From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 00:02:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19390106564A; Sun, 27 Feb 2011 00:02:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1A368FC0C; Sun, 27 Feb 2011 00:02:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1R02mAB007661; Sun, 27 Feb 2011 00:02:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R02meU007657; Sun, 27 Feb 2011 00:02:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102270002.p1R02meU007657@svn.freebsd.org> From: Dimitry Andric Date: Sun, 27 Feb 2011 00:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219076 - in head: contrib/llvm/lib/Support lib/clang/include/llvm/Config X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 00:02:49 -0000 Author: dim Date: Sun Feb 27 00:02:48 2011 New Revision: 219076 URL: http://svn.freebsd.org/changeset/base/219076 Log: Instead of defining LLVM_MULTITHREADED as 0 or 1, define or undefine it, and test appropriately. Otherwise it might erroneously pick up some pthread primitives, and fail to link. Modified: head/contrib/llvm/lib/Support/Atomic.cpp head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h Modified: head/contrib/llvm/lib/Support/Atomic.cpp ============================================================================== --- head/contrib/llvm/lib/Support/Atomic.cpp Sat Feb 26 23:30:32 2011 (r219075) +++ head/contrib/llvm/lib/Support/Atomic.cpp Sun Feb 27 00:02:48 2011 (r219076) @@ -22,7 +22,7 @@ using namespace llvm; #endif void sys::MemoryFence() { -#if LLVM_MULTITHREADED==0 +#if !defined(LLVM_MULTITHREADED) return; #else # if defined(__GNUC__) @@ -38,7 +38,7 @@ void sys::MemoryFence() { sys::cas_flag sys::CompareAndSwap(volatile sys::cas_flag* ptr, sys::cas_flag new_value, sys::cas_flag old_value) { -#if LLVM_MULTITHREADED==0 +#if !defined(LLVM_MULTITHREADED) sys::cas_flag result = *ptr; if (result == old_value) *ptr = new_value; @@ -53,7 +53,7 @@ sys::cas_flag sys::CompareAndSwap(volati } sys::cas_flag sys::AtomicIncrement(volatile sys::cas_flag* ptr) { -#if LLVM_MULTITHREADED==0 +#if !defined(LLVM_MULTITHREADED) ++(*ptr); return *ptr; #elif defined(__GNUC__) @@ -66,7 +66,7 @@ sys::cas_flag sys::AtomicIncrement(volat } sys::cas_flag sys::AtomicDecrement(volatile sys::cas_flag* ptr) { -#if LLVM_MULTITHREADED==0 +#if !defined(LLVM_MULTITHREADED) --(*ptr); return *ptr; #elif defined(__GNUC__) @@ -79,7 +79,7 @@ sys::cas_flag sys::AtomicDecrement(volat } sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) { -#if LLVM_MULTITHREADED==0 +#if !defined(LLVM_MULTITHREADED) *ptr += val; return *ptr; #elif defined(__GNUC__) Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Sat Feb 26 23:30:32 2011 (r219075) +++ head/lib/clang/include/llvm/Config/config.h Sun Feb 27 00:02:48 2011 (r219076) @@ -564,7 +564,7 @@ /* #undef LLVM_MANDIR */ /* Build multithreading support into LLVM */ -#define LLVM_MULTITHREADED 0 +/* #undef LLVM_MULTITHREADED */ /* LLVM architecture name for the native architecture, if available */ #define LLVM_NATIVE_ARCH X86 Modified: head/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- head/lib/clang/include/llvm/Config/llvm-config.h Sat Feb 26 23:30:32 2011 (r219075) +++ head/lib/clang/include/llvm/Config/llvm-config.h Sun Feb 27 00:02:48 2011 (r219076) @@ -49,7 +49,7 @@ /* #undef LLVM_MANDIR */ /* Build multithreading support into LLVM */ -#define LLVM_MULTITHREADED 0 +/* #undef LLVM_MULTITHREADED */ /* LLVM architecture name for the native architecture, if available */ #define LLVM_NATIVE_ARCH X86 From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 01:32:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92299106566C; Sun, 27 Feb 2011 01:32:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC5C8FC1B; Sun, 27 Feb 2011 01:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1R1WBpb016881; Sun, 27 Feb 2011 01:32:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R1WBrV016862; Sun, 27 Feb 2011 01:32:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102270132.p1R1WBrV016862@svn.freebsd.org> From: Dimitry Andric Date: Sun, 27 Feb 2011 01:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219077 - in head: contrib/llvm/include/llvm contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/include/llvm/MC contrib/llvm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 01:32:11 -0000 Author: dim Date: Sun Feb 27 01:32:10 2011 New Revision: 219077 URL: http://svn.freebsd.org/changeset/base/219077 Log: Update llvm/clang to trunk r126547. There are several bugfixes in this update, but the most important one is to ensure __start_ and __stop_ symbols for linker sets and kernel module metadata are always emitted in object files: http://llvm.org/bugs/show_bug.cgi?id=9292 Before this fix, if you compiled kernel modules with clang, they would not be properly processed by kldxref, and if they had any dependencies, the kernel would fail to load those. Another problem occurred when attempting to mount a tmpfs filesystem, which would result in 'operation not supported by device'. Added: head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h - copied unchanged from r219074, vendor/clang/dist/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h - copied unchanged from r219074, vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h head/contrib/llvm/tools/clang/lib/Analysis/CFGReachabilityAnalysis.cpp - copied unchanged from r219074, vendor/clang/dist/lib/Analysis/CFGReachabilityAnalysis.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp - copied unchanged from r219074, vendor/clang/dist/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp Deleted: head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrLeakChecker.cpp Modified: head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h head/contrib/llvm/include/llvm/ADT/ImmutableMap.h head/contrib/llvm/include/llvm/Analysis/DIBuilder.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/IntrinsicsXCore.td head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/Support/NoFolder.h head/contrib/llvm/include/llvm/Support/PathV1.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/lib/Analysis/DIBuilder.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/CodeGen/AllocationOrder.h head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/LowerSubregs.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/VirtRegRewriter.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDOperand.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDToken.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParserExtension.cpp head/contrib/llvm/lib/MC/MCSectionMachO.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp head/contrib/llvm/lib/Target/ARM/NEONMoveFix.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclGroup.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Frontend/AnalyzerOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DeclXML.def head/contrib/llvm/tools/clang/include/clang/Frontend/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h head/contrib/llvm/tools/clang/include/clang/Sema/AnalysisBasedWarnings.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h head/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/LocalCheckers.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerProvider.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerV2.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Checker.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/DocumentXML.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticsClient.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckerProvider.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExperimentalChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/InternalChecks.h head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.h head/contrib/llvm/utils/TableGen/ClangSACheckersEmitter.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/libclanganalysis/Makefile head/lib/clang/libclangstaticanalyzercheckers/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APInt.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/ADT/APInt.h Sun Feb 27 01:32:10 2011 (r219077) @@ -1193,6 +1193,12 @@ public: /// @brief Count the number of leading one bits. unsigned countLeadingOnes() const; + /// Computes the number of leading bits of this APInt that are equal to its + /// sign bit. + unsigned getNumSignBits() const { + return isNegative() ? countLeadingOnes() : countLeadingZeros(); + } + /// countTrailingZeros - This function is an APInt version of the /// countTrailingZeros_{32,64} functions in MathExtras.h. It counts /// the number of zeros from the least significant bit to the first set bit. Modified: head/contrib/llvm/include/llvm/ADT/ArrayRef.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ArrayRef.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/ADT/ArrayRef.h Sun Feb 27 01:32:10 2011 (r219077) @@ -64,7 +64,10 @@ namespace llvm { /*implicit*/ ArrayRef(const std::vector &Vec) : Data(Vec.empty() ? (T*)0 : &Vec[0]), Length(Vec.size()) {} - // TODO: C arrays. + /// Construct an ArrayRef from a C array. + template + /*implicit*/ ArrayRef(const T (&Arr)[N]) + : Data(Arr), Length(N) {} /// @} /// @name Simple Operations Modified: head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h Sun Feb 27 01:32:10 2011 (r219077) @@ -215,7 +215,7 @@ public: ImmutableIntervalMap add(ImmutableIntervalMap Old, key_type_ref K, data_type_ref D) { - TreeTy *T = F.add(Old.Root, std::make_pair(K, D)); + TreeTy *T = F.add(Old.Root, std::pair(K, D)); return ImmutableIntervalMap(F.getCanonicalTree(T)); } Modified: head/contrib/llvm/include/llvm/ADT/ImmutableMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ImmutableMap.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/ADT/ImmutableMap.h Sun Feb 27 01:32:10 2011 (r219077) @@ -108,7 +108,7 @@ public: ImmutableMap getEmptyMap() { return ImmutableMap(F.getEmptyTree()); } ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) { - TreeTy *T = F.add(Old.Root, std::make_pair(K,D)); + TreeTy *T = F.add(Old.Root, std::pair(K,D)); return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T); } Modified: head/contrib/llvm/include/llvm/Analysis/DIBuilder.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Feb 27 01:32:10 2011 (r219077) @@ -58,7 +58,7 @@ namespace llvm { const MDNode *getCU() { return TheCU; } enum ComplexAddrKind { OpPlus=1, OpDeref }; - /// CreateCompileUnit - A CompileUnit provides an anchor for all debugging + /// createCompileUnit - A CompileUnit provides an anchor for all debugging /// information generated during this instance of compilation. /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99 /// @param File File name @@ -72,67 +72,67 @@ namespace llvm { /// by a tool analyzing generated debugging information. /// @param RV This indicates runtime version for languages like /// Objective-C. - void CreateCompileUnit(unsigned Lang, StringRef File, StringRef Dir, + void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV); - /// CreateFile - Create a file descriptor to hold debugging information + /// createFile - Create a file descriptor to hold debugging information /// for a file. - DIFile CreateFile(StringRef Filename, StringRef Directory); + DIFile createFile(StringRef Filename, StringRef Directory); - /// CreateEnumerator - Create a single enumerator value. - DIEnumerator CreateEnumerator(StringRef Name, uint64_t Val); + /// createEnumerator - Create a single enumerator value. + DIEnumerator createEnumerator(StringRef Name, uint64_t Val); - /// CreateBasicType - Create debugging information entry for a basic + /// createBasicType - Create debugging information entry for a basic /// type. /// @param Name Type name. /// @param SizeInBits Size of the type. /// @param AlignInBits Type alignment. /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float. - DIType CreateBasicType(StringRef Name, uint64_t SizeInBits, + DIType createBasicType(StringRef Name, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding); - /// CreateQualifiedType - Create debugging information entry for a qualified + /// createQualifiedType - Create debugging information entry for a qualified /// type, e.g. 'const int'. /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type /// @param FromTy Base Type. - DIType CreateQualifiedType(unsigned Tag, DIType FromTy); + DIType createQualifiedType(unsigned Tag, DIType FromTy); - /// CreatePointerType - Create debugging information entry for a pointer. + /// createPointerType - Create debugging information entry for a pointer. /// @param PointeeTy Type pointed by this pointer. /// @param SizeInBits Size. /// @param AlignInBits Alignment. (optional) /// @param Name Pointer type name. (optional) - DIType CreatePointerType(DIType PointeeTy, uint64_t SizeInBits, + DIType createPointerType(DIType PointeeTy, uint64_t SizeInBits, uint64_t AlignInBits = 0, StringRef Name = StringRef()); - /// CreateReferenceType - Create debugging information entry for a c++ + /// createReferenceType - Create debugging information entry for a c++ /// style reference. - DIType CreateReferenceType(DIType RTy); + DIType createReferenceType(DIType RTy); - /// CreateTypedef - Create debugging information entry for a typedef. + /// createTypedef - Create debugging information entry for a typedef. /// @param Ty Original type. /// @param Name Typedef name. /// @param File File where this type is defined. /// @param LineNo Line number. - DIType CreateTypedef(DIType Ty, StringRef Name, DIFile File, + DIType createTypedef(DIType Ty, StringRef Name, DIFile File, unsigned LineNo); - /// CreateFriend - Create debugging information entry for a 'friend'. - DIType CreateFriend(DIType Ty, DIType FriendTy); + /// createFriend - Create debugging information entry for a 'friend'. + DIType createFriend(DIType Ty, DIType FriendTy); - /// CreateInheritance - Create debugging information entry to establish + /// createInheritance - Create debugging information entry to establish /// inheritance relationship between two types. /// @param Ty Original type. /// @param BaseTy Base type. Ty is inherits from base. /// @param BaseOffset Base offset. /// @param Flags Flags to describe inheritance attribute, /// e.g. private - DIType CreateInheritance(DIType Ty, DIType BaseTy, uint64_t BaseOffset, + DIType createInheritance(DIType Ty, DIType BaseTy, uint64_t BaseOffset, unsigned Flags); - /// CreateMemberType - Create debugging information entry for a member. + /// createMemberType - Create debugging information entry for a member. /// @param Name Member name. /// @param File File where this member is defined. /// @param LineNo Line number. @@ -141,12 +141,12 @@ namespace llvm { /// @param OffsetInBits Member offset. /// @param Flags Flags to encode member attribute, e.g. private /// @param Ty Parent type. - DIType CreateMemberType(StringRef Name, DIFile File, + DIType createMemberType(StringRef Name, DIFile File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType Ty); - /// CreateClassType - Create debugging information entry for a class. + /// createClassType - Create debugging information entry for a class. /// @param Scope Scope in which this class is defined. /// @param Name class name. /// @param File File where this member is defined. @@ -161,14 +161,14 @@ namespace llvm { /// DW_AT_containing_type. See DWARF documentation /// for more info. /// @param TemplateParms Template type parameters. - DIType CreateClassType(DIDescriptor Scope, StringRef Name, DIFile File, + DIType createClassType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType DerivedFrom, DIArray Elements, MDNode *VTableHolder = 0, MDNode *TemplateParms = 0); - /// CreateStructType - Create debugging information entry for a struct. + /// createStructType - Create debugging information entry for a struct. /// @param Scope Scope in which this struct is defined. /// @param Name Struct name. /// @param File File where this member is defined. @@ -178,12 +178,12 @@ namespace llvm { /// @param Flags Flags to encode member attribute, e.g. private /// @param Elements Struct elements. /// @param RunTimeLang Optional parameter, Objective-C runtime version. - DIType CreateStructType(DIDescriptor Scope, StringRef Name, DIFile File, + DIType createStructType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIArray Elements, unsigned RunTimeLang = 0); - /// CreateUnionType - Create debugging information entry for an union. + /// createUnionType - Create debugging information entry for an union. /// @param Scope Scope in which this union is defined. /// @param Name Union name. /// @param File File where this member is defined. @@ -193,12 +193,12 @@ namespace llvm { /// @param Flags Flags to encode member attribute, e.g. private /// @param Elements Union elements. /// @param RunTimeLang Optional parameter, Objective-C runtime version. - DIType CreateUnionType(DIDescriptor Scope, StringRef Name, DIFile File, + DIType createUnionType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIArray Elements, unsigned RunTimeLang = 0); - /// CreateTemplateTypeParameter - Create debugging information for template + /// createTemplateTypeParameter - Create debugging information for template /// type parameter. /// @param Scope Scope in which this type is defined. /// @param Name Type parameter name. @@ -207,11 +207,11 @@ namespace llvm { /// @param LineNo Line number. /// @param ColumnNo Column Number. DITemplateTypeParameter - CreateTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty, + createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty, MDNode *File = 0, unsigned LineNo = 0, unsigned ColumnNo = 0); - /// CreateTemplateValueParameter - Create debugging information for template + /// createTemplateValueParameter - Create debugging information for template /// value parameter. /// @param Scope Scope in which this type is defined. /// @param Name Value parameter name. @@ -221,28 +221,28 @@ namespace llvm { /// @param LineNo Line number. /// @param ColumnNo Column Number. DITemplateValueParameter - CreateTemplateValueParameter(DIDescriptor Scope, StringRef Name, DIType Ty, + createTemplateValueParameter(DIDescriptor Scope, StringRef Name, DIType Ty, uint64_t Value, MDNode *File = 0, unsigned LineNo = 0, unsigned ColumnNo = 0); - /// CreateArrayType - Create debugging information entry for an array. + /// createArrayType - Create debugging information entry for an array. /// @param Size Array size. /// @param AlignInBits Alignment. /// @param Ty Element type. /// @param Subscripts Subscripts. - DIType CreateArrayType(uint64_t Size, uint64_t AlignInBits, + DIType createArrayType(uint64_t Size, uint64_t AlignInBits, DIType Ty, DIArray Subscripts); - /// CreateVectorType - Create debugging information entry for a vector type. + /// createVectorType - Create debugging information entry for a vector type. /// @param Size Array size. /// @param AlignInBits Alignment. /// @param Ty Element type. /// @param Subscripts Subscripts. - DIType CreateVectorType(uint64_t Size, uint64_t AlignInBits, + DIType createVectorType(uint64_t Size, uint64_t AlignInBits, DIType Ty, DIArray Subscripts); - /// CreateEnumerationType - Create debugging information entry for an + /// createEnumerationType - Create debugging information entry for an /// enumeration. /// @param Scope Scope in which this enumeration is defined. /// @param Name Union name. @@ -251,40 +251,40 @@ namespace llvm { /// @param SizeInBits Member size. /// @param AlignInBits Member alignment. /// @param Elements Enumeration elements. - DIType CreateEnumerationType(DIDescriptor Scope, StringRef Name, + DIType createEnumerationType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements); - /// CreateSubroutineType - Create subroutine type. + /// createSubroutineType - Create subroutine type. /// @param File File in which this subroutine is defined. /// @param ParamterTypes An array of subroutine parameter types. This /// includes return type at 0th index. - DIType CreateSubroutineType(DIFile File, DIArray ParameterTypes); + DIType createSubroutineType(DIFile File, DIArray ParameterTypes); - /// CreateArtificialType - Create a new DIType with "artificial" flag set. - DIType CreateArtificialType(DIType Ty); + /// createArtificialType - Create a new DIType with "artificial" flag set. + DIType createArtificialType(DIType Ty); - /// CreateTemporaryType - Create a temporary forward-declared type. - DIType CreateTemporaryType(); - DIType CreateTemporaryType(DIFile F); + /// createTemporaryType - Create a temporary forward-declared type. + DIType createTemporaryType(); + DIType createTemporaryType(DIFile F); - /// RetainType - Retain DIType in a module even if it is not referenced + /// retainType - Retain DIType in a module even if it is not referenced /// through debug info anchors. - void RetainType(DIType T); + void retainType(DIType T); - /// CreateUnspecifiedParameter - Create unspeicified type descriptor + /// createUnspecifiedParameter - Create unspeicified type descriptor /// for a subroutine type. - DIDescriptor CreateUnspecifiedParameter(); + DIDescriptor createUnspecifiedParameter(); - /// GetOrCreateArray - Get a DIArray, create one if required. - DIArray GetOrCreateArray(Value *const *Elements, unsigned NumElements); + /// getOrCreateArray - Get a DIArray, create one if required. + DIArray getOrCreateArray(Value *const *Elements, unsigned NumElements); - /// GetOrCreateSubrange - Create a descriptor for a value range. This + /// getOrCreateSubrange - Create a descriptor for a value range. This /// implicitly uniques the values returned. - DISubrange GetOrCreateSubrange(int64_t Lo, int64_t Hi); + DISubrange getOrCreateSubrange(int64_t Lo, int64_t Hi); - /// CreateGlobalVariable - Create a new descriptor for the specified global. + /// createGlobalVariable - Create a new descriptor for the specified global. /// @param Name Name of the variable. /// @param File File where this variable is defined. /// @param LineNo Line number. @@ -293,11 +293,11 @@ namespace llvm { /// externally visible or not. /// @param Val llvm::Value of the variable. DIGlobalVariable - CreateGlobalVariable(StringRef Name, DIFile File, unsigned LineNo, + createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit, llvm::Value *Val); - /// CreateStaticVariable - Create a new descriptor for the specified + /// createStaticVariable - Create a new descriptor for the specified /// variable. /// @param Conext Variable scope. /// @param Name Name of the variable. @@ -309,12 +309,12 @@ namespace llvm { /// externally visible or not. /// @param Val llvm::Value of the variable. DIGlobalVariable - CreateStaticVariable(DIDescriptor Context, StringRef Name, + createStaticVariable(DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit, llvm::Value *Val); - /// CreateLocalVariable - Create a new descriptor for the specified + /// createLocalVariable - Create a new descriptor for the specified /// local variable. /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or /// DW_TAG_arg_variable. @@ -326,14 +326,14 @@ namespace llvm { /// @param AlwaysPreserve Boolean. Set to true if debug info for this /// variable should be preserved in optimized build. /// @param Flags Flags, e.g. artificial variable. - DIVariable CreateLocalVariable(unsigned Tag, DIDescriptor Scope, + DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo, DIType Ty, bool AlwaysPreserve = false, unsigned Flags = 0); - /// CreateComplexVariable - Create a new descriptor for the specified + /// createComplexVariable - Create a new descriptor for the specified /// variable which has a complex address expression for its address. /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or /// DW_TAG_arg_variable. @@ -344,12 +344,12 @@ namespace llvm { /// @param Ty Variable Type /// @param Addr A pointer to a vector of complex address operations. /// @param NumAddr Num of address operations in the vector. - DIVariable CreateComplexVariable(unsigned Tag, DIDescriptor Scope, + DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope, StringRef Name, DIFile F, unsigned LineNo, DIType Ty, Value *const *Addr, unsigned NumAddr); - /// CreateFunction - Create a new descriptor for the specified subprogram. + /// createFunction - Create a new descriptor for the specified subprogram. /// See comments in DISubprogram for descriptions of these fields. /// @param Scope Function scope. /// @param Name Function name. @@ -363,7 +363,7 @@ namespace llvm { /// This flags are used to emit dwarf attributes. /// @param isOptimized True if optimization is ON. /// @param Fn llvm::Function pointer. - DISubprogram CreateFunction(DIDescriptor Scope, StringRef Name, + DISubprogram createFunction(DIDescriptor Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit, @@ -372,7 +372,7 @@ namespace llvm { bool isOptimized = false, Function *Fn = 0); - /// CreateMethod - Create a new descriptor for the specified C++ method. + /// createMethod - Create a new descriptor for the specified C++ method. /// See comments in DISubprogram for descriptions of these fields. /// @param Scope Function scope. /// @param Name Function name. @@ -390,7 +390,7 @@ namespace llvm { /// This flags are used to emit dwarf attributes. /// @param isOptimized True if optimization is ON. /// @param Fn llvm::Function pointer. - DISubprogram CreateMethod(DIDescriptor Scope, StringRef Name, + DISubprogram createMethod(DIDescriptor Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DIType Ty, bool isLocalToUnit, @@ -401,55 +401,55 @@ namespace llvm { bool isOptimized = false, Function *Fn = 0); - /// CreateNameSpace - This creates new descriptor for a namespace + /// createNameSpace - This creates new descriptor for a namespace /// with the specified parent scope. /// @param Scope Namespace scope /// @param Name Name of this namespace /// @param File Source file /// @param LineNo Line number - DINameSpace CreateNameSpace(DIDescriptor Scope, StringRef Name, + DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo); - /// CreateLexicalBlock - This creates a descriptor for a lexical block + /// createLexicalBlock - This creates a descriptor for a lexical block /// with the specified parent context. /// @param Scope Parent lexical scope. /// @param File Source file /// @param Line Line number /// @param Col Column number - DILexicalBlock CreateLexicalBlock(DIDescriptor Scope, DIFile File, + DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File, unsigned Line, unsigned Col); - /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. + /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call. /// @param Storage llvm::Value of the variable /// @param VarInfo Variable's debug info descriptor. /// @param InsertAtEnd Location for the new intrinsic. - Instruction *InsertDeclare(llvm::Value *Storage, DIVariable VarInfo, + Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo, BasicBlock *InsertAtEnd); - /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. + /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call. /// @param Storage llvm::Value of the variable /// @param VarInfo Variable's debug info descriptor. /// @param InsertBefore Location for the new intrinsic. - Instruction *InsertDeclare(llvm::Value *Storage, DIVariable VarInfo, + Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo, Instruction *InsertBefore); - /// InsertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call. + /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call. /// @param Val llvm::Value of the variable /// @param Offset Offset /// @param VarInfo Variable's debug info descriptor. /// @param InsertAtEnd Location for the new intrinsic. - Instruction *InsertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, + Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, DIVariable VarInfo, BasicBlock *InsertAtEnd); - /// InsertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call. + /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call. /// @param Val llvm::Value of the variable /// @param Offset Offset /// @param VarInfo Variable's debug info descriptor. /// @param InsertBefore Location for the new intrinsic. - Instruction *InsertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, + Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, DIVariable VarInfo, Instruction *InsertBefore); Modified: head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h Sun Feb 27 01:32:10 2011 (r219077) @@ -445,7 +445,8 @@ namespace llvm { /// EmitVisibility - This emits visibility information about symbol, if /// this is suported by the target. - void EmitVisibility(MCSymbol *Sym, unsigned Visibility) const; + void EmitVisibility(MCSymbol *Sym, unsigned Visibility, + bool IsDefinition = true) const; void EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const; Modified: head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Sun Feb 27 01:32:10 2011 (r219077) @@ -101,13 +101,16 @@ public: #endif struct LiveOutInfo { - unsigned NumSignBits; + unsigned NumSignBits : 31; + bool IsValid : 1; APInt KnownOne, KnownZero; - LiveOutInfo() : NumSignBits(0), KnownOne(1, 0), KnownZero(1, 0) {} + LiveOutInfo() : NumSignBits(0), IsValid(true), KnownOne(1, 0), + KnownZero(1, 0) {} }; - - /// LiveOutRegInfo - Information about live out vregs. - IndexedMap LiveOutRegInfo; + + /// VisitedBBs - The set of basic blocks visited thus far by instruction + /// selection. + DenseSet VisitedBBs; /// PHINodesToUpdate - A list of phi instructions whose operand list will /// be updated after processing the current basic block. @@ -143,12 +146,62 @@ public: return R = CreateRegs(V->getType()); } + /// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the + /// register is a PHI destination and the PHI's LiveOutInfo is not valid. + const LiveOutInfo *GetLiveOutRegInfo(unsigned Reg) { + if (!LiveOutRegInfo.inBounds(Reg)) + return NULL; + + const LiveOutInfo *LOI = &LiveOutRegInfo[Reg]; + if (!LOI->IsValid) + return NULL; + + return LOI; + } + + /// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the + /// register is a PHI destination and the PHI's LiveOutInfo is not valid. If + /// the register's LiveOutInfo is for a smaller bit width, it is extended to + /// the larger bit width by zero extension. The bit width must be no smaller + /// than the LiveOutInfo's existing bit width. + const LiveOutInfo *GetLiveOutRegInfo(unsigned Reg, unsigned BitWidth); + + /// AddLiveOutRegInfo - Adds LiveOutInfo for a register. + void AddLiveOutRegInfo(unsigned Reg, unsigned NumSignBits, + const APInt &KnownZero, const APInt &KnownOne) { + // Only install this information if it tells us something. + if (NumSignBits == 1 && KnownZero == 0 && KnownOne == 0) + return; + + LiveOutRegInfo.grow(Reg); + LiveOutInfo &LOI = LiveOutRegInfo[Reg]; + LOI.NumSignBits = NumSignBits; + LOI.KnownOne = KnownOne; + LOI.KnownZero = KnownZero; + } + + /// ComputePHILiveOutRegInfo - Compute LiveOutInfo for a PHI's destination + /// register based on the LiveOutInfo of its operands. + void ComputePHILiveOutRegInfo(const PHINode*); + + /// InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be + /// called when a block is visited before all of its predecessors. + void InvalidatePHILiveOutRegInfo(const PHINode *PN) { + unsigned Reg = ValueMap[PN]; + LiveOutRegInfo.grow(Reg); + LiveOutRegInfo[Reg].IsValid = false; + } + /// setByValArgumentFrameIndex - Record frame index for the byval /// argument. void setByValArgumentFrameIndex(const Argument *A, int FI); /// getByValArgumentFrameIndex - Get frame index for the byval argument. int getByValArgumentFrameIndex(const Argument *A); + +private: + /// LiveOutRegInfo - Information about live out vregs. + IndexedMap LiveOutRegInfo; }; /// AddCatchInfo - Extract the personality and type infos from an eh.selector Modified: head/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/CodeGen/MachineConstantPool.h Sun Feb 27 01:32:10 2011 (r219077) @@ -16,6 +16,7 @@ #ifndef LLVM_CODEGEN_MACHINECONSTANTPOOL_H #define LLVM_CODEGEN_MACHINECONSTANTPOOL_H +#include "llvm/ADT/DenseSet.h" #include #include #include @@ -130,6 +131,8 @@ class MachineConstantPool { const TargetData *TD; ///< The machine's TargetData. unsigned PoolAlignment; ///< The alignment for the pool. std::vector Constants; ///< The pool of constants. + /// MachineConstantPoolValues that use an existing MachineConstantPoolEntry. + DenseSet MachineCPVsSharingEntries; public: /// @brief The only constructor. explicit MachineConstantPool(const TargetData *td) Modified: head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h Sun Feb 27 01:32:10 2011 (r219077) @@ -281,7 +281,7 @@ public: /// addLiveIn - Add the specified physical register as a live-in value and /// create a corresponding virtual register for it. - unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC, DebugLoc DL); + unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC); //===--------------------------------------------------------------------===// // BasicBlock accessor functions. Modified: head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h Sun Feb 27 01:32:10 2011 (r219077) @@ -17,8 +17,6 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/IndexedMap.h" -#include "llvm/ADT/DenseMap.h" -#include "llvm/Support/DebugLoc.h" #include namespace llvm { @@ -66,10 +64,7 @@ class MachineRegisterInfo { /// stored in the second element. std::vector > LiveIns; std::vector LiveOuts; - - /// LiveInLocs - Keep track of location livein registers. - DenseMap LiveInLocs; - + MachineRegisterInfo(const MachineRegisterInfo&); // DO NOT IMPLEMENT void operator=(const MachineRegisterInfo&); // DO NOT IMPLEMENT public: @@ -276,12 +271,7 @@ public: LiveIns.push_back(std::make_pair(Reg, vreg)); } void addLiveOut(unsigned Reg) { LiveOuts.push_back(Reg); } - - /// addLiveInLoc - Keep track of location info for live in reg. - void addLiveInLoc(unsigned VReg, DebugLoc DL) { - LiveInLocs[VReg] = DL; - } - + // Iteration support for live in/out sets. These sets are kept in sorted // order by their register number. typedef std::vector >::const_iterator Modified: head/contrib/llvm/include/llvm/IntrinsicsXCore.td ============================================================================== --- head/contrib/llvm/include/llvm/IntrinsicsXCore.td Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/IntrinsicsXCore.td Sun Feb 27 01:32:10 2011 (r219077) @@ -33,4 +33,23 @@ let TargetPrefix = "xcore" in { // All [NoCapture<0>]>; def int_xcore_setc : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], [NoCapture<0>]>; + def int_xcore_inshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], + [NoCapture<0>]>; + def int_xcore_outshr : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty, llvm_i32_ty], + [NoCapture<0>]>; + def int_xcore_setpt : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], + [NoCapture<0>]>; + def int_xcore_getts : Intrinsic<[llvm_i32_ty],[llvm_anyptr_ty], + [NoCapture<0>]>; + def int_xcore_syncr : Intrinsic<[],[llvm_anyptr_ty], + [NoCapture<0>]>; + def int_xcore_settw : Intrinsic<[],[llvm_anyptr_ty, llvm_i32_ty], + [NoCapture<0>]>; + def int_xcore_setv : Intrinsic<[],[llvm_anyptr_ty, llvm_ptr_ty], + [NoCapture<0>]>; + def int_xcore_eeu : Intrinsic<[],[llvm_anyptr_ty], [NoCapture<0>]>; + + // Intrinsics for events. + def int_xcore_waitevent : Intrinsic<[llvm_ptr_ty],[], [IntrReadMem]>; + def int_xcore_clre : Intrinsic<[],[],[]>; } Modified: head/contrib/llvm/include/llvm/MC/MCAsmInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/MC/MCAsmInfo.h Sun Feb 27 01:32:10 2011 (r219077) @@ -246,6 +246,11 @@ namespace llvm { /// declare a symbol as having hidden visibility. MCSymbolAttr HiddenVisibilityAttr; // Defaults to MCSA_Hidden. + /// HiddenDeclarationVisibilityAttr - This attribute, if not MCSA_Invalid, + /// is used to declare an undefined symbol as having hidden visibility. + MCSymbolAttr HiddenDeclarationVisibilityAttr; // Defaults to MCSA_Hidden. + + /// ProtectedVisibilityAttr - This attribute, if not MCSA_Invalid, is used /// to declare a symbol as having protected visibility. MCSymbolAttr ProtectedVisibilityAttr; // Defaults to MCSA_Protected @@ -425,6 +430,9 @@ namespace llvm { const char *getLinkOnceDirective() const { return LinkOnceDirective; } MCSymbolAttr getHiddenVisibilityAttr() const { return HiddenVisibilityAttr;} + MCSymbolAttr getHiddenDeclarationVisibilityAttr() const { + return HiddenDeclarationVisibilityAttr; + } MCSymbolAttr getProtectedVisibilityAttr() const { return ProtectedVisibilityAttr; } Modified: head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h Sun Feb 27 01:32:10 2011 (r219077) @@ -38,6 +38,8 @@ protected: return (Obj->*Handler)(Directive, DirectiveLoc); } + bool BracketExpressionsSupported; + public: virtual ~MCAsmParserExtension(); @@ -68,6 +70,8 @@ public: const AsmToken &getTok() { return getParser().getTok(); } + bool HasBracketExpressions() const { return BracketExpressionsSupported; } + /// @} }; Modified: head/contrib/llvm/include/llvm/MC/MCStreamer.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCStreamer.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/MC/MCStreamer.h Sun Feb 27 01:32:10 2011 (r219077) @@ -57,13 +57,10 @@ namespace llvm { MCDwarfFrameInfo *getCurrentFrameInfo(); void EnsureValidFrame(); - /// CurSectionStack - This is stack of CurSection values saved by - /// PushSection. - SmallVector CurSectionStack; - - /// PrevSectionStack - This is stack of PrevSection values saved by - /// PushSection. - SmallVector PrevSectionStack; + /// SectionStack - This is stack of current and previous section + /// values saved by PushSection. + SmallVector, 4> SectionStack; protected: MCStreamer(MCContext &Ctx); @@ -117,16 +114,16 @@ namespace llvm { /// getCurrentSection - Return the current section that the streamer is /// emitting code to. const MCSection *getCurrentSection() const { - if (!CurSectionStack.empty()) - return CurSectionStack.back(); + if (!SectionStack.empty()) + return SectionStack.back().first; return NULL; } /// getPreviousSection - Return the previous section that the streamer is /// emitting code to. const MCSection *getPreviousSection() const { - if (!PrevSectionStack.empty()) - return PrevSectionStack.back(); + if (!SectionStack.empty()) + return SectionStack.back().second; return NULL; } @@ -139,8 +136,8 @@ namespace llvm { /// pushSection - Save the current and previous section on the /// section stack. void PushSection() { - PrevSectionStack.push_back(getPreviousSection()); - CurSectionStack.push_back(getCurrentSection()); + SectionStack.push_back(std::make_pair(getCurrentSection(), + getPreviousSection())); } /// popSection - Restore the current and previous section from @@ -148,12 +145,10 @@ namespace llvm { /// /// Returns false if the stack was empty. bool PopSection() { - if (PrevSectionStack.size() <= 1) + if (SectionStack.size() <= 1) return false; - assert(CurSectionStack.size() > 1); - PrevSectionStack.pop_back(); - const MCSection *oldSection = CurSectionStack.pop_back_val(); - const MCSection *curSection = CurSectionStack.back(); + const MCSection *oldSection = SectionStack.pop_back_val().first; + const MCSection *curSection = SectionStack.back().first; if (oldSection != curSection) ChangeSection(curSection); @@ -166,10 +161,10 @@ namespace llvm { /// This corresponds to assembler directives like .section, .text, etc. void SwitchSection(const MCSection *Section) { assert(Section && "Cannot switch to a null section!"); - const MCSection *curSection = CurSectionStack.back(); - PrevSectionStack.back() = curSection; + const MCSection *curSection = SectionStack.back().first; + SectionStack.back().second = curSection; if (Section != curSection) { - CurSectionStack.back() = Section; + SectionStack.back().first = Section; ChangeSection(Section); } } Modified: head/contrib/llvm/include/llvm/Support/NoFolder.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/NoFolder.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/Support/NoFolder.h Sun Feb 27 01:32:10 2011 (r219077) @@ -38,8 +38,12 @@ public: // Binary Operators //===--------------------------------------------------------------------===// - Instruction *CreateAdd(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateAdd(LHS, RHS); + Instruction *CreateAdd(Constant *LHS, Constant *RHS, + bool HasNUW = false, bool HasNSW = false) const { + BinaryOperator *BO = BinaryOperator::CreateAdd(LHS, RHS); + if (HasNUW) BO->setHasNoUnsignedWrap(); + if (HasNSW) BO->setHasNoSignedWrap(); + return BO; } Instruction *CreateNSWAdd(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateNSWAdd(LHS, RHS); @@ -50,8 +54,12 @@ public: Instruction *CreateFAdd(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateFAdd(LHS, RHS); } - Instruction *CreateSub(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateSub(LHS, RHS); + Instruction *CreateSub(Constant *LHS, Constant *RHS, + bool HasNUW = false, bool HasNSW = false) const { + BinaryOperator *BO = BinaryOperator::CreateSub(LHS, RHS); + if (HasNUW) BO->setHasNoUnsignedWrap(); + if (HasNSW) BO->setHasNoSignedWrap(); + return BO; } Instruction *CreateNSWSub(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateNSWSub(LHS, RHS); @@ -62,8 +70,12 @@ public: Instruction *CreateFSub(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateFSub(LHS, RHS); } - Instruction *CreateMul(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateMul(LHS, RHS); + Instruction *CreateMul(Constant *LHS, Constant *RHS, + bool HasNUW = false, bool HasNSW = false) const { + BinaryOperator *BO = BinaryOperator::CreateMul(LHS, RHS); + if (HasNUW) BO->setHasNoUnsignedWrap(); + if (HasNSW) BO->setHasNoSignedWrap(); + return BO; } Instruction *CreateNSWMul(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateNSWMul(LHS, RHS); @@ -74,14 +86,20 @@ public: Instruction *CreateFMul(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateFMul(LHS, RHS); } - Instruction *CreateUDiv(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateUDiv(LHS, RHS); + Instruction *CreateUDiv(Constant *LHS, Constant *RHS, + bool isExact = false) const { + if (!isExact) + return BinaryOperator::CreateUDiv(LHS, RHS); + return BinaryOperator::CreateExactUDiv(LHS, RHS); } Instruction *CreateExactUDiv(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateExactUDiv(LHS, RHS); } - Instruction *CreateSDiv(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateSDiv(LHS, RHS); + Instruction *CreateSDiv(Constant *LHS, Constant *RHS, + bool isExact = false) const { + if (!isExact) + return BinaryOperator::CreateSDiv(LHS, RHS); + return BinaryOperator::CreateExactSDiv(LHS, RHS); } Instruction *CreateExactSDiv(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateExactSDiv(LHS, RHS); @@ -98,14 +116,24 @@ public: Instruction *CreateFRem(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateFRem(LHS, RHS); } - Instruction *CreateShl(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateShl(LHS, RHS); - } - Instruction *CreateLShr(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateLShr(LHS, RHS); - } - Instruction *CreateAShr(Constant *LHS, Constant *RHS) const { - return BinaryOperator::CreateAShr(LHS, RHS); + Instruction *CreateShl(Constant *LHS, Constant *RHS, bool HasNUW = false, + bool HasNSW = false) const { + BinaryOperator *BO = BinaryOperator::CreateShl(LHS, RHS); + if (HasNUW) BO->setHasNoUnsignedWrap(); + if (HasNSW) BO->setHasNoSignedWrap(); + return BO; + } + Instruction *CreateLShr(Constant *LHS, Constant *RHS, + bool isExact = false) const { + if (!isExact) + return BinaryOperator::CreateLShr(LHS, RHS); + return BinaryOperator::CreateExactLShr(LHS, RHS); + } + Instruction *CreateAShr(Constant *LHS, Constant *RHS, + bool isExact = false) const { + if (!isExact) + return BinaryOperator::CreateAShr(LHS, RHS); + return BinaryOperator::CreateExactAShr(LHS, RHS); } Instruction *CreateAnd(Constant *LHS, Constant *RHS) const { return BinaryOperator::CreateAnd(LHS, RHS); @@ -126,8 +154,12 @@ public: // Unary Operators //===--------------------------------------------------------------------===// - Instruction *CreateNeg(Constant *C) const { - return BinaryOperator::CreateNeg(C); + Instruction *CreateNeg(Constant *C, + bool HasNUW = false, bool HasNSW = false) const { + BinaryOperator *BO = BinaryOperator::CreateNeg(C); + if (HasNUW) BO->setHasNoUnsignedWrap(); + if (HasNSW) BO->setHasNoSignedWrap(); + return BO; } Instruction *CreateNSWNeg(Constant *C) const { return BinaryOperator::CreateNSWNeg(C); Modified: head/contrib/llvm/include/llvm/Support/PathV1.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/PathV1.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/Support/PathV1.h Sun Feb 27 01:32:10 2011 (r219077) @@ -312,9 +312,9 @@ namespace sys { /// This function determines if the path name is absolute, as opposed to /// relative. /// @brief Determine if the path is absolute. -//FIXME: LLVM_ATTRIBUTE_DEPRECATED( - bool isAbsolute() const; -//FIXME: LLVMV_PATH_DEPRECATED_MSG(path::is_absolute)); + LLVM_ATTRIBUTE_DEPRECATED( + bool isAbsolute() const, + LLVM_PATH_DEPRECATED_MSG(path::is_absolute)); /// This function determines if the path name is absolute, as opposed to /// relative. Modified: head/contrib/llvm/include/llvm/Target/TargetLowering.h ============================================================================== --- head/contrib/llvm/include/llvm/Target/TargetLowering.h Sun Feb 27 00:02:48 2011 (r219076) +++ head/contrib/llvm/include/llvm/Target/TargetLowering.h Sun Feb 27 01:32:10 2011 (r219077) @@ -111,7 +111,7 @@ public: bool isBigEndian() const { return !IsLittleEndian; } bool isLittleEndian() const { return IsLittleEndian; } MVT getPointerTy() const { return PointerTy; } - MVT getShiftAmountTy() const { return ShiftAmountTy; } + virtual MVT getShiftAmountTy(EVT LHSTy) const; /// isSelectExpensive - Return true if the select operation is expensive for /// this target. @@ -210,7 +210,7 @@ public: /// ValueTypeActions - For each value type, keep a LegalizeAction enum /// that indicates how instruction selection should deal with the type. uint8_t ValueTypeActions[MVT::LAST_VALUETYPE]; - + LegalizeAction getExtendedTypeAction(EVT VT) const { // Handle non-vector integers. if (!VT.isVector()) { @@ -221,42 +221,56 @@ public: return Promote; return Expand; } - - // If this is a type smaller than a legal vector type, promote to that - // type, e.g. <2 x float> -> <4 x float>. - if (VT.getVectorElementType().isSimple() && - VT.getVectorNumElements() != 1) { - MVT EltType = VT.getVectorElementType().getSimpleVT(); - unsigned NumElts = VT.getVectorNumElements(); - while (1) { - // Round up to the nearest power of 2. - NumElts = (unsigned)NextPowerOf2(NumElts); - - MVT LargerVector = MVT::getVectorVT(EltType, NumElts); - if (LargerVector == MVT()) break; - - // If this the larger type is legal, promote to it. - if (getTypeAction(LargerVector) == Legal) return Promote; - } + + // Vectors with only one element are always scalarized. + if (VT.getVectorNumElements() == 1) + return Expand; + + // Vectors with a number of elements that is not a power of two are always + // widened, for example <3 x float> -> <4 x float>. + if (!VT.isPow2VectorType()) + return Promote; + + // Vectors with a crazy element type are always expanded, for example + // <4 x i2> is expanded into two vectors of type <2 x i2>. + if (!VT.getVectorElementType().isSimple()) + return Expand; + + // If this type is smaller than a legal vector type then widen it, + // otherwise expand it. E.g. <2 x float> -> <4 x float>. + MVT EltType = VT.getVectorElementType().getSimpleVT(); + unsigned NumElts = VT.getVectorNumElements(); + while (1) { + // Round up to the next power of 2. + NumElts = (unsigned)NextPowerOf2(NumElts); + + // If there is no simple vector type with this many elements then there + // cannot be a larger legal vector type. Note that this assumes that + // there are no skipped intermediate vector types in the simple types. + MVT LargerVector = MVT::getVectorVT(EltType, NumElts); + if (LargerVector == MVT()) + return Expand; + + // If this type is legal then widen the vector. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 01:45:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04EFF106564A; Sun, 27 Feb 2011 01:45:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEEE48FC12; Sun, 27 Feb 2011 01:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1R1jaMU018835; Sun, 27 Feb 2011 01:45:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R1jaC0018832; Sun, 27 Feb 2011 01:45:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102270145.p1R1jaC0018832@svn.freebsd.org> From: Dimitry Andric Date: Sun, 27 Feb 2011 01:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219078 - in head/usr.bin/clang: clang tblgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 01:45:37 -0000 Author: dim Date: Sun Feb 27 01:45:36 2011 New Revision: 219078 URL: http://svn.freebsd.org/changeset/base/219078 Log: Regenerate clang and tblgen manpages; the clang manpage has some minor updates. Modified: head/usr.bin/clang/clang/clang.1 head/usr.bin/clang/tblgen/tblgen.1 Modified: head/usr.bin/clang/clang/clang.1 ============================================================================== --- head/usr.bin/clang/clang/clang.1 Sun Feb 27 01:32:10 2011 (r219077) +++ head/usr.bin/clang/clang/clang.1 Sun Feb 27 01:45:36 2011 (r219078) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== @@ -125,7 +125,7 @@ .\" ======================================================================== .\" .IX Title "CLANG 1" -.TH CLANG 1 "2010-09-27" "Clang 2.8" "Clang Tools Documentation" +.TH CLANG 1 "2010-10-25" "clang 2.9" "Clang Tools Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -197,7 +197,7 @@ stages. In addition to compilation of c \&\fBClang Static Analyzer\fR .PP The Clang Static Analyzer is a tool that scans source code to try to find bugs -though code analysis. This tool uses many parts of Clang and is built into the +through code analysis. This tool uses many parts of Clang and is built into the same driver. .SH "OPTIONS" .IX Header "OPTIONS" @@ -264,6 +264,9 @@ Enable support for Pascal-style strings .IP "\fB\-fms\-extensions\fR" 4 .IX Item "-fms-extensions" Enable support for Microsoft extensions. +.IP "\fB\-fmsc\-version=\fR" 4 +.IX Item "-fmsc-version=" +Set _MSC_VER. Defaults to 1300 on Windows. Not set otherwise. .IP "\fB\-fborland\-extensions\fR" 4 .IX Item "-fborland-extensions" Enable support for Borland extensions. Modified: head/usr.bin/clang/tblgen/tblgen.1 ============================================================================== --- head/usr.bin/clang/tblgen/tblgen.1 Sun Feb 27 01:32:10 2011 (r219077) +++ head/usr.bin/clang/tblgen/tblgen.1 Sun Feb 27 01:45:36 2011 (r219078) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== @@ -125,7 +125,7 @@ .\" ======================================================================== .\" .IX Title "TBLGEN 1" -.TH TBLGEN 1 "2010-06-19" "LLVM 2.8" "LLVM Command Guide" +.TH TBLGEN 1 "2010-06-19" "LLVM 2.9" "LLVM Command Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 02:06:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A66DC1065674; Sun, 27 Feb 2011 02:06:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1028FC15; Sun, 27 Feb 2011 02:06:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1R269mK021436; Sun, 27 Feb 2011 02:06:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R269VO021432; Sun, 27 Feb 2011 02:06:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201102270206.p1R269VO021432@svn.freebsd.org> From: Dimitry Andric Date: Sun, 27 Feb 2011 02:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219079 - in head/sys/boot/i386: gptboot gptzfsboot zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 02:06:09 -0000 Author: dim Date: Sun Feb 27 02:06:09 2011 New Revision: 219079 URL: http://svn.freebsd.org/changeset/base/219079 Log: Clang's integrated assembler can now handle sys/boot/i386/boot2/sio.S. It used to choke on the notation "inb (%dx),%al" for "inb %dx,%al"; GNU as accepts both forms. Which notation is more 'correct' is an open question. :) Modified: head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Sun Feb 27 01:45:36 2011 (r219078) +++ head/sys/boot/i386/gptboot/Makefile Sun Feb 27 02:06:09 2011 (r219079) @@ -44,8 +44,6 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ .if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -# XXX: clang integrated-as doesn't grok some 16-bit instructions yet -CFLAGS+= ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/} .endif LDFLAGS=-static -N --gc-sections Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Sun Feb 27 01:45:36 2011 (r219078) +++ head/sys/boot/i386/gptzfsboot/Makefile Sun Feb 27 02:06:09 2011 (r219079) @@ -41,8 +41,6 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ .if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -# XXX: clang integrated-as doesn't grok some 16-bit instructions yet -CFLAGS+= ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/} .endif LDFLAGS=-static -N --gc-sections Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Sun Feb 27 01:45:36 2011 (r219078) +++ head/sys/boot/i386/zfsboot/Makefile Sun Feb 27 02:06:09 2011 (r219079) @@ -41,8 +41,6 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -Winline --param max-inline-insns-single=100 .if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok some 16-bit instructions yet -CFLAGS+= ${.IMPSRC:T:Msio.S:C/^.+$/-no-integrated-as/} # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS+= ${.IMPSRC:T:Mzfsldr.S:C/^.+$/-no-integrated-as/} .endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 03:04:04 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F3FA106566C; Sun, 27 Feb 2011 03:04:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9428FC14; Sun, 27 Feb 2011 03:04:02 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1R340Sd001120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Feb 2011 14:04:01 +1100 Date: Sun, 27 Feb 2011 14:04:00 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201102270206.p1R269VO021432@svn.freebsd.org> Message-ID: <20110227133227.S1974@besplex.bde.org> References: <201102270206.p1R269VO021432@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219079 - in head/sys/boot/i386: gptboot gptzfsboot zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 03:04:04 -0000 On Sun, 27 Feb 2011, Dimitry Andric wrote: > Log: > Clang's integrated assembler can now handle sys/boot/i386/boot2/sio.S. > It used to choke on the notation "inb (%dx),%al" for "inb %dx,%al"; GNU > as accepts both forms. Which notation is more 'correct' is an open > question. :) Nah, the former is just a syntax error since %dx is not dereferenced :-). It is a syntax error at the design level that parentheses are used for indirection. In better assembler syntaxes like Intel/Microsoft's one for x86 and Motorola's one for 6809, brackets are used for indirections so parentheses are not context-dependent. Then extra parentheses around expressions can have no effect. But dx isn't an expression, so (dx) should still be a syntax error. I think it is in I/M syntax but I can't test that easily. It is a syntax error in my x86/6809 assembler. My assembler doesn't check, but emits a diagnostic for this :-). (My assembler wants brackets for indirection, but it has an option to to implement some bugs including use of parentheses for indirection.) Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 09:47:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 808F4106566C; Sun, 27 Feb 2011 09:47:10 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 0B1E38FC12; Sun, 27 Feb 2011 09:47:10 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 51A84E8CA6; Sun, 27 Feb 2011 09:47:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=subject :from:to:cc:in-reply-to:references:content-type:date:message-id :mime-version; s=mail; bh=twLZl7JPImyla/TbGjpeaKVtM1k=; b=y6x+4t +OXllOYaST8PZePymF1UCeS23kWofEtWO32SO+evF/OXqNABq2C0dwho+pbRhCF8 Q4evV2FbBdy8UezepGZqMJPGKN/f0YG+cAcC1wHlkyPwtse+mgP2r34Vwxh+6ceA vupw8ZpDiDZrbxAc3/G7u00pqhnJosofSLwMo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=subject:from :to:cc:in-reply-to:references:content-type:date:message-id :mime-version; q=dns; s=mail; b=aYqdREe93f/B/eHZej27N3b/YD2iInfH u+JrBtsZl7QgtZTtr+FUW1AsY1Ot52qJV4ITL3KLvqes+btqhCKwlfb6GFj4U1xA PtoNxHjY3l/0cgHgbpk3ogGq35JDc3+GdI4pGpHzhO8DgOJNBibQFFSWRXY1n6fy BLhvYw+8w/k= Received: from [192.168.0.10] (client-86-31-236-253.oxfd.adsl.virginmedia.com [86.31.236.253]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id EEE21E8C98; Sun, 27 Feb 2011 09:47:06 +0000 (GMT) From: Bruce Cran To: Bruce Evans In-Reply-To: <20110224102112.P1871@besplex.bde.org> References: <201102231028.p1NASbET045275@svn.freebsd.org> <20110224063233.Y1100@besplex.bde.org> <1298499116.9366.3.camel@core.nessbank> <20110224102112.P1871@besplex.bde.org> Content-Type: multipart/mixed; boundary="=-j8MDx4GezBwO3yPa/kG/" Date: Sun, 27 Feb 2011 09:46:51 +0000 Message-ID: <1298800011.24317.7.camel@core.nessbank> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r218966 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 09:47:10 -0000 --=-j8MDx4GezBwO3yPa/kG/ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thu, 2011-02-24 at 10:36 +1100, Bruce Evans wrote: > > I would cast operand(s) in the expression as necessary to prevent overflow > of subexpressions. vm_pindex_t would work, but I prefer to use a type > related to the subexpressions. Not sure what that is. Maybe just > uintmax_t for safety (even that is not safe if the subexpressions have > large values). So: > > (uintmax_t)swap_bcount * SWAP_META_PAGES * n / mumble. Following Alan's suggestion, I've attached an updated patch which uses a cast to u_long and returns long. -- Bruce Cran --=-j8MDx4GezBwO3yPa/kG/ Content-Disposition: attachment; filename="vm.diff" Content-Type: text/x-patch; name="vm.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: vm_map.h =================================================================== --- vm_map.h (revision 219050) +++ vm_map.h (working copy) @@ -380,6 +380,6 @@ int flags); int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); -vm_offset_t vmspace_swap_count(struct vmspace *vmspace); +long vmspace_swap_count(struct vmspace *vmspace); #endif /* _KERNEL */ #endif /* _VM_MAP_ */ Index: swap_pager.c =================================================================== --- swap_pager.c (revision 219050) +++ swap_pager.c (working copy) @@ -2420,13 +2420,13 @@ * if the VM object has any swap use at all the associated map entries * count for at least 1 swap page. */ -vm_offset_t +long vmspace_swap_count(struct vmspace *vmspace) { vm_map_t map; vm_map_entry_t cur; vm_object_t object; - vm_offset_t count, n; + long count, n; map = &vmspace->vm_map; count = 0; @@ -2438,7 +2438,7 @@ if (object->type == OBJT_SWAP && object->un_pager.swp.swp_bcount != 0) { n = (cur->end - cur->start) / PAGE_SIZE; - count += object->un_pager.swp.swp_bcount * + count += (u_long)object->un_pager.swp.swp_bcount * SWAP_META_PAGES * n / object->size + 1; } VM_OBJECT_UNLOCK(object); --=-j8MDx4GezBwO3yPa/kG/-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 10:13:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CB031065672; Sun, 27 Feb 2011 10:13:17 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B75E8FC14; Sun, 27 Feb 2011 10:13:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RADHJ1071414; Sun, 27 Feb 2011 10:13:17 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RADGfF071412; Sun, 27 Feb 2011 10:13:16 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102271013.p1RADGfF071412@svn.freebsd.org> From: Bruce Cran Date: Sun, 27 Feb 2011 10:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219081 - head/contrib/lukemftp/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 10:13:17 -0000 Author: brucec Date: Sun Feb 27 10:13:16 2011 New Revision: 219081 URL: http://svn.freebsd.org/changeset/base/219081 Log: Merge fix from r1.108 of NetBSD's usr.bin/ftp/main.c: Only attempt to el_parse() a command unknown by the default parser if editing is enabled. PR: bin/100089 MFC after: 3 days Modified: head/contrib/lukemftp/src/main.c Modified: head/contrib/lukemftp/src/main.c ============================================================================== --- head/contrib/lukemftp/src/main.c Sun Feb 27 09:12:24 2011 (r219080) +++ head/contrib/lukemftp/src/main.c Sun Feb 27 10:13:16 2011 (r219081) @@ -707,6 +707,7 @@ cmdscanner(void) * such commands as invalid. */ if (strchr(margv[0], ':') != NULL || + !editing || el_parse(el, margc, (const char **)margv) != 0) #endif /* !NO_EDITCOMPLETE */ fputs("?Invalid command.\n", ttyout); From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 11:40:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8CD41065691; Sun, 27 Feb 2011 11:40:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C885B8FC13; Sun, 27 Feb 2011 11:40:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RBeKNR084748; Sun, 27 Feb 2011 11:40:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RBeKZX084747; Sun, 27 Feb 2011 11:40:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102271140.p1RBeKZX084747@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 27 Feb 2011 11:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219082 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 11:40:20 -0000 Author: pjd Date: Sun Feb 27 11:40:20 2011 New Revision: 219082 URL: http://svn.freebsd.org/changeset/base/219082 Log: Recognize 'reload' command, as hastd can be reloaded with the SIGHUP signal. MFC after: 1 week Modified: head/etc/rc.d/hastd Modified: head/etc/rc.d/hastd ============================================================================== --- head/etc/rc.d/hastd Sun Feb 27 10:13:16 2011 (r219081) +++ head/etc/rc.d/hastd Sun Feb 27 11:40:20 2011 (r219082) @@ -18,6 +18,7 @@ hastctl="/sbin/hastctl" required_files="/etc/hast.conf" stop_precmd="hastd_stop_precmd" required_modules="geom_gate:g_gate" +extra_commands="reload" hastd_stop_precmd() { From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 11:49:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0501E1065672; Sun, 27 Feb 2011 11:49:53 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id A7DF58FC12; Sun, 27 Feb 2011 11:49:52 +0000 (UTC) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id D1AF8C978F; Sun, 27 Feb 2011 14:49:48 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 304153046; Sun, 27 Feb 2011 14:49:48 +0300 Received: from dchagin.static.corbina.ru (localhost [127.0.0.1]) by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id p1RBnlw1026993; Sun, 27 Feb 2011 14:49:47 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p1RBngVS026992; Sun, 27 Feb 2011 14:49:42 +0300 (MSK) (envelope-from dchagin) Date: Sun, 27 Feb 2011 14:49:42 +0300 From: Chagin Dmitry To: John Baldwin Message-ID: <20110227114942.GA26984@dchagin.static.corbina.ru> References: <201102252207.p1PM7NR9013988@svn.freebsd.org> <201102251722.31108.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <201102251722.31108.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219043 - in head/usr.bin: kdump ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 11:49:53 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 25, 2011 at 05:22:30PM -0500, John Baldwin wrote: > On Friday, February 25, 2011 5:07:23 pm Dmitry Chagin wrote: > > Author: dchagin > > Date: Fri Feb 25 22:07:23 2011 > > New Revision: 219043 > > URL: http://svn.freebsd.org/changeset/base/219043 > >=20 > > Log: > > Teach kdump to understand sv_flags records in the trace files. > > =20 > > MFC after: 1 Month. >=20 > Ohhh, are you going to merge in Linux kdump?? :) >=20 http://www.freebsd.org/cgi/query-pr.cgi?pr=3D155083 :) --=20 Have fun! chd --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk1qOlQACgkQ0t2Tb3OO/O0QtQCfeLocINBT8nLaNDm6MKcO1/jf 8e0An1+PvFYVNHHDqOMtMjrZfDAjX2j0 =1WK/ -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 12:12:16 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464B81065670; Sun, 27 Feb 2011 12:12:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id A33D88FC0C; Sun, 27 Feb 2011 12:12:15 +0000 (UTC) Received: from c122-107-114-89.carlnfd1.nsw.optusnet.com.au (c122-107-114-89.carlnfd1.nsw.optusnet.com.au [122.107.114.89]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p1RCC3cZ008607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Feb 2011 23:12:06 +1100 Date: Sun, 27 Feb 2011 23:12:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Cran In-Reply-To: <1298800011.24317.7.camel@core.nessbank> Message-ID: <20110227230553.N10085@besplex.bde.org> References: <201102231028.p1NASbET045275@svn.freebsd.org> <20110224063233.Y1100@besplex.bde.org> <1298499116.9366.3.camel@core.nessbank> <20110224102112.P1871@besplex.bde.org> <1298800011.24317.7.camel@core.nessbank> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r218966 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 12:12:16 -0000 On Sun, 27 Feb 2011, Bruce Cran wrote: > On Thu, 2011-02-24 at 10:36 +1100, Bruce Evans wrote: >> >> I would cast operand(s) in the expression as necessary to prevent overflow >> of subexpressions. vm_pindex_t would work, but I prefer to use a type >> related to the subexpressions. Not sure what that is. Maybe just >> uintmax_t for safety (even that is not safe if the subexpressions have >> large values). So: >> >> (uintmax_t)swap_bcount * SWAP_META_PAGES * n / mumble. > > Following Alan's suggestion, I've attached an updated patch which uses a > cast to u_long and returns long. I thought he only meant to return long. The units being returned are PAGE_SIZE smaller than the units in the expression. But I don't know exacty how large swp_bcount can be. If everything fits in a single object, then vm_size_t = u_int on 32-bit machines is enough. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 12:25:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CF97106564A; Sun, 27 Feb 2011 12:25:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71DCB8FC15; Sun, 27 Feb 2011 12:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RCPlqj086969; Sun, 27 Feb 2011 12:25:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RCPlbw086966; Sun, 27 Feb 2011 12:25:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102271225.p1RCPlbw086966@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 27 Feb 2011 12:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219083 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 12:25:47 -0000 Author: pjd Date: Sun Feb 27 12:25:47 2011 New Revision: 219083 URL: http://svn.freebsd.org/changeset/base/219083 Log: Rename bcpy() macro to bcopy(). Modified: head/sys/boot/common/gpt.c head/sys/boot/common/util.h Modified: head/sys/boot/common/gpt.c ============================================================================== --- head/sys/boot/common/gpt.c Sun Feb 27 11:40:20 2011 (r219082) +++ head/sys/boot/common/gpt.c Sun Feb 27 12:25:47 2011 (r219083) @@ -71,7 +71,7 @@ gptupdate(const char *which, struct dsk entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; slba = curent / entries_per_sec; firstent = slba * entries_per_sec; - bcpy(&table[firstent], secbuf, DEV_BSIZE); + bcopy(&table[firstent], secbuf, DEV_BSIZE); slba += hdr->hdr_lba_table; if (drvwrite(dskp, secbuf, slba, 1)) { printf("%s: unable to update %s GPT partition table\n", @@ -82,7 +82,7 @@ gptupdate(const char *which, struct dsk hdr->hdr_crc_self = 0; hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); bzero(secbuf, DEV_BSIZE); - bcpy(hdr, secbuf, hdr->hdr_size); + bcopy(hdr, secbuf, hdr->hdr_size); if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { printf("%s: unable to update %s GPT header\n", BOOTPROG, which); return; @@ -191,7 +191,7 @@ gptread_hdr(const char *which, struct ds printf("%s: unable to read %s GPT header\n", BOOTPROG, which); return (-1); } - bcpy(secbuf, hdr, sizeof(*hdr)); + bcopy(secbuf, hdr, sizeof(*hdr)); if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || hdr->hdr_entsz < sizeof(struct gpt_ent) || @@ -259,7 +259,7 @@ gptbootconv(const char *which, struct ds } if (!sector_updated) continue; - bcpy(&table[nent], secbuf, DEV_BSIZE); + bcopy(&table[nent], secbuf, DEV_BSIZE); if (drvwrite(dskp, secbuf, slba, 1)) { printf("%s: unable to update %s GPT partition table\n", BOOTPROG, which); @@ -271,7 +271,7 @@ gptbootconv(const char *which, struct ds hdr->hdr_crc_self = 0; hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size); bzero(secbuf, DEV_BSIZE); - bcpy(hdr, secbuf, hdr->hdr_size); + bcopy(hdr, secbuf, hdr->hdr_size); if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) printf("%s: unable to update %s GPT header\n", BOOTPROG, which); } @@ -299,7 +299,7 @@ gptread_table(const char *which, const u } ent = (struct gpt_ent *)secbuf; for (part = 0; part < entries_per_sec; part++, ent++) { - bcpy(ent, &table[nent], sizeof(table[nent])); + bcopy(ent, &table[nent], sizeof(table[nent])); if (++nent >= hdr->hdr_entries) break; } Modified: head/sys/boot/common/util.h ============================================================================== --- head/sys/boot/common/util.h Sun Feb 27 11:40:20 2011 (r219082) +++ head/sys/boot/common/util.h Sun Feb 27 12:25:47 2011 (r219083) @@ -37,7 +37,7 @@ void memcpy(void *dst, const void *src, void memset(void *b, int c, size_t len); int memcmp(const void *b1, const void *b2, size_t len); -#define bcpy(src, dst, len) memcpy((dst), (src), (len)) +#define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bzero(buf, size) memset((buf), 0, (size)) #define bcmp(b1, b2, len) (memcmp((b1), (b2), (len)) != 0) From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 12:28:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75EE81065672; Sun, 27 Feb 2011 12:28:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 654138FC19; Sun, 27 Feb 2011 12:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RCS6vZ087134; Sun, 27 Feb 2011 12:28:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RCS6qG087131; Sun, 27 Feb 2011 12:28:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201102271228.p1RCS6qG087131@svn.freebsd.org> From: Xin LI Date: Sun, 27 Feb 2011 12:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219084 - in head: bin/test tools/regression/bin/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 12:28:06 -0000 Author: delphij Date: Sun Feb 27 12:28:06 2011 New Revision: 219084 URL: http://svn.freebsd.org/changeset/base/219084 Log: Accept == as an alias of = which is a popular GNU extension. This is intentionally undocumented for now since it's not part of any standard. MFC after: 1 month Modified: head/bin/test/test.c head/tools/regression/bin/test/regress.sh Modified: head/bin/test/test.c ============================================================================== --- head/bin/test/test.c Sun Feb 27 12:25:47 2011 (r219083) +++ head/bin/test/test.c Sun Feb 27 12:28:06 2011 (r219084) @@ -144,6 +144,7 @@ struct t_op { {"-L", FILSYM, UNOP}, {"-S", FILSOCK,UNOP}, {"=", STREQ, BINOP}, + {"==", STREQ, BINOP}, {"!=", STRNE, BINOP}, {"<", STRLT, BINOP}, {">", STRGT, BINOP}, Modified: head/tools/regression/bin/test/regress.sh ============================================================================== --- head/tools/regression/bin/test/regress.sh Sun Feb 27 12:25:47 2011 (r219083) +++ head/tools/regression/bin/test/regress.sh Sun Feb 27 12:28:06 2011 (r219084) @@ -52,12 +52,15 @@ t () } count=0 -echo "1..94" +echo "1..97" t 0 'b = b' +t 0 'b == b' t 1 'b != b' t 0 '\( b = b \)' +t 0 '\( b == b \)' t 1 '! \( b = b \)' +t 1 '! \( b == b \)' t 1 '! -f /etc/passwd' t 0 '-h = -h' From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 13:19:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73C49106566C; Sun, 27 Feb 2011 13:19:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DEF288FC0C; Sun, 27 Feb 2011 13:19:09 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p1RDJ4rr035403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Feb 2011 15:19:04 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p1RDJ4wM007338; Sun, 27 Feb 2011 15:19:04 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p1RDJ3cF007337; Sun, 27 Feb 2011 15:19:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Feb 2011 15:19:03 +0200 From: Kostik Belousov To: Bruce Evans Message-ID: <20110227131903.GE78089@deviant.kiev.zoral.com.ua> References: <201102231028.p1NASbET045275@svn.freebsd.org> <20110224063233.Y1100@besplex.bde.org> <1298499116.9366.3.camel@core.nessbank> <20110224102112.P1871@besplex.bde.org> <1298800011.24317.7.camel@core.nessbank> <20110227230553.N10085@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uZAQk/nhVDxpDIck" Content-Disposition: inline In-Reply-To: <20110227230553.N10085@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218966 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 13:19:10 -0000 --uZAQk/nhVDxpDIck Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 27, 2011 at 11:12:03PM +1100, Bruce Evans wrote: > On Sun, 27 Feb 2011, Bruce Cran wrote: >=20 > >On Thu, 2011-02-24 at 10:36 +1100, Bruce Evans wrote: > >> > >>I would cast operand(s) in the expression as necessary to prevent overf= low > >>of subexpressions. vm_pindex_t would work, but I prefer to use a type > >>related to the subexpressions. Not sure what that is. Maybe just > >>uintmax_t for safety (even that is not safe if the subexpressions have > >>large values). So: > >> > >> (uintmax_t)swap_bcount * SWAP_META_PAGES * n / mumble. > > > >Following Alan's suggestion, I've attached an updated patch which uses a > >cast to u_long and returns long. >=20 > I thought he only meant to return long. The units being returned are > PAGE_SIZE smaller than the units in the expression. But I don't know > exacty how large swp_bcount can be. If everything fits in a single > object, then vm_size_t =3D u_int on 32-bit machines is enough. I think that return type should be left as vm_offset_t. The calculation basically returns some quantity of type vm_offset_t, divided by PAGE_SIZE. This validates the new return type. The calculation could use vm_offset_t, or uintmax_t cast, probably vm_offset_t is preferred for the same reason. --uZAQk/nhVDxpDIck Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk1qT0cACgkQC3+MBN1Mb4jZ3wCgzOYhyMq3VyMFcNZ8wBa5bQue o+MAn0I0IQTEWaTiTPuJ6hLddDyQYFoM =nIGG -----END PGP SIGNATURE----- --uZAQk/nhVDxpDIck-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 13:58:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795171065672; Sun, 27 Feb 2011 13:58:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 698A78FC1B; Sun, 27 Feb 2011 13:58:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RDwKu4089974; Sun, 27 Feb 2011 13:58:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RDwKaV089972; Sun, 27 Feb 2011 13:58:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102271358.p1RDwKaV089972@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 27 Feb 2011 13:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219085 - head/sys/dev/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 13:58:20 -0000 Author: pjd Date: Sun Feb 27 13:58:20 2011 New Revision: 219085 URL: http://svn.freebsd.org/changeset/base/219085 Log: Force DMA for controller found in Lenovo T510 (probably in others too). This makes reads 10 times faster. Discussed with: mav Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Feb 27 12:28:06 2011 (r219084) +++ head/sys/dev/sdhci/sdhci.c Sun Feb 27 13:58:20 2011 (r219085) @@ -83,6 +83,8 @@ static const struct sdhci_device { } sdhci_devices[] = { { 0x08221180, 0xffff, "RICOH R5C822 SD", SDHCI_QUIRK_FORCE_DMA }, + { 0xe8221180, 0xffff, "RICOH SD", + SDHCI_QUIRK_FORCE_DMA }, { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, { 0x05501524, 0xffff, "ENE CB712 SD", From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 17:14:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37A111065672; Sun, 27 Feb 2011 17:14:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27C8C8FC14; Sun, 27 Feb 2011 17:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RHE7tD095724; Sun, 27 Feb 2011 17:14:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RHE7P4095722; Sun, 27 Feb 2011 17:14:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201102271714.p1RHE7P4095722@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Feb 2011 17:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219086 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 17:14:07 -0000 Author: gjb (doc committer) Date: Sun Feb 27 17:14:06 2011 New Revision: 219086 URL: http://svn.freebsd.org/changeset/base/219086 Log: Fix typo in kernel configuration entry. PR: 155074 Submitted by: Warren Block (wblock of wonkity com) MFC after: 3 days Modified: head/share/man/man4/usb_quirk.4 Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Sun Feb 27 13:58:20 2011 (r219085) +++ head/share/man/man4/usb_quirk.4 Sun Feb 27 17:14:06 2011 (r219086) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 9, 2010 +.Dd February 27, 2011 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -27,7 +27,7 @@ To compile this module into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device usb" +.Cd "device usb_quirk" .Ed .Pp Alternatively, to load the module at boot From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 19:41:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E691065670; Sun, 27 Feb 2011 19:41:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44258FC24; Sun, 27 Feb 2011 19:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RJfe22000361; Sun, 27 Feb 2011 19:41:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RJfePI000348; Sun, 27 Feb 2011 19:41:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102271941.p1RJfePI000348@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 27 Feb 2011 19:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219089 - in head: cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/stat cddl/contrib/opensolaris/cmd/stat/common cddl/contrib/opensolaris/cmd/z... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 19:41:41 -0000 Author: pjd Date: Sun Feb 27 19:41:40 2011 New Revision: 219089 URL: http://svn.freebsd.org/changeset/base/219089 Log: Finally... Import the latest open-source ZFS version - (SPA) 28. Few new things available from now on: - Data deduplication. - Triple parity RAIDZ (RAIDZ3). - zfs diff. - zpool split. - Snapshot holds. - zpool import -F. Allows to rewind corrupted pool to earlier transaction group. - Possibility to import pool in read-only mode. MFC after: 1 month Added: head/cddl/compat/opensolaris/include/sha2.h (contents, props changed) head/cddl/compat/opensolaris/include/thread_pool.h (contents, props changed) head/cddl/contrib/opensolaris/cmd/stat/ head/cddl/contrib/opensolaris/cmd/stat/common/ head/cddl/contrib/opensolaris/cmd/stat/common/statcommon.h (contents, props changed) head/cddl/contrib/opensolaris/cmd/stat/common/timestamp.c (contents, props changed) head/cddl/contrib/opensolaris/cmd/zlook/ head/cddl/contrib/opensolaris/cmd/zlook/zlook.c (contents, props changed) head/cddl/contrib/opensolaris/cmd/zstreamdump/ head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.1 (contents, props changed) head/cddl/contrib/opensolaris/cmd/zstreamdump/zstreamdump.c (contents, props changed) head/cddl/contrib/opensolaris/lib/libuutil/common/uu_string.c (contents, props changed) head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c (contents, props changed) head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c (contents, props changed) head/cddl/contrib/opensolaris/lib/pyzfs/common/holds.py (contents, props changed) head/cddl/contrib/opensolaris/lib/pyzfs/common/table.py (contents, props changed) head/cddl/usr.bin/zlook/ head/cddl/usr.bin/zlook/Makefile (contents, props changed) head/cddl/usr.bin/zstreamdump/ head/cddl/usr.bin/zstreamdump/Makefile (contents, props changed) head/sys/cddl/boot/zfs/zle.c (contents, props changed) head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c (contents, props changed) head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c (contents, props changed) head/sys/cddl/compat/opensolaris/sys/systeminfo.h (contents, props changed) head/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c (contents, props changed) head/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h (contents, props changed) head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c (contents, props changed) head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deadlist.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_onexit.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_sa.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_stat.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/os/fm.c (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zut.h (contents, props changed) head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/dev.h (contents, props changed) Deleted: head/sys/cddl/compat/opensolaris/sys/sysmacros.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c head/sys/cddl/contrib/opensolaris/uts/common/sys/byteorder.h Modified: head/cddl/compat/opensolaris/include/fcntl.h head/cddl/compat/opensolaris/include/mnttab.h head/cddl/compat/opensolaris/include/priv.h head/cddl/compat/opensolaris/include/solaris.h head/cddl/compat/opensolaris/misc/fsshare.c head/cddl/compat/opensolaris/misc/zmount.c head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h head/cddl/contrib/opensolaris/cmd/zinject/translate.c head/cddl/contrib/opensolaris/cmd/zinject/zinject.c head/cddl/contrib/opensolaris/cmd/zinject/zinject.h head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_util.c head/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/cddl/contrib/opensolaris/head/synch.h head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h head/cddl/contrib/opensolaris/lib/libuutil/common/libuutil.h head/cddl/contrib/opensolaris/lib/libuutil/common/uu_alloc.c head/cddl/contrib/opensolaris/lib/libuutil/common/uu_misc.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h head/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c head/cddl/contrib/opensolaris/lib/libzpool/common/util.c head/cddl/contrib/opensolaris/lib/pyzfs/common/__init__.py head/cddl/contrib/opensolaris/lib/pyzfs/common/allow.py head/cddl/contrib/opensolaris/lib/pyzfs/common/dataset.py head/cddl/contrib/opensolaris/lib/pyzfs/common/groupspace.py head/cddl/contrib/opensolaris/lib/pyzfs/common/ioctl.c head/cddl/contrib/opensolaris/lib/pyzfs/common/unallow.py head/cddl/contrib/opensolaris/lib/pyzfs/common/userspace.py head/cddl/contrib/opensolaris/lib/pyzfs/common/util.py head/cddl/lib/libzfs/Makefile head/cddl/lib/libzpool/Makefile head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile head/cddl/usr.bin/Makefile head/cddl/usr.bin/ztest/Makefile head/cddl/usr.sbin/zdb/Makefile head/rescue/rescue/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/zfs/zfs.c head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/fletcher.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c head/sys/cddl/compat/opensolaris/kern/opensolaris_string.c head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c head/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c head/sys/cddl/compat/opensolaris/sys/atomic.h head/sys/cddl/compat/opensolaris/sys/byteorder.h head/sys/cddl/compat/opensolaris/sys/dirent.h head/sys/cddl/compat/opensolaris/sys/file.h head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/compat/opensolaris/sys/misc.h head/sys/cddl/compat/opensolaris/sys/mount.h head/sys/cddl/compat/opensolaris/sys/mutex.h head/sys/cddl/compat/opensolaris/sys/policy.h head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/cddl/compat/opensolaris/sys/rwlock.h head/sys/cddl/compat/opensolaris/sys/sid.h head/sys/cddl/compat/opensolaris/sys/stat.h head/sys/cddl/compat/opensolaris/sys/string.h head/sys/cddl/compat/opensolaris/sys/sunddi.h head/sys/cddl/compat/opensolaris/sys/systm.h head/sys/cddl/compat/opensolaris/sys/taskq.h head/sys/cddl/compat/opensolaris/sys/time.h head/sys/cddl/compat/opensolaris/sys/types.h head/sys/cddl/compat/opensolaris/sys/uio.h head/sys/cddl/compat/opensolaris/sys/vfs.h head/sys/cddl/compat/opensolaris/sys/vnode.h head/sys/cddl/compat/opensolaris/sys/zone.h head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c head/sys/cddl/contrib/opensolaris/common/acl/acl_common.h head/sys/cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S head/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S head/sys/cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S head/sys/cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S head/sys/cddl/contrib/opensolaris/common/avl/avl.c head/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c head/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files head/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bplist.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_fuid.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c head/sys/cddl/contrib/opensolaris/uts/common/os/callb.c head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h head/sys/cddl/contrib/opensolaris/uts/common/sys/cpupart.h head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h head/sys/cddl/contrib/opensolaris/uts/common/sys/cred.h head/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fm/protocol.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fm/util.h head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/idmap.h head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h head/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h head/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h head/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h head/sys/modules/opensolaris/Makefile head/sys/modules/zfs/Makefile head/usr.bin/fstat/zfs.c Modified: head/cddl/compat/opensolaris/include/fcntl.h ============================================================================== --- head/cddl/compat/opensolaris/include/fcntl.h Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/include/fcntl.h Sun Feb 27 19:41:40 2011 (r219089) @@ -32,6 +32,7 @@ #include_next -#define open64 open +#define open64(...) open(__VA_ARGS__) +#define openat64(...) openat(__VA_ARGS__) #endif Modified: head/cddl/compat/opensolaris/include/mnttab.h ============================================================================== --- head/cddl/compat/opensolaris/include/mnttab.h Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/include/mnttab.h Sun Feb 27 19:41:40 2011 (r219089) @@ -12,6 +12,10 @@ #define MNTTAB _PATH_DEVZERO #define MNT_LINE_MAX 1024 +#define MS_OVERLAY 0x0 +#define MS_NOMNTTAB 0x0 +#define MS_RDONLY 0x1 + #define umount2(p, f) unmount(p, f) struct mnttab { Modified: head/cddl/compat/opensolaris/include/priv.h ============================================================================== --- head/cddl/compat/opensolaris/include/priv.h Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/include/priv.h Sun Feb 27 19:41:40 2011 (r219089) @@ -10,7 +10,7 @@ #define PRIV_SYS_CONFIG 0 static __inline int -priv_ineffect(priv) +priv_ineffect(int priv) { assert(priv == PRIV_SYS_CONFIG); Added: head/cddl/compat/opensolaris/include/sha2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/compat/opensolaris/include/sha2.h Sun Feb 27 19:41:40 2011 (r219089) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 _OPENSOLARIS_SHA2_H_ +#define _OPENSOLARIS_SHA2_H_ + +#include_next + +#define SHA256Init(c) SHA256_Init(c) +#define SHA256Update(c, d, s) SHA256_Update((c), (d), (s)) +#define SHA256Final(b, c) SHA256_Final((unsigned char *)(b), (c)) + +#endif /* !_OPENSOLARIS_SHA2_H_ */ Modified: head/cddl/compat/opensolaris/include/solaris.h ============================================================================== --- head/cddl/compat/opensolaris/include/solaris.h Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/include/solaris.h Sun Feb 27 19:41:40 2011 (r219089) @@ -5,6 +5,10 @@ #include -#define dirent64 dirent +#include + +#define NOTE(s) + +int mkdirp(const char *, mode_t); #endif /* !_SOLARIS_H_ */ Added: head/cddl/compat/opensolaris/include/thread_pool.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/compat/opensolaris/include/thread_pool.h Sun Feb 27 19:41:40 2011 (r219089) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 _OPENSOLARIS_THREAD_POOL_H_ +#define _OPENSOLARIS_THREAD_POOL_H_ + +typedef int tpool_t; + +#define tpool_create(a, b, c, d) (0) +#define tpool_dispatch(pool, func, arg) func(arg) +#define tpool_wait(pool) do { } while (0) +#define tpool_destroy(pool) do { } while (0) + +#endif /* !_OPENSOLARIS_THREAD_POOL_H_ */ Modified: head/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- head/cddl/compat/opensolaris/misc/fsshare.c Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/misc/fsshare.c Sun Feb 27 19:41:40 2011 (r219089) @@ -28,15 +28,17 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include + +#include #include +#include +#include #include -#include #include /* _PATH_MOUNTDPID */ -#include +#include +#include +#include +#include #define FILE_HEADER "# !!! DO NOT EDIT THIS FILE MANUALLY !!!\n\n" #define OPTSSIZE 1024 Modified: head/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- head/cddl/compat/opensolaris/misc/zmount.c Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/compat/opensolaris/misc/zmount.c Sun Feb 27 19:41:40 2011 (r219089) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, @@ -78,7 +79,7 @@ zmount(const char *spec, const char *dir assert(spec != NULL); assert(dir != NULL); - assert(mflag == 0); + assert(mflag == 0 || mflag == MS_RDONLY); assert(fstype != NULL); assert(strcmp(fstype, MNTTYPE_ZFS) == 0); assert(dataptr == NULL); @@ -91,6 +92,8 @@ zmount(const char *spec, const char *dir iov = NULL; iovlen = 0; + if (mflag & MS_RDONLY) + build_iovec(&iov, &iovlen, "ro", NULL, 0); build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); Added: head/cddl/contrib/opensolaris/cmd/stat/common/statcommon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/stat/common/statcommon.h Sun Feb 27 19:41:40 2011 (r219089) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * + * Common routines for acquiring snapshots of kstats for + * iostat, mpstat, and vmstat. + */ + +#ifndef _STATCOMMON_H +#define _STATCOMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define NODATE 0 /* Default: No time stamp */ +#define DDATE 1 /* Standard date format */ +#define UDATE 2 /* Internal representation of Unix time */ + +/* Print a timestamp in either Unix or standard format. */ +void print_timestamp(uint_t); + +#ifdef __cplusplus +} +#endif + +#endif /* _STATCOMMON_H */ Added: head/cddl/contrib/opensolaris/cmd/stat/common/timestamp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/stat/common/timestamp.c Sun Feb 27 19:41:40 2011 (r219089) @@ -0,0 +1,49 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "statcommon.h" + +#include + +/* + * Print timestamp as decimal reprentation of time_t value (-T u was specified) + * or in date(1) format (-T d was specified). + */ +void +print_timestamp(uint_t timestamp_fmt) +{ + time_t t = time(NULL); + + if (timestamp_fmt == UDATE) { + (void) printf("%ld\n", t); + } else if (timestamp_fmt == DDATE) { + char dstr[64]; + int len; + + len = strftime(dstr, sizeof (dstr), "%+", localtime(&t)); + if (len > 0) + (void) printf("%s\n", dstr); + } +} Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Feb 27 18:23:28 2011 (r219088) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sun Feb 27 19:41:40 2011 (r219089) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -34,6 +33,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -51,10 +53,25 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include +#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ + zio_compress_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ + zio_checksum_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ + dmu_ot[(idx)].ot_name : "UNKNOWN") +#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) + +#ifndef lint +extern int zfs_recover; +#else +int zfs_recover; +#endif + const char cmdname[] = "zdb"; uint8_t dump_opt[256]; @@ -64,8 +81,6 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; -boolean_t zdb_sig_user_data = B_TRUE; -int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -87,39 +102,56 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-udibcsvL] [-U cachefile_path] [-t txg]\n" - "\t [-S user:cksumalg] " - "dataset [object...]\n" - " %s -C [pool]\n" - " %s -l dev\n" - " %s -R pool:vdev:offset:size:flags\n" - " %s [-p path_to_vdev_dir]\n" - " %s -e pool | GUID | devid ...\n", - cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); - - (void) fprintf(stderr, " -u uberblock\n"); - (void) fprintf(stderr, " -d datasets\n"); - (void) fprintf(stderr, " -C cached pool configuration\n"); - (void) fprintf(stderr, " -i intent logs\n"); - (void) fprintf(stderr, " -b block statistics\n"); - (void) fprintf(stderr, " -m metaslabs\n"); - (void) fprintf(stderr, " -c checksum all metadata (twice for " + "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" + " %s [-div] dataset [object...]\n" + " %s -m [-L] poolname [vdev [metaslab...]]\n" + " %s -R poolname vdev:offset:size[:flags]\n" + " %s -S poolname\n" + " %s -l [-u] device\n" + " %s -C\n\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); + + (void) fprintf(stderr, " Dataset name must include at least one " + "separator character '/' or '@'\n"); + (void) fprintf(stderr, " If dataset name is specified, only that " + "dataset is dumped\n"); + (void) fprintf(stderr, " If object numbers are specified, only " + "those objects are dumped\n\n"); + (void) fprintf(stderr, " Options to control amount of output:\n"); + (void) fprintf(stderr, " -u uberblock\n"); + (void) fprintf(stderr, " -d dataset(s)\n"); + (void) fprintf(stderr, " -i intent logs\n"); + (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); + (void) fprintf(stderr, " -h pool history\n"); + (void) fprintf(stderr, " -b block statistics\n"); + (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); - (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); - (void) fprintf(stderr, " -S : -- " - "dump blkptr signatures\n"); - (void) fprintf(stderr, " -v verbose (applies to all others)\n"); + (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -D dedup statistics\n"); + (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); + (void) fprintf(stderr, " -v verbose (applies to all others)\n"); (void) fprintf(stderr, " -l dump label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); - (void) fprintf(stderr, " -U cachefile_path -- use alternate " - "cachefile\n"); (void) fprintf(stderr, " -R read and display block from a " - "device\n"); - (void) fprintf(stderr, " -e Pool is exported/destroyed/" - "has altroot\n"); - (void) fprintf(stderr, " -p (use with -e)\n"); - (void) fprintf(stderr, " -t highest txg to use when " + "device\n\n"); + (void) fprintf(stderr, " Below options are intended for use " + "with other options (except -l):\n"); + (void) fprintf(stderr, " -A ignore assertions (-A), enable " + "panic recovery (-AA) or both (-AAA)\n"); + (void) fprintf(stderr, " -F attempt automatic rewind within " + "safe range of transaction groups\n"); + (void) fprintf(stderr, " -U -- use alternate " + "cachefile\n"); + (void) fprintf(stderr, " -X attempt extreme rewind (does not " + "work with dataset)\n"); + (void) fprintf(stderr, " -e pool is exported/destroyed/" + "has altroot/not in a cachefile\n"); + (void) fprintf(stderr, " -p -- use one or more with " + "-e to specify path to vdev dir\n"); + (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); @@ -146,68 +178,6 @@ fatal(const char *fmt, ...) exit(1); } -static void -dump_nvlist(nvlist_t *list, int indent) -{ - nvpair_t *elem = NULL; - - while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { - switch (nvpair_type(elem)) { - case DATA_TYPE_STRING: - { - char *value; - - VERIFY(nvpair_value_string(elem, &value) == 0); - (void) printf("%*s%s='%s'\n", indent, "", - nvpair_name(elem), value); - } - break; - - case DATA_TYPE_UINT64: - { - uint64_t value; - - VERIFY(nvpair_value_uint64(elem, &value) == 0); - (void) printf("%*s%s=%llu\n", indent, "", - nvpair_name(elem), (u_longlong_t)value); - } - break; - - case DATA_TYPE_NVLIST: - { - nvlist_t *value; - - VERIFY(nvpair_value_nvlist(elem, &value) == 0); - (void) printf("%*s%s\n", indent, "", - nvpair_name(elem)); - dump_nvlist(value, indent + 4); - } - break; - - case DATA_TYPE_NVLIST_ARRAY: - { - nvlist_t **value; - uint_t c, count; - - VERIFY(nvpair_value_nvlist_array(elem, &value, - &count) == 0); - - for (c = 0; c < count; c++) { - (void) printf("%*s%s[%u]\n", indent, "", - nvpair_name(elem), c); - dump_nvlist(value[c], indent + 8); - } - } - break; - - default: - - (void) printf("bad config type %d for %s\n", - nvpair_type(elem), nvpair_name(elem)); - } - } -} - /* ARGSUSED */ static void dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) @@ -227,6 +197,15 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +static void +zdb_nicenum(uint64_t num, char *buf) +{ + if (dump_opt['P']) + (void) sprintf(buf, "%llu", (longlong_t)num); + else + nicenum(num, buf); +} + const char dump_zap_stars[] = "****************************************"; const int dump_zap_width = sizeof (dump_zap_stars) - 1; @@ -325,6 +304,13 @@ dump_none(objset_t *os, uint64_t object, } /*ARGSUSED*/ +static void +dump_unknown(objset_t *os, uint64_t object, void *data, size_t size) +{ + (void) printf("\tUNKNOWN OBJECT TYPE\n"); +} + +/*ARGSUSED*/ void dump_uint8(objset_t *os, uint64_t object, void *data, size_t size) { @@ -388,6 +374,79 @@ dump_zap(objset_t *os, uint64_t object, /*ARGSUSED*/ static void +dump_ddt_zap(objset_t *os, uint64_t object, void *data, size_t size) +{ + dump_zap_stats(os, object); + /* contents are printed elsewhere, properly decoded */ +} + +/*ARGSUSED*/ +static void +dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = ", attr.za_name); + if (attr.za_num_integers == 0) { + (void) printf("\n"); + continue; + } + (void) printf(" %llx : [%d:%d:%d]\n", + (u_longlong_t)attr.za_first_integer, + (int)ATTR_LENGTH(attr.za_first_integer), + (int)ATTR_BSWAP(attr.za_first_integer), + (int)ATTR_NUM(attr.za_first_integer)); + } + zap_cursor_fini(&zc); +} + +/*ARGSUSED*/ +static void +dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + uint16_t *layout_attrs; + int i; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = [", attr.za_name); + if (attr.za_num_integers == 0) { + (void) printf("\n"); + continue; + } + + VERIFY(attr.za_integer_length == 2); + layout_attrs = umem_zalloc(attr.za_num_integers * + attr.za_integer_length, UMEM_NOFAIL); + + VERIFY(zap_lookup(os, object, attr.za_name, + attr.za_integer_length, + attr.za_num_integers, layout_attrs) == 0); + + for (i = 0; i != attr.za_num_integers; i++) + (void) printf(" %d ", (int)layout_attrs[i]); + (void) printf("]\n"); + umem_free(layout_attrs, + attr.za_num_integers * attr.za_integer_length); + } + zap_cursor_fini(&zc); +} + +/*ARGSUSED*/ +static void dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size) { zap_cursor_t zc; @@ -441,17 +500,17 @@ dump_spacemap(objset_t *os, space_map_ob */ alloc = 0; for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY(0 == dmu_read(os, smo->smo_object, offset, + VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { - (void) printf("\t\t[%4llu] %s: txg %llu, pass %llu\n", + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], (u_longlong_t)SM_DEBUG_TXG_DECODE(entry), (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry)); } else { - (void) printf("\t\t[%4llu] %c range:" - " %08llx-%08llx size: %06llx\n", + (void) printf("\t [%6llu] %c range:" + " %010llx-%010llx size: %06llx\n", (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << @@ -476,14 +535,14 @@ dump_spacemap(objset_t *os, space_map_ob static void dump_metaslab_stats(metaslab_t *msp) { - char maxbuf[5]; + char maxbuf[32]; space_map_t *sm = &msp->ms_map; avl_tree_t *t = sm->sm_pp_root; int free_pct = sm->sm_space * 100 / sm->sm_size; - nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(space_map_maxsize(sm), maxbuf); - (void) printf("\t %20s %10lu %7s %6s %4s %4d%%\n", + (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); } @@ -495,16 +554,16 @@ dump_metaslab(metaslab_t *msp) spa_t *spa = vd->vdev_spa; space_map_t *sm = &msp->ms_map; space_map_obj_t *smo = &msp->ms_smo; - char freebuf[5]; + char freebuf[32]; - nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); (void) printf( - "\tvdev %5llu offset %12llx spacemap %6llu free %5s\n", + "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", (u_longlong_t)(sm->sm_start / sm->sm_size), (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); - if (dump_opt['m'] > 1) { + if (dump_opt['m'] > 1 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); space_map_load_wait(sm); if (!sm->sm_loaded) @@ -525,22 +584,52 @@ dump_metaslab(metaslab_t *msp) } static void +print_vdev_metaslab_header(vdev_t *vd) +{ + (void) printf("\tvdev %10llu\n\t%-10s%5llu %-19s %-15s %-10s\n", + (u_longlong_t)vd->vdev_id, + "metaslabs", (u_longlong_t)vd->vdev_ms_count, + "offset", "spacemap", "free"); + (void) printf("\t%15s %19s %15s %10s\n", + "---------------", "-------------------", + "---------------", "-------------"); +} + +static void dump_metaslabs(spa_t *spa) { - vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m; + vdev_t *vd, *rvd = spa->spa_root_vdev; + uint64_t m, c = 0, children = rvd->vdev_children; (void) printf("\nMetaslabs:\n"); - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; + if (!dump_opt['d'] && zopt_objects > 0) { + c = zopt_object[0]; - (void) printf("\t%-10s %-19s %-15s %-10s\n", - "vdev", "offset", "spacemap", "free"); - (void) printf("\t%10s %19s %15s %10s\n", - "----------", "-------------------", - "---------------", "-------------"); + if (c >= children) + (void) fatal("bad vdev id: %llu", (u_longlong_t)c); + + if (zopt_objects > 1) { + vd = rvd->vdev_child[c]; + print_vdev_metaslab_header(vd); + + for (m = 1; m < zopt_objects; m++) { + if (zopt_object[m] < vd->vdev_ms_count) + dump_metaslab( + vd->vdev_ms[zopt_object[m]]); + else + (void) fprintf(stderr, "bad metaslab " + "number %llu\n", + (u_longlong_t)zopt_object[m]); + } + (void) printf("\n"); + return; + } + children = c + 1; + } + for (; c < children; c++) { + vd = rvd->vdev_child[c]; + print_vdev_metaslab_header(vd); for (m = 0; m < vd->vdev_ms_count; m++) dump_metaslab(vd->vdev_ms[m]); @@ -549,6 +638,133 @@ dump_metaslabs(spa_t *spa) } static void +dump_dde(const ddt_t *ddt, const ddt_entry_t *dde, uint64_t index) +{ + const ddt_phys_t *ddp = dde->dde_phys; + const ddt_key_t *ddk = &dde->dde_key; + char *types[4] = { "ditto", "single", "double", "triple" }; + char blkbuf[BP_SPRINTF_LEN]; + blkptr_t blk; + + for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { + if (ddp->ddp_phys_birth == 0) + continue; + ddt_bp_create(ddt->ddt_checksum, ddk, ddp, &blk); + sprintf_blkptr(blkbuf, &blk); + (void) printf("index %llx refcnt %llu %s %s\n", + (u_longlong_t)index, (u_longlong_t)ddp->ddp_refcnt, + types[p], blkbuf); + } +} + +static void +dump_dedup_ratio(const ddt_stat_t *dds) +{ + double rL, rP, rD, D, dedup, compress, copies; + + if (dds->dds_blocks == 0) + return; + + rL = (double)dds->dds_ref_lsize; + rP = (double)dds->dds_ref_psize; + rD = (double)dds->dds_ref_dsize; + D = (double)dds->dds_dsize; + + dedup = rD / D; + compress = rL / rP; + copies = rD / rP; + + (void) printf("dedup = %.2f, compress = %.2f, copies = %.2f, " + "dedup * compress / copies = %.2f\n\n", + dedup, compress, copies, dedup * compress / copies); +} + +static void +dump_ddt(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +{ + char name[DDT_NAMELEN]; + ddt_entry_t dde; + uint64_t walk = 0; + dmu_object_info_t doi; + uint64_t count, dspace, mspace; + int error; + + error = ddt_object_info(ddt, type, class, &doi); + + if (error == ENOENT) + return; + ASSERT(error == 0); + + if ((count = ddt_object_count(ddt, type, class)) == 0) + return; + + dspace = doi.doi_physical_blocks_512 << 9; + mspace = doi.doi_fill_count * doi.doi_data_block_size; + + ddt_object_name(ddt, type, class, name); + + (void) printf("%s: %llu entries, size %llu on disk, %llu in core\n", + name, + (u_longlong_t)count, + (u_longlong_t)(dspace / count), + (u_longlong_t)(mspace / count)); + + if (dump_opt['D'] < 3) + return; + + zpool_dump_ddt(NULL, &ddt->ddt_histogram[type][class]); + + if (dump_opt['D'] < 4) + return; + + if (dump_opt['D'] < 5 && class == DDT_CLASS_UNIQUE) + return; + + (void) printf("%s contents:\n\n", name); + + while ((error = ddt_object_walk(ddt, type, class, &walk, &dde)) == 0) + dump_dde(ddt, &dde, walk); + + ASSERT(error == ENOENT); + + (void) printf("\n"); +} + +static void +dump_all_ddts(spa_t *spa) +{ + ddt_histogram_t ddh_total = { 0 }; + ddt_stat_t dds_total = { 0 }; + + for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) { + ddt_t *ddt = spa->spa_ddt[c]; + for (enum ddt_type type = 0; type < DDT_TYPES; type++) { + for (enum ddt_class class = 0; class < DDT_CLASSES; + class++) { + dump_ddt(ddt, type, class); + } + } + } + + ddt_get_dedup_stats(spa, &dds_total); + + if (dds_total.dds_blocks == 0) { + (void) printf("All DDTs are empty\n"); + return; + } + + (void) printf("\n"); + + if (dump_opt['D'] > 1) { + (void) printf("DDT histogram (aggregated over all DDTs):\n"); + ddt_get_dedup_histogram(spa, &ddh_total); + zpool_dump_ddt(&dds_total, &ddh_total); + } + + dump_dedup_ratio(&dds_total); +} + +static void dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) { char *prefix = (void *)sm; @@ -568,7 +784,7 @@ dump_dtl(vdev_t *vd, int indent) char *name[DTL_TYPES] = { "missing", "partial", "scrub", "outage" }; char prefix[256]; - spa_vdev_state_enter(spa); + spa_vdev_state_enter(spa, SCL_NONE); required = vdev_dtl_required(vd); (void) spa_vdev_state_exit(spa, NULL, 0); @@ -598,6 +814,68 @@ dump_dtl(vdev_t *vd, int indent) dump_dtl(vd->vdev_child[c], indent + 4); } +static void +dump_history(spa_t *spa) +{ + nvlist_t **events = NULL; + char buf[SPA_MAXBLOCKSIZE]; + uint64_t resid, len, off = 0; + uint_t num = 0; + int error; + time_t tsec; + struct tm t; + char tbuf[30]; + char internalstr[MAXPATHLEN]; + + do { + len = sizeof (buf); + + if ((error = spa_history_get(spa, &off, &len, buf)) != 0) { + (void) fprintf(stderr, "Unable to read history: " + "error %d\n", error); + return; + } + + if (zpool_history_unpack(buf, len, &resid, &events, &num) != 0) + break; + + off -= resid; + } while (len != 0); + + (void) printf("\nHistory:\n"); + for (int i = 0; i < num; i++) { + uint64_t time, txg, ievent; + char *cmd, *intstr; + + if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, + &time) != 0) + continue; + if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, + &cmd) != 0) { + if (nvlist_lookup_uint64(events[i], + ZPOOL_HIST_INT_EVENT, &ievent) != 0) + continue; + verify(nvlist_lookup_uint64(events[i], + ZPOOL_HIST_TXG, &txg) == 0); + verify(nvlist_lookup_string(events[i], + ZPOOL_HIST_INT_STR, &intstr) == 0); + if (ievent >= LOG_END) + continue; + + (void) snprintf(internalstr, + sizeof (internalstr), + "[internal %s txg:%lld] %s", + zfs_history_event_names[ievent], txg, + intstr); + cmd = internalstr; + } + tsec = time; + (void) localtime_r(&tsec, &t); + (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); + (void) printf("%s %s\n", tbuf, cmd); + } +} + /*ARGSUSED*/ static void dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) @@ -605,35 +883,48 @@ dump_dnode(objset_t *os, uint64_t object } static uint64_t -blkid2offset(const dnode_phys_t *dnp, int level, uint64_t blkid) +blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb) { - if (level < 0) - return (blkid); + if (dnp == NULL) { + ASSERT(zb->zb_level < 0); + if (zb->zb_object == 0) + return (zb->zb_blkid); + return (zb->zb_blkid * BP_GET_LSIZE(bp)); + } + + ASSERT(zb->zb_level >= 0); - return ((blkid << (level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) * + return ((zb->zb_blkid << + (zb->zb_level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) * dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); } static void -sprintf_blkptr_compact(char *blkbuf, blkptr_t *bp, int alldvas) +sprintf_blkptr_compact(char *blkbuf, const blkptr_t *bp) { - dva_t *dva = bp->blk_dva; - int ndvas = alldvas ? BP_GET_NDVAS(bp) : 1; - int i; + const dva_t *dva = bp->blk_dva; + int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; + + if (dump_opt['b'] >= 5) { + sprintf_blkptr(blkbuf, bp); + return; + } blkbuf[0] = '\0'; - for (i = 0; i < ndvas; i++) + for (int i = 0; i < ndvas; i++) (void) sprintf(blkbuf + strlen(blkbuf), "%llu:%llx:%llx ", (u_longlong_t)DVA_GET_VDEV(&dva[i]), (u_longlong_t)DVA_GET_OFFSET(&dva[i]), (u_longlong_t)DVA_GET_ASIZE(&dva[i])); - (void) sprintf(blkbuf + strlen(blkbuf), "%llxL/%llxP F=%llu B=%llu", + (void) sprintf(blkbuf + strlen(blkbuf), + "%llxL/%llxP F=%llu B=%llu/%llu", (u_longlong_t)BP_GET_LSIZE(bp), *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 19:44:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 781CC106566C; Sun, 27 Feb 2011 19:44:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6666F8FC0C; Sun, 27 Feb 2011 19:44:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RJiAGE000479; Sun, 27 Feb 2011 19:44:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RJiAEK000476; Sun, 27 Feb 2011 19:44:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102271944.p1RJiAEK000476@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 27 Feb 2011 19:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219090 - in head: . etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 19:44:10 -0000 Author: pjd Date: Sun Feb 27 19:44:10 2011 New Revision: 219090 URL: http://svn.freebsd.org/changeset/base/219090 Log: Commit two more files missed in r219089. MFC after: 1 month Modified: head/Makefile.inc1 head/etc/rc.d/zvol Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Feb 27 19:41:40 2011 (r219089) +++ head/Makefile.inc1 Sun Feb 27 19:44:10 2011 (r219090) @@ -1153,6 +1153,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ + ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1166,6 +1167,7 @@ _generic_libs= ${_cddl_lib} gnu/lib ${_k lib/libopie__L lib/libtacplus__L: lib/libmd__L .if ${MK_CDDL} != "no" +_cddl_lib_libumem= cddl/lib/libumem _cddl_lib= cddl/lib .endif Modified: head/etc/rc.d/zvol ============================================================================== --- head/etc/rc.d/zvol Sun Feb 27 19:41:40 2011 (r219089) +++ head/etc/rc.d/zvol Sun Feb 27 19:44:10 2011 (r219090) @@ -17,7 +17,6 @@ required_modules="zfs" zvol_start() { - zfs volinit # Enable swap on ZVOLs with property org.freebsd:swap=on. zfs list -H -o org.freebsd:swap,name -t volume | \ while read state name; do @@ -40,7 +39,6 @@ zvol_stop() ;; esac done - zfs volfini } load_rc_config $name From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 21:32:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A2AF106566B; Sun, 27 Feb 2011 21:32:26 +0000 (UTC) (envelope-from versus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C52BC8FC13; Sun, 27 Feb 2011 21:32:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1RLWPp9007792; Sun, 27 Feb 2011 21:32:25 GMT (envelope-from versus@svn.freebsd.org) Received: (from versus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RLWPZJ007789; Sun, 27 Feb 2011 21:32:25 GMT (envelope-from versus@svn.freebsd.org) Message-Id: <201102272132.p1RLWPZJ007789@svn.freebsd.org> From: Konrad Jankowski Date: Sun, 27 Feb 2011 21:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219091 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 21:32:26 -0000 Author: versus Date: Sun Feb 27 21:32:25 2011 New Revision: 219091 URL: http://svn.freebsd.org/changeset/base/219091 Log: Partial fix for PR 91106. Correct the short weekday names. Done according to this poll https://bugzilla.redhat.com/show_bug.cgi?id=242296. This will not close the bug fully yet, as the month names are still not correctly in Genitive. More research on this topic will be done, as I'm suspecting a bug in the libc locale functions picking the month name from the wrong group. PR: conf/91106 Approved by: gavin (mentor) MFC after: 1 month Modified: head/share/timedef/pl_PL.ISO8859-2.src head/share/timedef/pl_PL.UTF-8.src Modified: head/share/timedef/pl_PL.ISO8859-2.src ============================================================================== --- head/share/timedef/pl_PL.ISO8859-2.src Sun Feb 27 19:44:10 2011 (r219090) +++ head/share/timedef/pl_PL.ISO8859-2.src Sun Feb 27 21:32:25 2011 (r219091) @@ -32,12 +32,12 @@ grudnia # # Short weekday names # -ndz +nie pon wto ¶ro czw -ptk +pi± sob # # Long weekday names Modified: head/share/timedef/pl_PL.UTF-8.src ============================================================================== --- head/share/timedef/pl_PL.UTF-8.src Sun Feb 27 19:44:10 2011 (r219090) +++ head/share/timedef/pl_PL.UTF-8.src Sun Feb 27 21:32:25 2011 (r219091) @@ -32,12 +32,12 @@ grudnia # # Short weekday names # -ndz +nie pon wto Å›ro czw -ptk +piÄ… sob # # Long weekday names From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 21:41:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EBA81065673; Sun, 27 Feb 2011 21:41:12 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id A0A158FC15; Sun, 27 Feb 2011 21:41:11 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id C7007E8C8A; Sun, 27 Feb 2011 21:41:10 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=subject :from:to:cc:in-reply-to:references:content-type:date:message-id :mime-version:content-transfer-encoding; s=mail; bh=nEkFDJYxUENB 7H3tkxulc/C2vcs=; b=y3+0+5Hr3904Q2TNLnQkkJ3PhGBSUkl8FXpP94qDwZBD +XsrxSsPBQ1cLhsHHtXr/V6jwDX6O43FTPMYu2rlwm7pEHJuEmNhdq2u+ze6z1k6 FQga8+As3OyaYUhe0nAouSWng/BZNW6pT73yYssAJDG/S1lp9DGYY5wUXOVZcWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=subject:from :to:cc:in-reply-to:references:content-type:date:message-id :mime-version:content-transfer-encoding; q=dns; s=mail; b=haJ8Ut CmeX7e9lB2VpYgYUL1BzYAi/TizsI3WD9of2lrVrU9NFvC7gxQnIjsY17P9HOSbZ E81J+/UjfnSyq5kkq/ol5Olp8x/yIWcVSuiKUohxSOjolaaXJn/ZrVT1pHfLIxwo p497j30f5OWEcfY1TIokdgzJ9Qm44Dqx57ZKw= Received: from [192.168.0.10] (client-86-31-236-253.oxfd.adsl.virginmedia.com [86.31.236.253]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 68A67E785C; Sun, 27 Feb 2011 21:41:10 +0000 (GMT) From: Bruce Cran To: Konrad Jankowski In-Reply-To: <201102272132.p1RLWPZJ007789@svn.freebsd.org> References: <201102272132.p1RLWPZJ007789@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Feb 2011 21:40:49 +0000 Message-ID: <1298842849.10001.4.camel@core.nessbank> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219091 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 21:41:12 -0000 On Sun, 2011-02-27 at 21:32 +0000, Konrad Jankowski wrote: > Author: versus > Date: Sun Feb 27 21:32:25 2011 > New Revision: 219091 > URL: http://svn.freebsd.org/changeset/base/219091 > > Log: > Partial fix for PR 91106. Correct the short weekday names. Done according to this poll https://bugzilla.redhat.com/show_bug.cgi?id=242296. This will not close the bug fully yet, as the month names are still not correctly in Genitive. More research on this topic will be done, as I'm suspecting a bug in the libc locale functions picking the month name from the wrong group. Could you limit lines to 80 characters please? If you use vim, the following in ~/.vimrc will cause it to highlight overly long lines in red: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.\+/ -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sun Feb 27 22:53:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 151F9106564A; Sun, 27 Feb 2011 22:53:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from doug-optiplex.ka9q.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 8DFBB150BA0; Sun, 27 Feb 2011 22:52:42 +0000 (UTC) Message-ID: <4D6AD5BA.8070700@FreeBSD.org> Date: Sun, 27 Feb 2011 14:52:42 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110129 Thunderbird/3.1.7 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201102271941.p1RJfePI000348@svn.freebsd.org> In-Reply-To: <201102271941.p1RJfePI000348@svn.freebsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219089 - in head: cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/stat cddl/contrib/opensolaris/cmd/stat/common cddl/contrib/opensolaris/cmd/z... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 22:53:17 -0000 On 02/27/2011 11:41, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Sun Feb 27 19:41:40 2011 > New Revision: 219089 > URL: http://svn.freebsd.org/changeset/base/219089 > > Log: > Finally... Import the latest open-source ZFS version - (SPA) 28. Has this been successfully built with clang? It failed for me with -DNO_CLEAN, restarting now with a clean /obj directory. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 05:45:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDBD106564A; Mon, 28 Feb 2011 05:45:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D5758FC0C; Mon, 28 Feb 2011 05:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1S5jVHq026616; Mon, 28 Feb 2011 05:45:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1S5jVuY026614; Mon, 28 Feb 2011 05:45:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201102280545.p1S5jVuY026614@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 28 Feb 2011 05:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219092 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 05:45:31 -0000 Author: pjd Date: Mon Feb 28 05:45:31 2011 New Revision: 219092 URL: http://svn.freebsd.org/changeset/base/219092 Log: Use proper lock in assertion. MFC after: 1 month Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Sun Feb 27 21:32:25 2011 (r219091) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c Mon Feb 28 05:45:31 2011 (r219092) @@ -94,7 +94,7 @@ ddi_get_soft_state_locked(struct ddi_sof { struct ddi_soft_state_item *itemp; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&ss->ss_lock)); LIST_FOREACH(itemp, &ss->ss_list, ssi_next) { if (itemp->ssi_item == item) @@ -142,7 +142,7 @@ ddi_soft_state_free_locked(struct ddi_so { struct ddi_soft_state_item *itemp; - ASSERT(MUTEX_HELD(&zfsdev_state_lock)); + ASSERT(MUTEX_HELD(&ss->ss_lock)); LIST_FOREACH(itemp, &ss->ss_list, ssi_next) { if (itemp->ssi_item == item) From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 06:54:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81170106566C; Mon, 28 Feb 2011 06:54:15 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FF978FC08; Mon, 28 Feb 2011 06:54:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1S6sFJ3028158; Mon, 28 Feb 2011 06:54:15 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1S6sF7M028156; Mon, 28 Feb 2011 06:54:15 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201102280654.p1S6sF7M028156@svn.freebsd.org> From: "Simon L. Nielsen" Date: Mon, 28 Feb 2011 06:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219093 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 06:54:15 -0000 Author: simon Date: Mon Feb 28 06:54:14 2011 New Revision: 219093 URL: http://svn.freebsd.org/changeset/base/219093 Log: Drop my OpenSSL maintainer hat. I don't have the motivation to keep chasing updates etc. Leave a reminder not to commit non-upstream changes (ref: Debian random...). Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Feb 28 05:45:31 2011 (r219092) +++ head/MAINTAINERS Mon Feb 28 06:54:14 2011 (r219093) @@ -107,7 +107,7 @@ linux emul emulation Please discuss chan bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. -openssl simon Pre-commit review requested. +openssl - No non-upstream commits should be done. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 07:52:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EAD01065675; Mon, 28 Feb 2011 07:52:12 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id BC5788FC18; Mon, 28 Feb 2011 07:52:11 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 85D2045E5C; Mon, 28 Feb 2011 08:52:09 +0100 (CET) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5A5CB45683; Mon, 28 Feb 2011 08:52:04 +0100 (CET) Date: Mon, 28 Feb 2011 08:51:43 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20110228075143.GA1819@garage.freebsd.pl> References: <201102271941.p1RJfePI000348@svn.freebsd.org> <4D6AD5BA.8070700@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <4D6AD5BA.8070700@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219089 - in head: cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/stat cddl/contrib/opensolaris/cmd/stat/common cddl/contrib/opensolaris/cmd/z... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 07:52:12 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 27, 2011 at 02:52:42PM -0800, Doug Barton wrote: > On 02/27/2011 11:41, Pawel Jakub Dawidek wrote: > >Author: pjd > >Date: Sun Feb 27 19:41:40 2011 > >New Revision: 219089 > >URL: http://svn.freebsd.org/changeset/base/219089 > > > >Log: > > Finally... Import the latest open-source ZFS version - (SPA) 28. >=20 > Has this been successfully built with clang? [...] I haven't tried clang. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk1rVA8ACgkQForvXbEpPzRcZgCeI9DeS4IR/pN+ggSlvvvQb5v1 dAUAoJvR9IS/uP+L9w/7YoJQ+8Ambkap =wxuy -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 07:56:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F346106566B; Mon, 28 Feb 2011 07:56:07 +0000 (UTC) (envelope-from lichave@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 16CD88FC12; Mon, 28 Feb 2011 07:56:06 +0000 (UTC) Received: by vws16 with SMTP id 16so3351176vws.13 for ; Sun, 27 Feb 2011 23:56:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/iDRNWS9CB5Hgppp+c70Xp/UgCZvhMleRPhdlqPR9rg=; b=Ub3aCY4Knj4NR574iNoRwenDTGtSLXYEaZ5Q+EZJyJotiHtt/1JwC8DnNESx/5IEg4 gvUuNUcelYmG4v8zTRjv/3xqskw4mNvnofbBGS3K/c9sf2N42OFGP2IFrPrnOfqE1Sl+ rmZI6xnt4RUGdZAbFEFCNC4cyUfOsxhBj2pp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=IdOb4oXtjJ+QLzAvRcy3zMWsbwiaBCmgB1IP6+gyoQ/14Kbd0HeCAM+4gepG06WyBz uXuindbMLeeH7zNblW64BwjiAwVC3FqgaCN360YrJT4gXqhiOV28z6Fgv+Ht4+HnzsFj x0kYVocV8l0Qx5acH5GFD0qOBEvH/746SulYI= Received: by 10.52.158.100 with SMTP id wt4mr8371247vdb.144.1298878262152; Sun, 27 Feb 2011 23:31:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.161.234 with HTTP; Sun, 27 Feb 2011 23:30:40 -0800 (PST) In-Reply-To: <1298842849.10001.4.camel@core.nessbank> References: <201102272132.p1RLWPZJ007789@svn.freebsd.org> <1298842849.10001.4.camel@core.nessbank> From: Konrad Jankowski Date: Mon, 28 Feb 2011 08:30:40 +0100 Message-ID: To: Bruce Cran Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219091 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: versus@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 07:56:07 -0000 On Sun, Feb 27, 2011 at 10:40 PM, Bruce Cran wrote: > On Sun, 2011-02-27 at 21:32 +0000, Konrad Jankowski wrote: >> Author: versus >> Date: Sun Feb 27 21:32:25 2011 >> New Revision: 219091 >> URL: http://svn.freebsd.org/changeset/base/219091 >> >> Log: >> =C2=A0 Partial fix for PR 91106. Correct the short weekday names. Done a= ccording to this poll https://bugzilla.redhat.com/show_bug.cgi?id=3D242296.= This will not close the bug fully yet, as the month names are still not co= rrectly in Genitive. More research on this topic will be done, as I'm suspe= cting a bug in the libc locale functions picking the month name from the wr= ong group. > > Could you limit lines to 80 characters please? > If you use vim, the following in ~/.vimrc will cause it to highlight > overly long lines in red: > > highlight OverLength ctermbg=3Dred ctermfg=3Dwhite guibg=3D#592929 > match OverLength /\%81v.\+/ Sure, sorry about that, it won't happen again. --=20 Konrad Jankowski From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 08:59:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD4FB1065670; Mon, 28 Feb 2011 08:59:35 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBD3F8FC16; Mon, 28 Feb 2011 08:59:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1S8xZRM031248; Mon, 28 Feb 2011 08:59:35 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1S8xZ2P031246; Mon, 28 Feb 2011 08:59:35 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201102280859.p1S8xZ2P031246@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 28 Feb 2011 08:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219094 - head/usr.sbin/fifolog/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 08:59:36 -0000 Author: phk Date: Mon Feb 28 08:59:35 2011 New Revision: 219094 URL: http://svn.freebsd.org/changeset/base/219094 Log: Don't override the perfectly good default ->zalloc and ->zfree functions. Modified: head/usr.sbin/fifolog/lib/fifolog_int.c Modified: head/usr.sbin/fifolog/lib/fifolog_int.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_int.c Mon Feb 28 06:54:14 2011 (r219093) +++ head/usr.sbin/fifolog/lib/fifolog_int.c Mon Feb 28 08:59:35 2011 (r219094) @@ -43,24 +43,6 @@ #include "libfifolog_int.h" /* - * Memory handling for zlib - */ - -static voidpf -fifo_zalloc(voidpf opaque __unused, uInt items, uInt size) -{ - - return calloc(items,size); -} - -static void -fifo_zfree(voidpf opaque __unused, voidpf address) -{ - - free(address); -} - -/* * Open a fifolog file or partition for reading or writing. * * Return value is NULL for success or a error description string to @@ -88,6 +70,7 @@ fifolog_int_open_i(struct fifolog_file * if (i != 0) { i = fstat(f->fd, &st); + assert(i == 0); if (!S_ISREG(st.st_mode)) return ("Neither disk nor regular file"); f->recsize = 512; @@ -145,8 +128,6 @@ fifolog_int_open_i(struct fifolog_file * f->zs = calloc(sizeof *f->zs, 1); if (f->zs == NULL) return ("cannot malloc"); - f->zs->zalloc = fifo_zalloc; - f->zs->zfree = fifo_zfree; return (NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 09:11:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B761B1065673; Mon, 28 Feb 2011 09:11:46 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46088FC0C; Mon, 28 Feb 2011 09:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1S9BkDP031598; Mon, 28 Feb 2011 09:11:46 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1S9Bk76031590; Mon, 28 Feb 2011 09:11:46 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201102280911.p1S9Bk76031590@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 28 Feb 2011 09:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219095 - in head/usr.sbin/fifolog: . fifolog_writer lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 09:11:46 -0000 Author: phk Date: Mon Feb 28 09:11:46 2011 New Revision: 219095 URL: http://svn.freebsd.org/changeset/base/219095 Log: Update fifolog internals to match main version: Rename ...write_bytes... to ...write_records..., that's what they do. Move writer .h stuff into writer private .h file. Change logic in writer to support both fifolog usage in FreeBSD and Measured usage better, by always using an input buffer. Various cleanups. Modified: head/usr.sbin/fifolog/fifolog_writer/fifolog_writer.c head/usr.sbin/fifolog/flint.lnt head/usr.sbin/fifolog/lib/fifolog_create.c head/usr.sbin/fifolog/lib/fifolog_write.h head/usr.sbin/fifolog/lib/fifolog_write_poll.c head/usr.sbin/fifolog/lib/libfifolog.h head/usr.sbin/fifolog/lib/libfifolog_int.h Modified: head/usr.sbin/fifolog/fifolog_writer/fifolog_writer.c ============================================================================== --- head/usr.sbin/fifolog/fifolog_writer/fifolog_writer.c Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/fifolog_writer/fifolog_writer.c Mon Feb 28 09:11:46 2011 (r219095) @@ -42,7 +42,8 @@ static void usage(void) { - fprintf(stderr, "Usage: fifolog_writer [-w write-rate] [-s sync-rate] " + fprintf(stderr, + "Usage: fifolog_writer [-w write-rate] [-s sync-rate] " "[-z compression] file\n"); exit(EX_USAGE); } @@ -105,10 +106,10 @@ main(int argc, char * const *argv) p--; *p = '\0'; if (*buf != '\0') - fifolog_write_bytes_poll(f, 0, 0, buf, 0); + fifolog_write_record_poll(f, 0, 0, buf, 0); } else if (i == 0) - (void)fifolog_write_poll(f, 0); + fifolog_write_poll(f, 0); } - (void)fifolog_write_flush(f); + fifolog_write_close(f); return (0); } Modified: head/usr.sbin/fifolog/flint.lnt ============================================================================== --- head/usr.sbin/fifolog/flint.lnt Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/flint.lnt Mon Feb 28 09:11:46 2011 (r219095) @@ -1,49 +1,55 @@ // $FreeBSD$ // FlexeLint file for fifolog tools // - --passes=3 --ffc - -// GCC --cgnu -+d__FreeBSD__=7 -+d__GNUC__=4 -+d__GNUC_MINOR__=2 -+d__FreeBSD_cc_version=700003 -+d__attribute__()= --d__builtin_va_list=void* // used by stdarg.h -// -d__builtin_stdarg_start()=_to_semi // ditto -// -d__builtin_va_start(a,b)=((void)(b),(a)=0) // ditto -// -d__builtin_va_end()=_to_semi // ditto -+rw(__inline) // enable the (non-standard) __inline keyword -+rw(__inline__) // enable the (non-standard) __inline__ keyword - -+d"__unused=/*lint -e{715} -e{818} */" - --e537 // Repeated include file --elib(652) // #define of symbol '...' declared previously --function(exit,__assert) --function(exit,err) --function(exit,errx) --e716 // while(1) ... --e717 // do ... while(0) - -// Ignore return values +// +//-passes=3 +//-ffc +// +//// GCC +//-cgnu +//+d__FreeBSD__=7 +//+d__GNUC__=4 +//+d__GNUC_MINOR__=2 +//+d__FreeBSD_cc_version=700003 +//+d__attribute__()= +//-d__builtin_va_list=void* // used by stdarg.h +//// -d__builtin_stdarg_start()=_to_semi // ditto +//// -d__builtin_va_start(a,b)=((void)(b),(a)=0) // ditto +//// -d__builtin_va_end()=_to_semi // ditto +//+rw(__inline) // enable the (non-standard) __inline keyword +//+rw(__inline__) // enable the (non-standard) __inline__ keyword +// +//+d"__unused=/*lint -e{715} -e{818} */" +// +//-e537 // Repeated include file +//-elib(652) // #define of symbol '...' declared previously +//-function(exit,__assert) +//-function(exit,err) +//-function(exit,errx) +//-e716 // while(1) ... +//-e717 // do ... while(0) +// +//// Ignore return values -esym(534, memset) -esym(534, memcpy) -esym(534, strcpy) --esym(534, printf) +//-esym(534, printf) -esym(534, time) -esym(534, fprintf) --esym(534, vfprintf) - -+libh(fifolog.h) -+libh(miniobj.h) -+libh(libfifolog.h) +//-esym(534, vfprintf) +// +//+libh(fifolog.h) +//+libh(miniobj.h) +//+libh(libfifolog.h) +// +//-e713 // loss of precision sign/unsigned +//-e732 // loss of sign +//-e734 // loss of precision assignment +//-e737 // loss of sign in promotion int->unsigned +//-e573 // sign/unsign mix in divide --e713 // loss of precision sign/unsigned --e732 // loss of sign --e734 // loss of precision assignment --e737 // loss of sign in promotion int->unsigned --e573 // sign/unsign mix in divide +-e712 // Loss of precision (___) (___ to ___) +-e713 // Loss of precision (___) (___ to ___) +-e716 // while(1) ... +-e732 // Loss of sign (___) (___ to ___) +-e747 // Significant prototype coercion (___) ___ to ___ Modified: head/usr.sbin/fifolog/lib/fifolog_create.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_create.c Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/lib/fifolog_create.c Mon Feb 28 09:11:46 2011 (r219095) @@ -41,7 +41,7 @@ #include "libfifolog.h" const char * -fifolog_create(const char *fn, off_t size, unsigned recsize) +fifolog_create(const char *fn, off_t size, ssize_t recsize) { int i, fd; unsigned u; @@ -103,7 +103,7 @@ fifolog_create(const char *fn, off_t siz strcpy(buf, FIFOLOG_FMT_MAGIC); /*lint !e64 */ be32enc(buf + FIFOLOG_OFF_BS, recsize); - if ((int)recsize != pwrite(fd, buf, recsize, 0)) { + if (recsize != pwrite(fd, buf, recsize, 0)) { i = errno; free(buf); errno = i; Modified: head/usr.sbin/fifolog/lib/fifolog_write.h ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write.h Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/lib/fifolog_write.h Mon Feb 28 09:11:46 2011 (r219095) @@ -50,16 +50,26 @@ struct fifolog_writer { uint32_t seq; off_t recno; - int flag; + uint8_t flag; time_t last; - u_int obufsize; + ssize_t obufsize; u_char *obuf; - u_int ibufsize; + ssize_t ibufsize; + ssize_t ibufptr; u_char *ibuf; time_t starttime; time_t lastwrite; time_t lastsync; }; + +struct fifolog_writer *fifolog_write_new(void); +const char *fifolog_write_open(struct fifolog_writer *f, const char *fn, unsigned writerate, unsigned syncrate, unsigned compression); +int fifolog_write_record(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, ssize_t len); +int fifolog_write_poll(struct fifolog_writer *f, time_t now); +int fifolog_write_record_poll(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, ssize_t len); +void fifolog_write_close(struct fifolog_writer *f); +void fifolog_write_destroy(struct fifolog_writer *f); +extern const char *fifolog_write_statnames[]; Modified: head/usr.sbin/fifolog/lib/fifolog_write_poll.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write_poll.c Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/lib/fifolog_write_poll.c Mon Feb 28 09:11:46 2011 (r219095) @@ -31,20 +31,19 @@ #include #include #include +#include #include #include -#if 0 -#include -#endif #include #include "fifolog.h" -#include "libfifolog.h" #include "libfifolog_int.h" #include "fifolog_write.h" #include "miniobj.h" +static int fifolog_write_gzip(struct fifolog_writer *f, time_t now); + #define ALLOC(ptr, size) do { \ (*(ptr)) = calloc(size, 1); \ assert(*(ptr) != NULL); \ @@ -60,7 +59,7 @@ const char *fifolog_write_statnames[] = [FIFOLOG_PT_RUNTIME] = "Runtime" }; -/* +/********************************************************************** * Check that everything is all right */ static void @@ -72,6 +71,10 @@ fifolog_write_assert(const struct fifolo f->obuf + f->obufsize); } +/********************************************************************** + * Allocate/Destroy a new fifolog writer instance + */ + struct fifolog_writer * fifolog_write_new(void) { @@ -85,24 +88,35 @@ fifolog_write_new(void) void fifolog_write_destroy(struct fifolog_writer *f) { - CHECK_OBJ_NOTNULL(f, FIFOLOG_WRITER_MAGIC); - free(f); + + free(f->obuf); + free(f->ibuf); + FREE_OBJ(f); } +/********************************************************************** + * Open/Close the fifolog + */ + void fifolog_write_close(struct fifolog_writer *f) { + time_t now; CHECK_OBJ_NOTNULL(f, FIFOLOG_WRITER_MAGIC); + fifolog_write_assert(f); + + f->cleanup = 1; + time(&now); + fifolog_write_gzip(f, now); + fifolog_write_assert(f); fifolog_int_close(&f->ff); free(f->ff); - if (f->obuf != NULL) - free(f->obuf); - free(f); } const char * -fifolog_write_open(struct fifolog_writer *f, const char *fn, unsigned writerate, unsigned syncrate, int compression) +fifolog_write_open(struct fifolog_writer *f, const char *fn, + unsigned writerate, unsigned syncrate, unsigned compression) { const char *es; int i; @@ -112,8 +126,7 @@ fifolog_write_open(struct fifolog_writer CHECK_OBJ_NOTNULL(f, FIFOLOG_WRITER_MAGIC); /* Check for legal compression value */ - if (compression < Z_DEFAULT_COMPRESSION || - compression > Z_BEST_COMPRESSION) + if (compression > Z_BEST_COMPRESSION) return ("Illegal compression value"); f->writerate = writerate; @@ -144,6 +157,10 @@ fifolog_write_open(struct fifolog_writer f->obufsize = f->ff->recsize; ALLOC(&f->obuf, f->obufsize); + f->ibufsize = f->obufsize * 10; + ALLOC(&f->ibuf, f->ibufsize); + f->ibufptr = 0; + i = deflateInit(f->ff->zs, (int)f->compression); assert(i == Z_OK); @@ -161,11 +178,17 @@ fifolog_write_open(struct fifolog_writer return (NULL); } +/********************************************************************** + * Write an output record + * Returns -1 if there are trouble writing data + */ + static int fifolog_write_output(struct fifolog_writer *f, int fl, time_t now) { long h, l = f->ff->zs->next_out - f->obuf; - int i, w; + ssize_t i, w; + int retval = 0; h = 4; /* seq */ be32enc(f->obuf, f->seq); @@ -176,13 +199,14 @@ fifolog_write_output(struct fifolog_writ h += 4; /* timestamp */ } - assert(l <= (long)f->ff->recsize); + assert(l <= (long)f->ff->recsize); /* NB: l includes h */ assert(l >= h); + + /* We will never write an entirely empty buffer */ if (l == h) return (0); - - if (h + l < (long)f->ff->recsize && fl == Z_NO_FLUSH) + if (l < (long)f->ff->recsize && fl == Z_NO_FLUSH) return (0); w = f->ff->recsize - l; @@ -190,117 +214,111 @@ fifolog_write_output(struct fifolog_writ be32enc(f->obuf + f->ff->recsize - 4, w); f->obuf[4] |= FIFOLOG_FLG_4BYTE; } else if (w > 0) { - f->obuf[f->ff->recsize - 1] = w; + f->obuf[f->ff->recsize - 1] = (uint8_t)w; f->obuf[4] |= FIFOLOG_FLG_1BYTE; } - f->cnt[FIFOLOG_PT_BYTES_POST] += w; - -#ifdef DBG -fprintf(stderr, "W: fl=%d h=%ld l=%ld w=%d recno=%jd fx %02x\n", - fl, h, l, w, f->recno, f->obuf[4]); -#endif + f->cnt[FIFOLOG_PT_BYTES_POST] += l - h; i = pwrite(f->ff->fd, f->obuf, f->ff->recsize, (f->recno + 1) * f->ff->recsize); - assert(i == (int)f->ff->recsize); + if (i != f->ff->recsize) + retval = -1; + else + retval = 1; f->cnt[FIFOLOG_PT_WRITES]++; + f->cnt[FIFOLOG_PT_RUNTIME] = now - f->starttime; f->lastwrite = now; + /* + * We increment these even on error, so as to properly skip bad, + * sectors or other light trouble. + */ f->seq++; f->recno++; -#ifdef DBG -if (f->flag) -fprintf(stderr, "SYNC- %d\n", __LINE__); -#endif f->flag = 0; memset(f->obuf, 0, f->obufsize); f->ff->zs->next_out = f->obuf + 5; f->ff->zs->avail_out = f->obufsize - 5; - return (1); + return (retval); } -static void -fifolog_write_gzip(struct fifolog_writer *f, const void *p, int len, time_t now, int fin) -{ - int i, fl; +/********************************************************************** + * Run the compression engine + * Returns -1 if there are trouble writing data + */ - f->cnt[FIFOLOG_PT_BYTES_PRE] += len; +static int +fifolog_write_gzip(struct fifolog_writer *f, time_t now) +{ + int i, fl, retval = 0; - if (fin == 0) - fl = Z_NO_FLUSH; - else if (f->cleanup || now >= (int)(f->lastsync + f->syncrate)) { + assert(now != 0); + if (f->cleanup || now >= (int)(f->lastsync + f->syncrate)) { f->cleanup = 0; fl = Z_FINISH; f->cnt[FIFOLOG_PT_SYNC]++; } else if (now >= (int)(f->lastwrite + f->writerate)) { fl = Z_SYNC_FLUSH; f->cnt[FIFOLOG_PT_FLUSH]++; - } else if (p == NULL) - return; + } else if (f->ibufptr == 0) + return (0); else fl = Z_NO_FLUSH; - f->ff->zs->avail_in = len; - f->ff->zs->next_in = (void*)(uintptr_t)p; -#ifdef DBG -if (fl != Z_NO_FLUSH) -fprintf(stderr, "Z len %3d fin %d now %ld fl %d ai %u ao %u\n", - len, fin, now, fl, - f->ff->zs->avail_in, - f->ff->zs->avail_out); -#endif + f->ff->zs->avail_in = f->ibufptr; + f->ff->zs->next_in = f->ibuf; while (1) { i = deflate(f->ff->zs, fl); - -#ifdef DBG -if (i || f->ff->zs->avail_in) -fprintf(stderr, "fl = %d, i = %d ai = %u ao = %u fx=%02x\n", fl, i, - f->ff->zs->avail_in, - f->ff->zs->avail_out, f->flag); -#endif - assert(i == Z_OK || i == Z_BUF_ERROR || i == Z_STREAM_END); - assert(f->ff->zs->avail_in == 0); - if (!fifolog_write_output(f, fl, now)) + i = fifolog_write_output(f, fl, now); + if (i == 0) break; + if (i < 0) + retval = -1; } assert(f->ff->zs->avail_in == 0); + f->ibufptr = 0; if (fl == Z_FINISH) { f->flag |= FIFOLOG_FLG_SYNC; f->ff->zs->next_out = f->obuf + 9; f->ff->zs->avail_out = f->obufsize - 9; f->lastsync = now; -#ifdef DBG -fprintf(stderr, "SYNC %d\n", __LINE__); -#endif assert(Z_OK == deflateReset(f->ff->zs)); } + return (retval); } +/********************************************************************** + * Poll to see if we need to flush out a record + * Returns -1 if there are trouble writing data + */ + int fifolog_write_poll(struct fifolog_writer *f, time_t now) { + if (now == 0) time(&now); - fifolog_write_gzip(f, NULL, 0, now, 1); - return (0); + return (fifolog_write_gzip(f, now)); } -/* - * Attempt to write an entry. +/********************************************************************** + * Attempt to write an entry into the ibuf. * Return zero if there is no space, one otherwise */ int -fifolog_write_bytes(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, unsigned len) +fifolog_write_record(struct fifolog_writer *f, uint32_t id, time_t now, + const void *ptr, ssize_t len) { const unsigned char *p; - uint8_t buf[4]; + uint8_t buf[9]; + unsigned bufl; fifolog_write_assert(f); assert(!(id & (FIFOLOG_TIMESTAMP|FIFOLOG_LENGTH))); @@ -308,94 +326,87 @@ fifolog_write_bytes(struct fifolog_write p = ptr; if (len == 0) { - len = strlen(ptr) + 1; + len = strlen(ptr); + len++; } else { assert(len <= 255); id |= FIFOLOG_LENGTH; } + assert (len > 0); - /* Now do timestamp, if needed */ + /* Do a timestamp, if needed */ if (now == 0) time(&now); - if (now != f->last) { + if (now != f->last) id |= FIFOLOG_TIMESTAMP; - f->last = now; - } /* Emit instance+flag */ be32enc(buf, id); - fifolog_write_gzip(f, buf, 4, now, 0); + bufl = 4; if (id & FIFOLOG_TIMESTAMP) { - be32enc(buf, (uint32_t)f->last); - fifolog_write_gzip(f, buf, 4, now, 0); - } - if (id & FIFOLOG_LENGTH) { - buf[0] = (u_char)len; - fifolog_write_gzip(f, buf, 1, now, 0); + be32enc(buf + bufl, (uint32_t)now); + bufl += 4; } + if (id & FIFOLOG_LENGTH) + buf[bufl++] = (u_char)len; - assert (len > 0); -#if 1 - if (len > f->ibufsize) { - free(f->ibuf); - f->ibufsize = len; - ALLOC(&f->ibuf, f->ibufsize); - } - memcpy(f->ibuf, p, len); - fifolog_write_gzip(f, f->ibuf, len, now, 1); -#else - fifolog_write_gzip(f, p, len, now, 1); -#endif - fifolog_write_assert(f); + if (bufl + len + f->ibufptr > f->ibufsize) + return (0); + + memcpy(f->ibuf + f->ibufptr, buf, bufl); + f->ibufptr += bufl; + memcpy(f->ibuf + f->ibufptr, p, len); + f->ibufptr += len; + f->cnt[FIFOLOG_PT_BYTES_PRE] += bufl + len; + + if (id & FIFOLOG_TIMESTAMP) + f->last = now; return (1); } -/* - * Write an entry, polling until success. +/********************************************************************** + * Write an entry, polling the gzip/writer until success. * Long binary entries are broken into 255 byte chunks. + * Returns -1 if there are problems writing data */ -void -fifolog_write_bytes_poll(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, unsigned len) +int +fifolog_write_record_poll(struct fifolog_writer *f, uint32_t id, time_t now, + const void *ptr, ssize_t len) { u_int l; const unsigned char *p; + int retval = 0; + if (now == 0) + time(&now); fifolog_write_assert(f); assert(!(id & (FIFOLOG_TIMESTAMP|FIFOLOG_LENGTH))); assert(ptr != NULL); if (len == 0) { - while (!fifolog_write_bytes(f, id, now, ptr, len)) { - (void)usleep(10000); + if (!fifolog_write_record(f, id, now, ptr, len)) { + if (fifolog_write_gzip(f, now) < 0) + retval = -1; + /* The string could be too long for the ibuf, so... */ + if (!fifolog_write_record(f, id, now, ptr, len)) + retval = -1; } } else { - p = ptr; for (p = ptr; len > 0; len -= l, p += l) { l = len; if (l > 255) l = 255; - while (!fifolog_write_bytes(f, id, now, p, l)) { - (void)usleep(10000); - } + while (!fifolog_write_record(f, id, now, p, l)) + if (fifolog_write_gzip(f, now) < 0) + retval = -1; } } + if (fifolog_write_gzip(f, now) < 0) + retval = -1; fifolog_write_assert(f); -} - -int -fifolog_write_flush(struct fifolog_writer *f) -{ - int i; - - fifolog_write_assert(f); - - f->cleanup = 1; - for (i = 0; fifolog_write_poll(f, 0); i = 1) - continue; - fifolog_write_assert(f); - return (i); + return (retval); } Modified: head/usr.sbin/fifolog/lib/libfifolog.h ============================================================================== --- head/usr.sbin/fifolog/lib/libfifolog.h Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/lib/libfifolog.h Mon Feb 28 09:11:46 2011 (r219095) @@ -29,21 +29,11 @@ #include /* CREATORS */ -const char *fifolog_create(const char *fn, off_t size, unsigned recsize); - +const char *fifolog_create(const char *fn, off_t size, ssize_t recsize); /* WRITERS */ -struct fifolog_writer; -struct fifolog_writer *fifolog_write_new(void); -const char *fifolog_write_open(struct fifolog_writer *f, const char *fn, unsigned writerate, unsigned syncrate, int compression); -int fifolog_write_bytes(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, unsigned len); -void fifolog_write_bytes_poll(struct fifolog_writer *f, uint32_t id, time_t now, const void *ptr, unsigned len); -int fifolog_write_poll(struct fifolog_writer *f, time_t now); -void fifolog_write_close(struct fifolog_writer *f); -void fifolog_write_destroy(struct fifolog_writer *f); -int fifolog_write_flush(struct fifolog_writer *f); -extern const char *fifolog_write_statnames[]; +#include "fifolog_write.h" /* READERS */ @@ -55,8 +45,3 @@ void fifolog_reader_process(struct fifol /* UTILS */ time_t get_date(char *p); - -#if (__FreeBSD__ < 7) -int expand_number(char *_buf, int64_t *_num); -#endif - Modified: head/usr.sbin/fifolog/lib/libfifolog_int.h ============================================================================== --- head/usr.sbin/fifolog/lib/libfifolog_int.h Mon Feb 28 08:59:35 2011 (r219094) +++ head/usr.sbin/fifolog/lib/libfifolog_int.h Mon Feb 28 09:11:46 2011 (r219095) @@ -30,7 +30,7 @@ struct fifolog_file { unsigned magic; #define FIFOLOG_FILE_MAGIC 0x307ea50d - unsigned recsize; + ssize_t recsize; off_t logsize; int fd; From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 10:03:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F082106566B; Mon, 28 Feb 2011 10:03:49 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BF878FC12; Mon, 28 Feb 2011 10:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SA3n8L032944; Mon, 28 Feb 2011 10:03:49 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SA3mfl032937; Mon, 28 Feb 2011 10:03:48 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201102281003.p1SA3mfl032937@svn.freebsd.org> From: Bruce Cran Date: Mon, 28 Feb 2011 10:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219096 - in head: lib/libc/yp lib/libelf share/man/man7 sys/boot/i386/cdboot sys/boot/pc98/cdboot usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 10:03:49 -0000 Author: brucec Date: Mon Feb 28 10:03:48 2011 New Revision: 219096 URL: http://svn.freebsd.org/changeset/base/219096 Log: Revert some of r177626. "in in" is valid in certain sentences. PR: 121490 MFC after: 3 days Modified: head/lib/libc/yp/xdryp.c head/lib/libelf/libelf_convert.m4 head/share/man/man7/security.7 head/sys/boot/i386/cdboot/cdboot.s head/sys/boot/pc98/cdboot/cdboot.s head/usr.bin/checknr/checknr.c Modified: head/lib/libc/yp/xdryp.c ============================================================================== --- head/lib/libc/yp/xdryp.c Mon Feb 28 09:11:46 2011 (r219095) +++ head/lib/libc/yp/xdryp.c Mon Feb 28 10:03:48 2011 (r219096) @@ -42,7 +42,7 @@ extern void *ypresp_data; * I'm leaving the xdr_datum() function in purely for backwards * compatibility. yplib.c doesn't actually use it, but it's listed * in yp_prot.h as being available, so it's probably a good idea to - * leave it in case somebody goes looking for it. + * leave it in in case somebody goes looking for it. */ typedef struct { char *dptr; Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Mon Feb 28 09:11:46 2011 (r219095) +++ head/lib/libelf/libelf_convert.m4 Mon Feb 28 10:03:48 2011 (r219096) @@ -136,7 +136,7 @@ __FBSDID("$FreeBSD$"); /* * Read in various integral values. The source pointer could be - * unaligned. Values are read in native byte order. The source + * unaligned. Values are read in in native byte order. The source * pointer is incremented appropriately. */ Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Mon Feb 28 09:11:46 2011 (r219095) +++ head/share/man/man7/security.7 Mon Feb 28 10:03:48 2011 (r219096) @@ -138,7 +138,7 @@ This gives you a convenient way to detec Making it impossible for an attacker to install a backdoor may actually be detrimental to your security because it will not close off the hole the attacker used to -break in the first place. +break in in the first place. .Pp Security remedies should always be implemented with a multi-layered .Dq onion peel Modified: head/sys/boot/i386/cdboot/cdboot.s ============================================================================== --- head/sys/boot/i386/cdboot/cdboot.s Mon Feb 28 09:11:46 2011 (r219095) +++ head/sys/boot/i386/cdboot/cdboot.s Mon Feb 28 10:03:48 2011 (r219096) @@ -174,7 +174,7 @@ lookup_path: push %si # Save file name lookup_found: # Found a loader file # # Load the binary into the buffer. Due to real mode addressing limitations -# we have to read it in 64k chunks. +# we have to read it in in 64k chunks. # mov DIR_SIZE(%bx),%eax # Read file length add $SECTOR_SIZE-1,%eax # Convert length to sectors Modified: head/sys/boot/pc98/cdboot/cdboot.s ============================================================================== --- head/sys/boot/pc98/cdboot/cdboot.s Mon Feb 28 09:11:46 2011 (r219095) +++ head/sys/boot/pc98/cdboot/cdboot.s Mon Feb 28 10:03:48 2011 (r219096) @@ -415,7 +415,7 @@ lookup_path: push %si # Save file name lookup_found: # Found a loader file # # Load the binary into the buffer. Due to real mode addressing limitations -# we have to read it in 64k chunks. +# we have to read it in in 64k chunks. # mov %es:DIR_SIZE(%bx),%eax # Read file length add $SECTOR_SIZE-1,%eax # Convert length to sectors Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Mon Feb 28 09:11:46 2011 (r219095) +++ head/usr.bin/checknr/checknr.c Mon Feb 28 10:03:48 2011 (r219096) @@ -79,7 +79,7 @@ struct stkstr { int opno; /* number of opening bracket */ int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ int parm; /* parm to size, font, etc */ - int lno; /* line number the thing came in */ + int lno; /* line number the thing came in in */ } stk[MAXSTK]; int stktop; From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 13:38:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D3371065672; Mon, 28 Feb 2011 13:38:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 350448FC13; Mon, 28 Feb 2011 13:38:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E291B46B37; Mon, 28 Feb 2011 08:38:39 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 86C418A02B; Mon, 28 Feb 2011 08:38:39 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 28 Feb 2011 07:59:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102261458.p1QEws75077588@svn.freebsd.org> In-Reply-To: <201102261458.p1QEws75077588@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102280759.59927.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 28 Feb 2011 08:38:39 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219056 - in head/sys: cam/ata cam/scsi dev/ata geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 13:38:40 -0000 On Saturday, February 26, 2011 9:58:54 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Feb 26 14:58:54 2011 > New Revision: 219056 > URL: http://svn.freebsd.org/changeset/base/219056 > > Log: > Add the disk ident and a human-meaningful description (here, the disk model > string) to the geom_disk config XML so that they are easily accessible from > userland. > > MFC after: 1 week Not sure if you want to do this for mfi_disk.c, etc.? Logical disks in mfi(4) have an optional volume name for example (the BIOS typically fills it in with "RAID 5" or some such when you create a volume in the BIOS) that might be worth exporting as the description for mfidX devices. Not sure about other disk devices such as twed. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 13:38:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E573B106566C; Mon, 28 Feb 2011 13:38:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B761E8FC15; Mon, 28 Feb 2011 13:38:41 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6100346B38; Mon, 28 Feb 2011 08:38:41 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 04BCF8A01B; Mon, 28 Feb 2011 08:38:41 -0500 (EST) From: John Baldwin To: Bruce Evans Date: Mon, 28 Feb 2011 08:12:36 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102270206.p1R269VO021432@svn.freebsd.org> <20110227133227.S1974@besplex.bde.org> In-Reply-To: <20110227133227.S1974@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102280812.36867.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 28 Feb 2011 08:38:41 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r219079 - in head/sys/boot/i386: gptboot gptzfsboot zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 13:38:42 -0000 On Saturday, February 26, 2011 10:04:00 pm Bruce Evans wrote: > On Sun, 27 Feb 2011, Dimitry Andric wrote: > > > Log: > > Clang's integrated assembler can now handle sys/boot/i386/boot2/sio.S. > > It used to choke on the notation "inb (%dx),%al" for "inb %dx,%al"; GNU > > as accepts both forms. Which notation is more 'correct' is an open > > question. :) > > Nah, the former is just a syntax error since %dx is not dereferenced :-). > > It is a syntax error at the design level that parentheses are used for > indirection. In better assembler syntaxes like Intel/Microsoft's one > for x86 and Motorola's one for 6809, brackets are used for indirections > so parentheses are not context-dependent. Then extra parentheses > around expressions can have no effect. But dx isn't an expression, > so (dx) should still be a syntax error. I think it is in I/M syntax > but I can't test that easily. It is a syntax error in my x86/6809 > assembler. My assembler doesn't check, but emits a diagnostic for > this :-). (My assembler wants brackets for indirection, but it has > an option to to implement some bugs including use of parentheses for > indirection.) OTOH, I actually prefer the ()'s. One could argue that I/O ports are simply an alternate address space, and 'inb (%dx),%al' for more closely matches 'movb (%dx),%al' than something like 'movzb %dx,%al'. I find it even more compelling for 'outb' as 'outb' clearly does not modify %dx, but %dx is an address register, and addresses are in ()'s in x86 assembly. In an assembly language where load and store are separate from inter-register copies so that you have 'ld %r0,%r1', then I would be fine with the address argument to inb/outb not using ()'s. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 14:47:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EA4B106566B; Mon, 28 Feb 2011 14:47:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 73BD98FC08; Mon, 28 Feb 2011 14:47:25 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 148C546B03; Mon, 28 Feb 2011 09:47:25 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A83288A027; Mon, 28 Feb 2011 09:47:24 -0500 (EST) From: John Baldwin To: Chagin Dmitry Date: Mon, 28 Feb 2011 09:44:32 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102252207.p1PM7NR9013988@svn.freebsd.org> <201102251722.31108.jhb@freebsd.org> <20110227114942.GA26984@dchagin.static.corbina.ru> In-Reply-To: <20110227114942.GA26984@dchagin.static.corbina.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201102280944.33209.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 28 Feb 2011 09:47:24 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219043 - in head/usr.bin: kdump ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 14:47:25 -0000 On Sunday, February 27, 2011 6:49:42 am Chagin Dmitry wrote: > On Fri, Feb 25, 2011 at 05:22:30PM -0500, John Baldwin wrote: > > On Friday, February 25, 2011 5:07:23 pm Dmitry Chagin wrote: > > > Author: dchagin > > > Date: Fri Feb 25 22:07:23 2011 > > > New Revision: 219043 > > > URL: http://svn.freebsd.org/changeset/base/219043 > > > > > > Log: > > > Teach kdump to understand sv_flags records in the trace files. > > > > > > MFC after: 1 Month. > > > > Ohhh, are you going to merge in Linux kdump?? :) > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=155083 :) Are you planning to integrate it into kdump tree in the base system perhaps? freebsd32 support in the base kdump would also be really nice. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 14:48:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68B5E1065677; Mon, 28 Feb 2011 14:48:00 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57A3F8FC17; Mon, 28 Feb 2011 14:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SEm0sg042324; Mon, 28 Feb 2011 14:48:00 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SEm0Q3042322; Mon, 28 Feb 2011 14:48:00 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201102281448.p1SEm0Q3042322@svn.freebsd.org> From: Poul-Henning Kamp Date: Mon, 28 Feb 2011 14:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219097 - head/usr.sbin/fifolog/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 14:48:00 -0000 Author: phk Date: Mon Feb 28 14:48:00 2011 New Revision: 219097 URL: http://svn.freebsd.org/changeset/base/219097 Log: Type-change to ssize_t to (app|pl)ease ppc platform. Modified: head/usr.sbin/fifolog/lib/fifolog_int.c Modified: head/usr.sbin/fifolog/lib/fifolog_int.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_int.c Mon Feb 28 10:03:48 2011 (r219096) +++ head/usr.sbin/fifolog/lib/fifolog_int.c Mon Feb 28 14:48:00 2011 (r219097) @@ -56,7 +56,7 @@ static const char * fifolog_int_open_i(struct fifolog_file *f, const char *fname, int mode) { struct stat st; - unsigned u; + ssize_t u; int i; f->fd = open(fname, mode ? O_RDWR : O_RDONLY); From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 15:25:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DECE106564A; Mon, 28 Feb 2011 15:25:39 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id DC7358FC0A; Mon, 28 Feb 2011 15:25:38 +0000 (UTC) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 1B606CA160; Mon, 28 Feb 2011 18:25:35 +0300 (MSK) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 304470556; Mon, 28 Feb 2011 18:25:34 +0300 Received: from dchagin.static.corbina.ru (localhost [127.0.0.1]) by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id p1SFPYdR010415; Mon, 28 Feb 2011 18:25:34 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p1SFPTlu010414; Mon, 28 Feb 2011 18:25:29 +0300 (MSK) (envelope-from dchagin) Date: Mon, 28 Feb 2011 18:25:29 +0300 From: Chagin Dmitry To: John Baldwin Message-ID: <20110228152529.GA10330@dchagin.static.corbina.ru> References: <201102252207.p1PM7NR9013988@svn.freebsd.org> <201102251722.31108.jhb@freebsd.org> <20110227114942.GA26984@dchagin.static.corbina.ru> <201102280944.33209.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <201102280944.33209.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219043 - in head/usr.bin: kdump ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 15:25:39 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 28, 2011 at 09:44:32AM -0500, John Baldwin wrote: > On Sunday, February 27, 2011 6:49:42 am Chagin Dmitry wrote: > > On Fri, Feb 25, 2011 at 05:22:30PM -0500, John Baldwin wrote: > > > On Friday, February 25, 2011 5:07:23 pm Dmitry Chagin wrote: > > > > Author: dchagin > > > > Date: Fri Feb 25 22:07:23 2011 > > > > New Revision: 219043 > > > > URL: http://svn.freebsd.org/changeset/base/219043 > > > >=20 > > > > Log: > > > > Teach kdump to understand sv_flags records in the trace files. > > > > =20 > > > > MFC after: 1 Month. > > >=20 > > > Ohhh, are you going to merge in Linux kdump?? :) > > >=20 > >=20 > > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D155083 :) >=20 > Are you planning to integrate it into kdump tree in the base system perha= ps? It's impossible, as linux_kdump contains GPL derived code. Instead I would to integrate kdump into linux_kdump. >=20 > freebsd32 support in the base kdump would also be really nice. >=20 a little bit later, but I'll do it.=20 --=20 Have fun! chd --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk1rvmYACgkQ0t2Tb3OO/O1ylgCcCF2RYJq5f/MY8R2oLymGnWAU OUsAoMmyIhFisKho/56FJwH9JBsKOOKi =P6rB -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 15:26:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7456106566B; Mon, 28 Feb 2011 15:26:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id A78EF8FC0C; Mon, 28 Feb 2011 15:26:43 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LHC0050804I5D00@smtpauth3.wiscmail.wisc.edu>; Mon, 28 Feb 2011 08:26:42 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-75-50-89-165.dsl.mdsnwi.sbcglobal.net [75.50.89.165]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LHC0044T04FVV00@smtpauth3.wiscmail.wisc.edu>; Mon, 28 Feb 2011 08:26:40 -0600 (CST) Date: Mon, 28 Feb 2011 08:26:39 -0600 From: Nathan Whitehorn In-reply-to: <201102280759.59927.jhb@freebsd.org> To: John Baldwin Message-id: <4D6BB09F.1050400@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=75.50.89.165 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.2.28.141815, SenderIP=75.50.89.165 References: <201102261458.p1QEws75077588@svn.freebsd.org> <201102280759.59927.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101214 Thunderbird/3.1.7 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219056 - in head/sys: cam/ata cam/scsi dev/ata geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 15:26:43 -0000 On 02/28/11 06:59, John Baldwin wrote: > On Saturday, February 26, 2011 9:58:54 am Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sat Feb 26 14:58:54 2011 >> New Revision: 219056 >> URL: http://svn.freebsd.org/changeset/base/219056 >> >> Log: >> Add the disk ident and a human-meaningful description (here, the disk model >> string) to the geom_disk config XML so that they are easily accessible from >> userland. >> >> MFC after: 1 week > Not sure if you want to do this for mfi_disk.c, etc.? Logical disks in > mfi(4) have an optional volume name for example (the BIOS typically fills it > in with "RAID 5" or some such when you create a volume in the BIOS) that > might be worth exporting as the description for mfidX devices. > > Not sure about other disk devices such as twed. I'm not as familiar with all the various RAID modules. I've started making patches to set d_descr to things like "Adaptec RAID Volume" for now, but would be interested to know if there is something better in individual cases. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 15:58:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8320A106566C; Mon, 28 Feb 2011 15:58:30 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71A968FC0A; Mon, 28 Feb 2011 15:58:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SFwUbg044425; Mon, 28 Feb 2011 15:58:30 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SFwUWg044420; Mon, 28 Feb 2011 15:58:30 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201102281558.p1SFwUWg044420@svn.freebsd.org> From: Matt Jacob Date: Mon, 28 Feb 2011 15:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219098 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 15:58:30 -0000 Author: mjacob Date: Mon Feb 28 15:58:30 2011 New Revision: 219098 URL: http://svn.freebsd.org/changeset/base/219098 Log: Sync FreeBSD ISP with mercurial tree. Minor changes having to do with a macro for minima. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Mon Feb 28 14:48:00 2011 (r219097) +++ head/sys/dev/isp/isp.c Mon Feb 28 15:58:30 2011 (r219098) @@ -4377,7 +4377,7 @@ isp_start(XS_T *xs) if (IS_SCSI(isp)) { reqp->req_target = target | (XS_CHANNEL(xs) << 7); reqp->req_lun_trn = XS_LUN(xs); - cdblen = MIN(cdblen, sizeof (reqp->req_cdb)); + cdblen = ISP_MIN(cdblen, sizeof (reqp->req_cdb)); cdbp = reqp->req_cdb; reqp->req_cdblen = cdblen; } else if (IS_24XX(isp)) { @@ -4396,25 +4396,25 @@ isp_start(XS_T *xs) t7->req_lun[1] = XS_LUN(xs); tptr = &t7->req_time; cdbp = t7->req_cdb; - cdblen = MIN(cdblen, sizeof (t7->req_cdb)); + cdblen = ISP_MIN(cdblen, sizeof (t7->req_cdb)); } else if (ISP_CAP_2KLOGIN(isp)) { ispreqt2e_t *t2e = (ispreqt2e_t *)local; t2e->req_target = target; t2e->req_scclun = XS_LUN(xs); cdbp = t2e->req_cdb; - cdblen = MIN(cdblen, sizeof (t2e->req_cdb)); + cdblen = ISP_MIN(cdblen, sizeof (t2e->req_cdb)); } else if (ISP_CAP_SCCFW(isp)) { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_scclun = XS_LUN(xs); cdbp = t2->req_cdb; - cdblen = MIN(cdblen, sizeof (t2->req_cdb)); + cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb)); } else { ispreqt2_t *t2 = (ispreqt2_t *)local; t2->req_target = target; t2->req_lun_trn = XS_LUN(xs); cdbp = t2->req_cdb; - cdblen = MIN(cdblen, sizeof (t2->req_cdb)); + cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb)); } ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Feb 28 14:48:00 2011 (r219097) +++ head/sys/dev/isp/isp_freebsd.c Mon Feb 28 15:58:30 2011 (r219098) @@ -1865,7 +1865,7 @@ isp_handle_platform_atio(ispsoftc_t *isp } if (status & QLTM_SVALID) { - size_t amt = imin(QLTM_SENSELEN, sizeof (atiop->sense_data)); + size_t amt = ISP_MIN(QLTM_SENSELEN, sizeof (atiop->sense_data)); atiop->sense_len = amt; ISP_MEMCPY(&atiop->sense_data, aep->at_sense, amt); } else { Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Mon Feb 28 14:48:00 2011 (r219097) +++ head/sys/dev/isp/isp_freebsd.h Mon Feb 28 15:58:30 2011 (r219098) @@ -325,6 +325,8 @@ struct isposinfo { #define ISP_DELAY DELAY #define ISP_SLEEP(isp, x) DELAY(x) +#define ISP_MIN imin + #ifndef DIAGNOSTIC #define ISP_INLINE __inline #else Modified: head/sys/dev/isp/ispvar.h ============================================================================== --- head/sys/dev/isp/ispvar.h Mon Feb 28 14:48:00 2011 (r219097) +++ head/sys/dev/isp/ispvar.h Mon Feb 28 15:58:30 2011 (r219098) @@ -997,6 +997,7 @@ void isp_async(ispsoftc_t *, ispasync_t, * * ISP_INLINE ___inline or not- depending on how * good your debugger is + * ISP_MIN shorthand for ((a) < (b))? (a) : (b) * * NANOTIME_T nanosecond time type * From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 16:06:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00C13106564A; Mon, 28 Feb 2011 16:06:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C663F8FC15; Mon, 28 Feb 2011 16:06:22 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 58CE146B2C; Mon, 28 Feb 2011 11:06:22 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E9A328A01B; Mon, 28 Feb 2011 11:06:21 -0500 (EST) From: John Baldwin To: Chagin Dmitry Date: Mon, 28 Feb 2011 11:06:11 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201102252207.p1PM7NR9013988@svn.freebsd.org> <201102280944.33209.jhb@freebsd.org> <20110228152529.GA10330@dchagin.static.corbina.ru> In-Reply-To: <20110228152529.GA10330@dchagin.static.corbina.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201102281106.11719.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 28 Feb 2011 11:06:22 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219043 - in head/usr.bin: kdump ktrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 16:06:23 -0000 On Monday, February 28, 2011 10:25:29 am Chagin Dmitry wrote: > On Mon, Feb 28, 2011 at 09:44:32AM -0500, John Baldwin wrote: > > On Sunday, February 27, 2011 6:49:42 am Chagin Dmitry wrote: > > > On Fri, Feb 25, 2011 at 05:22:30PM -0500, John Baldwin wrote: > > > > On Friday, February 25, 2011 5:07:23 pm Dmitry Chagin wrote: > > > > > Author: dchagin > > > > > Date: Fri Feb 25 22:07:23 2011 > > > > > New Revision: 219043 > > > > > URL: http://svn.freebsd.org/changeset/base/219043 > > > > > > > > > > Log: > > > > > Teach kdump to understand sv_flags records in the trace files. > > > > > > > > > > MFC after: 1 Month. > > > > > > > > Ohhh, are you going to merge in Linux kdump?? :) > > > > > > > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=155083 :) > > > > Are you planning to integrate it into kdump tree in the base system perhaps? > > It's impossible, as linux_kdump contains GPL derived code. Instead I > would to integrate kdump into linux_kdump. Ah. We could at least use the Linux syscalls.master table in the base system kdump even if it doesn't do fancier printing of all the arguments. Perhaps we could have a stripped down version of linux_kdump in base that way and have a fuller version in ports. > > freebsd32 support in the base kdump would also be really nice. > > > > a little bit later, but I'll do it. > > -- > Have fun! > chd > -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 17:23:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B71B1065672; Mon, 28 Feb 2011 17:23:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 282128FC1B; Mon, 28 Feb 2011 17:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SHNGoj046644; Mon, 28 Feb 2011 17:23:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SHNFLD046632; Mon, 28 Feb 2011 17:23:15 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102281723.p1SHNFLD046632@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Feb 2011 17:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219100 - in head: lib/libusb share/man/man9 sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 17:23:16 -0000 Author: hselasky Date: Mon Feb 28 17:23:15 2011 New Revision: 219100 URL: http://svn.freebsd.org/changeset/base/219100 Log: - Add support for software pre-scaling of ISOCHRONOUS transfers. MFC after: 14 days Approved by: thompsa (mentor) Modified: head/lib/libusb/libusb10.c head/lib/libusb/libusb20.3 head/lib/libusb/libusb20.c head/lib/libusb/libusb20.h head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c head/share/man/man9/usbdi.9 head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_ioctl.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb10.c Mon Feb 28 17:23:15 2011 (r219100) @@ -51,7 +51,6 @@ struct libusb_context *usbi_default_cont /* Prototypes */ static struct libusb20_transfer *libusb10_get_transfer(struct libusb20_device *, uint8_t, uint8_t); -static int libusb10_get_maxframe(struct libusb20_device *, libusb_transfer *); static int libusb10_get_buffsize(struct libusb20_device *, libusb_transfer *); static int libusb10_convert_error(uint8_t status); static void libusb10_complete_transfer(struct libusb20_transfer *, struct libusb_super_transfer *, int); @@ -810,25 +809,14 @@ libusb_free_transfer(struct libusb_trans free(sxfer); } -static int +static uint32_t libusb10_get_maxframe(struct libusb20_device *pdev, libusb_transfer *xfer) { - int ret; - int usb_speed; - - usb_speed = libusb20_dev_get_speed(pdev); + uint32_t ret; switch (xfer->type) { case LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: - switch (usb_speed) { - case LIBUSB20_SPEED_LOW: - case LIBUSB20_SPEED_FULL: - ret = 60 * 1; - break; - default: - ret = 60 * 8; - break; - } + ret = 60 | LIBUSB20_MAX_FRAME_PRE_SCALE; /* 60ms */ break; case LIBUSB_TRANSFER_TYPE_CONTROL: ret = 2; Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb20.3 Mon Feb 28 17:23:15 2011 (r219100) @@ -261,6 +261,16 @@ The actual buffer size can be greater th and is returned by .Fn libusb20_tr_get_max_total_length . . +If +.Fa max_frame_count +is OR'ed with LIBUSB20_MAX_FRAME_PRE_SCALE the remaining part of the +argument is converted from milliseconds into the actual number of +frames rounded up, when this function returns. +This flag is only valid for ISOCHRONOUS transfers and has no effect +for other transfer types. +The actual number of frames setup is found by calling +.Fn libusb20_tr_get_max_frames . +. This function returns zero upon success. . Non-zero return values indicate a LIBUSB20_ERROR value. Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb20.c Mon Feb 28 17:23:15 2011 (r219100) @@ -156,14 +156,20 @@ libusb20_tr_open(struct libusb20_transfe uint32_t MaxFrameCount, uint8_t ep_no) { uint32_t size; + uint8_t pre_scale; int error; - if (xfer->is_opened) { + if (xfer->is_opened) return (LIBUSB20_ERROR_BUSY); + if (MaxFrameCount & LIBUSB20_MAX_FRAME_PRE_SCALE) { + MaxFrameCount &= ~LIBUSB20_MAX_FRAME_PRE_SCALE; + pre_scale = 1; + } else { + pre_scale = 0; } - if (MaxFrameCount == 0) { + if (MaxFrameCount == 0) return (LIBUSB20_ERROR_INVALID_PARAM); - } + xfer->maxFrames = MaxFrameCount; size = MaxFrameCount * sizeof(xfer->pLength[0]); @@ -182,7 +188,7 @@ libusb20_tr_open(struct libusb20_transfe memset(xfer->ppBuffer, 0, size); error = xfer->pdev->methods->tr_open(xfer, MaxBufSize, - MaxFrameCount, ep_no); + MaxFrameCount, ep_no, pre_scale); if (error) { free(xfer->ppBuffer); Modified: head/lib/libusb/libusb20.h ============================================================================== --- head/lib/libusb/libusb20.h Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb20.h Mon Feb 28 17:23:15 2011 (r219100) @@ -197,8 +197,9 @@ struct libusb20_quirk { char quirkname[64 - 12]; }; -/* USB transfer operations */ +#define LIBUSB20_MAX_FRAME_PRE_SCALE (1U << 31) +/* USB transfer operations */ int libusb20_tr_close(struct libusb20_transfer *xfer); int libusb20_tr_open(struct libusb20_transfer *xfer, uint32_t max_buf_size, uint32_t max_frame_count, uint8_t ep_no); struct libusb20_transfer *libusb20_tr_get_pointer(struct libusb20_device *pdev, uint16_t tr_index); Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb20_int.h Mon Feb 28 17:23:15 2011 (r219100) @@ -110,7 +110,7 @@ typedef int (libusb20_set_config_index_t typedef int (libusb20_check_connected_t)(struct libusb20_device *pdev); /* USB transfer specific */ -typedef int (libusb20_tr_open_t)(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no); +typedef int (libusb20_tr_open_t)(struct libusb20_transfer *xfer, uint32_t MaxBufSize, uint32_t MaxFrameCount, uint8_t ep_no, uint8_t pre_scale); typedef int (libusb20_tr_close_t)(struct libusb20_transfer *xfer); typedef int (libusb20_tr_clear_stall_sync_t)(struct libusb20_transfer *xfer); typedef void (libusb20_tr_submit_t)(struct libusb20_transfer *xfer); Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Mon Feb 28 16:39:15 2011 (r219099) +++ head/lib/libusb/libusb20_ugen20.c Mon Feb 28 17:23:15 2011 (r219100) @@ -736,11 +736,14 @@ ugen20_process(struct libusb20_device *p static int ugen20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize, - uint32_t MaxFrameCount, uint8_t ep_no) + uint32_t MaxFrameCount, uint8_t ep_no, uint8_t pre_scale) { struct usb_fs_open temp; struct usb_fs_endpoint *fsep; + if (pre_scale) + MaxFrameCount |= USB_FS_MAX_FRAMES_PRE_SCALE; + memset(&temp, 0, sizeof(temp)); fsep = xfer->pdev->privBeData; Modified: head/share/man/man9/usbdi.9 ============================================================================== --- head/share/man/man9/usbdi.9 Mon Feb 28 16:39:15 2011 (r219099) +++ head/share/man/man9/usbdi.9 Mon Feb 28 17:23:15 2011 (r219100) @@ -593,6 +593,10 @@ use the "usbd_xfer_set_stall()" and "usb functions! This flag is automatically cleared after that the stall or clear stall has been executed. . +.It pre_scale_frames +If this flag is set the number of frames specified is assumed to give the buffering time in milliseconds instead of frames. +During transfer setup the frames field is pre scaled with the corresponding value for the endpoint and rounded to the nearest number of frames greater than zero. +This option only has effect for ISOCHRONOUS transfers. .El .Pp .Fa bufsize Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Mon Feb 28 16:39:15 2011 (r219099) +++ head/sys/dev/usb/usb_generic.c Mon Feb 28 17:23:15 2011 (r219100) @@ -1397,6 +1397,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cm uint8_t iface_index; uint8_t isread; uint8_t ep_index; + uint8_t pre_scale; u.addr = addr; @@ -1448,6 +1449,12 @@ ugen_ioctl(struct usb_fifo *f, u_long cm if (u.popen->max_bufsize > USB_FS_MAX_BUFSIZE) { u.popen->max_bufsize = USB_FS_MAX_BUFSIZE; } + if (u.popen->max_frames & USB_FS_MAX_FRAMES_PRE_SCALE) { + pre_scale = 1; + u.popen->max_frames &= ~USB_FS_MAX_FRAMES_PRE_SCALE; + } else { + pre_scale = 0; + } if (u.popen->max_frames > USB_FS_MAX_FRAMES) { u.popen->max_frames = USB_FS_MAX_FRAMES; break; @@ -1468,13 +1475,15 @@ ugen_ioctl(struct usb_fifo *f, u_long cm } iface_index = ep->iface_index; - bzero(usb_config, sizeof(usb_config)); + memset(usb_config, 0, sizeof(usb_config)); usb_config[0].type = ed->bmAttributes & UE_XFERTYPE; usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR; usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); usb_config[0].interval = USB_DEFAULT_INTERVAL; usb_config[0].flags.proxy_buffer = 1; + if (pre_scale != 0) + usb_config[0].flags.pre_scale_frames = 1; usb_config[0].callback = &ugen_ctrl_fs_callback; usb_config[0].timeout = 0; /* no timeout */ usb_config[0].frames = u.popen->max_frames; @@ -1516,6 +1525,10 @@ ugen_ioctl(struct usb_fifo *f, u_long cm f->fs_xfer[u.popen->ep_index]->max_frame_size; u.popen->max_bufsize = f->fs_xfer[u.popen->ep_index]->max_data_length; + /* update number of frames */ + u.popen->max_frames = + f->fs_xfer[u.popen->ep_index]->nframes; + /* store index of endpoint */ f->fs_xfer[u.popen->ep_index]->priv_fifo = ((uint8_t *)0) + u.popen->ep_index; } else { Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Mon Feb 28 16:39:15 2011 (r219099) +++ head/sys/dev/usb/usb_ioctl.h Mon Feb 28 17:23:15 2011 (r219100) @@ -183,8 +183,9 @@ struct usb_fs_uninit { struct usb_fs_open { #define USB_FS_MAX_BUFSIZE (1 << 18) uint32_t max_bufsize; -#define USB_FS_MAX_FRAMES (1 << 12) - uint32_t max_frames; +#define USB_FS_MAX_FRAMES (1U << 12) +#define USB_FS_MAX_FRAMES_PRE_SCALE (1U << 31) /* for ISOCHRONOUS transfers */ + uint32_t max_frames; /* read and write */ uint16_t max_packet_length; /* read only */ uint8_t dev_index; /* currently unused */ uint8_t ep_index; Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon Feb 28 16:39:15 2011 (r219099) +++ head/sys/dev/usb/usb_transfer.c Mon Feb 28 17:23:15 2011 (r219100) @@ -471,6 +471,8 @@ usbd_transfer_setup_sub(struct usb_setup xfer->fps_shift--; if (xfer->fps_shift > 3) xfer->fps_shift = 3; + if (xfer->flags.pre_scale_frames != 0) + xfer->nframes <<= (3 - xfer->fps_shift); break; } Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Mon Feb 28 16:39:15 2011 (r219099) +++ head/sys/dev/usb/usbdi.h Mon Feb 28 17:23:15 2011 (r219100) @@ -195,6 +195,16 @@ struct usb_xfer_flags { uint8_t stall_pipe:1; /* set if the endpoint belonging to * this USB transfer should be stalled * before starting this transfer! */ + uint8_t pre_scale_frames:1; /* "usb_config->frames" is + * assumed to give the + * buffering time in + * milliseconds and is + * converted into the nearest + * number of frames when the + * USB transfer is setup. This + * option only has effect for + * ISOCHRONOUS transfers. + */ }; /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 18:53:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2A6B106566C; Mon, 28 Feb 2011 18:53:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6A7A8FC16; Mon, 28 Feb 2011 18:53:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SIr6TJ048695; Mon, 28 Feb 2011 18:53:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SIr6Cl048692; Mon, 28 Feb 2011 18:53:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201102281853.p1SIr6Cl048692@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 28 Feb 2011 18:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219101 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 18:53:07 -0000 Author: hselasky Date: Mon Feb 28 18:53:06 2011 New Revision: 219101 URL: http://svn.freebsd.org/changeset/base/219101 Log: - Add missing MLINKS for libusb and some manpage fixes. MFC after: 14 days Approved by: thompsa (mentor) Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Mon Feb 28 17:23:15 2011 (r219100) +++ head/lib/libusb/Makefile Mon Feb 28 18:53:06 2011 (r219101) @@ -36,3 +36,174 @@ CFLAGS+= -DCOMPAT_32BIT .include +# LibUSB v1.0 +MLINKS += libusb.3 libusb_init.3 +MLINKS += libusb.3 libusb_exit.3 +MLINKS += libusb.3 libusb_strerror.3 +MLINKS += libusb.3 libusb_set_debug.3 +MLINKS += libusb.3 libusb_get_device_list.3 +MLINKS += libusb.3 libusb_free_device_list.3 +MLINKS += libusb.3 libusb_get_bus_number.3 +MLINKS += libusb.3 libusb_get_device_address.3 +MLINKS += libusb.3 libusb_get_max_packet_size.3 +MLINKS += libusb.3 libusb_ref_device.3 +MLINKS += libusb.3 libusb_unref_device.3 +MLINKS += libusb.3 libusb_open.3 +MLINKS += libusb.3 libusb_open_device_with_vid_pid.3 +MLINKS += libusb.3 libusb_close.3 +MLINKS += libusb.3 libusb_get_device.3 +MLINKS += libusb.3 libusb_get_configuration.3 +MLINKS += libusb.3 libusb_set_configuration.3 +MLINKS += libusb.3 libusb_claim_interface.3 +MLINKS += libusb.3 libusb_release_interface.3 +MLINKS += libusb.3 libusb_set_interface_alt_setting.3 +MLINKS += libusb.3 libusb_clear_halt.3 +MLINKS += libusb.3 libusb_reset_device.3 +MLINKS += libusb.3 libusb_check_connected.3 +MLINKS += libusb.3 libusb_kernel_driver_active.3 +MLINKS += libusb.3 libusb_get_driver.3 +MLINKS += libusb.3 libusb_get_driver_np.3 +MLINKS += libusb.3 libusb_detach_kernel_driver.3 +MLINKS += libusb.3 libusb_detach_kernel_driver_np.3 +MLINKS += libusb.3 libusb_attach_kernel_driver.3 +MLINKS += libusb.3 libusb_get_device_descriptor.3 +MLINKS += libusb.3 libsub_get_active_config_descriptor.3 +MLINKS += libusb.3 libusb_get_config_descriptor.3 +MLINKS += libusb.3 libusb_get_config_descriptor_by_value.3 +MLINKS += libusb.3 libusb_free_config_descriptor.3 +MLINKS += libusb.3 libusb_get_string_descriptor_ascii.3 +MLINKS += libusb.3 libusb_alloc_transfer.3 +MLINKS += libusb.3 libusb_free_transfer.3 +MLINKS += libusb.3 libusb_submit_transfer.3 +MLINKS += libusb.3 libusb_cancel_transfer.3 +MLINKS += libusb.3 libusb_control_transfer.3 +MLINKS += libusb.3 libusb_bulk_transfer.3 +MLINKS += libusb.3 libusb_interrupt_transfer.3 +MLINKS += libusb.3 libusb_try_lock_events.3 +MLINKS += libusb.3 libusb_lock_events.3 +MLINKS += libusb.3 libusb_unlock_events.3 +MLINKS += libusb.3 libusb_event_handling_ok.3 +MLINKS += libusb.3 libusb_event_handler_active.3 +MLINKS += libusb.3 libusb_lock_event_waiters.3 +MLINKS += libusb.3 libusb_unlock_event_waiters.3 +MLINKS += libusb.3 libusb_wait_for_event.3 +MLINKS += libusb.3 libusb_handle_events_timeout.3 +MLINKS += libusb.3 libusb_handle_events.3 +MLINKS += libusb.3 libusb_handle_events_locked.3 +MLINKS += libusb.3 libusb_get_next_timeout.3 +MLINKS += libusb.3 libusb_set_pollfd_notifiers.3 +MLINKS += libusb.3 libusb_get_pollfds.3 + +# LibUSB v0.1 +MLINKS += libusb.3 usb_open.3 +MLINKS += libusb.3 usb_close.3 +MLINKS += libusb.3 usb_get_string.3 +MLINKS += libusb.3 usb_get_string_simple.3 +MLINKS += libusb.3 usb_get_descriptor_by_endpoint.3 +MLINKS += libusb.3 usb_get_descriptor.3 +MLINKS += libusb.3 usb_parse_descriptor.3 +MLINKS += libusb.3 usb_parse_configuration.3 +MLINKS += libusb.3 usb_destroy_configuration.3 +MLINKS += libusb.3 usb_fetch_and_parse_descriptors.3 +MLINKS += libusb.3 usb_bulk_write.3 +MLINKS += libusb.3 usb_bulk_read.3 +MLINKS += libusb.3 usb_interrupt_write.3 +MLINKS += libusb.3 usb_interrupt_read.3 +MLINKS += libusb.3 usb_control_msg.3 +MLINKS += libusb.3 usb_set_configuration.3 +MLINKS += libusb.3 usb_claim_interface.3 +MLINKS += libusb.3 usb_release_interface.3 +MLINKS += libusb.3 usb_set_altinterface.3 +MLINKS += libusb.3 usb_resetep.3 +MLINKS += libusb.3 usb_clear_halt.3 +MLINKS += libusb.3 usb_reset.3 +MLINKS += libusb.3 usb_strerror.3 +MLINKS += libusb.3 usb_init.3 +MLINKS += libusb.3 usb_set_debug.3 +MLINKS += libusb.3 usb_find_busses.3 +MLINKS += libusb.3 usb_find_devices.3 +MLINKS += libusb.3 usb_device.3 +MLINKS += libusb.3 usb_get_busses.3 +MLINKS += libusb.3 usb_check_connected.3 + +# LibUSB v2.0 +MLINKS += libusb20.3 libusb20_tr_close.3 +MLINKS += libusb20.3 libusb20_tr_open.3 +MLINKS += libusb20.3 libusb20_tr_get_pointer.3 +MLINKS += libusb20.3 libusb20_tr_get_time_complete.3 +MLINKS += libusb20.3 libusb20_tr_get_actual_frames.3 +MLINKS += libusb20.3 libusb20_tr_get_actual_length.3 +MLINKS += libusb20.3 libusb20_tr_get_max_frames.3 +MLINKS += libusb20.3 libusb20_tr_get_max_packet_length.3 +MLINKS += libusb20.3 libusb20_tr_get_max_total_length.3 +MLINKS += libusb20.3 libusb20_tr_get_status.3 +MLINKS += libusb20.3 libusb20_tr_pending.3 +MLINKS += libusb20.3 libusb20_tr_callback_wrapper.3 +MLINKS += libusb20.3 libusb20_tr_clear_stall_sync.3 +MLINKS += libusb20.3 libusb20_tr_drain.3 +MLINKS += libusb20.3 libusb20_tr_set_buffer.3 +MLINKS += libusb20.3 libusb20_tr_set_callback.3 +MLINKS += libusb20.3 libusb20_tr_set_flags.3 +MLINKS += libusb20.3 libusb20_tr_get_length.3 +MLINKS += libusb20.3 libusb20_tr_set_length.3 +MLINKS += libusb20.3 libusb20_tr_set_priv_sc0.3 +MLINKS += libusb20.3 libusb20_tr_set_priv_sc1.3 +MLINKS += libusb20.3 libusb20_tr_set_timeout.3 +MLINKS += libusb20.3 libusb20_tr_set_total_frames.3 +MLINKS += libusb20.3 libusb20_tr_setup_bulk.3 +MLINKS += libusb20.3 libusb20_tr_setup_control.3 +MLINKS += libusb20.3 libusb20_tr_setup_intr.3 +MLINKS += libusb20.3 libusb20_tr_setup_isoc.3 +MLINKS += libusb20.3 libusb20_tr_bulk_intr_sync.3 +MLINKS += libusb20.3 libusb20_tr_start.3 +MLINKS += libusb20.3 libusb20_tr_stop.3 +MLINKS += libusb20.3 libusb20_tr_submit.3 +MLINKS += libusb20.3 libusb20_tr_get_priv_sc0.3 +MLINKS += libusb20.3 libusb20_tr_get_priv_sc1.3 +MLINKS += libusb20.3 libusb20_dev_get_backend_name.3 +MLINKS += libusb20.3 libusb20_dev_get_info.3 +MLINKS += libusb20.3 libusb20_dev_get_iface_desc.3 +MLINKS += libusb20.3 libusb20_dev_get_desc.3 +MLINKS += libusb20.3 libusb20_dev_close.3 +MLINKS += libusb20.3 libusb20_dev_detach_kernel_driver.3 +MLINKS += libusb20.3 libusb20_dev_set_config_index.3 +MLINKS += libusb20.3 libusb20_dev_get_debug.3 +MLINKS += libusb20.3 libusb20_dev_get_fd.3 +MLINKS += libusb20.3 libusb20_dev_kernel_driver_active.3 +MLINKS += libusb20.3 libusb20_dev_open.3 +MLINKS += libusb20.3 libusb20_dev_process.3 +MLINKS += libusb20.3 libusb20_dev_request_sync.3 +MLINKS += libusb20.3 libusb20_dev_req_string_sync.3 +MLINKS += libusb20.3 libusb20_dev_req_string_simple_sync.3 +MLINKS += libusb20.3 libusb20_dev_reset.3 +MLINKS += libusb20.3 libusb20_dev_check_connected.3 +MLINKS += libusb20.3 libusb20_dev_set_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_power_mode.3 +MLINKS += libusb20.3 libusb20_dev_set_alt_index.3 +MLINKS += libusb20.3 libusb20_dev_get_device_desc.3 +MLINKS += libusb20.3 libusb20_dev_alloc_config.3 +MLINKS += libusb20.3 libusb20_dev_alloc.3 +MLINKS += libusb20.3 libusb20_dev_get_address.3 +MLINKS += libusb20.3 libusb20_dev_get_bus_number.3 +MLINKS += libusb20.3 libusb20_dev_get_mode.3 +MLINKS += libusb20.3 libusb20_dev_get_speed.3 +MLINKS += libusb20.3 libusb20_dev_get_config_index.3 +MLINKS += libusb20.3 libusb20_dev_free.3 +MLINKS += libusb20.3 libusb20_dev_set_debug.3 +MLINKS += libusb20.3 libusb20_dev_wait_process.3 +MLINKS += libusb20.3 libusb20_be_get_template.3 +MLINKS += libusb20.3 libusb20_be_set_template.3 +MLINKS += libusb20.3 libusb20_be_get_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_get_quirk_name.3 +MLINKS += libusb20.3 libusb20_be_add_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_remove_dev_quirk.3 +MLINKS += libusb20.3 libusb20_be_alloc_default.3 +MLINKS += libusb20.3 libusb20_be_device_foreach.3 +MLINKS += libusb20.3 libusb20_be_dequeue_device.3 +MLINKS += libusb20.3 libusb20_be_enqueue_device.3 +MLINKS += libusb20.3 libusb20_be_free.3 +MLINKS += libusb20.3 libusb20_me_get_1.3 +MLINKS += libusb20.3 libusb20_me_get_2.3 +MLINKS += libusb20.3 libusb20_me_encode.3 +MLINKS += libusb20.3 libusb20_me_decode.3 +MLINKS += libusb20.3 libusb20_desc_foreach.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Mon Feb 28 17:23:15 2011 (r219100) +++ head/lib/libusb/libusb.3 Mon Feb 28 18:53:06 2011 (r219101) @@ -383,7 +383,7 @@ LIBUSB_ERROR code on failure. Perform a USB control transfer. Returns the actual number of bytes transferred on success in the range from and including zero until and including -.Xa wLength . +.Fa wLength . On error a libusb error code is returned, for example LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_NO_DEVICE if the @@ -393,7 +393,10 @@ The libusb error codes are always negati .Pp .Ft int .Fn libusb_bulk_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" -Perform an USB bulk transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT +Perform an USB bulk transfer. +A timeout value of zero means no timeout. +The timeout value is given in milliseconds. +Returns 0 on success, LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and @@ -402,7 +405,10 @@ LIBUSB_ERROR code on other failure. .Pp .Ft int .Fn libusb_interrupt_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" -Perform an USB Interrupt transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT +Perform an USB Interrupt transfer. +A timeout value of zero means no timeout. +The timeout value is given in milliseconds. +Returns 0 on success, LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 20:37:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 949E41065686; Mon, 28 Feb 2011 20:37:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 839EF8FC1F; Mon, 28 Feb 2011 20:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SKbmnj051170; Mon, 28 Feb 2011 20:37:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SKbmJH051167; Mon, 28 Feb 2011 20:37:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282037.p1SKbmJH051167@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 20:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219102 - head/sys/dev/sis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 20:37:48 -0000 Author: yongari Date: Mon Feb 28 20:37:48 2011 New Revision: 219102 URL: http://svn.freebsd.org/changeset/base/219102 Log: Make sure changing ownership of RX descriptor to be done as last operation. Previously ownership was transferred to hardware before setting address of new RX buffer such that it was possible for hardware to use wrong RX buffer address. While here keep compiler from re-ordering instructions by declaring descriptor members volatile. Memory barriers would do the same job but volatile is supposed to be cheaper than using memory barriers, especially on MP systems. Submitted by: marius MFC after: 1 week Modified: head/sys/dev/sis/if_sis.c head/sys/dev/sis/if_sisreg.h Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Mon Feb 28 18:53:06 2011 (r219101) +++ head/sys/dev/sis/if_sis.c Mon Feb 28 20:37:48 2011 (r219102) @@ -1566,8 +1566,8 @@ sis_newbuf(struct sis_softc *sc, struct sc->sis_rx_sparemap = map; bus_dmamap_sync(sc->sis_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_PREREAD); rxd->rx_m = m; - rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); rxd->rx_desc->sis_ptr = htole32(SIS_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->sis_cmdsts = htole32(SIS_RXLEN); return (0); } Modified: head/sys/dev/sis/if_sisreg.h ============================================================================== --- head/sys/dev/sis/if_sisreg.h Mon Feb 28 18:53:06 2011 (r219101) +++ head/sys/dev/sis/if_sisreg.h Mon Feb 28 20:37:48 2011 (r219102) @@ -337,8 +337,8 @@ struct sis_desc { /* SiS hardware descriptor section */ uint32_t sis_next; - uint32_t sis_cmdsts; - uint32_t sis_ptr; + volatile uint32_t sis_cmdsts; + volatile uint32_t sis_ptr; }; #define SIS_CMDSTS_BUFLEN 0x00000FFF From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 20:55:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C069B106564A; Mon, 28 Feb 2011 20:55:41 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3398FC17; Mon, 28 Feb 2011 20:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SKtfOv051623; Mon, 28 Feb 2011 20:55:41 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SKtfAn051621; Mon, 28 Feb 2011 20:55:41 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201102282055.p1SKtfAn051621@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 28 Feb 2011 20:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219103 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 20:55:41 -0000 Author: jchandra Date: Mon Feb 28 20:55:41 2011 New Revision: 219103 URL: http://svn.freebsd.org/changeset/base/219103 Log: Use vm_offset_t for virtual addresses. The unsigned int type used now is incorrect in n64 compilation. Modified: head/sys/mips/mips/cache_mipsNN.c Modified: head/sys/mips/mips/cache_mipsNN.c ============================================================================== --- head/sys/mips/mips/cache_mipsNN.c Mon Feb 28 20:37:48 2011 (r219102) +++ head/sys/mips/mips/cache_mipsNN.c Mon Feb 28 20:55:41 2011 (r219103) @@ -230,7 +230,7 @@ mipsNN_icache_sync_range_32(vm_offset_t void mipsNN_icache_sync_range_index_16(vm_offset_t va, vm_size_t size) { - unsigned int eva, tmpva; + vm_offset_t eva, tmpva; int i, stride, loopcount; /* @@ -273,7 +273,7 @@ mipsNN_icache_sync_range_index_16(vm_off void mipsNN_icache_sync_range_index_32(vm_offset_t va, vm_size_t size) { - unsigned int eva, tmpva; + vm_offset_t eva, tmpva; int i, stride, loopcount; /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 28 21:33:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 553021065674; Mon, 28 Feb 2011 21:33:27 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA308FC1F; Mon, 28 Feb 2011 21:33:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1SLXRaK052595; Mon, 28 Feb 2011 21:33:27 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SLXRsN052592; Mon, 28 Feb 2011 21:33:27 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201102282133.p1SLXRsN052592@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 28 Feb 2011 21:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219106 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 21:33:27 -0000 Author: jchandra Date: Mon Feb 28 21:33:26 2011 New Revision: 219106 URL: http://svn.freebsd.org/changeset/base/219106 Log: Use correct types and fromats for physical address - Use vm_paddr_t for pa in pmap_steal_memory() - Use uintmax_t and %jx to ensure that physical address are printed correctly in cpu_startup() and pmap_bootstrap() Modified: head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Mon Feb 28 21:25:35 2011 (r219105) +++ head/sys/mips/mips/machdep.c Mon Feb 28 21:33:26 2011 (r219106) @@ -184,8 +184,8 @@ cpu_startup(void *dummy) if (boothowto & RB_VERBOSE) bootverbose++; - printf("real memory = %lu (%luK bytes)\n", ptoa(realmem), - ptoa(realmem) / 1024); + printf("real memory = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem), + ptoa((uintmax_t)realmem) / 1024); /* * Display any holes after the first chunk of extended memory. @@ -195,13 +195,13 @@ cpu_startup(void *dummy) printf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { - uintptr_t size1 = phys_avail[indx + 1] - phys_avail[indx]; + vm_paddr_t size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08llx - 0x%08llx, %llu bytes (%llu pages)\n", - (unsigned long long)phys_avail[indx], - (unsigned long long)phys_avail[indx + 1] - 1, - (unsigned long long)size1, - (unsigned long long)size1 / PAGE_SIZE); + printf("0x%08jx - 0x%08jx, %ju bytes (%ju pages)\n", + (uintmax_t)phys_avail[indx], + (uintmax_t)phys_avail[indx + 1] - 1, + (uintmax_t)size1, + (uintmax_t)size1 / PAGE_SIZE); } } Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Feb 28 21:25:35 2011 (r219105) +++ head/sys/mips/mips/pmap.c Mon Feb 28 21:33:26 2011 (r219106) @@ -387,11 +387,10 @@ pmap_pte(pmap_t pmap, vm_offset_t va) vm_offset_t pmap_steal_memory(vm_size_t size) { - vm_size_t bank_size; - vm_offset_t pa, va; + vm_paddr_t bank_size, pa; + vm_offset_t va; size = round_page(size); - bank_size = phys_avail[1] - phys_avail[0]; while (size > bank_size) { int i; @@ -540,7 +539,7 @@ again: (uintmax_t) phys_avail[i + 1] - 1, (uintmax_t) size, (uintmax_t) size / PAGE_SIZE); } - printf("Maxmem is 0x%0lx\n", ptoa(Maxmem)); + printf("Maxmem is 0x%0jx\n", ptoa((uintmax_t)Maxmem)); } /* * Steal the message buffer from the beginning of memory. From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 00:37:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9474106564A; Tue, 1 Mar 2011 00:37:46 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C67838FC08; Tue, 1 Mar 2011 00:37:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p210bkrQ065881; Tue, 1 Mar 2011 00:37:46 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p210bkY6065872; Tue, 1 Mar 2011 00:37:46 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201103010037.p210bkY6065872@svn.freebsd.org> From: Randall Stewart Date: Tue, 1 Mar 2011 00:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219120 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:37:46 -0000 Author: rrs Date: Tue Mar 1 00:37:46 2011 New Revision: 219120 URL: http://svn.freebsd.org/changeset/base/219120 Log: Adds a new Congestion Control that helps reduce the RTT that a flow will build up in buffers in transit. It is a slight modification to RFC2581 but is more friendly i.e. less aggressive. MFC after: 3 months Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp.h Tue Mar 1 00:37:46 2011 (r219120) @@ -258,6 +258,11 @@ struct sctp_paramhdr { #define SCTP_CC_HSTCP 0x00000001 /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RTCC Congestion Control - RFC2581 plus */ +#define SCTP_CC_RTCC 0x00000003 + +#define SCTP_CC_OPT_RTCC_SETMODE 0x00002000 +#define SCTP_CC_OPT_USE_DCCC_ECN 0x00002001 /* RS - Supported stream scheduling modules for pluggable * stream scheduling Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_cc_functions.c Tue Mar 1 00:37:46 2011 (r219120) @@ -185,10 +185,203 @@ sctp_cwnd_update_after_fr(struct sctp_tc } } + +/* RTCC Algoritm to limit growth of cwnd, return + * true if you want to NOT allow cwnd growth + */ +static int +cc_bw_limit(struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw) +{ + uint64_t bw_offset, rtt_offset, rtt, vtag, probepoint; + + /*- + * Here we need to see if we want + * to limit cwnd growth due to increase + * in overall rtt but no increase in bw. + * We use the following table to figure + * out what we should do. When we return + * 0, cc update goes on as planned. If we + * return 1, then no cc update happens and cwnd + * stays where it is at. + * ---------------------------------- + * BW | RTT | Action + * ********************************* + * INC | INC | return 0 + * ---------------------------------- + * INC | SAME | return 0 + * ---------------------------------- + * INC | DECR | return 0 + * ---------------------------------- + * SAME | INC | return 1 + * ---------------------------------- + * SAME | SAME | return 1 + * ---------------------------------- + * SAME | DECR | return 0 + * ---------------------------------- + * DECR | INC | return 0 or 1 based on if we caused. + * ---------------------------------- + * DECR | SAME | return 0 + * ---------------------------------- + * DECR | DECR | return 0 + * ---------------------------------- + * + * We are a bit fuzz on what an increase or + * decrease is. For BW it is the same if + * it did not change within 1/64th. For + * RTT it stayed the same if it did not + * change within 1/32nd + */ + rtt = stcb->asoc.my_vtag; + vtag = (rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + rtt = net->rtt; + bw_offset = net->cc_mod.rtcc.lbw >> SCTP_BASE_SYSCTL(sctp_rttvar_bw); + if (nbw > net->cc_mod.rtcc.lbw + bw_offset) { + /* + * BW increased, so update and return 0, since all actions + * in our table say to do the normal CC update + */ + /* PROBE POINT 0 */ + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + rtt_offset = net->cc_mod.rtcc.lbw_rtt >> SCTP_BASE_SYSCTL(sctp_rttvar_rtt); + if (nbw < net->cc_mod.rtcc.lbw - bw_offset) { + /* Bandwidth decreased. */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* rtt increased */ + /* Did we add more */ + if (net->cwnd > net->cc_mod.rtcc.cwnd_at_bw_set) { + /* We caused it maybe.. back off */ + /* PROBE POINT 1 */ + probepoint |= ((1 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cwnd = net->cc_mod.rtcc.cwnd_at_bw_set; + if (net->cc_mod.rtcc.ret_from_eq) { + /* + * Switch over to CA if we are less + * aggressive + */ + net->ssthresh = net->cwnd - 1; + net->partial_bytes_acked = 0; + } + return (1); + } + /* Probe point 2 */ + probepoint |= ((2 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + + /* Someone else - fight for more? */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } else if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* rtt decreased */ + /* Probe point 3 */ + probepoint |= ((3 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* The bw decreased but rtt stayed the same */ + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + /* Probe point 4 */ + probepoint |= ((4 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (0); + } + /* + * If we reach here then we are in a situation where the bw stayed + * the same. + */ + if (rtt > net->cc_mod.rtcc.lbw_rtt + rtt_offset) { + /* + * rtt increased we don't update bw.. so we don't update the + * rtt either. + */ + /* Probe point 5 */ + probepoint |= ((5 << 16) | 1); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return (1); + } + if (rtt < net->cc_mod.rtcc.lbw_rtt - rtt_offset) { + /* + * rtt decreased, there could be more room. we update both + * the bw and the rtt here. + */ + /* Probe point 6 */ + probepoint |= ((6 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = rtt; + net->cc_mod.rtcc.cwnd_at_bw_set = net->cwnd; + return (0); + } + /* + * Ok bw and rtt remained the same .. no update to any but save the + * latest cwnd. + */ + /* Probe point 7 */ + probepoint |= ((7 << 16) | net->cc_mod.rtcc.ret_from_eq); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | nbw), + net->cc_mod.rtcc.lbw_rtt, + rtt, + probepoint); + return ((int)net->cc_mod.rtcc.ret_from_eq); +} + static void -sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, +sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb, struct sctp_association *asoc, - int accum_moved, int reneged_all, int will_exit) + int accum_moved, int reneged_all, int will_exit, int use_rtcc) { struct sctp_nets *net; int old_cwnd; @@ -327,6 +520,48 @@ sctp_cwnd_update_after_sack(struct sctp_ goto skip_cwnd_update; } /* + * Did any measurements go on for this network? + */ + if (use_rtcc && (net->cc_mod.rtcc.tls_needs_set > 0)) { + uint64_t nbw; + + /* + * At this point our bw_bytes has been updated by + * incoming sack information. + * + * But our bw may not yet be set. + * + */ + if ((net->cc_mod.rtcc.new_tot_time / 1000) > 0) { + nbw = net->cc_mod.rtcc.bw_bytes / (net->cc_mod.rtcc.new_tot_time / 1000); + } else { + nbw = net->cc_mod.rtcc.bw_bytes; + } + if (net->cc_mod.rtcc.lbw) { + if (cc_bw_limit(stcb, net, nbw)) { + /* Hold here, no update */ + goto skip_cwnd_update; + } + } else { + uint64_t vtag, probepoint; + + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((0xa << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + nbw, + 0, + net->rtt, + probepoint); + net->cc_mod.rtcc.lbw = nbw; + net->cc_mod.rtcc.lbw_rtt = net->rtt; + } + } + /* * CMT: CUC algorithm. Update cwnd if pseudo-cumack has * moved. */ @@ -481,31 +716,67 @@ sctp_cwnd_update_after_timeout(struct sc } } - static void -sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, - int in_window, int num_pkt_lost) +sctp_cwnd_update_after_ecn_echo_common(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost, int use_rtcc) { int old_cwnd = net->cwnd; - if (in_window == 0) { - SCTP_STAT_INCR(sctps_ecnereducedcwnd); - net->ssthresh = net->cwnd / 2; - if (net->ssthresh < net->mtu) { - net->ssthresh = net->mtu; - /* here back off the timer as well, to slow us down */ - net->RTO <<= 1; + if ((use_rtcc) && (net->lan_type == SCTP_LAN_LOCAL) && (net->cc_mod.rtcc.use_dccc_ecn)) { + /* Data center Congestion Control */ + if (in_window == 0) { + /* + * Go to CA with the cwnd at the point we sent the + * TSN that was marked with a CE. + */ + if (net->ecn_prev_cwnd < net->cwnd) { + /* Restore to prev cwnd */ + net->cwnd = net->ecn_prev_cwnd - (net->mtu * num_pkt_lost); + } else { + /* Just cut in 1/2 */ + net->cwnd /= 2; + } + /* Drop to CA */ + net->ssthresh = net->cwnd - (num_pkt_lost * net->mtu); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } + } else { + /* + * Further tuning down required over the drastic + * orginal cut + */ + net->ssthresh -= (net->mtu * num_pkt_lost); + net->cwnd -= (net->mtu * num_pkt_lost); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } - net->cwnd = net->ssthresh; - SDT_PROBE(sctp, cwnd, net, ecn, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + } else { + if (in_window == 0) { + SCTP_STAT_INCR(sctps_ecnereducedcwnd); + net->ssthresh = net->cwnd / 2; + if (net->ssthresh < net->mtu) { + net->ssthresh = net->mtu; + /* + * here back off the timer as well, to slow + * us down + */ + net->RTO <<= 1; + } + net->cwnd = net->ssthresh; + SDT_PROBE(sctp, cwnd, net, ecn, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT); + } } } + } static void @@ -636,14 +907,16 @@ sctp_cwnd_update_after_output(struct sct if (net->ssthresh < net->cwnd) net->ssthresh = net->cwnd; - net->cwnd = (net->flight_size + (burst_limit * net->mtu)); - SDT_PROBE(sctp, cwnd, net, bl, - stcb->asoc.my_vtag, - ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), - net, - old_cwnd, net->cwnd); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { - sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + if (burst_limit) { + net->cwnd = (net->flight_size + (burst_limit * net->mtu)); + SDT_PROBE(sctp, cwnd, net, bl, + stcb->asoc.my_vtag, + ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), + net, + old_cwnd, net->cwnd); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_MONITOR_ENABLE) { + sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_BRST); + } } } @@ -673,6 +946,212 @@ sctp_cwnd_update_after_fr_timer(struct s } } +static void +sctp_cwnd_update_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 0); +} + +static void +sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + /* Passing a zero argument in last disables the rtcc algoritm */ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 0); +} + +/* Here starts the RTCCVAR type CC invented by RRS which + * is a slight mod to RFC2581. We reuse a common routine or + * two since these algoritms are so close and need to + * remain the same. + */ +static void +sctp_cwnd_update_rtcc_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, + int in_window, int num_pkt_lost) +{ + sctp_cwnd_update_after_ecn_echo_common(stcb, net, in_window, num_pkt_lost, 1); +} + + +static +void +sctp_cwnd_update_rtcc_tsn_acknowledged(struct sctp_nets *net, + struct sctp_tmit_chunk *tp1) +{ + net->cc_mod.rtcc.bw_bytes += tp1->send_size; +} + +static void +sctp_cwnd_prepare_rtcc_net_for_sack(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set > 0) { + /* We had a bw measurment going on */ + struct timeval ltls; + + SCTP_GETPTIME_TIMEVAL(<ls); + timevalsub(<ls, &net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.new_tot_time = (ltls.tv_sec * 1000000) + ltls.tv_usec; + } +} + +static void +sctp_cwnd_new_rtcc_transmission_begins(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + if (net->cc_mod.rtcc.lbw) { + /* Clear the old bw.. we went to 0 in-flight */ + vtag = (net->rtt << 32) | (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + probepoint = (((uint64_t) net->cwnd) << 32); + /* Probe point 8 */ + probepoint |= ((8 << 16) | 0); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + ((net->cc_mod.rtcc.lbw << 32) | 0), + net->cc_mod.rtcc.lbw_rtt, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + if (net->cc_mod.rtcc.ret_from_eq) { + /* less aggressive one - reset cwnd too */ + uint32_t cwnd_in_mtu, cwnd; + + cwnd_in_mtu = SCTP_BASE_SYSCTL(sctp_initial_cwnd); + if (cwnd_in_mtu == 0) { + /* + * Using 0 means that the value of RFC 4960 + * is used. + */ + cwnd = min((net->mtu * 4), max((2 * net->mtu), SCTP_INITIAL_CWND)); + } else { + /* + * We take the minimum of the burst limit + * and the initial congestion window. + */ + if ((stcb->asoc.max_burst > 0) && (cwnd_in_mtu > stcb->asoc.max_burst)) + cwnd_in_mtu = stcb->asoc.max_burst; + cwnd = (net->mtu - sizeof(struct sctphdr)) * cwnd_in_mtu; + } + if (net->cwnd > cwnd) { + /* + * Only set if we are not a timeout (i.e. + * down to 1 mtu) + */ + net->cwnd = cwnd; + } + } + } +} + +static void +sctp_set_rtcc_initial_cc_param(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + uint64_t vtag, probepoint; + + sctp_set_initial_cc_param(stcb, net); + stcb->asoc.use_precise_time = 1; + probepoint = (((uint64_t) net->cwnd) << 32); + probepoint |= ((9 << 16) | 0); + vtag = (net->rtt << 32) | + (((uint32_t) (stcb->sctp_ep->sctp_lport)) << 16) | + (stcb->rport); + SDT_PROBE(sctp, cwnd, net, rttvar, + vtag, + 0, + 0, + 0, + probepoint); + net->cc_mod.rtcc.lbw_rtt = 0; + net->cc_mod.rtcc.cwnd_at_bw_set = 0; + net->cc_mod.rtcc.lbw = 0; + net->cc_mod.rtcc.bw_tot_time = 0; + net->cc_mod.rtcc.bw_bytes = 0; + net->cc_mod.rtcc.tls_needs_set = 0; + net->cc_mod.rtcc.ret_from_eq = SCTP_BASE_SYSCTL(sctp_rttvar_eqret); +} + +static int +sctp_cwnd_rtcc_socket_option(struct sctp_tcb *stcb, int setorget, + struct sctp_cc_option *cc_opt) +{ + struct sctp_nets *net; + + if (setorget == 1) { + /* a set */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.ret_from_eq = cc_opt->aid_value.assoc_value; + } + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + if ((cc_opt->aid_value.assoc_value != 0) && + (cc_opt->aid_value.assoc_value != 1)) { + return (EINVAL); + } + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + net->cc_mod.rtcc.use_dccc_ecn = cc_opt->aid_value.assoc_value; + } + } else { + return (EINVAL); + } + } else { + /* a get */ + if (cc_opt->option == SCTP_CC_OPT_RTCC_SETMODE) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.ret_from_eq; + } else if (cc_opt->option == SCTP_CC_OPT_USE_DCCC_ECN) { + net = TAILQ_FIRST(&stcb->asoc.nets); + if (net == NULL) { + return (EFAULT); + } + cc_opt->aid_value.assoc_value = net->cc_mod.rtcc.use_dccc_ecn; + } else { + return (EINVAL); + } + } + return (0); +} + +static void +sctp_cwnd_update_rtcc_packet_transmitted(struct sctp_tcb *stcb, + struct sctp_nets *net) +{ + if (net->cc_mod.rtcc.tls_needs_set == 0) { + SCTP_GETPTIME_TIMEVAL(&net->cc_mod.rtcc.tls); + net->cc_mod.rtcc.tls_needs_set = 2; + } +} + +static void +sctp_cwnd_update_rtcc_after_sack(struct sctp_tcb *stcb, + struct sctp_association *asoc, + int accum_moved, int reneged_all, int will_exit) +{ + /* Passing a one argument at the last enables the rtcc algoritm */ + sctp_cwnd_update_after_sack_common(stcb, asoc, accum_moved, reneged_all, will_exit, 1); +} + + +/* Here starts Sally Floyds HS-TCP */ + struct sctp_hs_raise_drop { int32_t cwnd; int32_t increase; @@ -1710,5 +2189,20 @@ struct sctp_cc_functions sctp_cc_functio .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, .sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer + }, + { + .sctp_set_initial_cc_param = sctp_set_rtcc_initial_cc_param, + .sctp_cwnd_update_after_sack = sctp_cwnd_update_rtcc_after_sack, + .sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr, + .sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout, + .sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_rtcc_after_ecn_echo, + .sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped, + .sctp_cwnd_update_after_output = sctp_cwnd_update_after_output, + .sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer, + .sctp_cwnd_update_packet_transmitted = sctp_cwnd_update_rtcc_packet_transmitted, + .sctp_cwnd_update_tsn_acknowledged = sctp_cwnd_update_rtcc_tsn_acknowledged, + .sctp_cwnd_new_transmission_begins = sctp_cwnd_new_rtcc_transmission_begins, + .sctp_cwnd_prepare_net_for_sack = sctp_cwnd_prepare_rtcc_net_for_sack, + .sctp_cwnd_socket_option = sctp_cwnd_rtcc_socket_option } }; Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_constants.h Tue Mar 1 00:37:46 2011 (r219120) @@ -965,10 +965,9 @@ __FBSDID("$FreeBSD$"); * local lan type rtt's */ /* - * We allow 500us for the rtt and another 500us for the cookie processing - * since we measure this on the first rtt. + * We allow 900us for the rtt. */ -#define SCTP_LOCAL_LAN_RTT 1100 +#define SCTP_LOCAL_LAN_RTT 900 #define SCTP_LAN_UNKNOWN 0 #define SCTP_LAN_LOCAL 1 #define SCTP_LAN_INTERNET 2 Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_structs.h Tue Mar 1 00:37:46 2011 (r219120) @@ -219,6 +219,21 @@ struct htcp { uint32_t lasttime; }; +struct rtcc_cc { + struct timeval tls; /* The time we started the sending */ + uint64_t lbw; /* Our last estimated bw */ + uint64_t lbw_rtt; /* RTT at bw estimate */ + uint64_t bw_bytes; /* The total bytes since this sending began */ + uint64_t bw_tot_time; /* The total time since sending began */ + uint64_t new_tot_time; /* temp holding the new value */ + uint32_t cwnd_at_bw_set; + uint8_t ret_from_eq; + uint8_t use_dccc_ecn; + uint8_t tls_needs_set; /* Flag to indicate we need to set tls 0 or 1 + * means set at send 2 not */ +}; + + struct sctp_nets { TAILQ_ENTRY(sctp_nets) sctp_next; /* next link */ @@ -255,6 +270,7 @@ struct sctp_nets { struct timeval last_sent_time; union cc_control_data { struct htcp htcp_ca; /* JRS - struct used in HTCP algorithm */ + struct rtcc_cc rtcc; /* rtcc module cc stuff */ } cc_mod; int ref_count; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_sysctl.c Tue Mar 1 00:37:46 2011 (r219120) @@ -115,11 +115,9 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; SCTP_BASE_SYSCTL(sctp_buffer_splitting) = SCTPCTL_BUFFER_SPLITTING_DEFAULT; SCTP_BASE_SYSCTL(sctp_initial_cwnd) = SCTPCTL_INITIAL_CWND_DEFAULT; -#ifdef SCTP_HAS_RTTCC SCTP_BASE_SYSCTL(sctp_rttvar_bw) = SCTPCTL_RTTVAR_BW_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_rtt) = SCTPCTL_RTTVAR_RTT_DEFAULT; SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; -#endif #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -638,11 +636,9 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_buffer_splitting), SCTPCTL_BUFFER_SPLITTING_MIN, SCTPCTL_BUFFER_SPLITTING_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_initial_cwnd), SCTPCTL_INITIAL_CWND_MIN, SCTPCTL_INITIAL_CWND_MAX); -#ifdef SCTP_HAS_RTTCC RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_bw), SCTPCTL_RTTVAR_BW_MIN, SCTPCTL_RTTVAR_BW_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_rtt), SCTPCTL_RTTVAR_RTT_MIN, SCTPCTL_RTTVAR_RTT_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_rttvar_eqret), SCTPCTL_RTTVAR_EQRET_MIN, SCTPCTL_RTTVAR_EQRET_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable), SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MIN, SCTPCTL_UDP_TUNNELING_FOR_CLIENT_ENABLE_MAX); @@ -1110,7 +1106,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_initial_cwnd), 0, sysctl_sctp_check, "IU", SCTPCTL_INITIAL_CWND_DESC); -#ifdef SCTP_HAS_RTTCC SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_bw, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rttvar_bw), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_BW_DESC); @@ -1122,7 +1117,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, rttvar_eqret, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_rttvar_eqret), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_EQRET_DESC); -#endif #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_sysctl.h Tue Mar 1 00:37:46 2011 (r219120) @@ -104,11 +104,9 @@ struct sctp_sysctl { uint32_t sctp_mobility_base; uint32_t sctp_mobility_fasthandoff; uint32_t sctp_inits_include_nat_friendly; -#ifdef SCTP_HAS_RTTCC uint32_t sctp_rttvar_bw; uint32_t sctp_rttvar_rtt; uint32_t sctp_rttvar_eqret; -#endif #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_log sctp_log; #endif @@ -519,7 +517,6 @@ struct sctp_sysctl { #define SCTPCTL_INITIAL_CWND_MIN 0 #define SCTPCTL_INITIAL_CWND_MAX 0xffffffff #define SCTPCTL_INITIAL_CWND_DEFAULT 3 -#ifdef SCTP_HAS_RTTCC /* rttvar smooth avg for bw calc */ #define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smothing on rtt calc" @@ -537,7 +534,6 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_EQRET_MIN 0 #define SCTPCTL_RTTVAR_EQRET_MAX 1 #define SCTPCTL_RTTVAR_EQRET_DEFAULT 0 -#endif #if defined(SCTP_DEBUG) /* debug: Configure debug output */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Mar 1 00:13:50 2011 (r219119) +++ head/sys/netinet/sctp_usrreq.c Tue Mar 1 00:37:46 2011 (r219120) @@ -1777,6 +1777,7 @@ flags_out: SCTP_TCB_UNLOCK(stcb); } } + break; /* RS - Get socket option for pluggable stream scheduling */ case SCTP_PLUGGABLE_SS: { @@ -2957,6 +2958,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value]; stcb->asoc.congestion_control_module = av->assoc_value; if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) { @@ -2976,6 +2978,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_CC_RFC2581: case SCTP_CC_HSTCP: case SCTP_CC_HTCP: + case SCTP_CC_RTCC: SCTP_INP_WLOCK(inp); inp->sctp_ep.sctp_default_cc_module = av->assoc_value; SCTP_INP_WUNLOCK(inp); @@ -2987,6 +2990,7 @@ sctp_setopt(struct socket *so, int optna } } } + break; case SCTP_CC_OPTION: { struct sctp_cc_option *cc_opt; From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 03:07:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70B0106564A; Tue, 1 Mar 2011 03:07:25 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 38AEF8FC0A; Tue, 1 Mar 2011 03:07:24 +0000 (UTC) Received: by vxc34 with SMTP id 34so4403368vxc.13 for ; Mon, 28 Feb 2011 19:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=predatorlabs.net; s=google; h=domainkey-signature:mime-version:x-originating-ip:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y51IlBS6RguVVjJ7qmVxcol2v9DWbh0J0+x9ZVfb0Cc=; b=W4LhSEYulTFaavNptVNNm7IkPwvU+snVb/7mYyT75GICkey2wb1f6eTcYp6b4PvTXJ fsUxRzwbFqmRc905zCBk3+1aoMmyYDVLOWEvw6hrJGOhR0eenc0vrIqg3p0KlM93MJRW l6nuEvmE8Gt7VPe23r3Sa62gtwYrRdk/BOslc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=predatorlabs.net; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=aaAfyEmYa03lirZ0sIWmv6A+dB9EnbVNZRnHHdVTcUnfCWBMyai4Tg2hEsHrYUjWFn dzcnf3/bGY9kkLWxjpYyBb2J7Q2OdCMNDnBUg79A+WJIzofCfjpEWFOEg4BnLknlZICQ LtEP35Hk6iZhEcHt2D6Vt4z1/xPiGd3zJPlBo= MIME-Version: 1.0 Received: by 10.52.164.227 with SMTP id yt3mr10473777vdb.163.1298948844218; Mon, 28 Feb 2011 19:07:24 -0800 (PST) Received: by 10.220.192.195 with HTTP; Mon, 28 Feb 2011 19:07:24 -0800 (PST) X-Originating-IP: [128.95.133.33] In-Reply-To: <201102281003.p1SA3mfl032937@svn.freebsd.org> References: <201102281003.p1SA3mfl032937@svn.freebsd.org> Date: Mon, 28 Feb 2011 19:07:24 -0800 Message-ID: From: Rob Farmer To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219096 - in head: lib/libc/yp lib/libelf share/man/man7 sys/boot/i386/cdboot sys/boot/pc98/cdboot usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 03:07:25 -0000 On Mon, Feb 28, 2011 at 2:03 AM, Bruce Cran wrote: > Author: brucec > Date: Mon Feb 28 10:03:48 2011 > New Revision: 219096 > URL: http://svn.freebsd.org/changeset/base/219096 > > Log: > =A0Revert some of r177626. "in in" is valid in certain sentences. I disagree. "in in" (or any doubled word) looks awkward in print and should be avoided. Even if its grammatically correct, its a style problem because the reader has to do a double take and starts to wonder about the quality of the writing. With the exception of the security manpage, where "break in originally" or similar would work, these are all unnecessary verbosity and should be cut. > > =A0PR: =A0 =A0 =A0 =A0 =A0 121490 > =A0MFC after: =A0 =A03 days > > Modified: > =A0head/lib/libc/yp/xdryp.c > =A0head/lib/libelf/libelf_convert.m4 > =A0head/share/man/man7/security.7 > =A0head/sys/boot/i386/cdboot/cdboot.s > =A0head/sys/boot/pc98/cdboot/cdboot.s > =A0head/usr.bin/checknr/checknr.c > > Modified: head/lib/libc/yp/xdryp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/yp/xdryp.c =A0 =A0Mon Feb 28 09:11:46 2011 =A0 =A0 =A0 = =A0(r219095) > +++ head/lib/libc/yp/xdryp.c =A0 =A0Mon Feb 28 10:03:48 2011 =A0 =A0 =A0 = =A0(r219096) > @@ -42,7 +42,7 @@ extern void *ypresp_data; > =A0* I'm leaving the xdr_datum() function in purely for backwards > =A0* compatibility. yplib.c doesn't actually use it, but it's listed > =A0* in yp_prot.h as being available, so it's probably a good idea to > - * leave it in case somebody goes looking for it. > + * leave it in in case somebody goes looking for it. "leave it" and "leave it in" are equal. > =A0*/ > =A0typedef struct { > =A0 =A0 =A0 =A0char *dptr; > > Modified: head/lib/libelf/libelf_convert.m4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libelf/libelf_convert.m4 =A0 Mon Feb 28 09:11:46 2011 =A0 = =A0 =A0 =A0(r219095) > +++ head/lib/libelf/libelf_convert.m4 =A0 Mon Feb 28 10:03:48 2011 =A0 = =A0 =A0 =A0(r219096) > @@ -136,7 +136,7 @@ __FBSDID("$FreeBSD$"); > > =A0/* > =A0* Read in various integral values. =A0The source pointer could be > - * unaligned. =A0Values are read in native byte order. =A0The source > + * unaligned. =A0Values are read in in native byte order. =A0The source > =A0* pointer is incremented appropriately. > =A0*/ > > > Modified: head/share/man/man7/security.7 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man7/security.7 =A0 =A0 =A0Mon Feb 28 09:11:46 2011 = =A0 =A0 =A0 =A0(r219095) > +++ head/share/man/man7/security.7 =A0 =A0 =A0Mon Feb 28 10:03:48 2011 = =A0 =A0 =A0 =A0(r219096) > @@ -138,7 +138,7 @@ This gives you a convenient way to detec > =A0Making > =A0it impossible for an attacker to install a backdoor may actually be de= trimental > =A0to your security because it will not close off the hole the attacker u= sed to > -break in the first place. > +break in in the first place. > =A0.Pp > =A0Security remedies should always be implemented with a multi-layered > =A0.Dq onion peel > > Modified: head/sys/boot/i386/cdboot/cdboot.s > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/boot/i386/cdboot/cdboot.s =A0Mon Feb 28 09:11:46 2011 =A0 = =A0 =A0 =A0(r219095) > +++ head/sys/boot/i386/cdboot/cdboot.s =A0Mon Feb 28 10:03:48 2011 =A0 = =A0 =A0 =A0(r219096) > @@ -174,7 +174,7 @@ lookup_path: =A0 =A0 =A0 =A0push %si =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Save file name > =A0lookup_found: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0# Found a loader file > =A0# > =A0# Load the binary into the buffer. =A0Due to real mode addressing limi= tations > -# we have to read it in 64k chunks. > +# we have to read it in in 64k chunks. > =A0# > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mov DIR_SIZE(%bx),%eax =A0 =A0 =A0 =A0 =A0= # Read file length > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0add $SECTOR_SIZE-1,%eax =A0 =A0 =A0 =A0 # = Convert length to sectors > > Modified: head/sys/boot/pc98/cdboot/cdboot.s > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/boot/pc98/cdboot/cdboot.s =A0Mon Feb 28 09:11:46 2011 =A0 = =A0 =A0 =A0(r219095) > +++ head/sys/boot/pc98/cdboot/cdboot.s =A0Mon Feb 28 10:03:48 2011 =A0 = =A0 =A0 =A0(r219096) > @@ -415,7 +415,7 @@ lookup_path: =A0 =A0 =A0 =A0push %si =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0# Save file name > =A0lookup_found: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0# Found a loader file > =A0# > =A0# Load the binary into the buffer. =A0Due to real mode addressing limi= tations > -# we have to read it in 64k chunks. > +# we have to read it in in 64k chunks. These have the form "read it in in x parts" and that's worse than just "read it in x parts." read=3Din and write=3Dout is a fair assumption, IMHO, if you disagree, then switch to "read it in using 64k chunks." > =A0# > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mov %es:DIR_SIZE(%bx),%eax =A0 =A0 =A0# Re= ad file length > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0add $SECTOR_SIZE-1,%eax =A0 =A0 =A0 =A0 # = Convert length to sectors > > Modified: head/usr.bin/checknr/checknr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/checknr/checknr.c =A0 =A0 =A0Mon Feb 28 09:11:46 2011 = =A0 =A0 =A0 =A0(r219095) > +++ head/usr.bin/checknr/checknr.c =A0 =A0 =A0Mon Feb 28 10:03:48 2011 = =A0 =A0 =A0 =A0(r219096) > @@ -79,7 +79,7 @@ struct stkstr { > =A0 =A0 =A0 =A0int opno; =A0 =A0 =A0 /* number of opening bracket */ > =A0 =A0 =A0 =A0int pl; =A0 =A0 =A0 =A0 /* '+', '-', ' ' for \s, 1 for \f,= 0 for .ft */ > =A0 =A0 =A0 =A0int parm; =A0 =A0 =A0 /* parm to size, font, etc */ > - =A0 =A0 =A0 int lno; =A0 =A0 =A0 =A0/* line number the thing came in */ > + =A0 =A0 =A0 int lno; =A0 =A0 =A0 =A0/* line number the thing came in in= */ How about "line number of x?" (I can't tell what x is from the context.) --=20 Rob Farmer > =A0} stk[MAXSTK]; > =A0int stktop; > > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 03:08:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F11B1065677; Tue, 1 Mar 2011 03:08:26 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from exhub015-1.exch015.msoutlookonline.net (exhub015-1.exch015.msoutlookonline.net [207.5.72.93]) by mx1.freebsd.org (Postfix) with ESMTP id EA49C8FC21; Tue, 1 Mar 2011 03:08:25 +0000 (UTC) Received: from [192.168.1.2] (173.66.131.189) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.2.254.0; Mon, 28 Feb 2011 19:08:24 -0800 Message-ID: <4D6C6327.3040503@p6m7g8.com> Date: Mon, 28 Feb 2011 22:08:23 -0500 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Simon L. Nielsen" References: <201102280654.p1S6sF7M028156@svn.freebsd.org> In-Reply-To: <201102280654.p1S6sF7M028156@svn.freebsd.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219093 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 03:08:26 -0000 Thanks for all the numerous ones, especially recently! On 2/28/2011 1:54 AM, Simon L. Nielsen wrote: > Author: simon > Date: Mon Feb 28 06:54:14 2011 > New Revision: 219093 > URL: http://svn.freebsd.org/changeset/base/219093 > > Log: > Drop my OpenSSL maintainer hat. I don't have the motivation to keep > chasing updates etc. > > Leave a reminder not to commit non-upstream changes (ref: Debian > random...). > > Modified: > head/MAINTAINERS > > Modified: head/MAINTAINERS > ============================================================================== > --- head/MAINTAINERS Mon Feb 28 05:45:31 2011 (r219092) > +++ head/MAINTAINERS Mon Feb 28 06:54:14 2011 (r219093) > @@ -107,7 +107,7 @@ linux emul emulation Please discuss chan > bs{diff,patch} cperciva Pre-commit review requested. > portsnap cperciva Pre-commit review requested. > freebsd-update cperciva Pre-commit review requested. > -openssl simon Pre-commit review requested. > +openssl - No non-upstream commits should be done. > sys/netgraph/bluetooth emax Pre-commit review preferred. > lib/libbluetooth emax Pre-commit review preferred. > lib/libsdp emax Pre-commit review preferred. > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 03:11:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8488106566B; Tue, 1 Mar 2011 03:11:29 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 620DF8FC14; Tue, 1 Mar 2011 03:11:26 +0000 (UTC) Received: by vxc34 with SMTP id 34so4406087vxc.13 for ; Mon, 28 Feb 2011 19:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=predatorlabs.net; s=google; h=domainkey-signature:mime-version:x-originating-ip:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SZ6IKjDkfRARuEzXkR4+p+573p5+yQvltzNQCIKCnek=; b=AVLRv3OVR7nW9aYebGwMN3ia04cuQLcMzbTCGdCF3suMrnf/X7BwcSnGTEbMCHnffY uz748XhiWt/s3pJT2kYUsxOLDEP0eTJvIYbEqmIMB2iqECar1nXW68Wo900pmz0IU6eT zqpa94DVuqV1nFeCRyTCH3d1Xh35CTYCL/3l0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=predatorlabs.net; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Jd7854LVSZzqm4t+/7RH7+TJsaxyWzBKgNbn0gS62PnFXdDWIhUcBmCuputSgJFyIj 9s2JPFhHYege5R4gecR1tYZvnxLgrmoKPtkCIcdki+q2cmbWT9svY5P5L7bR1YWBvOWr 0t4zlngjL7j3D4oAv4jpEU+912ACzULhsIWTY= MIME-Version: 1.0 Received: by 10.220.60.133 with SMTP id p5mr932576vch.206.1298949085097; Mon, 28 Feb 2011 19:11:25 -0800 (PST) Received: by 10.220.192.195 with HTTP; Mon, 28 Feb 2011 19:11:25 -0800 (PST) X-Originating-IP: [128.95.133.33] In-Reply-To: References: <201102281003.p1SA3mfl032937@svn.freebsd.org> Date: Mon, 28 Feb 2011 19:11:25 -0800 Message-ID: From: Rob Farmer To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219096 - in head: lib/libc/yp lib/libelf share/man/man7 sys/boot/i386/cdboot sys/boot/pc98/cdboot usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 03:11:30 -0000 On Mon, Feb 28, 2011 at 7:07 PM, Rob Farmer wrot= e: > On Mon, Feb 28, 2011 at 2:03 AM, Bruce Cran wrote: >> Author: brucec >> Date: Mon Feb 28 10:03:48 2011 >> New Revision: 219096 >> URL: http://svn.freebsd.org/changeset/base/219096 >> >> Log: >> =A0Revert some of r177626. "in in" is valid in certain sentences. > > I disagree. "in in" (or any doubled word) looks awkward in print and > should be avoided. Even if its grammatically correct, its a style And I misused "its" and "it's" in my message about grammar. How embarrassin= g. --=20 Rob Farmer From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 03:25:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC812106564A; Tue, 1 Mar 2011 03:25:18 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B079F8FC08; Tue, 1 Mar 2011 03:25:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p213PI6f079254; Tue, 1 Mar 2011 03:25:18 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p213PImX079252; Tue, 1 Mar 2011 03:25:18 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201103010325.p213PImX079252@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 1 Mar 2011 03:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219121 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 03:25:19 -0000 Author: jchandra Date: Tue Mar 1 03:25:18 2011 New Revision: 219121 URL: http://svn.freebsd.org/changeset/base/219121 Log: Use new thread's stack to invoke pmap_activate in cpu_switch() Restore the SP from the new thread's PCB before calling pmap_activate. Remove some old FIXME comments. Modified: head/sys/mips/mips/swtch.S Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Tue Mar 1 00:37:46 2011 (r219120) +++ head/sys/mips/mips/swtch.S Tue Mar 1 03:25:18 2011 (r219121) @@ -195,11 +195,6 @@ LEAF(savectx) SAVE_U_PCB_CONTEXT(ra, PREG_PC, a0) move ra, v0 /* restore 'ra' before returning */ - /* - * FREEBSD_DEVELOPERS_FIXME: - * In case there are CPU-specific registers that need - * to be saved with the other registers do so here. - */ j ra move v0, zero END(savectx) @@ -254,11 +249,6 @@ NON_LEAF(cpu_switch, CALLFRAME_SIZ, ra) nop getpc: SAVE_U_PCB_CONTEXT(ra, PREG_PC, a0) # save return address - /* - * FREEBSD_DEVELOPERS_FIXME: - * In case there are CPU-specific registers that need - * to be saved with the other registers do so here. - */ PTR_S a2, TD_LOCK(a3) # Switchout td_lock @@ -328,13 +318,15 @@ entry0set: * Now running on new u struct. */ sw2: + PTR_L s0, TD_PCB(s7) + RESTORE_U_PCB_CONTEXT(sp, PREG_SP, s0) PTR_LA t1, _C_LABEL(pmap_activate) # s7 = new proc pointer jalr t1 # s7 = new proc pointer move a0, s7 # BDSLOT /* * Restore registers and return. */ - PTR_L a0, TD_PCB(s7) + move a0, s0 RESTORE_U_PCB_CONTEXT(gp, PREG_GP, a0) RESTORE_U_PCB_CONTEXT(v0, PREG_SR, a0) # restore kernel context RESTORE_U_PCB_CONTEXT(ra, PREG_RA, a0) @@ -346,13 +338,8 @@ sw2: RESTORE_U_PCB_CONTEXT(s5, PREG_S5, a0) RESTORE_U_PCB_CONTEXT(s6, PREG_S6, a0) RESTORE_U_PCB_CONTEXT(s7, PREG_S7, a0) - RESTORE_U_PCB_CONTEXT(sp, PREG_SP, a0) RESTORE_U_PCB_CONTEXT(s8, PREG_S8, a0) - /* - * FREEBSD_DEVELOPERS_FIXME: - * In case there are CPU-specific registers that need - * to be restored with the other registers do so here. - */ + mfc0 t0, MIPS_COP_0_STATUS and t0, t0, MIPS_SR_INT_MASK and v0, v0, ~MIPS_SR_INT_MASK From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 04:21:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 075DE106566B; Tue, 1 Mar 2011 04:21:57 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90298FC2A; Tue, 1 Mar 2011 04:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p214LuUa083845; Tue, 1 Mar 2011 04:21:56 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p214Luh2083843; Tue, 1 Mar 2011 04:21:56 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201103010421.p214Luh2083843@svn.freebsd.org> From: "Jayachandran C." Date: Tue, 1 Mar 2011 04:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219122 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 04:21:57 -0000 Author: jchandra Date: Tue Mar 1 04:21:56 2011 New Revision: 219122 URL: http://svn.freebsd.org/changeset/base/219122 Log: Increase NKPT in case of n32 and n64 to support more physical memory. On n32, vm_page_startup() needs more virtual mem to map vm_page structs. The new value of 256 will allow us to support 16GB RAM. Modified: head/sys/mips/include/pmap.h Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Tue Mar 1 03:25:18 2011 (r219121) +++ head/sys/mips/include/pmap.h Tue Mar 1 04:21:56 2011 (r219122) @@ -49,7 +49,11 @@ #include #include +#if defined(__mips_n32) || defined(__mips_n64) /* PHYSADDR_64BIT */ +#define NKPT 256 /* mem > 4G, vm_page_startup needs more KPTs */ +#else #define NKPT 120 /* actual number of kernel page tables */ +#endif #ifndef LOCORE From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 08:52:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DE831065673; Tue, 1 Mar 2011 08:52:10 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8398FC15; Tue, 1 Mar 2011 08:52:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p218qAln004894; Tue, 1 Mar 2011 08:52:10 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p218qA0K004891; Tue, 1 Mar 2011 08:52:10 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201103010852.p218qA0K004891@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 1 Mar 2011 08:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219123 - head/usr.sbin/fifolog/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 08:52:10 -0000 Author: phk Date: Tue Mar 1 08:52:10 2011 New Revision: 219123 URL: http://svn.freebsd.org/changeset/base/219123 Log: Another couple of unsigned/ssize_t changes. Modified: head/usr.sbin/fifolog/lib/fifolog_create.c head/usr.sbin/fifolog/lib/fifolog_write_poll.c Modified: head/usr.sbin/fifolog/lib/fifolog_create.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_create.c Tue Mar 1 04:21:56 2011 (r219122) +++ head/usr.sbin/fifolog/lib/fifolog_create.c Tue Mar 1 08:52:10 2011 (r219123) @@ -44,7 +44,7 @@ const char * fifolog_create(const char *fn, off_t size, ssize_t recsize) { int i, fd; - unsigned u; + ssize_t u; off_t ms; struct stat st; char *buf; Modified: head/usr.sbin/fifolog/lib/fifolog_write_poll.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_write_poll.c Tue Mar 1 04:21:56 2011 (r219122) +++ head/usr.sbin/fifolog/lib/fifolog_write_poll.c Tue Mar 1 08:52:10 2011 (r219123) @@ -318,7 +318,7 @@ fifolog_write_record(struct fifolog_writ { const unsigned char *p; uint8_t buf[9]; - unsigned bufl; + ssize_t bufl; fifolog_write_assert(f); assert(!(id & (FIFOLOG_TIMESTAMP|FIFOLOG_LENGTH))); From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 10:10:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346861065673; Tue, 1 Mar 2011 10:10:51 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (unknown [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id DD1EA8FC18; Tue, 1 Mar 2011 10:10:50 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id DFA1CE902C; Tue, 1 Mar 2011 10:10:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=subject :from:to:cc:in-reply-to:references:content-type:date:message-id :mime-version:content-transfer-encoding; s=mail; bh=YszGdAjTx2SU XV/G8EmKWJdk8IE=; b=QjSbtVPc7YYoNQUSqvesmYljMAo+B3i+pjJbHZ+gOvor fymz6AvHGkx2e8GdWWbjYgr1OWiFUKv8lBRZkYJKHARTYxRApk+452AKTPoazAST tGALEPjucgavk6Bd0iDUXrqMyQ+wWkw3kKpiHgFudkTI7tkZLCxWPQ41sAmJu3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=subject:from :to:cc:in-reply-to:references:content-type:date:message-id :mime-version:content-transfer-encoding; q=dns; s=mail; b=BwFk1J SkAAkGbV+LWaA4cO51+rR5n+L/5ohbycBwUvOmNhRnb5ZTbiMj3SVVX1vJgfwBq2 CmDbVmShe5Zuzm24w/Nds3FKnjKHXKcrD9q//69oKcDIlfOh5s02fbMO65nW0u4e LLVfB3mHhDfDU0DYtiLTSeUOFqqVQyi6wQ1TM= Received: from [192.168.0.10] (client-86-31-236-253.oxfd.adsl.virginmedia.com [86.31.236.253]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 75232E902B; Tue, 1 Mar 2011 10:10:49 +0000 (GMT) From: Bruce Cran To: Rob Farmer In-Reply-To: References: <201102281003.p1SA3mfl032937@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Tue, 01 Mar 2011 10:10:22 +0000 Message-ID: <1298974222.2888.13.camel@core.nessbank> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Cran Subject: Re: svn commit: r219096 - in head: lib/libc/yp lib/libelf share/man/man7 sys/boot/i386/cdboot sys/boot/pc98/cdboot usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 10:10:51 -0000 On Mon, 2011-02-28 at 19:07 -0800, Rob Farmer wrote: > On Mon, Feb 28, 2011 at 2:03 AM, Bruce Cran wrote: > > Author: brucec > > Date: Mon Feb 28 10:03:48 2011 > > New Revision: 219096 > > URL: http://svn.freebsd.org/changeset/base/219096 > > > > Log: > > Revert some of r177626. "in in" is valid in certain sentences. > > I disagree. "in in" (or any doubled word) looks awkward in print and > should be avoided. Even if its grammatically correct, its a style > problem because the reader has to do a double take and starts to > wonder about the quality of the writing. With the exception of the > security manpage, where "break in originally" or similar would work, > these are all unnecessary verbosity and should be cut. So you actually agree with me that it's valid grammatically :) I'll commit the changes you suggested. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 11:04:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F22C31065678; Tue, 1 Mar 2011 11:04:30 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E06388FC12; Tue, 1 Mar 2011 11:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21B4Ulu020269; Tue, 1 Mar 2011 11:04:30 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21B4UZB020266; Tue, 1 Mar 2011 11:04:30 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201103011104.p21B4UZB020266@svn.freebsd.org> From: Bruce Cran Date: Tue, 1 Mar 2011 11:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219124 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 11:04:31 -0000 Author: brucec Date: Tue Mar 1 11:04:30 2011 New Revision: 219124 URL: http://svn.freebsd.org/changeset/base/219124 Log: Change the return type of vmspace_swap_count to a long to match the other vmspace_*_count functions. MFC after: 3 days Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_map.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Mar 1 08:52:10 2011 (r219123) +++ head/sys/vm/swap_pager.c Tue Mar 1 11:04:30 2011 (r219124) @@ -2420,13 +2420,13 @@ SYSCTL_NODE(_vm, OID_AUTO, swap_info, CT * if the VM object has any swap use at all the associated map entries * count for at least 1 swap page. */ -vm_offset_t +long vmspace_swap_count(struct vmspace *vmspace) { vm_map_t map; vm_map_entry_t cur; vm_object_t object; - vm_offset_t count, n; + long count, n; map = &vmspace->vm_map; count = 0; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Tue Mar 1 08:52:10 2011 (r219123) +++ head/sys/vm/vm_map.h Tue Mar 1 11:04:30 2011 (r219124) @@ -380,6 +380,6 @@ int vm_map_unwire(vm_map_t map, vm_offse int flags); int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); -vm_offset_t vmspace_swap_count(struct vmspace *vmspace); +long vmspace_swap_count(struct vmspace *vmspace); #endif /* _KERNEL */ #endif /* _VM_MAP_ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 11:47:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D60BD106564A; Tue, 1 Mar 2011 11:47:16 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50E88FC15; Tue, 1 Mar 2011 11:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21BlGBO022692; Tue, 1 Mar 2011 11:47:16 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21BlGMB022690; Tue, 1 Mar 2011 11:47:16 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201103011147.p21BlGMB022690@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 1 Mar 2011 11:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219125 - head/usr.sbin/mountd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 11:47:16 -0000 Author: ru Date: Tue Mar 1 11:47:16 2011 New Revision: 219125 URL: http://svn.freebsd.org/changeset/base/219125 Log: Fixed conversion of prefix length to a netmask. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Mar 1 11:04:30 2011 (r219124) +++ head/usr.sbin/mountd/mountd.c Tue Mar 1 11:47:16 2011 (r219125) @@ -2875,7 +2875,7 @@ makemask(struct sockaddr_storage *ssp, i for (i = 0; i < len; i++) { bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen; - *p++ = (1 << bits) - 1; + *p++ = (u_char)~0 << (CHAR_BIT - bits); bitlen -= bits; } return 0; From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 11:47:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E87EB106564A; Tue, 1 Mar 2011 11:47:51 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5ACF8FC0A; Tue, 1 Mar 2011 11:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21Blp0K022753; Tue, 1 Mar 2011 11:47:51 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21BlpCd022746; Tue, 1 Mar 2011 11:47:51 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201103011147.p21BlpCd022746@svn.freebsd.org> From: Bruce Cran Date: Tue, 1 Mar 2011 11:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219126 - in head: lib/libc/yp lib/libelf share/man/man7 sys/boot/i386/cdboot sys/boot/pc98/cdboot usr.bin/checknr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 11:47:52 -0000 Author: brucec Date: Tue Mar 1 11:47:51 2011 New Revision: 219126 URL: http://svn.freebsd.org/changeset/base/219126 Log: Remove duplicate "in". Suggested by: Rob Farmer MFC after: 3 days Modified: head/lib/libc/yp/xdryp.c head/lib/libelf/libelf_convert.m4 head/share/man/man7/security.7 head/sys/boot/i386/cdboot/cdboot.s head/sys/boot/pc98/cdboot/cdboot.s head/usr.bin/checknr/checknr.c Modified: head/lib/libc/yp/xdryp.c ============================================================================== --- head/lib/libc/yp/xdryp.c Tue Mar 1 11:47:16 2011 (r219125) +++ head/lib/libc/yp/xdryp.c Tue Mar 1 11:47:51 2011 (r219126) @@ -42,7 +42,7 @@ extern void *ypresp_data; * I'm leaving the xdr_datum() function in purely for backwards * compatibility. yplib.c doesn't actually use it, but it's listed * in yp_prot.h as being available, so it's probably a good idea to - * leave it in in case somebody goes looking for it. + * leave it in case somebody goes looking for it. */ typedef struct { char *dptr; Modified: head/lib/libelf/libelf_convert.m4 ============================================================================== --- head/lib/libelf/libelf_convert.m4 Tue Mar 1 11:47:16 2011 (r219125) +++ head/lib/libelf/libelf_convert.m4 Tue Mar 1 11:47:51 2011 (r219126) @@ -136,7 +136,7 @@ __FBSDID("$FreeBSD$"); /* * Read in various integral values. The source pointer could be - * unaligned. Values are read in in native byte order. The source + * unaligned. Values are read in native byte order. The source * pointer is incremented appropriately. */ Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Tue Mar 1 11:47:16 2011 (r219125) +++ head/share/man/man7/security.7 Tue Mar 1 11:47:51 2011 (r219126) @@ -138,7 +138,7 @@ This gives you a convenient way to detec Making it impossible for an attacker to install a backdoor may actually be detrimental to your security because it will not close off the hole the attacker used to -break in in the first place. +break in originally. .Pp Security remedies should always be implemented with a multi-layered .Dq onion peel Modified: head/sys/boot/i386/cdboot/cdboot.s ============================================================================== --- head/sys/boot/i386/cdboot/cdboot.s Tue Mar 1 11:47:16 2011 (r219125) +++ head/sys/boot/i386/cdboot/cdboot.s Tue Mar 1 11:47:51 2011 (r219126) @@ -174,7 +174,7 @@ lookup_path: push %si # Save file name lookup_found: # Found a loader file # # Load the binary into the buffer. Due to real mode addressing limitations -# we have to read it in in 64k chunks. +# we have to read it in 64k chunks. # mov DIR_SIZE(%bx),%eax # Read file length add $SECTOR_SIZE-1,%eax # Convert length to sectors Modified: head/sys/boot/pc98/cdboot/cdboot.s ============================================================================== --- head/sys/boot/pc98/cdboot/cdboot.s Tue Mar 1 11:47:16 2011 (r219125) +++ head/sys/boot/pc98/cdboot/cdboot.s Tue Mar 1 11:47:51 2011 (r219126) @@ -415,7 +415,7 @@ lookup_path: push %si # Save file name lookup_found: # Found a loader file # # Load the binary into the buffer. Due to real mode addressing limitations -# we have to read it in in 64k chunks. +# we have to read it in 64k chunks. # mov %es:DIR_SIZE(%bx),%eax # Read file length add $SECTOR_SIZE-1,%eax # Convert length to sectors Modified: head/usr.bin/checknr/checknr.c ============================================================================== --- head/usr.bin/checknr/checknr.c Tue Mar 1 11:47:16 2011 (r219125) +++ head/usr.bin/checknr/checknr.c Tue Mar 1 11:47:51 2011 (r219126) @@ -79,7 +79,7 @@ struct stkstr { int opno; /* number of opening bracket */ int pl; /* '+', '-', ' ' for \s, 1 for \f, 0 for .ft */ int parm; /* parm to size, font, etc */ - int lno; /* line number the thing came in in */ + int lno; /* line number */ } stk[MAXSTK]; int stktop; From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:10:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE60A106566B; Tue, 1 Mar 2011 13:10:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832ED8FC1C; Tue, 1 Mar 2011 13:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DAuOX027053; Tue, 1 Mar 2011 13:10:56 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DAu39027049; Tue, 1 Mar 2011 13:10:56 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201103011310.p21DAu39027049@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 1 Mar 2011 13:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219127 - in head: share/man/man4 sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:10:56 -0000 Author: ae Date: Tue Mar 1 13:10:56 2011 New Revision: 219127 URL: http://svn.freebsd.org/changeset/base/219127 Log: Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are delivered out the first active "many" hook. PR: kern/137775 Submitted by: Maxim Ignatenko MFC after: 2 weeks Modified: head/share/man/man4/ng_one2many.4 head/sys/netgraph/ng_one2many.c head/sys/netgraph/ng_one2many.h Modified: head/share/man/man4/ng_one2many.4 ============================================================================== --- head/share/man/man4/ng_one2many.4 Tue Mar 1 11:47:51 2011 (r219126) +++ head/share/man/man4/ng_one2many.4 Tue Mar 1 13:10:56 2011 (r219127) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2006 +.Dd March 1, 2011 .Dt NG_ONE2MANY 4 .Os .Sh NAME @@ -96,6 +96,10 @@ hooks. Each packet goes out each .Dv many hook. +.It Dv NG_ONE2MANY_XMIT_FAILOVER +Packets are delivered out the first active +.Dv many +hook. .El .Pp In the future other algorithms may be added as well. Modified: head/sys/netgraph/ng_one2many.c ============================================================================== --- head/sys/netgraph/ng_one2many.c Tue Mar 1 11:47:51 2011 (r219126) +++ head/sys/netgraph/ng_one2many.c Tue Mar 1 13:10:56 2011 (r219127) @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i switch (conf->xmitAlg) { case NG_ONE2MANY_XMIT_ROUNDROBIN: case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; default: error = EINVAL; @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p NG_SEND_DATA_ONLY(error, mdst->hook, m2); } break; + case NG_ONE2MANY_XMIT_FAILOVER: + dst = &priv->many[priv->activeMany[0]]; + break; #ifdef INVARIANTS default: panic("%s: invalid xmitAlg", __func__); @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv) priv->nextMany %= priv->numActiveMany; break; case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; #ifdef INVARIANTS default: Modified: head/sys/netgraph/ng_one2many.h ============================================================================== --- head/sys/netgraph/ng_one2many.h Tue Mar 1 11:47:51 2011 (r219126) +++ head/sys/netgraph/ng_one2many.h Tue Mar 1 13:10:56 2011 (r219127) @@ -61,6 +61,7 @@ /* Algorithms for outgoing packet distribution (XXX only one so far) */ #define NG_ONE2MANY_XMIT_ROUNDROBIN 1 /* round-robin delivery */ #define NG_ONE2MANY_XMIT_ALL 2 /* send packets to all many hooks */ +#define NG_ONE2MANY_XMIT_FAILOVER 3 /* send packets to first active "many" */ /* Algorithms for detecting link failure (XXX only one so far) */ #define NG_ONE2MANY_FAIL_MANUAL 1 /* use enabledLinks[] array */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:14:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9941065674; Tue, 1 Mar 2011 13:14:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4ACE8FC16; Tue, 1 Mar 2011 13:14:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DESQZ027265; Tue, 1 Mar 2011 13:14:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DESH9027261; Tue, 1 Mar 2011 13:14:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011314.p21DESH9027261@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219128 - in head/sys: bsm security/audit sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:14:29 -0000 Author: rwatson Date: Tue Mar 1 13:14:28 2011 New Revision: 219128 URL: http://svn.freebsd.org/changeset/base/219128 Log: Add ECAPMODE, "Not permitted in capability mode", a new kernel errno constant to indicate that a system call (or perhaps an operation requested via a system call) is not permitted for a capability mode process. Submitted by: anderson Sponsored by: Google, Inc. Obtained from: Capsicum Project MFC after: 1 week Modified: head/sys/bsm/audit_errno.h head/sys/security/audit/audit_bsm_errno.c head/sys/sys/errno.h Modified: head/sys/bsm/audit_errno.h ============================================================================== --- head/sys/bsm/audit_errno.h Tue Mar 1 13:10:56 2011 (r219127) +++ head/sys/bsm/audit_errno.h Tue Mar 1 13:14:28 2011 (r219128) @@ -205,6 +205,8 @@ #define BSM_ERRNO_EKEYEXPIRED 220 /* Linux-specific. */ #define BSM_ERRNO_EKEYREVOKED 221 /* Linux-specific. */ #define BSM_ERRNO_EKEYREJECTED 222 /* Linux-specific. */ +#define BSM_ERRNO_ENOTCAPABLE 223 /* FreeBSD-specific. */ +#define BSM_ERRNO_ECAPMODE 224 /* FreeBSD-specific. */ /* * In the event that OpenBSM doesn't have a file representation of a local Modified: head/sys/security/audit/audit_bsm_errno.c ============================================================================== --- head/sys/security/audit/audit_bsm_errno.c Tue Mar 1 13:10:56 2011 (r219127) +++ head/sys/security/audit/audit_bsm_errno.c Tue Mar 1 13:14:28 2011 (r219128) @@ -686,6 +686,20 @@ static const struct bsm_errno bsm_errnos ERRNO_NO_LOCAL_MAPPING, #endif ES("Key was rejected by service") }, + { BSM_ERRNO_ENOTCAPABLE, +#ifdef ENOTCAPABLE + ENOTCAPABLE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Capabilities insufficient") }, + { BSM_ERRNO_ECAPMODE, +#ifdef ECAPMODE + ECAPMODE, +#else + ERRNO_NO_LOCAL_MAPPING, +#endif + ES("Not permitted in capability mode") }, }; static const int bsm_errnos_count = sizeof(bsm_errnos) / sizeof(bsm_errnos[0]); Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Tue Mar 1 13:10:56 2011 (r219127) +++ head/sys/sys/errno.h Tue Mar 1 13:14:28 2011 (r219128) @@ -175,10 +175,11 @@ __END_DECLS #ifndef _POSIX_SOURCE #define ENOTCAPABLE 93 /* Capabilities insufficient */ +#define ECAPMODE 94 /* Not permitted in capability mode */ #endif /* _POSIX_SOURCE */ #ifndef _POSIX_SOURCE -#define ELAST 93 /* Must be equal largest errno */ +#define ELAST 94 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:23:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3EC1106566B; Tue, 1 Mar 2011 13:23:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B12C78FC0C; Tue, 1 Mar 2011 13:23:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DNbo6027752; Tue, 1 Mar 2011 13:23:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DNbau027743; Tue, 1 Mar 2011 13:23:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011323.p21DNbau027743@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219129 - in head/sys: compat/freebsd32 conf kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:23:37 -0000 Author: rwatson Date: Tue Mar 1 13:23:37 2011 New Revision: 219129 URL: http://svn.freebsd.org/changeset/base/219129 Log: Add initial support for Capsicum's Capability Mode to the FreeBSD kernel, compiled conditionally on options CAPABILITIES: Add a new credential flag, CRED_FLAG_CAPMODE, which indicates that a subject (typically a process) is in capability mode. Add two new system calls, cap_enter(2) and cap_getmode(2), which allow setting and querying (but never clearing) the flag. Export the capability mode flag via process information sysctls. Sponsored by: Google, Inc. Reviewed by: anderson Discussed with: benl, kris, pjd Obtained from: Capsicum Project MFC after: 3 months Added: head/sys/kern/sys_capability.c (contents, props changed) Modified: head/sys/compat/freebsd32/syscalls.master head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_proc.c head/sys/kern/syscalls.master head/sys/sys/ucred.h head/sys/sys/user.h Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/compat/freebsd32/syscalls.master Tue Mar 1 13:23:37 2011 (r219129) @@ -952,8 +952,8 @@ 513 AUE_LPATHCONF NOPROTO { int lpathconf(char *path, int name); } 514 AUE_CAP_NEW UNIMPL cap_new 515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights -516 AUE_CAP_ENTER UNIMPL cap_enter -517 AUE_CAP_GETMODE UNIMPL cap_getmode +516 AUE_CAP_ENTER NOPROTO { int cap_enter(void); } +517 AUE_CAP_GETMODE NOPROTO { int cap_getmode(u_int *modep); } 518 AUE_PDFORK UNIMPL pdfork 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/conf/NOTES Tue Mar 1 13:23:37 2011 (r219129) @@ -1157,6 +1157,9 @@ options MAC_SEEOTHERUIDS options MAC_STUB options MAC_TEST +# Support for Capsicum +options CAPABILIITES + ##################################################################### # CLOCK OPTIONS Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/conf/options Tue Mar 1 13:23:37 2011 (r219129) @@ -63,6 +63,7 @@ SYSCTL_DEBUG opt_sysctl.h ADAPTIVE_LOCKMGRS ALQ AUDIT opt_global.h +CAPABILITIES opt_capabilities.h CODA_COMPAT_5 opt_coda.h COMPAT_43 opt_compat.h COMPAT_43TTY opt_compat.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/kern/kern_proc.c Tue Mar 1 13:23:37 2011 (r219129) @@ -725,7 +725,9 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_uid = cred->cr_uid; kp->ki_ruid = cred->cr_ruid; kp->ki_svuid = cred->cr_svuid; - kp->ki_cr_flags = cred->cr_flags; + kp->ki_cr_flags = 0; + if (cred->cr_flags & CRED_FLAG_CAPMODE) + kp->ki_cr_flags |= KI_CRF_CAPABILITY_MODE; /* XXX bde doesn't like KI_NGROUPS */ if (cred->cr_ngroups > KI_NGROUPS) { kp->ki_ngroups = KI_NGROUPS; Added: head/sys/kern/sys_capability.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/sys_capability.c Tue Mar 1 13:23:37 2011 (r219129) @@ -0,0 +1,123 @@ +/*- + * Copyright (c) 2008-2011 Robert N. M. Watson + * Copyright (c) 2010-2011 Jonathan Anderson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, 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. + */ + +/* + * FreeBSD kernel capability facility. + * + * Currently, this file implements only capability mode; capabilities + * (rights-refined file descriptors) will follow. + * + */ + +#include "opt_capabilities.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#ifdef CAPABILITIES + +/* + * We don't currently have any MIB entries for sysctls, but we do expose + * security.capabilities so that it's easy to tell if options CAPABILITIES is + * compiled into the kernel. + */ +SYSCTL_NODE(_security, OID_AUTO, capabilities, CTLFLAG_RW, 0, "Capsicum"); + +/* + * System call to enter capability mode for the process. + */ +int +cap_enter(struct thread *td, struct cap_enter_args *uap) +{ + struct ucred *newcred, *oldcred; + struct proc *p; + + if (IN_CAPABILITY_MODE(td)) + return (0); + + newcred = crget(); + p = td->td_proc; + PROC_LOCK(p); + oldcred = p->p_ucred; + crcopy(newcred, oldcred); + newcred->cr_flags |= CRED_FLAG_CAPMODE; + p->p_ucred = newcred; + PROC_UNLOCK(p); + crfree(oldcred); + return (0); +} + +/* + * System call to query whether the process is in capability mode. + */ +int +cap_getmode(struct thread *td, struct cap_getmode_args *uap) +{ + u_int i; + + i = (IN_CAPABILITY_MODE(td)) ? 1 : 0; + return (copyout(&i, uap->modep, sizeof(i))); +} + +#else /* !CAPABILITIES */ + +int +cap_enter(struct thread *td, struct cap_enter_args *uap) +{ + + return (ENOSYS); +} + +int +cap_getmode(struct thread *td, struct cap_getmode_args *uap) +{ + + return (ENOSYS); +} + +#endif /* CAPABILITIES */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/kern/syscalls.master Tue Mar 1 13:23:37 2011 (r219129) @@ -916,8 +916,8 @@ 513 AUE_LPATHCONF STD { int lpathconf(char *path, int name); } 514 AUE_CAP_NEW UNIMPL cap_new 515 AUE_CAP_GETRIGHTS UNIMPL cap_getrights -516 AUE_CAP_ENTER UNIMPL cap_enter -517 AUE_CAP_GETMODE UNIMPL cap_getmode +516 AUE_CAP_ENTER STD { int cap_enter(void); } +517 AUE_CAP_GETMODE STD { int cap_getmode(u_int *modep); } 518 AUE_PDFORK UNIMPL pdfork 519 AUE_PDKILL UNIMPL pdkill 520 AUE_PDGETPID UNIMPL pdgetpid Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/sys/ucred.h Tue Mar 1 13:23:37 2011 (r219129) @@ -70,6 +70,11 @@ struct ucred { #define XU_NGROUPS 16 /* + * Flags for cr_flags. + */ +#define CRED_FLAG_CAPMODE 0x00000001 /* In capability mode. */ + +/* * This is the external representation of struct ucred. */ struct xucred { Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Tue Mar 1 13:14:28 2011 (r219128) +++ head/sys/sys/user.h Tue Mar 1 13:23:37 2011 (r219129) @@ -101,9 +101,11 @@ #define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ +/* Flags for the process credential. */ +#define KI_CRF_CAPABILITY_MODE 0x00000001 /* - * Steal a bit from ki_cr_flags (cr_flags is never used) to indicate - * that the cred had more than KI_NGROUPS groups. + * Steal a bit from ki_cr_flags to indicate that the cred had more than + * KI_NGROUPS groups. */ #define KI_CRF_GRP_OVERFLOW 0x80000000 From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:24:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AC5106564A; Tue, 1 Mar 2011 13:24:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08E98FC13; Tue, 1 Mar 2011 13:24:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DOnZM027853; Tue, 1 Mar 2011 13:24:49 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DOn3L027851; Tue, 1 Mar 2011 13:24:49 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011324.p21DOn3L027851@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219130 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:24:49 -0000 Author: rwatson Date: Tue Mar 1 13:24:49 2011 New Revision: 219130 URL: http://svn.freebsd.org/changeset/base/219130 Log: Hook up sys_capability.c to the build. Sponsored by: Google, Inc. Reviewed by: anderson Discussed with: benl, kris, pjd Obtained from: Capsicum Project MFC after: 3 months Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 1 13:23:37 2011 (r219129) +++ head/sys/conf/files Tue Mar 1 13:24:49 2011 (r219130) @@ -2272,6 +2272,7 @@ kern/subr_turnstile.c standard kern/subr_uio.c standard kern/subr_unit.c standard kern/subr_witness.c optional witness +kern/sys_capability.c standard kern/sys_generic.c standard kern/sys_pipe.c standard kern/sys_process.c standard From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:28:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78745106564A; Tue, 1 Mar 2011 13:28:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 655238FC12; Tue, 1 Mar 2011 13:28:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DSRNn028083; Tue, 1 Mar 2011 13:28:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DSRNj028078; Tue, 1 Mar 2011 13:28:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011328.p21DSRNj028078@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219131 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:28:27 -0000 Author: rwatson Date: Tue Mar 1 13:28:27 2011 New Revision: 219131 URL: http://svn.freebsd.org/changeset/base/219131 Log: Continue to introduce Capsicum Capability Mode support: Add a new system call flag, SYF_CAPENABLED, which indicates that a particular system call is available in capability mode. Add a new configuration file, kern/capabilities.conf (similar files may be introduced for other ABIs in the future), which enumerates system calls that are available in capability mode. When a new system call is added to syscalls.master, it will also need to be added here (if needed). Teach sysent parts to use this file to set values for SYF_CAPENABLED for the native ABI. Reviewed by: anderson Discussed with: benl, kris, pjd Obtained from: Capsicum Project MFC after: 3 months Added: head/sys/kern/capabilities.conf (contents, props changed) Modified: head/sys/kern/Makefile head/sys/kern/makesyscalls.sh head/sys/sys/sysent.h Modified: head/sys/kern/Makefile ============================================================================== --- head/sys/kern/Makefile Tue Mar 1 13:24:49 2011 (r219130) +++ head/sys/kern/Makefile Tue Mar 1 13:28:27 2011 (r219131) @@ -10,7 +10,8 @@ sysent: init_sysent.c syscalls.c ../sys/ ../sys/sysproto.h init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \ -../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master +../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master \ +capabilities.conf -mv -f init_sysent.c init_sysent.c.bak -mv -f syscalls.c syscalls.c.bak -mv -f systrace_args.c systrace_args.c.bak Added: head/sys/kern/capabilities.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/capabilities.conf Tue Mar 1 13:28:27 2011 (r219131) @@ -0,0 +1,756 @@ +## +## Copyright (c) 2008-2010 Robert N. M. Watson +## All rights reserved. +## +## This software was developed at the University of Cambridge Computer +## Laboratory with support from a grant from Google, 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. +## +## List of system calls enabled in capability mode, one name per line. +## +## Notes: +## - sys_exit(2), abort2(2) and close(2) are very important. +## - Sorted alphabetically, please keep it that way. +## +## $FreeBSD$ +## + +## +## Allow ACL and MAC label operations by file descriptor, subject to +## capability rights. Allow MAC label operations on the current process but +## we will need to scope __mac_get_pid(2). +## +__acl_aclcheck_fd +__acl_delete_fd +__acl_get_fd +__acl_set_fd +__mac_get_fd +#__mac_get_pid +__mac_get_proc +__mac_set_fd +__mac_set_proc + +## +## Allow sysctl(2) as we scope internal to the call; this is a global +## namespace, but there are several critical sysctls required for almost +## anything to run, such as hw.pagesize. For now that policy lives in the +## kernel for performance and simplicity, but perhaps it could move to a +## proxying daemon in userspace. +## +__sysctl + +## +## Allow umtx operations as these are scoped by address space. +## +## XXRW: Need to check this very carefully. +## +_umtx_lock +_umtx_op +_umtx_unlock + +## +## Allow process termination using abort2(2). +## +abort2 + +## +## Allow accept(2) since it doesn't manipulate namespaces directly, rather +## relies on existing bindings on a socket, subject to capability rights. +## +accept + +## +## Allow AIO operations by file descriptor, subject to capability rights. +## +aio_cancel +aio_error +aio_fsync +aio_read +aio_return +aio_suspend +aio_waitcomplete +aio_write + +## +## audit(2) is a global operation, submitting to the global trail, but it is +## controlled by privilege, and it might be useful to be able to submit +## records from sandboxes. For now, disallow, but we may want to think about +## providing some sort of proxy service for this. +## +#audit + +## +## Disllow bind(2) for now, even though we support CAP_BIND. +## +## XXXRW: Revisit this. +## +#bind + +## +## Allow capability mode and capability system calls. +## +cap_enter +cap_getmode +cap_getrights +cap_new + +## +## Allow read-only clock operations. +## +clock_gettime +clock_getres + +## +## Always allow file descriptor close(2). +## +close +closefrom + +## +## Disallow connect(2) for now, despite CAP_CONNECT. +## +## XXXRW: Revisit this. +## +#connect + +## +## cpuset(2) and related calls require scoping by process, but should +## eventually be allowed, at least in the current process case. +## +#cpuset +#cpuset_getaffinity +#cpuset_getid +#cpuset_setaffinity +#cpuset_setid + +## +## Always allow dup(2) and dup2(2) manipulation of the file descriptor table. +## +dup +dup2 + +## +## Allow extended attribute operations by file descriptor, subject to +## capability rights. +## +extattr_delete_fd +extattr_get_fd +extattr_list_fd +extattr_set_fd + +## +## Allow changing file flags, mode, and owner by file descriptor, subject to +## capability rights. +## +fchflags +fchmod +fchown + +## +## For now, allow fcntl(2), subject to capability rights, but this probably +## needs additional scoping. +## +fcntl + +## +## Allow fexecve(2), subject to capability rights. We perform some scoping, +## such as disallowing privilege escalation. +## +fexecve + +## +## Allow flock(2), subject to capability rights. +## +flock + +## +## Allow fork(2), even though it returns pids -- some applications seem to +## prefer this interface. +## +fork + +## +## Allow fpathconf(2), subject to capability rights. +## +fpathconf + +## +## Allow various file descriptor-based I/O operations, subject to capability +## rights. mmap(2) requires further attention. +## +freebsd6_ftruncate +freebsd6_lseek +freebsd6_mmap +freebsd6_pread +freebsd6_pwrite + +## +## Allow querying file and file system state with fstat(2) and fstatfs(2), +## subject to capability rights. +## +fstat +fstatfs + +## +## Allow further file descriptor-based I/O operations, subject to capability +## rights. +## +fsync +ftruncate + +## +## Allow futimes(2), subject to capability rights. +## +futimes + +## +## Allow querying process audit state, subject to normal access control. +## +getaudit +getaudit_addr +getauid + +## +## Allow thread context management with getcontext(2). +## +getcontext + +## +## Allow directory I/O on a file descriptor, subject to capability rights. +## Originally we had separate capabilities for directory-specific read +## operations, but on BSD we allow reading the raw directory data, so we just +## rely on CAP_READ (etc) now. +## +## XXXRW: Possibly these should also use CAP_SEEK. +## +getdents +getdirentries + +## +## Allow querying certain trivial global state. +## +getdomainname + +## +## Allow querying current process credential state. +## +getegid +geteuid + +## +## Allow querying certain trivial global state. +## +gethostid +gethostname + +## +## Allow querying per-process timer. +## +getitimer + +## +## Allow querying current process credential state. +## +getgid +getgroups +getlogin + +## +## Allow querying certain trivial global state. +## +getpagesize +getpeername + +## +## Allow querying certain per-process scheduling, resource limit, and +## credential state. +## +## XXXRW: getpgid(2) needs scoping. It's not clear if it's worth scoping +## getppid(2). getpriority(2) needs scoping. getrusage(2) needs scoping. +## getsid(2) needs scoping. +## +getpgid +getpgrp +getpid +getppid +getpriority +getresgid +getresuid +getrlimit +getrusage +getsid + +## +## Allow querying socket state, subject to capability rights. +## +## XXXRW: getsockopt(2) may need more attention. +## +getsockname +getsockopt + +## +## Allow querying the global clock. +## +gettimeofday + +## +## Allow querying current process credential state. +## +getuid + +## +## Disallow ioctl(2) for now, as frequently ioctl(2) operations have global +## scope, but this is a tricky one as it is also required for tty control. +## We do have a capability right for this operation. +## +## XXXRW: This needs to be revisited. +## +#ioctl + +## +## Allow querying current process credential state. +## +issetugid + +## +## Allow kevent(2), as we will authorize based on capability rights on the +## target descriptor. +## +## XXXRW: Do we do this? +## +kevent + +## +## Allow message queue operations on file descriptors, subject to capability +## rights. +## +kmq_notify +kmq_setattr +kmq_timedreceive +kmq_timedsend + +## +## Allow kqueue(2), we will control use. +## +kqueue + +## +## Allow managing per-process timers. +## +ktimer_create +ktimer_delete +ktimer_getoverrun +ktimer_gettime +ktimer_settime + +## +## We can't allow ktrace(2) because it relies on a global namespace, but we +## might want to introduce an fktrace(2) of some sort. +## +#ktrace + +## +## Allow AIO operations by file descriptor, subject to capability rights. +## +lio_listio + +## +## Allow listen(2), subject to capability rights. +## +## XXXRW: One might argue this manipulates a global namespace. +## +listen + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +lseek + +## +## Allow MAC label operations by file descriptor, subject to capability +## rights. +## +mac_get_fd +mac_set_fd + +## +## Allow simple VM operations on the current process. +## +madvise +mincore +minherit +mlock +mlockall + +## +## Allow memory mapping a file descriptor, and updating protections, subject +## to capability rights. +## +## XXXRW: We currently don't properly mask VM protections using capability +## rights. +## +mmap +mprotect + +## +## Allow simple VM operations on the current process. +## +msync +munlock +munlockall +munmap + +## +## Allow the current process to sleep. +## +nanosleep + +## +## Allow querying the global clock. +## +ntp_gettime + +## +## Allow AIO operations by file descriptor, subject to capability rights. +## +oaio_read +oaio_write + +## +## Allow simple VM operations on the current process. +## +obreak + +## +## Allow AIO operations by file descriptor, subject to capability rights. +## +olio_listio + +## +## Once Capsicum is fully merged, some of the *at(2) calls which can be +## semantically constrained will be permitted in capability mode. For now, +## we will simply not allow them to be called. +## +#faccessat +#fstatat +#fchmodat +#futimesat +#mkdirat +#rmdirat +#mkfifoat +#mknodat +#openat +#renameat + +## +## ONCE CAPSICUM IS FULLY MERGED: +## Allow entry into open(2). This system call will fail, since access to the global +## file namespace has been disallowed, but allowing entry into the syscall means +## that an audit trail will be generated (which is also very useful for debugging), +## +#open + +## +## Allow poll(2), which will be scoped by capability rights. +## +## XXXRW: Perhaps we don't need the OpenBSD version? +## XXXRW: We don't yet do that scoping. +## +openbsd_poll + +## +## Process descriptor-related system calls are allowed. +## +pdfork +pdgetpid +pdkill +pdwait4 + +## +## Allow pipe(2). +## +pipe + +## +## Allow poll(2), which will be scoped by capability rights. +## XXXRW: We don't yet do that scoping. +## +poll + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +pread +preadv + +## +## Allow access to profiling state on the current process. +## +profil + +## +## Disallow ptrace(2) for now, but we do need debugging facilities in +## capability mode, so we will want to revisit this, possibly by scoping its +## operation. +## +#ptrace + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +pwrite +pwritev +read +readv +recv +recvfrom +recvmsg + +## +## Allow real-time scheduling primitives to be used. +## +## XXXRW: These require scoping. +## +rtprio +rtprio_thread + +## +## Allow simple VM operations on the current process. +## +sbrk + +## +## Allow querying trivial global scheduler state. +## +sched_get_priority_max +sched_get_priority_min + +## +## Allow various thread/process scheduler operations. +## +## XXXRW: Some of these require further scoping. +## +sched_getparam +sched_getscheduler +sched_rr_getinterval +sched_setparam +sched_setscheduler +sched_yield + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +sctp_generic_recvmsg +sctp_generic_sendmsg +sctp_generic_sendmsg_iov +sctp_peeloff + +## +## Allow select(2), which will be scoped by capability rights. +## +## XXXRW: But is it? +## +select + +## +## Allow I/O-related file descriptors, subject to capability rights. Use of +## explicit addresses here is restricted by the system calls themselves. +## +send +sendfile +sendmsg +sendto + +## +## Allow setting per-process audit state, which is controlled separately by +## privileges. +## +setaudit +setaudit_addr +setauid + +## +## Allow setting thread context. +## +setcontext + +## +## Allow setting current process credential state, which is controlled +## separately by privilege. +## +setegid +seteuid +setgid + +## +## Allow use of the process interval timer. +## +setitimer + +## +## Allow setpriority(2). +## +## XXXRW: Requires scoping. +## +setpriority + +## +## Allow setting current process credential state, which is controlled +## separately by privilege. +## +setregid +setresgid +setresuid +setreuid + +## +## Allow setting process resource limits with setrlimit(2). +## +setrlimit + +## +## Allow creating a new session with setsid(2). +## +setsid + +## +## Allow setting socket options with setsockopt(2), subject to capability +## rights. +## +## XXXRW: Might require scoping. +## +setsockopt + +## +## Allow setting current process credential state, which is controlled +## separately by privilege. +## +setuid + +## +## ONCE CAPSICUM IS FULLY MERGED: +## Allow shm_open(2), which is scoped so as to allow only access to new +## anonymous objects. +## +#shm_open + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +shutdown + +## +## Allow signal control on current process. +## +sigaction +sigaltstack +sigblock +sigpending +sigprocmask +sigqueue +sigreturn +sigsetmask +sigstack +sigsuspend +sigtimedwait +sigvec +sigwaitinfo + +## +## Allow creating new socket pairs with socket(2) and socketpair(2). +## +socket +socketpair + +## +## Allow simple VM operations on the current process. +## +## XXXRW: Kernel doesn't implement this, so drop? +## +sstk + +## +## Do allow sync(2) for now, but possibly shouldn't. +## +sync + +## +## Always allow process termination with sys_exit(2). +## +sys_exit + +## +## sysarch(2) does rather diverse things, but is required on at least i386 +## in order to configure per-thread data. As such, it's scoped on each +## architecture. +## +sysarch + +## +## Allow thread operations operating only on current process. +## +thr_create +thr_exit +thr_kill + +## +## Disallow thr_kill2(2), as it may operate beyond the current process. +## +## XXXRW: Requires scoping. +## +#thr_kill2 + +## +## Allow thread operations operating only on current process. +## +thr_new +thr_self +thr_set_name +thr_suspend +thr_wake + +## +## Allow manipulation of the current process umask with umask(2). +## +umask + +## +## Allow submitting of process trace entries with utrace(2). +## +utrace + +## +## Allow generating UUIDs with uuidgen(2). +## +uuidgen + +## +## Allow I/O-related file descriptors, subject to capability rights. +## +write +writev + +## +## Allow processes to yield(2). +## +yield Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Tue Mar 1 13:24:49 2011 (r219130) +++ head/sys/kern/makesyscalls.sh Tue Mar 1 13:28:27 2011 (r219131) @@ -39,6 +39,13 @@ sysarg="sysarg.switch.$$" sysprotoend="sysprotoend.$$" systracetmp="systrace.$$" +if [ -r capabilities.conf ]; then + capenabled=`cat capabilities.conf | grep -v "^#" | grep -v "^$"` + capenabled=`echo $capenabled | sed 's/ /,/g'` +else + capenabled="" +fi + trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp" 0 touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp @@ -97,8 +104,11 @@ s/\$//g switchname = \"$switchname\" namesname = \"$namesname\" infile = \"$1\" + capenabled_string = \"$capenabled\" "' + split(capenabled_string, capenabled, ","); + printf "/*\n * System call switch table.\n *\n" > syssw printf " * DO NOT EDIT-- this file is automatically generated.\n" > syssw printf " * $%s$\n", "FreeBSD" > syssw @@ -290,6 +300,18 @@ s/\$//g f++ #function return type funcname=$f + + # + # We now know the func name, so define a flags field for it. + # Do this before any other processing as we may return early + # from it. + # + for (cap in capenabled) { + if (funcname == capenabled[cap]) { + flags = "SYF_CAPENABLED"; + } + } + if (funcalias == "") funcalias = funcname if (argalias == "") { @@ -348,7 +370,7 @@ s/\$//g } # - # The currently-empty flags field. + # The flags, if any. # { flags = "0"; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Tue Mar 1 13:24:49 2011 (r219130) +++ head/sys/sys/sysent.h Tue Mar 1 13:28:27 2011 (r219131) @@ -65,6 +65,11 @@ struct sysent { /* system call table * u_int32_t sy_thrcnt; }; +/* + * A system call is permitted in capability mode. + */ +#define SYF_CAPENABLED 0x00000001 + #define SY_THR_FLAGMASK 0x7 #define SY_THR_STATIC 0x1 #define SY_THR_DRAINING 0x2 From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:30:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2095106564A; Tue, 1 Mar 2011 13:30:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE5158FC14; Tue, 1 Mar 2011 13:30:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DUNSM028219; Tue, 1 Mar 2011 13:30:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DUNJH028208; Tue, 1 Mar 2011 13:30:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011330.p21DUNJH028208@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219132 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:30:24 -0000 Author: rwatson Date: Tue Mar 1 13:30:23 2011 New Revision: 219132 URL: http://svn.freebsd.org/changeset/base/219132 Log: Regenerate system call files following addition of cap_enter(2), cap_getmode(2), and capabilities.conf. Reviewed by: anderson Discussed with: benl, kris, pjd Obtained from: Capsicum Project Sponsored by: Google, Inc. MFC after: 3 months Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/compat/freebsd32/freebsd32_proto.h Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #define FREEBSD32_SYS_syscall 0 @@ -409,5 +409,7 @@ #define FREEBSD32_SYS_freebsd32_msgctl 511 #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 +#define FREEBSD32_SYS_cap_enter 516 +#define FREEBSD32_SYS_cap_getmode 517 #define FREEBSD32_SYS_freebsd32_pselect 522 #define FREEBSD32_SYS_MAXSYSCALL 523 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ const char *freebsd32_syscallnames[] = { @@ -539,8 +539,8 @@ const char *freebsd32_syscallnames[] = { "lpathconf", /* 513 = lpathconf */ "#514", /* 514 = cap_new */ "#515", /* 515 = cap_getrights */ - "#516", /* 516 = cap_enter */ - "#517", /* 517 = cap_getmode */ + "cap_enter", /* 516 = cap_enter */ + "cap_getmode", /* 517 = cap_getmode */ "#518", /* 518 = pdfork */ "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 209579 2010-06-28 18:06:46Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #include "opt_compat.h" @@ -576,8 +576,8 @@ struct sysent freebsd32_sysent[] = { { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 513 = lpathconf */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 514 = cap_new */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 515 = cap_getrights */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 516 = cap_enter */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)cap_enter, AUE_CAP_ENTER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 516 = cap_enter */ + { AS(cap_getmode_args), (sy_call_t *)cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 517 = cap_getmode */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 518 = pdfork */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 520 = pdgetpid */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/kern/init_sysent.c Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #include "opt_compat.h" @@ -35,12 +35,12 @@ /* The casts are bogus but will do for now. */ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */ - { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 1 = exit */ - { 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 2 = fork */ - { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 3 = read */ - { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 4 = write */ + { AS(sys_exit_args), (sy_call_t *)sys_exit, AUE_EXIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 1 = exit */ + { 0, (sy_call_t *)fork, AUE_FORK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 2 = fork */ + { AS(read_args), (sy_call_t *)read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 3 = read */ + { AS(write_args), (sy_call_t *)write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 4 = write */ { AS(open_args), (sy_call_t *)open, AUE_OPEN_RWTC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 5 = open */ - { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 6 = close */ + { AS(close_args), (sy_call_t *)close, AUE_CLOSE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 6 = close */ { AS(wait_args), (sy_call_t *)wait4, AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 7 = wait4 */ { compat(AS(ocreat_args),creat), AUE_CREAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 8 = old creat */ { AS(link_args), (sy_call_t *)link, AUE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 9 = link */ @@ -51,199 +51,199 @@ struct sysent sysent[] = { { AS(mknod_args), (sy_call_t *)mknod, AUE_MKNOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 14 = mknod */ { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ - { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ + { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 getfsstat */ - { compat(AS(olseek_args),lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old lseek */ - { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */ + { compat(AS(olseek_args),lseek), AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 19 = old lseek */ + { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */ { AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */ - { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = setuid */ - { 0, (sy_call_t *)getuid, AUE_GETUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = getuid */ - { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = geteuid */ + { AS(setuid_args), (sy_call_t *)setuid, AUE_SETUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 23 = setuid */ + { 0, (sy_call_t *)getuid, AUE_GETUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 24 = getuid */ + { 0, (sy_call_t *)geteuid, AUE_GETEUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 25 = geteuid */ { AS(ptrace_args), (sy_call_t *)ptrace, AUE_PTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = ptrace */ - { AS(recvmsg_args), (sy_call_t *)recvmsg, AUE_RECVMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 27 = recvmsg */ - { AS(sendmsg_args), (sy_call_t *)sendmsg, AUE_SENDMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 28 = sendmsg */ - { AS(recvfrom_args), (sy_call_t *)recvfrom, AUE_RECVFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 29 = recvfrom */ - { AS(accept_args), (sy_call_t *)accept, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 30 = accept */ - { AS(getpeername_args), (sy_call_t *)getpeername, AUE_GETPEERNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 31 = getpeername */ - { AS(getsockname_args), (sy_call_t *)getsockname, AUE_GETSOCKNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 32 = getsockname */ + { AS(recvmsg_args), (sy_call_t *)recvmsg, AUE_RECVMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 27 = recvmsg */ + { AS(sendmsg_args), (sy_call_t *)sendmsg, AUE_SENDMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 28 = sendmsg */ + { AS(recvfrom_args), (sy_call_t *)recvfrom, AUE_RECVFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 29 = recvfrom */ + { AS(accept_args), (sy_call_t *)accept, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = accept */ + { AS(getpeername_args), (sy_call_t *)getpeername, AUE_GETPEERNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = getpeername */ + { AS(getsockname_args), (sy_call_t *)getsockname, AUE_GETSOCKNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = getsockname */ { AS(access_args), (sy_call_t *)access, AUE_ACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 33 = access */ { AS(chflags_args), (sy_call_t *)chflags, AUE_CHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 34 = chflags */ - { AS(fchflags_args), (sy_call_t *)fchflags, AUE_FCHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 35 = fchflags */ - { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 36 = sync */ + { AS(fchflags_args), (sy_call_t *)fchflags, AUE_FCHFLAGS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = fchflags */ + { 0, (sy_call_t *)sync, AUE_SYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = sync */ { AS(kill_args), (sy_call_t *)kill, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 37 = kill */ { compat(AS(ostat_args),stat), AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 38 = old stat */ - { 0, (sy_call_t *)getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = getppid */ + { 0, (sy_call_t *)getppid, AUE_GETPPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = getppid */ { compat(AS(olstat_args),lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old lstat */ - { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ - { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = getegid */ - { AS(profil_args), (sy_call_t *)profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */ + { AS(dup_args), (sy_call_t *)dup, AUE_DUP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = dup */ + { 0, (sy_call_t *)pipe, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = pipe */ + { 0, (sy_call_t *)getegid, AUE_GETEGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = getegid */ + { AS(profil_args), (sy_call_t *)profil, AUE_PROFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = profil */ { AS(ktrace_args), (sy_call_t *)ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */ - { compat(AS(osigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 46 = old sigaction */ - { 0, (sy_call_t *)getgid, AUE_GETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 47 = getgid */ - { compat(AS(osigprocmask_args),sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 48 = old sigprocmask */ - { AS(getlogin_args), (sy_call_t *)getlogin, AUE_GETLOGIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 49 = getlogin */ + { compat(AS(osigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = old sigaction */ + { 0, (sy_call_t *)getgid, AUE_GETGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = getgid */ + { compat(AS(osigprocmask_args),sigprocmask), AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = old sigprocmask */ + { AS(getlogin_args), (sy_call_t *)getlogin, AUE_GETLOGIN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = getlogin */ { AS(setlogin_args), (sy_call_t *)setlogin, AUE_SETLOGIN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 50 = setlogin */ { AS(acct_args), (sy_call_t *)acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 51 = acct */ - { compat(0,sigpending), AUE_SIGPENDING, NULL, 0, 0, 0, SY_THR_STATIC }, /* 52 = old sigpending */ - { AS(sigaltstack_args), (sy_call_t *)sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 53 = sigaltstack */ + { compat(0,sigpending), AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = old sigpending */ + { AS(sigaltstack_args), (sy_call_t *)sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = sigaltstack */ { AS(ioctl_args), (sy_call_t *)ioctl, AUE_IOCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 54 = ioctl */ { AS(reboot_args), (sy_call_t *)reboot, AUE_REBOOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = reboot */ { AS(revoke_args), (sy_call_t *)revoke, AUE_REVOKE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = revoke */ { AS(symlink_args), (sy_call_t *)symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = symlink */ { AS(readlink_args), (sy_call_t *)readlink, AUE_READLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 58 = readlink */ { AS(execve_args), (sy_call_t *)execve, AUE_EXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 59 = execve */ - { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 60 = umask */ + { AS(umask_args), (sy_call_t *)umask, AUE_UMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 60 = umask */ { AS(chroot_args), (sy_call_t *)chroot, AUE_CHROOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 61 = chroot */ - { compat(AS(ofstat_args),fstat), AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 62 = old fstat */ + { compat(AS(ofstat_args),fstat), AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 62 = old fstat */ { compat(AS(getkerninfo_args),getkerninfo), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 63 = old getkerninfo */ - { compat(0,getpagesize), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 64 = old getpagesize */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 65 = msync */ + { compat(0,getpagesize), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 64 = old getpagesize */ + { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 65 = msync */ { 0, (sy_call_t *)vfork, AUE_VFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 66 = vfork */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 67 = obsolete vread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 68 = obsolete vwrite */ - { AS(sbrk_args), (sy_call_t *)sbrk, AUE_SBRK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 69 = sbrk */ - { AS(sstk_args), (sy_call_t *)sstk, AUE_SSTK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 70 = sstk */ - { compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 71 = old mmap */ + { AS(sbrk_args), (sy_call_t *)sbrk, AUE_SBRK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 69 = sbrk */ + { AS(sstk_args), (sy_call_t *)sstk, AUE_SSTK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 70 = sstk */ + { compat(AS(ommap_args),mmap), AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 71 = old mmap */ { AS(ovadvise_args), (sy_call_t *)ovadvise, AUE_O_VADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 72 = vadvise */ - { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 73 = munmap */ - { AS(mprotect_args), (sy_call_t *)mprotect, AUE_MPROTECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 74 = mprotect */ - { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 75 = madvise */ + { AS(munmap_args), (sy_call_t *)munmap, AUE_MUNMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 73 = munmap */ + { AS(mprotect_args), (sy_call_t *)mprotect, AUE_MPROTECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 74 = mprotect */ + { AS(madvise_args), (sy_call_t *)madvise, AUE_MADVISE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 75 = madvise */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 76 = obsolete vhangup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 77 = obsolete vlimit */ - { AS(mincore_args), (sy_call_t *)mincore, AUE_MINCORE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 78 = mincore */ - { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 79 = getgroups */ + { AS(mincore_args), (sy_call_t *)mincore, AUE_MINCORE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 78 = mincore */ + { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 79 = getgroups */ { AS(setgroups_args), (sy_call_t *)setgroups, AUE_SETGROUPS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 80 = setgroups */ - { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 81 = getpgrp */ + { 0, (sy_call_t *)getpgrp, AUE_GETPGRP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 81 = getpgrp */ { AS(setpgid_args), (sy_call_t *)setpgid, AUE_SETPGRP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 82 = setpgid */ - { AS(setitimer_args), (sy_call_t *)setitimer, AUE_SETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 83 = setitimer */ + { AS(setitimer_args), (sy_call_t *)setitimer, AUE_SETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 83 = setitimer */ { compat(0,wait), AUE_WAIT4, NULL, 0, 0, 0, SY_THR_STATIC }, /* 84 = old wait */ { AS(swapon_args), (sy_call_t *)swapon, AUE_SWAPON, NULL, 0, 0, 0, SY_THR_STATIC }, /* 85 = swapon */ - { AS(getitimer_args), (sy_call_t *)getitimer, AUE_GETITIMER, NULL, 0, 0, 0, SY_THR_STATIC }, /* 86 = getitimer */ - { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 87 = old gethostname */ + { AS(getitimer_args), (sy_call_t *)getitimer, AUE_GETITIMER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 86 = getitimer */ + { compat(AS(gethostname_args),gethostname), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 87 = old gethostname */ { compat(AS(sethostname_args),sethostname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 88 = old sethostname */ { 0, (sy_call_t *)getdtablesize, AUE_GETDTABLESIZE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 89 = getdtablesize */ - { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 90 = dup2 */ + { AS(dup2_args), (sy_call_t *)dup2, AUE_DUP2, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 90 = dup2 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 91 = getdopt */ - { AS(fcntl_args), (sy_call_t *)fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 92 = fcntl */ - { AS(select_args), (sy_call_t *)select, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 93 = select */ + { AS(fcntl_args), (sy_call_t *)fcntl, AUE_FCNTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 92 = fcntl */ + { AS(select_args), (sy_call_t *)select, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 93 = select */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 94 = setdopt */ - { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 95 = fsync */ - { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 96 = setpriority */ - { AS(socket_args), (sy_call_t *)socket, AUE_SOCKET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 97 = socket */ + { AS(fsync_args), (sy_call_t *)fsync, AUE_FSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 95 = fsync */ + { AS(setpriority_args), (sy_call_t *)setpriority, AUE_SETPRIORITY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 96 = setpriority */ + { AS(socket_args), (sy_call_t *)socket, AUE_SOCKET, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 97 = socket */ { AS(connect_args), (sy_call_t *)connect, AUE_CONNECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 98 = connect */ - { compat(AS(accept_args),accept), AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 99 = old accept */ - { AS(getpriority_args), (sy_call_t *)getpriority, AUE_GETPRIORITY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 100 = getpriority */ - { compat(AS(osend_args),send), AUE_SEND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 101 = old send */ - { compat(AS(orecv_args),recv), AUE_RECV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 102 = old recv */ - { compat(AS(osigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 103 = old sigreturn */ + { compat(AS(accept_args),accept), AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 99 = old accept */ + { AS(getpriority_args), (sy_call_t *)getpriority, AUE_GETPRIORITY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 100 = getpriority */ + { compat(AS(osend_args),send), AUE_SEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 101 = old send */ + { compat(AS(orecv_args),recv), AUE_RECV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 102 = old recv */ + { compat(AS(osigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 103 = old sigreturn */ { AS(bind_args), (sy_call_t *)bind, AUE_BIND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 104 = bind */ - { AS(setsockopt_args), (sy_call_t *)setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 105 = setsockopt */ - { AS(listen_args), (sy_call_t *)listen, AUE_LISTEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 106 = listen */ + { AS(setsockopt_args), (sy_call_t *)setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 105 = setsockopt */ + { AS(listen_args), (sy_call_t *)listen, AUE_LISTEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 106 = listen */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 107 = obsolete vtimes */ - { compat(AS(osigvec_args),sigvec), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 108 = old sigvec */ - { compat(AS(osigblock_args),sigblock), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 109 = old sigblock */ - { compat(AS(osigsetmask_args),sigsetmask), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 110 = old sigsetmask */ - { compat(AS(osigsuspend_args),sigsuspend), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 111 = old sigsuspend */ - { compat(AS(osigstack_args),sigstack), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 112 = old sigstack */ - { compat(AS(orecvmsg_args),recvmsg), AUE_RECVMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 113 = old recvmsg */ - { compat(AS(osendmsg_args),sendmsg), AUE_SENDMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 114 = old sendmsg */ + { compat(AS(osigvec_args),sigvec), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 108 = old sigvec */ + { compat(AS(osigblock_args),sigblock), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 109 = old sigblock */ + { compat(AS(osigsetmask_args),sigsetmask), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 110 = old sigsetmask */ + { compat(AS(osigsuspend_args),sigsuspend), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 111 = old sigsuspend */ + { compat(AS(osigstack_args),sigstack), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 112 = old sigstack */ + { compat(AS(orecvmsg_args),recvmsg), AUE_RECVMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 113 = old recvmsg */ + { compat(AS(osendmsg_args),sendmsg), AUE_SENDMSG, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 114 = old sendmsg */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 115 = obsolete vtrace */ - { AS(gettimeofday_args), (sy_call_t *)gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 116 = gettimeofday */ - { AS(getrusage_args), (sy_call_t *)getrusage, AUE_GETRUSAGE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 117 = getrusage */ - { AS(getsockopt_args), (sy_call_t *)getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 118 = getsockopt */ + { AS(gettimeofday_args), (sy_call_t *)gettimeofday, AUE_GETTIMEOFDAY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 116 = gettimeofday */ + { AS(getrusage_args), (sy_call_t *)getrusage, AUE_GETRUSAGE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 117 = getrusage */ + { AS(getsockopt_args), (sy_call_t *)getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 118 = getsockopt */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 119 = resuba */ - { AS(readv_args), (sy_call_t *)readv, AUE_READV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 120 = readv */ - { AS(writev_args), (sy_call_t *)writev, AUE_WRITEV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 121 = writev */ + { AS(readv_args), (sy_call_t *)readv, AUE_READV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 120 = readv */ + { AS(writev_args), (sy_call_t *)writev, AUE_WRITEV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 121 = writev */ { AS(settimeofday_args), (sy_call_t *)settimeofday, AUE_SETTIMEOFDAY, NULL, 0, 0, 0, SY_THR_STATIC }, /* 122 = settimeofday */ - { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 123 = fchown */ - { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 124 = fchmod */ - { compat(AS(recvfrom_args),recvfrom), AUE_RECVFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 125 = old recvfrom */ - { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 126 = setreuid */ - { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 127 = setregid */ + { AS(fchown_args), (sy_call_t *)fchown, AUE_FCHOWN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 123 = fchown */ + { AS(fchmod_args), (sy_call_t *)fchmod, AUE_FCHMOD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 124 = fchmod */ + { compat(AS(recvfrom_args),recvfrom), AUE_RECVFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 125 = old recvfrom */ + { AS(setreuid_args), (sy_call_t *)setreuid, AUE_SETREUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 126 = setreuid */ + { AS(setregid_args), (sy_call_t *)setregid, AUE_SETREGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 127 = setregid */ { AS(rename_args), (sy_call_t *)rename, AUE_RENAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 128 = rename */ { compat(AS(otruncate_args),truncate), AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 129 = old truncate */ - { compat(AS(oftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 130 = old ftruncate */ - { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 131 = flock */ + { compat(AS(oftruncate_args),ftruncate), AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 130 = old ftruncate */ + { AS(flock_args), (sy_call_t *)flock, AUE_FLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 131 = flock */ { AS(mkfifo_args), (sy_call_t *)mkfifo, AUE_MKFIFO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 132 = mkfifo */ - { AS(sendto_args), (sy_call_t *)sendto, AUE_SENDTO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 133 = sendto */ - { AS(shutdown_args), (sy_call_t *)shutdown, AUE_SHUTDOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 134 = shutdown */ - { AS(socketpair_args), (sy_call_t *)socketpair, AUE_SOCKETPAIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 135 = socketpair */ + { AS(sendto_args), (sy_call_t *)sendto, AUE_SENDTO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 133 = sendto */ + { AS(shutdown_args), (sy_call_t *)shutdown, AUE_SHUTDOWN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 134 = shutdown */ + { AS(socketpair_args), (sy_call_t *)socketpair, AUE_SOCKETPAIR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 135 = socketpair */ { AS(mkdir_args), (sy_call_t *)mkdir, AUE_MKDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 136 = mkdir */ { AS(rmdir_args), (sy_call_t *)rmdir, AUE_RMDIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 137 = rmdir */ { AS(utimes_args), (sy_call_t *)utimes, AUE_UTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 138 = utimes */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 139 = obsolete 4.2 sigreturn */ { AS(adjtime_args), (sy_call_t *)adjtime, AUE_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 140 = adjtime */ - { compat(AS(ogetpeername_args),getpeername), AUE_GETPEERNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 141 = old getpeername */ - { compat(0,gethostid), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 142 = old gethostid */ + { compat(AS(ogetpeername_args),getpeername), AUE_GETPEERNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 141 = old getpeername */ + { compat(0,gethostid), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 142 = old gethostid */ { compat(AS(osethostid_args),sethostid), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 143 = old sethostid */ - { compat(AS(ogetrlimit_args),getrlimit), AUE_GETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 144 = old getrlimit */ - { compat(AS(osetrlimit_args),setrlimit), AUE_SETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 145 = old setrlimit */ + { compat(AS(ogetrlimit_args),getrlimit), AUE_GETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 144 = old getrlimit */ + { compat(AS(osetrlimit_args),setrlimit), AUE_SETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 145 = old setrlimit */ { compat(AS(okillpg_args),killpg), AUE_KILLPG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 146 = old killpg */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 147 = setsid */ + { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 147 = setsid */ { AS(quotactl_args), (sy_call_t *)quotactl, AUE_QUOTACTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 148 = quotactl */ { compat(0,quota), AUE_O_QUOTA, NULL, 0, 0, 0, SY_THR_STATIC }, /* 149 = old quota */ - { compat(AS(getsockname_args),getsockname), AUE_GETSOCKNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 150 = old getsockname */ + { compat(AS(getsockname_args),getsockname), AUE_GETSOCKNAME, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 150 = old getsockname */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 151 = sem_lock */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 152 = sem_wakeup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 153 = asyncdaemon */ { AS(nlm_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 154 = nlm_syscall */ { AS(nfssvc_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 155 = nfssvc */ - { compat(AS(ogetdirentries_args),getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 156 = old getdirentries */ + { compat(AS(ogetdirentries_args),getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 156 = old getdirentries */ { compat4(AS(freebsd4_statfs_args),statfs), AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 157 = freebsd4 statfs */ - { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 158 = freebsd4 fstatfs */ + { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 158 = freebsd4 fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 159 = nosys */ { AS(lgetfh_args), (sy_call_t *)lgetfh, AUE_LGETFH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 161 = getfh */ - { compat4(AS(freebsd4_getdomainname_args),getdomainname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 162 = freebsd4 getdomainname */ + { compat4(AS(freebsd4_getdomainname_args),getdomainname), AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 162 = freebsd4 getdomainname */ { compat4(AS(freebsd4_setdomainname_args),setdomainname), AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 163 = freebsd4 setdomainname */ { compat4(AS(freebsd4_uname_args),uname), AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 164 = freebsd4 uname */ - { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 165 = sysarch */ - { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 166 = rtprio */ + { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 165 = sysarch */ + { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 166 = rtprio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 167 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 168 = nosys */ { AS(semsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 169 = semsys */ { AS(msgsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 170 = msgsys */ { AS(shmsys_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 171 = shmsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 172 = nosys */ - { AS(freebsd6_pread_args), (sy_call_t *)freebsd6_pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 173 = freebsd6_pread */ - { AS(freebsd6_pwrite_args), (sy_call_t *)freebsd6_pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 174 = freebsd6_pwrite */ + { AS(freebsd6_pread_args), (sy_call_t *)freebsd6_pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6_pread */ + { AS(freebsd6_pwrite_args), (sy_call_t *)freebsd6_pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 174 = freebsd6_pwrite */ { AS(setfib_args), (sy_call_t *)setfib, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = setfib */ { AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = ntp_adjtime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = sfork */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 178 = getdescriptor */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 179 = setdescriptor */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 180 = nosys */ - { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 181 = setgid */ - { AS(setegid_args), (sy_call_t *)setegid, AUE_SETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 182 = setegid */ - { AS(seteuid_args), (sy_call_t *)seteuid, AUE_SETEUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 183 = seteuid */ + { AS(setgid_args), (sy_call_t *)setgid, AUE_SETGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 181 = setgid */ + { AS(setegid_args), (sy_call_t *)setegid, AUE_SETEGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 182 = setegid */ + { AS(seteuid_args), (sy_call_t *)seteuid, AUE_SETEUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 183 = seteuid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 184 = lfs_bmapv */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 185 = lfs_markv */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 186 = lfs_segclean */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 187 = lfs_segwait */ { AS(stat_args), (sy_call_t *)stat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 188 = stat */ - { AS(fstat_args), (sy_call_t *)fstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 189 = fstat */ + { AS(fstat_args), (sy_call_t *)fstat, AUE_FSTAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 189 = fstat */ { AS(lstat_args), (sy_call_t *)lstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 190 = lstat */ { AS(pathconf_args), (sy_call_t *)pathconf, AUE_PATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 191 = pathconf */ - { AS(fpathconf_args), (sy_call_t *)fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 192 = fpathconf */ + { AS(fpathconf_args), (sy_call_t *)fpathconf, AUE_FPATHCONF, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 192 = fpathconf */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 193 = nosys */ - { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 194 = getrlimit */ - { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 195 = setrlimit */ - { AS(getdirentries_args), (sy_call_t *)getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 196 = getdirentries */ - { AS(freebsd6_mmap_args), (sy_call_t *)freebsd6_mmap, AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 197 = freebsd6_mmap */ + { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 194 = getrlimit */ + { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 195 = setrlimit */ + { AS(getdirentries_args), (sy_call_t *)getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 196 = getdirentries */ + { AS(freebsd6_mmap_args), (sy_call_t *)freebsd6_mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 197 = freebsd6_mmap */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 198 = __syscall */ - { AS(freebsd6_lseek_args), (sy_call_t *)freebsd6_lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 199 = freebsd6_lseek */ + { AS(freebsd6_lseek_args), (sy_call_t *)freebsd6_lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 199 = freebsd6_lseek */ { AS(freebsd6_truncate_args), (sy_call_t *)freebsd6_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 200 = freebsd6_truncate */ - { AS(freebsd6_ftruncate_args), (sy_call_t *)freebsd6_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 201 = freebsd6_ftruncate */ - { AS(sysctl_args), (sy_call_t *)__sysctl, AUE_SYSCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 202 = __sysctl */ - { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 203 = mlock */ - { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 204 = munlock */ + { AS(freebsd6_ftruncate_args), (sy_call_t *)freebsd6_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 201 = freebsd6_ftruncate */ + { AS(sysctl_args), (sy_call_t *)__sysctl, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 202 = __sysctl */ + { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 203 = mlock */ + { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 204 = munlock */ { AS(undelete_args), (sy_call_t *)undelete, AUE_UNDELETE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = undelete */ - { AS(futimes_args), (sy_call_t *)futimes, AUE_FUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 206 = futimes */ - { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 207 = getpgid */ + { AS(futimes_args), (sy_call_t *)futimes, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 206 = futimes */ + { AS(getpgid_args), (sy_call_t *)getpgid, AUE_GETPGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 207 = getpgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = newreboot */ - { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 209 = poll */ + { AS(poll_args), (sy_call_t *)poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 209 = poll */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 212 = lkmnosys */ @@ -266,15 +266,15 @@ struct sysent sysent[] = { { 0, (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 229 = freebsd7 shmctl */ { AS(shmdt_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 230 = shmdt */ { AS(shmget_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 231 = shmget */ - { AS(clock_gettime_args), (sy_call_t *)clock_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 232 = clock_gettime */ + { AS(clock_gettime_args), (sy_call_t *)clock_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 232 = clock_gettime */ { AS(clock_settime_args), (sy_call_t *)clock_settime, AUE_CLOCK_SETTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 233 = clock_settime */ - { AS(clock_getres_args), (sy_call_t *)clock_getres, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 234 = clock_getres */ - { AS(ktimer_create_args), (sy_call_t *)ktimer_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 235 = ktimer_create */ - { AS(ktimer_delete_args), (sy_call_t *)ktimer_delete, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 236 = ktimer_delete */ - { AS(ktimer_settime_args), (sy_call_t *)ktimer_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 237 = ktimer_settime */ - { AS(ktimer_gettime_args), (sy_call_t *)ktimer_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 238 = ktimer_gettime */ - { AS(ktimer_getoverrun_args), (sy_call_t *)ktimer_getoverrun, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ - { AS(nanosleep_args), (sy_call_t *)nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 240 = nanosleep */ + { AS(clock_getres_args), (sy_call_t *)clock_getres, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 234 = clock_getres */ + { AS(ktimer_create_args), (sy_call_t *)ktimer_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 235 = ktimer_create */ + { AS(ktimer_delete_args), (sy_call_t *)ktimer_delete, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 236 = ktimer_delete */ + { AS(ktimer_settime_args), (sy_call_t *)ktimer_settime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 237 = ktimer_settime */ + { AS(ktimer_gettime_args), (sy_call_t *)ktimer_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 238 = ktimer_gettime */ + { AS(ktimer_getoverrun_args), (sy_call_t *)ktimer_getoverrun, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 239 = ktimer_getoverrun */ + { AS(nanosleep_args), (sy_call_t *)nanosleep, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 240 = nanosleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 241 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 242 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 243 = nosys */ @@ -282,12 +282,12 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 247 = nosys */ - { AS(ntp_gettime_args), (sy_call_t *)ntp_gettime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 248 = ntp_gettime */ + { AS(ntp_gettime_args), (sy_call_t *)ntp_gettime, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 248 = ntp_gettime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ - { AS(minherit_args), (sy_call_t *)minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */ + { AS(minherit_args), (sy_call_t *)minherit, AUE_MINHERIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 250 = minherit */ { AS(rfork_args), (sy_call_t *)rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = openbsd_poll */ - { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = issetugid */ + { AS(openbsd_poll_args), (sy_call_t *)openbsd_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 252 = openbsd_poll */ + { 0, (sy_call_t *)issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ { AS(aio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 255 = aio_read */ { AS(aio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 256 = aio_write */ @@ -306,12 +306,12 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 269 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 270 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 271 = nosys */ - { AS(getdents_args), (sy_call_t *)getdents, AUE_O_GETDENTS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = getdents */ + { AS(getdents_args), (sy_call_t *)getdents, AUE_O_GETDENTS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 272 = getdents */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 273 = nosys */ { AS(lchmod_args), (sy_call_t *)lchmod, AUE_LCHMOD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = lchmod */ { AS(lchown_args), (sy_call_t *)lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 275 = netbsd_lchown */ { AS(lutimes_args), (sy_call_t *)lutimes, AUE_LUTIMES, NULL, 0, 0, 0, SY_THR_STATIC }, /* 276 = lutimes */ - { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 277 = netbsd_msync */ + { AS(msync_args), (sy_call_t *)msync, AUE_MSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 277 = netbsd_msync */ { AS(nstat_args), (sy_call_t *)nstat, AUE_STAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 278 = nstat */ { AS(nfstat_args), (sy_call_t *)nfstat, AUE_FSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 279 = nfstat */ { AS(nlstat_args), (sy_call_t *)nlstat, AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = nlstat */ @@ -323,8 +323,8 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 286 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 287 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 288 = nosys */ - { AS(preadv_args), (sy_call_t *)preadv, AUE_PREADV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 289 = preadv */ - { AS(pwritev_args), (sy_call_t *)pwritev, AUE_PWRITEV, NULL, 0, 0, 0, SY_THR_STATIC }, /* 290 = pwritev */ + { AS(preadv_args), (sy_call_t *)preadv, AUE_PREADV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 289 = preadv */ + { AS(pwritev_args), (sy_call_t *)pwritev, AUE_PWRITEV, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 290 = pwritev */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 291 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 292 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 293 = nosys */ @@ -344,9 +344,9 @@ struct sysent sysent[] = { { AS(kldnext_args), (sy_call_t *)kldnext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = kldnext */ { AS(kldstat_args), (sy_call_t *)kldstat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = kldstat */ { AS(kldfirstmod_args), (sy_call_t *)kldfirstmod, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = kldfirstmod */ - { AS(getsid_args), (sy_call_t *)getsid, AUE_GETSID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = getsid */ - { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = setresuid */ - { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = setresgid */ + { AS(getsid_args), (sy_call_t *)getsid, AUE_GETSID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 310 = getsid */ + { AS(setresuid_args), (sy_call_t *)setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */ + { AS(setresgid_args), (sy_call_t *)setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */ { AS(aio_return_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 314 = aio_return */ { AS(aio_suspend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 315 = aio_suspend */ @@ -355,49 +355,49 @@ struct sysent sysent[] = { { AS(oaio_read_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 318 = oaio_read */ { AS(oaio_write_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 319 = oaio_write */ { AS(olio_listio_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 320 = olio_listio */ - { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = yield */ + { 0, (sy_call_t *)yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */ - { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = mlockall */ - { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = munlockall */ + { AS(mlockall_args), (sy_call_t *)mlockall, AUE_MLOCKALL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 324 = mlockall */ + { 0, (sy_call_t *)munlockall, AUE_MUNLOCKALL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 325 = munlockall */ { AS(__getcwd_args), (sy_call_t *)__getcwd, AUE_GETCWD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = __getcwd */ - { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = sched_setparam */ - { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = sched_getparam */ - { AS(sched_setscheduler_args), (sy_call_t *)sched_setscheduler, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = sched_setscheduler */ - { AS(sched_getscheduler_args), (sy_call_t *)sched_getscheduler, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = sched_getscheduler */ - { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = sched_yield */ - { AS(sched_get_priority_max_args), (sy_call_t *)sched_get_priority_max, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ - { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ + { AS(sched_setparam_args), (sy_call_t *)sched_setparam, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 327 = sched_setparam */ + { AS(sched_getparam_args), (sy_call_t *)sched_getparam, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 328 = sched_getparam */ + { AS(sched_setscheduler_args), (sy_call_t *)sched_setscheduler, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 329 = sched_setscheduler */ + { AS(sched_getscheduler_args), (sy_call_t *)sched_getscheduler, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 330 = sched_getscheduler */ + { 0, (sy_call_t *)sched_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 331 = sched_yield */ + { AS(sched_get_priority_max_args), (sy_call_t *)sched_get_priority_max, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 332 = sched_get_priority_max */ + { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 333 = sched_get_priority_min */ { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = sched_rr_get_interval */ - { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = utrace */ - { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ + { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 335 = utrace */ + { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = kldsym */ { AS(jail_args), (sy_call_t *)jail, AUE_JAIL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = jail */ { AS(nnpfs_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nnpfs_syscall */ - { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 340 = sigprocmask */ - { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 342 = freebsd4 sigaction */ - { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0, 0, SY_THR_STATIC }, /* 343 = sigpending */ - { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = freebsd4 sigreturn */ - { AS(sigtimedwait_args), (sy_call_t *)sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = sigtimedwait */ - { AS(sigwaitinfo_args), (sy_call_t *)sigwaitinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = sigwaitinfo */ + { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 340 = sigprocmask */ + { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 341 = sigsuspend */ + { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 342 = freebsd4 sigaction */ + { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 343 = sigpending */ + { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 344 = freebsd4 sigreturn */ + { AS(sigtimedwait_args), (sy_call_t *)sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 345 = sigtimedwait */ + { AS(sigwaitinfo_args), (sy_call_t *)sigwaitinfo, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 346 = sigwaitinfo */ { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */ { AS(__acl_set_file_args), (sy_call_t *)__acl_set_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */ - { AS(__acl_get_fd_args), (sy_call_t *)__acl_get_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 349 = __acl_get_fd */ - { AS(__acl_set_fd_args), (sy_call_t *)__acl_set_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 350 = __acl_set_fd */ + { AS(__acl_get_fd_args), (sy_call_t *)__acl_get_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */ + { AS(__acl_set_fd_args), (sy_call_t *)__acl_set_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */ { AS(__acl_delete_file_args), (sy_call_t *)__acl_delete_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */ - { AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ + { AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ { AS(__acl_aclcheck_file_args), (sy_call_t *)__acl_aclcheck_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */ - { AS(__acl_aclcheck_fd_args), (sy_call_t *)__acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ + { AS(__acl_aclcheck_fd_args), (sy_call_t *)__acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ { AS(extattrctl_args), (sy_call_t *)extattrctl, AUE_EXTATTRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 355 = extattrctl */ { AS(extattr_set_file_args), (sy_call_t *)extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */ { AS(aio_waitcomplete_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = aio_waitcomplete */ - { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 360 = getresuid */ - { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 361 = getresgid */ - { 0, (sy_call_t *)kqueue, AUE_KQUEUE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 362 = kqueue */ - { AS(kevent_args), (sy_call_t *)kevent, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 363 = kevent */ + { AS(getresuid_args), (sy_call_t *)getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ + { AS(getresgid_args), (sy_call_t *)getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ + { 0, (sy_call_t *)kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ + { AS(kevent_args), (sy_call_t *)kevent, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = kevent */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */ @@ -405,9 +405,9 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 368 = __cap_set_fd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 369 = __cap_set_file */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 370 = nosys */ - { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 371 = extattr_set_fd */ - { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 372 = extattr_get_fd */ - { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 373 = extattr_delete_fd */ + { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 371 = extattr_set_fd */ + { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 372 = extattr_get_fd */ + { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 373 = extattr_delete_fd */ { AS(__setugid_args), (sy_call_t *)__setugid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nfsclnt */ { AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 376 = eaccess */ @@ -418,20 +418,20 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 381 = kse_create */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 382 = kse_thr_interrupt */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = kse_release */ - { AS(__mac_get_proc_args), (sy_call_t *)__mac_get_proc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 384 = __mac_get_proc */ - { AS(__mac_set_proc_args), (sy_call_t *)__mac_set_proc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 385 = __mac_set_proc */ - { AS(__mac_get_fd_args), (sy_call_t *)__mac_get_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 386 = __mac_get_fd */ + { AS(__mac_get_proc_args), (sy_call_t *)__mac_get_proc, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 384 = __mac_get_proc */ + { AS(__mac_set_proc_args), (sy_call_t *)__mac_set_proc, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 385 = __mac_set_proc */ + { AS(__mac_get_fd_args), (sy_call_t *)__mac_get_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 386 = __mac_get_fd */ { AS(__mac_get_file_args), (sy_call_t *)__mac_get_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 387 = __mac_get_file */ - { AS(__mac_set_fd_args), (sy_call_t *)__mac_set_fd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 388 = __mac_set_fd */ + { AS(__mac_set_fd_args), (sy_call_t *)__mac_set_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 388 = __mac_set_fd */ { AS(__mac_set_file_args), (sy_call_t *)__mac_set_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 389 = __mac_set_file */ { AS(kenv_args), (sy_call_t *)kenv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 390 = kenv */ { AS(lchflags_args), (sy_call_t *)lchflags, AUE_LCHFLAGS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 391 = lchflags */ - { AS(uuidgen_args), (sy_call_t *)uuidgen, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 392 = uuidgen */ - { AS(sendfile_args), (sy_call_t *)sendfile, AUE_SENDFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 393 = sendfile */ + { AS(uuidgen_args), (sy_call_t *)uuidgen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 392 = uuidgen */ + { AS(sendfile_args), (sy_call_t *)sendfile, AUE_SENDFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 393 = sendfile */ { AS(mac_syscall_args), (sy_call_t *)mac_syscall, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 394 = mac_syscall */ { AS(getfsstat_args), (sy_call_t *)getfsstat, AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 395 = getfsstat */ { AS(statfs_args), (sy_call_t *)statfs, AUE_STATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 396 = statfs */ - { AS(fstatfs_args), (sy_call_t *)fstatfs, AUE_FSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 397 = fstatfs */ + { AS(fstatfs_args), (sy_call_t *)fstatfs, AUE_FSTATFS, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 397 = fstatfs */ { AS(fhstatfs_args), (sy_call_t *)fhstatfs, AUE_FHSTATFS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 398 = fhstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 399 = nosys */ { AS(ksem_close_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 400 = ksem_close */ @@ -450,13 +450,13 @@ struct sysent sysent[] = { { AS(extattr_get_link_args), (sy_call_t *)extattr_get_link, AUE_EXTATTR_GET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 413 = extattr_get_link */ { AS(extattr_delete_link_args), (sy_call_t *)extattr_delete_link, AUE_EXTATTR_DELETE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 414 = extattr_delete_link */ { AS(__mac_execve_args), (sy_call_t *)__mac_execve, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 415 = __mac_execve */ - { AS(sigaction_args), (sy_call_t *)sigaction, AUE_SIGACTION, NULL, 0, 0, 0, SY_THR_STATIC }, /* 416 = sigaction */ - { AS(sigreturn_args), (sy_call_t *)sigreturn, AUE_SIGRETURN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 417 = sigreturn */ + { AS(sigaction_args), (sy_call_t *)sigaction, AUE_SIGACTION, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 416 = sigaction */ + { AS(sigreturn_args), (sy_call_t *)sigreturn, AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 417 = sigreturn */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 418 = __xstat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 419 = __xfstat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 420 = __xlstat */ - { AS(getcontext_args), (sy_call_t *)getcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 421 = getcontext */ - { AS(setcontext_args), (sy_call_t *)setcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 422 = setcontext */ + { AS(getcontext_args), (sy_call_t *)getcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 421 = getcontext */ + { AS(setcontext_args), (sy_call_t *)setcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 422 = setcontext */ { AS(swapcontext_args), (sy_call_t *)swapcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = swapcontext */ { AS(swapoff_args), (sy_call_t *)swapoff, AUE_SWAPOFF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = swapoff */ { AS(__acl_get_link_args), (sy_call_t *)__acl_get_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */ @@ -464,57 +464,57 @@ struct sysent sysent[] = { { AS(__acl_delete_link_args), (sy_call_t *)__acl_delete_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */ { AS(__acl_aclcheck_link_args), (sy_call_t *)__acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ { AS(sigwait_args), (sy_call_t *)sigwait, AUE_SIGWAIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 429 = sigwait */ - { AS(thr_create_args), (sy_call_t *)thr_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 430 = thr_create */ - { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 431 = thr_exit */ - { AS(thr_self_args), (sy_call_t *)thr_self, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 432 = thr_self */ - { AS(thr_kill_args), (sy_call_t *)thr_kill, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 433 = thr_kill */ - { AS(_umtx_lock_args), (sy_call_t *)_umtx_lock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 434 = _umtx_lock */ - { AS(_umtx_unlock_args), (sy_call_t *)_umtx_unlock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 435 = _umtx_unlock */ + { AS(thr_create_args), (sy_call_t *)thr_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 430 = thr_create */ + { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ + { AS(thr_self_args), (sy_call_t *)thr_self, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 432 = thr_self */ + { AS(thr_kill_args), (sy_call_t *)thr_kill, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ + { AS(_umtx_lock_args), (sy_call_t *)_umtx_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 434 = _umtx_lock */ + { AS(_umtx_unlock_args), (sy_call_t *)_umtx_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 435 = _umtx_unlock */ { AS(jail_attach_args), (sy_call_t *)jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ - { AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 437 = extattr_list_fd */ + { AS(extattr_list_fd_args), (sy_call_t *)extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */ { AS(extattr_list_link_args), (sy_call_t *)extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 439 = extattr_list_link */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 440 = kse_switchin */ { AS(ksem_timedwait_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 441 = ksem_timedwait */ - { AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 442 = thr_suspend */ - { AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 443 = thr_wake */ + { AS(thr_suspend_args), (sy_call_t *)thr_suspend, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 442 = thr_suspend */ + { AS(thr_wake_args), (sy_call_t *)thr_wake, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 443 = thr_wake */ { AS(kldunloadf_args), (sy_call_t *)kldunloadf, AUE_MODUNLOAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 444 = kldunloadf */ { AS(audit_args), (sy_call_t *)audit, AUE_AUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 445 = audit */ { AS(auditon_args), (sy_call_t *)auditon, AUE_AUDITON, NULL, 0, 0, 0, SY_THR_STATIC }, /* 446 = auditon */ - { AS(getauid_args), (sy_call_t *)getauid, AUE_GETAUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 447 = getauid */ - { AS(setauid_args), (sy_call_t *)setauid, AUE_SETAUID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 448 = setauid */ - { AS(getaudit_args), (sy_call_t *)getaudit, AUE_GETAUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 449 = getaudit */ - { AS(setaudit_args), (sy_call_t *)setaudit, AUE_SETAUDIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 450 = setaudit */ - { AS(getaudit_addr_args), (sy_call_t *)getaudit_addr, AUE_GETAUDIT_ADDR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 451 = getaudit_addr */ - { AS(setaudit_addr_args), (sy_call_t *)setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 452 = setaudit_addr */ + { AS(getauid_args), (sy_call_t *)getauid, AUE_GETAUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 447 = getauid */ + { AS(setauid_args), (sy_call_t *)setauid, AUE_SETAUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 448 = setauid */ + { AS(getaudit_args), (sy_call_t *)getaudit, AUE_GETAUDIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 449 = getaudit */ + { AS(setaudit_args), (sy_call_t *)setaudit, AUE_SETAUDIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 450 = setaudit */ + { AS(getaudit_addr_args), (sy_call_t *)getaudit_addr, AUE_GETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 451 = getaudit_addr */ + { AS(setaudit_addr_args), (sy_call_t *)setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 452 = setaudit_addr */ { AS(auditctl_args), (sy_call_t *)auditctl, AUE_AUDITCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 453 = auditctl */ - { AS(_umtx_op_args), (sy_call_t *)_umtx_op, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 454 = _umtx_op */ - { AS(thr_new_args), (sy_call_t *)thr_new, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 455 = thr_new */ - { AS(sigqueue_args), (sy_call_t *)sigqueue, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 456 = sigqueue */ + { AS(_umtx_op_args), (sy_call_t *)_umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = _umtx_op */ + { AS(thr_new_args), (sy_call_t *)thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = thr_new */ + { AS(sigqueue_args), (sy_call_t *)sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */ { AS(kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = kmq_open */ { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 458 = kmq_setattr */ { AS(kmq_timedreceive_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 459 = kmq_timedreceive */ { AS(kmq_timedsend_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 460 = kmq_timedsend */ { AS(kmq_notify_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 461 = kmq_notify */ { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ - { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 463 = abort2 */ - { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 464 = thr_set_name */ + { AS(abort2_args), (sy_call_t *)abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ + { AS(thr_set_name_args), (sy_call_t *)thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ { AS(aio_fsync_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 465 = aio_fsync */ - { AS(rtprio_thread_args), (sy_call_t *)rtprio_thread, AUE_RTPRIO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 466 = rtprio_thread */ + { AS(rtprio_thread_args), (sy_call_t *)rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 469 = __getpath_fromfd */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 470 = __getpath_fromaddr */ - { AS(sctp_peeloff_args), (sy_call_t *)sctp_peeloff, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 471 = sctp_peeloff */ - { AS(sctp_generic_sendmsg_args), (sy_call_t *)sctp_generic_sendmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 472 = sctp_generic_sendmsg */ - { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)sctp_generic_sendmsg_iov, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 473 = sctp_generic_sendmsg_iov */ - { AS(sctp_generic_recvmsg_args), (sy_call_t *)sctp_generic_recvmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 474 = sctp_generic_recvmsg */ - { AS(pread_args), (sy_call_t *)pread, AUE_PREAD, NULL, 0, 0, 0, SY_THR_STATIC }, /* 475 = pread */ - { AS(pwrite_args), (sy_call_t *)pwrite, AUE_PWRITE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 476 = pwrite */ - { AS(mmap_args), (sy_call_t *)mmap, AUE_MMAP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 477 = mmap */ - { AS(lseek_args), (sy_call_t *)lseek, AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 478 = lseek */ + { AS(sctp_peeloff_args), (sy_call_t *)sctp_peeloff, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 471 = sctp_peeloff */ + { AS(sctp_generic_sendmsg_args), (sy_call_t *)sctp_generic_sendmsg, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 472 = sctp_generic_sendmsg */ + { AS(sctp_generic_sendmsg_iov_args), (sy_call_t *)sctp_generic_sendmsg_iov, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 473 = sctp_generic_sendmsg_iov */ + { AS(sctp_generic_recvmsg_args), (sy_call_t *)sctp_generic_recvmsg, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 474 = sctp_generic_recvmsg */ + { AS(pread_args), (sy_call_t *)pread, AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 475 = pread */ + { AS(pwrite_args), (sy_call_t *)pwrite, AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 476 = pwrite */ + { AS(mmap_args), (sy_call_t *)mmap, AUE_MMAP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 477 = mmap */ + { AS(lseek_args), (sy_call_t *)lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 478 = lseek */ { AS(truncate_args), (sy_call_t *)truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = truncate */ - { AS(ftruncate_args), (sy_call_t *)ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 480 = ftruncate */ + { AS(ftruncate_args), (sy_call_t *)ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 480 = ftruncate */ { AS(thr_kill2_args), (sy_call_t *)thr_kill2, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ { AS(shm_open_args), (sy_call_t *)shm_open, AUE_SHMOPEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 482 = shm_open */ { AS(shm_unlink_args), (sy_call_t *)shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ @@ -526,7 +526,7 @@ struct sysent sysent[] = { { AS(faccessat_args), (sy_call_t *)faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 489 = faccessat */ { AS(fchmodat_args), (sy_call_t *)fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 490 = fchmodat */ { AS(fchownat_args), (sy_call_t *)fchownat, AUE_FCHOWNAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 491 = fchownat */ - { AS(fexecve_args), (sy_call_t *)fexecve, AUE_FEXECVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 492 = fexecve */ + { AS(fexecve_args), (sy_call_t *)fexecve, AUE_FEXECVE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 492 = fexecve */ { AS(fstatat_args), (sy_call_t *)fstatat, AUE_FSTATAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 493 = fstatat */ { AS(futimesat_args), (sy_call_t *)futimesat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 494 = futimesat */ { AS(linkat_args), (sy_call_t *)linkat, AUE_LINKAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 495 = linkat */ @@ -543,15 +543,15 @@ struct sysent sysent[] = { { AS(jail_get_args), (sy_call_t *)jail_get, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = jail_get */ { AS(jail_set_args), (sy_call_t *)jail_set, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = jail_set */ { AS(jail_remove_args), (sy_call_t *)jail_remove, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */ - { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 509 = closefrom */ + { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 509 = closefrom */ { AS(__semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 510 = __semctl */ { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 511 = msgctl */ { AS(shmctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 512 = shmctl */ { AS(lpathconf_args), (sy_call_t *)lpathconf, AUE_LPATHCONF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 513 = lpathconf */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 514 = cap_new */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 515 = cap_getrights */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 516 = cap_enter */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 517 = cap_getmode */ + { 0, (sy_call_t *)cap_enter, AUE_CAP_ENTER, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 516 = cap_enter */ + { AS(cap_getmode_args), (sy_call_t *)cap_getmode, AUE_CAP_GETMODE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 517 = cap_getmode */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 518 = pdfork */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 519 = pdkill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 520 = pdgetpid */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/kern/syscalls.c Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ const char *syscallnames[] = { @@ -523,8 +523,8 @@ const char *syscallnames[] = { "lpathconf", /* 513 = lpathconf */ "#514", /* 514 = cap_new */ "#515", /* 515 = cap_getrights */ - "#516", /* 516 = cap_enter */ - "#517", /* 517 = cap_getmode */ + "cap_enter", /* 516 = cap_enter */ + "cap_getmode", /* 517 = cap_getmode */ "#518", /* 518 = pdfork */ "#519", /* 519 = pdkill */ "#520", /* 520 = pdgetpid */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/kern/systrace_args.c Tue Mar 1 13:30:23 2011 (r219132) @@ -3096,6 +3096,18 @@ systrace_args(int sysnum, void *params, *n_args = 2; break; } + /* cap_enter */ + case 516: { + *n_args = 0; + break; + } + /* cap_getmode */ + case 517: { + struct cap_getmode_args *p = params; + uarg[0] = (intptr_t) p->modep; /* u_int * */ + *n_args = 1; + break; + } /* pselect */ case 522: { struct pselect_args *p = params; @@ -8240,6 +8252,19 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* cap_enter */ + case 516: + break; + /* cap_getmode */ + case 517: + switch(ndx) { + case 0: + p = "u_int *"; + break; + default: + break; + }; + break; /* pselect */ case 522: switch(ndx) { Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/sys/syscall.h Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #define SYS_syscall 0 @@ -430,5 +430,7 @@ #define SYS_msgctl 511 #define SYS_shmctl 512 #define SYS_lpathconf 513 +#define SYS_cap_enter 516 +#define SYS_cap_getmode 517 #define SYS_pselect 522 #define SYS_MAXSYSCALL 523 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/sys/syscall.mk Tue Mar 1 13:30:23 2011 (r219132) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib +# created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson MIASM = \ syscall.o \ exit.o \ @@ -379,4 +379,6 @@ MIASM = \ msgctl.o \ shmctl.o \ lpathconf.o \ + cap_enter.o \ + cap_getmode.o \ pselect.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Tue Mar 1 13:28:27 2011 (r219131) +++ head/sys/sys/sysproto.h Tue Mar 1 13:30:23 2011 (r219132) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 211998 2010-08-30 14:24:44Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson */ #ifndef _SYS_SYSPROTO_H_ @@ -1657,6 +1657,12 @@ struct lpathconf_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)]; }; +struct cap_enter_args { + register_t dummy; +}; +struct cap_getmode_args { + char modep_l_[PADL_(u_int *)]; u_int * modep; char modep_r_[PADR_(u_int *)]; +}; struct pselect_args { char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; @@ -2025,6 +2031,8 @@ int __semctl(struct thread *, struct __s int msgctl(struct thread *, struct msgctl_args *); int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); +int cap_enter(struct thread *, struct cap_enter_args *); +int cap_getmode(struct thread *, struct cap_getmode_args *); int pselect(struct thread *, struct pselect_args *); #ifdef COMPAT_43 @@ -2700,6 +2708,8 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_msgctl AUE_MSGCTL #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF +#define SYS_AUE_cap_enter AUE_CAP_ENTER +#define SYS_AUE_cap_getmode AUE_CAP_GETMODE #define SYS_AUE_pselect AUE_SELECT #undef PAD_ From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:32:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6D81065678; Tue, 1 Mar 2011 13:32:08 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D20E8FC0A; Tue, 1 Mar 2011 13:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DW8Bg028359; Tue, 1 Mar 2011 13:32:08 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DW854028357; Tue, 1 Mar 2011 13:32:08 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011332.p21DW854028357@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219133 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:32:08 -0000 Author: rwatson Date: Tue Mar 1 13:32:07 2011 New Revision: 219133 URL: http://svn.freebsd.org/changeset/base/219133 Log: Continue introducing Capsicum capability mode support: If a system call wasn't listed in capabilities.conf, return ECAPMODE at syscall entry. Reviewed by: anderson Discussed with: benl, kris, pjd Sponsored by: Google, Inc. Obtained from: Capsicum Project MFC after: 3 months Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Mar 1 13:30:23 2011 (r219132) +++ head/sys/kern/subr_trap.c Tue Mar 1 13:32:07 2011 (r219133) @@ -44,12 +44,14 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capabilities.h" #include "opt_ktrace.h" #include "opt_kdtrace.h" #include "opt_sched.h" #include #include +#include #include #include #include @@ -310,6 +312,19 @@ syscallenter(struct thread *td, struct s if (error != 0) goto retval; } + +#ifdef CAPABILITIES + /* + * In capability mode, we only allow access to system calls + * flagged with SYF_CAPENABLED. + */ + if (IN_CAPABILITY_MODE(td) && + !(sa->callp->sy_flags & SYF_CAPENABLED)) { + error = ECAPMODE; + goto retval; + } +#endif + error = syscall_thread_enter(td, sa->callp); if (error != 0) goto retval; From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 13:35:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62098106566B; Tue, 1 Mar 2011 13:35:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5005D8FC15; Tue, 1 Mar 2011 13:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21DZmPv028584; Tue, 1 Mar 2011 13:35:48 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21DZmJ7028579; Tue, 1 Mar 2011 13:35:48 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011335.p21DZmJ7028579@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 13:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219134 - in head/sys: amd64/amd64 arm/arm i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 13:35:48 -0000 Author: rwatson Date: Tue Mar 1 13:35:48 2011 New Revision: 219134 URL: http://svn.freebsd.org/changeset/base/219134 Log: Continue to introduce Capsicum capability mode: White list sysarch calls allowed in capability mode; arguably, there should be some link between the capability mode model and the privilege model here. Sysarch is a morass similar to ioctl, in many senses. Submitted by: anderson Discussed with: benl, kris, pjd Sponsored by: Google, Inc. Obtained from: Capsicum Project MFC after: 3 months Modified: head/sys/amd64/amd64/sys_machdep.c head/sys/arm/arm/sys_machdep.c head/sys/i386/i386/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Mar 1 13:32:07 2011 (r219133) +++ head/sys/amd64/amd64/sys_machdep.c Tue Mar 1 13:35:48 2011 (r219134) @@ -33,8 +33,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capabilities.h" + #include #include +#include #include #include #include @@ -177,6 +180,32 @@ sysarch(td, uap) uint64_t a64base; struct i386_ioperm_args iargs; +#ifdef CAPABILITIES + /* + * Whitelist of operations which are safe enough for capability mode. + */ + if (IN_CAPABILITY_MODE(td)) { + switch (uap->op) { + case I386_GET_LDT: + case I386_SET_LDT: + case I386_GET_IOPERM: + case I386_GET_FSBASE: + case I386_SET_FSBASE: + case I386_GET_GSBASE: + case I386_SET_GSBASE: + case AMD64_GET_FSBASE: + case AMD64_SET_FSBASE: + case AMD64_GET_GSBASE: + case AMD64_SET_GSBASE: + break; + + case I386_SET_IOPERM: + default: + return (ECAPMODE); + } + } +#endif + if (uap->op == I386_GET_LDT || uap->op == I386_SET_LDT) return (sysarch_ldt(td, uap, UIO_USERSPACE)); /* Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Tue Mar 1 13:32:07 2011 (r219133) +++ head/sys/arm/arm/sys_machdep.c Tue Mar 1 13:35:48 2011 (r219134) @@ -36,8 +36,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capabilities.h" + #include #include +#include #include #include #include @@ -104,6 +107,24 @@ sysarch(td, uap) { int error; +#ifdef CAPABILITIES + /* + * Whitelist of operations which are safe enough for capability mode. + */ + if (IN_CAPABILITY_MODE(td)) { + switch (uap->op) { + case ARM_SYNC_ICACHE: + case ARM_DRAIN_WRITEBUF: + case ARM_SET_TP: + case ARM_GET_TP: + break; + + default: + return (ECAPMODE); + } + } +#endif + switch (uap->op) { case ARM_SYNC_ICACHE : error = arm32_sync_icache(td, uap->parms); Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Tue Mar 1 13:32:07 2011 (r219133) +++ head/sys/i386/i386/sys_machdep.c Tue Mar 1 13:35:48 2011 (r219134) @@ -32,9 +32,11 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capabilities.h" #include "opt_kstack_pages.h" #include +#include #include #include #include @@ -108,6 +110,29 @@ sysarch(td, uap) struct segment_descriptor sd, *sdp; AUDIT_ARG_CMD(uap->op); + +#ifdef CAPABILITIES + /* + * Whitelist of operations which are safe enough for capability mode. + */ + if (IN_CAPABILITY_MODE(td)) { + switch (uap->op) { + case I386_GET_LDT: + case I386_SET_LDT: + case I386_GET_IOPERM: + case I386_GET_FSBASE: + case I386_SET_FSBASE: + case I386_GET_GSBASE: + case I386_SET_GSBASE: + break; + + case I386_SET_IOPERM: + default: + return (ECAPMODE); + } + } +#endif + switch (uap->op) { case I386_GET_IOPERM: case I386_SET_IOPERM: From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 14:43:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2216B106564A; Tue, 1 Mar 2011 14:43:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 108CD8FC1A; Tue, 1 Mar 2011 14:43:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21EhbkW032730; Tue, 1 Mar 2011 14:43:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21EhbRb032728; Tue, 1 Mar 2011 14:43:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103011443.p21EhbRb032728@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Mar 2011 14:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219135 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 14:43:38 -0000 Author: jhb Date: Tue Mar 1 14:43:37 2011 New Revision: 219135 URL: http://svn.freebsd.org/changeset/base/219135 Log: Similar to 189574, properly handle subclasses of bus drivers when deleting a driver during kldunload. Specifically, recursively walk the tree of subclasses of a given driver attachment's bus device class detaching all instances of that driver for each class and its subclasses. Reported by: bschmidt Reviewed by: imp MFC after: 1 week Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Mar 1 13:35:48 2011 (r219134) +++ head/sys/kern/subr_bus.c Tue Mar 1 14:43:37 2011 (r219135) @@ -987,10 +987,12 @@ devclass_find(const char *classname) * is called by devclass_add_driver to accomplish the recursive * notification of all the children classes of dc, as well as dc. * Each layer will have BUS_DRIVER_ADDED() called for all instances of - * the devclass. We do a full search here of the devclass list at - * each iteration level to save storing children-lists in the devclass - * structure. If we ever move beyond a few dozen devices doing this, - * we may need to reevaluate... + * the devclass. + * + * We do a full search here of the devclass list at each iteration + * level to save storing children-lists in the devclass structure. If + * we ever move beyond a few dozen devices doing this, we may need to + * reevaluate... * * @param dc the devclass to edit * @param driver the driver that was just added @@ -1085,6 +1087,78 @@ devclass_add_driver(devclass_t dc, drive } /** + * @brief Register that a device driver has been deleted from a devclass + * + * Register that a device driver has been removed from a devclass. + * This is called by devclass_delete_driver to accomplish the + * recursive notification of all the children classes of busclass, as + * well as busclass. Each layer will attempt to detach the driver + * from any devices that are children of the bus's devclass. The function + * will return an error if a device fails to detach. + * + * We do a full search here of the devclass list at each iteration + * level to save storing children-lists in the devclass structure. If + * we ever move beyond a few dozen devices doing this, we may need to + * reevaluate... + * + * @param busclass the devclass of the parent bus + * @param dc the devclass of the driver being deleted + * @param driver the driver being deleted + */ +static int +devclass_driver_deleted(devclass_t busclass, devclass_t dc, driver_t *driver) +{ + devclass_t parent; + device_t dev; + int error, i; + + /* + * Disassociate from any devices. We iterate through all the + * devices in the devclass of the driver and detach any which are + * using the driver and which have a parent in the devclass which + * we are deleting from. + * + * Note that since a driver can be in multiple devclasses, we + * should not detach devices which are not children of devices in + * the affected devclass. + */ + for (i = 0; i < dc->maxunit; i++) { + if (dc->devices[i]) { + dev = dc->devices[i]; + if (dev->driver == driver && dev->parent && + dev->parent->devclass == busclass) { + if ((error = device_detach(dev)) != 0) + return (error); + device_set_driver(dev, NULL); + BUS_PROBE_NOMATCH(dev->parent, dev); + devnomatch(dev); + dev->flags |= DF_DONENOMATCH; + } + } + } + + /* + * Walk through the children classes. Since we only keep a + * single parent pointer around, we walk the entire list of + * devclasses looking for children. We set the + * DC_HAS_CHILDREN flag when a child devclass is created on + * the parent, so we only walk the list for those devclasses + * that have children. + */ + if (!(busclass->flags & DC_HAS_CHILDREN)) + return (0); + parent = busclass; + TAILQ_FOREACH(busclass, &devclasses, link) { + if (busclass->parent == parent) { + error = devclass_driver_deleted(busclass, dc, driver); + if (error) + return (error); + } + } + return (0); +} + +/** * @brief Delete a device driver from a device class * * Delete a device driver from a devclass. This is normally called @@ -1103,8 +1177,6 @@ devclass_delete_driver(devclass_t buscla { devclass_t dc = devclass_find(driver->name); driverlink_t dl; - device_t dev; - int i; int error; PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass))); @@ -1126,30 +1198,9 @@ devclass_delete_driver(devclass_t buscla return (ENOENT); } - /* - * Disassociate from any devices. We iterate through all the - * devices in the devclass of the driver and detach any which are - * using the driver and which have a parent in the devclass which - * we are deleting from. - * - * Note that since a driver can be in multiple devclasses, we - * should not detach devices which are not children of devices in - * the affected devclass. - */ - for (i = 0; i < dc->maxunit; i++) { - if (dc->devices[i]) { - dev = dc->devices[i]; - if (dev->driver == driver && dev->parent && - dev->parent->devclass == busclass) { - if ((error = device_detach(dev)) != 0) - return (error); - device_set_driver(dev, NULL); - BUS_PROBE_NOMATCH(dev->parent, dev); - devnomatch(dev); - dev->flags |= DF_DONENOMATCH; - } - } - } + error = devclass_driver_deleted(busclass, dc, driver); + if (error != 0) + return (error); TAILQ_REMOVE(&busclass->drivers, dl, link); free(dl, M_BUS); From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 14:53:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5141B106566B; Tue, 1 Mar 2011 14:53:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26BC28FC15; Tue, 1 Mar 2011 14:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21ErbhD033337; Tue, 1 Mar 2011 14:53:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21ErbLM033335; Tue, 1 Mar 2011 14:53:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103011453.p21ErbLM033335@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Mar 2011 14:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219136 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 14:53:37 -0000 Author: jhb Date: Tue Mar 1 14:53:36 2011 New Revision: 219136 URL: http://svn.freebsd.org/changeset/base/219136 Log: Use a suitable DIRPRFX for each invocation of make in the build32 and install32 targets so that the full path to each program or library is displayed in the make output. MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Mar 1 14:43:37 2011 (r219135) +++ head/Makefile.inc1 Tue Mar 1 14:53:36 2011 (r219136) @@ -463,36 +463,38 @@ build32: .for _t in obj depend all cd ${.CURDIR}/kerberos5/tools; \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - ${_t} + DIRPRFX=kerberos5/tools/ ${_t} .endfor .endif .for _t in obj includes - cd ${.CURDIR}/include; ${LIB32WMAKE} ${_t} - cd ${.CURDIR}/lib; ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t} + cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t} .if ${MK_CDDL} != "no" - cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t} .endif - cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t} .if ${MK_CRYPT} != "no" - cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t} .endif .if ${MK_KERBEROS} != "no" - cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t} .endif .endfor .for _dir in usr.bin/lex/lib - cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} obj + cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj .endfor .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic cd ${.CURDIR}/${_dir}; \ MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \ - build-tools + DIRPRFX=${_dir}/ build-tools .endfor cd ${.CURDIR}; \ ${LIB32WMAKE} -f Makefile.inc1 libraries .for _t in obj depend all - cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} ${_t} - cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} ${_t} + cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \ + DIRPRFX=libexec/rtld-elf/ ${_t} + cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \ + DIRPRFX=usr.bin/ldd ${_t} .endfor distribute32 install32: From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 14:54:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893DD106566B; Tue, 1 Mar 2011 14:54:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 787698FC15; Tue, 1 Mar 2011 14:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21EsE6f033422; Tue, 1 Mar 2011 14:54:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21EsEqj033420; Tue, 1 Mar 2011 14:54:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201103011454.p21EsEqj033420@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Mar 2011 14:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219137 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 14:54:14 -0000 Author: jhb Date: Tue Mar 1 14:54:14 2011 New Revision: 219137 URL: http://svn.freebsd.org/changeset/base/219137 Log: Fully honor KERNSRCDIR for 'make universe' if it is set. MFC after: 1 week Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Mar 1 14:53:36 2011 (r219136) +++ head/Makefile Tue Mar 1 14:54:14 2011 (r219137) @@ -336,6 +336,7 @@ MAKE_JUST_WORLDS= YES .else UNIVERSE_TARGET?= buildworld .endif +KERNSRCDIR?= ${.CURDIR}/sys targets: @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" @@ -383,8 +384,8 @@ universe_${target}_${target_arch}: unive .endfor .endif .if !defined(MAKE_JUST_WORLDS) -.if exists(${.CURDIR}/sys/${target}/conf/NOTES) - @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ +.if exists(${KERNSRCDIR}/${target}/conf/NOTES) + @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) @@ -398,13 +399,13 @@ universe_kernels: universe_kernconfs .if !defined(TARGET) TARGET!= uname -m .endif -KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ +KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES universe_kernconfs: .for kernel in ${KERNCONFS} -TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ - config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ +TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ + config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ grep -v WARNING: | cut -f 2 .if empty(TARGET_ARCH_${kernel}) .error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 15:13:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31CD2106564A; Tue, 1 Mar 2011 15:13:16 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id D77B48FC13; Tue, 1 Mar 2011 15:13:15 +0000 (UTC) Received: from outgoing.leidinger.net (p5B32E637.dip.t-dialin.net [91.50.230.55]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id BF19D844016; Tue, 1 Mar 2011 15:53:39 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 80FB4210F; Tue, 1 Mar 2011 15:53:36 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p21ErVPo041463; Tue, 1 Mar 2011 15:53:31 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 01 Mar 2011 15:53:30 +0100 Message-ID: <20110301155330.198475yg1cnokx44@webmail.leidinger.net> Date: Tue, 01 Mar 2011 15:53:30 +0100 From: Alexander Leidinger To: Robert Watson References: <201103011323.p21DNbau027743@svn.freebsd.org> In-Reply-To: <201103011323.p21DNbau027743@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: BF19D844016.A6BB9 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.351, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1299596022.01767@t97x9hPlXXpAAbR0EvTtCA X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r219129 - in head/sys: compat/freebsd32 conf kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 15:13:16 -0000 Quoting Robert Watson (from Tue, 1 Mar 2011 13:23:37 +0000 (UTC)): > Author: rwatson > Date: Tue Mar 1 13:23:37 2011 > New Revision: 219129 > URL: http://svn.freebsd.org/changeset/base/219129 > > Log: > Add initial support for Capsicum's Capability Mode to the FreeBSD kernel, > compiled conditionally on options CAPABILITIES: Typo in NOTES. What about adding a FEATURE to sys_capabilities.c, could it be useful? > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Tue Mar 1 13:14:28 2011 (r219128) > +++ head/sys/conf/NOTES Tue Mar 1 13:23:37 2011 (r219129) > @@ -1157,6 +1157,9 @@ options MAC_SEEOTHERUIDS > options MAC_STUB > options MAC_TEST > > +# Support for Capsicum > +options CAPABILIITES > + > > ##################################################################### > # CLOCK OPTIONS > > Added: head/sys/kern/sys_capability.c Bye, Alexander. -- A woman has got to love a bad man once or twice in her life to be thankful for a good one. -- Marjorie Kinnan Rawlings http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 15:21:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F129106564A; Tue, 1 Mar 2011 15:21:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D7EBB8FC16; Tue, 1 Mar 2011 15:21:03 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 89E4746B03; Tue, 1 Mar 2011 10:21:03 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 289708A01B; Tue, 1 Mar 2011 10:21:03 -0500 (EST) From: John Baldwin To: Robert Watson Date: Tue, 1 Mar 2011 10:21:02 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103011323.p21DNbau027743@svn.freebsd.org> In-Reply-To: <201103011323.p21DNbau027743@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103011021.02651.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Mar 2011 10:21:03 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219129 - in head/sys: compat/freebsd32 conf kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 15:21:04 -0000 On Tuesday, March 01, 2011 8:23:37 am Robert Watson wrote: > Author: rwatson > Date: Tue Mar 1 13:23:37 2011 > New Revision: 219129 > URL: http://svn.freebsd.org/changeset/base/219129 > > Log: > Add initial support for Capsicum's Capability Mode to the FreeBSD kernel, > compiled conditionally on options CAPABILITIES: > > Add a new credential flag, CRED_FLAG_CAPMODE, which indicates that a > subject (typically a process) is in capability mode. > > Add two new system calls, cap_enter(2) and cap_getmode(2), which allow > setting and querying (but never clearing) the flag. > > Export the capability mode flag via process information sysctls. > > Sponsored by: Google, Inc. > Reviewed by: anderson > Discussed with: benl, kris, pjd > Obtained from: Capsicum Project > MFC after: 3 months > > Added: > head/sys/kern/sys_capability.c (contents, props changed) > Modified: > head/sys/compat/freebsd32/syscalls.master > head/sys/conf/NOTES > head/sys/conf/options > head/sys/kern/kern_proc.c > head/sys/kern/syscalls.master > head/sys/sys/ucred.h > head/sys/sys/user.h Looks like head/sys/sys/capability.h wasn't added by accident? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 16:42:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 757F31065673; Tue, 1 Mar 2011 16:42:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6374F8FC17; Tue, 1 Mar 2011 16:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21GgTY1041026; Tue, 1 Mar 2011 16:42:29 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21GgTaH041022; Tue, 1 Mar 2011 16:42:29 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103011642.p21GgTaH041022@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 16:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219138 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 16:42:29 -0000 Author: dchagin Date: Tue Mar 1 16:42:28 2011 New Revision: 219138 URL: http://svn.freebsd.org/changeset/base/219138 Log: Teach kdump to decode linux syscalls names too. Fix bug introduced in my previous commit: the kernel always dump native signal numbers, so no need to check the ABI in ktrpsig(). Suggested by: jhb MFC after: 1 Month. Added: head/usr.bin/kdump/linux_syscalls.conf (contents, props changed) Modified: head/usr.bin/kdump/Makefile head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/Makefile ============================================================================== --- head/usr.bin/kdump/Makefile Tue Mar 1 14:54:14 2011 (r219137) +++ head/usr.bin/kdump/Makefile Tue Mar 1 16:42:28 2011 (r219138) @@ -1,15 +1,23 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.if (${MACHINE_ARCH} == "amd64") +SFX= 32 +.endif + .PATH: ${.CURDIR}/../ktrace PROG= kdump SRCS= kdump.c ioctl.c kdump_subr.c subr.c CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +SRCS+= linux_syscalls.c +.endif + WARNS?= 0 -CLEANFILES= ioctl.c kdump_subr.c +CLEANFILES= ioctl.c kdump_subr.c linux_syscalls.c ioctl.c: mkioctls sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET} @@ -17,4 +25,10 @@ ioctl.c: mkioctls kdump_subr.c: mksubr sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET} +linux_syscalls.c: + /bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \ + ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf + echo "int nlinux_syscalls = sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);" \ + >> linux_syscalls.c + .include Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Mar 1 14:54:14 2011 (r219137) +++ head/usr.bin/kdump/kdump.c Tue Mar 1 16:42:28 2011 (r219138) @@ -93,7 +93,7 @@ void ktrnamei(char *, int); void hexdump(char *, int, int); void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); -void ktrpsig(struct ktr_psig *, u_int); +void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); @@ -111,6 +111,41 @@ struct ktr_header ktr_header; #define TIME_FORMAT "%b %e %T %Y" #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) +#define print_number(i,n,c) do { \ + if (decimal) \ + printf("%c%ld", c, (long)*i); \ + else \ + printf("%c%#lx", c, (long)*i); \ + i++; \ + n--; \ + c = ','; \ + } while (0); + +#if defined(__amd64__) || defined(__i386__) + +void linux_ktrsyscall(struct ktr_syscall *); +void linux_ktrsysret(struct ktr_sysret *); +extern char *linux_syscallnames[]; +extern int nlinux_syscalls; + +/* + * from linux.h + * Linux syscalls return negative errno's, we do positive and map them + */ +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 +}; +#endif + struct proc_info { TAILQ_ENTRY(proc_info) info; @@ -233,10 +268,20 @@ main(int argc, char *argv[]) drop_logged = 0; switch (ktr_header.ktr_type) { case KTR_SYSCALL: - ktrsyscall((struct ktr_syscall *)m, sv_flags); +#if defined(__amd64__) || defined(__i386__) + if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX) + linux_ktrsyscall((struct ktr_syscall *)m); + else +#endif + ktrsyscall((struct ktr_syscall *)m, sv_flags); break; case KTR_SYSRET: - ktrsysret((struct ktr_sysret *)m, sv_flags); +#if defined(__amd64__) || defined(__i386__) + if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX) + linux_ktrsysret((struct ktr_sysret *)m); + else +#endif + ktrsysret((struct ktr_sysret *)m, sv_flags); break; case KTR_NAMEI: case KTR_SYSCTL: @@ -246,7 +291,7 @@ main(int argc, char *argv[]) ktrgenio((struct ktr_genio *)m, ktrlen); break; case KTR_PSIG: - ktrpsig((struct ktr_psig *)m, sv_flags); + ktrpsig((struct ktr_psig *)m); break; case KTR_CSW: ktrcsw((struct ktr_csw *)m); @@ -455,17 +500,6 @@ ktrsyscall(struct ktr_syscall *ktr, u_in char c = '('; if (fancy && (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) { - -#define print_number(i,n,c) do { \ - if (decimal) \ - (void)printf("%c%ld", c, (long)*i); \ - else \ - (void)printf("%c%#lx", c, (long)*i); \ - i++; \ - n--; \ - c = ','; \ - } while (0); - if (ktr->ktr_code == SYS_ioctl) { const char *cp; print_number(ip,narg,c); @@ -1093,10 +1127,9 @@ const char *signames[] = { }; void -ktrpsig(struct ktr_psig *psig, u_int flags) +ktrpsig(struct ktr_psig *psig) { - if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD && - psig->signo > 0 && psig->signo < NSIG) + if (psig->signo > 0 && psig->signo < NSIG) (void)printf("SIG%s ", signames[psig->signo]); else (void)printf("SIG %d ", psig->signo); @@ -1471,6 +1504,67 @@ invalid: printf("invalid record\n"); } +#if defined(__amd64__) || defined(__i386__) +void +linux_ktrsyscall(struct ktr_syscall *ktr) +{ + int narg = ktr->ktr_narg; + register_t *ip; + + if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0) + printf("[%d]", ktr->ktr_code); + else + printf("%s", linux_syscallnames[ktr->ktr_code]); + ip = &ktr->ktr_args[0]; + if (narg) { + char c = '('; + while (narg > 0) + print_number(ip, narg, c); + putchar(')'); + } + putchar('\n'); +} + +void +linux_ktrsysret(struct ktr_sysret *ktr) +{ + register_t ret = ktr->ktr_retval; + int error = ktr->ktr_error; + int code = ktr->ktr_code; + + if (code >= nlinux_syscalls || code < 0) + printf("[%d] ", code); + else + printf("%s ", linux_syscallnames[code]); + + if (error == 0) { + if (fancy) { + printf("%ld", (long)ret); + if (ret < 0 || ret > 9) + printf("/%#lx", (long)ret); + } else { + if (decimal) + printf("%ld", (long)ret); + else + printf("%#lx", (long)ret); + } + } else if (error == ERESTART) + printf("RESTART"); + else if (error == EJUSTRETURN) + printf("JUSTRETURN"); + else { + if (ktr->ktr_error <= ELAST + 1) + error = abs(bsd_to_linux_errno[ktr->ktr_error]); + else + error = 999; + printf("-1 errno %d", error); + if (fancy) + printf(" %s", strerror(ktr->ktr_error)); + } + putchar('\n'); +} +#endif + void usage(void) { Added: head/usr.bin/kdump/linux_syscalls.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/kdump/linux_syscalls.conf Tue Mar 1 16:42:28 2011 (r219138) @@ -0,0 +1,11 @@ +# $FreeBSD$ +sysnames="linux_syscalls.c" +sysproto="/dev/null" +sysproto_h=_LINUX_SYSPROTO_H_ +syshdr="/dev/null" +syssw="/dev/null" +sysmk="/dev/null" +syscallprefix="LINUX_SYS_" +switchname="/dev/null" +namesname="linux_syscallnames" +systrace="/dev/null" From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 17:15:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24511065673; Tue, 1 Mar 2011 17:15:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D11788FC14; Tue, 1 Mar 2011 17:15:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21HFiAm043253; Tue, 1 Mar 2011 17:15:44 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21HFiDB043251; Tue, 1 Mar 2011 17:15:44 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201103011715.p21HFiDB043251@svn.freebsd.org> From: Dimitry Andric Date: Tue, 1 Mar 2011 17:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219139 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:15:45 -0000 Author: dim Date: Tue Mar 1 17:15:44 2011 New Revision: 219139 URL: http://svn.freebsd.org/changeset/base/219139 Log: Put in a temporary workaround for ctfmerge hanging on processing kernel.debug (or possibly other files), when WITH_CTF is active. This is caused by a bug in clang's integrated assembler, causing malloc to sometimes hang during initialization in statically linked executables that use threading, such as the copy of ctfmerge that is built during the bootstrap stage of buildworld. The bug has been submitted upstream: http://llvm.org/bugs/show_bug.cgi?id=9352 Note that you might have to rebuild and install libc first, to get your kernel build to finish, because the ctfmerge binary built during bootstrap is linked with your base system's copy of libc.a, which might already contain a bad copy of malloc.o. Modified: head/lib/libc/stdlib/Makefile.inc Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Tue Mar 1 16:42:28 2011 (r219138) +++ head/lib/libc/stdlib/Makefile.inc Tue Mar 1 17:15:44 2011 (r219139) @@ -51,3 +51,7 @@ MLINKS+=tsearch.3 tdelete.3 tsearch.3 tf CFLAGS+= -DMALLOC_PRODUCTION .endif +.if ${CC:T:Mclang} == "clang" +# XXX: Temporary workaround for LLVM PR 9352 +CFLAGS+= ${.IMPSRC:T:Mmalloc.c:C/^.+$/-no-integrated-as/} +.endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 17:37:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93BC4106566C; Tue, 1 Mar 2011 17:37:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 789458FC13; Tue, 1 Mar 2011 17:37:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21Hbwgd044674; Tue, 1 Mar 2011 17:37:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21HbwvX044672; Tue, 1 Mar 2011 17:37:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011737.p21HbwvX044672@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 17:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219140 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:37:58 -0000 Author: rwatson Date: Tue Mar 1 17:37:58 2011 New Revision: 219140 URL: http://svn.freebsd.org/changeset/base/219140 Log: Add Capsicum capability mode support; svn add of capability.h was missed in a previous commit. Whoops! Reported by: jhb Reviewed by: anderson Discussed with: benl, kris, pjd Sponsored by: Google, Inc. Obtained from: Capsicum Project MFC after: 3 months Added: head/sys/sys/capability.h (contents, props changed) Added: head/sys/sys/capability.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/capability.h Tue Mar 1 17:37:58 2011 (r219140) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2008-2010 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, 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. + * + * $FreeBSD$ + */ + +/* + * Definitions for FreeBSD capabilities facility. + */ +#ifndef _SYS_CAPABILITY_H_ +#define _SYS_CAPABILITY_H_ + +#include +#include + +#ifdef _KERNEL + +#define IN_CAPABILITY_MODE(td) (td->td_ucred->cr_flags & CRED_FLAG_CAPMODE) + +#else /* !_KERNEL */ + +__BEGIN_DECLS + +/* + * cap_enter(): Cause the process to enter capability mode, which will + * prevent it from directly accessing global namespaces. System calls will + * be limited to process-local, process-inherited, or file descriptor + * operations. If already in capability mode, a no-op. + * + * Currently, process-inherited operations are not properly handled -- in + * particular, we're interested in things like waitpid(2), kill(2), etc, + * being properly constrained. One possible solution is to introduce process + * descriptors. + */ +int cap_enter(void); + +/* + * cap_getmode(): Are we in capability mode? + */ +int cap_getmode(u_int* modep); + +__END_DECLS + +#endif /* !_KERNEL */ + +#endif /* !_SYS_CAPABILITY_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 17:39:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FCF51065672; Tue, 1 Mar 2011 17:39:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED308FC12; Tue, 1 Mar 2011 17:39:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21HdS6h044793; Tue, 1 Mar 2011 17:39:28 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21HdSr0044791; Tue, 1 Mar 2011 17:39:28 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201103011739.p21HdSr0044791@svn.freebsd.org> From: Robert Watson Date: Tue, 1 Mar 2011 17:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219141 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:39:28 -0000 Author: rwatson Date: Tue Mar 1 17:39:27 2011 New Revision: 219141 URL: http://svn.freebsd.org/changeset/base/219141 Log: Correct spelling in a last-minute tweaked NOTES entry for CAPABILITIES. Submitted by: netchild Sponsored by: Google, Inc. Obtained from: Capsicum Project MFC after: 3 months Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Mar 1 17:37:58 2011 (r219140) +++ head/sys/conf/NOTES Tue Mar 1 17:39:27 2011 (r219141) @@ -1158,7 +1158,7 @@ options MAC_STUB options MAC_TEST # Support for Capsicum -options CAPABILIITES +options CAPABILITIES ##################################################################### From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 17:40:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3504106566C; Tue, 1 Mar 2011 17:40:33 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AD41C8FC0A; Tue, 1 Mar 2011 17:40:33 +0000 (UTC) Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk [128.232.18.47]) by cyrus.watson.org (Postfix) with ESMTPSA id DC7BF46B03; Tue, 1 Mar 2011 12:40:32 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <201103011021.02651.jhb@freebsd.org> Date: Tue, 1 Mar 2011 17:40:31 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <187C8D46-19D1-417F-96C2-6CEB04AD77E4@freebsd.org> References: <201103011323.p21DNbau027743@svn.freebsd.org> <201103011021.02651.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219129 - in head/sys: compat/freebsd32 conf kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:40:33 -0000 On 1 Mar 2011, at 15:21, John Baldwin wrote: > Looks like head/sys/sys/capability.h wasn't added by accident? Indeed -- a classic case of things building fine but a missing svn add = -- thanks! Robert= From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 18:29:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388221065672; Tue, 1 Mar 2011 18:29:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC818FC24; Tue, 1 Mar 2011 18:29:43 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B72AB46B2E; Tue, 1 Mar 2011 13:29:42 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 507148A02A; Tue, 1 Mar 2011 13:29:42 -0500 (EST) From: John Baldwin To: Dmitry Chagin Date: Tue, 1 Mar 2011 13:03:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201103011642.p21GgTaH041022@svn.freebsd.org> In-Reply-To: <201103011642.p21GgTaH041022@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103011303.59905.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 01 Mar 2011 13:29:42 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219138 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 18:29:43 -0000 On Tuesday, March 01, 2011 11:42:29 am Dmitry Chagin wrote: > Author: dchagin > Date: Tue Mar 1 16:42:28 2011 > New Revision: 219138 > URL: http://svn.freebsd.org/changeset/base/219138 > > Log: > Teach kdump to decode linux syscalls names too. > > Fix bug introduced in my previous commit: the kernel always dump native > signal numbers, so no need to check the ABI in ktrpsig(). > > Suggested by: jhb > MFC after: 1 Month. Neat! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 19:01:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id C19C11065670; Tue, 1 Mar 2011 19:01:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 1 Mar 2011 14:01:33 -0500 User-Agent: KMail/1.6.2 References: <201103011715.p21HFiDB043251@svn.freebsd.org> In-Reply-To: <201103011715.p21HFiDB043251@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103011401.36371.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Dimitry Andric Subject: Re: svn commit: r219139 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 19:01:47 -0000 On Tuesday 01 March 2011 12:15 pm, Dimitry Andric wrote: > Author: dim > Date: Tue Mar 1 17:15:44 2011 > New Revision: 219139 > URL: http://svn.freebsd.org/changeset/base/219139 > > Log: > Put in a temporary workaround for ctfmerge hanging on processing > kernel.debug (or possibly other files), when WITH_CTF is active. > > This is caused by a bug in clang's integrated assembler, causing > malloc to sometimes hang during initialization in statically linked > executables that use threading, such as the copy of ctfmerge that > is built during the bootstrap stage of buildworld. The bug has > been submitted upstream: > > http://llvm.org/bugs/show_bug.cgi?id=9352 > > Note that you might have to rebuild and install libc first, to > get your kernel build to finish, because the ctfmerge binary built > during bootstrap is linked with your base system's copy of libc.a, > which might already contain a bad copy of malloc.o. Is this somehow related? http://llvm.org/viewvc/llvm-project?view=rev&revision=126720 Please see #6 in the following thread: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013638.html Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 20:51:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECB90106566B; Tue, 1 Mar 2011 20:51:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB57C8FC19; Tue, 1 Mar 2011 20:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21Kpf0b058717; Tue, 1 Mar 2011 20:51:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21KpfWW058715; Tue, 1 Mar 2011 20:51:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201103012051.p21KpfWW058715@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 1 Mar 2011 20:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219146 - head/sys/modules/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:51:42 -0000 Author: nwhitehorn Date: Tue Mar 1 20:51:41 2011 New Revision: 219146 URL: http://svn.freebsd.org/changeset/base/219146 Log: Fix misuse of TARGET_ARCH. This should be MACHINE_ARCH. Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue Mar 1 20:48:03 2011 (r219145) +++ head/sys/modules/zfs/Makefile Tue Mar 1 20:51:41 2011 (r219146) @@ -85,7 +85,7 @@ CFLAGS+=-I${SUNW}/common CFLAGS+=-I${.CURDIR}/../../../include CFLAGS+=-DBUILDING_ZFS -.if ${TARGET_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "powerpc64" CFLAGS+=-mminimal-toc .endif From owner-svn-src-head@FreeBSD.ORG Tue Mar 1 21:24:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA3E106564A; Tue, 1 Mar 2011 21:24:51 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23A98FC15; Tue, 1 Mar 2011 21:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LOoxc061034; Tue, 1 Mar 2011 21:24:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LOoIW061031; Tue, 1 Mar 2011 21:24:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201103012124.p21LOoIW061031@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 1 Mar 2011 21:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219149 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 21:24:51 -0000 Author: edwin Date: Tue Mar 1 21:24:50 2011 New Revision: 219149 URL: http://svn.freebsd.org/changeset/base/219149 Log: MFV of tzdata2011b, r219147 - USA/Mercer County, North Dakota - Moved from Mountain time to Central time. Modified: head/contrib/tzdata/northamerica head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/northamerica ============================================================================== --- head/contrib/tzdata/northamerica Tue Mar 1 21:20:01 2011 (r219148) +++ head/contrib/tzdata/northamerica Tue Mar 1 21:24:50 2011 (r219149) @@ -1,5 +1,5 @@ #
-# %W%
+# @(#)northamerica	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -346,6 +346,27 @@ Zone America/North_Dakota/New_Salem -6:4
 			-7:00	US	M%sT	2003 Oct 26 02:00
 			-6:00	US	C%sT
 
+# From Josh Findley (2011-01-21):
+# ...it appears that Mercer County, North Dakota, changed from the
+# mountain time zone to the central time zone at the last transition from
+# daylight-saving to standard time (on Nov. 7, 2010):
+# 
+# http://www.gpo.gov/fdsys/pkg/FR-2010-09-29/html/2010-24376.htm
+# 
+# 
+# http://www.bismarcktribune.com/news/local/article_1eb1b588-c758-11df-b472-001cc4c03286.html
+# 
+
+# From Andy Lipscomb (2011-01-24):
+# ...according to the Census Bureau, the largest city is Beulah (although
+# it's commonly referred to as Beulah-Hazen, with Hazen being the next
+# largest city in Mercer County).  Google Maps places Beulah's city hall
+# at 4715'51" north, 10146'40" west, which yields an offset of 6h47'07".
+
+Zone America/North_Dakota/Beulah -6:47:07 - LMT 1883 Nov 18 12:12:53
+			-7:00	US	M%sT	2010 Nov  7 2:00
+			-6:00	US	C%sT
+
 # US mountain time, represented by Denver
 #
 # Colorado, far western Kansas, Montana, western

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Tue Mar  1 21:20:01 2011	(r219148)
+++ head/contrib/tzdata/zone.tab	Tue Mar  1 21:24:50 2011	(r219149)
@@ -1,5 +1,5 @@
 # 
-# @(#)zone.tab	8.38
+# @(#)zone.tab	8.40
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
@@ -211,8 +211,8 @@ HT	+1832-07220	America/Port-au-Prince
 HU	+4730+01905	Europe/Budapest
 ID	-0610+10648	Asia/Jakarta	Java & Sumatra
 ID	-0002+10920	Asia/Pontianak	west & central Borneo
-ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
+ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
+ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
 IL	+3146+03514	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
@@ -404,6 +404,7 @@ US	+411745-0863730	America/Indiana/Knox	
 US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
 US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
 US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
+US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
 US	+394421-1045903	America/Denver	Mountain Time
 US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
 US	+364708-1084111	America/Shiprock	Mountain Time - Navajo

From owner-svn-src-head@FreeBSD.ORG  Tue Mar  1 21:47:06 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 71F93106566C;
	Tue,  1 Mar 2011 21:47:06 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 60F838FC14;
	Tue,  1 Mar 2011 21:47:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21Ll61D062817;
	Tue, 1 Mar 2011 21:47:06 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21Ll6OV062815;
	Tue, 1 Mar 2011 21:47:06 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103012147.p21Ll6OV062815@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 1 Mar 2011 21:47:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219153 - head/usr.bin/printf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:47:06 -0000

Author: jilles
Date: Tue Mar  1 21:47:06 2011
New Revision: 219153
URL: http://svn.freebsd.org/changeset/base/219153

Log:
  printf: Note that this is used both as a normal program and a shell builtin.

Modified:
  head/usr.bin/printf/printf.c

Modified: head/usr.bin/printf/printf.c
==============================================================================
--- head/usr.bin/printf/printf.c	Tue Mar  1 21:29:16 2011	(r219152)
+++ head/usr.bin/printf/printf.c	Tue Mar  1 21:47:06 2011	(r219153)
@@ -26,6 +26,10 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+/*
+ * Important: This file is used both as a standalone program /usr/bin/printf
+ * and as a builtin for /bin/sh (#define SHELL).
+ */
 
 #ifndef SHELL
 #ifndef lint

From owner-svn-src-head@FreeBSD.ORG  Tue Mar  1 21:48:22 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B0A51065672;
	Tue,  1 Mar 2011 21:48:22 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A1A78FC12;
	Tue,  1 Mar 2011 21:48:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p21LmMd7062947;
	Tue, 1 Mar 2011 21:48:22 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LmMVs062945;
	Tue, 1 Mar 2011 21:48:22 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103012148.p21LmMVs062945@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Tue, 1 Mar 2011 21:48:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219154 - head/bin/kill
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:48:22 -0000

Author: jilles
Date: Tue Mar  1 21:48:22 2011
New Revision: 219154
URL: http://svn.freebsd.org/changeset/base/219154

Log:
  kill: Note that this is used both as a normal program and a shell builtin.

Modified:
  head/bin/kill/kill.c

Modified: head/bin/kill/kill.c
==============================================================================
--- head/bin/kill/kill.c	Tue Mar  1 21:47:06 2011	(r219153)
+++ head/bin/kill/kill.c	Tue Mar  1 21:48:22 2011	(r219154)
@@ -26,6 +26,10 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+/*
+ * Important: This file is used both as a standalone program /bin/kill and
+ * as a builtin for /bin/sh (#define SHELL).
+ */
 
 #if 0
 #ifndef lint

From owner-svn-src-head@FreeBSD.ORG  Tue Mar  1 22:44:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 948251065673;
	Tue,  1 Mar 2011 22:44:43 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net
	[IPv6:2001:7b8:2ff:146::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 543E18FC14;
	Tue,  1 Mar 2011 22:44:43 +0000 (UTC)
Received: from [IPv6:2001:7b8:3a7:0:348f:5488:ad29:7fa] (unknown
	[IPv6:2001:7b8:3a7:0:348f:5488:ad29:7fa])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tensor.andric.com (Postfix) with ESMTPSA id CBC9E5C59;
	Tue,  1 Mar 2011 23:44:37 +0100 (CET)
Message-ID: <4D6D76DB.7030307@FreeBSD.org>
Date: Tue, 01 Mar 2011 23:44:43 +0100
From: Dimitry Andric 
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
	rv:1.9.2.15pre) Gecko/20110227 Lanikai/3.1.9pre
MIME-Version: 1.0
To: Jung-uk Kim 
References: <201103011715.p21HFiDB043251@svn.freebsd.org>
	<201103011401.36371.jkim@FreeBSD.org>
In-Reply-To: <201103011401.36371.jkim@FreeBSD.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219139 - head/lib/libc/stdlib
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 22:44:43 -0000

On 2011-03-01 20:01, Jung-uk Kim wrote:
...
>>    This is caused by a bug in clang's integrated assembler, causing
>> malloc to sometimes hang during initialization in statically linked
>> executables that use threading, such as the copy of ctfmerge that
>> is built during the bootstrap stage of buildworld.  The bug has
>> been submitted upstream:
>>
>>      http://llvm.org/bugs/show_bug.cgi?id=9352
...
> Is this somehow related?
>
> http://llvm.org/viewvc/llvm-project?view=rev&revision=126720
>
> Please see #6 in the following thread:
>
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013638.html

Yes, I already tried that fix, but it didn't work for this particular
issue.  In the PR you can see I tested with clang r126742, which already
contained the fix, but it still produces an incorrect result.

Note that usually this kind of problem is fixed pretty fast, the more so
since llvm/clang is going to branch for 2.9 soon (March 6th). :)

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 00:24:08 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E13101065670;
	Wed,  2 Mar 2011 00:24:07 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D0D148FC08;
	Wed,  2 Mar 2011 00:24:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p220O7PJ071479;
	Wed, 2 Mar 2011 00:24:07 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p220O7Yg071477;
	Wed, 2 Mar 2011 00:24:07 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <201103020024.p220O7Yg071477@svn.freebsd.org>
From: Alan Cox 
Date: Wed, 2 Mar 2011 00:24:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219157 - head/sys/amd64/amd64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 00:24:08 -0000

Author: alc
Date: Wed Mar  2 00:24:07 2011
New Revision: 219157
URL: http://svn.freebsd.org/changeset/base/219157

Log:
  Make a change to the implementation of the direct map to improve performance
  on processors that support 1 GB pages.  Specifically, if the end of physical
  memory is not aligned to a 1 GB page boundary, then map the residual
  physical memory with multiple 2 MB page mappings rather than a single 1 GB
  page mapping.  When a 1 GB page mapping is used for this residual memory,
  access to the memory is slower than when multiple 2 MB page mappings are
  used.  (I suspect that the reason for this slowdown is that the TLB is
  actually being loaded with 4 KB page mappings for the residual memory.)
  
  X-MFC after:	r214425

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Tue Mar  1 21:52:24 2011	(r219156)
+++ head/sys/amd64/amd64/pmap.c	Wed Mar  2 00:24:07 2011	(r219157)
@@ -457,7 +457,7 @@ CTASSERT(powerof2(NDMPML4E));
 static void
 create_pagetables(vm_paddr_t *firstaddr)
 {
-	int i;
+	int i, j, ndm1g;
 
 	/* Allocate pages */
 	KPTphys = allocpages(firstaddr, NKPT);
@@ -469,8 +469,11 @@ create_pagetables(vm_paddr_t *firstaddr)
 	if (ndmpdp < 4)		/* Minimum 4GB of dirmap */
 		ndmpdp = 4;
 	DMPDPphys = allocpages(firstaddr, NDMPML4E);
-	if ((amd_feature & AMDID_PAGE1GB) == 0)
-		DMPDphys = allocpages(firstaddr, ndmpdp);
+	ndm1g = 0;
+	if ((amd_feature & AMDID_PAGE1GB) != 0)
+		ndm1g = ptoa(Maxmem) >> PDPSHIFT;
+	if (ndm1g < ndmpdp)
+		DMPDphys = allocpages(firstaddr, ndmpdp - ndm1g);
 	dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT;
 
 	/* Fill in the underlying page table pages */
@@ -502,32 +505,28 @@ create_pagetables(vm_paddr_t *firstaddr)
 	}
 
 	/*
-	 * Now, set up the direct map region using either 2MB or 1GB pages.
-	 * Later, if pmap_mapdev{_attr}() uses the direct map for non-write-
-	 * back memory, pmap_change_attr() will demote any 2MB or 1GB page
-	 * mappings that are partially used.
-	 */
-	if ((amd_feature & AMDID_PAGE1GB) == 0) {
-		for (i = 0; i < NPDEPG * ndmpdp; i++) {
-			((pd_entry_t *)DMPDphys)[i] = (vm_paddr_t)i << PDRSHIFT;
-			/* Preset PG_M and PG_A because demotion expects it. */
-			((pd_entry_t *)DMPDphys)[i] |= PG_RW | PG_V | PG_PS |
-			    PG_G | PG_M | PG_A;
-		}
-		/* And the direct map space's PDP */
-		for (i = 0; i < ndmpdp; i++) {
-			((pdp_entry_t *)DMPDPphys)[i] = DMPDphys +
-			    (i << PAGE_SHIFT);
-			((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_U;
-		}
-	} else {
-		for (i = 0; i < ndmpdp; i++) {
-			((pdp_entry_t *)DMPDPphys)[i] =
-			    (vm_paddr_t)i << PDPSHIFT;
-			/* Preset PG_M and PG_A because demotion expects it. */
-			((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_PS |
-			    PG_G | PG_M | PG_A;
-		}
+	 * Now, set up the direct map region using 2MB and/or 1GB pages.  If
+	 * the end of physical memory is not aligned to a 1GB page boundary,
+	 * then the residual physical memory is mapped with 2MB pages.  Later,
+	 * if pmap_mapdev{_attr}() uses the direct map for non-write-back
+	 * memory, pmap_change_attr() will demote any 2MB or 1GB page mappings
+	 * that are partially used. 
+	 */
+	for (i = NPDEPG * ndm1g, j = 0; i < NPDEPG * ndmpdp; i++, j++) {
+		((pd_entry_t *)DMPDphys)[j] = (vm_paddr_t)i << PDRSHIFT;
+		/* Preset PG_M and PG_A because demotion expects it. */
+		((pd_entry_t *)DMPDphys)[j] |= PG_RW | PG_V | PG_PS | PG_G |
+		    PG_M | PG_A;
+	}
+	for (i = 0; i < ndm1g; i++) {
+		((pdp_entry_t *)DMPDPphys)[i] = (vm_paddr_t)i << PDPSHIFT;
+		/* Preset PG_M and PG_A because demotion expects it. */
+		((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_PS | PG_G |
+		    PG_M | PG_A;
+	}
+	for (j = 0; i < ndmpdp; i++, j++) {
+		((pdp_entry_t *)DMPDPphys)[i] = DMPDphys + (j << PAGE_SHIFT);
+		((pdp_entry_t *)DMPDPphys)[i] |= PG_RW | PG_V | PG_U;
 	}
 
 	/* And recursively map PML4 to itself in order to get PTmap */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 00:29:14 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC2CE1065670;
	Wed,  2 Mar 2011 00:29:14 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CC0778FC15;
	Wed,  2 Mar 2011 00:29:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p220TEb6071745;
	Wed, 2 Mar 2011 00:29:14 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p220TEmq071743;
	Wed, 2 Mar 2011 00:29:14 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201103020029.p220TEmq071743@svn.freebsd.org>
From: Xin LI 
Date: Wed, 2 Mar 2011 00:29:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219158 - head/usr.sbin/faithd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 00:29:15 -0000

Author: delphij
Date: Wed Mar  2 00:29:14 2011
New Revision: 219158
URL: http://svn.freebsd.org/changeset/base/219158

Log:
  Correct a typo.
  
  PR:		bin/155175
  Submitted by:	Peter J. Philipp 
  MFC after:	3 days

Modified:
  head/usr.sbin/faithd/faithd.c

Modified: head/usr.sbin/faithd/faithd.c
==============================================================================
--- head/usr.sbin/faithd/faithd.c	Wed Mar  2 00:24:07 2011	(r219157)
+++ head/usr.sbin/faithd/faithd.c	Wed Mar  2 00:29:14 2011	(r219158)
@@ -340,7 +340,7 @@ daemon_main(int argc, char **argv)
 	snprintf(logname, sizeof(logname), "faithd %s", service);
 	snprintf(procname, sizeof(procname), "accepting port %s", service);
 	openlog(logname, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
-	syslog(LOG_INFO, "Staring faith daemon for %s port", service);
+	syslog(LOG_INFO, "Starting faith daemon for %s port", service);
 
 	play_service(s_wld);
 	/* NOTREACHED */

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 09:30:46 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76424106566B;
	Wed,  2 Mar 2011 09:30:46 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 278FF8FC16;
	Wed,  2 Mar 2011 09:30:45 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B32E950.dip.t-dialin.net
	[91.50.233.80])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 01D25844015;
	Wed,  2 Mar 2011 10:30:40 +0100 (CET)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 9E70D21F6;
	Wed,  2 Mar 2011 10:30:36 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p229UV5m004288;
	Wed, 2 Mar 2011 10:30:31 +0100 (CET)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Wed, 02 Mar 2011
	10:30:31 +0100
Message-ID: <20110302103031.30608fh7u33h3s54@webmail.leidinger.net>
Date: Wed, 02 Mar 2011 10:30:31 +0100
From: Alexander Leidinger 
To: Dmitry Chagin 
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
In-Reply-To: <201103011642.p21GgTaH041022@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: 01D25844015.A76AF
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=1.351, required 6,
	autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08)
X-EBL-MailScanner-SpamScore: s
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1299663043.04602@nXmY8q2JV7y0EgoyKox0SA
X-EBL-Spam-Status: No
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 09:30:46 -0000

Quoting Dmitry Chagin  (from Tue, 1 Mar 2011  
16:42:29 +0000 (UTC)):

> Author: dchagin
> Date: Tue Mar  1 16:42:28 2011
> New Revision: 219138
> URL: http://svn.freebsd.org/changeset/base/219138
>
> Log:
>   Teach kdump to decode linux syscalls names too.

> Modified: head/usr.bin/kdump/kdump.c
> ==============================================================================
> --- head/usr.bin/kdump/kdump.c	Tue Mar  1 14:54:14 2011	(r219137)
> +++ head/usr.bin/kdump/kdump.c	Tue Mar  1 16:42:28 2011	(r219138)

> +/*
> + * from linux.h
> + * Linux syscalls return negative errno's, we do positive and map them
> + */
> +static int bsd_to_linux_errno[ELAST + 1] = {
> +	-0,  -1,  -2,  -3,  -4,  -5,  -6,  -7,  -8,  -9,

Can you please specify the full path within SRC for the linux.h you  
copied this from, and also add a comment to this linux.h to tell to  
not forget to update kdump.c if this is updated (or seperate this into  
another header and include it here)?

Bye,
Alexander.

-- 
Committee, n.:
	A group of men who individually can do nothing but as a group
	decide that nothing can be done.
		-- Fred Allen

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 11:04:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E6E1106566C;
	Wed,  2 Mar 2011 11:04:50 +0000 (UTC) (envelope-from osa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6D72D8FC14;
	Wed,  2 Mar 2011 11:04:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22B4oSu098837;
	Wed, 2 Mar 2011 11:04:50 GMT (envelope-from osa@svn.freebsd.org)
Received: (from osa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22B4oln098835;
	Wed, 2 Mar 2011 11:04:50 GMT (envelope-from osa@svn.freebsd.org)
Message-Id: <201103021104.p22B4oln098835@svn.freebsd.org>
From: "Sergey A. Osokin" 
Date: Wed, 2 Mar 2011 11:04:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219174 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 11:04:50 -0000

Author: osa (ports committer)
Date: Wed Mar  2 11:04:50 2011
New Revision: 219174
URL: http://svn.freebsd.org/changeset/base/219174

Log:
  Fix beginning day of the Carnival. it starts

Modified:
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan   (contents, props changed)

Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan
==============================================================================
--- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan	Wed Mar  2 09:53:13 2011	(r219173)
+++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan	Wed Mar  2 11:04:50 2011	(r219174)
@@ -17,7 +17,7 @@ Paskha=ðÁÓÈÁ
 29 ÆÅ×	äÅÎØ ëÁÝÅÑ
  1 ÍÁÒ	äÅÎØ íÁÒÅÎÙ
 14 ÍÁÒ	îÏ×ÙÊ çÏÄ, ï×ÓÅÎØ ÍÁÌÙÊ
-ðÁÓÈÁ-47	íÁÓÌÅÎÉÃÁ
+ðÁÓÈÁ-55	íÁÓÌÅÎÉÃÁ
 ðÁÓÈÁ+7	ëÒÁÓÎÁÑ çÏÒËÁ
 ðÁÓÈÁ+16	òÁÄÕÎÉÃÁ
 20 ÍÁÒ*	÷ÅÓÅÎÎÉÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 11:09:34 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79389106564A;
	Wed,  2 Mar 2011 11:09:34 +0000 (UTC) (envelope-from osa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 680CE8FC13;
	Wed,  2 Mar 2011 11:09:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22B9Yme099089;
	Wed, 2 Mar 2011 11:09:34 GMT (envelope-from osa@svn.freebsd.org)
Received: (from osa@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22B9Y81099087;
	Wed, 2 Mar 2011 11:09:34 GMT (envelope-from osa@svn.freebsd.org)
Message-Id: <201103021109.p22B9Y81099087@svn.freebsd.org>
From: "Sergey A. Osokin" 
Date: Wed, 2 Mar 2011 11:09:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219175 - head/usr.bin/calendar/calendars/ru_RU.KOI8-R
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 11:09:34 -0000

Author: osa (ports committer)
Date: Wed Mar  2 11:09:34 2011
New Revision: 219175
URL: http://svn.freebsd.org/changeset/base/219175

Log:
  Expand the name of Palm Sunday holiday with more canonical Entry of the
  Lord into Jerusalem.
  Merge the Pentecost and Trinity Sunday holidays, they are synonyms.
  Remove Body of Christ day, nonexistent holiday for Orthodox Church.
  Fix typo in the name of Ioann The Baptist, introduced in previous commit.

Modified:
  head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox

Modified: head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox
==============================================================================
--- head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox	Wed Mar  2 11:04:50 2011	(r219174)
+++ head/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox	Wed Mar  2 11:09:34 2011	(r219175)
@@ -19,16 +19,14 @@ Paskha=ðÁÓÈÁ
 19 ÑÎ×	âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ
 15 ÆÅ×	óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ
 ðÁÓÈÁ-48	÷ÅÌÉËÉÊ ðÏÓÔ
-ðÁÓÈÁ-7	÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ
+ðÁÓÈÁ-7	÷ÈÏÄ çÏÓÐÏÄÅÎØ × éÅÒÕÓÁÌÉÍ. ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ
 ðÁÓÈÁ-3	÷ÅÌÉËÉÊ þÅÔ×ÅÒÇ
 ðÁÓÈÁ-2	óÔÒÁÓÔÎÁÑ ðÑÔÎÉÃÁ
 ðÁÓÈÁ	÷ÏÓËÒÅÓÅÎÉÅ èÒÉÓÔÏ×Ï
 ðÁÓÈÁ+39	÷ÏÚÎÅÓÅÎÉÅ
-ðÁÓÈÁ+49	ðÑÔÉÄÅÓÑÔÎÉÃÁ
-ðÁÓÈÁ+56	ôÒÏÉÃÉÎ äÅÎØ
-ðÁÓÈÁ+60	ðÒÁÚÄÎÉË ôÅÌÁ èÒÉÓÔÏ×Á
+ðÁÓÈÁ+49	äÅÎØ ó×ÑÔÏÊ ôÒÏÉÃÙ. ðÑÔÉÄÅÓÑÔÎÉÃÁ
  7 ÁÐÒ	âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ
- 7 ÉÀÌ	òÏÖÄÅÓÔ×Ï éÏÎÎÁ ðÒÅÄÔÅÞÉ
+ 7 ÉÀÌ	òÏÖÄÅÓÔ×Ï éÏÁÎÎÁ ðÒÅÄÔÅÞÉ
 12 ÉÀÌ	äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ
 19 Á×Ç	ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ
 28 Á×Ç	õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 14:39:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CF45F1065672;
	Wed,  2 Mar 2011 14:39:26 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BCA228FC13;
	Wed,  2 Mar 2011 14:39:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22EdQEQ015429;
	Wed, 2 Mar 2011 14:39:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22EdQsU015424;
	Wed, 2 Mar 2011 14:39:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103021439.p22EdQsU015424@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 2 Mar 2011 14:39:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219177 - in head: . games release release/scripts
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 14:39:26 -0000

Author: nwhitehorn
Date: Wed Mar  2 14:39:26 2011
New Revision: 219177
URL: http://svn.freebsd.org/changeset/base/219177

Log:
  Improve the distributeworld target in Makefile.inc1 and update the release
  infrastructure to use it. make distributeworld can now be used without
  preparing its environment first and installs games into its distribution
  using the regular make distribute logic instead of post-processing with
  a script.
  
  Also add two new targets, packageworld and packagekernel, that tar up the
  results of distributeworld and distributekernel (also new), respectively.

Deleted:
  head/release/scripts/games-make.sh
  head/release/scripts/lib32-make.sh
Modified:
  head/Makefile
  head/Makefile.inc1
  head/games/Makefile.inc
  head/release/Makefile

Modified: head/Makefile
==============================================================================
--- head/Makefile	Wed Mar  2 13:06:47 2011	(r219176)
+++ head/Makefile	Wed Mar  2 14:39:26 2011	(r219177)
@@ -89,9 +89,11 @@ TGTS=	all all-man buildenv buildenvvars 
 	check-old check-old-dirs check-old-files check-old-libs \
 	checkdpadd clean cleandepend cleandir \
 	delete-old delete-old-dirs delete-old-files delete-old-libs \
-	depend distribute distributeworld distrib-dirs distribution doxygen \
+	depend distribute distributekernel distributekernel.debug \
+	distributeworld distrib-dirs distribution doxygen \
 	everything hierarchy install installcheck installkernel \
-	installkernel.debug reinstallkernel reinstallkernel.debug \
+	installkernel.debug packagekernel packageworld \
+	reinstallkernel reinstallkernel.debug \
 	installworld kernel-toolchain libraries lint maninstall \
 	obj objlink regress rerelease showconfig tags toolchain update \
 	_worldtmp _legacy _bootstrap-tools _cleanobj _obj \

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Mar  2 13:06:47 2011	(r219176)
+++ head/Makefile.inc1	Wed Mar  2 14:39:26 2011	(r219177)
@@ -631,6 +631,13 @@ ITOOLS=	[ awk cap_mkdb cat chflags chmod
 #
 # Installs everything compiled by a 'buildworld'.
 #
+
+# Non-base distributions produced by the base system
+EXTRA_DISTRIBUTIONS=	doc games
+.if defined(LIB32TMP) && ${MK_LIB32} != "no"
+EXTRA_DISTRIBUTIONS+=	lib32
+.endif
+
 distributeworld installworld: installcheck
 	mkdir -p ${INSTALLTMP}
 	progs=$$(for prog in ${ITOOLS}; do \
@@ -653,8 +660,33 @@ distributeworld installworld: installche
 	    done); \
 	cp $$libs $$progs ${INSTALLTMP}
 	cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
+.if make(distributeworld)
+.for dist in ${EXTRA_DISTRIBUTIONS}
+	-mkdir ${DESTDIR}/${DISTDIR}/${dist}
+	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
+	    -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
+	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
+	    -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
+	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
+	    -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
+.endfor
+	-mkdir ${DESTDIR}/${DISTDIR}/base
+	${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \
+	    DESTDIR=${DESTDIR}/${DISTDIR}/base
+.endif
 	${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
 	    ${IMAKEENV} rm -rf ${INSTALLTMP}
+.if make(distributeworld)
+.for dist in ${EXTRA_DISTRIBUTIONS}
+	find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete
+.endfor
+.endif
+
+packageworld:
+.for dist in base ${EXTRA_DISTRIBUTIONS}
+	${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
+	    tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz .
+.endfor
 
 #
 # reinstall
@@ -840,6 +872,20 @@ reinstallkernel reinstallkernel.debug: i
 	    ${CROSSENV} PATH=${TMPPATH} \
 	    ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
 
+distributekernel distributekernel.debug:
+.if empty(INSTALLKERNEL)
+	@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
+	false
+.endif
+	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
+	    ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
+	    DESTDIR=${DESTDIR}/${DISTDIR}/kernel \
+	    ${.TARGET:S/distributekernel/install/}
+
+packagekernel:
+	${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \
+	    tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
+
 #
 # doxygen
 #

Modified: head/games/Makefile.inc
==============================================================================
--- head/games/Makefile.inc	Wed Mar  2 13:06:47 2011	(r219176)
+++ head/games/Makefile.inc	Wed Mar  2 14:39:26 2011	(r219177)
@@ -4,3 +4,4 @@
 BINDIR?=	/usr/games
 FILESDIR?=	${SHAREDIR}/games
 WARNS?=		6
+DISTRIBUTION?=	games

Modified: head/release/Makefile
==============================================================================
--- head/release/Makefile	Wed Mar  2 13:06:47 2011	(r219176)
+++ head/release/Makefile	Wed Mar  2 14:39:26 2011	(r219177)
@@ -194,8 +194,8 @@ DIST_DOCS_ARCH_DEP=	
 # Things which without too much trouble can be considered variables
 # BASE_DISTS are special in that they get full /etc installation sets.
 #
-OTHER_DISTS?=	catpages manpages games proflibs dict info doc ${ARCH_DISTS}
-BASE_DISTS?=	base
+OTHER_DISTS?=	catpages manpages proflibs dict info
+BASE_DISTS?=	base doc games ${ARCH_DISTS}
 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
 ARCH_DISTS?=	lib32
 .endif
@@ -647,9 +647,7 @@ release.1:
 		mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
 		    -p ${RD}/trees/$$i/usr > /dev/null && \
 		mtree -deU -f ${MTREEFILES}/BSD.include.dist \
-		    -p ${RD}/trees/$$i/usr/include > /dev/null && \
-		mtree -deU -f ${MTREEFILES}/BSD.var.dist \
-		    -p ${RD}/trees/$$i/var > /dev/null ; \
+		    -p ${RD}/trees/$$i/usr/include > /dev/null; \
 	done
 	mkdir ${RD}/kernels
 	for i in ${KERNELS_BASE} ${KERNELS}; do \

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 14:56:58 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 660EC106564A;
	Wed,  2 Mar 2011 14:56:58 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 545518FC1A;
	Wed,  2 Mar 2011 14:56:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Euw23016653;
	Wed, 2 Mar 2011 14:56:58 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22EuwNf016650;
	Wed, 2 Mar 2011 14:56:58 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103021456.p22EuwNf016650@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 2 Mar 2011 14:56:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219178 - head/sys/crypto/aesni
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 14:56:58 -0000

Author: kib
Date: Wed Mar  2 14:56:58 2011
New Revision: 219178
URL: http://svn.freebsd.org/changeset/base/219178

Log:
  Fix a bug in the result of manual assembly.
  
  Reported by:	Stefan Grundmann 
  PR:	kern/155118
  MFC after:	3 days

Modified:
  head/sys/crypto/aesni/aeskeys_amd64.S
  head/sys/crypto/aesni/aeskeys_i386.S

Modified: head/sys/crypto/aesni/aeskeys_amd64.S
==============================================================================
--- head/sys/crypto/aesni/aeskeys_amd64.S	Wed Mar  2 14:39:26 2011	(r219177)
+++ head/sys/crypto/aesni/aeskeys_amd64.S	Wed Mar  2 14:56:58 2011	(r219178)
@@ -162,7 +162,7 @@ ENTRY(aesni_set_enckey)
 	.byte	0x66,0x0f,0x3a,0xdf,0xc8,0x20
 	call	_key_expansion_256b
 //	aeskeygenassist $0x40,%xmm2,%xmm1	# round 7
-	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x20
+	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x40
 	call	_key_expansion_256a
 	retq
 .Lenc_key192:

Modified: head/sys/crypto/aesni/aeskeys_i386.S
==============================================================================
--- head/sys/crypto/aesni/aeskeys_i386.S	Wed Mar  2 14:39:26 2011	(r219177)
+++ head/sys/crypto/aesni/aeskeys_i386.S	Wed Mar  2 14:56:58 2011	(r219178)
@@ -167,7 +167,7 @@ ENTRY(aesni_set_enckey)
 	.byte	0x66,0x0f,0x3a,0xdf,0xc8,0x20
 	call	_key_expansion_256b
 //	aeskeygenassist $0x40,%xmm2,%xmm1	# round 7
-	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x20
+	.byte	0x66,0x0f,0x3a,0xdf,0xca,0x40
 	call	_key_expansion_256a
 	.cfi_adjust_cfa_offset -4
 	leave

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 15:41:01 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0106B1065674;
	Wed,  2 Mar 2011 15:41:01 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E2C548FC14;
	Wed,  2 Mar 2011 15:41:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Ff0p2019038;
	Wed, 2 Mar 2011 15:41:00 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Ff0HB019036;
	Wed, 2 Mar 2011 15:41:00 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103021541.p22Ff0HB019036@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 2 Mar 2011 15:41:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219179 - head/usr.sbin/bsdinstall/scripts
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 15:41:01 -0000

Author: nwhitehorn
Date: Wed Mar  2 15:41:00 2011
New Revision: 219179
URL: http://svn.freebsd.org/changeset/base/219179

Log:
  Make installations work when no optional components are selected.

Modified:
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/scripts/auto
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/auto	Wed Mar  2 14:56:58 2011	(r219178)
+++ head/usr.sbin/bsdinstall/scripts/auto	Wed Mar  2 15:41:00 2011	(r219179)
@@ -66,7 +66,7 @@ EXTRA_DISTS=$(echo $DISTMENU | xargs dia
     --checklist "Choose optional system components to install:" \
     0 0 0 \
 2>&1 1>&3)
-DISTRIBUTIONS="base.txz kernel.txz"
+export DISTRIBUTIONS="base.txz kernel.txz"
 for dist in $EXTRA_DISTS; do
 	export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz"
 done

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 16:03:19 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C650D1065674;
	Wed,  2 Mar 2011 16:03:19 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B2EA78FC1C;
	Wed,  2 Mar 2011 16:03:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22G3JrB020106;
	Wed, 2 Mar 2011 16:03:19 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22G3JrD020100;
	Wed, 2 Mar 2011 16:03:19 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103021603.p22G3JrD020100@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 2 Mar 2011 16:03:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219180 - in head/sys: conf dev/ath modules/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 16:03:19 -0000

Author: adrian
Date: Wed Mar  2 16:03:19 2011
New Revision: 219180
URL: http://svn.freebsd.org/changeset/base/219180

Log:
  Migrate the sysctl related routines (statistics, debugging, etc) out of
  if_ath.c and into if_ath_sysctl.c .

Added:
  head/sys/dev/ath/if_ath_sysctl.c   (contents, props changed)
  head/sys/dev/ath/if_ath_sysctl.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/modules/ath/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Mar  2 15:41:00 2011	(r219179)
+++ head/sys/conf/files	Wed Mar  2 16:03:19 2011	(r219180)
@@ -578,6 +578,8 @@ dev/ath/if_ath_tx.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx_ht.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath_sysctl.c		optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_pci.c		optional ath pci \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/ah_osdep.c		optional ath \

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Wed Mar  2 15:41:00 2011	(r219179)
+++ head/sys/dev/ath/if_ath.c	Wed Mar  2 16:03:19 2011	(r219180)
@@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef ATH_TX99_DIAG
 #include 
@@ -122,7 +123,6 @@ static void	ath_init(void *);
 static void	ath_stop_locked(struct ifnet *);
 static void	ath_stop(struct ifnet *);
 static void	ath_start(struct ifnet *);
-static int	ath_reset(struct ifnet *);
 static int	ath_reset_vap(struct ieee80211vap *, u_long);
 static int	ath_media_change(struct ifnet *);
 static void	ath_watchdog(void *);
@@ -204,9 +204,7 @@ static void	ath_led_event(struct ath_sof
 static int	ath_rate_setup(struct ath_softc *, u_int mode);
 static void	ath_setcurmode(struct ath_softc *, enum ieee80211_phymode);
 
-static void	ath_sysctlattach(struct ath_softc *);
 static void	ath_announce(struct ath_softc *);
-static void	ath_sysctl_stats_attach(struct ath_softc *sc);
 
 #ifdef IEEE80211_SUPPORT_TDMA
 static void	ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt,
@@ -1650,7 +1648,7 @@ ath_stop(struct ifnet *ifp)
  * operational state.  Used to recover from various errors and
  * to reset or reload hardware state.
  */
-static int
+int
 ath_reset(struct ifnet *ifp)
 {
 	struct ath_softc *sc = ifp->if_softc;
@@ -5614,391 +5612,6 @@ ath_ioctl(struct ifnet *ifp, u_long cmd,
 #undef IS_RUNNING
 }
 
-static int
-ath_sysctl_slottime(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int slottime = ath_hal_getslottime(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &slottime, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_setslottime(sc->sc_ah, slottime) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_acktimeout(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int acktimeout = ath_hal_getacktimeout(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &acktimeout, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_ctstimeout(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int ctstimeout = ath_hal_getctstimeout(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &ctstimeout, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_softled(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	int softled = sc->sc_softled;
-	int error;
-
-	error = sysctl_handle_int(oidp, &softled, 0, req);
-	if (error || !req->newptr)
-		return error;
-	softled = (softled != 0);
-	if (softled != sc->sc_softled) {
-		if (softled) {
-			/* NB: handle any sc_ledpin change */
-			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
-			    HAL_GPIO_MUX_MAC_NETWORK_LED);
-			ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
-				!sc->sc_ledon);
-		}
-		sc->sc_softled = softled;
-	}
-	return 0;
-}
-
-static int
-ath_sysctl_ledpin(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	int ledpin = sc->sc_ledpin;
-	int error;
-
-	error = sysctl_handle_int(oidp, &ledpin, 0, req);
-	if (error || !req->newptr)
-		return error;
-	if (ledpin != sc->sc_ledpin) {
-		sc->sc_ledpin = ledpin;
-		if (sc->sc_softled) {
-			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
-			    HAL_GPIO_MUX_MAC_NETWORK_LED);
-			ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
-				!sc->sc_ledon);
-		}
-	}
-	return 0;
-}
-
-static int
-ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int txantenna = ath_hal_getantennaswitch(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &txantenna, 0, req);
-	if (!error && req->newptr) {
-		/* XXX assumes 2 antenna ports */
-		if (txantenna < HAL_ANT_VARIABLE || txantenna > HAL_ANT_FIXED_B)
-			return EINVAL;
-		ath_hal_setantennaswitch(sc->sc_ah, txantenna);
-		/*
-		 * NB: with the switch locked this isn't meaningful,
-		 *     but set it anyway so things like radiotap get
-		 *     consistent info in their data.
-		 */
-		sc->sc_txantenna = txantenna;
-	}
-	return error;
-}
-
-static int
-ath_sysctl_rxantenna(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int defantenna = ath_hal_getdefantenna(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &defantenna, 0, req);
-	if (!error && req->newptr)
-		ath_hal_setdefantenna(sc->sc_ah, defantenna);
-	return error;
-}
-
-static int
-ath_sysctl_diversity(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int diversity = ath_hal_getdiversity(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &diversity, 0, req);
-	if (error || !req->newptr)
-		return error;
-	if (!ath_hal_setdiversity(sc->sc_ah, diversity))
-		return EINVAL;
-	sc->sc_diversity = diversity;
-	return 0;
-}
-
-static int
-ath_sysctl_diag(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int32_t diag;
-	int error;
-
-	if (!ath_hal_getdiag(sc->sc_ah, &diag))
-		return EINVAL;
-	error = sysctl_handle_int(oidp, &diag, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	struct ifnet *ifp = sc->sc_ifp;
-	u_int32_t scale;
-	int error;
-
-	(void) ath_hal_gettpscale(sc->sc_ah, &scale);
-	error = sysctl_handle_int(oidp, &scale, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL :
-	    (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0;
-}
-
-static int
-ath_sysctl_tpc(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int tpc = ath_hal_gettpc(sc->sc_ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &tpc, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	struct ifnet *ifp = sc->sc_ifp;
-	struct ath_hal *ah = sc->sc_ah;
-	u_int rfkill = ath_hal_getrfkill(ah);
-	int error;
-
-	error = sysctl_handle_int(oidp, &rfkill, 0, req);
-	if (error || !req->newptr)
-		return error;
-	if (rfkill == ath_hal_getrfkill(ah))	/* unchanged */
-		return 0;
-	if (!ath_hal_setrfkill(ah, rfkill))
-		return EINVAL;
-	return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0;
-}
-
-static int
-ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int rfsilent;
-	int error;
-
-	(void) ath_hal_getrfsilent(sc->sc_ah, &rfsilent);
-	error = sysctl_handle_int(oidp, &rfsilent, 0, req);
-	if (error || !req->newptr)
-		return error;
-	if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent))
-		return EINVAL;
-	sc->sc_rfsilentpin = rfsilent & 0x1c;
-	sc->sc_rfsilentpol = (rfsilent & 0x2) != 0;
-	return 0;
-}
-
-static int
-ath_sysctl_tpack(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int32_t tpack;
-	int error;
-
-	(void) ath_hal_gettpack(sc->sc_ah, &tpack);
-	error = sysctl_handle_int(oidp, &tpack, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_settpack(sc->sc_ah, tpack) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_tpcts(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	u_int32_t tpcts;
-	int error;
-
-	(void) ath_hal_gettpcts(sc->sc_ah, &tpcts);
-	error = sysctl_handle_int(oidp, &tpcts, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_settpcts(sc->sc_ah, tpcts) ? EINVAL : 0;
-}
-
-static int
-ath_sysctl_intmit(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	int intmit, error;
-
-	intmit = ath_hal_getintmit(sc->sc_ah);
-	error = sysctl_handle_int(oidp, &intmit, 0, req);
-	if (error || !req->newptr)
-		return error;
-	return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0;
-}
-
-#ifdef IEEE80211_SUPPORT_TDMA
-static int
-ath_sysctl_setcca(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	int setcca, error;
-
-	setcca = sc->sc_setcca;
-	error = sysctl_handle_int(oidp, &setcca, 0, req);
-	if (error || !req->newptr)
-		return error;
-	sc->sc_setcca = (setcca != 0);
-	return 0;
-}
-#endif /* IEEE80211_SUPPORT_TDMA */
-
-static void
-ath_sysctlattach(struct ath_softc *sc)
-{
-	struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
-	struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
-	struct ath_hal *ah = sc->sc_ah;
-
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"countrycode", CTLFLAG_RD, &sc->sc_eecc, 0,
-		"EEPROM country code");
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"regdomain", CTLFLAG_RD, &sc->sc_eerd, 0,
-		"EEPROM regdomain code");
-#ifdef	ATH_DEBUG
-	SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"debug", CTLFLAG_RW, &sc->sc_debug, 0,
-		"control debugging printfs");
-#endif
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"slottime", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_slottime, "I", "802.11 slot time (us)");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"acktimeout", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_acktimeout, "I", "802.11 ACK timeout (us)");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"ctstimeout", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_ctstimeout, "I", "802.11 CTS timeout (us)");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"softled", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_softled, "I", "enable/disable software LED support");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"ledpin", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_ledpin, "I", "GPIO pin connected to LED");
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"ledon", CTLFLAG_RW, &sc->sc_ledon, 0,
-		"setting to turn LED on");
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"ledidle", CTLFLAG_RW, &sc->sc_ledidle, 0,
-		"idle time for inactivity LED (ticks)");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"txantenna", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_txantenna, "I", "antenna switch");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"rxantenna", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_rxantenna, "I", "default/rx antenna");
-	if (ath_hal_hasdiversity(ah))
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"diversity", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_diversity, "I", "antenna diversity");
-	sc->sc_txintrperiod = ATH_TXINTR_PERIOD;
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"txintrperiod", CTLFLAG_RW, &sc->sc_txintrperiod, 0,
-		"tx descriptor batching");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"diag", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_diag, "I", "h/w diagnostic control");
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"tpscale", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-		ath_sysctl_tpscale, "I", "tx power scaling");
-	if (ath_hal_hastpc(ah)) {
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"tpc", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_tpc, "I", "enable/disable per-packet TPC");
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"tpack", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_tpack, "I", "tx power for ack frames");
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"tpcts", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_tpcts, "I", "tx power for cts frames");
-	}
-	if (ath_hal_hasrfsilent(ah)) {
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"rfsilent", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_rfsilent, "I", "h/w RF silent config");
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"rfkill", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_rfkill, "I", "enable/disable RF kill switch");
-	}
-	if (ath_hal_hasintmit(ah)) {
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"intmit", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_intmit, "I", "interference mitigation");
-	}
-	sc->sc_monpass = HAL_RXERR_DECRYPT | HAL_RXERR_MIC;
-	SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-		"monpass", CTLFLAG_RW, &sc->sc_monpass, 0,
-		"mask of error frames to pass when monitoring");
-#ifdef IEEE80211_SUPPORT_TDMA
-	if (ath_hal_macversion(ah) > 0x78) {
-		sc->sc_tdmadbaprep = 2;
-		SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"dbaprep", CTLFLAG_RW, &sc->sc_tdmadbaprep, 0,
-			"TDMA DBA preparation time");
-		sc->sc_tdmaswbaprep = 10;
-		SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"swbaprep", CTLFLAG_RW, &sc->sc_tdmaswbaprep, 0,
-			"TDMA SWBA preparation time");
-		SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"guardtime", CTLFLAG_RW, &sc->sc_tdmaguard, 0,
-			"TDMA slot guard time");
-		SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"superframe", CTLFLAG_RD, &sc->sc_tdmabintval, 0,
-			"TDMA calculated super frame");
-		SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-			"setcca", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-			ath_sysctl_setcca, "I", "enable CCA control");
-	}
-#endif
-}
-
 /*
  * Announce various information on device/driver attach.
  */
@@ -6392,227 +6005,3 @@ ath_tdma_beacon_send(struct ath_softc *s
 }
 #endif /* IEEE80211_SUPPORT_TDMA */
 
-static int
-ath_sysctl_clearstats(SYSCTL_HANDLER_ARGS)
-{
-	struct ath_softc *sc = arg1;
-	int val = 0;
-	int error;
-
-	error = sysctl_handle_int(oidp, &val, 0, req);
-	if (error || !req->newptr)
-		return error;
-	if (val == 0)
-		return 0;       /* Not clearing the stats is still valid */
-	memset(&sc->sc_stats, 0, sizeof(sc->sc_stats));
-	val = 0;
-	return 0;
-}
-
-static void
-ath_sysctl_stats_attach_rxphyerr(struct ath_softc *sc, struct sysctl_oid_list *parent)
-{
-	struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
-	struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
-	struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
-	int i;
-	char sn[8];
-
-	tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx_phy_err", CTLFLAG_RD, NULL, "Per-code RX PHY Errors");
-	child = SYSCTL_CHILDREN(tree);
-	for (i = 0; i < 64; i++) {
-		snprintf(sn, sizeof(sn), "%d", i);
-		SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, &sc->sc_stats.ast_rx_phy[i], 0, "");
-	}
-}
-
-static void
-ath_sysctl_stats_attach(struct ath_softc *sc)
-{
-	struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
-	struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
-	struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree);
- 
-	/* Create "clear" node */
-	SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
-	    "clear_stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
-	    ath_sysctl_clearstats, "I", "clear stats");
-
-	/* Create stats node */
-	tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD,
-	    NULL, "Statistics");
-	child = SYSCTL_CHILDREN(tree);
-
-	/* This was generated from if_athioctl.h */
-
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_watchdog", CTLFLAG_RD,
-	    &sc->sc_stats.ast_watchdog, 0, "device reset by watchdog");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_hardware", CTLFLAG_RD,
-	    &sc->sc_stats.ast_hardware, 0, "fatal hardware error interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_bmiss", CTLFLAG_RD,
-	    &sc->sc_stats.ast_bmiss, 0, "beacon miss interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_bmiss_phantom", CTLFLAG_RD,
-	    &sc->sc_stats.ast_bmiss_phantom, 0, "beacon miss interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_bstuck", CTLFLAG_RD,
-	    &sc->sc_stats.ast_bstuck, 0, "beacon stuck interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rxorn", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rxorn, 0, "rx overrun interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rxeol", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rxeol, 0, "rx eol interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_txurn", CTLFLAG_RD,
-	    &sc->sc_stats.ast_txurn, 0, "tx underrun interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_mib", CTLFLAG_RD,
-	    &sc->sc_stats.ast_mib, 0, "mib interrupts");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_intrcoal", CTLFLAG_RD,
-	    &sc->sc_stats.ast_intrcoal, 0, "interrupts coalesced");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_packets", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_packets, 0, "packet sent on the interface");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_mgmt", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_mgmt, 0, "management frames transmitted");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_discard", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_discard, 0, "frames discarded prior to assoc");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_qstop", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_qstop, 0, "output stopped 'cuz no buffer");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_encap", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_encap, 0, "tx encapsulation failed");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nonode", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nonode, 0, "tx failed 'cuz no node");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nombuf", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nombuf, 0, "tx failed 'cuz no mbuf");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nomcl", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nomcl, 0, "tx failed 'cuz no cluster");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_linear", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_linear, 0, "tx linearized to cluster");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nodata", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nodata, 0, "tx discarded empty frame");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_busdma", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_busdma, 0, "tx failed for dma resrcs");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_xretries", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_xretries, 0, "tx failed 'cuz too many retries");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_fifoerr", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_fifoerr, 0, "tx failed 'cuz FIFO underrun");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_filtered", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_filtered, 0, "tx failed 'cuz xmit filtered");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_shortretry", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_shortretry, 0, "tx on-chip retries (short)");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_longretry", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_longretry, 0, "tx on-chip retries (long)");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_badrate", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_badrate, 0, "tx failed 'cuz bogus xmit rate");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_noack", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_noack, 0, "tx frames with no ack marked");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_rts", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_rts, 0, "tx frames with rts enabled");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_cts", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_cts, 0, "tx frames with cts enabled");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_shortpre", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_shortpre, 0, "tx frames with short preamble");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_altrate", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_altrate, 0, "tx frames with alternate rate");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_protect", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_protect, 0, "tx frames with protection");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_ctsburst", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_ctsburst, 0, "tx frames with cts and bursting");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_ctsext", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_ctsext, 0, "tx frames with cts extension");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_nombuf", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_nombuf, 0, "rx setup failed 'cuz no mbuf");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_busdma", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_busdma, 0, "rx setup failed for dma resrcs");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_orn", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_orn, 0, "rx failed 'cuz of desc overrun");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_crcerr", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_crcerr, 0, "rx failed 'cuz of bad CRC");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_fifoerr", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_fifoerr, 0, "rx failed 'cuz of FIFO overrun");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_badcrypt", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_badcrypt, 0, "rx failed 'cuz decryption");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_badmic", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_badmic, 0, "rx failed 'cuz MIC failure");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_phyerr", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_phyerr, 0, "rx failed 'cuz of PHY err");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_tooshort", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_tooshort, 0, "rx discarded 'cuz frame too short");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_toobig", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_toobig, 0, "rx discarded 'cuz frame too large");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_packets", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_packets, 0, "packet recv on the interface");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_mgt", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_mgt, 0, "management frames received");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_ctl", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_ctl, 0, "rx discarded 'cuz ctl frame");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_be_xmit", CTLFLAG_RD,
-	    &sc->sc_stats.ast_be_xmit, 0, "beacons transmitted");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_be_nombuf", CTLFLAG_RD,
-	    &sc->sc_stats.ast_be_nombuf, 0, "beacon setup failed 'cuz no mbuf");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_per_cal", CTLFLAG_RD,
-	    &sc->sc_stats.ast_per_cal, 0, "periodic calibration calls");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_per_calfail", CTLFLAG_RD,
-	    &sc->sc_stats.ast_per_calfail, 0, "periodic calibration failed");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_per_rfgain", CTLFLAG_RD,
-	    &sc->sc_stats.ast_per_rfgain, 0, "periodic calibration rfgain reset");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rate_calls", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rate_calls, 0, "rate control checks");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rate_raise", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rate_raise, 0, "rate control raised xmit rate");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rate_drop", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rate_drop, 0, "rate control dropped xmit rate");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ant_defswitch", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ant_defswitch, 0, "rx/default antenna switches");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ant_txswitch", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ant_txswitch, 0, "tx antenna switches");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_cabq_xmit", CTLFLAG_RD,
-	    &sc->sc_stats.ast_cabq_xmit, 0, "cabq frames transmitted");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_cabq_busy", CTLFLAG_RD,
-	    &sc->sc_stats.ast_cabq_busy, 0, "cabq found busy");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_raw", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_raw, 0, "tx frames through raw api");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ff_txok", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ff_txok, 0, "fast frames tx'd successfully");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ff_txerr", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ff_txerr, 0, "fast frames tx'd w/ error");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ff_rx", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ff_rx, 0, "fast frames rx'd");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ff_flush", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ff_flush, 0, "fast frames flushed from staging q");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_qfull", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_qfull, 0, "tx dropped 'cuz of queue limit");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nobuf", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nobuf, 0, "tx dropped 'cuz no ath buffer");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tdma_update", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tdma_update, 0, "TDMA slot timing updates");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tdma_timers", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tdma_timers, 0, "TDMA slot update set beacon timers");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tdma_tsf", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tdma_tsf, 0, "TDMA slot update set TSF");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tdma_ack", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tdma_ack, 0, "TDMA tx failed 'cuz ACK required");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_raw_fail", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_raw_fail, 0, "raw tx failed 'cuz h/w down");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_nofrag", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_nofrag, 0, "tx dropped 'cuz no ath frag buffer");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_be_missed", CTLFLAG_RD,
-	    &sc->sc_stats.ast_be_missed, 0, "number of -missed- beacons");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_ani_cal", CTLFLAG_RD,
-	    &sc->sc_stats.ast_ani_cal, 0, "number of ANI polls");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_agg", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_agg, 0, "number of aggregate frames received");
-
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_halfgi", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_halfgi, 0, "number of frames received with half-GI");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_2040", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_2040, 0, "number of HT/40 frames received");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_pre_crc_err", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_pre_crc_err, 0, "number of delimeter-CRC errors detected");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_post_crc_err", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_post_crc_err, 0, "number of post-delimiter CRC errors detected");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_decrypt_busy_err", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_decrypt_busy_err, 0, "number of frames received w/ busy decrypt engine");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_hi_rx_chain", CTLFLAG_RD,
-	    &sc->sc_stats.ast_rx_hi_rx_chain, 0, "");
-	SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_htprotect", CTLFLAG_RD,
-	    &sc->sc_stats.ast_tx_htprotect, 0, "HT tx frames with protection");
-
-	/* Attach the RX phy error array */
-	ath_sysctl_stats_attach_rxphyerr(sc, child);
-}

Modified: head/sys/dev/ath/if_ath_misc.h
==============================================================================
--- head/sys/dev/ath/if_ath_misc.h	Wed Mar  2 15:41:00 2011	(r219179)
+++ head/sys/dev/ath/if_ath_misc.h	Wed Mar  2 16:03:19 2011	(r219180)
@@ -53,4 +53,6 @@ extern int ath_tx_findrix(const struct a
 extern struct ath_buf * ath_getbuf(struct ath_softc *sc);
 extern struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc);
 
+extern int ath_reset(struct ifnet *);
+
 #endif

Added: head/sys/dev/ath/if_ath_sysctl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_sysctl.c	Wed Mar  2 16:03:19 2011	(r219180)
@@ -0,0 +1,709 @@
+/*-
+ * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
+ * 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
+ *    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 NONINFRINGEMENT, 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Driver for the Atheros Wireless LAN controller.
+ *
+ * This software is derived from work of Atsushi Onoe; his contribution
+ * is greatly appreciated.
+ */
+
+#include "opt_inet.h"
+#include "opt_ath.h"
+#include "opt_wlan.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#ifdef IEEE80211_SUPPORT_SUPERG
+#include 
+#endif
+#ifdef IEEE80211_SUPPORT_TDMA
+#include 
+#endif
+
+#include 
+
+#ifdef INET
+#include 
+#include 
+#endif
+
+#include 
+#include 		/* XXX for softled */
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#ifdef ATH_TX99_DIAG
+#include 
+#endif
+
+static int
+ath_sysctl_slottime(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int slottime = ath_hal_getslottime(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &slottime, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_setslottime(sc->sc_ah, slottime) ? EINVAL : 0;
+}
+
+static int
+ath_sysctl_acktimeout(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int acktimeout = ath_hal_getacktimeout(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &acktimeout, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0;
+}
+
+static int
+ath_sysctl_ctstimeout(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int ctstimeout = ath_hal_getctstimeout(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &ctstimeout, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0;
+}
+
+static int
+ath_sysctl_softled(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	int softled = sc->sc_softled;
+	int error;
+
+	error = sysctl_handle_int(oidp, &softled, 0, req);
+	if (error || !req->newptr)
+		return error;
+	softled = (softled != 0);
+	if (softled != sc->sc_softled) {
+		if (softled) {
+			/* NB: handle any sc_ledpin change */
+			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
+			    HAL_GPIO_MUX_MAC_NETWORK_LED);
+			ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
+				!sc->sc_ledon);
+		}
+		sc->sc_softled = softled;
+	}
+	return 0;
+}
+
+static int
+ath_sysctl_ledpin(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	int ledpin = sc->sc_ledpin;
+	int error;
+
+	error = sysctl_handle_int(oidp, &ledpin, 0, req);
+	if (error || !req->newptr)
+		return error;
+	if (ledpin != sc->sc_ledpin) {
+		sc->sc_ledpin = ledpin;
+		if (sc->sc_softled) {
+			ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
+			    HAL_GPIO_MUX_MAC_NETWORK_LED);
+			ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
+				!sc->sc_ledon);
+		}
+	}
+	return 0;
+}
+
+static int
+ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int txantenna = ath_hal_getantennaswitch(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &txantenna, 0, req);
+	if (!error && req->newptr) {
+		/* XXX assumes 2 antenna ports */
+		if (txantenna < HAL_ANT_VARIABLE || txantenna > HAL_ANT_FIXED_B)
+			return EINVAL;
+		ath_hal_setantennaswitch(sc->sc_ah, txantenna);
+		/*
+		 * NB: with the switch locked this isn't meaningful,
+		 *     but set it anyway so things like radiotap get
+		 *     consistent info in their data.
+		 */
+		sc->sc_txantenna = txantenna;
+	}
+	return error;
+}
+
+static int
+ath_sysctl_rxantenna(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int defantenna = ath_hal_getdefantenna(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &defantenna, 0, req);
+	if (!error && req->newptr)
+		ath_hal_setdefantenna(sc->sc_ah, defantenna);
+	return error;
+}
+
+static int
+ath_sysctl_diversity(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int diversity = ath_hal_getdiversity(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &diversity, 0, req);
+	if (error || !req->newptr)
+		return error;
+	if (!ath_hal_setdiversity(sc->sc_ah, diversity))
+		return EINVAL;
+	sc->sc_diversity = diversity;
+	return 0;
+}
+
+static int
+ath_sysctl_diag(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int32_t diag;
+	int error;
+
+	if (!ath_hal_getdiag(sc->sc_ah, &diag))
+		return EINVAL;
+	error = sysctl_handle_int(oidp, &diag, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_setdiag(sc->sc_ah, diag) ? EINVAL : 0;
+}
+
+static int
+ath_sysctl_tpscale(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	struct ifnet *ifp = sc->sc_ifp;
+	u_int32_t scale;
+	int error;
+
+	(void) ath_hal_gettpscale(sc->sc_ah, &scale);
+	error = sysctl_handle_int(oidp, &scale, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_settpscale(sc->sc_ah, scale) ? EINVAL :
+	    (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0;
+}
+
+static int
+ath_sysctl_tpc(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int tpc = ath_hal_gettpc(sc->sc_ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &tpc, 0, req);
+	if (error || !req->newptr)
+		return error;
+	return !ath_hal_settpc(sc->sc_ah, tpc) ? EINVAL : 0;
+}
+
+static int
+ath_sysctl_rfkill(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	struct ifnet *ifp = sc->sc_ifp;
+	struct ath_hal *ah = sc->sc_ah;
+	u_int rfkill = ath_hal_getrfkill(ah);
+	int error;
+
+	error = sysctl_handle_int(oidp, &rfkill, 0, req);
+	if (error || !req->newptr)
+		return error;
+	if (rfkill == ath_hal_getrfkill(ah))	/* unchanged */
+		return 0;
+	if (!ath_hal_setrfkill(ah, rfkill))
+		return EINVAL;
+	return (ifp->if_drv_flags & IFF_DRV_RUNNING) ? ath_reset(ifp) : 0;
+}
+
+static int
+ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS)
+{
+	struct ath_softc *sc = arg1;
+	u_int rfsilent;
+	int error;
+
+	(void) ath_hal_getrfsilent(sc->sc_ah, &rfsilent);
+	error = sysctl_handle_int(oidp, &rfsilent, 0, req);
+	if (error || !req->newptr)
+		return error;
+	if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent))
+		return EINVAL;
+	sc->sc_rfsilentpin = rfsilent & 0x1c;
+	sc->sc_rfsilentpol = (rfsilent & 0x2) != 0;
+	return 0;
+}
+
+static int
+ath_sysctl_tpack(SYSCTL_HANDLER_ARGS)

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 16:06:57 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BCF7E106566B;
	Wed,  2 Mar 2011 16:06:57 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AADAC8FC08;
	Wed,  2 Mar 2011 16:06:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22G6v3G020463;
	Wed, 2 Mar 2011 16:06:57 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22G6vou020460;
	Wed, 2 Mar 2011 16:06:57 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201103021606.p22G6vou020460@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Wed, 2 Mar 2011 16:06:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 16:06:57 -0000

Author: nwhitehorn
Date: Wed Mar  2 16:06:57 2011
New Revision: 219181
URL: http://svn.freebsd.org/changeset/base/219181

Log:
  Add additional release makefile for bsdinstall-based media, along with
  support files. This does not change the default behavior of anything.
  
  To make bsdinstall-based media, pre-build world and GENERIC, then run
  the release target in Makefile.bsdinstall.

Added:
  head/release/Makefile.bsdinstall   (contents, props changed)
  head/release/rc.local   (contents, props changed)

Added: head/release/Makefile.bsdinstall
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/Makefile.bsdinstall	Wed Mar  2 16:06:57 2011	(r219181)
@@ -0,0 +1,53 @@
+# $FreeBSD$
+
+WORLDDIR?=	${.CURDIR}/..
+DISTDIR?=	${DESTDIR}/usr/freebsd-dist
+PORTSDIR?=	/usr/ports
+
+TARGET_ARCH?=	${MACHINE_ARCH}
+.if ${TARGET_ARCH} == ${MACHINE_ARCH}
+TARGET?=	${MACHINE}
+.else
+TARGET?=	${TARGET_ARCH}
+.endif
+IMAKE=		${MAKE} TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
+
+packagesystem:
+	-mkdir -p ${DISTDIR}
+	cd ${WORLDDIR} && ${IMAKE} distributeworld distributekernel DISTDIR=${DISTDIR}
+# Set up mergemaster root database
+	sh ${.CURDIR}/scripts/mm-mtree.sh -F "TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}" -D "${DISTDIR}/base"
+	cd ${WORLDDIR} && ${IMAKE} packageworld packagekernel DISTDIR=${DISTDIR}
+	-mkdir -p ${DISTDIR}/usr
+# Package up src and ports trees
+	ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
+	ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
+.if !defined(NOPORTS)
+	cd ${DISTDIR} && tar cLvJf ${DISTDIR}/ports.txz --exclude usr/ports/distfiles --exclude usr/ports/packages --exclude 'usr/ports/INDEX*' usr/ports
+.endif
+.if !defined(NOSRC)
+	cd ${DISTDIR} && tar cLvJf ${DISTDIR}/src.txz --exclude .svn --exclude CVS usr/src
+.endif
+
+system:
+# Install system
+	-mkdir ${DISTDIR}/release
+	cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${DISTDIR}/release
+	-rm ${DISTDIR}/release/boot/kernel/*.symbols
+# Copy distfiles
+	mkdir ${DISTDIR}/release/usr/freebsd-dist
+	cp ${DISTDIR}/*.txz ${DISTDIR}/release/usr/freebsd-dist
+# Set up installation environment
+	ln -s /tmp/bsdinstall_etc/resolv.conf ${DISTDIR}/release/etc/resolv.conf
+	echo sendmail_enable=\"NONE\" > ${DISTDIR}/release/etc/rc.conf
+	echo hostid_enable=\"NO\" >> ${DISTDIR}/release/etc/rc.conf
+	touch ${DISTDIR}/release/etc/fstab
+	cp rc.local ${DISTDIR}/release/etc
+
+cdrom:
+	echo kernel_options=\"-C\" > ${DISTDIR}/release/boot/loader.conf
+	sh /usr/src/release/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${DISTDIR}/release.iso ${DISTDIR}/release
+	rm ${DISTDIR}/release/boot/loader.conf
+
+release: packagesystem system cdrom
+	

Added: head/release/rc.local
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/rc.local	Wed Mar  2 16:06:57 2011	(r219181)
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $FreeBSD$
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_HELP=2}
+: ${DIALOG_EXTRA=3}
+: ${DIALOG_ITEM_HELP=4}
+: ${DIALOG_ESC=255}
+
+TERM=xterm; export TERM # XXX: serial consoles
+
+dialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0
+
+case $? in
+$DIALOG_OK)	# Install
+	BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
+	trap true SIGINT	# Ignore cntrl-C here
+	bsdinstall
+	dialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete! The system will now reboot." 0 0
+	reboot
+	;;
+$DIALOG_CANCEL)	# Live CD
+	exit 0
+	;;
+$DIALOG_EXTRA)	# Shell
+	clear
+	echo "When finished, type 'exit' to return to the installer."
+	/bin/sh
+	. /etc/rc.local
+	;;
+esac
+

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 16:15:11 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED159106564A;
	Wed,  2 Mar 2011 16:15:11 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D8C368FC14;
	Wed,  2 Mar 2011 16:15:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22GFBG1021174;
	Wed, 2 Mar 2011 16:15:11 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22GFBvm021168;
	Wed, 2 Mar 2011 16:15:11 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201103021615.p22GFBvm021168@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 2 Mar 2011 16:15:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219182 - in head/sys: conf modules/netgraph/netflow
	netgraph/netflow
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 16:15:12 -0000

Author: glebius
Date: Wed Mar  2 16:15:11 2011
New Revision: 219182
URL: http://svn.freebsd.org/changeset/base/219182

Log:
  Add support for NetFlow version 9 into ng_netflow(4) node.
  
  Submitted by:	Alexander V. Chernikov 

Added:
  head/sys/netgraph/netflow/netflow_v9.c   (contents, props changed)
  head/sys/netgraph/netflow/netflow_v9.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/netgraph/netflow/Makefile
  head/sys/netgraph/netflow/netflow.c
  head/sys/netgraph/netflow/netflow.h
  head/sys/netgraph/netflow/ng_netflow.c
  head/sys/netgraph/netflow/ng_netflow.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Mar  2 16:06:57 2011	(r219181)
+++ head/sys/conf/files	Wed Mar  2 16:15:11 2011	(r219182)
@@ -2556,6 +2556,7 @@ netgraph/bluetooth/socket/ng_btsocket_l2
 netgraph/bluetooth/socket/ng_btsocket_rfcomm.c optional netgraph_bluetooth_socket
 netgraph/bluetooth/socket/ng_btsocket_sco.c optional netgraph_bluetooth_socket
 netgraph/netflow/netflow.c	optional netgraph_netflow
+netgraph/netflow/netflow_v9.c	optional netgraph_netflow
 netgraph/netflow/ng_netflow.c	optional netgraph_netflow
 netgraph/ng_UI.c		optional netgraph_UI
 netgraph/ng_async.c		optional netgraph_async

Modified: head/sys/modules/netgraph/netflow/Makefile
==============================================================================
--- head/sys/modules/netgraph/netflow/Makefile	Wed Mar  2 16:06:57 2011	(r219181)
+++ head/sys/modules/netgraph/netflow/Makefile	Wed Mar  2 16:15:11 2011	(r219182)
@@ -3,9 +3,22 @@
 # Author: Gleb Smirnoff 
 #
 
+.include 
+
 .PATH: ${.CURDIR}/../../../netgraph/netflow
 
 KMOD=   ng_netflow
-SRCS=   ng_netflow.c netflow.c
+SRCS=   ng_netflow.c netflow.c netflow_v9.c opt_inet6.h opt_route.h
+
+.if !defined(KERNBUILDDIR)
+
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+	echo "#define INET6 1" > ${.TARGET}
+.endif
+
+opt_route.h:
+	echo "#define ROUTETABLES RT_MAXFIBS" > ${.TARGET}
+.endif
 
 .include 

Modified: head/sys/netgraph/netflow/netflow.c
==============================================================================
--- head/sys/netgraph/netflow/netflow.c	Wed Mar  2 16:06:57 2011	(r219181)
+++ head/sys/netgraph/netflow/netflow.c	Wed Mar  2 16:15:11 2011	(r219182)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2010-2011 Alexander V. Chernikov 
  * Copyright (c) 2004-2005 Gleb Smirnoff 
  * Copyright (c) 2001-2003 Roman V. Palagin 
  * All rights reserved.
@@ -30,6 +31,8 @@
 static const char rcs_id[] =
     "@(#) $FreeBSD$";
 
+#include "opt_inet6.h"
+#include "opt_route.h"
 #include 
 #include 
 #include 
@@ -37,14 +40,18 @@ static const char rcs_id[] =
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -52,6 +59,7 @@ static const char rcs_id[] =
 #include 
 
 #include 
+#include 
 #include 
 
 #define	NBUCKETS	(65536)		/* must be power of 2 */
@@ -83,25 +91,28 @@ static const char rcs_id[] =
  */
 #define	SMALL(fle)	(fle->f.packets <= 4)
 
-/*
- * Cisco uses milliseconds for uptime. Bad idea, since it overflows
- * every 48+ days. But we will do same to keep compatibility. This macro
- * does overflowable multiplication to 1000.
- */
-#define	MILLIUPTIME(t)	(((t) << 9) +	/* 512 */	\
-			 ((t) << 8) +	/* 256 */	\
-			 ((t) << 7) +	/* 128 */	\
-			 ((t) << 6) +	/* 64  */	\
-			 ((t) << 5) +	/* 32  */	\
-			 ((t) << 3))	/* 8   */
 
 MALLOC_DECLARE(M_NETFLOW_HASH);
 MALLOC_DEFINE(M_NETFLOW_HASH, "netflow_hash", "NetFlow hash");
 
 static int export_add(item_p, struct flow_entry *);
-static int export_send(priv_p, item_p, int flags);
+static int export_send(priv_p, fib_export_p, item_p, int);
+
+static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t);
+static int hash6_insert(priv_p, struct flow6_hash_entry *, struct flow6_rec *, int, uint8_t);
+
+static __inline void expire_flow(priv_p, fib_export_p, struct flow_entry *, int);
 
-/* Generate hash for a given flow record. */
+/*
+ * Generate hash for a given flow record.
+ *
+ * FIB is not used here, because:
+ * most VRFS will carry public IPv4 addresses which are unique even
+ * without FIB private addresses can overlap, but this is worked out
+ * via flow_rec bcmp() containing fib id. In IPv6 world addresses are
+ * all globally unique (it's not fully true, there is FC00::/7 for example,
+ * but chances of address overlap are MUCH smaller)
+ */
 static __inline uint32_t
 ip_hash(struct flow_rec *r)
 {
@@ -115,6 +126,24 @@ ip_hash(struct flow_rec *r)
 	}
 }
 
+#ifdef INET6
+/* Generate hash for a given flow6 record. Use lower 4 octets from v6 addresses */
+static __inline uint32_t
+ip6_hash(struct flow6_rec *r)
+{
+	switch (r->r_ip_p) {
+	case IPPROTO_TCP:
+	case IPPROTO_UDP:
+		return FULL_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
+		    r->dst.r_dst6.__u6_addr.__u6_addr32[3], r->r_sport,
+		    r->r_dport);
+	default:
+		return ADDR_HASH(r->src.r_src6.__u6_addr.__u6_addr32[3],
+		    r->dst.r_dst6.__u6_addr.__u6_addr32[3]);
+ 	}
+}
+#endif
+
 /* This is callback from uma(9), called on alloc. */
 static int
 uma_ctor_flow(void *mem, int size, void *arg, int how)
@@ -138,21 +167,46 @@ uma_dtor_flow(void *mem, int size, void 
 	atomic_subtract_32(&priv->info.nfinfo_used, 1);
 }
 
+#ifdef INET6
+/* This is callback from uma(9), called on alloc. */
+static int
+uma_ctor_flow6(void *mem, int size, void *arg, int how)
+{
+	priv_p priv = (priv_p )arg;
+
+	if (atomic_load_acq_32(&priv->info.nfinfo_used6) >= CACHESIZE)
+		return (ENOMEM);
+
+	atomic_add_32(&priv->info.nfinfo_used6, 1);
+
+	return (0);
+}
+
+/* This is callback from uma(9), called on free. */
+static void
+uma_dtor_flow6(void *mem, int size, void *arg)
+{
+	priv_p priv = (priv_p )arg;
+
+	atomic_subtract_32(&priv->info.nfinfo_used6, 1);
+}
+#endif
+
 /*
  * Detach export datagram from priv, if there is any.
  * If there is no, allocate a new one.
  */
 static item_p
-get_export_dgram(priv_p priv)
+get_export_dgram(priv_p priv, fib_export_p fe)
 {
 	item_p	item = NULL;
 
-	mtx_lock(&priv->export_mtx);
-	if (priv->export_item != NULL) {
-		item = priv->export_item;
-		priv->export_item = NULL;
+	mtx_lock(&fe->export_mtx);
+	if (fe->exp.item != NULL) {
+		item = fe->exp.item;
+		fe->exp.item = NULL;
 	}
-	mtx_unlock(&priv->export_mtx);
+	mtx_unlock(&fe->export_mtx);
 
 	if (item == NULL) {
 		struct netflow_v5_export_dgram *dgram;
@@ -178,20 +232,20 @@ get_export_dgram(priv_p priv)
  * Re-attach incomplete datagram back to priv.
  * If there is already another one, then send incomplete. */
 static void
-return_export_dgram(priv_p priv, item_p item, int flags)
+return_export_dgram(priv_p priv, fib_export_p fe, item_p item, int flags)
 {
 	/*
 	 * It may happen on SMP, that some thread has already
 	 * put its item there, in this case we bail out and
 	 * send what we have to collector.
 	 */
-	mtx_lock(&priv->export_mtx);
-	if (priv->export_item == NULL) {
-		priv->export_item = item;
-		mtx_unlock(&priv->export_mtx);
+	mtx_lock(&fe->export_mtx);
+	if (fe->exp.item == NULL) {
+		fe->exp.item = item;
+		mtx_unlock(&fe->export_mtx);
 	} else {
-		mtx_unlock(&priv->export_mtx);
-		export_send(priv, item, flags);
+		mtx_unlock(&fe->export_mtx);
+		export_send(priv, fe, item, flags);
 	}
 }
 
@@ -200,20 +254,51 @@ return_export_dgram(priv_p priv, item_p 
  * full, then call export_send().
  */
 static __inline void
-expire_flow(priv_p priv, item_p *item, struct flow_entry *fle, int flags)
+expire_flow(priv_p priv, fib_export_p fe, struct flow_entry *fle, int flags)
 {
-	if (*item == NULL)
-		*item = get_export_dgram(priv);
-	if (*item == NULL) {
-		atomic_add_32(&priv->info.nfinfo_export_failed, 1);
-		uma_zfree_arg(priv->zone, fle, priv);
-		return;
+	struct netflow_export_item exp;
+	uint16_t version = fle->f.version;
+
+	if ((priv->export != NULL) && (version == IPVERSION)) {
+		exp.item = get_export_dgram(priv, fe);
+		if (exp.item == NULL) {
+			atomic_add_32(&priv->info.nfinfo_export_failed, 1);
+			if (priv->export9 != NULL)
+				atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
+			/* fle definitely contains IPv4 flow */
+			uma_zfree_arg(priv->zone, fle, priv);
+			return;
+		}
+
+		if (export_add(exp.item, fle) > 0)
+			export_send(priv, fe, exp.item, flags);
+		else
+			return_export_dgram(priv, fe, exp.item, NG_QUEUE);
 	}
-	if (export_add(*item, fle) > 0) {
-		export_send(priv, *item, flags);
-		*item = NULL;
+
+	if (priv->export9 != NULL) {
+		exp.item9 = get_export9_dgram(priv, fe, &exp.item9_opt);
+		if (exp.item9 == NULL) {
+			atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
+			if (version == IPVERSION)
+				uma_zfree_arg(priv->zone, fle, priv);
+			else if (version == IP6VERSION)
+				uma_zfree_arg(priv->zone6, fle, priv);
+			else
+				panic("ng_netflow: Unknown IP proto: %d", version);
+			return;
+		}
+
+		if (export9_add(exp.item9, exp.item9_opt, fle) > 0)
+			export9_send(priv, fe, exp.item9, exp.item9_opt, flags);
+		else
+			return_export9_dgram(priv, fe, exp.item9, exp.item9_opt, NG_QUEUE);
 	}
-	uma_zfree_arg(priv->zone, fle, priv);
+
+	if (version == IPVERSION)
+		uma_zfree_arg(priv->zone, fle, priv);
+	else if (version == IP6VERSION)
+		uma_zfree_arg(priv->zone6, fle, priv);
 }
 
 /* Get a snapshot of node statistics */
@@ -235,7 +320,7 @@ ng_netflow_copyinfo(priv_p priv, struct 
  * to be sure.
  */
 static __inline int
-hash_insert(priv_p priv, struct flow_hash_entry  *hsh, struct flow_rec *r,
+hash_insert(priv_p priv, struct flow_hash_entry *hsh, struct flow_rec *r,
 	int plen, uint8_t tcp_flags)
 {
 	struct flow_entry *fle;
@@ -255,6 +340,7 @@ hash_insert(priv_p priv, struct flow_has
 	 * we can safely edit it.
 	 */
 
+	fle->f.version = IPVERSION;
 	bcopy(r, &fle->f.r, sizeof(struct flow_rec));
 	fle->f.bytes = plen;
 	fle->f.packets = 1;
@@ -270,8 +356,7 @@ hash_insert(priv_p priv, struct flow_has
 	sin.sin_len = sizeof(struct sockaddr_in);
 	sin.sin_family = AF_INET;
 	sin.sin_addr = fle->f.r.r_dst;
-	/* XXX MRT 0 as a default.. need the m here to get fib */
-	rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, 0);
+	rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib);
 	if (rt != NULL) {
 		fle->f.fle_o_ifx = rt->rt_ifp->if_index;
 
@@ -295,8 +380,7 @@ hash_insert(priv_p priv, struct flow_has
 	sin.sin_len = sizeof(struct sockaddr_in);
 	sin.sin_family = AF_INET;
 	sin.sin_addr = fle->f.r.r_src;
-	/* XXX MRT 0 as a default  revisit.  need the mbuf for fib*/
-	rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, 0);
+	rt = rtalloc1_fib((struct sockaddr *)&sin, 0, 0, r->fib);
 	if (rt != NULL) {
 		if (rt_mask(rt))
 			fle->f.src_mask = bitcount32(((struct sockaddr_in *)
@@ -314,6 +398,99 @@ hash_insert(priv_p priv, struct flow_has
 	return (0);
 }
 
+#ifdef INET6
+/* XXX: make normal function, instead of.. */
+#define ipv6_masklen(x)		bitcount32((x).__u6_addr.__u6_addr32[0]) + \
+				bitcount32((x).__u6_addr.__u6_addr32[1]) + \
+				bitcount32((x).__u6_addr.__u6_addr32[2]) + \
+				bitcount32((x).__u6_addr.__u6_addr32[3])
+/* XXX: Do we need inline here ? */
+static __inline int
+hash6_insert(priv_p priv, struct flow6_hash_entry *hsh6, struct flow6_rec *r,
+	int plen, uint8_t tcp_flags)
+{
+	struct flow6_entry *fle6;
+	struct sockaddr_in6 *src, *dst;
+	struct rtentry *rt;
+	struct route_in6 rin6;
+
+	mtx_assert(&hsh6->mtx, MA_OWNED);
+
+	fle6 = uma_zalloc_arg(priv->zone6, priv, M_NOWAIT);
+	if (fle6 == NULL) {
+		atomic_add_32(&priv->info.nfinfo_alloc_failed, 1);
+		return (ENOMEM);
+	}
+
+	/*
+	 * Now fle is totally ours. It is detached from all lists,
+	 * we can safely edit it.
+	 */
+
+	fle6->f.version = IP6VERSION;
+	bcopy(r, &fle6->f.r, sizeof(struct flow6_rec));
+	fle6->f.bytes = plen;
+	fle6->f.packets = 1;
+	fle6->f.tcp_flags = tcp_flags;
+
+	fle6->f.first = fle6->f.last = time_uptime;
+
+	/*
+	 * First we do route table lookup on destination address. So we can
+	 * fill in out_ifx, dst_mask, nexthop, and dst_as in future releases.
+	 */
+	bzero(&rin6, sizeof(struct route_in6));
+	dst = (struct sockaddr_in6 *)&rin6.ro_dst;
+	dst->sin6_len = sizeof(struct sockaddr_in6);
+	dst->sin6_family = AF_INET6;
+	dst->sin6_addr = r->dst.r_dst6;
+
+	rin6.ro_rt = rtalloc1_fib((struct sockaddr *)dst, 0, 0, r->fib);
+
+	if (rin6.ro_rt != NULL) {
+		rt = rin6.ro_rt;
+		fle6->f.fle_o_ifx = rt->rt_ifp->if_index;
+
+		if (rt->rt_flags & RTF_GATEWAY &&
+		    rt->rt_gateway->sa_family == AF_INET6)
+			fle6->f.n.next_hop6 =
+			    ((struct sockaddr_in6 *)(rt->rt_gateway))->sin6_addr;
+
+		if (rt_mask(rt))
+			fle6->f.dst_mask = ipv6_masklen(((struct sockaddr_in6 *)rt_mask(rt))->sin6_addr);
+		else 
+			fle6->f.dst_mask = 128;
+
+		RTFREE_LOCKED(rt);
+	}
+
+	/* Do route lookup on source address, to fill in src_mask. */
+	bzero(&rin6, sizeof(struct route_in6));
+	src = (struct sockaddr_in6 *)&rin6.ro_dst;
+	src->sin6_len = sizeof(struct sockaddr_in6);
+	src->sin6_family = AF_INET6;
+	src->sin6_addr = r->src.r_src6;
+
+	rin6.ro_rt = rtalloc1_fib((struct sockaddr *)src, 0, 0, r->fib);
+
+	if (rin6.ro_rt != NULL) {
+		rt = rin6.ro_rt;
+
+		if (rt_mask(rt))
+			fle6->f.src_mask = ipv6_masklen(((struct sockaddr_in6 *)rt_mask(rt))->sin6_addr);
+		else 
+			fle6->f.src_mask = 128;
+
+		RTFREE_LOCKED(rt);
+	}
+
+	/* Push new flow at the and of hash. */
+	TAILQ_INSERT_TAIL(&hsh6->head, fle6, fle6_hash);
+
+	return (0);
+}
+#endif
+
 
 /*
  * Non-static functions called from ng_netflow.c
@@ -323,43 +500,100 @@ hash_insert(priv_p priv, struct flow_has
 int
 ng_netflow_cache_init(priv_p priv)
 {
-	struct flow_hash_entry	*hsh;
+	struct flow_hash_entry *hsh;
+#ifdef INET6	
+	struct flow6_hash_entry *hsh6;
+#endif
 	int i;
 
 	/* Initialize cache UMA zone. */
-	priv->zone = uma_zcreate("NetFlow cache", sizeof(struct flow_entry),
+	priv->zone = uma_zcreate("NetFlow IPv4 cache", sizeof(struct flow_entry),
 	    uma_ctor_flow, uma_dtor_flow, NULL, NULL, UMA_ALIGN_CACHE, 0);
 	uma_zone_set_max(priv->zone, CACHESIZE);
+#ifdef INET6	
+	priv->zone6 = uma_zcreate("NetFlow IPv6 cache", sizeof(struct flow6_entry),
+	    uma_ctor_flow6, uma_dtor_flow6, NULL, NULL, UMA_ALIGN_CACHE, 0);
+	uma_zone_set_max(priv->zone6, CACHESIZE);
+#endif	
 
 	/* Allocate hash. */
 	priv->hash = malloc(NBUCKETS * sizeof(struct flow_hash_entry),
 	    M_NETFLOW_HASH, M_WAITOK | M_ZERO);
 
-	if (priv->hash == NULL) {
-		uma_zdestroy(priv->zone);
-		return (ENOMEM);
-	}
-
 	/* Initialize hash. */
 	for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++) {
 		mtx_init(&hsh->mtx, "hash mutex", NULL, MTX_DEF);
 		TAILQ_INIT(&hsh->head);
 	}
 
-	mtx_init(&priv->export_mtx, "export dgram lock", NULL, MTX_DEF);
+#ifdef INET6
+	/* Allocate hash. */
+	priv->hash6 = malloc(NBUCKETS * sizeof(struct flow6_hash_entry),
+	    M_NETFLOW_HASH, M_WAITOK | M_ZERO);
+
+	/* Initialize hash. */
+	for (i = 0, hsh6 = priv->hash6; i < NBUCKETS; i++, hsh6++) {
+		mtx_init(&hsh6->mtx, "hash mutex", NULL, MTX_DEF);
+		TAILQ_INIT(&hsh6->head);
+	}
+#endif
+
+	ng_netflow_v9_cache_init(priv);
+	CTR0(KTR_NET, "ng_netflow startup()");
 
 	return (0);
 }
 
+/* Initialize new FIB table for v5 and v9 */
+int
+ng_netflow_fib_init(priv_p priv, int fib)
+{
+	fib_export_p	fe = priv_to_fib(priv, fib);
+
+	CTR1(KTR_NET, "ng_netflow(): fib init: %d", fib);
+
+	if (fe != NULL)
+		return (0);
+
+	if ((fe = malloc(sizeof(struct fib_export), M_NETGRAPH, M_NOWAIT | M_ZERO)) == NULL)
+		return (1);
+
+	mtx_init(&fe->export_mtx, "export dgram lock", NULL, MTX_DEF);
+	mtx_init(&fe->export9_mtx, "export9 dgram lock", NULL, MTX_DEF);
+	fe->fib = fib;
+	fe->domain_id = fib;
+
+	if (atomic_cmpset_ptr((volatile uintptr_t *)&priv->fib_data[fib], (uintptr_t)NULL, (uintptr_t)fe) == 0) {
+		/* FIB already set up by other ISR */
+		CTR3(KTR_NET, "ng_netflow(): fib init: %d setup %p but got %p", fib, fe, priv_to_fib(priv, fib));
+		mtx_destroy(&fe->export_mtx);
+		mtx_destroy(&fe->export9_mtx);
+		free(fe, M_NETGRAPH);
+	} else {
+		/* Increase counter for statistics */
+		CTR3(KTR_NET, "ng_netflow(): fib %d setup to %p (%p)", fib, fe, priv_to_fib(priv, fib));
+		atomic_fetchadd_32(&priv->info.nfinfo_alloc_fibs, 1);
+	}
+	
+	return (0);
+}
+
 /* Free all flow cache memory. Called from node close method. */
 void
 ng_netflow_cache_flush(priv_p priv)
 {
 	struct flow_entry	*fle, *fle1;
 	struct flow_hash_entry	*hsh;
-	item_p			item = NULL;
+#ifdef INET6
+	struct flow6_entry	*fle6, *fle61;
+	struct flow6_hash_entry	*hsh6;
+#endif
+	struct netflow_export_item exp;
+	fib_export_p fe;
 	int i;
 
+	bzero(&exp, sizeof(exp));
+
 	/*
 	 * We are going to free probably billable data.
 	 * Expire everything before freeing it.
@@ -368,36 +602,67 @@ ng_netflow_cache_flush(priv_p priv)
 	for (hsh = priv->hash, i = 0; i < NBUCKETS; hsh++, i++)
 		TAILQ_FOREACH_SAFE(fle, &hsh->head, fle_hash, fle1) {
 			TAILQ_REMOVE(&hsh->head, fle, fle_hash);
-			expire_flow(priv, &item, fle, NG_QUEUE);
+			fe = priv_to_fib(priv, fle->f.r.fib);
+			expire_flow(priv, fe, fle, NG_QUEUE);
 		}
-
-	if (item != NULL)
-		export_send(priv, item, NG_QUEUE);
+#ifdef INET6
+	for (hsh6 = priv->hash6, i = 0; i < NBUCKETS; hsh6++, i++)
+		TAILQ_FOREACH_SAFE(fle6, &hsh6->head, fle6_hash, fle61) {
+			TAILQ_REMOVE(&hsh6->head, fle6, fle6_hash);
+			fe = priv_to_fib(priv, fle6->f.r.fib);
+			expire_flow(priv, fe, (struct flow_entry *)fle6, NG_QUEUE);
+		}
+#endif
 
 	uma_zdestroy(priv->zone);
-
 	/* Destroy hash mutexes. */
 	for (i = 0, hsh = priv->hash; i < NBUCKETS; i++, hsh++)
 		mtx_destroy(&hsh->mtx);
 
 	/* Free hash memory. */
-	if (priv->hash)
+	if (priv->hash != NULL)
 		free(priv->hash, M_NETFLOW_HASH);
+#ifdef INET6
+	uma_zdestroy(priv->zone6);
+	/* Destroy hash mutexes. */
+	for (i = 0, hsh6 = priv->hash6; i < NBUCKETS; i++, hsh6++)
+		mtx_destroy(&hsh6->mtx);
+
+	/* Free hash memory. */
+	if (priv->hash6 != NULL)
+		free(priv->hash6, M_NETFLOW_HASH);
+#endif
+
+	for (i = 0; i < RT_NUMFIBS; i++) {
+		if ((fe = priv_to_fib(priv, i)) == NULL)
+			continue;
 
-	mtx_destroy(&priv->export_mtx);
+		if (fe->exp.item != NULL)
+			export_send(priv, fe, fe->exp.item, NG_QUEUE);
+
+		if (fe->exp.item9 != NULL)
+			export9_send(priv, fe, fe->exp.item9, fe->exp.item9_opt, NG_QUEUE);
+
+		mtx_destroy(&fe->export_mtx);
+		mtx_destroy(&fe->export9_mtx);
+		free(fe, M_NETGRAPH);
+	}
+
+	ng_netflow_v9_cache_flush(priv);
 }
 
 /* Insert packet from into flow cache. */
 int
-ng_netflow_flow_add(priv_p priv, struct ip *ip, unsigned int src_if_index)
+ng_netflow_flow_add(priv_p priv, fib_export_p fe, struct ip *ip, caddr_t upper_ptr, uint8_t upper_proto, 
+		uint8_t is_frag, unsigned int src_if_index)
 {
 	register struct flow_entry	*fle, *fle1;
-	struct flow_hash_entry		*hsh;
+	struct flow_hash_entry	*hsh;
 	struct flow_rec		r;
-	item_p			item = NULL;
 	int			hlen, plen;
 	int			error = 0;
 	uint8_t			tcp_flags = 0;
+	uint16_t		eproto;
 
 	/* Try to fill flow_rec r */
 	bzero(&r, sizeof(r));
@@ -411,8 +676,13 @@ ng_netflow_flow_add(priv_p priv, struct 
 	if (hlen < sizeof(struct ip))
 		return (EINVAL);
 
+	eproto = ETHERTYPE_IP;
+	/* Assume L4 template by default */
+	r.flow_type = NETFLOW_V9_FLOW_V4_L4;
+
 	r.r_src = ip->ip_src;
 	r.r_dst = ip->ip_dst;
+	r.fib = fe->fib;
 
 	/* save packet length */
 	plen = ntohs(ip->ip_len);
@@ -448,8 +718,8 @@ ng_netflow_flow_add(priv_p priv, struct 
 			break;
 		}
 
-	/* Update node statistics. XXX: race... */
-	priv->info.nfinfo_packets ++;
+	atomic_fetchadd_32(&priv->info.nfinfo_packets, 1);
+	/* XXX: atomic */
 	priv->info.nfinfo_bytes += plen;
 
 	/* Find hash slot. */
@@ -468,7 +738,7 @@ ng_netflow_flow_add(priv_p priv, struct 
 			break;
 		if ((INACTIVE(fle) && SMALL(fle)) || AGED(fle)) {
 			TAILQ_REMOVE(&hsh->head, fle, fle_hash);
-			expire_flow(priv, &item, fle, NG_QUEUE);
+			expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, NG_QUEUE);
 			atomic_add_32(&priv->info.nfinfo_act_exp, 1);
 		}
 	}
@@ -487,9 +757,9 @@ ng_netflow_flow_add(priv_p priv, struct 
 		 * - it is going to overflow counter
 		 */
 		if (tcp_flags & TH_FIN || tcp_flags & TH_RST || AGED(fle) ||
-		    (fle->f.bytes >= (UINT_MAX - IF_MAXMTU)) ) {
+		    (fle->f.bytes >= (CNTR_MAX - IF_MAXMTU)) ) {
 			TAILQ_REMOVE(&hsh->head, fle, fle_hash);
-			expire_flow(priv, &item, fle, NG_QUEUE);
+			expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, NG_QUEUE);
 			atomic_add_32(&priv->info.nfinfo_act_exp, 1);
 		} else {
 			/*
@@ -507,24 +777,144 @@ ng_netflow_flow_add(priv_p priv, struct 
 
 	mtx_unlock(&hsh->mtx);
 
-	if (item != NULL)
-		return_export_dgram(priv, item, NG_QUEUE);
+	return (error);
+}
+
+#ifdef INET6
+/* Insert IPv6 packet from into flow cache. */
+int
+ng_netflow_flow6_add(priv_p priv, fib_export_p fe, struct ip6_hdr *ip6, caddr_t upper_ptr, uint8_t upper_proto, 
+		uint8_t is_frag, unsigned int src_if_index)
+{
+	register struct flow6_entry	*fle6 = NULL, *fle61;
+	struct flow6_hash_entry		*hsh6;
+	struct flow6_rec		r;
+	int			plen;
+	int			error = 0;
+	uint8_t			tcp_flags = 0;
+
+	/* check version */
+	if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION)
+		return (EINVAL);
+
+	bzero(&r, sizeof(r));
+
+	r.src.r_src6 = ip6->ip6_src;
+	r.dst.r_dst6 = ip6->ip6_dst;
+	r.fib = fe->fib;
+
+	/* Assume L4 template by default */
+	r.flow_type = NETFLOW_V9_FLOW_V6_L4;
+
+	/* save packet length */
+	plen = ntohs(ip6->ip6_plen) + sizeof(struct ip6_hdr);
+
+	/* XXX: set DSCP/CoS value */
+#if 0
+	r.r_tos = ip->ip_tos;
+#endif
+	if (is_frag == 0) {
+		switch(upper_proto) {
+		case IPPROTO_TCP:
+		{
+			register struct tcphdr *tcp;
+
+			tcp = (struct tcphdr *)upper_ptr;
+			r.r_ports = *(uint32_t *)upper_ptr;
+			tcp_flags = tcp->th_flags;
+			break;
+		}
+ 		case IPPROTO_UDP:
+		case IPPROTO_SCTP:
+		{
+			r.r_ports = *(uint32_t *)upper_ptr;
+			break;
+		}
+
+		}
+	}	
+
+	r.r_ip_p = upper_proto;
+	r.r_i_ifx = src_if_index;
+ 
+	atomic_fetchadd_32(&priv->info.nfinfo_packets6, 1);
+	/* XXX: atomic */
+	priv->info.nfinfo_bytes6 += plen;
+
+	/* Find hash slot. */
+	hsh6 = &priv->hash6[ip6_hash(&r)];
+
+	mtx_lock(&hsh6->mtx);
+
+	/*
+	 * Go through hash and find our entry. If we encounter an
+	 * entry, that should be expired, purge it. We do a reverse
+	 * search since most active entries are first, and most
+	 * searches are done on most active entries.
+	 */
+	TAILQ_FOREACH_REVERSE_SAFE(fle6, &hsh6->head, f6head, fle6_hash, fle61) {
+		if (fle6->f.version != IP6VERSION)
+			continue;
+		if (bcmp(&r, &fle6->f.r, sizeof(struct flow6_rec)) == 0)
+			break;
+		if ((INACTIVE(fle6) && SMALL(fle6)) || AGED(fle6)) {
+			TAILQ_REMOVE(&hsh6->head, fle6, fle6_hash);
+			expire_flow(priv, priv_to_fib(priv, fle6->f.r.fib), (struct flow_entry *)fle6, NG_QUEUE);
+			atomic_add_32(&priv->info.nfinfo_act_exp, 1);
+		}
+	}
+
+	if (fle6 != NULL) {			/* An existent entry. */
+
+		fle6->f.bytes += plen;
+		fle6->f.packets ++;
+		fle6->f.tcp_flags |= tcp_flags;
+		fle6->f.last = time_uptime;
+
+		/*
+		 * We have the following reasons to expire flow in active way:
+		 * - it hit active timeout
+		 * - a TCP connection closed
+		 * - it is going to overflow counter
+		 */
+		if (tcp_flags & TH_FIN || tcp_flags & TH_RST || AGED(fle6) ||
+		    (fle6->f.bytes >= (CNTR_MAX - IF_MAXMTU)) ) {
+			TAILQ_REMOVE(&hsh6->head, fle6, fle6_hash);
+			expire_flow(priv, priv_to_fib(priv, fle6->f.r.fib), (struct flow_entry *)fle6, NG_QUEUE);
+			atomic_add_32(&priv->info.nfinfo_act_exp, 1);
+		} else {
+			/*
+			 * It is the newest, move it to the tail,
+			 * if it isn't there already. Next search will
+			 * locate it quicker.
+			 */
+			if (fle6 != TAILQ_LAST(&hsh6->head, f6head)) {
+				TAILQ_REMOVE(&hsh6->head, fle6, fle6_hash);
+				TAILQ_INSERT_TAIL(&hsh6->head, fle6, fle6_hash);
+			}
+		}
+	} else				/* A new flow entry. */
+		error = hash6_insert(priv, hsh6, &r, plen, tcp_flags);
+
+	mtx_unlock(&hsh6->mtx);
 
 	return (error);
 }
+#endif
 
 /*
  * Return records from cache to userland.
  *
  * TODO: matching particular IP should be done in kernel, here.
+ * XXX: IPv6 flows will return random data
  */
 int
 ng_netflow_flow_show(priv_p priv, uint32_t last, struct ng_mesg *resp)
 {
-	struct flow_hash_entry *hsh;
-	struct flow_entry *fle;
-	struct ngnf_flows *data;
-	int i;
+	struct flow_hash_entry	*hsh;
+	struct flow_entry	*fle;
+	struct ngnf_flows	*data;
+	int	i;
 
 	data = (struct ngnf_flows *)resp->data;
 	data->last = 0;
@@ -579,7 +969,7 @@ ng_netflow_flow_show(priv_p priv, uint32
 
 /* We have full datagram in privdata. Send it to export hook. */
 static int
-export_send(priv_p priv, item_p item, int flags)
+export_send(priv_p priv, fib_export_p fe, item_p item, int flags)
 {
 	struct mbuf *m = NGI_M(item);
 	struct netflow_v5_export_dgram *dgram = mtod(m,
@@ -598,9 +988,9 @@ export_send(priv_p priv, item_p item, in
 	header->unix_secs  = htonl(ts.tv_sec);
 	header->unix_nsecs = htonl(ts.tv_nsec);
 	header->engine_type = 0;
-	header->engine_id = 0;
+	header->engine_id = fe->domain_id;
 	header->pad = 0;
-	header->flow_seq = htonl(atomic_fetchadd_32(&priv->flow_seq,
+	header->flow_seq = htonl(atomic_fetchadd_32(&fe->flow_seq,
 	    header->count));
 	header->count = htons(header->count);
 
@@ -663,8 +1053,11 @@ ng_netflow_expire(void *arg)
 {
 	struct flow_entry	*fle, *fle1;
 	struct flow_hash_entry	*hsh;
+#ifdef INET6	
+	struct flow6_entry	*fle6, *fle61;
+	struct flow6_hash_entry	*hsh6;
+#endif	
 	priv_p			priv = (priv_p )arg;
-	item_p			item = NULL;
 	uint32_t		used;
 	int			i;
 
@@ -697,7 +1090,7 @@ ng_netflow_expire(void *arg)
 			if ((INACTIVE(fle) && (SMALL(fle) ||
 			    (used > (NBUCKETS*2)))) || AGED(fle)) {
 				TAILQ_REMOVE(&hsh->head, fle, fle_hash);
-				expire_flow(priv, &item, fle, NG_NOFLAGS);
+				expire_flow(priv, priv_to_fib(priv, fle->f.r.fib), fle, NG_NOFLAGS);
 				used--;
 				atomic_add_32(&priv->info.nfinfo_inact_exp, 1);
 			}
@@ -705,8 +1098,41 @@ ng_netflow_expire(void *arg)
 		mtx_unlock(&hsh->mtx);
 	}
 
-	if (item != NULL)
-		return_export_dgram(priv, item, NG_NOFLAGS);
+#ifdef INET6
+	for (hsh6 = priv->hash6, i = 0; i < NBUCKETS; hsh6++, i++) {
+		/*
+		 * Skip entries, that are already being worked on.
+		 */
+		if (mtx_trylock(&hsh6->mtx) == 0)
+			continue;
+
+		used = atomic_load_acq_32(&priv->info.nfinfo_used6);
+		TAILQ_FOREACH_SAFE(fle6, &hsh6->head, fle6_hash, fle61) {
+			/*
+			 * Interrupt thread wants this entry!
+			 * Quick! Quick! Bail out!
+			 */
+			if (hsh6->mtx.mtx_lock & MTX_CONTESTED)
+				break;
+
+			/*
+			 * Don't expire aggressively while hash collision
+			 * ratio is predicted small.
+			 */
+			if (used <= (NBUCKETS*2) && !INACTIVE(fle6))
+				break;
+
+			if ((INACTIVE(fle6) && (SMALL(fle6) ||
+			    (used > (NBUCKETS*2)))) || AGED(fle6)) {
+				TAILQ_REMOVE(&hsh6->head, fle6, fle6_hash);
+				expire_flow(priv, priv_to_fib(priv, fle6->f.r.fib), (struct flow_entry *)fle6, NG_NOFLAGS);
+				used--;
+				atomic_add_32(&priv->info.nfinfo_inact_exp, 1);
+			}
+		}
+		mtx_unlock(&hsh6->mtx);
+	}
+#endif
 
 	/* Schedule next expire. */
 	callout_reset(&priv->exp_callout, (1*hz), &ng_netflow_expire,

Modified: head/sys/netgraph/netflow/netflow.h
==============================================================================
--- head/sys/netgraph/netflow/netflow.h	Wed Mar  2 16:06:57 2011	(r219181)
+++ head/sys/netgraph/netflow/netflow.h	Wed Mar  2 16:15:11 2011	(r219182)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2010-2011 Alexander V. Chernikov 
  * Copyright (c) 2004 Gleb Smirnoff 
  * All rights reserved.
  *
@@ -42,10 +43,14 @@
  * Datagram Formats.
  * http://www.cisco.com/en/US/products/sw/netmgtsw/ps1964/products_user_guide_chapter09186a00803f3147.html#wp26453
  *
+ * Cisco Systems NetFlow Services Export Version 9
+ * http://www.ietf.org/rfc/rfc3954.txt
+ *
  */
 
 #define NETFLOW_V1 1
 #define NETFLOW_V5 5
+#define NETFLOW_V9 9
 
 struct netflow_v1_header
 {
@@ -69,6 +74,16 @@ struct netflow_v5_header
   uint16_t pad;		/* Pad to word boundary */
 } __attribute__((__packed__));
 
+struct netflow_v9_header
+{
+  uint16_t version;	/* NetFlow version */
+  uint16_t count;	/* Total number of records in packet */
+  uint32_t sys_uptime;	/* System uptime */
+  uint32_t unix_secs;	/* Current seconds since 0000 UTC 1970 */
+  uint32_t seq_num;	/* Sequence number */
+  uint32_t source_id;	/* Observation Domain id */
+} __attribute__((__packed__));
+
 struct netflow_v1_record
 {
   uint32_t src_addr;	/* Source IP address */
@@ -127,3 +142,73 @@ struct netflow_v5_export_dgram {
 	struct netflow_v5_header	header;
 	struct netflow_v5_record	r[NETFLOW_V5_MAX_RECORDS];
 } __attribute__((__packed__));
+
+
+/* RFC3954 field definitions */
+#define NETFLOW_V9_FIELD_IN_BYTES		1	/* Input bytes count for a flow. Default 4, can be 8 */
+#define NETFLOW_V9_FIELD_IN_PKTS		2	/* Incoming counter with number of packets associated with an IP Flow. Default 4 */
+#define NETFLOW_V9_FIELD_FLOWS			3	/* Number of Flows that were aggregated. Default 4 */
+#define NETFLOW_V9_FIELD_PROTOCOL		4	/* IP protocol byte. 1 */
+#define NETFLOW_V9_FIELD_TOS			5	/* Type of service byte setting when entering the incoming interface. 1 */
+#define NETFLOW_V9_FIELD_TCP_FLAGS		6	/* TCP flags; cumulative of all the TCP flags seen in this Flow. 1 */
+#define NETFLOW_V9_FIELD_L4_SRC_PORT		7	/* TCP/UDP source port number. 2 */
+#define NETFLOW_V9_FIELD_IPV4_SRC_ADDR		8	/* IPv4 source address. 4 */
+#define NETFLOW_V9_FIELD_SRC_MASK		9	/* The number of contiguous bits in the source subnet mask (i.e., the mask in slash notation). 1 */
+#define NETFLOW_V9_FIELD_INPUT_SNMP		10	/* Input interface index. Default 2 */
+#define NETFLOW_V9_FIELD_L4_DST_PORT		11	/* TCP/UDP destination port number. 2 */
+#define NETFLOW_V9_FIELD_IPV4_DST_ADDR		12	/* IPv4 destination address. 4 */
+#define NETFLOW_V9_FIELD_DST_MASK		13	/* The number of contiguous bits in the destination subnet mask (i.e., the mask in slash notation). 1 */
+#define NETFLOW_V9_FIELD_OUTPUT_SNMP		14	/* Output interface index. Default 2 */
+#define NETFLOW_V9_FIELD_IPV4_NEXT_HOP		15	/* IPv4 address of the next-hop router. 4 */
+#define NETFLOW_V9_FIELD_SRC_AS			16	/* Source BGP autonomous system number. Default 2, can be 4 */
+#define NETFLOW_V9_FIELD_DST_AS			17	/* Destination BGP autonomous system number. Default 2, can be 4 */
+#define NETFLOW_V9_FIELD_BGP_IPV4_NEXT_HOP	18	/* Next-hop router's IP address in the BGP domain. 4 */
+#define NETFLOW_V9_FIELD_MUL_DST_PKTS		19	/* IP multicast outgoing packet counter for packets associated with IP flow. Default 4 */
+#define NETFLOW_V9_FIELD_MUL_DST_BYTES		20	/* IP multicast outgoing Octet (byte) counter for the number of bytes associated with IP flow. Default 4 */
+#define NETFLOW_V9_FIELD_LAST_SWITCHED		21	/* sysUptime in msec at which the last packet of this Flow was switched. 4 */
+#define NETFLOW_V9_FIELD_FIRST_SWITCHED		22	/* sysUptime in msec at which the first packet of this Flow was switched. 4 */
+#define NETFLOW_V9_FIELD_OUT_BYTES		23	/* Outgoing counter for the number of bytes associated with an IP Flow. Default 4 */
+#define NETFLOW_V9_FIELD_OUT_PKTS		24	/* Outgoing counter for the number of packets associated with an IP Flow. Default 4 */
+#define NETFLOW_V9_FIELD_IPV6_SRC_ADDR		27	/* IPv6 source address. 16 */
+#define NETFLOW_V9_FIELD_IPV6_DST_ADDR		28	/* IPv6 destination address. 16 */
+#define NETFLOW_V9_FIELD_IPV6_SRC_MASK		29	/* Length of the IPv6 source mask in contiguous bits. 1 */
+#define NETFLOW_V9_FIELD_IPV6_DST_MASK		30	/* Length of the IPv6 destination mask in contiguous bits. 1 */
+#define NETFLOW_V9_FIELD_IPV6_FLOW_LABEL	31	/* IPv6 flow label as per RFC 2460 definition. 3 */
+#define NETFLOW_V9_FIELD_ICMP_TYPE		32	/* Internet Control Message Protocol (ICMP) packet type; reported as ICMP Type * 256 + ICMP code. 2 */
+#define NETFLOW_V9_FIELD_MUL_IGMP_TYPE		33	/* Internet Group Management Protocol (IGMP) packet type. 1 */
+#define NETFLOW_V9_FIELD_SAMPLING_INTERVAL	34	/* When using sampled NetFlow, the rate at which packets are sampled; for example, a value of 100 indicates that one of every hundred packets is sampled. 4 */
+#define NETFLOW_V9_FIELD_SAMPLING_ALGORITHM	35	/* For sampled NetFlow platform-wide: 0x01 deterministic sampling 0x02 random sampling. 1 */
+#define NETFLOW_V9_FIELD_FLOW_ACTIVE_TIMEOUT	36	/* Timeout value (in seconds) for active flow entries in the NetFlow cache. 2 */
+#define NETFLOW_V9_FIELD_FLOW_INACTIVE_TIMEOUT	37	/* Timeout value (in seconds) for inactive Flow entries in the NetFlow cache. 2 */
+#define NETFLOW_V9_FIELD_ENGINE_TYPE		38	/* Type of Flow switching engine (route processor, linecard, etc...). 1 */
+#define NETFLOW_V9_FIELD_ENGINE_ID		39	/* ID number of the Flow switching engine. 1 */
+#define NETFLOW_V9_FIELD_TOTAL_BYTES_EXP	40	/* Counter with for the number of bytes exported by the Observation Domain. Default 4 */
+#define NETFLOW_V9_FIELD_TOTAL_PKTS_EXP		41	/* Counter with for the number of packets exported by the Observation Domain. Default 4 */
+#define NETFLOW_V9_FIELD_TOTAL_FLOWS_EXP	42	/* Counter with for the number of flows exported by the Observation Domain. Default 4 */
+#define NETFLOW_V9_FIELD_MPLS_TOP_LABEL_TYPE	46	/* MPLS Top Label Type. 1 */
+#define NETFLOW_V9_FIELD_MPLS_TOP_LABEL_IP_ADDR	47	/* Forwarding Equivalent Class corresponding to the MPLS Top Label. 4 */
+#define NETFLOW_V9_FIELD_FLOW_SAMPLER_ID	48	/* Identifier shown in "show flow-sampler". 1 */
+#define NETFLOW_V9_FIELD_FLOW_SAMPLER_MODE	49	/* The type of algorithm used for sampling data. 2 */
+#define NETFLOW_V9_FIELD_FLOW_SAMPLER_RANDOM_INTERVAL		50	/* Packet interval at which to sample. 4. */
+#define NETFLOW_V9_FIELD_DST_TOS		55	/* Type of Service byte setting when exiting outgoing interface. 1. */
+#define NETFLOW_V9_FIELD_SRC_MAC		56	/* Source MAC Address. 6 */
+#define NETFLOW_V9_FIELD_DST_MAC		57	/* Destination MAC Address. 6 */
+#define NETFLOW_V9_FIELD_SRC_VLAN		58	/* Virtual LAN identifier associated with ingress interface. 2 */
+#define NETFLOW_V9_FIELD_DST_VLAN		59	/* Virtual LAN identifier associated with egress interface. 2 */
+#define NETFLOW_V9_FIELD_IP_PROTOCOL_VERSION	60	/* Internet Protocol Version. Set to 4 for IPv4, set to 6 for IPv6. If not present in the template, then version 4 is assumed. 1. */
+#define NETFLOW_V9_FIELD_DIRECTION		61	/* Flow direction: 0 - ingress flow 1 - egress flow. 1 */
+#define NETFLOW_V9_FIELD_IPV6_NEXT_HOP		62	/* IPv6 address of the next-hop router. 16 */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 16:16:09 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6979A1065673;
	Wed,  2 Mar 2011 16:16:09 +0000 (UTC)
	(envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 571278FC1F;
	Wed,  2 Mar 2011 16:16:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22GG9Jq021297;
	Wed, 2 Mar 2011 16:16:09 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22GG9Jr021295;
	Wed, 2 Mar 2011 16:16:09 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201103021616.p22GG9Jr021295@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Wed, 2 Mar 2011 16:16:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219183 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 16:16:09 -0000

Author: glebius
Date: Wed Mar  2 16:16:09 2011
New Revision: 219183
URL: http://svn.freebsd.org/changeset/base/219183

Log:
  Update manual: node now supports NetFlow v9.
  
  Submitted by:	Alexander V. Chernikov 

Modified:
  head/share/man/man4/ng_netflow.4

Modified: head/share/man/man4/ng_netflow.4
==============================================================================
--- head/share/man/man4/ng_netflow.4	Wed Mar  2 16:15:11 2011	(r219182)
+++ head/share/man/man4/ng_netflow.4	Wed Mar  2 16:16:09 2011	(r219183)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 8, 2008
+.Dd March 2, 2011
 .Dt NG_NETFLOW 4
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@ The
 node listens for incoming traffic and identifies unique flows in it.
 Flows are distinguished by endpoint IP addresses, TCP/UDP port numbers,
 ToS and input interface.
-Expired flows are exported out of the node in NetFlow version 5 UDP datagrams.
+Expired flows are exported out of the node in NetFlow version 5/9 UDP datagrams.
 Expiration reason can be one of the following:
 .Bl -dash
 .It
@@ -59,19 +59,24 @@ A flow was inactive for the specified pe
 The default is 15 seconds.
 .El
 .Pp
-Export information is stored in NetFlow version 5 datagrams.
+Node supports IPv6 accounting (NetFlow v9 only) and is aware of multiple fibs.
+Different fibs are mapped to different domain_id in NetFlow V9 and different engine_id in NetFlow V5.
+.Pp
 .Sh HOOKS
 This node type supports up to
 .Dv NG_NETFLOW_MAXIFACES
-hooks named
+(default 65536) hooks named
 .Va iface0 , iface1 ,
 etc.,
 and the same number of hooks named
 .Va out0 , out1 ,
 etc.,
-plus a single hook named
-.Va export .
-By default (ingress NetFlow enabled) node does NetFlow accounting of data
+plus two export hooks:
+.Va export 
+(for NetFlow version 5) and
+.Va export9 
+(for NetFlow version 9). Export can be done simultaneously for all supported
+export hooks. By default (ingress NetFlow enabled) node does NetFlow accounting of data
 received on
 .Va iface*
 hooks.
@@ -83,12 +88,12 @@ If data is received on
 hook, it is bypassed to corresponding
 .Va iface
 hook without any processing (egress NetFlow disabled by default).
-When full export datagram is built it is sent to the
+When full export datagram for an export protocol is built it is sent to the
 .Va export
+or
+.Va export9
 hook.
-In normal operation, the
-.Va export
-hook is connected to the
+In normal operation, one (or more) export hook is connected to the
 .Va inet/dgram/udp
 hook of the
 .Xr ng_ksocket 4
@@ -188,6 +193,33 @@ NG_NETFLOW_CONF_THISONCE defines that pa
 if it several times passes via exactly this netflow node. Last two options are
 important to avoid duplicate accounting when both ingress and egress NetFlow
 are enabled.
+.It Dv NGM_NETFLOW_SETTEMPLATE
+Sets various timeouts to announce data flow templates 
+(NetFlow v9-specific). This message requires
+.Vt "struct ng_netflow_settemplate"
+as an argument:
+.Bd -literal -offset 4n
+struct ng_netflow_settemplate {
+	uint16_t time;
+	uint16_t packets;
+};
+.Ed
+.Pp
+Value of time field represents time in seconds to re-announce data templates.
+Value of packets field represents maximum packets count between
+re-announcing data templates.
+.It Dv NGM_NETFLOW_SETMTU
+Sets export interface MTU to build packets of specified size (NetFlow v9-specific). 
+This message requires
+.Vt "struct ng_netflow_setmtu"
+as an argument:
+.Bd -literal -offset 4n
+struct ng_netflow_settemtu {
+	uint16_t mtu;
+};
+.Ed
+.Pp
+Default is 1500 bytes
 .It Dv NGM_NETFLOW_SHOW
 This control message asks a node to dump the entire contents of the flow cache.
 It is called from
@@ -219,6 +251,10 @@ commands are:
 .Qq Li "settimeouts { inactive = %u active = %u }"
 .It Dv NGM_NETFLOW_SETCONFIG
 .Qq Li "setconfig { iface = %u conf = %u }"
+.It Dv NGM_NETFLOW_SETTEMPLATE
+.Qq Li "settemplate { time = %u packets = %u }"
+.It Dv NGM_NETFLOW_SETMTU
+.Qq Li "setmtu { mtu = %u }"
 .El
 .Sh SHUTDOWN
 This node shuts down upon receipt of a
@@ -272,21 +308,29 @@ SEQ
 .Ed
 .Sh SEE ALSO
 .Xr netgraph 4 ,
+.Xr setfib 2 ,
 .Xr ng_ether 4 ,
 .Xr ng_iface 4 ,
 .Xr ng_ksocket 4 ,
 .Xr ng_tee 4 ,
 .Xr flowctl 8 ,
 .Xr ngctl 8
+.Rs
+.%A B. Claise, Ed
+.%T "Cisco Systems NetFlow Services Export Version 9"
+.%O RFC 3954
+.Re
 .Pp
-.Pa http://www.cisco.com/univercd/cc/td/doc/cisintwk/intsolns/netflsol/\:nfwhite.htm
+.Pa http://www.cisco.com/en/US/docs/ios/solutions_docs/netflow/nfwhite.html
 .Sh AUTHORS
 .An -nosplit
 The
 .Nm
 node type was written by
 .An Gleb Smirnoff Aq glebius@FreeBSD.org ,
-based on
+.An Alexander Motin Aq mav@FreeBSD.org ,
+.An Alexander Chernikov Aq melifaro@ipfw.ru .
+The initial code was based on
 .Nm ng_ipacct
 written by
 .An Roman V. Palagin Aq romanp@unshadow.net .
@@ -294,6 +338,7 @@ written by
 Cache snapshot obtained via
 .Dv NGM_NETFLOW_SHOW
 command may lack some percentage of entries under severe load.
+IPv6 flows are not shown.
 .Pp
 The
 .Nm

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 17:13:07 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EE021065672;
	Wed,  2 Mar 2011 17:13:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D25C8FC0C;
	Wed,  2 Mar 2011 17:13:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22HD71j025319;
	Wed, 2 Mar 2011 17:13:07 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22HD7fq025317;
	Wed, 2 Mar 2011 17:13:07 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103021713.p22HD7fq025317@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 2 Mar 2011 17:13:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219184 - head/usr.sbin/rtadvd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 17:13:07 -0000

Author: bz
Date: Wed Mar  2 17:13:07 2011
New Revision: 219184
URL: http://svn.freebsd.org/changeset/base/219184

Log:
  Prevent crashes from a race when (cloned) interfaces go away.
  
  PR:		bin/152143
  Submitted by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
  Tested by:	Przemyslaw Frasunek (przemyslaw frasunek.com)
  MFC after:	1 week

Modified:
  head/usr.sbin/rtadvd/rtadvd.c

Modified: head/usr.sbin/rtadvd/rtadvd.c
==============================================================================
--- head/usr.sbin/rtadvd/rtadvd.c	Wed Mar  2 16:16:09 2011	(r219183)
+++ head/usr.sbin/rtadvd/rtadvd.c	Wed Mar  2 17:13:07 2011	(r219184)
@@ -667,14 +667,16 @@ rtadvd_input()
 	}
 
 	/*
-	 * If we happen to receive data on an interface which is now down,
-	 * just discard the data.
+	 * If we happen to receive data on an interface which is now gone
+	 * or down, just discard the data.
 	 */
-	if ((iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) {
+	if (iflist[pi->ipi6_ifindex] == NULL ||
+	    (iflist[pi->ipi6_ifindex]->ifm_flags & IFF_UP) == 0) {
 		syslog(LOG_INFO,
 		       "<%s> received data on a disabled interface (%s)",
 		       __func__,
-		       if_indextoname(pi->ipi6_ifindex, ifnamebuf));
+		       (iflist[pi->ipi6_ifindex] == NULL) ? "[gone]" :
+			    if_indextoname(pi->ipi6_ifindex, ifnamebuf));
 		return;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 17:19:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61F22106566B;
	Wed,  2 Mar 2011 17:19:55 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E4638FC1D;
	Wed,  2 Mar 2011 17:19:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22HJtfL025863;
	Wed, 2 Mar 2011 17:19:55 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22HJsAk025857;
	Wed, 2 Mar 2011 17:19:54 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103021719.p22HJsAk025857@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 2 Mar 2011 17:19:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219185 - in head/sys: conf dev/ath modules/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 17:19:55 -0000

Author: adrian
Date: Wed Mar  2 17:19:54 2011
New Revision: 219185
URL: http://svn.freebsd.org/changeset/base/219185

Log:
  Break the keycache management functions out into if_ath_keycache.c .

Added:
  head/sys/dev/ath/if_ath_keycache.c   (contents, props changed)
  head/sys/dev/ath/if_ath_keycache.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/if_ath.c
  head/sys/modules/ath/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Mar  2 17:13:07 2011	(r219184)
+++ head/sys/conf/files	Wed Mar  2 17:19:54 2011	(r219185)
@@ -574,6 +574,8 @@ dev/ath/if_ath.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_debug.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
+dev/ath/if_ath_keycache.c	optional ath \
+	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx.c		optional ath \
 	compile-with "${NORMAL_C} -I$S/dev/ath"
 dev/ath/if_ath_tx_ht.c		optional ath \

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Wed Mar  2 17:13:07 2011	(r219184)
+++ head/sys/dev/ath/if_ath.c	Wed Mar  2 17:19:54 2011	(r219185)
@@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef ATH_TX99_DIAG
 #include 
@@ -130,15 +131,6 @@ static int	ath_ioctl(struct ifnet *, u_l
 static void	ath_fatal_proc(void *, int);
 static void	ath_bmiss_vap(struct ieee80211vap *);
 static void	ath_bmiss_proc(void *, int);
-static int	ath_keyset(struct ath_softc *, const struct ieee80211_key *,
-			struct ieee80211_node *);
-static int	ath_key_alloc(struct ieee80211vap *,
-			struct ieee80211_key *,
-			ieee80211_keyix *, ieee80211_keyix *);
-static int	ath_key_delete(struct ieee80211vap *,
-			const struct ieee80211_key *);
-static int	ath_key_set(struct ieee80211vap *, const struct ieee80211_key *,
-			const u_int8_t mac[IEEE80211_ADDR_LEN]);
 static void	ath_key_update_begin(struct ieee80211vap *);
 static void	ath_key_update_end(struct ieee80211vap *);
 static void	ath_update_mcast(struct ifnet *);
@@ -1851,424 +1843,6 @@ ath_media_change(struct ifnet *ifp)
 	return (error == ENETRESET ? 0 : error);
 }
 
-#ifdef ATH_DEBUG
-static void
-ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix,
-	const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
-{
-	static const char *ciphers[] = {
-		"WEP",
-		"AES-OCB",
-		"AES-CCM",
-		"CKIP",
-		"TKIP",
-		"CLR",
-	};
-	int i, n;
-
-	printf("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]);
-	for (i = 0, n = hk->kv_len; i < n; i++)
-		printf("%02x", hk->kv_val[i]);
-	printf(" mac %s", ether_sprintf(mac));
-	if (hk->kv_type == HAL_CIPHER_TKIP) {
-		printf(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
-		for (i = 0; i < sizeof(hk->kv_mic); i++)
-			printf("%02x", hk->kv_mic[i]);
-		if (!sc->sc_splitmic) {
-			printf(" txmic ");
-			for (i = 0; i < sizeof(hk->kv_txmic); i++)
-				printf("%02x", hk->kv_txmic[i]);
-		}
-	}
-	printf("\n");
-}
-#endif
-
-/*
- * Set a TKIP key into the hardware.  This handles the
- * potential distribution of key state to multiple key
- * cache slots for TKIP.
- */
-static int
-ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k,
-	HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
-{
-#define	IEEE80211_KEY_XR	(IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)
-	static const u_int8_t zerobssid[IEEE80211_ADDR_LEN];
-	struct ath_hal *ah = sc->sc_ah;
-
-	KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP,
-		("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher));
-	if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) {
-		if (sc->sc_splitmic) {
-			/*
-			 * TX key goes at first index, RX key at the rx index.
-			 * The hal handles the MIC keys at index+64.
-			 */
-			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic));
-			KEYPRINTF(sc, k->wk_keyix, hk, zerobssid);
-			if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid))
-				return 0;
-
-			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
-			KEYPRINTF(sc, k->wk_keyix+32, hk, mac);
-			/* XXX delete tx key on failure? */
-			return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac);
-		} else {
-			/*
-			 * Room for both TX+RX MIC keys in one key cache
-			 * slot, just set key at the first index; the hal
-			 * will handle the rest.
-			 */
-			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
-			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
-			KEYPRINTF(sc, k->wk_keyix, hk, mac);
-			return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
-		}
-	} else if (k->wk_flags & IEEE80211_KEY_XMIT) {
-		if (sc->sc_splitmic) {
-			/*
-			 * NB: must pass MIC key in expected location when
-			 * the keycache only holds one MIC key per entry.
-			 */
-			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_txmic));
-		} else
-			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
-		KEYPRINTF(sc, k->wk_keyix, hk, mac);
-		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
-	} else if (k->wk_flags & IEEE80211_KEY_RECV) {
-		memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
-		KEYPRINTF(sc, k->wk_keyix, hk, mac);
-		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
-	}
-	return 0;
-#undef IEEE80211_KEY_XR
-}
-
-/*
- * Set a net80211 key into the hardware.  This handles the
- * potential distribution of key state to multiple key
- * cache slots for TKIP with hardware MIC support.
- */
-static int
-ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k,
-	struct ieee80211_node *bss)
-{
-#define	N(a)	(sizeof(a)/sizeof(a[0]))
-	static const u_int8_t ciphermap[] = {
-		HAL_CIPHER_WEP,		/* IEEE80211_CIPHER_WEP */
-		HAL_CIPHER_TKIP,	/* IEEE80211_CIPHER_TKIP */
-		HAL_CIPHER_AES_OCB,	/* IEEE80211_CIPHER_AES_OCB */
-		HAL_CIPHER_AES_CCM,	/* IEEE80211_CIPHER_AES_CCM */
-		(u_int8_t) -1,		/* 4 is not allocated */
-		HAL_CIPHER_CKIP,	/* IEEE80211_CIPHER_CKIP */
-		HAL_CIPHER_CLR,		/* IEEE80211_CIPHER_NONE */
-	};
-	struct ath_hal *ah = sc->sc_ah;
-	const struct ieee80211_cipher *cip = k->wk_cipher;
-	u_int8_t gmac[IEEE80211_ADDR_LEN];
-	const u_int8_t *mac;
-	HAL_KEYVAL hk;
-
-	memset(&hk, 0, sizeof(hk));
-	/*
-	 * Software crypto uses a "clear key" so non-crypto
-	 * state kept in the key cache are maintained and
-	 * so that rx frames have an entry to match.
-	 */
-	if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) == 0) {
-		KASSERT(cip->ic_cipher < N(ciphermap),
-			("invalid cipher type %u", cip->ic_cipher));
-		hk.kv_type = ciphermap[cip->ic_cipher];
-		hk.kv_len = k->wk_keylen;
-		memcpy(hk.kv_val, k->wk_key, k->wk_keylen);
-	} else
-		hk.kv_type = HAL_CIPHER_CLR;
-
-	if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) {
-		/*
-		 * Group keys on hardware that supports multicast frame
-		 * key search use a MAC that is the sender's address with
-		 * the multicast bit set instead of the app-specified address.
-		 */
-		IEEE80211_ADDR_COPY(gmac, bss->ni_macaddr);
-		gmac[0] |= 0x01;
-		mac = gmac;
-	} else
-		mac = k->wk_macaddr;
-
-	if (hk.kv_type == HAL_CIPHER_TKIP &&
-	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
-		return ath_keyset_tkip(sc, k, &hk, mac);
-	} else {
-		KEYPRINTF(sc, k->wk_keyix, &hk, mac);
-		return ath_hal_keyset(ah, k->wk_keyix, &hk, mac);
-	}
-#undef N
-}
-
-/*
- * Allocate tx/rx key slots for TKIP.  We allocate two slots for
- * each key, one for decrypt/encrypt and the other for the MIC.
- */
-static u_int16_t
-key_alloc_2pair(struct ath_softc *sc,
-	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
-{
-#define	N(a)	(sizeof(a)/sizeof(a[0]))
-	u_int i, keyix;
-
-	KASSERT(sc->sc_splitmic, ("key cache !split"));
-	/* XXX could optimize */
-	for (i = 0; i < N(sc->sc_keymap)/4; i++) {
-		u_int8_t b = sc->sc_keymap[i];
-		if (b != 0xff) {
-			/*
-			 * One or more slots in this byte are free.
-			 */
-			keyix = i*NBBY;
-			while (b & 1) {
-		again:
-				keyix++;
-				b >>= 1;
-			}
-			/* XXX IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV */
-			if (isset(sc->sc_keymap, keyix+32) ||
-			    isset(sc->sc_keymap, keyix+64) ||
-			    isset(sc->sc_keymap, keyix+32+64)) {
-				/* full pair unavailable */
-				/* XXX statistic */
-				if (keyix == (i+1)*NBBY) {
-					/* no slots were appropriate, advance */
-					continue;
-				}
-				goto again;
-			}
-			setbit(sc->sc_keymap, keyix);
-			setbit(sc->sc_keymap, keyix+64);
-			setbit(sc->sc_keymap, keyix+32);
-			setbit(sc->sc_keymap, keyix+32+64);
-			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
-				"%s: key pair %u,%u %u,%u\n",
-				__func__, keyix, keyix+64,
-				keyix+32, keyix+32+64);
-			*txkeyix = keyix;
-			*rxkeyix = keyix+32;
-			return 1;
-		}
-	}
-	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__);
-	return 0;
-#undef N
-}
-
-/*
- * Allocate tx/rx key slots for TKIP.  We allocate two slots for
- * each key, one for decrypt/encrypt and the other for the MIC.
- */
-static u_int16_t
-key_alloc_pair(struct ath_softc *sc,
-	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
-{
-#define	N(a)	(sizeof(a)/sizeof(a[0]))
-	u_int i, keyix;
-
-	KASSERT(!sc->sc_splitmic, ("key cache split"));
-	/* XXX could optimize */
-	for (i = 0; i < N(sc->sc_keymap)/4; i++) {
-		u_int8_t b = sc->sc_keymap[i];
-		if (b != 0xff) {
-			/*
-			 * One or more slots in this byte are free.
-			 */
-			keyix = i*NBBY;
-			while (b & 1) {
-		again:
-				keyix++;
-				b >>= 1;
-			}
-			if (isset(sc->sc_keymap, keyix+64)) {
-				/* full pair unavailable */
-				/* XXX statistic */
-				if (keyix == (i+1)*NBBY) {
-					/* no slots were appropriate, advance */
-					continue;
-				}
-				goto again;
-			}
-			setbit(sc->sc_keymap, keyix);
-			setbit(sc->sc_keymap, keyix+64);
-			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
-				"%s: key pair %u,%u\n",
-				__func__, keyix, keyix+64);
-			*txkeyix = *rxkeyix = keyix;
-			return 1;
-		}
-	}
-	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__);
-	return 0;
-#undef N
-}
-
-/*
- * Allocate a single key cache slot.
- */
-static int
-key_alloc_single(struct ath_softc *sc,
-	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
-{
-#define	N(a)	(sizeof(a)/sizeof(a[0]))
-	u_int i, keyix;
-
-	/* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */
-	for (i = 0; i < N(sc->sc_keymap); i++) {
-		u_int8_t b = sc->sc_keymap[i];
-		if (b != 0xff) {
-			/*
-			 * One or more slots are free.
-			 */
-			keyix = i*NBBY;
-			while (b & 1)
-				keyix++, b >>= 1;
-			setbit(sc->sc_keymap, keyix);
-			DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: key %u\n",
-				__func__, keyix);
-			*txkeyix = *rxkeyix = keyix;
-			return 1;
-		}
-	}
-	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of space\n", __func__);
-	return 0;
-#undef N
-}
-
-/*
- * Allocate one or more key cache slots for a uniacst key.  The
- * key itself is needed only to identify the cipher.  For hardware
- * TKIP with split cipher+MIC keys we allocate two key cache slot
- * pairs so that we can setup separate TX and RX MIC keys.  Note
- * that the MIC key for a TKIP key at slot i is assumed by the
- * hardware to be at slot i+64.  This limits TKIP keys to the first
- * 64 entries.
- */
-static int
-ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
-	ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix)
-{
-	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
-
-	/*
-	 * Group key allocation must be handled specially for
-	 * parts that do not support multicast key cache search
-	 * functionality.  For those parts the key id must match
-	 * the h/w key index so lookups find the right key.  On
-	 * parts w/ the key search facility we install the sender's
-	 * mac address (with the high bit set) and let the hardware
-	 * find the key w/o using the key id.  This is preferred as
-	 * it permits us to support multiple users for adhoc and/or
-	 * multi-station operation.
-	 */
-	if (k->wk_keyix != IEEE80211_KEYIX_NONE) {
-		/*
-		 * Only global keys should have key index assigned.
-		 */
-		if (!(&vap->iv_nw_keys[0] <= k &&
-		      k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) {
-			/* should not happen */
-			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
-				"%s: bogus group key\n", __func__);
-			return 0;
-		}
-		if (vap->iv_opmode != IEEE80211_M_HOSTAP ||
-		    !(k->wk_flags & IEEE80211_KEY_GROUP) ||
-		    !sc->sc_mcastkey) {
-			/*
-			 * XXX we pre-allocate the global keys so
-			 * have no way to check if they've already
-			 * been allocated.
-			 */
-			*keyix = *rxkeyix = k - vap->iv_nw_keys;
-			return 1;
-		}
-		/*
-		 * Group key and device supports multicast key search.
-		 */
-		k->wk_keyix = IEEE80211_KEYIX_NONE;
-	}
-
-	/*
-	 * We allocate two pair for TKIP when using the h/w to do
-	 * the MIC.  For everything else, including software crypto,
-	 * we allocate a single entry.  Note that s/w crypto requires
-	 * a pass-through slot on the 5211 and 5212.  The 5210 does
-	 * not support pass-through cache entries and we map all
-	 * those requests to slot 0.
-	 */
-	if (k->wk_flags & IEEE80211_KEY_SWCRYPT) {
-		return key_alloc_single(sc, keyix, rxkeyix);
-	} else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP &&
-	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
-		if (sc->sc_splitmic)
-			return key_alloc_2pair(sc, keyix, rxkeyix);
-		else
-			return key_alloc_pair(sc, keyix, rxkeyix);
-	} else {
-		return key_alloc_single(sc, keyix, rxkeyix);
-	}
-}
-
-/*
- * Delete an entry in the key cache allocated by ath_key_alloc.
- */
-static int
-ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
-{
-	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
-	struct ath_hal *ah = sc->sc_ah;
-	const struct ieee80211_cipher *cip = k->wk_cipher;
-	u_int keyix = k->wk_keyix;
-
-	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix);
-
-	ath_hal_keyreset(ah, keyix);
-	/*
-	 * Handle split tx/rx keying required for TKIP with h/w MIC.
-	 */
-	if (cip->ic_cipher == IEEE80211_CIPHER_TKIP &&
-	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic)
-		ath_hal_keyreset(ah, keyix+32);		/* RX key */
-	if (keyix >= IEEE80211_WEP_NKID) {
-		/*
-		 * Don't touch keymap entries for global keys so
-		 * they are never considered for dynamic allocation.
-		 */
-		clrbit(sc->sc_keymap, keyix);
-		if (cip->ic_cipher == IEEE80211_CIPHER_TKIP &&
-		    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
-			clrbit(sc->sc_keymap, keyix+64);	/* TX key MIC */
-			if (sc->sc_splitmic) {
-				/* +32 for RX key, +32+64 for RX key MIC */
-				clrbit(sc->sc_keymap, keyix+32);
-				clrbit(sc->sc_keymap, keyix+32+64);
-			}
-		}
-	}
-	return 1;
-}
-
-/*
- * Set the key cache contents for the specified key.  Key cache
- * slot(s) must already have been allocated by ath_key_alloc.
- */
-static int
-ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k,
-	const u_int8_t mac[IEEE80211_ADDR_LEN])
-{
-	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
-
-	return ath_keyset(sc, k, vap->iv_bss);
-}
-
 /*
  * Block/unblock tx+rx processing while a key change is done.
  * We assume the caller serializes key management operations

Added: head/sys/dev/ath/if_ath_keycache.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_keycache.c	Wed Mar  2 17:19:54 2011	(r219185)
@@ -0,0 +1,497 @@
+/*-
+ * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
+ * 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
+ *    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 NONINFRINGEMENT, 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.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+/*
+ * Driver for the Atheros Wireless LAN controller.
+ *
+ * This software is derived from work of Atsushi Onoe; his contribution
+ * is greatly appreciated.
+ */
+
+#include "opt_inet.h"
+#include "opt_ath.h"
+#include "opt_wlan.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+#ifdef ATH_DEBUG
+static void
+ath_keyprint(struct ath_softc *sc, const char *tag, u_int ix,
+	const HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
+{
+	static const char *ciphers[] = {
+		"WEP",
+		"AES-OCB",
+		"AES-CCM",
+		"CKIP",
+		"TKIP",
+		"CLR",
+	};
+	int i, n;
+
+	printf("%s: [%02u] %-7s ", tag, ix, ciphers[hk->kv_type]);
+	for (i = 0, n = hk->kv_len; i < n; i++)
+		printf("%02x", hk->kv_val[i]);
+	printf(" mac %s", ether_sprintf(mac));
+	if (hk->kv_type == HAL_CIPHER_TKIP) {
+		printf(" %s ", sc->sc_splitmic ? "mic" : "rxmic");
+		for (i = 0; i < sizeof(hk->kv_mic); i++)
+			printf("%02x", hk->kv_mic[i]);
+		if (!sc->sc_splitmic) {
+			printf(" txmic ");
+			for (i = 0; i < sizeof(hk->kv_txmic); i++)
+				printf("%02x", hk->kv_txmic[i]);
+		}
+	}
+	printf("\n");
+}
+#endif
+
+/*
+ * Set a TKIP key into the hardware.  This handles the
+ * potential distribution of key state to multiple key
+ * cache slots for TKIP.
+ */
+static int
+ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k,
+	HAL_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN])
+{
+#define	IEEE80211_KEY_XR	(IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)
+	static const u_int8_t zerobssid[IEEE80211_ADDR_LEN];
+	struct ath_hal *ah = sc->sc_ah;
+
+	KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP,
+		("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher));
+	if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) {
+		if (sc->sc_splitmic) {
+			/*
+			 * TX key goes at first index, RX key at the rx index.
+			 * The hal handles the MIC keys at index+64.
+			 */
+			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic));
+			KEYPRINTF(sc, k->wk_keyix, hk, zerobssid);
+			if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid))
+				return 0;
+
+			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
+			KEYPRINTF(sc, k->wk_keyix+32, hk, mac);
+			/* XXX delete tx key on failure? */
+			return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac);
+		} else {
+			/*
+			 * Room for both TX+RX MIC keys in one key cache
+			 * slot, just set key at the first index; the hal
+			 * will handle the rest.
+			 */
+			memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
+			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
+			KEYPRINTF(sc, k->wk_keyix, hk, mac);
+			return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
+		}
+	} else if (k->wk_flags & IEEE80211_KEY_XMIT) {
+		if (sc->sc_splitmic) {
+			/*
+			 * NB: must pass MIC key in expected location when
+			 * the keycache only holds one MIC key per entry.
+			 */
+			memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_txmic));
+		} else
+			memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic));
+		KEYPRINTF(sc, k->wk_keyix, hk, mac);
+		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
+	} else if (k->wk_flags & IEEE80211_KEY_RECV) {
+		memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic));
+		KEYPRINTF(sc, k->wk_keyix, hk, mac);
+		return ath_hal_keyset(ah, k->wk_keyix, hk, mac);
+	}
+	return 0;
+#undef IEEE80211_KEY_XR
+}
+
+/*
+ * Set a net80211 key into the hardware.  This handles the
+ * potential distribution of key state to multiple key
+ * cache slots for TKIP with hardware MIC support.
+ */
+int
+ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k,
+	struct ieee80211_node *bss)
+{
+#define	N(a)	(sizeof(a)/sizeof(a[0]))
+	static const u_int8_t ciphermap[] = {
+		HAL_CIPHER_WEP,		/* IEEE80211_CIPHER_WEP */
+		HAL_CIPHER_TKIP,	/* IEEE80211_CIPHER_TKIP */
+		HAL_CIPHER_AES_OCB,	/* IEEE80211_CIPHER_AES_OCB */
+		HAL_CIPHER_AES_CCM,	/* IEEE80211_CIPHER_AES_CCM */
+		(u_int8_t) -1,		/* 4 is not allocated */
+		HAL_CIPHER_CKIP,	/* IEEE80211_CIPHER_CKIP */
+		HAL_CIPHER_CLR,		/* IEEE80211_CIPHER_NONE */
+	};
+	struct ath_hal *ah = sc->sc_ah;
+	const struct ieee80211_cipher *cip = k->wk_cipher;
+	u_int8_t gmac[IEEE80211_ADDR_LEN];
+	const u_int8_t *mac;
+	HAL_KEYVAL hk;
+
+	memset(&hk, 0, sizeof(hk));
+	/*
+	 * Software crypto uses a "clear key" so non-crypto
+	 * state kept in the key cache are maintained and
+	 * so that rx frames have an entry to match.
+	 */
+	if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) == 0) {
+		KASSERT(cip->ic_cipher < N(ciphermap),
+			("invalid cipher type %u", cip->ic_cipher));
+		hk.kv_type = ciphermap[cip->ic_cipher];
+		hk.kv_len = k->wk_keylen;
+		memcpy(hk.kv_val, k->wk_key, k->wk_keylen);
+	} else
+		hk.kv_type = HAL_CIPHER_CLR;
+
+	if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) {
+		/*
+		 * Group keys on hardware that supports multicast frame
+		 * key search use a MAC that is the sender's address with
+		 * the multicast bit set instead of the app-specified address.
+		 */
+		IEEE80211_ADDR_COPY(gmac, bss->ni_macaddr);
+		gmac[0] |= 0x01;
+		mac = gmac;
+	} else
+		mac = k->wk_macaddr;
+
+	if (hk.kv_type == HAL_CIPHER_TKIP &&
+	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
+		return ath_keyset_tkip(sc, k, &hk, mac);
+	} else {
+		KEYPRINTF(sc, k->wk_keyix, &hk, mac);
+		return ath_hal_keyset(ah, k->wk_keyix, &hk, mac);
+	}
+#undef N
+}
+
+/*
+ * Allocate tx/rx key slots for TKIP.  We allocate two slots for
+ * each key, one for decrypt/encrypt and the other for the MIC.
+ */
+static u_int16_t
+key_alloc_2pair(struct ath_softc *sc,
+	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
+{
+#define	N(a)	(sizeof(a)/sizeof(a[0]))
+	u_int i, keyix;
+
+	KASSERT(sc->sc_splitmic, ("key cache !split"));
+	/* XXX could optimize */
+	for (i = 0; i < N(sc->sc_keymap)/4; i++) {
+		u_int8_t b = sc->sc_keymap[i];
+		if (b != 0xff) {
+			/*
+			 * One or more slots in this byte are free.
+			 */
+			keyix = i*NBBY;
+			while (b & 1) {
+		again:
+				keyix++;
+				b >>= 1;
+			}
+			/* XXX IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV */
+			if (isset(sc->sc_keymap, keyix+32) ||
+			    isset(sc->sc_keymap, keyix+64) ||
+			    isset(sc->sc_keymap, keyix+32+64)) {
+				/* full pair unavailable */
+				/* XXX statistic */
+				if (keyix == (i+1)*NBBY) {
+					/* no slots were appropriate, advance */
+					continue;
+				}
+				goto again;
+			}
+			setbit(sc->sc_keymap, keyix);
+			setbit(sc->sc_keymap, keyix+64);
+			setbit(sc->sc_keymap, keyix+32);
+			setbit(sc->sc_keymap, keyix+32+64);
+			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
+				"%s: key pair %u,%u %u,%u\n",
+				__func__, keyix, keyix+64,
+				keyix+32, keyix+32+64);
+			*txkeyix = keyix;
+			*rxkeyix = keyix+32;
+			return 1;
+		}
+	}
+	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__);
+	return 0;
+#undef N
+}
+
+/*
+ * Allocate tx/rx key slots for TKIP.  We allocate two slots for
+ * each key, one for decrypt/encrypt and the other for the MIC.
+ */
+static u_int16_t
+key_alloc_pair(struct ath_softc *sc,
+	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
+{
+#define	N(a)	(sizeof(a)/sizeof(a[0]))
+	u_int i, keyix;
+
+	KASSERT(!sc->sc_splitmic, ("key cache split"));
+	/* XXX could optimize */
+	for (i = 0; i < N(sc->sc_keymap)/4; i++) {
+		u_int8_t b = sc->sc_keymap[i];
+		if (b != 0xff) {
+			/*
+			 * One or more slots in this byte are free.
+			 */
+			keyix = i*NBBY;
+			while (b & 1) {
+		again:
+				keyix++;
+				b >>= 1;
+			}
+			if (isset(sc->sc_keymap, keyix+64)) {
+				/* full pair unavailable */
+				/* XXX statistic */
+				if (keyix == (i+1)*NBBY) {
+					/* no slots were appropriate, advance */
+					continue;
+				}
+				goto again;
+			}
+			setbit(sc->sc_keymap, keyix);
+			setbit(sc->sc_keymap, keyix+64);
+			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
+				"%s: key pair %u,%u\n",
+				__func__, keyix, keyix+64);
+			*txkeyix = *rxkeyix = keyix;
+			return 1;
+		}
+	}
+	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__);
+	return 0;
+#undef N
+}
+
+/*
+ * Allocate a single key cache slot.
+ */
+static int
+key_alloc_single(struct ath_softc *sc,
+	ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
+{
+#define	N(a)	(sizeof(a)/sizeof(a[0]))
+	u_int i, keyix;
+
+	/* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */
+	for (i = 0; i < N(sc->sc_keymap); i++) {
+		u_int8_t b = sc->sc_keymap[i];
+		if (b != 0xff) {
+			/*
+			 * One or more slots are free.
+			 */
+			keyix = i*NBBY;
+			while (b & 1)
+				keyix++, b >>= 1;
+			setbit(sc->sc_keymap, keyix);
+			DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: key %u\n",
+				__func__, keyix);
+			*txkeyix = *rxkeyix = keyix;
+			return 1;
+		}
+	}
+	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of space\n", __func__);
+	return 0;
+#undef N
+}
+
+/*
+ * Allocate one or more key cache slots for a uniacst key.  The
+ * key itself is needed only to identify the cipher.  For hardware
+ * TKIP with split cipher+MIC keys we allocate two key cache slot
+ * pairs so that we can setup separate TX and RX MIC keys.  Note
+ * that the MIC key for a TKIP key at slot i is assumed by the
+ * hardware to be at slot i+64.  This limits TKIP keys to the first
+ * 64 entries.
+ */
+int
+ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
+	ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix)
+{
+	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
+
+	/*
+	 * Group key allocation must be handled specially for
+	 * parts that do not support multicast key cache search
+	 * functionality.  For those parts the key id must match
+	 * the h/w key index so lookups find the right key.  On
+	 * parts w/ the key search facility we install the sender's
+	 * mac address (with the high bit set) and let the hardware
+	 * find the key w/o using the key id.  This is preferred as
+	 * it permits us to support multiple users for adhoc and/or
+	 * multi-station operation.
+	 */
+	if (k->wk_keyix != IEEE80211_KEYIX_NONE) {
+		/*
+		 * Only global keys should have key index assigned.
+		 */
+		if (!(&vap->iv_nw_keys[0] <= k &&
+		      k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) {
+			/* should not happen */
+			DPRINTF(sc, ATH_DEBUG_KEYCACHE,
+				"%s: bogus group key\n", __func__);
+			return 0;
+		}
+		if (vap->iv_opmode != IEEE80211_M_HOSTAP ||
+		    !(k->wk_flags & IEEE80211_KEY_GROUP) ||
+		    !sc->sc_mcastkey) {
+			/*
+			 * XXX we pre-allocate the global keys so
+			 * have no way to check if they've already
+			 * been allocated.
+			 */
+			*keyix = *rxkeyix = k - vap->iv_nw_keys;
+			return 1;
+		}
+		/*
+		 * Group key and device supports multicast key search.
+		 */
+		k->wk_keyix = IEEE80211_KEYIX_NONE;
+	}
+
+	/*
+	 * We allocate two pair for TKIP when using the h/w to do
+	 * the MIC.  For everything else, including software crypto,
+	 * we allocate a single entry.  Note that s/w crypto requires
+	 * a pass-through slot on the 5211 and 5212.  The 5210 does
+	 * not support pass-through cache entries and we map all
+	 * those requests to slot 0.
+	 */
+	if (k->wk_flags & IEEE80211_KEY_SWCRYPT) {
+		return key_alloc_single(sc, keyix, rxkeyix);
+	} else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP &&
+	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
+		if (sc->sc_splitmic)
+			return key_alloc_2pair(sc, keyix, rxkeyix);
+		else
+			return key_alloc_pair(sc, keyix, rxkeyix);
+	} else {
+		return key_alloc_single(sc, keyix, rxkeyix);
+	}
+}
+
+/*
+ * Delete an entry in the key cache allocated by ath_key_alloc.
+ */
+int
+ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
+{
+	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
+	struct ath_hal *ah = sc->sc_ah;
+	const struct ieee80211_cipher *cip = k->wk_cipher;
+	u_int keyix = k->wk_keyix;
+
+	DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix);
+
+	ath_hal_keyreset(ah, keyix);
+	/*
+	 * Handle split tx/rx keying required for TKIP with h/w MIC.
+	 */
+	if (cip->ic_cipher == IEEE80211_CIPHER_TKIP &&
+	    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic)
+		ath_hal_keyreset(ah, keyix+32);		/* RX key */
+	if (keyix >= IEEE80211_WEP_NKID) {
+		/*
+		 * Don't touch keymap entries for global keys so
+		 * they are never considered for dynamic allocation.
+		 */
+		clrbit(sc->sc_keymap, keyix);
+		if (cip->ic_cipher == IEEE80211_CIPHER_TKIP &&
+		    (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) {
+			clrbit(sc->sc_keymap, keyix+64);	/* TX key MIC */
+			if (sc->sc_splitmic) {
+				/* +32 for RX key, +32+64 for RX key MIC */
+				clrbit(sc->sc_keymap, keyix+32);
+				clrbit(sc->sc_keymap, keyix+32+64);
+			}
+		}
+	}
+	return 1;
+}
+
+/*
+ * Set the key cache contents for the specified key.  Key cache
+ * slot(s) must already have been allocated by ath_key_alloc.
+ */
+int
+ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k,
+	const u_int8_t mac[IEEE80211_ADDR_LEN])
+{
+	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
+
+	return ath_keyset(sc, k, vap->iv_bss);
+}

Added: head/sys/dev/ath/if_ath_keycache.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/if_ath_keycache.h	Wed Mar  2 17:19:54 2011	(r219185)
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2011 Sam Leffler, Errno Consulting
+ * 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
+ *    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 NONINFRINGEMENT, 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef	__IF_ATH_CRYPTO_H__
+#define	__IF_ATH_CRYPTO_H__
+
+extern int ath_key_alloc(struct ieee80211vap *, struct ieee80211_key *,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 18:53:13 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DEF27106564A;
	Wed,  2 Mar 2011 18:53:12 +0000 (UTC)
	(envelope-from rdivacky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C32708FC18;
	Wed,  2 Mar 2011 18:53:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22IrCgo035392;
	Wed, 2 Mar 2011 18:53:12 GMT (envelope-from rdivacky@svn.freebsd.org)
Received: (from rdivacky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22IrCkr035390;
	Wed, 2 Mar 2011 18:53:12 GMT (envelope-from rdivacky@svn.freebsd.org)
Message-Id: <201103021853.p22IrCkr035390@svn.freebsd.org>
From: Roman Divacky 
Date: Wed, 2 Mar 2011 18:53:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219186 - head/sys/boot/i386/boot2
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 18:53:13 -0000

Author: rdivacky
Date: Wed Mar  2 18:53:12 2011
New Revision: 219186
URL: http://svn.freebsd.org/changeset/base/219186

Log:
  This patch shrinks boot2 a little.
  
  o    It switches kname to be just a pointer instead of an array
       thus avoiding a couple of memcpy()s.
  
  o    It changes ioctl to unsigned from uint8_t.
  
  o    It changes the second keyhit limit to 3 seconds from 5
       so that constant propagation can take place.
  
  o    It changes the ticks overflow computation as suggested by bde@.
  
  o    It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from
       bootinfo as it is unused.
  
  Reviewed by: jhb

Modified:
  head/sys/boot/i386/boot2/boot2.c

Modified: head/sys/boot/i386/boot2/boot2.c
==============================================================================
--- head/sys/boot/i386/boot2/boot2.c	Wed Mar  2 17:19:54 2011	(r219185)
+++ head/sys/boot/i386/boot2/boot2.c	Wed Mar  2 18:53:12 2011	(r219186)
@@ -131,11 +131,11 @@ static struct dsk {
     int init;
 } dsk;
 static char cmd[512], cmddup[512];
-static char kname[1024];
+static const char *kname = NULL;
 static uint32_t opts;
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
-static uint8_t ioctrl = IO_KEYBOARD;
+static unsigned ioctrl = IO_KEYBOARD;
 
 void exit(int);
 static void load(void);
@@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t
 static int dskread(void *, unsigned, unsigned);
 static void printf(const char *,...);
 static void putchar(int);
-static uint32_t memsize(void);
 static int drvread(void *, unsigned, unsigned);
 static int keyhit(unsigned);
 static int xputc(int);
@@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n
     return 0;
 }
 
-static inline uint32_t
-memsize(void)
-{
-    v86.addr = MEM_EXT;
-    v86.eax = 0x8800;
-    v86int();
-    return v86.eax;
-}
-
 static inline void
 getstr(void)
 {
@@ -245,9 +235,6 @@ main(void)
     dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1;
     bootinfo.bi_version = BOOTINFO_VERSION;
     bootinfo.bi_size = sizeof(bootinfo);
-    bootinfo.bi_basemem = 0;	/* XXX will be filled by loader or kernel */
-    bootinfo.bi_extmem = memsize();
-    bootinfo.bi_memsizes_valid++;
 
     /* Process configuration file */
 
@@ -271,11 +258,11 @@ main(void)
      * or in case of failure, try to load a kernel directly instead.
      */
 
-    if (autoboot && !*kname) {
-	memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
+    if (autoboot && !kname) {
+	kname = PATH_BOOT3;
 	if (!keyhit(3*SECOND)) {
 	    load();
-	    memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
+	    kname = PATH_KERNEL;
 	}
     }
 
@@ -290,7 +277,7 @@ main(void)
 		   'a' + dsk.part, kname);
 	if (ioctrl & IO_SERIAL)
 	    sio_flush();
-	if (!autoboot || keyhit(5*SECOND))
+	if (!autoboot || keyhit(3*SECOND))
 	    getstr();
 	else if (!autoboot || !OPT_CHECK(RBX_QUIET))
 	    putchar('\n');
@@ -474,11 +461,7 @@ parse()
 			     ? DRV_HARD : 0) + drv;
 		dsk_meta = 0;
 	    }
-	    if ((i = ep - arg)) {
-		if ((size_t)i >= sizeof(kname))
-		    return -1;
-		memcpy(kname, arg, i + 1);
-	    }
+            kname = arg;
 	}
 	arg = p;
     }
@@ -630,7 +613,7 @@ keyhit(unsigned ticks)
 	t1 = *(uint32_t *)PTOV(0x46c);
 	if (!t0)
 	    t0 = t1;
-	if (t1 < t0 || t1 >= t0 + ticks)
+	if ((uint32_t)(t1 - t0) >= ticks)
 	    return 0;
     }
 }

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 21:39:09 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5D2CB1065670;
	Wed,  2 Mar 2011 21:39:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BFFC8FC1A;
	Wed,  2 Mar 2011 21:39:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22Ld9rG054967;
	Wed, 2 Mar 2011 21:39:09 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Ld9tm054964;
	Wed, 2 Mar 2011 21:39:09 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103022139.p22Ld9tm054964@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 2 Mar 2011 21:39:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219206 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:39:09 -0000

Author: bz
Date: Wed Mar  2 21:39:08 2011
New Revision: 219206
URL: http://svn.freebsd.org/changeset/base/219206

Log:
  Hide the outer IP addresses of a tunnel interfaces (gif(4), gre(4))
  from processes inside jails if the addresses do not belong to the jail.
  
  Originally reported by: Pieter de Boer via remko
  PR:		kern/151119
  Tested by:	Piotr KUCHARSKI (nospam 42.pl) [gif]
  MFC after:	1 week

Modified:
  head/sys/net/if_gif.c
  head/sys/net/if_gre.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Wed Mar  2 20:08:52 2011	(r219205)
+++ head/sys/net/if_gif.c	Wed Mar  2 21:39:08 2011	(r219206)
@@ -35,6 +35,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -817,6 +818,12 @@ gif_ioctl(ifp, cmd, data)
 		}
 		if (src->sa_len > size)
 			return EINVAL;
+		error = prison_if(curthread->td_ucred, src);
+		if (error != 0)
+			return (error);
+		error = prison_if(curthread->td_ucred, dst);
+		if (error != 0)
+			return (error);
 		bcopy((caddr_t)src, (caddr_t)dst, src->sa_len);
 #ifdef INET6
 		if (dst->sa_family == AF_INET6) {

Modified: head/sys/net/if_gre.c
==============================================================================
--- head/sys/net/if_gre.c	Wed Mar  2 20:08:52 2011	(r219205)
+++ head/sys/net/if_gre.c	Wed Mar  2 21:39:08 2011	(r219206)
@@ -46,6 +46,7 @@
 #include "opt_inet6.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -636,6 +637,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
 		sa = sintosa(&si);
+		error = prison_if(curthread->td_ucred, sa);
+		if (error != 0)
+			break;
 		ifr->ifr_addr = *sa;
 		break;
 	case GREGADDRD:
@@ -644,6 +648,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
 		sa = sintosa(&si);
+		error = prison_if(curthread->td_ucred, sa);
+		if (error != 0)
+			break;
 		ifr->ifr_addr = *sa;
 		break;
 	case SIOCSIFPHYADDR:
@@ -707,8 +714,14 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		memcpy(&lifr->addr, &si, sizeof(si));
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		memcpy(&lifr->dstaddr, &si, sizeof(si));
 		break;
 	case SIOCGIFPSRCADDR:
@@ -723,6 +736,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_src.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
 		break;
 	case SIOCGIFPDSTADDR:
@@ -737,6 +753,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 		si.sin_family = AF_INET;
 		si.sin_len = sizeof(struct sockaddr_in);
 		si.sin_addr.s_addr = sc->g_dst.s_addr;
+		error = prison_if(curthread->td_ucred, (struct sockaddr *)&si);
+		if (error != 0)
+			break;
 		bcopy(&si, &ifr->ifr_addr, sizeof(ifr->ifr_addr));
 		break;
 	case GRESKEY:

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 21:59:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25D89106567F;
	Wed,  2 Mar 2011 21:59:43 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 14C5F8FC22;
	Wed,  2 Mar 2011 21:59:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22LxgfB057454;
	Wed, 2 Mar 2011 21:59:42 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22LxgcA057452;
	Wed, 2 Mar 2011 21:59:42 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103022159.p22LxgcA057452@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Wed, 2 Mar 2011 21:59:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219209 - head/contrib/groff/tmac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:59:43 -0000

Author: uqs
Date: Wed Mar  2 21:59:42 2011
New Revision: 219209
URL: http://svn.freebsd.org/changeset/base/219209

Log:
  Unbreak .Aq for non-ASCII output like -Tps or -Tutf8.
  
  groff will try to produce fancy angle brackets like
  	Foo ⟨foo@FreeBSD.org⟩
  This is nice and well, but no email client will understand them. For
  ease of copy&paste keep the one-true pair of brackets 0x3c/0x3e.
  
  See:		RFC 822, RFC 2822
  PR:		gnu/154822
  Submitted by:	Dominic Fandrey 
  MFC after:	2 weeks

Modified:
  head/contrib/groff/tmac/doc.tmac

Modified: head/contrib/groff/tmac/doc.tmac
==============================================================================
--- head/contrib/groff/tmac/doc.tmac	Wed Mar  2 21:51:22 2011	(r219208)
+++ head/contrib/groff/tmac/doc.tmac	Wed Mar  2 21:59:42 2011	(r219209)
@@ -1197,8 +1197,8 @@
 .  if !\n[doc-arg-limit] \
 .    ds doc-macro-name Aq
 .
-.  ds doc-quote-left \[la]
-.  ds doc-quote-right \[ra]
+.  ds doc-quote-left <
+.  ds doc-quote-right >
 .
 .  doc-enclose-string \$@
 ..

From owner-svn-src-head@FreeBSD.ORG  Wed Mar  2 21:59:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BFF61065670;
	Wed,  2 Mar 2011 21:59:54 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EEF2D8FC14;
	Wed,  2 Mar 2011 21:59:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p22LxrvI057510;
	Wed, 2 Mar 2011 21:59:53 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22LxrYX057507;
	Wed, 2 Mar 2011 21:59:53 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201103022159.p22LxrYX057507@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Wed, 2 Mar 2011 21:59:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219210 - in head: lib/libelf usr.sbin/ntp/doc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:59:54 -0000

Author: uqs
Date: Wed Mar  2 21:59:53 2011
New Revision: 219210
URL: http://svn.freebsd.org/changeset/base/219210

Log:
  Fix some duplicate-word typos in manpages.
  
  Submitted by:	arundel
  MFC after:	1 week

Modified:
  head/lib/libelf/elf_cntl.3
  head/usr.sbin/ntp/doc/ntp.conf.5

Modified: head/lib/libelf/elf_cntl.3
==============================================================================
--- head/lib/libelf/elf_cntl.3	Wed Mar  2 21:59:42 2011	(r219209)
+++ head/lib/libelf/elf_cntl.3	Wed Mar  2 21:59:53 2011	(r219210)
@@ -75,7 +75,7 @@ archive, an ELF file, or other data file
 .Sh IMPLEMENTATION NOTES
 Due to use of
 .Xr mmap 2
-internally, this function is a no-op for for ELF objects opened in
+internally, this function is a no-op for ELF objects opened in
 .Dv ELF_C_READ
 mode.
 .Sh RETURN VALUES

Modified: head/usr.sbin/ntp/doc/ntp.conf.5
==============================================================================
--- head/usr.sbin/ntp/doc/ntp.conf.5	Wed Mar  2 21:59:42 2011	(r219209)
+++ head/usr.sbin/ntp/doc/ntp.conf.5	Wed Mar  2 21:59:53 2011	(r219210)
@@ -1368,7 +1368,7 @@ The
 daemon implements a general purpose address/mask based restriction
 list.
 The list contains address/match entries sorted first
-by increasing address values and and then by increasing mask values.
+by increasing address values and then by increasing mask values.
 A match occurs when the bitwise AND of the mask and the packet
 source address is equal to the bitwise AND of the mask and
 address in the list.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 03:02:06 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CC718106566C;
	Thu,  3 Mar 2011 03:02:06 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9BE28FC17;
	Thu,  3 Mar 2011 03:02:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23326xj089306;
	Thu, 3 Mar 2011 03:02:06 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p233268T089304;
	Thu, 3 Mar 2011 03:02:06 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103030302.p233268T089304@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Mar 2011 03:02:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219214 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 03:02:06 -0000

Author: adrian
Date: Thu Mar  3 03:02:06 2011
New Revision: 219214
URL: http://svn.freebsd.org/changeset/base/219214

Log:
  Disable trying to do HT/40 and short-GI TX.
  
  These flags are just plain wrong - they're the node flags from negotiation,
  not the configured flags. I'll jump in later on and figure out exactly
  what should be done to properly set these two flags when in both STA mode
  (ie, what the AP says is possible and what's configured) and AP mode
  (ie, where the AP has a configuration, but then negotiates what's possible
  with each node, so per-node configuration can and will differ.)
  
  This allows the 11n 2.4ghz/ht20 mode to associate (but perform poorly still)
  and exchange MCS rates with atheros reference APs and a Cisco/Linksys
  E3000 AP.

Modified:
  head/sys/dev/ath/if_ath_tx_ht.c

Modified: head/sys/dev/ath/if_ath_tx_ht.c
==============================================================================
--- head/sys/dev/ath/if_ath_tx_ht.c	Thu Mar  3 00:43:35 2011	(r219213)
+++ head/sys/dev/ath/if_ath_tx_ht.c	Thu Mar  3 03:02:06 2011	(r219214)
@@ -128,6 +128,7 @@ ath_rateseries_setup(struct ath_softc *s
 		if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA))
 			series[i].RateFlags |= HAL_RATESERIES_RTS_CTS;
 
+#if 0
 		if (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)
 			series[i].RateFlags |= HAL_RATESERIES_2040;
 
@@ -138,6 +139,7 @@ ath_rateseries_setup(struct ath_softc *s
 		 */
 		if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)
 			series[i].RateFlags |= HAL_RATESERIES_HALFGI;
+#endif
 
 		series[i].Rate = rt->info[rix[i]].rateCode;
 		/* the short preamble field is only applicable for non-MCS rates */
@@ -150,7 +152,7 @@ ath_rateseries_setup(struct ath_softc *s
 			    ath_computedur_ht(pktlen
 				, series[i].Rate
 				, ic->ic_txstream
-				, (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)
+				, 0 /* disable 20/40 for now */
 				, series[i].RateFlags & HAL_RATESERIES_HALFGI);
 		} else {
 			series[i].PktDuration = ath_hal_computetxtime(ah,

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 08:09:49 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA9F91065670;
	Thu,  3 Mar 2011 08:09:49 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9873A8FC13;
	Thu,  3 Mar 2011 08:09:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2389nil010854;
	Thu, 3 Mar 2011 08:09:49 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2389nmq010852;
	Thu, 3 Mar 2011 08:09:49 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103030809.p2389nmq010852@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Mar 2011 08:09:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219216 - head/sys/dev/ath/ath_rate/sample
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 08:09:49 -0000

Author: adrian
Date: Thu Mar  3 08:09:49 2011
New Revision: 219216
URL: http://svn.freebsd.org/changeset/base/219216

Log:
  Modify the sample rate module output to be (slightly) easier to understand.
  
  * add dot11rate_label() which returns Mb or MCS based on legacy or HT
  * use it everywhere dot11rate() is used
  * in the "current selection" part at the top of the debugging output,
    otuput what the rate itself is rather than the rix. The rate index
    (rix) has very little meaning to normal humans who don't know how
    to find the PHY settings for each of the chipsets; pointing out the
    rix rate and type is likely more useful.

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==============================================================================
--- head/sys/dev/ath/ath_rate/sample/sample.c	Thu Mar  3 05:56:29 2011	(r219215)
+++ head/sys/dev/ath/ath_rate/sample/sample.c	Thu Mar  3 08:09:49 2011	(r219216)
@@ -150,6 +150,12 @@ dot11rate(const HAL_RATE_TABLE *rt, int 
 	    rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2;
 }
 
+static const char *
+dot11rate_label(const HAL_RATE_TABLE *rt, int rix)
+{
+	return rt->info[rix].phy == IEEE80211_T_HT ? "MCS" : "Mb ";
+}
+
 /*
  * Return the rix with the lowest average_tx_time,
  * or -1 if all the average_tx_times are 0.
@@ -553,11 +559,11 @@ ath_rate_tx_complete(struct ath_softc *s
 		 * Only one rate was used; optimize work.
 		 */
 		IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL,
-		     &an->an_node, "%s: size %d %s rate/try %d/%d/%d",
+		     &an->an_node, "%s: size %d %s rate/try %d %s/%d/%d",
 		     __func__,
 		     bin_to_size(size_to_bin(frame_size)),
 		     ts->ts_status ? "FAIL" : "OK",
-		     dot11rate(rt, final_rix), short_tries, long_tries);
+		     dot11rate(rt, final_rix), dot11rate_label(rt, final_rix), short_tries, long_tries);
 		update_stats(sc, an, frame_size, 
 			     final_rix, long_tries,
 			     0, 0,
@@ -580,16 +586,16 @@ ath_rate_tx_complete(struct ath_softc *s
 
 		IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL,
 		    &an->an_node,
-"%s: size %d finaltsidx %d tries %d %s rate/try [%d/%d %d/%d %d/%d %d/%d]", 
+"%s: size %d finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d]", 
 		     __func__,
 		     bin_to_size(size_to_bin(frame_size)),
 		     finalTSIdx,
 		     long_tries, 
 		     ts->ts_status ? "FAIL" : "OK",
-		     dot11rate(rt, rix[0]), tries[0],
-		     dot11rate(rt, rix[1]), tries[1],
-		     dot11rate(rt, rix[2]), tries[2],
-		     dot11rate(rt, rix[3]), tries[3]);
+		     dot11rate(rt, rix[0]), dot11rate_label(rt, rix[0]), tries[0],
+		     dot11rate(rt, rix[1]), dot11rate_label(rt, rix[1]), tries[1],
+		     dot11rate(rt, rix[2]), dot11rate_label(rt, rix[2]), tries[2],
+		     dot11rate(rt, rix[3]), dot11rate_label(rt, rix[3]), tries[3]);
 
 		for (i = 0; i < 4; i++) {
 			if (tries[i] && !IS_RATE_DEFINED(sn, rix[i]))
@@ -765,7 +771,7 @@ ath_rate_ctl_reset(struct ath_softc *sc,
 		for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) {
 			if ((mask & 1) == 0)
 				continue;
-			printf(" %d/%d", dot11rate(rt, rix),
+			printf(" %d %s/%d", dot11rate(rt, rix), dot11rate_label(rt, rix),
 			    calc_usecs_unicast_packet(sc, 1600, rix, 0,0,
 			        (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40)));
 		}
@@ -835,8 +841,10 @@ sample_stats(void *arg, struct ieee80211
 	    ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni),
 	    sn->static_rix, sn->ratemask);
 	for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
-		printf("[%4u] cur rix %d since switch: packets %d ticks %u\n",
+		printf("[%4u] cur rix %d (%d %s) since switch: packets %d ticks %u\n",
 		    bin_to_size(y), sn->current_rix[y],
+		    dot11rate(rt, sn->current_rix[y]),
+		    dot11rate_label(rt, sn->current_rix[y]),
 		    sn->packets_since_switch[y], sn->ticks_since_switch[y]);
 		printf("[%4u] last sample %d cur sample %d packets sent %d\n",
 		    bin_to_size(y), sn->last_sample_rix[y],
@@ -851,8 +859,8 @@ sample_stats(void *arg, struct ieee80211
 		for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
 			if (sn->stats[y][rix].total_packets == 0)
 				continue;
-			printf("[%2u:%4u] %8d:%-8d (%3d%%) T %8d F %4d avg %5u last %u\n",
-			    dot11rate(rt, rix),
+			printf("[%2u %s:%4u] %8d:%-8d (%3d%%) T %8d F %4d avg %5u last %u\n",
+			    dot11rate(rt, rix), dot11rate_label(rt, rix),
 			    bin_to_size(y),
 			    sn->stats[y][rix].total_packets,
 			    sn->stats[y][rix].packets_acked,

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 08:30:29 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3EAC7106566B;
	Thu,  3 Mar 2011 08:30:29 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 13D748FC1D;
	Thu,  3 Mar 2011 08:30:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p238US93011699;
	Thu, 3 Mar 2011 08:30:28 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p238USYq011697;
	Thu, 3 Mar 2011 08:30:28 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103030830.p238USYq011697@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Mar 2011 08:30:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219217 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 08:30:29 -0000

Author: adrian
Date: Thu Mar  3 08:30:28 2011
New Revision: 219217
URL: http://svn.freebsd.org/changeset/base/219217

Log:
  * fix the ar5416 check macros to be slightly more correct;
  * add some stubs for chipsets that we haven't yet obtained support for.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Thu Mar  3 08:09:49 2011	(r219216)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Thu Mar  3 08:30:28 2011	(r219217)
@@ -505,6 +505,7 @@
 #define	AR_PCU_CLEAR_BA_VALID		0x04000000 /* clear ba state */
 
 #define	AR_PCU_MISC_MODE2_HWWAR1	0x00100000
+#define	AR_PCU_MISC_MODE2_HWWAR2	0x02000000
 
 /* GPIO Interrupt */
 #define	AR_INTR_GPIO		0x3FF00000	/* gpio interrupted */
@@ -580,6 +581,7 @@
 #define	AR_XSREV_REVISION_OWL_10	0	/* Owl 1.0 */
 #define	AR_XSREV_REVISION_OWL_20	1	/* Owl 2.0/2.1 */
 #define	AR_XSREV_REVISION_OWL_22	2	/* Owl 2.2 */
+#define	AR_XSREV_VERSION_HOWL		0x14	/* Howl (AR9130) */
 #define	AR_XSREV_VERSION_SOWL		0x40
 #define	AR_XSREV_REVISION_SOWL_10	0	/* Sowl 1.0 */
 #define	AR_XSREV_REVISION_SOWL_11	1	/* Sowl 1.1 */
@@ -597,11 +599,11 @@
 	 (AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_OWL_PCIE))
 
 #define	AR_SREV_OWL_20_OR_LATER(_ah) \
-	(AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_SOWL || \
-	 AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_20)
+	((AR_SREV_OWL(_ah) && AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_20) || \
+	AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_HOWL)
 #define	AR_SREV_OWL_22_OR_LATER(_ah) \
-	(AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_SOWL || \
-	 AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_22)
+	((AR_SREV_OWL(_ah) && AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_22) || \
+	AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_HOWL)
 
 #define	AR_SREV_SOWL(_ah) \
 	(AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_SOWL)
@@ -642,4 +644,9 @@
 	(AR_SREV_KITE_12_OR_LATER(_ah) && \
 	((OS_REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
 
+/* Not yet implemented chips */
+#define	AR_SREV_9271(_ah)	0
+#define	AR_SREV_9287_11_OR_LATER(_ah)	0
+#define	AR_SREV_9100(_ah)	0
+
 #endif /* _DEV_ATH_AR5416REG_H */

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 08:38:32 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 096DD106564A;
	Thu,  3 Mar 2011 08:38:32 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EB8AC8FC14;
	Thu,  3 Mar 2011 08:38:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p238cVNl012003;
	Thu, 3 Mar 2011 08:38:31 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p238cVat011999;
	Thu, 3 Mar 2011 08:38:31 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103030838.p238cVat011999@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Mar 2011 08:38:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219218 - in head/sys/dev/ath/ath_hal: ar5416 ar9002
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 08:38:32 -0000

Author: adrian
Date: Thu Mar  3 08:38:31 2011
New Revision: 219218
URL: http://svn.freebsd.org/changeset/base/219218

Log:
  Port over ar5416OverrideIni() from ath9k ar5008_hw_override_ini().
  
  * change the BB gating logic to explicitly define which chips are covered;
    the ath9k method isn't as clear.
  * don't disable the BB gating for now, the ar5416 initvals have it, and the
    ar9160 initval sets it to 0x0. Figure out why before re-enabling this.
  * migrate the Merlin (ar9280) applicable WAR from the Kite (ar9285) code
    (which won't get called for Merlin!) and stuff it in here.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Mar  3 08:30:28 2011	(r219217)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Mar  3 08:38:31 2011	(r219218)
@@ -45,6 +45,7 @@ static void ar5416InitIMR(struct ath_hal
 static void ar5416InitQoS(struct ath_hal *ah);
 static void ar5416InitUserSettings(struct ath_hal *ah);
 static void ar5416UpdateChainMasks(struct ath_hal *ah, HAL_BOOL is_ht);
+static void ar5416OverrideIni(struct ath_hal *ah, const struct ieee80211_channel *);
 
 #if 0
 static HAL_BOOL	ar5416ChannelChange(struct ath_hal *, const struct ieee80211_channel *);
@@ -183,6 +184,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 
 	AH5416(ah)->ah_writeIni(ah, chan);
 
+	/* Override ini values (that can be overriden in this fashion) */
+	ar5416OverrideIni(ah, chan);
+
 	/* Setup 11n MAC/Phy mode registers */
 	ar5416Set11nRegs(ah, chan);	
 
@@ -2323,3 +2327,57 @@ ar5416GetChannelCenters(struct ath_hal *
 		centers->ext_center = freq;
 	}
 }
+
+/*
+ * Override the INI vals being programmed.
+ */
+static void
+ar5416OverrideIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
+{
+	uint32_t val;
+
+	/*
+	 * Set the RX_ABORT and RX_DIS and clear if off only after
+	 * RXE is set for MAC. This prevents frames with corrupted
+	 * descriptor status.
+	 */
+	OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
+
+        if (AR_SREV_MERLIN_20_OR_LATER(ah)) {
+                val = OS_REG_READ(ah, AR_PCU_MISC_MODE2);
+
+                if (!AR_SREV_9271(ah))
+                        val &= ~AR_PCU_MISC_MODE2_HWWAR1;
+
+                if (AR_SREV_9287_11_OR_LATER(ah))
+                        val = val & (~AR_PCU_MISC_MODE2_HWWAR2);
+
+                OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val);
+        }
+
+	/*
+	 * The AR5416 initvals have this already set to 0x11; AR9160 has
+	 * the register set to 0x0. Figure out whether AR9100/AR9160 needs
+	 * this before moving forward with it.
+	 */
+#if 0
+	/* Disable BB clock gating for AR5416v2, AR9100, AR9160 */
+        if (AR_SREV_OWL_20_OR_LATER(ah) || AR_SREV_9100(ah) || AR_SREV_SOWL(ah)) {
+		/*
+		 * Disable BB clock gating
+		 * Necessary to avoid issues on AR5416 2.0
+		 */
+		OS_REG_WRITE(ah, 0x9800 + (651 << 2), 0x11);
+	}
+#endif
+
+	/*
+	 * Disable RIFS search on some chips to avoid baseband
+	 * hang issues.
+	 */
+	if (AR_SREV_9100(ah) || AR_SREV_SOWL(ah)) {
+		val = OS_REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS);
+		val &= ~AR_PHY_RIFS_INIT_DELAY;
+		OS_REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val);
+	}
+}

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Mar  3 08:30:28 2011	(r219217)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c	Thu Mar  3 08:38:31 2011	(r219218)
@@ -339,17 +339,6 @@ ar9285WriteIni(struct ath_hal *ah, const
 	}
 	regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common,
 	    1, regWrites);
-
-      	OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
-
-	if (AR_SREV_MERLIN_10_OR_LATER(ah)) {
-		uint32_t val;
-		val = OS_REG_READ(ah, AR_PCU_MISC_MODE2) &
-			(~AR_PCU_MISC_MODE2_HWWAR1);
-		OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val);
-		OS_REG_WRITE(ah, 0x9800 + (651 << 2), 0x11);
-	}
-
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 10:25:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE02E106566C;
	Thu,  3 Mar 2011 10:25:41 +0000 (UTC)
	(envelope-from hselasky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC7CA8FC15;
	Thu,  3 Mar 2011 10:25:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23APfKQ023503;
	Thu, 3 Mar 2011 10:25:41 GMT (envelope-from hselasky@svn.freebsd.org)
Received: (from hselasky@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23APfdB023500;
	Thu, 3 Mar 2011 10:25:41 GMT (envelope-from hselasky@svn.freebsd.org)
Message-Id: <201103031025.p23APfdB023500@svn.freebsd.org>
From: Hans Petter Selasky 
Date: Thu, 3 Mar 2011 10:25:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219221 - in head/sys: conf dev/usb/serial
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 10:25:42 -0000

Author: hselasky
Date: Thu Mar  3 10:25:41 2011
New Revision: 219221
URL: http://svn.freebsd.org/changeset/base/219221

Log:
  - Remove dependency to ucom from ulpt.
  
  MFC after:	14 days
  Approved by:	thompsa (mentor)

Modified:
  head/sys/conf/files
  head/sys/dev/usb/serial/ulpt.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Mar  3 09:49:03 2011	(r219220)
+++ head/sys/conf/files	Thu Mar  3 10:25:41 2011	(r219221)
@@ -1878,7 +1878,7 @@ dev/usb/serial/uvisor.c		optional uvisor
 dev/usb/serial/uvscom.c		optional uvscom
 dev/usb/serial/usb_serial.c 	optional ucom | u3g | uark | ubsa | ubser | \
 					 uchcom | ucycom | ufoma | uftdi | \
-					 ugensa | uipaq | ulpt | umct | \
+					 ugensa | uipaq | umct | \
 					 umodem | umoscom | uplcom | uslcom | \
 					 uvisor | uvscom
 #

Modified: head/sys/dev/usb/serial/ulpt.c
==============================================================================
--- head/sys/dev/usb/serial/ulpt.c	Thu Mar  3 09:49:03 2011	(r219220)
+++ head/sys/dev/usb/serial/ulpt.c	Thu Mar  3 10:25:41 2011	(r219221)
@@ -743,5 +743,4 @@ static driver_t ulpt_driver = {
 
 DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass, NULL, 0);
 MODULE_DEPEND(ulpt, usb, 1, 1, 1);
-MODULE_DEPEND(ulpt, ucom, 1, 1, 1);
 MODULE_VERSION(ulpt, 1);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 11:15:01 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EBB40106564A;
	Thu,  3 Mar 2011 11:15:00 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 91CE48FC17;
	Thu,  3 Mar 2011 11:15:00 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id B9A5146B89;
	Thu,  3 Mar 2011 06:14:59 -0500 (EST)
Date: Thu, 3 Mar 2011 11:14:59 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Dmitry Chagin 
In-Reply-To: <201103011642.p21GgTaH041022@svn.freebsd.org>
Message-ID: 
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:15:01 -0000


On Tue, 1 Mar 2011, Dmitry Chagin wrote:

>  Teach kdump to decode linux syscalls names too.
>
>  Fix bug introduced in my previous commit: the kernel always dump native
>  signal numbers, so no need to check the ABI in ktrpsig().

Does this mean that we're eliminating the need for the long-broken 
linux_kdump?

Is there any ABI record in ktrace files, and/or should we add one somehow?

I'd love to be able to process a kdump file generated from a blend of ABIs: 
i.e., if I do ktrace -di tcsh, and then run a bunch of commands from different 
ABIs (FreeBSD/32-bit Intel, FreeBSD/64-bit Intel, Linux/32-bit Intel, and 
possible FreeBSD/64 MIPS so that a distributed ktracing tool gathers the 
results across hosts for a single action), have kdump Just Work.  This 
suggests that a per-record ABI indicator might be useful.

Robert

>
>  Suggested by:	jhb
>  MFC after:	1 Month.
>
> Added:
>  head/usr.bin/kdump/linux_syscalls.conf   (contents, props changed)
> Modified:
>  head/usr.bin/kdump/Makefile
>  head/usr.bin/kdump/kdump.c
>
> Modified: head/usr.bin/kdump/Makefile
> ==============================================================================
> --- head/usr.bin/kdump/Makefile	Tue Mar  1 14:54:14 2011	(r219137)
> +++ head/usr.bin/kdump/Makefile	Tue Mar  1 16:42:28 2011	(r219138)
> @@ -1,15 +1,23 @@
> #	@(#)Makefile	8.1 (Berkeley) 6/6/93
> # $FreeBSD$
>
> +.if (${MACHINE_ARCH} == "amd64")
> +SFX=		32
> +.endif
> +
> .PATH: ${.CURDIR}/../ktrace
>
> PROG=		kdump
> SRCS=		kdump.c ioctl.c kdump_subr.c subr.c
> CFLAGS+=	-I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../..
>
> +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> +SRCS+=		linux_syscalls.c
> +.endif
> +
> WARNS?=		0
>
> -CLEANFILES=	ioctl.c kdump_subr.c
> +CLEANFILES=	ioctl.c kdump_subr.c linux_syscalls.c
>
> ioctl.c: mkioctls
> 	sh ${.CURDIR}/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
> @@ -17,4 +25,10 @@ ioctl.c: mkioctls
> kdump_subr.c: mksubr
> 	sh ${.CURDIR}/mksubr ${DESTDIR}/usr/include > ${.TARGET}
>
> +linux_syscalls.c:
> +	/bin/sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
> +	    ${.CURDIR}/../../sys/${MACHINE_ARCH}/linux${SFX}/syscalls.master ${.CURDIR}/linux_syscalls.conf
> +	echo "int nlinux_syscalls = sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]);" \
> +	    >> linux_syscalls.c
> +
> .include 
>
> Modified: head/usr.bin/kdump/kdump.c
> ==============================================================================
> --- head/usr.bin/kdump/kdump.c	Tue Mar  1 14:54:14 2011	(r219137)
> +++ head/usr.bin/kdump/kdump.c	Tue Mar  1 16:42:28 2011	(r219138)
> @@ -93,7 +93,7 @@ void ktrnamei(char *, int);
> void hexdump(char *, int, int);
> void visdump(char *, int, int);
> void ktrgenio(struct ktr_genio *, int);
> -void ktrpsig(struct ktr_psig *, u_int);
> +void ktrpsig(struct ktr_psig *);
> void ktrcsw(struct ktr_csw *);
> void ktruser(int, unsigned char *);
> void ktrsockaddr(struct sockaddr *);
> @@ -111,6 +111,41 @@ struct ktr_header ktr_header;
> #define TIME_FORMAT	"%b %e %T %Y"
> #define eqs(s1, s2)	(strcmp((s1), (s2)) == 0)
>
> +#define print_number(i,n,c) do {		\
> +	if (decimal)				\
> +		printf("%c%ld", c, (long)*i);	\
> +	else					\
> +		printf("%c%#lx", c, (long)*i);	\
> +	i++;					\
> +	n--;					\
> +	c = ',';				\
> +	} while (0);
> +
> +#if defined(__amd64__) || defined(__i386__)
> +
> +void linux_ktrsyscall(struct ktr_syscall *);
> +void linux_ktrsysret(struct ktr_sysret *);
> +extern char *linux_syscallnames[];
> +extern int nlinux_syscalls;
> +
> +/*
> + * from linux.h
> + * Linux syscalls return negative errno's, we do positive and map them
> + */
> +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
> +};
> +#endif
> +
> struct proc_info
> {
> 	TAILQ_ENTRY(proc_info)	info;
> @@ -233,10 +268,20 @@ main(int argc, char *argv[])
> 		drop_logged = 0;
> 		switch (ktr_header.ktr_type) {
> 		case KTR_SYSCALL:
> -			ktrsyscall((struct ktr_syscall *)m, sv_flags);
> +#if defined(__amd64__) || defined(__i386__)
> +			if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
> +				linux_ktrsyscall((struct ktr_syscall *)m);
> +			else
> +#endif
> +				ktrsyscall((struct ktr_syscall *)m, sv_flags);
> 			break;
> 		case KTR_SYSRET:
> -			ktrsysret((struct ktr_sysret *)m, sv_flags);
> +#if defined(__amd64__) || defined(__i386__)
> +			if ((sv_flags & SV_ABI_MASK) == SV_ABI_LINUX)
> +				linux_ktrsysret((struct ktr_sysret *)m);
> +			else
> +#endif
> +				ktrsysret((struct ktr_sysret *)m, sv_flags);
> 			break;
> 		case KTR_NAMEI:
> 		case KTR_SYSCTL:
> @@ -246,7 +291,7 @@ main(int argc, char *argv[])
> 			ktrgenio((struct ktr_genio *)m, ktrlen);
> 			break;
> 		case KTR_PSIG:
> -			ktrpsig((struct ktr_psig *)m, sv_flags);
> +			ktrpsig((struct ktr_psig *)m);
> 			break;
> 		case KTR_CSW:
> 			ktrcsw((struct ktr_csw *)m);
> @@ -455,17 +500,6 @@ ktrsyscall(struct ktr_syscall *ktr, u_in
> 		char c = '(';
> 		if (fancy &&
> 		    (flags == 0 || (flags & SV_ABI_MASK) == SV_ABI_FREEBSD)) {
> -
> -#define print_number(i,n,c) do {                      \
> -	if (decimal)                                  \
> -		(void)printf("%c%ld", c, (long)*i);   \
> -	else                                          \
> -		(void)printf("%c%#lx", c, (long)*i);  \
> -	i++;                                          \
> -	n--;                                          \
> -	c = ',';                                      \
> -	} while (0);
> -
> 			if (ktr->ktr_code == SYS_ioctl) {
> 				const char *cp;
> 				print_number(ip,narg,c);
> @@ -1093,10 +1127,9 @@ const char *signames[] = {
> };
>
> void
> -ktrpsig(struct ktr_psig *psig, u_int flags)
> +ktrpsig(struct ktr_psig *psig)
> {
> -	if ((flags & SV_ABI_MASK) == SV_ABI_FREEBSD &&
> -	    psig->signo > 0 && psig->signo < NSIG)
> +	if (psig->signo > 0 && psig->signo < NSIG)
> 		(void)printf("SIG%s ", signames[psig->signo]);
> 	else
> 		(void)printf("SIG %d ", psig->signo);
> @@ -1471,6 +1504,67 @@ invalid:
> 	printf("invalid record\n");
> }
>
> +#if defined(__amd64__) || defined(__i386__)
> +void
> +linux_ktrsyscall(struct ktr_syscall *ktr)
> +{
> +	int narg = ktr->ktr_narg;
> +	register_t *ip;
> +
> +	if (ktr->ktr_code >= nlinux_syscalls || ktr->ktr_code < 0)
> +		printf("[%d]", ktr->ktr_code);
> +	else
> +		printf("%s", linux_syscallnames[ktr->ktr_code]);
> +	ip = &ktr->ktr_args[0];
> +	if (narg) {
> +		char c = '(';
> +		while (narg > 0)
> +			print_number(ip, narg, c);
> +		putchar(')');
> +	}
> +	putchar('\n');
> +}
> +
> +void
> +linux_ktrsysret(struct ktr_sysret *ktr)
> +{
> +	register_t ret = ktr->ktr_retval;
> +	int error = ktr->ktr_error;
> +	int code = ktr->ktr_code;
> +
> +	if (code >= nlinux_syscalls || code < 0)
> +		printf("[%d] ", code);
> +	else
> +		printf("%s ", linux_syscallnames[code]);
> +
> +	if (error == 0) {
> +		if (fancy) {
> +			printf("%ld", (long)ret);
> +			if (ret < 0 || ret > 9)
> +				printf("/%#lx", (long)ret);
> +		} else {
> +			if (decimal)
> +				printf("%ld", (long)ret);
> +			else
> +				printf("%#lx", (long)ret);
> +		}
> +	} else if (error == ERESTART)
> +		printf("RESTART");
> +	else if (error == EJUSTRETURN)
> +		printf("JUSTRETURN");
> +	else {
> +		if (ktr->ktr_error <= ELAST + 1)
> +			error = abs(bsd_to_linux_errno[ktr->ktr_error]);
> +		else
> +			error = 999;
> +		printf("-1 errno %d", error);
> +		if (fancy)
> +			printf(" %s", strerror(ktr->ktr_error));
> +	}
> +	putchar('\n');
> +}
> +#endif
> +
> void
> usage(void)
> {
>
> Added: head/usr.bin/kdump/linux_syscalls.conf
> ==============================================================================
> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
> +++ head/usr.bin/kdump/linux_syscalls.conf	Tue Mar  1 16:42:28 2011	(r219138)
> @@ -0,0 +1,11 @@
> +# $FreeBSD$
> +sysnames="linux_syscalls.c"
> +sysproto="/dev/null"
> +sysproto_h=_LINUX_SYSPROTO_H_
> +syshdr="/dev/null"
> +syssw="/dev/null"
> +sysmk="/dev/null"
> +syscallprefix="LINUX_SYS_"
> +switchname="/dev/null"
> +namesname="linux_syscallnames"
> +systrace="/dev/null"
>

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 11:28:57 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A4501065672;
	Thu,  3 Mar 2011 11:28:57 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 892098FC1C;
	Thu,  3 Mar 2011 11:28:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23BSvdC026369;
	Thu, 3 Mar 2011 11:28:57 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23BSvjD026367;
	Thu, 3 Mar 2011 11:28:57 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103031128.p23BSvjD026367@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 3 Mar 2011 11:28:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219222 - head/lib/libc/gen
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:28:57 -0000

Author: rwatson
Date: Thu Mar  3 11:28:57 2011
New Revision: 219222
URL: http://svn.freebsd.org/changeset/base/219222

Log:
  Add text string for ECAPMODE to libc.
  
  Discussed with:	anderson
  Obtained from:	Capsicum Project
  Sponsored by:	Google, Inc.
  MFC after:	3 months

Modified:
  head/lib/libc/gen/errlst.c

Modified: head/lib/libc/gen/errlst.c
==============================================================================
--- head/lib/libc/gen/errlst.c	Thu Mar  3 10:25:41 2011	(r219221)
+++ head/lib/libc/gen/errlst.c	Thu Mar  3 11:28:57 2011	(r219222)
@@ -151,5 +151,6 @@ const char *const sys_errlist[] = {
 	"Link has been severed",		/* 91 - ENOLINK */
 	"Protocol error",			/* 92 - EPROTO */
 	"Capabilities insufficient",		/* 93 - ENOTCAPABLE */
+	"Not permitted in capability mode",	/* 94 - ECAPMODE */
 };
 const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 11:29:48 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 815981065674;
	Thu,  3 Mar 2011 11:29:48 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 700928FC19;
	Thu,  3 Mar 2011 11:29:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23BTmxY026430;
	Thu, 3 Mar 2011 11:29:48 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23BTmII026428;
	Thu, 3 Mar 2011 11:29:48 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103031129.p23BTmII026428@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 3 Mar 2011 11:29:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219223 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:29:48 -0000

Author: rwatson
Date: Thu Mar  3 11:29:48 2011
New Revision: 219223
URL: http://svn.freebsd.org/changeset/base/219223

Log:
  Add description of ECAPMODE to errno(2) man page.
  
  Discussed with: anderson
  Obtained from:  Capsicum Project
  Sponsored by:   Google, Inc.
  MFC after:      3 months

Modified:
  head/lib/libc/sys/intro.2

Modified: head/lib/libc/sys/intro.2
==============================================================================
--- head/lib/libc/sys/intro.2	Thu Mar  3 11:28:57 2011	(r219222)
+++ head/lib/libc/sys/intro.2	Thu Mar  3 11:29:48 2011	(r219223)
@@ -467,6 +467,8 @@ A device or socket encountered an unreco
 .It Er 93 ENOTCAPABLE Em "Capabilities insufficient" .
 An operation on a capability file descriptor requires greater privilege than
 the capability allows.
+.It Er 94 ECAPMODE Em "Not permitted in capability mode" .
+The system call or operation is not permitted for capability mode processes.
 .El
 .Sh DEFINITIONS
 .Bl -tag -width Ds

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 11:31:08 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85822106567E;
	Thu,  3 Mar 2011 11:31:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7342F8FC08;
	Thu,  3 Mar 2011 11:31:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23BV8lk026588;
	Thu, 3 Mar 2011 11:31:08 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23BV8wL026584;
	Thu, 3 Mar 2011 11:31:08 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103031131.p23BV8wL026584@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 3 Mar 2011 11:31:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219224 - head/lib/libc/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:31:08 -0000

Author: rwatson
Date: Thu Mar  3 11:31:08 2011
New Revision: 219224
URL: http://svn.freebsd.org/changeset/base/219224

Log:
  Make cap_new(2) and cap_getmode(2) symbols from libc public so applications
  can link against them.  Add man pages for the new system calls, with one
  errant forward reference to changes not yet present in FreeBSD, but soon
  will be.
  
  Reviewed by:	anderson
  Obtained from:	Capsicum Project
  Sponsored by:	Google, Inc.
  Discussed with:	benl, kris, pjd
  MFC after:	3 months

Added:
  head/lib/libc/sys/cap_enter.2   (contents, props changed)
Modified:
  head/lib/libc/sys/Makefile.inc
  head/lib/libc/sys/Symbol.map

Modified: head/lib/libc/sys/Makefile.inc
==============================================================================
--- head/lib/libc/sys/Makefile.inc	Thu Mar  3 11:29:48 2011	(r219223)
+++ head/lib/libc/sys/Makefile.inc	Thu Mar  3 11:31:08 2011	(r219224)
@@ -74,7 +74,7 @@ ${SPSEUDO}:
 MAN+=	abort2.2 accept.2 access.2 acct.2 adjtime.2 \
 	aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \
 	aio_suspend.2 aio_waitcomplete.2 aio_write.2 \
-	bind.2 brk.2 chdir.2 chflags.2 \
+	bind.2 brk.2 cap_enter.2 chdir.2 chflags.2 \
 	chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \
 	connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 _exit.2 \
 	extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \
@@ -115,6 +115,7 @@ MAN+=	sctp_generic_recvmsg.2 sctp_generi
 
 MLINKS+=access.2 eaccess.2 access.2 faccessat.2
 MLINKS+=brk.2 sbrk.2
+MLINKS+=cap_enter.2 cap_getmode.2
 MLINKS+=chdir.2 fchdir.2
 MLINKS+=chflags.2 fchflags.2 chflags.2 lchflags.2
 MLINKS+=chmod.2 fchmod.2 chmod.2 fchmodat.2 chmod.2 lchmod.2

Modified: head/lib/libc/sys/Symbol.map
==============================================================================
--- head/lib/libc/sys/Symbol.map	Thu Mar  3 11:29:48 2011	(r219223)
+++ head/lib/libc/sys/Symbol.map	Thu Mar  3 11:31:08 2011	(r219224)
@@ -330,6 +330,8 @@ FBSD_1.0 {
 
 FBSD_1.1 {
 	__semctl;
+	cap_enter;
+	cap_getmode;
 	closefrom;
 	cpuset;
 	cpuset_getid;

Added: head/lib/libc/sys/cap_enter.2
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/sys/cap_enter.2	Thu Mar  3 11:31:08 2011	(r219224)
@@ -0,0 +1,101 @@
+.\"
+.\" Copyright (c) 2008-2009 Robert N. M. Watson
+.\" All rights reserved.
+.\"
+.\" This software was developed at the University of Cambridge Computer
+.\" Laboratory with support from a grant from Google, 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 11, 2009
+.Dt CAP_ENTER 2
+.Os
+.Sh NAME
+.Nm cap_enter ,
+.Nm cap_getmode
+.Nd Capability mode system calls
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/capability.h
+.Ft int
+.Fn cap_enter "void"
+.Ft int
+.Fn cap_getmode "u_int *modep"
+.Sh DESCRIPTION
+.Fn cap_enter
+places the current process into capability mode, a mode of execution in which
+processes may only issue system calls operating on file descriptors or
+reading limited global system state.
+Access to global name spaces, such as file system or IPC name spaces, is
+prevented.
+If the process is already in a capability mode sandbox, the system call is a
+no-op.
+Future process descendants create with
+.Xr fork 2
+or
+.Xr pdfork 2
+will be placed in capability mode from inception.
+.Pp
+When combined with capabilities created with
+.Xr cap_new 2 ,
+.Fn cap_enter
+may be used to create kernel-enforced sandboxes in which
+appropriately-crafted applications or application components may be run.
+.Pp
+.Fn cap_getmode
+returns a flag indicating whether or not the process is in a capability mode
+sandbox.
+.Sh CAVEAT
+Creating effecive process sandboxes is a tricky process that involves
+identifying the least possible rights required by the process and then
+passing those rights into the process in a safe manner.
+See the CAVEAT
+section of
+.Xr cap_new 2
+for why this is particularly tricky with UNIX file descriptors as the
+canonical representation of a right.
+Consumers of
+.Fn cap_enter
+should also be aware of other inherited rights, such as access to VM
+resources, memory contents, and other process properties that should be
+considered.
+It is advisable to use
+.Xr fexecve 2
+to create a runtime environment inside the sandbox that has as few implicitly
+acquired rights as possible.
+.Sh RETURN VALUES
+.Rv -std cap_enter cap_getmode
+.Sh SEE ALSO
+.Xr cap_new 2 ,
+.Xr fexecve 2
+.Sh HISTORY
+Support for capabilities and capabilities mode was developed as part of the
+.Tn TrustedBSD
+Project.
+.Sh AUTHORS
+These functions and the capability facility were created by
+.An "Robert N. M. Watson"
+at the University of Cambridge Computer Laboratory with support from a grant
+from Google, Inc.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 11:45:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C60B1065670;
	Thu,  3 Mar 2011 11:45:55 +0000 (UTC)
	(envelope-from nyan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4180D8FC08;
	Thu,  3 Mar 2011 11:45:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23BjtlH027907;
	Thu, 3 Mar 2011 11:45:55 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23BjtfT027905;
	Thu, 3 Mar 2011 11:45:55 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <201103031145.p23BjtfT027905@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 3 Mar 2011 11:45:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219225 - head/sys/boot/pc98/boot2
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:45:55 -0000

Author: nyan
Date: Thu Mar  3 11:45:54 2011
New Revision: 219225
URL: http://svn.freebsd.org/changeset/base/219225

Log:
  MFi386: revision 219186
  
    This patch shrinks boot2 a little.
  
    o    It switches kname to be just a pointer instead of an array.
    o    It changes ioctl to unsigned from uint8_t.
    o    It changes the second keyhit limit to 3 seconds from 5.
    o    It removes bi_basemem/bi_extmem/bi_memsizes_valid setting.

Modified:
  head/sys/boot/pc98/boot2/boot2.c

Modified: head/sys/boot/pc98/boot2/boot2.c
==============================================================================
--- head/sys/boot/pc98/boot2/boot2.c	Thu Mar  3 11:31:08 2011	(r219224)
+++ head/sys/boot/pc98/boot2/boot2.c	Thu Mar  3 11:45:54 2011	(r219225)
@@ -133,11 +133,11 @@ static struct dsk {
     unsigned start;
 } dsk;
 static char cmd[512], cmddup[512];
-static char kname[1024];
+static const char *kname = NULL;
 static uint32_t opts;
 static int comspeed = SIOSPD;
 static struct bootinfo bootinfo;
-static uint8_t ioctrl = IO_KEYBOARD;
+static unsigned ioctrl = IO_KEYBOARD;
 
 void exit(int);
 static void load(void);
@@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t
 static int dskread(void *, unsigned, unsigned);
 static void printf(const char *,...);
 static void putchar(int);
-static uint32_t memsize(void);
 static int drvread(void *, unsigned);
 static int keyhit(unsigned);
 static int xputc(int);
@@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n
     return 0;
 }
 
-static inline uint32_t
-memsize(void)
-{
-    return (*(u_char *)PTOV(0x401) * 128 * 1024 +
-	*(uint16_t *)PTOV(0x594) * 1024 * 1024);
-}
-
 static inline void
 getstr(void)
 {
@@ -382,9 +374,6 @@ main(void)
 #endif
     bootinfo.bi_version = BOOTINFO_VERSION;
     bootinfo.bi_size = sizeof(bootinfo);
-    bootinfo.bi_basemem = 0;	/* XXX will be filled by loader or kernel */
-    bootinfo.bi_extmem = memsize();
-    bootinfo.bi_memsizes_valid++;
 
     /* Process configuration file */
 
@@ -408,11 +397,11 @@ main(void)
      * or in case of failure, try to load a kernel directly instead.
      */
 
-    if (autoboot && !*kname) {
-	memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
+    if (autoboot && !kname) {
+	kname = PATH_BOOT3;
 	if (!keyhit(3*SECOND)) {
 	    load();
-	    memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
+	    kname = PATH_KERNEL;
 	}
     }
 
@@ -427,7 +416,7 @@ main(void)
 		   'a' + dsk.part, kname);
 	if (ioctrl & IO_SERIAL)
 	    sio_flush();
-	if (!autoboot || keyhit(5*SECOND))
+	if (!autoboot || keyhit(3*SECOND))
 	    getstr();
 	else if (!autoboot || !OPT_CHECK(RBX_QUIET))
 	    putchar('\n');
@@ -611,11 +600,7 @@ parse()
 		dsk.daua = dsk.disk | dsk.unit;
 		dsk_meta = 0;
 	    }
-	    if ((i = ep - arg)) {
-		if ((size_t)i >= sizeof(kname))
-		    return -1;
-		memcpy(kname, arg, i + 1);
-	    }
+            kname = arg;
 	}
 	arg = p;
     }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 13:13:08 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9B66106564A;
	Thu,  3 Mar 2011 13:13:08 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id C14868FC08;
	Thu,  3 Mar 2011 13:13:08 +0000 (UTC)
Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk
	[128.232.18.47])
	by cyrus.watson.org (Postfix) with ESMTPSA id 0D49A46B89;
	Thu,  3 Mar 2011 08:13:07 -0500 (EST)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: "Robert N. M. Watson" 
In-Reply-To: <20110301155330.198475yg1cnokx44@webmail.leidinger.net>
Date: Thu, 3 Mar 2011 13:13:06 +0000
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201103011323.p21DNbau027743@svn.freebsd.org>
	<20110301155330.198475yg1cnokx44@webmail.leidinger.net>
To: Alexander Leidinger 
X-Mailer: Apple Mail (2.1082)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r219129 - in head/sys: compat/freebsd32 conf kern
	sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 13:13:09 -0000


On 1 Mar 2011, at 14:53, Alexander Leidinger wrote:

> Quoting Robert Watson  (from Tue, 1 Mar 2011 =
13:23:37 +0000 (UTC)):
>=20
>> Author: rwatson
>> Date: Tue Mar  1 13:23:37 2011
>> New Revision: 219129
>> URL: http://svn.freebsd.org/changeset/base/219129
>>=20
>> Log:
>>  Add initial support for Capsicum's Capability Mode to the FreeBSD =
kernel,
>>  compiled conditionally on options CAPABILITIES:
>=20
> Typo in NOTES.

Should now be fixed.

> What about adding a FEATURE to sys_capabilities.c, could it be useful?

Yes, this sounds like a good idea -- feel free to add one :-).

Robert=

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 13:15:07 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81AFD1065674;
	Thu,  3 Mar 2011 13:15:07 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 2CEFD8FC19;
	Thu,  3 Mar 2011 13:15:06 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B32EB58.dip.t-dialin.net
	[91.50.235.88])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id D2E7B844015;
	Thu,  3 Mar 2011 14:15:02 +0100 (CET)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 72FA0242A;
	Thu,  3 Mar 2011 14:14:59 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p23DExe1027996;
	Thu, 3 Mar 2011 14:14:59 +0100 (CET)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Thu, 03 Mar 2011
	14:14:58 +0100
Message-ID: <20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
Date: Thu, 03 Mar 2011 14:14:58 +0100
From: Alexander Leidinger 
To: Robert Watson 
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
	
In-Reply-To: 
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: D2E7B844015.A6600
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=1.351, required 6,
	autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08)
X-EBL-MailScanner-SpamScore: s
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1299762904.40226@dRm6NuaBN8OWn1vxJ0bUoA
X-EBL-Spam-Status: No
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Dmitry Chagin 
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 13:15:07 -0000

Quoting Robert Watson  (from Thu, 3 Mar 2011  
11:14:59 +0000 (GMT)):

>
> On Tue, 1 Mar 2011, Dmitry Chagin wrote:
>
>> Teach kdump to decode linux syscalls names too.
>>
>> Fix bug introduced in my previous commit: the kernel always dump native
>> signal numbers, so no need to check the ABI in ktrpsig().
>
> Does this mean that we're eliminating the need for the long-broken  
> linux_kdump?

For the linux parts there is (L?)GPLed code in linux_kdump (the main  
reason that it is a port, I think), it is unlikely that someone sits  
there and will do a clean-room implementation of those linux-kernel  
derived things (I like to get proven wrong, anyone out there accepts  
the challenge? ;-) ). Dmitry provided an updated linux-kdump which  
contains preprocessed things (no need to have a non-default  
linuxulator setup). I have the corresponding PR assigned to me, but  
from his comments it looks like his new version depends upon his  
changes and does not DTRT without them (I am awaiting confirmation,  
and I asked about changes to let it DTRT if this is true).

Bye,
Alexander.

-- 
Commitment, n.:
	Commitment can be illustrated by a breakfast of ham and eggs.
	The chicken was involved, the pig was committed.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 16:16:49 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4E411065680;
	Thu,  3 Mar 2011 16:16:49 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A5538FC18;
	Thu,  3 Mar 2011 16:16:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23GGnxq050907;
	Thu, 3 Mar 2011 16:16:49 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GGnCj050904;
	Thu, 3 Mar 2011 16:16:49 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201103031616.p23GGnCj050904@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Thu, 3 Mar 2011 16:16:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219229 - head/sys/netgraph/netflow
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:16:49 -0000

Author: bz
Date: Thu Mar  3 16:16:49 2011
New Revision: 219229
URL: http://svn.freebsd.org/changeset/base/219229

Log:
  Unbreak the build for no options INET6.
  
  PR:		kern/155227
  Submitted by:	Dmitry Afanasiev (KOT MATPOCKuH.Ru)

Modified:
  head/sys/netgraph/netflow/netflow.c
  head/sys/netgraph/netflow/netflow_v9.c

Modified: head/sys/netgraph/netflow/netflow.c
==============================================================================
--- head/sys/netgraph/netflow/netflow.c	Thu Mar  3 15:27:06 2011	(r219228)
+++ head/sys/netgraph/netflow/netflow.c	Thu Mar  3 16:16:49 2011	(r219229)
@@ -99,7 +99,9 @@ static int export_add(item_p, struct flo
 static int export_send(priv_p, fib_export_p, item_p, int);
 
 static int hash_insert(priv_p, struct flow_hash_entry *, struct flow_rec *, int, uint8_t);
+#ifdef INET6
 static int hash6_insert(priv_p, struct flow6_hash_entry *, struct flow6_rec *, int, uint8_t);
+#endif
 
 static __inline void expire_flow(priv_p, fib_export_p, struct flow_entry *, int);
 
@@ -282,8 +284,10 @@ expire_flow(priv_p priv, fib_export_p fe
 			atomic_add_32(&priv->info.nfinfo_export9_failed, 1);
 			if (version == IPVERSION)
 				uma_zfree_arg(priv->zone, fle, priv);
+#ifdef INET6
 			else if (version == IP6VERSION)
 				uma_zfree_arg(priv->zone6, fle, priv);
+#endif
 			else
 				panic("ng_netflow: Unknown IP proto: %d", version);
 			return;
@@ -297,8 +301,10 @@ expire_flow(priv_p priv, fib_export_p fe
 
 	if (version == IPVERSION)
 		uma_zfree_arg(priv->zone, fle, priv);
+#ifdef INET6
 	else if (version == IP6VERSION)
 		uma_zfree_arg(priv->zone6, fle, priv);
+#endif
 }
 
 /* Get a snapshot of node statistics */

Modified: head/sys/netgraph/netflow/netflow_v9.c
==============================================================================
--- head/sys/netgraph/netflow/netflow_v9.c	Thu Mar  3 15:27:06 2011	(r219228)
+++ head/sys/netgraph/netflow/netflow_v9.c	Thu Mar  3 16:16:49 2011	(r219229)
@@ -256,7 +256,9 @@ export9_add(item_p item, struct netflow_
 
 	/* Prepare flow record */
 	fed = (struct flow_entry_data *)&fle->f;
+#ifdef INET6
 	fed6 = (struct flow6_entry_data *)&fle->f;
+#endif
 	/* We can use flow_type field since fle6 offset is equal to fle */
 	flow_type = fed->r.flow_type;
 

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 16:22:39 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CEEF8106564A;
	Thu,  3 Mar 2011 16:22:39 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id A770C8FC1E;
	Thu,  3 Mar 2011 16:22:39 +0000 (UTC)
Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk
	[128.232.18.47])
	by cyrus.watson.org (Postfix) with ESMTPSA id 9735046B8F;
	Thu,  3 Mar 2011 11:22:38 -0500 (EST)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: "Robert N. M. Watson" 
In-Reply-To: <20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
Date: Thu, 3 Mar 2011 16:22:37 +0000
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
	
	<20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
To: Alexander Leidinger 
X-Mailer: Apple Mail (2.1082)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Dmitry Chagin 
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:22:39 -0000


On 3 Mar 2011, at 13:14, Alexander Leidinger wrote:

> Quoting Robert Watson  (from Thu, 3 Mar 2011 =
11:14:59 +0000 (GMT)):
>=20
>> On Tue, 1 Mar 2011, Dmitry Chagin wrote:
>>=20
>>> Teach kdump to decode linux syscalls names too.
>>>=20
>>> Fix bug introduced in my previous commit: the kernel always dump =
native
>>> signal numbers, so no need to check the ABI in ktrpsig().
>>=20
>> Does this mean that we're eliminating the need for the long-broken =
linux_kdump?
>=20
> For the linux parts there is (L?)GPLed code in linux_kdump (the main =
reason that it is a port, I think), it is unlikely that someone sits =
there and will do a clean-room implementation of those linux-kernel =
derived things (I like to get proven wrong, anyone out there accepts the =
challenge? ;-) ). Dmitry provided an updated linux-kdump which contains =
preprocessed things (no need to have a non-default linuxulator setup). I =
have the corresponding PR assigned to me, but from his comments it looks =
like his new version depends upon his changes and does not DTRT without =
them (I am awaiting confirmation, and I asked about changes to let it =
DTRT if this is true).

On a related note, the solution for handling different OS ABIs and calls =
for OpenBSM was to have a file format that (a) expressed a superset of =
the capabilities of each platform and (b) attempted to provide common =
terms to describe their intersections. This has its limitations, but =
works fairly well in practice: you can generally have a single piece of =
software that makes pretty good use of BSM streams generated on Solaris, =
Mac OS X, or FreeBSD across those platforms and also Linux (on which =
OpenBSM compiles and runs, but whose kernel audit stack differs).

Robert=

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 17:11:15 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10FA2106566B;
	Thu,  3 Mar 2011 17:11:15 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id CABFC8FC1C;
	Thu,  3 Mar 2011 17:11:14 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 871FA46B17;
	Thu,  3 Mar 2011 12:11:14 -0500 (EST)
Received: from jhbbsd.localnet (unknown [209.249.190.10])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1EC9B8A027;
	Thu,  3 Mar 2011 12:11:14 -0500 (EST)
From: John Baldwin 
To: Nathan Whitehorn 
Date: Thu, 3 Mar 2011 12:09:43 -0500
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201103021606.p22G6vou020460@svn.freebsd.org>
In-Reply-To: <201103021606.p22G6vou020460@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201103031209.43857.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 03 Mar 2011 12:11:14 -0500 (EST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:11:15 -0000

On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
> Author: nwhitehorn
> Date: Wed Mar  2 16:06:57 2011
> New Revision: 219181
> URL: http://svn.freebsd.org/changeset/base/219181
> 
> Log:
>   Add additional release makefile for bsdinstall-based media, along with
>   support files. This does not change the default behavior of anything.
>   
>   To make bsdinstall-based media, pre-build world and GENERIC, then run
>   the release target in Makefile.bsdinstall.

Are you planning on keeping the current 'make release' behavior of building a 
full chroot and doing a clean build in the chroot to build a release?  That 
is, is 'Makefile.bsdinstall' just a temporary shortcut for building test 
releases or is that the final replacement for 'release/Makefile'?

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 17:22:47 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BDCC106566B;
	Thu,  3 Mar 2011 17:22:47 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212])
	by mx1.freebsd.org (Postfix) with ESMTP id D07878FC0C;
	Thu,  3 Mar 2011 17:22:46 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0LHH00C00S9YXA00@smtpauth3.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 11:22:46 -0600 (CST)
Received: from anacreon.physics.wisc.edu
	(anacreon.physics.wisc.edu [128.104.160.176]) by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0LHH006HRS9WMO40@smtpauth3.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 11:22:45 -0600 (CST)
Date: Thu, 03 Mar 2011 11:22:44 -0600
From: Nathan Whitehorn 
In-reply-to: <201103031209.43857.jhb@freebsd.org>
To: John Baldwin 
Message-id: <4D6FCE64.3010302@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176
X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776,
	Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.3.171531,
	SenderIP=128.104.160.176
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org>
User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.14)
	Gecko/20110302 Thunderbird/3.1.8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:22:47 -0000

On 03/03/11 11:09, John Baldwin wrote:
> On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
>> Author: nwhitehorn
>> Date: Wed Mar  2 16:06:57 2011
>> New Revision: 219181
>> URL: http://svn.freebsd.org/changeset/base/219181
>>
>> Log:
>>    Add additional release makefile for bsdinstall-based media, along with
>>    support files. This does not change the default behavior of anything.
>>
>>    To make bsdinstall-based media, pre-build world and GENERIC, then run
>>    the release target in Makefile.bsdinstall.
> Are you planning on keeping the current 'make release' behavior of building a
> full chroot and doing a clean build in the chroot to build a release?  That
> is, is 'Makefile.bsdinstall' just a temporary shortcut for building test
> releases or is that the final replacement for 'release/Makefile'?

It was intended (modulo memstick building, docs, and some miscellaneous 
cleanup) to be the final replacement for release/Makefile. In my 
experience, the automatic fetching, clean build, and chroot was a major 
impediment to easily making installation media for users to test 
patches. I figured that if people (e.g. re@) really want a totally clean 
tree, checking one out by hand and building from there didn't seem like 
an enormous obstacle.

If you think it's a really important feature, I'm happy to add it back, 
however.
-Nathan


From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 17:33:22 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E23091065670;
	Thu,  3 Mar 2011 17:33:22 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B7B158FC12;
	Thu,  3 Mar 2011 17:33:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23HXMuO056736;
	Thu, 3 Mar 2011 17:33:22 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HXMQd056734;
	Thu, 3 Mar 2011 17:33:22 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103031733.p23HXMQd056734@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Thu, 3 Mar 2011 17:33:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219238 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:33:23 -0000

Author: trasz
Date: Thu Mar  3 17:33:22 2011
New Revision: 219238
URL: http://svn.freebsd.org/changeset/base/219238

Log:
  Make "struct pts_softc" point to ucred instead of uidinfo.  This is no-op,
  required for resource containers.
  
  Reviewed by:	kib (as part of a larger patch), ed

Modified:
  head/sys/kern/tty_pts.c

Modified: head/sys/kern/tty_pts.c
==============================================================================
--- head/sys/kern/tty_pts.c	Thu Mar  3 17:12:24 2011	(r219237)
+++ head/sys/kern/tty_pts.c	Thu Mar  3 17:33:22 2011	(r219238)
@@ -97,7 +97,7 @@ struct pts_softc {
 	struct cdev	*pts_cdev;	/* (c) Master device node. */
 #endif /* PTS_EXTERNAL */
 
-	struct uidinfo	*pts_uidinfo;	/* (c) Resource limit. */
+	struct ucred	*pts_cred;	/* (c) Resource limit. */
 };
 
 /*
@@ -681,8 +681,8 @@ ptsdrv_free(void *softc)
 	if (psc->pts_unit >= 0)
 		free_unr(pts_pool, psc->pts_unit);
 
-	chgptscnt(psc->pts_uidinfo, -1, 0);
-	uifree(psc->pts_uidinfo);
+	chgptscnt(psc->pts_cred->cr_ruidinfo, -1, 0);
+	crfree(psc->pts_cred);
 
 	knlist_destroy(&psc->pts_inpoll.si_note);
 	knlist_destroy(&psc->pts_outpoll.si_note);
@@ -716,11 +716,11 @@ pts_alloc(int fflags, struct thread *td,
 	struct tty *tp;
 	struct pts_softc *psc;
 	struct proc *p = td->td_proc;
-	struct uidinfo *uid = td->td_ucred->cr_ruidinfo;
+	struct ucred *cred = td->td_ucred;
 
 	/* Resource limiting. */
 	PROC_LOCK(p);
-	ok = chgptscnt(uid, 1, lim_cur(p, RLIMIT_NPTS));
+	ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS));
 	PROC_UNLOCK(p);
 	if (!ok)
 		return (EAGAIN);
@@ -728,7 +728,7 @@ pts_alloc(int fflags, struct thread *td,
 	/* Try to allocate a new pts unit number. */
 	unit = alloc_unr(pts_pool);
 	if (unit < 0) {
-		chgptscnt(uid, -1, 0);
+		chgptscnt(cred->cr_ruidinfo, -1, 0);
 		return (EAGAIN);
 	}
 
@@ -738,8 +738,7 @@ pts_alloc(int fflags, struct thread *td,
 	cv_init(&psc->pts_outwait, "ptsout");
 
 	psc->pts_unit = unit;
-	psc->pts_uidinfo = uid;
-	uihold(uid);
+	psc->pts_cred = crhold(cred);
 
 	tp = tty_alloc(&pts_class, psc);
 	knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx);
@@ -762,11 +761,11 @@ pts_alloc_external(int fflags, struct th
 	struct tty *tp;
 	struct pts_softc *psc;
 	struct proc *p = td->td_proc;
-	struct uidinfo *uid = td->td_ucred->cr_ruidinfo;
+	struct ucred *cred = td->td_ucred;
 
 	/* Resource limiting. */
 	PROC_LOCK(p);
-	ok = chgptscnt(uid, 1, lim_cur(p, RLIMIT_NPTS));
+	ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS));
 	PROC_UNLOCK(p);
 	if (!ok)
 		return (EAGAIN);
@@ -778,8 +777,7 @@ pts_alloc_external(int fflags, struct th
 
 	psc->pts_unit = -1;
 	psc->pts_cdev = dev;
-	psc->pts_uidinfo = uid;
-	uihold(uid);
+	psc->pts_cred = crhold(cred);
 
 	tp = tty_alloc(&pts_class, psc);
 	knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 18:04:10 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 932321065673;
	Thu,  3 Mar 2011 18:04:10 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 399F28FC08;
	Thu,  3 Mar 2011 18:04:09 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id 2D9AFCC4BA;
	Thu,  3 Mar 2011 21:03:57 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 305534779; Thu, 03 Mar 2011 21:03:57 +0300
Received: from dchagin.static.corbina.ru (localhost [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id
	p23I3uon016189; Thu, 3 Mar 2011 21:03:56 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p23I3p58016188; 
	Thu, 3 Mar 2011 21:03:51 +0300 (MSK) (envelope-from dchagin)
Date: Thu, 3 Mar 2011 21:03:51 +0300
From: Chagin Dmitry 
To: Robert Watson 
Message-ID: <20110303180351.GA6049@dchagin.static.corbina.ru>
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
	
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:04:10 -0000


--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 03, 2011 at 11:14:59AM +0000, Robert Watson wrote:
>=20
> On Tue, 1 Mar 2011, Dmitry Chagin wrote:
>=20
> >  Teach kdump to decode linux syscalls names too.
> >
> >  Fix bug introduced in my previous commit: the kernel always dump native
> >  signal numbers, so no need to check the ABI in ktrpsig().
>=20
> Does this mean that we're eliminating the need for the long-broken=20
> linux_kdump?
>=20

mostly yes, w/o syscall parameter decoding.

> Is there any ABI record in ktrace files, and/or should we add one somehow?
>=20

Now kernel writes sv_flags to the trace file at fork, exec, exit time.
And kdump knows how to handle this.

> I'd love to be able to process a kdump file generated from a blend of ABI=
s:=20
> i.e., if I do ktrace -di tcsh, and then run a bunch of commands from diff=
erent=20
> ABIs (FreeBSD/32-bit Intel, FreeBSD/64-bit Intel, Linux/32-bit Intel, and=
=20
> possible FreeBSD/64 MIPS so that a distributed ktracing tool gathers the=
=20
> results across hosts for a single action), have kdump Just Work.  This=20
> suggests that a per-record ABI indicator might be useful.
>=20
> Robert

This is the next stage :)

--
chd,
Have fun!

>=20

--vtzGhvizbBRQ85DL
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAk1v2AcACgkQ0t2Tb3OO/O2L4QCfSUi0UTPxJKX3PiFOh6N9BWhH
YMkAn0OkffY6Ylxt5NWE0mkOqBq3Oi2u
=RwtQ
-----END PGP SIGNATURE-----

--vtzGhvizbBRQ85DL--

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 18:05:18 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 738681065674;
	Thu,  3 Mar 2011 18:05:18 +0000 (UTC)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5])
	by mx1.freebsd.org (Postfix) with ESMTP id 181248FC08;
	Thu,  3 Mar 2011 18:05:18 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id 38318CD0D2;
	Thu,  3 Mar 2011 21:05:15 +0300 (MSK)
X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9
Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru)
	by corbina.ru (CommuniGate Pro SMTP 5.1.14)
	with ESMTPS id 305535209; Thu, 03 Mar 2011 21:05:15 +0300
Received: from dchagin.static.corbina.ru (localhost [127.0.0.1])
	by dchagin.static.corbina.ru (8.14.4/8.14.4) with ESMTP id
	p23I5Det017663; Thu, 3 Mar 2011 21:05:13 +0300 (MSK)
	(envelope-from dchagin@dchagin.static.corbina.ru)
Received: (from dchagin@localhost)
	by dchagin.static.corbina.ru (8.14.4/8.14.4/Submit) id p23I57g5017657; 
	Thu, 3 Mar 2011 21:05:07 +0300 (MSK) (envelope-from dchagin)
Date: Thu, 3 Mar 2011 21:05:07 +0300
From: Chagin Dmitry 
To: Alexander Leidinger 
Message-ID: <20110303180507.GB6049@dchagin.static.corbina.ru>
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
	
	<20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="EuxKj2iCbKjpUGkD"
Content-Disposition: inline
In-Reply-To: <20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Robert Watson 
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:05:18 -0000


--EuxKj2iCbKjpUGkD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Mar 03, 2011 at 02:14:58PM +0100, Alexander Leidinger wrote:
> Quoting Robert Watson  (from Thu, 3 Mar 2011 =20
> 11:14:59 +0000 (GMT)):
>=20
> >
> > On Tue, 1 Mar 2011, Dmitry Chagin wrote:
> >
> >> Teach kdump to decode linux syscalls names too.
> >>
> >> Fix bug introduced in my previous commit: the kernel always dump native
> >> signal numbers, so no need to check the ABI in ktrpsig().
> >
> > Does this mean that we're eliminating the need for the long-broken =20
> > linux_kdump?
>=20
> For the linux parts there is (L?)GPLed code in linux_kdump (the main =20
> reason that it is a port, I think), it is unlikely that someone sits =20
> there and will do a clean-room implementation of those linux-kernel =20
> derived things (I like to get proven wrong, anyone out there accepts =20
> the challenge? ;-) ). Dmitry provided an updated linux-kdump which =20
> contains preprocessed things (no need to have a non-default =20
> linuxulator setup). I have the corresponding PR assigned to me, but =20
> from his comments it looks like his new version depends upon his =20
> changes and does not DTRT without them (I am awaiting confirmation, =20
> and I asked about changes to let it DTRT if this is true).
>=20

It will be mergeed soon, I'll let you know. thnx!

--=20
Have fun!
chd

--EuxKj2iCbKjpUGkD
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAk1v2FMACgkQ0t2Tb3OO/O1PQgCgnAHFYS0CkugmOCVqj38WmVYd
RNIAoIEYc9fN5M/7XtBgnqbzgS14iohK
=ONaO
-----END PGP SIGNATURE-----

--EuxKj2iCbKjpUGkD--

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 18:19:11 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 003521065670;
	Thu,  3 Mar 2011 18:19:10 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E365F8FC17;
	Thu,  3 Mar 2011 18:19:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23IJAat060824;
	Thu, 3 Mar 2011 18:19:10 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23IJAD9060822;
	Thu, 3 Mar 2011 18:19:10 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103031819.p23IJAD9060822@svn.freebsd.org>
From: Dmitry Chagin 
Date: Thu, 3 Mar 2011 18:19:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219240 - head/sys/compat/linux
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:19:11 -0000

Author: dchagin
Date: Thu Mar  3 18:19:10 2011
New Revision: 219240
URL: http://svn.freebsd.org/changeset/base/219240

Log:
  Switch PROCESS_SHARE to AUTO_SHARE (as umtx do). Even for SHARED,
  if page mapped MAP_ANON linux uses private algorithm too.
  
  Disscussed with:	jhb
  
  MFC after:	3 Days

Modified:
  head/sys/compat/linux/linux_futex.c

Modified: head/sys/compat/linux/linux_futex.c
==============================================================================
--- head/sys/compat/linux/linux_futex.c	Thu Mar  3 18:16:35 2011	(r219239)
+++ head/sys/compat/linux/linux_futex.c	Thu Mar  3 18:19:10 2011	(r219240)
@@ -161,7 +161,7 @@ futex_get0(uint32_t *uaddr, struct futex
 	*newf = tmpf = NULL;
 
 	error = umtx_key_get(uaddr, TYPE_FUTEX, (flags & FUTEX_SHARED) ?
-	    PROCESS_SHARE : THREAD_SHARE, &key);
+	    AUTO_SHARE : THREAD_SHARE, &key);
 	if (error)
 		return (error);
 retry:

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 18:28:21 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E6761065675;
	Thu,  3 Mar 2011 18:28:21 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DB7C8FC08;
	Thu,  3 Mar 2011 18:28:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23ISLta061295;
	Thu, 3 Mar 2011 18:28:21 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23ISLwj061293;
	Thu, 3 Mar 2011 18:28:21 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201103031828.p23ISLwj061293@svn.freebsd.org>
From: Matt Jacob 
Date: Thu, 3 Mar 2011 18:28:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219241 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:28:21 -0000

Author: mjacob
Date: Thu Mar  3 18:28:21 2011
New Revision: 219241
URL: http://svn.freebsd.org/changeset/base/219241

Log:
  Don't automatically send a START UNIT to sequential access devices-
  this might cause them to load the tape unintentionally.
  
  Reviewed by:	gibbs
  MFC after:	1 month

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Thu Mar  3 18:19:10 2011	(r219240)
+++ head/sys/cam/cam_periph.c	Thu Mar  3 18:28:21 2011	(r219241)
@@ -1560,6 +1560,15 @@ camperiphscsisenseerror(union ccb *ccb, 
 		case SS_START:
 		{
 			int le;
+			if (SID_TYPE(&cgd.inq_data) == T_SEQUENTIAL) {
+				xpt_free_ccb(orig_ccb);
+				ccb->ccb_h.status |= CAM_DEV_QFRZN;
+				*action_string = "Will not autostart a "
+				    "sequential access device";
+				err_action = SS_FAIL;
+				error = EIO;
+				break;
+			}
 
 			/*
 			 * Send a start unit command to the device, and

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 18:29:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A707B106564A;
	Thu,  3 Mar 2011 18:29:55 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 95BC58FC17;
	Thu,  3 Mar 2011 18:29:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23ITtnS061396;
	Thu, 3 Mar 2011 18:29:55 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23ITtqW061394;
	Thu, 3 Mar 2011 18:29:55 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103031829.p23ITtqW061394@svn.freebsd.org>
From: Dmitry Chagin 
Date: Thu, 3 Mar 2011 18:29:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219242 - head/sys/compat/linux
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:29:55 -0000

Author: dchagin
Date: Thu Mar  3 18:29:55 2011
New Revision: 219242
URL: http://svn.freebsd.org/changeset/base/219242

Log:
  Print out shared flag for debug purpose.
  
  MFC after:	1 Week

Modified:
  head/sys/compat/linux/linux_futex.c

Modified: head/sys/compat/linux/linux_futex.c
==============================================================================
--- head/sys/compat/linux/linux_futex.c	Thu Mar  3 18:28:21 2011	(r219241)
+++ head/sys/compat/linux/linux_futex.c	Thu Mar  3 18:29:55 2011	(r219242)
@@ -137,16 +137,16 @@ futex_put(struct futex *f, struct waitin
 		FUTEXES_UNLOCK;
 		FUTEX_UNLOCK(f);
 
-		LINUX_CTR2(sys_futex, "futex_put destroy uaddr %p ref %d",
-		    f->f_uaddr, f->f_refcount);
+		LINUX_CTR3(sys_futex, "futex_put destroy uaddr %p ref %d "
+		    "shared %d", f->f_uaddr, f->f_refcount, f->f_key.shared);
 		umtx_key_release(&f->f_key);
 		FUTEX_DESTROY(f);
 		free(f, M_FUTEX);
 		return;
 	}
 
-	LINUX_CTR2(sys_futex, "futex_put uaddr %p ref %d",
-	    f->f_uaddr, f->f_refcount);
+	LINUX_CTR3(sys_futex, "futex_put uaddr %p ref %d shared %d",
+	    f->f_uaddr, f->f_refcount, f->f_key.shared);
 	FUTEXES_UNLOCK;
 	FUTEX_UNLOCK(f);
 }
@@ -189,8 +189,8 @@ retry:
 
 			FUTEX_LOCK(f);
 			*newf = f;
-			LINUX_CTR2(sys_futex, "futex_get uaddr %p ref %d",
-			    uaddr, f->f_refcount);
+			LINUX_CTR3(sys_futex, "futex_get uaddr %p ref %d shared %d",
+			    uaddr, f->f_refcount, f->f_key.shared);
 			return (0);
 		}
 	}
@@ -223,8 +223,8 @@ retry:
 	LIST_INSERT_HEAD(&futex_list, tmpf, f_list);
 	FUTEXES_UNLOCK;
 
-	LINUX_CTR2(sys_futex, "futex_get uaddr %p ref %d new",
-	    uaddr, tmpf->f_refcount);
+	LINUX_CTR3(sys_futex, "futex_get uaddr %p ref %d shared %d new",
+	    uaddr, tmpf->f_refcount, tmpf->f_key.shared);
 	*newf = tmpf;
 	return (0);
 }

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 19:34:09 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E261106564A;
	Thu,  3 Mar 2011 19:34:09 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id D88818FC17;
	Thu,  3 Mar 2011 19:34:08 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 798A746B35;
	Thu,  3 Mar 2011 14:34:08 -0500 (EST)
Received: from jhbbsd.localnet (unknown [209.249.190.10])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0C2CB8A01B;
	Thu,  3 Mar 2011 14:34:08 -0500 (EST)
From: John Baldwin 
To: Nathan Whitehorn 
Date: Thu, 3 Mar 2011 14:32:36 -0500
User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; )
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
In-Reply-To: <4D6FCE64.3010302@freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201103031432.36336.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 03 Mar 2011 14:34:08 -0500 (EST)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:34:09 -0000

On Thursday, March 03, 2011 12:22:44 pm Nathan Whitehorn wrote:
> On 03/03/11 11:09, John Baldwin wrote:
> > On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
> >> Author: nwhitehorn
> >> Date: Wed Mar  2 16:06:57 2011
> >> New Revision: 219181
> >> URL: http://svn.freebsd.org/changeset/base/219181
> >>
> >> Log:
> >>    Add additional release makefile for bsdinstall-based media, along with
> >>    support files. This does not change the default behavior of anything.
> >>
> >>    To make bsdinstall-based media, pre-build world and GENERIC, then run
> >>    the release target in Makefile.bsdinstall.
> > Are you planning on keeping the current 'make release' behavior of building a
> > full chroot and doing a clean build in the chroot to build a release?  That
> > is, is 'Makefile.bsdinstall' just a temporary shortcut for building test
> > releases or is that the final replacement for 'release/Makefile'?
> 
> It was intended (modulo memstick building, docs, and some miscellaneous 
> cleanup) to be the final replacement for release/Makefile. In my 
> experience, the automatic fetching, clean build, and chroot was a major 
> impediment to easily making installation media for users to test 
> patches. I figured that if people (e.g. re@) really want a totally clean 
> tree, checking one out by hand and building from there didn't seem like 
> an enormous obstacle.
> 
> If you think it's a really important feature, I'm happy to add it back, 
> however.

I think it is a very important feature to ensure release builds are not
polluted by local changes in /etc/src.conf, etc.  I think it would be good
to support both models perhaps, but for our official release builds I think
we need the clean environment.  I certainly use 'make release' now for my
own custom FooBSD builds to get a clean environment.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 19:49:21 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6AA26106564A;
	Thu,  3 Mar 2011 19:49:21 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id 2D85D8FC12;
	Thu,  3 Mar 2011 19:49:20 +0000 (UTC)
Received: from [192.168.1.100] (m206-63.dsl.tsoft.com [198.144.206.63])
	by ns1.feral.com (8.14.4/8.14.3) with ESMTP id p23JbNbc070306;
	Thu, 3 Mar 2011 11:37:23 -0800 (PST) (envelope-from mj@feral.com)
Message-ID: <4D6FEE09.5050502@feral.com>
Date: Thu, 03 Mar 2011 11:37:45 -0800
From: Matthew Jacob 
Organization: Feral Software
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8
MIME-Version: 1.0
To: John Baldwin 
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org>
In-Reply-To: <201103031432.36336.jhb@freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.6
	(ns1.feral.com [192.67.166.1]);
	Thu, 03 Mar 2011 11:37:24 -0800 (PST)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Nathan Whitehorn 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:49:21 -0000



> I think it is a very important feature to ensure release builds are not
> polluted by local changes in /etc/src.conf, etc.  I think it would be good
> to support both models perhaps, but for our official release builds I think
> we need the clean environment.  I certainly use 'make release' now for my
> own custom FooBSD builds to get a clean environment.
>
While not disagreeing with you on this, one should really always do 'env 
-i PATH=/usr/bin:/bin make release' if you want to ensure non-pollution.

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 20:04:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA676106566B;
	Thu,  3 Mar 2011 20:04:02 +0000 (UTC)
	(envelope-from yanegomi@gmail.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 9462E8FC0A;
	Thu,  3 Mar 2011 20:04:01 +0000 (UTC)
Received: by wyb32 with SMTP id 32so1660455wyb.13
	for ; Thu, 03 Mar 2011 12:04:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=JnW8sgPjokYiizKyG+tsn8YyWBaczDj1DanzLTS7Igc=;
	b=ot20hOa86uGKAD5Uthh7xX2dOM/ZnCpZVsjo8gl1E7MxyaXFYU+m3KUmykfdTxrOdU
	0szslvO3NNsCgv51mw2UTyqkKZi1YpvR2wxjx2lei6GIdrUuFsxobCxqUZD3uxrpHaIW
	Ad7aNo8PaAkHqydnmcgTf1+LrO8UtQUGtYETU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=TRJe6LmEos2AyHKdKZx2hrl2rz8b8dThqdNnF4tAxT6oRfLBj1SdujiuhaTjJt1yrx
	dcBdmGul6AXEh4IrcuoISRFVFd3DUCYU3j2qDqFNKnx9VLKWqXw0xt0ntdevd/oQY7Ba
	bLrxgeg9wPjmyVbYKKpuyTFS+dJ0bwz8/UBWY=
MIME-Version: 1.0
Received: by 10.216.144.198 with SMTP id n48mr988405wej.75.1299182640394; Thu,
	03 Mar 2011 12:04:00 -0800 (PST)
Sender: yanegomi@gmail.com
Received: by 10.216.172.7 with HTTP; Thu, 3 Mar 2011 12:04:00 -0800 (PST)
In-Reply-To: <4D6FEE09.5050502@feral.com>
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org> <4D6FEE09.5050502@feral.com>
Date: Thu, 3 Mar 2011 12:04:00 -0800
X-Google-Sender-Auth: uag99Br-fnU9ITS7mesfm5Yx7fo
Message-ID: 
From: Garrett Cooper 
To: Matthew Jacob 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Nathan Whitehorn ,
	John Baldwin 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:04:02 -0000

On Thu, Mar 3, 2011 at 11:37 AM, Matthew Jacob  wrote:
>
>
>> I think it is a very important feature to ensure release builds are not
>> polluted by local changes in /etc/src.conf, etc. =A0I think it would be =
good
>> to support both models perhaps, but for our official release builds I
>> think
>> we need the clean environment. =A0I certainly use 'make release' now for=
 my
>> own custom FooBSD builds to get a clean environment.
>>
> While not disagreeing with you on this, one should really always do 'env =
-i
> PATH=3D/usr/bin:/bin make release' if you want to ensure non-pollution.

It's more in-depth than that. The only way to ensure that the release
builds are non-tainted without doing a ton of hacks is to create an
untainted chroot/jail for the release build, or do the previous
incantation in release/Makefile, as a number of components can taint
the environment outside of PATH (see nanobsd's build scripts for a
start on this).

My personal preference is to have the scripts and infrastructure exist
within release to do this instead of within release/Makefile, but this
would require changes to any existing infrastructure that anyone
depending on release/Makefile is employing out in the field; on the
bright side maybe release/Makefile and nanobsd could converge because
they'd be using more of the same logic to run things and the things
that would truly differ are just the payload content.

Thanks,
-Garrett

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 20:42:00 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2AD2C106564A;
	Thu,  3 Mar 2011 20:42:00 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1954E8FC0A;
	Thu,  3 Mar 2011 20:42:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23Kfx46073610;
	Thu, 3 Mar 2011 20:42:00 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Kfxb5073608;
	Thu, 3 Mar 2011 20:41:59 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103032041.p23Kfxb5073608@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 3 Mar 2011 20:41:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219252 - head/sys/dev/ath/ath_rate/sample
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:42:00 -0000

Author: adrian
Date: Thu Mar  3 20:41:59 2011
New Revision: 219252
URL: http://svn.freebsd.org/changeset/base/219252

Log:
  The sample rate module currently does the slightly wrong thing when
  determining whether to use MRR or not.
  
  It uses the 11g protection mode when calculating 11n related stuff, rather
  than checking the 11n protection mode.
  
  Furthermore, the 11n chipsets can quite happily handle multi-rate retry w/
  protection; the TX path and rate control modules need to be taught about
  that.

Modified:
  head/sys/dev/ath/ath_rate/sample/sample.c

Modified: head/sys/dev/ath/ath_rate/sample/sample.c
==============================================================================
--- head/sys/dev/ath/ath_rate/sample/sample.c	Thu Mar  3 20:14:00 2011	(r219251)
+++ head/sys/dev/ath/ath_rate/sample/sample.c	Thu Mar  3 20:41:59 2011	(r219252)
@@ -273,6 +273,7 @@ ath_rate_findrate(struct ath_softc *sc, 
 		goto done;
 	}
 
+	/* XXX TODO: this doesn't know about 11gn vs 11g protection; teach it */
 	mrr = sc->sc_mrretry && !(ic->ic_flags & IEEE80211_F_USEPROT);
 
 	best_rix = pick_best_rate(sn, rt, size_bin, !mrr);

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 21:32:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD540106566B;
	Thu,  3 Mar 2011 21:32:41 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id 58C508FC12;
	Thu,  3 Mar 2011 21:32:41 +0000 (UTC)
Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57])
	(authenticated bits=0)
	by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id p23LEfBp031730;
	Thu, 3 Mar 2011 14:14:42 -0700 (MST)
	(envelope-from scottl@samsco.org)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Scott Long 
In-Reply-To: <201103031432.36336.jhb@freebsd.org>
Date: Thu, 3 Mar 2011 14:14:41 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.1082)
X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Nathan Whitehorn 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 21:32:41 -0000

On Mar 3, 2011, at 12:32 PM, John Baldwin wrote:
> On Thursday, March 03, 2011 12:22:44 pm Nathan Whitehorn wrote:
>> On 03/03/11 11:09, John Baldwin wrote:
>>> On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
>>>> Author: nwhitehorn
>>>> Date: Wed Mar  2 16:06:57 2011
>>>> New Revision: 219181
>>>> URL: http://svn.freebsd.org/changeset/base/219181
>>>>=20
>>>> Log:
>>>>  Add additional release makefile for bsdinstall-based media, along =
with
>>>>  support files. This does not change the default behavior of =
anything.
>>>>=20
>>>>  To make bsdinstall-based media, pre-build world and GENERIC, then =
run
>>>>  the release target in Makefile.bsdinstall.
>>> Are you planning on keeping the current 'make release' behavior of =
building a
>>> full chroot and doing a clean build in the chroot to build a =
release?  That
>>> is, is 'Makefile.bsdinstall' just a temporary shortcut for building =
test
>>> releases or is that the final replacement for 'release/Makefile'?
>>=20
>> It was intended (modulo memstick building, docs, and some =
miscellaneous=20
>> cleanup) to be the final replacement for release/Makefile. In my=20
>> experience, the automatic fetching, clean build, and chroot was a =
major=20
>> impediment to easily making installation media for users to test=20
>> patches. I figured that if people (e.g. re@) really want a totally =
clean=20
>> tree, checking one out by hand and building from there didn't seem =
like=20
>> an enormous obstacle.
>>=20
>> If you think it's a really important feature, I'm happy to add it =
back,=20
>> however.
>=20
> I think it is a very important feature to ensure release builds are =
not
> polluted by local changes in /etc/src.conf, etc.  I think it would be =
good
> to support both models perhaps, but for our official release builds I =
think
> we need the clean environment.  I certainly use 'make release' now for =
my
> own custom FooBSD builds to get a clean environment.
>=20

Agreed entirely.  I'd consider it a major bug if the insulated release =
environment went away, especially since I'm switching release building =
at Yahoo to use it.  There are plenty of shortcuts available in the =
script to reduce the time overhead for quick turnaround testing.

Scott



From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 21:42:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 819EC106566C;
	Thu,  3 Mar 2011 21:42:12 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EE558FC13;
	Thu,  3 Mar 2011 21:42:12 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0LHI00D0K4AB9F00@smtpauth3.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 15:42:11 -0600 (CST)
Received: from anacreon.physics.wisc.edu
	(anacreon.physics.wisc.edu [128.104.160.176]) by
	smtpauth3.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0LHI0059S4A58850@smtpauth3.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 15:42:06 -0600 (CST)
Date: Thu, 03 Mar 2011 15:42:05 -0600
From: Nathan Whitehorn 
In-reply-to: 
To: Scott Long 
Message-id: <4D700B2D.1010003@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176
X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776,
	Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.3.213620,
	SenderIP=128.104.160.176
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org>
	
User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.14)
	Gecko/20110302 Thunderbird/3.1.8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 21:42:12 -0000

On 03/03/11 15:14, Scott Long wrote:
> On Mar 3, 2011, at 12:32 PM, John Baldwin wrote:
>> On Thursday, March 03, 2011 12:22:44 pm Nathan Whitehorn wrote:
>>> On 03/03/11 11:09, John Baldwin wrote:
>>>> On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
>>>>> Author: nwhitehorn
>>>>> Date: Wed Mar  2 16:06:57 2011
>>>>> New Revision: 219181
>>>>> URL: http://svn.freebsd.org/changeset/base/219181
>>>>>
>>>>> Log:
>>>>>   Add additional release makefile for bsdinstall-based media, along with
>>>>>   support files. This does not change the default behavior of anything.
>>>>>
>>>>>   To make bsdinstall-based media, pre-build world and GENERIC, then run
>>>>>   the release target in Makefile.bsdinstall.
>>>> Are you planning on keeping the current 'make release' behavior of building a
>>>> full chroot and doing a clean build in the chroot to build a release?  That
>>>> is, is 'Makefile.bsdinstall' just a temporary shortcut for building test
>>>> releases or is that the final replacement for 'release/Makefile'?
>>> It was intended (modulo memstick building, docs, and some miscellaneous
>>> cleanup) to be the final replacement for release/Makefile. In my
>>> experience, the automatic fetching, clean build, and chroot was a major
>>> impediment to easily making installation media for users to test
>>> patches. I figured that if people (e.g. re@) really want a totally clean
>>> tree, checking one out by hand and building from there didn't seem like
>>> an enormous obstacle.
>>>
>>> If you think it's a really important feature, I'm happy to add it back,
>>> however.
>> I think it is a very important feature to ensure release builds are not
>> polluted by local changes in /etc/src.conf, etc.  I think it would be good
>> to support both models perhaps, but for our official release builds I think
>> we need the clean environment.  I certainly use 'make release' now for my
>> own custom FooBSD builds to get a clean environment.
>>
> Agreed entirely.  I'd consider it a major bug if the insulated release environment went away, especially since I'm switching release building at Yahoo to use it.  There are plenty of shortcuts available in the script to reduce the time overhead for quick turnaround testing.

To me, there's a distinction between "release building" and "make 
bootable media", and I like the suggestion to support both. One option 
would be that we keep the "make cdrom" target as is, but add 
dependencies, and then have a "release" target that actually the chroot 
setup. Another would be to keep the Makefile as-is, but to add a shell 
script that does the version control checkout, building, chroot setup, 
etc., etc. Would you have a preference there?
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 21:52:59 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 26CF7106566B;
	Thu,  3 Mar 2011 21:52:59 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id D08EB8FC1D;
	Thu,  3 Mar 2011 21:52:58 +0000 (UTC)
Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57])
	(authenticated bits=0)
	by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id p23LqpXV031897;
	Thu, 3 Mar 2011 14:52:53 -0700 (MST)
	(envelope-from scottl@samsco.org)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Scott Long 
In-Reply-To: <4D700B2D.1010003@freebsd.org>
Date: Thu, 3 Mar 2011 14:52:51 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org>
	
	<4D700B2D.1010003@freebsd.org>
To: Nathan Whitehorn 
X-Mailer: Apple Mail (2.1082)
X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 21:52:59 -0000

On Mar 3, 2011, at 2:42 PM, Nathan Whitehorn wrote:
> On 03/03/11 15:14, Scott Long wrote:
>> On Mar 3, 2011, at 12:32 PM, John Baldwin wrote:
>>> On Thursday, March 03, 2011 12:22:44 pm Nathan Whitehorn wrote:
>>>> On 03/03/11 11:09, John Baldwin wrote:
>>>>> On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
>>>>>> Author: nwhitehorn
>>>>>> Date: Wed Mar  2 16:06:57 2011
>>>>>> New Revision: 219181
>>>>>> URL: http://svn.freebsd.org/changeset/base/219181
>>>>>>=20
>>>>>> Log:
>>>>>>  Add additional release makefile for bsdinstall-based media, =
along with
>>>>>>  support files. This does not change the default behavior of =
anything.
>>>>>>=20
>>>>>>  To make bsdinstall-based media, pre-build world and GENERIC, =
then run
>>>>>>  the release target in Makefile.bsdinstall.
>>>>> Are you planning on keeping the current 'make release' behavior of =
building a
>>>>> full chroot and doing a clean build in the chroot to build a =
release?  That
>>>>> is, is 'Makefile.bsdinstall' just a temporary shortcut for =
building test
>>>>> releases or is that the final replacement for 'release/Makefile'?
>>>> It was intended (modulo memstick building, docs, and some =
miscellaneous
>>>> cleanup) to be the final replacement for release/Makefile. In my
>>>> experience, the automatic fetching, clean build, and chroot was a =
major
>>>> impediment to easily making installation media for users to test
>>>> patches. I figured that if people (e.g. re@) really want a totally =
clean
>>>> tree, checking one out by hand and building from there didn't seem =
like
>>>> an enormous obstacle.
>>>>=20
>>>> If you think it's a really important feature, I'm happy to add it =
back,
>>>> however.
>>> I think it is a very important feature to ensure release builds are =
not
>>> polluted by local changes in /etc/src.conf, etc.  I think it would =
be good
>>> to support both models perhaps, but for our official release builds =
I think
>>> we need the clean environment.  I certainly use 'make release' now =
for my
>>> own custom FooBSD builds to get a clean environment.
>>>=20
>> Agreed entirely.  I'd consider it a major bug if the insulated =
release environment went away, especially since I'm switching release =
building at Yahoo to use it.  There are plenty of shortcuts available in =
the script to reduce the time overhead for quick turnaround testing.
>=20
> To me, there's a distinction between "release building" and "make =
bootable media", and I like the suggestion to support both. One option =
would be that we keep the "make cdrom" target as is, but add =
dependencies, and then have a "release" target that actually the chroot =
setup. Another would be to keep the Makefile as-is, but to add a shell =
script that does the version control checkout, building, chroot setup, =
etc., etc. Would you have a preference there?
> -Nathan

I've been using the existing /usr/src/release/Makefile for 10 years, so =
it's pretty ingrained in me; I'm reluctant to embrace change =3D-)  That =
being said, yeah, I can see how there can be some improved =
modularization between obtaining the src tree, setting up the chroot, =
generating object bits, and packaging those bits onto release media.  =
Those functional splits already exist within the Makefile, but probably =
aren't too clear unless you're very familiar with all of the sub-targets =
and control variables.  If you wanted to clean this up and provide some =
clearer modularization, I think it could be a good thing.

Scott


From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 22:32:32 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E70C31065672;
	Thu,  3 Mar 2011 22:32:32 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211])
	by mx1.freebsd.org (Postfix) with ESMTP id B27688FC12;
	Thu,  3 Mar 2011 22:32:32 +0000 (UTC)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by
	smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009)) id <0LHI000006M8IV00@smtpauth2.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 16:32:32 -0600 (CST)
Received: from anacreon.physics.wisc.edu
	(anacreon.physics.wisc.edu [128.104.160.176]) by
	smtpauth2.wiscmail.wisc.edu
	(Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30
	2009))
	with ESMTPSA id <0LHI00GJY6M7M420@smtpauth2.wiscmail.wisc.edu>; Thu,
	03 Mar 2011 16:32:31 -0600 (CST)
Date: Thu, 03 Mar 2011 16:32:31 -0600
From: Nathan Whitehorn 
In-reply-to: 
To: Scott Long 
Message-id: <4D7016FF.3030302@freebsd.org>
X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176
X-Spam-PmxInfo: Server=avs-10, Version=5.6.0.2009776,
	Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.3.3.222116,
	SenderIP=128.104.160.176
References: <201103021606.p22G6vou020460@svn.freebsd.org>
	<201103031209.43857.jhb@freebsd.org> <4D6FCE64.3010302@freebsd.org>
	<201103031432.36336.jhb@freebsd.org>
	
	<4D700B2D.1010003@freebsd.org>
	
User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.14)
	Gecko/20110302 Thunderbird/3.1.8
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r219181 - head/release
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:32:33 -0000

On 03/03/11 15:52, Scott Long wrote:
> On Mar 3, 2011, at 2:42 PM, Nathan Whitehorn wrote:
>> On 03/03/11 15:14, Scott Long wrote:
>>> On Mar 3, 2011, at 12:32 PM, John Baldwin wrote:
>>>> On Thursday, March 03, 2011 12:22:44 pm Nathan Whitehorn wrote:
>>>>> On 03/03/11 11:09, John Baldwin wrote:
>>>>>> On Wednesday, March 02, 2011 11:06:57 am Nathan Whitehorn wrote:
>>>>>>> Author: nwhitehorn
>>>>>>> Date: Wed Mar  2 16:06:57 2011
>>>>>>> New Revision: 219181
>>>>>>> URL: http://svn.freebsd.org/changeset/base/219181
>>>>>>>
>>>>>>> Log:
>>>>>>>   Add additional release makefile for bsdinstall-based media, along with
>>>>>>>   support files. This does not change the default behavior of anything.
>>>>>>>
>>>>>>>   To make bsdinstall-based media, pre-build world and GENERIC, then run
>>>>>>>   the release target in Makefile.bsdinstall.
>>>>>> Are you planning on keeping the current 'make release' behavior of building a
>>>>>> full chroot and doing a clean build in the chroot to build a release?  That
>>>>>> is, is 'Makefile.bsdinstall' just a temporary shortcut for building test
>>>>>> releases or is that the final replacement for 'release/Makefile'?
>>>>> It was intended (modulo memstick building, docs, and some miscellaneous
>>>>> cleanup) to be the final replacement for release/Makefile. In my
>>>>> experience, the automatic fetching, clean build, and chroot was a major
>>>>> impediment to easily making installation media for users to test
>>>>> patches. I figured that if people (e.g. re@) really want a totally clean
>>>>> tree, checking one out by hand and building from there didn't seem like
>>>>> an enormous obstacle.
>>>>>
>>>>> If you think it's a really important feature, I'm happy to add it back,
>>>>> however.
>>>> I think it is a very important feature to ensure release builds are not
>>>> polluted by local changes in /etc/src.conf, etc.  I think it would be good
>>>> to support both models perhaps, but for our official release builds I think
>>>> we need the clean environment.  I certainly use 'make release' now for my
>>>> own custom FooBSD builds to get a clean environment.
>>>>
>>> Agreed entirely.  I'd consider it a major bug if the insulated release environment went away, especially since I'm switching release building at Yahoo to use it.  There are plenty of shortcuts available in the script to reduce the time overhead for quick turnaround testing.
>> To me, there's a distinction between "release building" and "make bootable media", and I like the suggestion to support both. One option would be that we keep the "make cdrom" target as is, but add dependencies, and then have a "release" target that actually the chroot setup. Another would be to keep the Makefile as-is, but to add a shell script that does the version control checkout, building, chroot setup, etc., etc. Would you have a preference there?
>> -Nathan
> I've been using the existing /usr/src/release/Makefile for 10 years, so it's pretty ingrained in me; I'm reluctant to embrace change =-)  That being said, yeah, I can see how there can be some improved modularization between obtaining the src tree, setting up the chroot, generating object bits, and packaging those bits onto release media.  Those functional splits already exist within the Makefile, but probably aren't too clear unless you're very familiar with all of the sub-targets and control variables.  If you wanted to clean this up and provide some clearer modularization, I think it could be a good thing.

With that (qualified :P) support, I'll mock up something and run it by 
you in the next few days.
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Thu Mar  3 22:34:13 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A3C71065674;
	Thu,  3 Mar 2011 22:34:13 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5905A8FC24;
	Thu,  3 Mar 2011 22:34:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p23MYDaV083684;
	Thu, 3 Mar 2011 22:34:13 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23MYDov083682;
	Thu, 3 Mar 2011 22:34:13 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103032234.p23MYDov083682@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 3 Mar 2011 22:34:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219256 - head/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:34:13 -0000

Author: jilles
Date: Thu Mar  3 22:34:13 2011
New Revision: 219256
URL: http://svn.freebsd.org/changeset/base/219256

Log:
  Fix some _POSIX minimum/maximum values in limits.h:
  * Some values changed in POSIX.1-2001; provide the former value if a program
    requests compliance to an earlier version of POSIX. [1]
  * Add missing _POSIX_CLOCKRES_MIN constant. This is a maximum value but
    otherwise works the same as the minimum values.
  
  PR:		standards/104743
  Submitted by:	bde [1] (not exact #ifdefs, but the values)
  MFC after:	2 weeks

Modified:
  head/include/limits.h

Modified: head/include/limits.h
==============================================================================
--- head/include/limits.h	Thu Mar  3 22:09:10 2011	(r219255)
+++ head/include/limits.h	Thu Mar  3 22:34:13 2011	(r219256)
@@ -37,18 +37,27 @@
 
 #if __POSIX_VISIBLE
 #define	_POSIX_ARG_MAX		4096
-#define	_POSIX_CHILD_MAX	25
 #define	_POSIX_LINK_MAX		8
 #define	_POSIX_MAX_CANON	255
 #define	_POSIX_MAX_INPUT	255
 #define	_POSIX_NAME_MAX		14
-#define	_POSIX_NGROUPS_MAX	8
-#define	_POSIX_OPEN_MAX		20
-#define	_POSIX_PATH_MAX		256
 #define	_POSIX_PIPE_BUF		512
 #define	_POSIX_SSIZE_MAX	32767
 #define	_POSIX_STREAM_MAX	8
+
+#if __POSIX_VISIBLE >= 200112
+#define	_POSIX_CHILD_MAX	25
+#define	_POSIX_NGROUPS_MAX	8
+#define	_POSIX_OPEN_MAX		20
+#define	_POSIX_PATH_MAX		256
 #define	_POSIX_TZNAME_MAX	6
+#else
+#define	_POSIX_CHILD_MAX	6
+#define	_POSIX_NGROUPS_MAX	0
+#define	_POSIX_OPEN_MAX		16
+#define	_POSIX_PATH_MAX		255
+#define	_POSIX_TZNAME_MAX	3
+#endif
 
 #define	BC_BASE_MAX		   99	/* max ibase/obase values in bc(1) */
 #define	BC_DIM_MAX		 2048	/* max array elements in bc(1) */
@@ -80,6 +89,8 @@
 #define	_POSIX_SEM_VALUE_MAX	32767
 #define	_POSIX_SIGQUEUE_MAX	32
 #define	_POSIX_TIMER_MAX	32
+
+#define	_POSIX_CLOCKRES_MIN	20000000
 #endif
 
 #if __POSIX_VISIBLE >= 199506

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 07:01:46 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0CEE8106566B;
	Fri,  4 Mar 2011 07:01:46 +0000 (UTC)
	(envelope-from daichi@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EEC748FC0C;
	Fri,  4 Mar 2011 07:01:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2471jWJ010661;
	Fri, 4 Mar 2011 07:01:45 GMT (envelope-from daichi@svn.freebsd.org)
Received: (from daichi@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2471jLm010657;
	Fri, 4 Mar 2011 07:01:45 GMT (envelope-from daichi@svn.freebsd.org)
Message-Id: <201103040701.p2471jLm010657@svn.freebsd.org>
From: Daichi GOTO 
Date: Fri, 4 Mar 2011 07:01:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219257 - in head: share/man/man4 sys/dev/usb
	sys/dev/usb/wlan
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 07:01:46 -0000

Author: daichi
Date: Fri Mar  4 07:01:45 2011
New Revision: 219257
URL: http://svn.freebsd.org/changeset/base/219257

Log:
  Add the Buffalo (Melco Inc.) WLI-UC-G301N
  
  PR:		usb/155229
  Submitted by:	Yoshiaki UCHIKAWA
  MFC after:	1 week

Modified:
  head/share/man/man4/run.4
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_run.c

Modified: head/share/man/man4/run.4
==============================================================================
--- head/share/man/man4/run.4	Thu Mar  3 22:34:13 2011	(r219256)
+++ head/share/man/man4/run.4	Fri Mar  4 07:01:45 2011	(r219257)
@@ -120,6 +120,7 @@ driver supports the following wireless a
 .It Belkin F6D4050 ver 1
 .It Buffalo WLI-UC-AG300N
 .It Buffalo WLI-UC-G300N
+.It Buffalo WLI-UC-G301N
 .It Buffalo WLI-UC-GN
 .It Corega CG-WLUSB2GNL
 .It Corega CG-WLUSB2GNR

Modified: head/sys/dev/usb/usbdevs
==============================================================================
--- head/sys/dev/usb/usbdevs	Thu Mar  3 22:34:13 2011	(r219256)
+++ head/sys/dev/usb/usbdevs	Fri Mar  4 07:01:45 2011	(r219257)
@@ -2157,6 +2157,7 @@ product MELCO WLIUCG		0x0137	WLI-UC-G
 product MELCO RT2870_1		0x0148	RT2870
 product MELCO RT2870_2		0x0150	RT2870
 product MELCO WLIUCGN		0x015d	WLI-UC-GN
+product MELCO WLIUCG301N	0x016f	WLI-UC-G301N
 
 /* Merlin products */
 product MERLIN V620             0x1110  Merlin V620

Modified: head/sys/dev/usb/wlan/if_run.c
==============================================================================
--- head/sys/dev/usb/wlan/if_run.c	Thu Mar  3 22:34:13 2011	(r219256)
+++ head/sys/dev/usb/wlan/if_run.c	Fri Mar  4 07:01:45 2011	(r219257)
@@ -210,6 +210,7 @@ static const struct usb_device_id run_de
     RUN_DEV(MELCO,		RT2870_2),
     RUN_DEV(MELCO,		WLIUCAG300N),
     RUN_DEV(MELCO,		WLIUCG300N),
+    RUN_DEV(MELCO,		WLIUCG301N),
     RUN_DEV(MELCO,		WLIUCGN),
     RUN_DEV(MOTOROLA4,		RT2770),
     RUN_DEV(MOTOROLA4,		RT3070),

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 08:41:59 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A3F75106568E;
	Fri,  4 Mar 2011 08:41:59 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id 3FB418FC1D;
	Fri,  4 Mar 2011 08:41:59 +0000 (UTC)
Received: from outgoing.leidinger.net (p5B155215.dip.t-dialin.net
	[91.21.82.21])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id C041F844016;
	Fri,  4 Mar 2011 09:41:54 +0100 (CET)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 5A6D2211A;
	Fri,  4 Mar 2011 09:41:50 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p248fjdK053875;
	Fri, 4 Mar 2011 09:41:45 +0100 (CET)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Fri, 04 Mar 2011
	09:41:44 +0100
Message-ID: <20110304094144.18434vywc94oqxs0@webmail.leidinger.net>
Date: Fri, 04 Mar 2011 09:41:44 +0100
From: Alexander Leidinger 
To: Chagin Dmitry 
References: <201103011642.p21GgTaH041022@svn.freebsd.org>
	
	<20110303141458.10926vfwryvbcgg8@webmail.leidinger.net>
	<20110303180507.GB6049@dchagin.static.corbina.ru>
In-Reply-To: <20110303180507.GB6049@dchagin.static.corbina.ru>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: C041F844016.A34EA
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=1.351, required 6,
	autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08)
X-EBL-MailScanner-SpamScore: s
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1299832915.29965@aXP8/xY9dvLsG+ohBLUt2Q
X-EBL-Spam-Status: No
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Robert Watson 
Subject: Re: svn commit: r219138 - head/usr.bin/kdump
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 08:41:59 -0000

Quoting Chagin Dmitry  (from Thu, 3 Mar 2011  
21:05:07 +0300):

> On Thu, Mar 03, 2011 at 02:14:58PM +0100, Alexander Leidinger wrote:
>> Quoting Robert Watson  (from Thu, 3 Mar 2011
>> 11:14:59 +0000 (GMT)):
>>
>> >
>> > On Tue, 1 Mar 2011, Dmitry Chagin wrote:
>> >
>> >> Teach kdump to decode linux syscalls names too.
>> >>
>> >> Fix bug introduced in my previous commit: the kernel always dump native
>> >> signal numbers, so no need to check the ABI in ktrpsig().
>> >
>> > Does this mean that we're eliminating the need for the long-broken
>> > linux_kdump?
>>
>> For the linux parts there is (L?)GPLed code in linux_kdump (the main
>> reason that it is a port, I think), it is unlikely that someone sits
>> there and will do a clean-room implementation of those linux-kernel
>> derived things (I like to get proven wrong, anyone out there accepts
>> the challenge? ;-) ). Dmitry provided an updated linux-kdump which
>> contains preprocessed things (no need to have a non-default
>> linuxulator setup). I have the corresponding PR assigned to me, but
>> from his comments it looks like his new version depends upon his
>> changes and does not DTRT without them (I am awaiting confirmation,
>> and I asked about changes to let it DTRT if this is true).
>>
>
> It will be mergeed soon, I'll let you know. thnx!

My comments where not about a MFC, they are about modifying the new  
linux_kdump to still work on 8.1 or 7.4 (we still support those  
release in ports).

Bye,
Alexander.

-- 
Go away, I'm all right.
		-- H. G. Wells' last words

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 09:03:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C346106564A;
	Fri,  4 Mar 2011 09:03:54 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A1978FC0C;
	Fri,  4 Mar 2011 09:03:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2493sUE017565;
	Fri, 4 Mar 2011 09:03:54 GMT (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2493sh8017562;
	Fri, 4 Mar 2011 09:03:54 GMT (envelope-from netchild@svn.freebsd.org)
Message-Id: <201103040903.p2493sh8017562@svn.freebsd.org>
From: Alexander Leidinger 
Date: Fri, 4 Mar 2011 09:03:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219258 - in head/sys: kern security/mac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 09:03:55 -0000

Author: netchild
Date: Fri Mar  4 09:03:54 2011
New Revision: 219258
URL: http://svn.freebsd.org/changeset/base/219258

Log:
  - Add a FEATURE for capsicum (security_capabilities).
  - Rename mac FEATURE to security_mac.
  
  Discussed with:	rwatson

Modified:
  head/sys/kern/sys_capability.c
  head/sys/security/mac/mac_syscalls.c

Modified: head/sys/kern/sys_capability.c
==============================================================================
--- head/sys/kern/sys_capability.c	Fri Mar  4 07:01:45 2011	(r219257)
+++ head/sys/kern/sys_capability.c	Fri Mar  4 09:03:54 2011	(r219258)
@@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$");
 
 #ifdef CAPABILITIES
 
+FEATURE(security_capabilities, "Capsicum Capability Mode");
+
 /*
  * We don't currently have any MIB entries for sysctls, but we do expose
  * security.capabilities so that it's easy to tell if options CAPABILITIES is

Modified: head/sys/security/mac/mac_syscalls.c
==============================================================================
--- head/sys/security/mac/mac_syscalls.c	Fri Mar  4 07:01:45 2011	(r219257)
+++ head/sys/security/mac/mac_syscalls.c	Fri Mar  4 09:03:54 2011	(r219258)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
 
 #ifdef MAC
 
-FEATURE(mac, "Mandatory Access Control Framework support");
+FEATURE(security_mac, "Mandatory Access Control Framework support");
 
 int
 __mac_get_pid(struct thread *td, struct __mac_get_pid_args *uap)

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 17:07:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1AFB1106564A;
	Fri,  4 Mar 2011 17:07:03 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E3BC08FC17;
	Fri,  4 Mar 2011 17:07:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24H72Ia042893;
	Fri, 4 Mar 2011 17:07:02 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24H72A0042888;
	Fri, 4 Mar 2011 17:07:02 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041707.p24H72A0042888@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 17:07:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219266 - head/tools/regression/acltools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 17:07:03 -0000

Author: trasz
Date: Fri Mar  4 17:07:02 2011
New Revision: 219266
URL: http://svn.freebsd.org/changeset/base/219266

Log:
  Make ACL tests slightly easier to run.

Modified:
  head/tools/regression/acltools/00.t
  head/tools/regression/acltools/01.t
  head/tools/regression/acltools/02.t
  head/tools/regression/acltools/03.t

Modified: head/tools/regression/acltools/00.t
==============================================================================
--- head/tools/regression/acltools/00.t	Fri Mar  4 12:42:40 2011	(r219265)
+++ head/tools/regression/acltools/00.t	Fri Mar  4 17:07:02 2011	(r219266)
@@ -44,7 +44,7 @@ if [ `whoami` != "root" ]; then
 	exit 1
 fi
 
-TESTDIR=`dirname $0`
+TESTDIR=$(dirname $(realpath $0))
 
 # Set up the test filesystem.
 MD=`mdconfig -at swap -s 10m`

Modified: head/tools/regression/acltools/01.t
==============================================================================
--- head/tools/regression/acltools/01.t	Fri Mar  4 12:42:40 2011	(r219265)
+++ head/tools/regression/acltools/01.t	Fri Mar  4 17:07:02 2011	(r219266)
@@ -46,7 +46,7 @@ if [ `whoami` != "root" ]; then
 	exit 1
 fi
 
-TESTDIR=`dirname $0`
+TESTDIR=$(dirname $(realpath $0))
 
 # Set up the test filesystem.
 MD=`mdconfig -at swap -s 64m`

Modified: head/tools/regression/acltools/02.t
==============================================================================
--- head/tools/regression/acltools/02.t	Fri Mar  4 12:42:40 2011	(r219265)
+++ head/tools/regression/acltools/02.t	Fri Mar  4 17:07:02 2011	(r219266)
@@ -27,7 +27,7 @@
 # $FreeBSD$
 #
 
-# This is a wrapper script to run tools-nfs4.test.
+# This is a wrapper script to run tools-nfs4.test on UFS filesystem.
 #
 # If any of the tests fails, here is how to debug it: go to
 # the directory with problematic filesystem mounted on it,
@@ -44,7 +44,7 @@ if [ `whoami` != "root" ]; then
 	exit 1
 fi
 
-TESTDIR=`dirname $0`
+TESTDIR=$(dirname $(realpath $0))
 
 # Set up the test filesystem.
 MD=`mdconfig -at swap -s 10m`

Modified: head/tools/regression/acltools/03.t
==============================================================================
--- head/tools/regression/acltools/03.t	Fri Mar  4 12:42:40 2011	(r219265)
+++ head/tools/regression/acltools/03.t	Fri Mar  4 17:07:02 2011	(r219266)
@@ -41,7 +41,7 @@ if [ `whoami` != "root" ]; then
 	exit 1
 fi
 
-TESTDIR=`dirname $0`
+TESTDIR=$(dirname $(realpath $0))
 MNTROOT=`mktemp -dt acltools`
 
 # Set up the test filesystems.

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 17:10:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B55C41065670;
	Fri,  4 Mar 2011 17:10:39 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A3ED08FC1D;
	Fri,  4 Mar 2011 17:10:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24HAdnF043079;
	Fri, 4 Mar 2011 17:10:39 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24HAd5b043077;
	Fri, 4 Mar 2011 17:10:39 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041710.p24HAd5b043077@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 17:10:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219267 - head/tools/regression/acltools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 17:10:39 -0000

Author: trasz
Date: Fri Mar  4 17:10:39 2011
New Revision: 219267
URL: http://svn.freebsd.org/changeset/base/219267

Log:
  Adapt NFSv4 ACL regression test to the fact that the new ZFS uses
  new semantics.

Modified:
  head/tools/regression/acltools/01.t

Modified: head/tools/regression/acltools/01.t
==============================================================================
--- head/tools/regression/acltools/01.t	Fri Mar  4 17:07:02 2011	(r219266)
+++ head/tools/regression/acltools/01.t	Fri Mar  4 17:10:39 2011	(r219267)
@@ -64,13 +64,13 @@ cd $MNT
 # First, check whether we can crash the kernel by creating too many
 # entries.  For some reason this won't work in the test file.
 touch xxx
-setfacl -x5 xxx
+setfacl -x2 xxx
 while :; do setfacl -a0 u:42:rwx:allow xxx 2> /dev/null; if [ $? -ne 0 ]; then break; fi; done
 chmod 600 xxx
 rm xxx
 echo "ok 2"
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null
 
 if [ $? -eq 0 ]; then
 	echo "ok 3"

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 17:23:10 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF474106566B;
	Fri,  4 Mar 2011 17:23:10 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC6EB8FC15;
	Fri,  4 Mar 2011 17:23:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24HNAxE043707;
	Fri, 4 Mar 2011 17:23:10 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24HNAAU043705;
	Fri, 4 Mar 2011 17:23:10 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041723.p24HNAAU043705@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 17:23:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219268 - head/lib/libc/posix1e
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 17:23:11 -0000

Author: trasz
Date: Fri Mar  4 17:23:10 2011
New Revision: 219268
URL: http://svn.freebsd.org/changeset/base/219268

Log:
  Make acl_strip_np(3) use new trivial ACL format for NFSv4 ACls (three
  entries instead of six).  This makes "setfacl -b" do the right thing
  for ACLs on ZFS.  UFS recognizes both kinds of trivial ACLs; no change
  there.
  
  MFC after:	2 months

Modified:
  head/lib/libc/posix1e/acl_strip.c

Modified: head/lib/libc/posix1e/acl_strip.c
==============================================================================
--- head/lib/libc/posix1e/acl_strip.c	Fri Mar  4 17:10:39 2011	(r219267)
+++ head/lib/libc/posix1e/acl_strip.c	Fri Mar  4 17:23:10 2011	(r219268)
@@ -141,7 +141,7 @@ acl_strip_np(const acl_t aclp, int recal
 {
 	switch (_acl_brand(aclp)) {
 	case ACL_BRAND_NFS4:
-		return (_nfs4_acl_strip_np(aclp, 1));
+		return (_nfs4_acl_strip_np(aclp, 0));
 
 	case ACL_BRAND_POSIX:
 		return (_posix1e_acl_strip_np(aclp, recalculate_mask));

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 18:37:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EF2F106566B;
	Fri,  4 Mar 2011 18:37:26 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 63D038FC0A;
	Fri,  4 Mar 2011 18:37:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24IbQEC047564;
	Fri, 4 Mar 2011 18:37:26 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24IbQom047562;
	Fri, 4 Mar 2011 18:37:26 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041837.p24IbQom047562@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 18:37:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219269 - head/tools/regression/acltools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 18:37:26 -0000

Author: trasz
Date: Fri Mar  4 18:37:26 2011
New Revision: 219269
URL: http://svn.freebsd.org/changeset/base/219269

Log:
  Adapt tools-crossfs.test to the new semantics.

Modified:
  head/tools/regression/acltools/tools-crossfs.test

Modified: head/tools/regression/acltools/tools-crossfs.test
==============================================================================
--- head/tools/regression/acltools/tools-crossfs.test	Fri Mar  4 17:23:10 2011	(r219268)
+++ head/tools/regression/acltools/tools-crossfs.test	Fri Mar  4 18:37:26 2011	(r219269)
@@ -43,11 +43,8 @@ $ umask 022
 
 $ touch nfs4/xxx
 $ getfacl -nq nfs4/xxx
->             owner@:--x-----------:------:deny
->             owner@:rw-p---A-W-Co-:------:allow
->             group@:-wxp----------:------:deny
->             group@:r-------------:------:allow
->          everyone@:-wxp---A-W-Co-:------:deny
+>             owner@:rw-p--aARWcCos:------:allow
+>             group@:r-----a-R-c--s:------:allow
 >          everyone@:r-----a-R-c--s:------:allow
 
 $ touch posix/xxx
@@ -100,10 +97,8 @@ $ mv posix/yyy nfs4/xxx
 > mv: failed to set acl entries for nfs4/xxx: Invalid argument
 $ getfacl -nq nfs4/xxx
 >             owner@:-wxp----------:------:deny
->             owner@:r------A-W-Co-:------:allow
->             group@:--------------:------:deny
->             group@:rwxp----------:------:allow
->          everyone@:--x----A-W-Co-:------:deny
+>             owner@:r-----aARWcCos:------:allow
+>             group@:rwxp--a-R-c--s:------:allow
 >          everyone@:rw-p--a-R-c--s:------:allow
 $ ls -l nfs4/xxx | cut -d' ' -f1
 > -r--rwxrw-
@@ -117,11 +112,8 @@ $ mv nfs4/xxx nfs4/yyy
 $ getfacl -nq nfs4/yyy
 >            user:42:--x-----------:------:allow
 >           group:43:-w------------:------:allow
->             owner@:--x-----------:------:deny
->             owner@:rw-p---A-W-Co-:------:allow
->             group@:-wxp----------:------:deny
->             group@:r-------------:------:allow
->          everyone@:-wxp---A-W-Co-:------:deny
+>             owner@:rw-p--aARWcCos:------:allow
+>             group@:r-----a-R-c--s:------:allow
 >          everyone@:r-----a-R-c--s:------:allow
 $ ls -l nfs4/yyy | cut -d' ' -f1
 > -rw-r--r--+
@@ -271,11 +263,11 @@ $ cp -p nfs4/xxx nfs4/yyy
 $ getfacl -nq nfs4/yyy
 >            user:42:--x-----------:------:allow
 >           group:43:-w------------:------:allow
+>             owner@:--x-----------:------:allow
 >             owner@:-w-p----------:------:deny
->             owner@:r-x----A-W-Co-:------:allow
 >             group@:-wxp----------:------:deny
->             group@:r-------------:------:allow
->          everyone@:r------A-W-Co-:------:deny
+>             owner@:r-x---aARWcCos:------:allow
+>             group@:r-----a-R-c--s:------:allow
 >          everyone@:-wxp--a-R-c--s:------:allow
 $ ls -l nfs4/yyy | cut -d' ' -f1
 > -r-xr---wx+

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 18:46:20 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3A0BB106566B;
	Fri,  4 Mar 2011 18:46:20 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2852D8FC15;
	Fri,  4 Mar 2011 18:46:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24IkKOZ047998;
	Fri, 4 Mar 2011 18:46:20 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24IkKGh047996;
	Fri, 4 Mar 2011 18:46:20 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041846.p24IkKGh047996@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 18:46:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219270 - head/tools/regression/acltools
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 18:46:20 -0000

Author: trasz
Date: Fri Mar  4 18:46:19 2011
New Revision: 219270
URL: http://svn.freebsd.org/changeset/base/219270

Log:
  One more fix.  Now all ACL tests pass again.

Modified:
  head/tools/regression/acltools/02.t

Modified: head/tools/regression/acltools/02.t
==============================================================================
--- head/tools/regression/acltools/02.t	Fri Mar  4 18:37:26 2011	(r219269)
+++ head/tools/regression/acltools/02.t	Fri Mar  4 18:46:19 2011	(r219270)
@@ -63,7 +63,7 @@ cd $MNT
 # First, check whether we can crash the kernel by creating too many
 # entries.  For some reason this won't work in the test file.
 touch xxx
-setfacl -x5 xxx
+setfacl -x2 xxx
 while :; do setfacl -a0 u:42:rwx:allow xxx 2> /dev/null; if [ $? -ne 0 ]; then break; fi; done
 chmod 600 xxx
 rm xxx

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 19:28:28 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03EB2106564A;
	Fri,  4 Mar 2011 19:28:28 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E67AD8FC0A;
	Fri,  4 Mar 2011 19:28:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24JSRdx049958;
	Fri, 4 Mar 2011 19:28:27 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24JSRK3049955;
	Fri, 4 Mar 2011 19:28:27 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103041928.p24JSRK3049955@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 4 Mar 2011 19:28:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219271 - in head: include sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 19:28:28 -0000

Author: jilles
Date: Fri Mar  4 19:28:27 2011
New Revision: 219271
URL: http://svn.freebsd.org/changeset/base/219271

Log:
  POSIX.1-2008 moved some constants from the XSI option to the Base.
  
  MFC after:	2 weeks

Modified:
  head/include/limits.h
  head/sys/sys/limits.h

Modified: head/include/limits.h
==============================================================================
--- head/include/limits.h	Fri Mar  4 18:46:19 2011	(r219270)
+++ head/include/limits.h	Fri Mar  4 19:28:27 2011	(r219271)
@@ -116,18 +116,21 @@
 #define	_POSIX_RE_DUP_MAX	_POSIX2_RE_DUP_MAX
 #endif
 
+#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
+#define	NL_ARGMAX		99	/* max # of position args for printf */
+#define	NL_MSGMAX		32767
+#define	NL_SETMAX		255
+#define	NL_TEXTMAX		2048
+#endif
+
 #if __XSI_VISIBLE
 #define	_XOPEN_IOV_MAX		16
 #define	_XOPEN_NAME_MAX		255
 #define	_XOPEN_PATH_MAX		1024
 #define	PASS_MAX		128	/* _PASSWORD_LEN from  */
 
-#define	NL_ARGMAX		99	/* max # of position args for printf */
 #define	NL_LANGMAX		31	/* max LANG name length */
-#define	NL_MSGMAX		32767
 #define	NL_NMAX			1
-#define	NL_SETMAX		255
-#define	NL_TEXTMAX		2048
 #endif
 
 #define	MB_LEN_MAX		6	/* 31-bit UTF-8 */

Modified: head/sys/sys/limits.h
==============================================================================
--- head/sys/sys/limits.h	Fri Mar  4 18:46:19 2011	(r219270)
+++ head/sys/sys/limits.h	Fri Mar  4 19:28:27 2011	(r219271)
@@ -88,7 +88,7 @@
 #define	QUAD_MIN	(__QUAD_MIN)	/* min value for a quad_t */
 #endif
 
-#if __XSI_VISIBLE
+#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
 #define	LONG_BIT	__LONG_BIT
 #define	WORD_BIT	__WORD_BIT
 #endif

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 19:53:08 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 37FFB106567B;
	Fri,  4 Mar 2011 19:53:08 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2679C8FC1B;
	Fri,  4 Mar 2011 19:53:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24Jr8oK051190;
	Fri, 4 Mar 2011 19:53:08 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24Jr8uc051188;
	Fri, 4 Mar 2011 19:53:08 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103041953.p24Jr8uc051188@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Fri, 4 Mar 2011 19:53:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219272 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 19:53:08 -0000

Author: trasz
Date: Fri Mar  4 19:53:07 2011
New Revision: 219272
URL: http://svn.freebsd.org/changeset/base/219272

Log:
  Make UFS use PSARC/2010/029 NFSv4 ACL semantics by default, just like
  ZFSv28 does.
  
  MFC after:	2 months

Modified:
  head/sys/kern/subr_acl_nfs4.c

Modified: head/sys/kern/subr_acl_nfs4.c
==============================================================================
--- head/sys/kern/subr_acl_nfs4.c	Fri Mar  4 19:28:27 2011	(r219271)
+++ head/sys/kern/subr_acl_nfs4.c	Fri Mar  4 19:53:07 2011	(r219272)
@@ -55,12 +55,12 @@ void		acl_nfs4_trivial_from_mode(struct 
 
 #endif /* !_KERNEL */
 
-static int	acl_nfs4_old_semantics = 1;
+static int	acl_nfs4_old_semantics = 0;
 
 #ifdef _KERNEL
 
 SYSCTL_INT(_vfs, OID_AUTO, acl_nfs4_old_semantics, CTLFLAG_RW,
-    &acl_nfs4_old_semantics, 1, "Use pre-PSARC/2010/029 NFSv4 ACL semantics");
+    &acl_nfs4_old_semantics, 0, "Use pre-PSARC/2010/029 NFSv4 ACL semantics");
 
 static struct {
 	accmode_t accmode;

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 20:37:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21EDD1065670;
	Fri,  4 Mar 2011 20:37:39 +0000 (UTC) (envelope-from eri@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 10D3C8FC0A;
	Fri,  4 Mar 2011 20:37:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24KbcLO053915;
	Fri, 4 Mar 2011 20:37:38 GMT (envelope-from eri@svn.freebsd.org)
Received: (from eri@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24KbcD1053913;
	Fri, 4 Mar 2011 20:37:38 GMT (envelope-from eri@svn.freebsd.org)
Message-Id: <201103042037.p24KbcD1053913@svn.freebsd.org>
From: Ermal Luçi 
Date: Fri, 4 Mar 2011 20:37:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219275 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 20:37:39 -0000

Author: eri
Date: Fri Mar  4 20:37:38 2011
New Revision: 219275
URL: http://svn.freebsd.org/changeset/base/219275

Log:
  Fix a panic that can happen when trying to destroy a lagg(4) with scheduler set to none.
  
  Approved by:	thompsa(mentor)
  MFC after:	1 week

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Fri Mar  4 20:30:18 2011	(r219274)
+++ head/sys/net/if_lagg.c	Fri Mar  4 20:37:38 2011	(r219275)
@@ -341,7 +341,8 @@ lagg_clone_destroy(struct ifnet *ifp)
 	while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL)
 		lagg_port_destroy(lp, 1);
 	/* Unhook the aggregation protocol */
-	(*sc->sc_detach)(sc);
+	if (sc->sc_detach != NULL)
+		(*sc->sc_detach)(sc);
 
 	LAGG_WUNLOCK(sc);
 

From owner-svn-src-head@FreeBSD.ORG  Fri Mar  4 22:26:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6030A106564A;
	Fri,  4 Mar 2011 22:26:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F48C8FC0A;
	Fri,  4 Mar 2011 22:26:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p24MQfA5062421;
	Fri, 4 Mar 2011 22:26:41 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24MQfjU062419;
	Fri, 4 Mar 2011 22:26:41 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103042226.p24MQfjU062419@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 4 Mar 2011 22:26:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219276 - head/sys/ufs/ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 22:26:41 -0000

Author: jhb
Date: Fri Mar  4 22:26:41 2011
New Revision: 219276
URL: http://svn.freebsd.org/changeset/base/219276

Log:
  Use ffs() to locate free bits in the inode bitmap rather than a loop with
  bit shifts.
  
  Reviewed by:	mckusick
  MFC after:	1 month

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==============================================================================
--- head/sys/ufs/ffs/ffs_alloc.c	Fri Mar  4 20:37:38 2011	(r219275)
+++ head/sys/ufs/ffs/ffs_alloc.c	Fri Mar  4 22:26:41 2011	(r219276)
@@ -1782,17 +1782,13 @@ ffs_nodealloccg(ip, cg, ipref, mode, unu
 		}
 	}
 	i = start + len - loc;
-	map = inosused[i];
-	ipref = i * NBBY;
-	for (i = 1; i < (1 << NBBY); i <<= 1, ipref++) {
-		if ((map & i) == 0) {
-			cgp->cg_irotor = ipref;
-			goto gotit;
-		}
+	map = inosused[i] ^ 0xff;
+	if (map == 0) {
+		printf("fs = %s\n", fs->fs_fsmnt);
+		panic("ffs_nodealloccg: block not in map");
 	}
-	printf("fs = %s\n", fs->fs_fsmnt);
-	panic("ffs_nodealloccg: block not in map");
-	/* NOTREACHED */
+	ipref = i * NBBY + ffs(map) - 1;
+	cgp->cg_irotor = ipref;
 gotit:
 	/*
 	 * Check to see if we need to initialize more inodes.

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 00:59:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 16441106566B;
	Sat,  5 Mar 2011 00:59:35 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 056BE8FC0C;
	Sat,  5 Mar 2011 00:59:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p250xYYq081999;
	Sat, 5 Mar 2011 00:59:34 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p250xY9p081997;
	Sat, 5 Mar 2011 00:59:34 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201103050059.p250xY9p081997@svn.freebsd.org>
From: Matt Jacob 
Date: Sat, 5 Mar 2011 00:59:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219282 - head/sys/dev/isp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 00:59:35 -0000

Author: mjacob
Date: Sat Mar  5 00:59:34 2011
New Revision: 219282
URL: http://svn.freebsd.org/changeset/base/219282

Log:
  Flush both reads *and* writes to registers.
  
  Obtained from:	Miod Vallat in OpenBSD
  MFC after:	1 week

Modified:
  head/sys/dev/isp/isp_freebsd.h

Modified: head/sys/dev/isp/isp_freebsd.h
==============================================================================
--- head/sys/dev/isp/isp_freebsd.h	Sat Mar  5 00:18:21 2011	(r219281)
+++ head/sys/dev/isp/isp_freebsd.h	Sat Mar  5 00:59:34 2011	(r219282)
@@ -369,7 +369,7 @@ case SYNC_RESULT:						\
 case SYNC_REG:							\
 	bus_space_barrier(isp->isp_osinfo.bus_tag,		\
 	    isp->isp_osinfo.bus_handle, offset, size,		\
-	    BUS_SPACE_BARRIER_READ);				\
+	    BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE);	\
 	break;							\
 default:							\
 	break;							\

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:01:14 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F7AE106566B;
	Sat,  5 Mar 2011 03:01:14 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4D9558FC16;
	Sat,  5 Mar 2011 03:01:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2531E5E095182;
	Sat, 5 Mar 2011 03:01:14 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2531Ebc095180;
	Sat, 5 Mar 2011 03:01:14 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050301.p2531Ebc095180@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:01:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219285 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:01:14 -0000

Author: np
Date: Sat Mar  5 03:01:14 2011
New Revision: 219285
URL: http://svn.freebsd.org/changeset/base/219285

Log:
  Fix incorrect assertion.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgbe/adapter.h

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Sat Mar  5 02:12:36 2011	(r219284)
+++ head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:01:14 2011	(r219285)
@@ -70,8 +70,8 @@ static __inline uint64_t
 t4_bus_space_read_8(bus_space_tag_t tag, bus_space_handle_t handle,
     bus_size_t offset)
 {
-	KASSERT(tag == X86_BUS_SPACE_IO,
-	    ("64-bit reads from I/O space not possible."));
+	KASSERT(tag == X86_BUS_SPACE_MEM,
+	    ("%s: can only handle mem space", __func__));
 
 	return (*(volatile uint64_t *)(handle + offset));
 }
@@ -80,8 +80,9 @@ static __inline void
 t4_bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t bsh,
     bus_size_t offset, uint64_t value)
 {
-	KASSERT(tag == X86_BUS_SPACE_IO,
-	    ("64-bit writes to I/O space not possible."));
+	KASSERT(tag == X86_BUS_SPACE_MEM,
+	    ("%s: can only handle mem space", __func__));
+
 	*(volatile uint64_t *)(bsh + offset) = value;
 }
 #else

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:06:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17BD0106564A;
	Sat,  5 Mar 2011 03:06:39 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 058AB8FC08;
	Sat,  5 Mar 2011 03:06:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2536cHO095937;
	Sat, 5 Mar 2011 03:06:38 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2536cMX095933;
	Sat, 5 Mar 2011 03:06:38 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050306.p2536cMX095933@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:06:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219286 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:06:39 -0000

Author: np
Date: Sat Mar  5 03:06:38 2011
New Revision: 219286
URL: http://svn.freebsd.org/changeset/base/219286

Log:
  Resume tx immediately in response to an SGE egress update from the hardware.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:01:14 2011	(r219285)
+++ head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:06:38 2011	(r219286)
@@ -177,6 +177,7 @@ struct port_info {
 	struct link_config link_cfg;
 	struct port_stats stats;
 
+	struct taskqueue *tq;
 	struct callout tick;
 	struct sysctl_ctx_list ctx;	/* lives from ifconfig up to down */
 	struct sysctl_oid *oid_rxq;
@@ -310,6 +311,9 @@ struct sge_fl {
 struct sge_txq {
 	struct sge_eq eq;	/* MUST be first */
 	struct mbuf *m;		/* held up due to temporary resource shortage */
+	struct task resume_tx;
+
+	struct port_info *port;	/* the port this txq belongs to */
 
 	/* stats for common events first */
 
@@ -545,13 +549,15 @@ static inline bool is_10G_port(const str
 	return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0);
 }
 
+/* t4_main.c */
+void cxgbe_txq_start(void *, int);
 int t4_os_find_pci_capability(struct adapter *, int);
 int t4_os_pci_save_state(struct adapter *);
 int t4_os_pci_restore_state(struct adapter *);
-
 void t4_os_portmod_changed(const struct adapter *, int);
 void t4_os_link_changed(struct adapter *, int, int);
 
+/* t4_sge.c */
 void t4_sge_init(struct adapter *);
 int t4_create_dma_tag(struct adapter *);
 int t4_destroy_dma_tag(struct adapter *);

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:01:14 2011	(r219285)
+++ head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:06:38 2011	(r219286)
@@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -274,6 +277,7 @@ static int sysctl_holdoff_pktc_idx(SYSCT
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
+static inline void txq_start(struct ifnet *, struct sge_txq *);
 
 
 struct t4_pciids {
@@ -692,6 +696,15 @@ cxgbe_attach(device_t dev)
 	ifp->if_softc = pi;
 
 	callout_init(&pi->tick, CALLOUT_MPSAFE);
+	pi->tq = taskqueue_create("cxgbe_taskq", M_NOWAIT,
+	    taskqueue_thread_enqueue, &pi->tq);
+	if (pi->tq == NULL) {
+		device_printf(dev, "failed to allocate port task queue\n");
+		if_free(pi->ifp);
+		return (ENOMEM);
+	}
+	taskqueue_start_threads(&pi->tq, 1, PI_NET, "%s taskq",
+	    device_get_nameunit(dev));
 
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -746,6 +759,8 @@ cxgbe_detach(device_t dev)
 	if (rc != 0)
 		device_printf(dev, "port uninit failed: %d.\n", rc);
 
+	taskqueue_free(pi->tq);
+
 	ifmedia_removeall(&pi->media);
 	ether_ifdetach(pi->ifp);
 	if_free(pi->ifp);
@@ -951,13 +966,7 @@ cxgbe_start(struct ifnet *ifp)
 
 	for_each_txq(pi, i, txq) {
 		if (TXQ_TRYLOCK(txq)) {
-			struct buf_ring *br = txq->eq.br;
-			struct mbuf *m;
-
-			m = txq->m ? txq->m : drbr_dequeue(ifp, br);
-			if (m)
-				t4_eth_tx(ifp, txq, m);
-
+			txq_start(ifp, txq);
 			TXQ_UNLOCK(txq);
 		}
 	}
@@ -2581,6 +2590,31 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR
 	return (sysctl_handle_64(oidp, &val, 0, req));
 }
 
+static inline void
+txq_start(struct ifnet *ifp, struct sge_txq *txq)
+{
+	struct buf_ring *br;
+	struct mbuf *m;
+
+	TXQ_LOCK_ASSERT_OWNED(txq);
+
+	br = txq->eq.br;
+	m = txq->m ? txq->m : drbr_dequeue(ifp, br);
+	if (m)
+		t4_eth_tx(ifp, txq, m);
+}
+
+void
+cxgbe_txq_start(void *arg, int count)
+{
+	struct sge_txq *txq = arg;
+	struct ifnet *ifp = txq->port->ifp;
+
+	TXQ_LOCK(txq);
+	txq_start(ifp, txq);
+	TXQ_UNLOCK(txq);
+}
+
 int
 t4_os_find_pci_capability(struct adapter *sc, int cap)
 {

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:01:14 2011	(r219285)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:06:38 2011	(r219286)
@@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -136,6 +139,8 @@ static inline void ring_tx_db(struct ada
 static int reclaim_tx_descs(struct sge_eq *, int, int);
 static void write_eqflush_wr(struct sge_eq *);
 static __be64 get_flit(bus_dma_segment_t *, int, int);
+static int handle_sge_egr_update(struct adapter *,
+    const struct cpl_sge_egr_update *);
 
 /**
  *	t4_sge_init - initialize SGE
@@ -492,21 +497,9 @@ t4_intr_evt(void *arg)
 
 			break;
 			}
-		case CPL_SGE_EGR_UPDATE: {
-			const struct cpl_sge_egr_update *cpl;
-			unsigned int qid;
-			struct sge *s = &sc->sge;
-			struct sge_txq *txq;
-
-			cpl = (const void *)(rss + 1);
-			qid = G_EGR_QID(ntohl(cpl->opcode_qid));
-			txq = (void *)s->eqmap[qid - s->eq_start];
-			txq->egr_update++;
-
-			/* XXX: wake up stalled tx */
-
+		case CPL_SGE_EGR_UPDATE:
+			handle_sge_egr_update(sc, (const void *)(rss + 1));
 			break;
-			}
 
 		default:
 			device_printf(sc->dev,
@@ -565,20 +558,9 @@ t4_intr_data(void *arg)
 		rsp_type = G_RSPD_TYPE(ctrl->u.type_gen);
 
 		if (__predict_false(rsp_type == X_RSPD_TYPE_CPL)) {
-			const struct cpl_sge_egr_update *p = (const void *)cpl;
-			unsigned int qid = G_EGR_QID(ntohl(p->opcode_qid));
-
-			KASSERT(cpl->opcode == CPL_SGE_EGR_UPDATE,
-			    ("unexpected opcode on data ingress queue: %x",
-			    cpl->opcode));
-
-			/* XXX: noone's waiting to be woken up... */
-			wakeup(sc->sge.eqmap[qid - sc->sge.eq_start]);
-
-			ndescs++;
-			iq_next(iq);
-
-			continue;
+			/* Can't be anything except an egress update */
+			handle_sge_egr_update(sc, (const void *)cpl);
+			goto nextdesc;
 		}
 
 		KASSERT(G_RSPD_TYPE(ctrl->u.type_gen) == X_RSPD_TYPE_FLBUF,
@@ -650,7 +632,7 @@ t4_intr_data(void *arg)
 		}
 		FL_UNLOCK(fl);
 
-		ndescs++;
+nextdesc:	ndescs++;
 		iq_next(iq);
 
 		if (ndescs > 32) {
@@ -1264,6 +1246,9 @@ alloc_txq(struct port_info *pi, struct s
 	struct sysctl_oid *oid;
 	struct sysctl_oid_list *children;
 
+	txq->port = pi;
+	TASK_INIT(&txq->resume_tx, 0, cxgbe_txq_start, txq);
+
 	mtx_init(&eq->eq_lock, eq->lockname, NULL, MTX_DEF);
 
 	len = eq->qsize * TX_EQ_ESIZE;
@@ -1797,12 +1782,14 @@ write_txpkt_wr(struct port_info *pi, str
 	struct cpl_tx_pkt_core *cpl;
 	uint32_t ctrl;	/* used in many unrelated places */
 	uint64_t ctrl1;
-	int nflits, ndesc;
+	int nflits, ndesc, pktlen;
 	struct tx_sdesc *txsd;
 	caddr_t dst;
 
 	TXQ_LOCK_ASSERT_OWNED(txq);
 
+	pktlen = m->m_pkthdr.len;
+
 	/*
 	 * Do we have enough flits to send this frame out?
 	 */
@@ -1815,8 +1802,8 @@ write_txpkt_wr(struct port_info *pi, str
 	if (sgl->nsegs > 0)
 		nflits += sgl->nflits;
 	else {
-		nflits += howmany(m->m_pkthdr.len, 8);
-		ctrl += m->m_pkthdr.len;
+		nflits += howmany(pktlen, 8);
+		ctrl += pktlen;
 	}
 	ndesc = howmany(nflits, 8);
 	if (ndesc > eq->avail)
@@ -1856,7 +1843,7 @@ write_txpkt_wr(struct port_info *pi, str
 		lso->ipid_ofst = htobe16(0);
 		lso->mss = htobe16(m->m_pkthdr.tso_segsz);
 		lso->seqno_offset = htobe32(0);
-		lso->len = htobe32(m->m_pkthdr.len);
+		lso->len = htobe32(pktlen);
 
 		cpl = (void *)(lso + 1);
 
@@ -1883,7 +1870,7 @@ write_txpkt_wr(struct port_info *pi, str
 	cpl->ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) |
 	    V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(pi->adapter->pf));
 	cpl->pack = 0;
-	cpl->len = htobe16(m->m_pkthdr.len);
+	cpl->len = htobe16(pktlen);
 	cpl->ctrl1 = htobe64(ctrl1);
 
 	/* Software descriptor */
@@ -1907,7 +1894,14 @@ write_txpkt_wr(struct port_info *pi, str
 		txq->imm_wrs++;
 		for (; m; m = m->m_next) {
 			copy_to_txd(eq, mtod(m, caddr_t), &dst, m->m_len);
+#ifdef INVARIANTS
+			pktlen -= m->m_len;
+#endif
 		}
+#ifdef INVARIANTS
+		KASSERT(pktlen == 0, ("%s: %d bytes left.", __func__, pktlen));
+#endif
+
 	}
 
 	txq->txpkt_wrs++;
@@ -2390,3 +2384,17 @@ set_fl_tag_idx(struct sge_fl *fl, int mt
 
 	fl->tag_idx = i;
 }
+
+static int
+handle_sge_egr_update(struct adapter *sc, const struct cpl_sge_egr_update *cpl)
+{
+	unsigned int qid = G_EGR_QID(ntohl(cpl->opcode_qid));
+	struct sge *s = &sc->sge;
+	struct sge_txq *txq;
+
+	txq = (void *)s->eqmap[qid - s->eq_start];
+	taskqueue_enqueue(txq->port->tq, &txq->resume_tx);
+	txq->egr_update++;
+
+	return (0);
+}

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:12:51 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 066C6106564A;
	Sat,  5 Mar 2011 03:12:51 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E8A5F8FC14;
	Sat,  5 Mar 2011 03:12:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253CoeV097119;
	Sat, 5 Mar 2011 03:12:50 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253CoAo097116;
	Sat, 5 Mar 2011 03:12:50 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050312.p253CoAo097116@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:12:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219287 - in head/sys/dev/cxgbe: . common
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:12:51 -0000

Author: np
Date: Sat Mar  5 03:12:50 2011
New Revision: 219287
URL: http://svn.freebsd.org/changeset/base/219287

Log:
  Upgrade the firmware on the card automatically if a better version is
  available.  Downgrade only for a major version mismatch.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/common/common.h
==============================================================================
--- head/sys/dev/cxgbe/common/common.h	Sat Mar  5 03:06:38 2011	(r219286)
+++ head/sys/dev/cxgbe/common/common.h	Sat Mar  5 03:12:50 2011	(r219287)
@@ -53,8 +53,8 @@ enum {
 };
 
 #define FW_VERSION_MAJOR 1
-#define FW_VERSION_MINOR 2
-#define FW_VERSION_MICRO 65
+#define FW_VERSION_MINOR 3
+#define FW_VERSION_MICRO 0
 
 struct port_stats {
 	u64 tx_octets;            /* total # of octets in good frames */

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:06:38 2011	(r219286)
+++ head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:12:50 2011	(r219287)
@@ -1256,28 +1256,69 @@ prep_firmware(struct adapter *sc)
 	/* Check firmware version and install a different one if necessary */
 	rc = t4_check_fw_version(sc);
 	if (rc != 0 || force_firmware_install) {
+		uint32_t v = 0;
 
 		fw = firmware_get(T4_FWNAME);
-		if (fw == NULL) {
-			device_printf(sc->dev,
-			    "Could not find firmware image %s\n", T4_FWNAME);
-			return (ENOENT);
+		if (fw != NULL) {
+			const struct fw_hdr *hdr = (const void *)fw->data;
+
+			v = ntohl(hdr->fw_ver);
+
+			/*
+			 * The firmware module will not be used if it isn't the
+			 * same major version as what the driver was compiled
+			 * with.  This check trumps force_firmware_install.
+			 */
+			if (G_FW_HDR_FW_VER_MAJOR(v) != FW_VERSION_MAJOR) {
+				device_printf(sc->dev,
+				    "Found firmware image but version %d "
+				    "can not be used with this driver (%d)\n",
+				    G_FW_HDR_FW_VER_MAJOR(v), FW_VERSION_MAJOR);
+
+				firmware_put(fw, FIRMWARE_UNLOAD);
+				fw = NULL;
+			}
 		}
 
-		device_printf(sc->dev,
-		    "installing firmware %d.%d.%d on card.\n",
-		    FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO);
-		rc = -t4_load_fw(sc, fw->data, fw->datasize);
-		if (rc != 0) {
+		if (fw == NULL && (rc < 0 || force_firmware_install)) {
+			device_printf(sc->dev, "No usable firmware. "
+			    "card has %d.%d.%d, driver compiled with %d.%d.%d, "
+			    "force_firmware_install%s set",
+			    G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
+			    G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
+			    G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
+			    FW_VERSION_MAJOR, FW_VERSION_MINOR,
+			    FW_VERSION_MICRO,
+			    force_firmware_install ? "" : " not");
+			return (EAGAIN);
+		}
+
+		/*
+		 * Always upgrade, even for minor/micro/build mismatches.
+		 * Downgrade only for a major version mismatch or if
+		 * force_firmware_install was specified.
+		 */
+		if (fw != NULL && (rc < 0 || force_firmware_install ||
+		    v > sc->params.fw_vers)) {
 			device_printf(sc->dev,
-			    "failed to install firmware: %d\n", rc);
-			return (rc);
-		} else {
-			t4_get_fw_version(sc, &sc->params.fw_vers);
-			t4_get_tp_version(sc, &sc->params.tp_vers);
+			    "installing firmware %d.%d.%d.%d on card.\n",
+			    G_FW_HDR_FW_VER_MAJOR(v), G_FW_HDR_FW_VER_MINOR(v),
+			    G_FW_HDR_FW_VER_MICRO(v), G_FW_HDR_FW_VER_BUILD(v));
+
+			rc = -t4_load_fw(sc, fw->data, fw->datasize);
+			if (rc != 0) {
+				device_printf(sc->dev,
+				    "failed to install firmware: %d\n", rc);
+				firmware_put(fw, FIRMWARE_UNLOAD);
+				return (rc);
+			} else {
+				/* refresh */
+				(void) t4_check_fw_version(sc);
+			}
 		}
 
-		firmware_put(fw, FIRMWARE_UNLOAD);
+		if (fw != NULL)
+			firmware_put(fw, FIRMWARE_UNLOAD);
 	}
 
 	/* Contact firmware, request master */

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:18:56 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C4E74106566C;
	Sat,  5 Mar 2011 03:18:56 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A0F68FC08;
	Sat,  5 Mar 2011 03:18:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253Ium3098000;
	Sat, 5 Mar 2011 03:18:56 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253IuBK097997;
	Sat, 5 Mar 2011 03:18:56 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050318.p253IuBK097997@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:18:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219288 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:18:56 -0000

Author: np
Date: Sat Mar  5 03:18:56 2011
New Revision: 219288
URL: http://svn.freebsd.org/changeset/base/219288

Log:
  A txpkts work request should have a valid FID.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:12:50 2011	(r219287)
+++ head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:18:56 2011	(r219288)
@@ -276,6 +276,7 @@ struct sge_eq {
 	uint16_t cidx;		/* consumer idx (desc idx) */
 	uint16_t pidx;		/* producer idx (desc idx) */
 	uint16_t pending;	/* # of descriptors used since last doorbell */
+	uint16_t iqid;		/* iq that gets egr_update for the eq */
 	uint32_t cntxt_id;	/* SGE context id for the eq */
 
 	/* DMA maps used for tx */

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:12:50 2011	(r219287)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:18:56 2011	(r219288)
@@ -1263,6 +1263,7 @@ alloc_txq(struct port_info *pi, struct s
 	eq->sdesc = malloc(eq->cap * sizeof(struct tx_sdesc), M_CXGBE,
 	    M_ZERO | M_WAITOK);
 	eq->br = buf_ring_alloc(eq->qsize, M_CXGBE, M_WAITOK, &eq->eq_lock);
+	eq->iqid = sc->sge.rxq[pi->first_rxq].iq.cntxt_id;
 
 	rc = bus_dma_tag_create(sc->dmat, 1, 0, BUS_SPACE_MAXADDR,
 	    BUS_SPACE_MAXADDR, NULL, NULL, 64 * 1024, TX_SGL_SEGS,
@@ -1290,7 +1291,7 @@ alloc_txq(struct port_info *pi, struct s
 	c.fetchszm_to_iqid =
 	    htobe32(V_FW_EQ_ETH_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
 		V_FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) |
-		V_FW_EQ_ETH_CMD_IQID(sc->sge.rxq[pi->first_rxq].iq.cntxt_id));
+		V_FW_EQ_ETH_CMD_IQID(eq->iqid));
 	c.dcaen_to_eqsize = htobe32(V_FW_EQ_ETH_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
 		      V_FW_EQ_ETH_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
 		      V_FW_EQ_ETH_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) |
@@ -2074,7 +2075,8 @@ write_ulp_cpl_sgl(struct port_info *pi, 
 
 	/* ULP master command */
 	ulpmc = (void *)flitp;
-	ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0));
+	ulpmc->cmd_dest = htonl(V_ULPTX_CMD(ULP_TX_PKT) | V_ULP_TXPKT_DEST(0) |
+	    V_ULP_TXPKT_FID(eq->iqid));
 	ulpmc->len = htonl(howmany(sizeof(*ulpmc) + sizeof(*ulpsc) +
 	    sizeof(*cpl) + 8 * sgl->nflits, 16));
 

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:27:15 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2355D1065672;
	Sat,  5 Mar 2011 03:27:15 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 070158FC14;
	Sat,  5 Mar 2011 03:27:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253REiP099297;
	Sat, 5 Mar 2011 03:27:14 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253REVA099293;
	Sat, 5 Mar 2011 03:27:14 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050327.p253REVA099293@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:27:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219289 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:27:15 -0000

Author: np
Date: Sat Mar  5 03:27:14 2011
New Revision: 219289
URL: http://svn.freebsd.org/changeset/base/219289

Log:
  Store the ifnet rather than the port_info in each txq and rxq struct.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:18:56 2011	(r219288)
+++ head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:27:14 2011	(r219289)
@@ -314,7 +314,7 @@ struct sge_txq {
 	struct mbuf *m;		/* held up due to temporary resource shortage */
 	struct task resume_tx;
 
-	struct port_info *port;	/* the port this txq belongs to */
+	struct ifnet *ifp;	/* the interface this txq belongs to */
 
 	/* stats for common events first */
 
@@ -343,7 +343,7 @@ struct sge_rxq {
 	struct sge_fl fl;
 
 	unsigned int flags;
-	struct port_info *port;	/* the port this rxq belongs to */
+	struct ifnet *ifp;	/* the interface this rxq belongs to */
 	struct lro_ctrl lro;	/* LRO state */
 
 	/* stats for common events first */

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:18:56 2011	(r219288)
+++ head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 03:27:14 2011	(r219289)
@@ -2649,10 +2649,9 @@ void
 cxgbe_txq_start(void *arg, int count)
 {
 	struct sge_txq *txq = arg;
-	struct ifnet *ifp = txq->port->ifp;
 
 	TXQ_LOCK(txq);
-	txq_start(ifp, txq);
+	txq_start(txq->ifp, txq);
 	TXQ_UNLOCK(txq);
 }
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:18:56 2011	(r219288)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:27:14 2011	(r219289)
@@ -531,11 +531,10 @@ t4_intr_data(void *arg)
 {
 	struct sge_rxq *rxq = arg;
 	struct sge_iq *iq = arg;
+	struct adapter *sc = iq->adapter;
 	struct rsp_ctrl *ctrl;
 	struct sge_fl *fl = &rxq->fl;
-	struct port_info *pi = rxq->port;
-	struct ifnet *ifp = pi->ifp;
-	struct adapter *sc = pi->adapter;
+	struct ifnet *ifp = rxq->ifp;
 	const struct rss_header *rss;
 	const struct cpl_rx_pkt *cpl;
 	int ndescs = 0, rsp_type;
@@ -1193,7 +1192,7 @@ alloc_rxq(struct port_info *pi, struct s
 	if (pi->ifp->if_capenable & IFCAP_LRO)
 		rxq->flags |= RXQ_LRO_ENABLED;
 #endif
-	rxq->port = pi;
+	rxq->ifp = pi->ifp;
 
 	children = SYSCTL_CHILDREN(pi->oid_rxq);
 
@@ -1246,7 +1245,7 @@ alloc_txq(struct port_info *pi, struct s
 	struct sysctl_oid *oid;
 	struct sysctl_oid_list *children;
 
-	txq->port = pi;
+	txq->ifp = pi->ifp;
 	TASK_INIT(&txq->resume_tx, 0, cxgbe_txq_start, txq);
 
 	mtx_init(&eq->eq_lock, eq->lockname, NULL, MTX_DEF);
@@ -2393,9 +2392,11 @@ handle_sge_egr_update(struct adapter *sc
 	unsigned int qid = G_EGR_QID(ntohl(cpl->opcode_qid));
 	struct sge *s = &sc->sge;
 	struct sge_txq *txq;
+	struct port_info *pi;
 
 	txq = (void *)s->eqmap[qid - s->eq_start];
-	taskqueue_enqueue(txq->port->tq, &txq->resume_tx);
+	pi = txq->ifp->if_softc;
+	taskqueue_enqueue(pi->tq, &txq->resume_tx);
 	txq->egr_update++;
 
 	return (0);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:42:05 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51638106564A;
	Sat,  5 Mar 2011 03:42:04 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3EC098FC0C;
	Sat,  5 Mar 2011 03:42:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253g4iL001611;
	Sat, 5 Mar 2011 03:42:04 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253g42W001608;
	Sat, 5 Mar 2011 03:42:04 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050342.p253g42W001608@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:42:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219290 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:42:05 -0000

Author: np
Date: Sat Mar  5 03:42:03 2011
New Revision: 219290
URL: http://svn.freebsd.org/changeset/base/219290

Log:
  Tweaks for rx:
  
  - everything related to LRO should be in #ifdef INET blocks
  - reorder sge_iq's fields so that the most frequently used are all together
  - pull all rx code into t4_intr_data directly
  - let go of the ingress queue lock when passing up data
  - refill the freelist only if it is short of at least 32 buffers

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:27:14 2011	(r219289)
+++ head/sys/dev/cxgbe/adapter.h	Sat Mar  5 03:42:03 2011	(r219290)
@@ -224,24 +224,25 @@ enum {
 struct sge_iq {
 	bus_dma_tag_t desc_tag;
 	bus_dmamap_t desc_map;
-	struct mtx iq_lock;
+	bus_addr_t ba;		/* bus address of descriptor ring */
 	char lockname[16];
-	unsigned int flags;
-	struct adapter *adapter;
+	uint32_t flags;
+	uint16_t abs_id;	/* absolute SGE id for the iq */
+	int8_t   intr_pktc_idx;	/* packet count threshold index */
+	int8_t   pad0;
+	iq_intr_handler_t *handler;
+	__be64  *desc;		/* KVA of descriptor ring */
 
-	__be64 *desc;		/* KVA of descriptor ring */
-	bus_addr_t ba;		/* bus address of descriptor ring */
+	struct mtx iq_lock;
+	struct adapter *adapter;
 	const __be64 *cdesc;	/* current descriptor */
 	uint8_t  gen;		/* generation bit */
 	uint8_t  intr_params;	/* interrupt holdoff parameters */
-	int8_t   intr_pktc_idx;	/* packet count threshold index */
 	uint8_t  intr_next;	/* holdoff for next interrupt */
 	uint8_t  esize;		/* size (bytes) of each entry in the queue */
 	uint16_t qsize;		/* size (# of entries) of the queue */
 	uint16_t cidx;		/* consumer index */
 	uint16_t cntxt_id;	/* SGE context id  for the iq */
-	uint16_t abs_id;	/* absolute SGE id for the iq */
-	iq_intr_handler_t *handler;
 };
 
 enum {
@@ -342,9 +343,11 @@ struct sge_rxq {
 	struct sge_iq iq;	/* MUST be first */
 	struct sge_fl fl;
 
-	unsigned int flags;
 	struct ifnet *ifp;	/* the interface this rxq belongs to */
+	unsigned int flags;
+#ifdef INET
 	struct lro_ctrl lro;	/* LRO state */
+#endif
 
 	/* stats for common events first */
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:27:14 2011	(r219289)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:42:03 2011	(r219290)
@@ -121,7 +121,6 @@ static int alloc_fl_sdesc(struct sge_fl 
 static void free_fl_sdesc(struct sge_fl *);
 static int alloc_eq_maps(struct sge_eq *);
 static void free_eq_maps(struct sge_eq *);
-static struct mbuf *get_fl_sdesc_data(struct sge_fl *, int, int);
 static void set_fl_tag_idx(struct sge_fl *, int);
 
 static int get_pkt_sgl(struct sge_txq *, struct mbuf **, struct sgl *, int);
@@ -533,18 +532,22 @@ t4_intr_data(void *arg)
 	struct sge_iq *iq = arg;
 	struct adapter *sc = iq->adapter;
 	struct rsp_ctrl *ctrl;
-	struct sge_fl *fl = &rxq->fl;
 	struct ifnet *ifp = rxq->ifp;
+	struct sge_fl *fl = &rxq->fl;
+	struct fl_sdesc *sd = &fl->sdesc[fl->cidx], *sd_next;
 	const struct rss_header *rss;
 	const struct cpl_rx_pkt *cpl;
-	int ndescs = 0, rsp_type;
 	uint32_t len;
+	int ndescs = 0, i;
 	struct mbuf *m0, *m;
 #ifdef INET
 	struct lro_ctrl *lro = &rxq->lro;
 	struct lro_entry *l;
 #endif
 
+	prefetch(sd->m);
+	prefetch(sd->cl);
+
 	IQ_LOCK(iq);
 	iq->intr_next = iq->intr_params;
 	while (is_new_response(iq, &ctrl)) {
@@ -552,30 +555,49 @@ t4_intr_data(void *arg)
 		rmb();
 
 		rss = (const void *)iq->cdesc;
-		cpl = (const void *)(rss + 1);
+		i = G_RSPD_TYPE(ctrl->u.type_gen);
 
-		rsp_type = G_RSPD_TYPE(ctrl->u.type_gen);
+		if (__predict_false(i == X_RSPD_TYPE_CPL)) {
 
-		if (__predict_false(rsp_type == X_RSPD_TYPE_CPL)) {
 			/* Can't be anything except an egress update */
-			handle_sge_egr_update(sc, (const void *)cpl);
+			KASSERT(rss->opcode == CPL_SGE_EGR_UPDATE,
+			    ("%s: unexpected CPL %x", __func__, rss->opcode));
+
+			handle_sge_egr_update(sc, (const void *)(rss + 1));
 			goto nextdesc;
 		}
+		KASSERT(i == X_RSPD_TYPE_FLBUF && rss->opcode == CPL_RX_PKT,
+		    ("%s: unexpected CPL %x rsp %d", __func__, rss->opcode, i));
 
-		KASSERT(G_RSPD_TYPE(ctrl->u.type_gen) == X_RSPD_TYPE_FLBUF,
-		    ("unexpected event on data ingress queue: %x",
-		    G_RSPD_TYPE(ctrl->u.type_gen)));
+		sd_next = sd + 1;
+		if (__predict_false(fl->cidx + 1 == fl->cap))
+			sd_next = fl->sdesc;
+		prefetch(sd_next->m);
+		prefetch(sd_next->cl);
 
-		len = be32toh(ctrl->pldbuflen_qid);
+		cpl = (const void *)(rss + 1);
 
-		KASSERT(len & F_RSPD_NEWBUF,
-		    ("%s: T4 misconfigured to pack buffers.", __func__));
+		m0 = sd->m;
+		sd->m = NULL;	/* consumed */
 
+		len = be32toh(ctrl->pldbuflen_qid);
+		if (__predict_false((len & F_RSPD_NEWBUF) == 0))
+			panic("%s: cannot handle packed frames", __func__);
 		len = G_RSPD_LEN(len);
-		m0 = get_fl_sdesc_data(fl, len, M_PKTHDR);
-		if (m0 == NULL) {
-			iq->intr_next = V_QINTR_TIMER_IDX(SGE_NTIMERS - 1);
-			break;
+
+		bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map,
+		    BUS_DMASYNC_POSTREAD);
+
+		m_init(m0, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, M_PKTHDR);
+		if (len < MINCLSIZE) {
+			/* copy data to mbuf, buffer will be recycled */
+			bcopy(sd->cl, mtod(m0, caddr_t), len);
+			m0->m_len = len;
+		} else {
+			bus_dmamap_unload(fl->tag[sd->tag_idx], sd->map);
+			m_cljset(m0, sd->cl, FL_BUF_TYPE(sd->tag_idx));
+			sd->cl = NULL;	/* consumed */
+			m0->m_len = min(len, FL_BUF_SIZE(sd->tag_idx));
 		}
 
 		len -= FL_PKTSHIFT;
@@ -604,16 +626,50 @@ t4_intr_data(void *arg)
 			rxq->vlan_extraction++;
 		}
 
+		i = 1;	/* # of fl sdesc used */
+		sd = sd_next;
+		if (__predict_false(++fl->cidx == fl->cap))
+			fl->cidx = 0;
+
 		len -= m0->m_len;
 		m = m0;
 		while (len) {
-			m->m_next = get_fl_sdesc_data(fl, len, 0);
-			if (m->m_next == NULL)
-				CXGBE_UNIMPLEMENTED("mbuf recovery");
+			i++;
+
+			sd_next = sd + 1;
+			if (__predict_false(fl->cidx + 1 == fl->cap))
+				sd_next = fl->sdesc;
+			prefetch(sd_next->m);
+			prefetch(sd_next->cl);
 
+			m->m_next = sd->m;
+			sd->m = NULL;	/* consumed */
 			m = m->m_next;
+
+			bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map,
+			    BUS_DMASYNC_POSTREAD);
+
+			m_init(m, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, 0);
+			if (len <= MLEN) {
+				bcopy(sd->cl, mtod(m, caddr_t), len);
+				m->m_len = len;
+			} else {
+				bus_dmamap_unload(fl->tag[sd->tag_idx],
+				    sd->map);
+				m_cljset(m, sd->cl, FL_BUF_TYPE(sd->tag_idx));
+				sd->cl = NULL;	/* consumed */
+				m->m_len = min(len, FL_BUF_SIZE(sd->tag_idx));
+			}
+
+			i++;
+			sd = sd_next;
+			if (__predict_false(++fl->cidx == fl->cap))
+				fl->cidx = 0;
+
 			len -= m->m_len;
 		}
+
+		IQ_UNLOCK(iq);
 #ifdef INET
 		if (cpl->l2info & htobe32(F_RXF_LRO) &&
 		    rxq->flags & RXQ_LRO_ENABLED &&
@@ -621,14 +677,15 @@ t4_intr_data(void *arg)
 			/* queued for LRO */
 		} else
 #endif
-			(*ifp->if_input)(ifp, m0);
+		ifp->if_input(ifp, m0);
+		IQ_LOCK(iq);
 
 		FL_LOCK(fl);
-		if (fl->needed >= 32) {
+		fl->needed += i;
+		if (fl->needed >= 32)
 			refill_fl(fl, 64);
-			if (fl->pending >= 32)
-				ring_fl_db(sc, fl);
-		}
+		if (fl->pending >= 32)
+			ring_fl_db(sc, fl);
 		FL_UNLOCK(fl);
 
 nextdesc:	ndescs++;
@@ -642,6 +699,7 @@ nextdesc:	ndescs++;
 			ndescs = 0;
 		}
 	}
+	IQ_UNLOCK(iq);
 
 #ifdef INET
 	while (!SLIST_EMPTY(&lro->lro_active)) {
@@ -654,14 +712,11 @@ nextdesc:	ndescs++;
 	t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(ndescs) |
 	    V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_next));
 
-	IQ_UNLOCK(iq);
-
 	FL_LOCK(fl);
-	if (fl->needed) {
-		refill_fl(fl, -1);
-		if (fl->pending >= 8)
-			ring_fl_db(sc, fl);
-	}
+	if (fl->needed >= 32)
+		refill_fl(fl, 128);
+	if (fl->pending >= 8)
+		ring_fl_db(sc, fl);
 	FL_UNLOCK(fl);
 }
 
@@ -1201,10 +1256,12 @@ alloc_rxq(struct port_info *pi, struct s
 	    NULL, "rx queue");
 	children = SYSCTL_CHILDREN(oid);
 
+#ifdef INET
 	SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD,
 	    &rxq->lro.lro_queued, 0, NULL);
 	SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_flushed", CTLFLAG_RD,
 	    &rxq->lro.lro_flushed, 0, NULL);
+#endif
 	SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "rxcsum", CTLFLAG_RD,
 	    &rxq->rxcsum, "# of times hardware assisted with checksum");
 	SYSCTL_ADD_UQUAD(&pi->ctx, children, OID_AUTO, "vlan_extraction",
@@ -1492,9 +1549,8 @@ refill_fl(struct sge_fl *fl, int nbufs)
 		if (cl == NULL)
 			break;
 
-		rc = bus_dmamap_load(tag, sd->map, cl,
-		    FL_BUF_SIZE(sd->tag_idx), oneseg_dma_callback,
-		    &pa, 0);
+		rc = bus_dmamap_load(tag, sd->map, cl, FL_BUF_SIZE(sd->tag_idx),
+		    oneseg_dma_callback, &pa, 0);
 		if (rc != 0 || pa == 0) {
 			fl->dmamap_failed++;
 			uma_zfree(FL_BUF_ZONE(sd->tag_idx), cl);
@@ -1508,7 +1564,15 @@ refill_fl(struct sge_fl *fl, int nbufs)
 		sd->ba_tag = htobe64(pa | sd->tag_idx);
 #endif
 
-recycled:	fl->pending++;
+recycled:
+		/* sd->m is never recycled, should always be NULL */
+		KASSERT(sd->m == NULL, ("%s: stray mbuf", __func__));
+
+		sd->m = m_gethdr(M_NOWAIT, MT_NOINIT);
+		if (sd->m == NULL)
+			break;
+
+		fl->pending++;
 		fl->needed--;
 		sd++;
 		if (++fl->pidx == fl->cap) {
@@ -1516,10 +1580,6 @@ recycled:	fl->pending++;
 			sd = fl->sdesc;
 			d = fl->desc;
 		}
-
-		/* No harm if gethdr fails, we'll retry after rx */
-		if (sd->m == NULL)
-			sd->m = m_gethdr(M_NOWAIT, MT_NOINIT);
 	}
 }
 
@@ -2335,42 +2395,6 @@ get_flit(bus_dma_segment_t *sgl, int nse
 	return (0);
 }
 
-static struct mbuf *
-get_fl_sdesc_data(struct sge_fl *fl, int len, int flags)
-{
-	struct fl_sdesc *sd;
-	struct mbuf *m;
-
-	sd = &fl->sdesc[fl->cidx];
-	FL_LOCK(fl);
-	if (++fl->cidx == fl->cap)
-		fl->cidx = 0;
-	fl->needed++;
-	FL_UNLOCK(fl);
-
-	m = sd->m;
-	if (m == NULL) {
-		m = m_gethdr(M_NOWAIT, MT_NOINIT);
-		if (m == NULL)
-			return (NULL);
-	}
-	sd->m = NULL;	/* consumed */
-
-	bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD);
-	m_init(m, zone_mbuf, MLEN, M_NOWAIT, MT_DATA, flags);
-	if ((flags && len < MINCLSIZE) || (!flags && len <= MLEN))
-		bcopy(sd->cl, mtod(m, caddr_t), len);
-	else {
-		bus_dmamap_unload(fl->tag[sd->tag_idx], sd->map);
-		m_cljset(m, sd->cl, FL_BUF_TYPE(sd->tag_idx));
-		sd->cl = NULL;	/* consumed */
-	}
-
-	m->m_len = min(len, FL_BUF_SIZE(sd->tag_idx));
-
-	return (m);
-}
-
 static void
 set_fl_tag_idx(struct sge_fl *fl, int mtu)
 {

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 03:54:38 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3500F1065672;
	Sat,  5 Mar 2011 03:54:38 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 22BF28FC19;
	Sat,  5 Mar 2011 03:54:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p253sbKj002801;
	Sat, 5 Mar 2011 03:54:37 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253sbL2002799;
	Sat, 5 Mar 2011 03:54:37 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050354.p253sbL2002799@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 03:54:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219292 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:54:38 -0000

Author: np
Date: Sat Mar  5 03:54:37 2011
New Revision: 219292
URL: http://svn.freebsd.org/changeset/base/219292

Log:
  Calculate how many descriptors can be reclaimed before calling
  reclaim_tx_descs

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:46:24 2011	(r219291)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:54:37 2011	(r219292)
@@ -135,6 +135,7 @@ static inline void write_ulp_cpl_sgl(str
 static int write_sgl_to_txd(struct sge_eq *, struct sgl *, caddr_t *);
 static inline void copy_to_txd(struct sge_eq *, caddr_t, caddr_t *, int);
 static inline void ring_tx_db(struct adapter *, struct sge_eq *);
+static inline int reclaimable(struct sge_eq *);
 static int reclaim_tx_descs(struct sge_eq *, int, int);
 static void write_eqflush_wr(struct sge_eq *);
 static __be64 get_flit(bus_dma_segment_t *, int, int);
@@ -753,22 +754,21 @@ t4_eth_tx(struct ifnet *ifp, struct sge_
 	struct sge_eq *eq = &txq->eq;
 	struct buf_ring *br = eq->br;
 	struct mbuf *next;
-	int rc, coalescing;
+	int rc, coalescing, can_reclaim;
 	struct txpkts txpkts;
 	struct sgl sgl;
 
 	TXQ_LOCK_ASSERT_OWNED(txq);
 	KASSERT(m, ("%s: called with nothing to do.", __func__));
 
+	prefetch(&eq->desc[eq->pidx]);
+	prefetch(&eq->sdesc[eq->pidx]);
+
 	txpkts.npkt = 0;/* indicates there's nothing in txpkts */
 	coalescing = 0;
 
-	prefetch(&eq->sdesc[eq->pidx]);
-	prefetch(&eq->desc[eq->pidx]);
-	prefetch(&eq->maps[eq->map_pidx]);
-
 	if (eq->avail < 8)
-		reclaim_tx_descs(eq, 1, 8);
+		reclaim_tx_descs(eq, 0, 8);
 
 	for (; m; m = next ? next : drbr_dequeue(ifp, br)) {
 
@@ -824,7 +824,7 @@ t4_eth_tx(struct ifnet *ifp, struct sge_
 		coalescing = 0;
 
 		if (eq->avail < 8)
-			reclaim_tx_descs(eq, 1, 8);
+			reclaim_tx_descs(eq, 0, 8);
 		rc = write_txpkt_wr(pi, txq, m, &sgl);
 		if (rc != 0) {
 
@@ -851,7 +851,10 @@ doorbell:
 		/* Fewer and fewer doorbells as the queue fills up */
 		if (eq->pending >= (1 << (fls(eq->qsize - eq->avail) / 2)))
 		    ring_tx_db(sc, eq);
-		reclaim_tx_descs(eq, 16, 32);
+
+		can_reclaim = reclaimable(eq);
+		if (can_reclaim >= 32)
+			reclaim_tx_descs(eq, can_reclaim, 32);
 	}
 
 	if (txpkts.npkt > 0)
@@ -874,7 +877,9 @@ doorbell:
 	if (eq->pending)
 		ring_tx_db(sc, eq);
 
-	reclaim_tx_descs(eq, 16, eq->qsize);
+	can_reclaim = reclaimable(eq);
+	if (can_reclaim >= 32)
+		reclaim_tx_descs(eq, can_reclaim, 128);
 
 	return (0);
 }
@@ -2271,32 +2276,40 @@ ring_tx_db(struct adapter *sc, struct sg
 	eq->pending = 0;
 }
 
-static int
-reclaim_tx_descs(struct sge_eq *eq, int atleast, int howmany)
+static inline int
+reclaimable(struct sge_eq *eq)
 {
-	struct tx_sdesc *txsd;
-	struct tx_map *txm, *next_txm;
-	unsigned int cidx, can_reclaim, reclaimed, maps, next_map_cidx;
-
-	EQ_LOCK_ASSERT_OWNED(eq);
+	unsigned int cidx;
 
 	cidx = eq->spg->cidx;	/* stable snapshot */
 	cidx = be16_to_cpu(cidx);
 
 	if (cidx >= eq->cidx)
-		can_reclaim = cidx - eq->cidx;
+		return (cidx - eq->cidx);
 	else
-		can_reclaim = cidx + eq->cap - eq->cidx;
+		return (cidx + eq->cap - eq->cidx);
+}
+
+/*
+ * There are "can_reclaim" tx descriptors ready to be reclaimed.  Reclaim as
+ * many as possible but stop when there are around "n" mbufs to free.
+ *
+ * The actual number reclaimed is provided as the return value.
+ */
+static int
+reclaim_tx_descs(struct sge_eq *eq, int can_reclaim, int n)
+{
+	struct tx_sdesc *txsd;
+	struct tx_map *txm;
+	unsigned int reclaimed, maps;
 
-	if (can_reclaim < atleast)
-		return (0);
+	EQ_LOCK_ASSERT_OWNED(eq);
 
-	next_map_cidx = eq->map_cidx;
-	next_txm = txm = &eq->maps[next_map_cidx];
-	prefetch(txm);
+	if (can_reclaim == 0)
+		can_reclaim = reclaimable(eq);
 
 	maps = reclaimed = 0;
-	do {
+	while (can_reclaim && maps < n) {
 		int ndesc;
 
 		txsd = &eq->sdesc[eq->cidx];
@@ -2308,15 +2321,18 @@ reclaim_tx_descs(struct sge_eq *eq, int 
 		    __func__, can_reclaim, ndesc));
 
 		maps += txsd->map_used;
+
 		reclaimed += ndesc;
+		can_reclaim -= ndesc;
 
 		eq->cidx += ndesc;
-		if (eq->cidx >= eq->cap)
+		if (__predict_false(eq->cidx >= eq->cap))
 			eq->cidx -= eq->cap;
+	}
 
-		can_reclaim -= ndesc;
-
-	} while (can_reclaim && reclaimed < howmany);
+	txm = &eq->maps[eq->map_cidx];
+	if (maps)
+		prefetch(txm->m);
 
 	eq->avail += reclaimed;
 	KASSERT(eq->avail < eq->cap,	/* avail tops out at (cap - 1) */
@@ -2326,22 +2342,22 @@ reclaim_tx_descs(struct sge_eq *eq, int 
 	KASSERT(eq->map_avail <= eq->map_total,
 	    ("%s: too many maps available", __func__));
 
-	prefetch(txm->m);
 	while (maps--) {
-		next_txm++;
-		if (++next_map_cidx == eq->map_total) {
-			next_map_cidx = 0;
-			next_txm = eq->maps;
-		}
-		prefetch(next_txm->m);
+		struct tx_map *next;
+
+		next = txm + 1;
+		if (__predict_false(eq->map_cidx + 1 == eq->map_total))
+			next = eq->maps;
+		prefetch(next->m);
 
 		bus_dmamap_unload(eq->tx_tag, txm->map);
 		m_freem(txm->m);
 		txm->m = NULL;
 
-		txm = next_txm;
+		txm = next;
+		if (__predict_false(++eq->map_cidx == eq->map_total))
+			eq->map_cidx = 0;
 	}
-	eq->map_cidx = next_map_cidx;
 
 	return (reclaimed);
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 04:04:23 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D1921065673;
	Sat,  5 Mar 2011 04:04:23 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B2B48FC19;
	Sat,  5 Mar 2011 04:04:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2544Nhs003785;
	Sat, 5 Mar 2011 04:04:23 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2544NCI003783;
	Sat, 5 Mar 2011 04:04:23 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050404.p2544NCI003783@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 04:04:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219293 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:04:23 -0000

Author: np
Date: Sat Mar  5 04:04:23 2011
New Revision: 219293
URL: http://svn.freebsd.org/changeset/base/219293

Log:
  There is no need to hold an ingress queue's lock while processing its
  descriptors.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 03:54:37 2011	(r219292)
+++ head/sys/dev/cxgbe/t4_sge.c	Sat Mar  5 04:04:23 2011	(r219293)
@@ -414,7 +414,6 @@ t4_intr_fwd(void *arg)
 	int ndesc_pending = 0, ndesc_total = 0;
 	int qid;
 
-	IQ_LOCK(iq);
 	while (is_new_response(iq, &ctrl)) {
 
 		rmb();
@@ -441,7 +440,6 @@ t4_intr_fwd(void *arg)
 
 		iq_next(iq);
 	}
-	IQ_UNLOCK(iq);
 
 	if (ndesc_total > 0) {
 		t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
@@ -474,7 +472,6 @@ t4_intr_evt(void *arg)
 
 	KASSERT(iq == &sc->sge.fwq, ("%s: unexpected ingress queue", __func__));
 
-	IQ_LOCK(iq);
 	while (is_new_response(iq, &ctrl)) {
 
 		rmb();
@@ -517,7 +514,6 @@ t4_intr_evt(void *arg)
 		}
 		iq_next(iq);
 	}
-	IQ_UNLOCK(iq);
 
 	if (ndesc_total > 0) {
 		t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS),
@@ -549,7 +545,6 @@ t4_intr_data(void *arg)
 	prefetch(sd->m);
 	prefetch(sd->cl);
 
-	IQ_LOCK(iq);
 	iq->intr_next = iq->intr_params;
 	while (is_new_response(iq, &ctrl)) {
 
@@ -670,7 +665,6 @@ t4_intr_data(void *arg)
 			len -= m->m_len;
 		}
 
-		IQ_UNLOCK(iq);
 #ifdef INET
 		if (cpl->l2info & htobe32(F_RXF_LRO) &&
 		    rxq->flags & RXQ_LRO_ENABLED &&
@@ -679,7 +673,6 @@ t4_intr_data(void *arg)
 		} else
 #endif
 		ifp->if_input(ifp, m0);
-		IQ_LOCK(iq);
 
 		FL_LOCK(fl);
 		fl->needed += i;
@@ -700,7 +693,6 @@ nextdesc:	ndescs++;
 			ndescs = 0;
 		}
 	}
-	IQ_UNLOCK(iq);
 
 #ifdef INET
 	while (!SLIST_EMPTY(&lro->lro_active)) {

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 04:19:38 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 787F1106567B;
	Sat,  5 Mar 2011 04:19:38 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6657F8FC16;
	Sat,  5 Mar 2011 04:19:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p254JcpA005521;
	Sat, 5 Mar 2011 04:19:38 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254JcpR005519;
	Sat, 5 Mar 2011 04:19:38 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201103050419.p254JcpR005519@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 5 Mar 2011 04:19:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219299 - head/sys/dev/cxgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:19:38 -0000

Author: np
Date: Sat Mar  5 04:19:38 2011
New Revision: 219299
URL: http://svn.freebsd.org/changeset/base/219299

Log:
  Be sure to stay within the bounds of the mod_str array when displaying
  the transceiver type.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 04:18:29 2011	(r219298)
+++ head/sys/dev/cxgbe/t4_main.c	Sat Mar  5 04:19:38 2011	(r219299)
@@ -2720,6 +2720,7 @@ t4_os_pci_restore_state(struct adapter *
 	pci_cfg_restore(dev, dinfo);
 	return (0);
 }
+
 void
 t4_os_portmod_changed(const struct adapter *sc, int idx)
 {
@@ -2730,10 +2731,13 @@ t4_os_portmod_changed(const struct adapt
 
 	if (pi->mod_type == FW_PORT_MOD_TYPE_NONE)
 		if_printf(pi->ifp, "transceiver unplugged.\n");
-	else
+	else if (pi->mod_type > 0 && pi->mod_type < ARRAY_SIZE(mod_str)) {
 		if_printf(pi->ifp, "%s transceiver inserted.\n",
 		    mod_str[pi->mod_type]);
-
+	} else {
+		if_printf(pi->ifp, "transceiver (type %d) inserted.\n",
+		    pi->mod_type);
+	}
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 12:40:36 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C263106566C;
	Sat,  5 Mar 2011 12:40:36 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED0638FC1B;
	Sat,  5 Mar 2011 12:40:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25CeZHb054688;
	Sat, 5 Mar 2011 12:40:35 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25CeZYc054670;
	Sat, 5 Mar 2011 12:40:35 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103051240.p25CeZYc054670@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Sat, 5 Mar 2011 12:40:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219304 - in head: include lib/libc/sys lib/libutil
	sys/compat/freebsd32 sys/conf sys/kern sys/sys usr.bin/id
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 12:40:36 -0000

Author: trasz
Date: Sat Mar  5 12:40:35 2011
New Revision: 219304
URL: http://svn.freebsd.org/changeset/base/219304

Log:
  Add two new system calls, setloginclass(2) and getloginclass(2).  This makes
  it possible for the kernel to track login class the process is assigned to,
  which is required for RCTL.  This change also make setusercontext(3) call
  setloginclass(2) and makes it possible to retrieve current login class using
  id(1).
  
  Reviewed by:	kib (as part of a larger patch)

Added:
  head/sys/kern/kern_loginclass.c   (contents, props changed)
  head/sys/sys/loginclass.h   (contents, props changed)
Modified:
  head/include/unistd.h
  head/lib/libc/sys/Symbol.map
  head/lib/libutil/login_cap.h
  head/lib/libutil/login_class.c
  head/sys/compat/freebsd32/syscalls.master
  head/sys/conf/files
  head/sys/kern/init_main.c
  head/sys/kern/kern_jail.c
  head/sys/kern/kern_prot.c
  head/sys/kern/syscalls.master
  head/sys/sys/priv.h
  head/sys/sys/ucred.h
  head/usr.bin/id/id.1
  head/usr.bin/id/id.c

Modified: head/include/unistd.h
==============================================================================
--- head/include/unistd.h	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/include/unistd.h	Sat Mar  5 12:40:35 2011	(r219304)
@@ -500,6 +500,7 @@ int	 feature_present(const char *);
 char	*fflagstostr(u_long);
 int	 getdomainname(char *, int);
 int	 getgrouplist(const char *, gid_t, gid_t *, int *);
+int	 getloginclass(char *, size_t);
 mode_t	 getmode(const void *, mode_t);
 int	 getosreldate(void);
 int	 getpeereid(int, uid_t *, gid_t *);
@@ -560,6 +561,7 @@ int	 setkey(const char *);
 #define	_SETKEY_DECLARED
 #endif
 int	 setlogin(const char *);
+int	 setloginclass(const char *);
 void	*setmode(const char *);
 void	 setproctitle(const char *_fmt, ...) __printf0like(1, 2);
 int	 setresgid(gid_t, gid_t, gid_t);

Modified: head/lib/libc/sys/Symbol.map
==============================================================================
--- head/lib/libc/sys/Symbol.map	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/lib/libc/sys/Symbol.map	Sat Mar  5 12:40:35 2011	(r219304)
@@ -344,6 +344,7 @@ FBSD_1.1 {
 	fexecve;
 	fstatat;
 	futimesat;
+	getloginclass;
 	jail_get;
 	jail_set;
 	jail_remove;
@@ -357,6 +358,7 @@ FBSD_1.1 {
 	readlinkat;
 	renameat;
 	setfib;
+	setloginclass;
 	shmctl;
 	symlinkat;
 	unlinkat;

Modified: head/lib/libutil/login_cap.h
==============================================================================
--- head/lib/libutil/login_cap.h	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/lib/libutil/login_cap.h	Sat Mar  5 12:40:35 2011	(r219304)
@@ -49,7 +49,8 @@
 #define LOGIN_SETENV		0x0080		/* set user environment */
 #define LOGIN_SETMAC		0x0100		/* set user default MAC label */
 #define LOGIN_SETCPUMASK	0x0200		/* set user cpumask */
-#define LOGIN_SETALL		0x03ff		/* set everything */
+#define LOGIN_SETLOGINCLASS	0x0400		/* set login class in the kernel */
+#define LOGIN_SETALL		0x07ff		/* set everything */
 
 #define BI_AUTH		"authorize"		/* accepted authentication */
 #define BI_REJECT	"reject"		/* rejected authentication */

Modified: head/lib/libutil/login_class.c
==============================================================================
--- head/lib/libutil/login_class.c	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/lib/libutil/login_class.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -425,6 +426,7 @@ setusercontext(login_cap_t *lc, const st
     quad_t	p;
     mode_t	mymask;
     login_cap_t *llc = NULL;
+    struct sigaction sa, prevsa;
     struct rtprio rtp;
     int error;
 
@@ -512,6 +514,27 @@ setusercontext(login_cap_t *lc, const st
 	return (-1);
     }
 
+    /* Inform the kernel about current login class */
+    if (lc != NULL && lc->lc_class != NULL && (flags & LOGIN_SETLOGINCLASS)) {
+	/*
+	 * XXX: This is a workaround to fail gracefully in case the kernel
+	 *      does not support setloginclass(2).
+	 */
+	bzero(&sa, sizeof(sa));
+	sa.sa_handler = SIG_IGN;
+	sigfillset(&sa.sa_mask);
+	sigaction(SIGSYS, &sa, &prevsa);
+	error = setloginclass(lc->lc_class);
+	sigaction(SIGSYS, &prevsa, NULL);
+	if (error != 0) {
+	    syslog(LOG_ERR, "setloginclass(%s): %m", lc->lc_class);
+#ifdef notyet
+	    login_close(llc);
+	    return (-1);
+#endif
+	}
+    }
+
     mymask = (flags & LOGIN_SETUMASK) ? umask(LOGIN_DEFUMASK) : 0;
     mymask = setlogincontext(lc, pwd, mymask, flags);
     login_close(llc);

Modified: head/sys/compat/freebsd32/syscalls.master
==============================================================================
--- head/sys/compat/freebsd32/syscalls.master	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/compat/freebsd32/syscalls.master	Sat Mar  5 12:40:35 2011	(r219304)
@@ -962,3 +962,6 @@
 				    fd_set *ou, fd_set *ex, \
 				    const struct timespec32 *ts, \
 				    const sigset_t *sm); }
+523	AUE_NULL	NOPROTO	{ int getloginclass(char *namebuf, \
+				    size_t namelen); }
+524	AUE_NULL	NOPROTO	{ int setloginclass(const char *namebuf); }

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/conf/files	Sat Mar  5 12:40:35 2011	(r219304)
@@ -2190,6 +2190,7 @@ kern/kern_linker.c		standard
 kern/kern_lock.c		standard
 kern/kern_lockf.c		standard
 kern/kern_lockstat.c		optional kdtrace_hooks
+kern/kern_loginclass.c		standard
 kern/kern_malloc.c		standard
 kern/kern_mbuf.c		standard
 kern/kern_mib.c			standard

Modified: head/sys/kern/init_main.c
==============================================================================
--- head/sys/kern/init_main.c	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/kern/init_main.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -484,6 +485,7 @@ proc0_init(void *dummy __unused)
 	p->p_ucred->cr_uidinfo = uifind(0);
 	p->p_ucred->cr_ruidinfo = uifind(0);
 	p->p_ucred->cr_prison = &prison0;
+	p->p_ucred->cr_loginclass = loginclass_find("default");
 #ifdef AUDIT
 	audit_cred_kproc0(p->p_ucred);
 #endif

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/kern/kern_jail.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -3874,6 +3874,12 @@ prison_priv_check(struct ucred *cred, in
 	case PRIV_NETINET_GETCRED:
 		return (0);
 
+		/*
+		 * Allow jailed root to set loginclass.
+		 */
+	case PRIV_PROC_SETLOGINCLASS:
+		return (0);
+
 	default:
 		/*
 		 * In all remaining cases, deny the privilege request.  This

Added: head/sys/kern/kern_loginclass.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/kern/kern_loginclass.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -0,0 +1,220 @@
+/*-
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Edward Tomasz Napierala 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$
+ */
+
+/*
+ * Processes may set login class name using setloginclass(2).  This
+ * is usually done through call to setusercontext(3), by programs
+ * such as login(1), based on information from master.passwd(5).  Kernel
+ * uses this information to enforce per-class resource limits.  Current
+ * login class can be determined using id(1).  Login class is inherited
+ * from the parent process during fork(2).  If not set, it defaults
+ * to "default".
+ *
+ * Code in this file implements setloginclass(2) and getloginclass(2)
+ * system calls, and maintains class name storage and retrieval.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static MALLOC_DEFINE(M_LOGINCLASS, "loginclass", "loginclass structures");
+
+LIST_HEAD(, loginclass)	loginclasses;
+
+/*
+ * Lock protecting loginclasses list.
+ */
+static struct mtx loginclasses_lock;
+
+static void lc_init(void);
+SYSINIT(loginclass, SI_SUB_CPU, SI_ORDER_FIRST, lc_init, NULL);
+
+void
+loginclass_hold(struct loginclass *lc)
+{
+
+	refcount_acquire(&lc->lc_refcount);
+}
+
+void
+loginclass_free(struct loginclass *lc)
+{
+	int old;
+
+	old = lc->lc_refcount;
+	if (old > 1 && atomic_cmpset_int(&lc->lc_refcount, old, old - 1))
+		return;
+
+	mtx_lock(&loginclasses_lock);
+	if (refcount_release(&lc->lc_refcount)) {
+		LIST_REMOVE(lc, lc_next);
+		mtx_unlock(&loginclasses_lock);
+		free(lc, M_LOGINCLASS);
+
+		return;
+	}
+	mtx_unlock(&loginclasses_lock);
+}
+
+/*
+ * Return loginclass structure with a corresponding name.  Not
+ * performance critical, as it's used mainly by setloginclass(2),
+ * which happens once per login session.  Caller has to use
+ * loginclass_free() on the returned value when it's no longer
+ * needed.
+ */
+struct loginclass *
+loginclass_find(const char *name)
+{
+	struct loginclass *lc, *newlc;
+
+	if (name[0] == '\0' || strlen(name) >= MAXLOGNAME)
+		return (NULL);
+
+	newlc = malloc(sizeof(*newlc), M_LOGINCLASS, M_ZERO | M_WAITOK);
+
+	mtx_lock(&loginclasses_lock);
+	LIST_FOREACH(lc, &loginclasses, lc_next) {
+		if (strcmp(name, lc->lc_name) != 0)
+			continue;
+
+		/* Found loginclass with a matching name? */
+		loginclass_hold(lc);
+		mtx_unlock(&loginclasses_lock);
+		free(newlc, M_LOGINCLASS);
+		return (lc);
+	}
+
+	/* Add new loginclass. */
+	strcpy(newlc->lc_name, name);
+	refcount_init(&newlc->lc_refcount, 1);
+	LIST_INSERT_HEAD(&loginclasses, newlc, lc_next);
+	mtx_unlock(&loginclasses_lock);
+
+	return (newlc);
+}
+
+/*
+ * Get login class name.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct getloginclass_args {
+	char	*namebuf;
+	size_t	namelen;
+};
+#endif
+/* ARGSUSED */
+int
+getloginclass(struct thread *td, struct getloginclass_args *uap)
+{
+	int error = 0;
+	size_t lcnamelen;
+	struct proc *p;
+	struct loginclass *lc;
+
+	p = td->td_proc;
+	PROC_LOCK(p);
+	lc = p->p_ucred->cr_loginclass;
+	loginclass_hold(lc);
+	PROC_UNLOCK(p);
+
+	lcnamelen = strlen(lc->lc_name) + 1;
+	if (lcnamelen > uap->namelen)
+		error = ERANGE;
+	if (error == 0)
+		error = copyout(lc->lc_name, uap->namebuf, lcnamelen);
+	loginclass_free(lc);
+	return (error);
+}
+
+/*
+ * Set login class name.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct setloginclass_args {
+	const char	*namebuf;
+};
+#endif
+/* ARGSUSED */
+int
+setloginclass(struct thread *td, struct setloginclass_args *uap)
+{
+	struct proc *p = td->td_proc;
+	int error;
+	char lcname[MAXLOGNAME];
+	struct loginclass *newlc;
+	struct ucred *newcred, *oldcred;
+
+	error = priv_check(td, PRIV_PROC_SETLOGINCLASS);
+	if (error != 0)
+		return (error);
+	error = copyinstr(uap->namebuf, lcname, sizeof(lcname), NULL);
+	if (error != 0)
+		return (error);
+
+	newlc = loginclass_find(lcname);
+	if (newlc == NULL)
+		return (EINVAL);
+	newcred = crget();
+
+	PROC_LOCK(p);
+	oldcred = crcopysafe(p, newcred);
+	newcred->cr_loginclass = newlc;
+	p->p_ucred = newcred;
+	PROC_UNLOCK(p);
+
+	loginclass_free(oldcred->cr_loginclass);
+	crfree(oldcred);
+
+	return (0);
+}
+
+static void
+lc_init(void)
+{
+
+	mtx_init(&loginclasses_lock, "loginclasses lock", NULL, MTX_DEF);
+}

Modified: head/sys/kern/kern_prot.c
==============================================================================
--- head/sys/kern/kern_prot.c	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/kern/kern_prot.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1842,6 +1843,8 @@ crfree(struct ucred *cr)
 		 */
 		if (cr->cr_prison != NULL)
 			prison_free(cr->cr_prison);
+		if (cr->cr_loginclass != NULL)
+			loginclass_free(cr->cr_loginclass);
 #ifdef AUDIT
 		audit_cred_destroy(cr);
 #endif
@@ -1878,6 +1881,7 @@ crcopy(struct ucred *dest, struct ucred 
 	uihold(dest->cr_uidinfo);
 	uihold(dest->cr_ruidinfo);
 	prison_hold(dest->cr_prison);
+	loginclass_hold(dest->cr_loginclass);
 #ifdef AUDIT
 	audit_cred_copy(src, dest);
 #endif

Modified: head/sys/kern/syscalls.master
==============================================================================
--- head/sys/kern/syscalls.master	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/kern/syscalls.master	Sat Mar  5 12:40:35 2011	(r219304)
@@ -926,5 +926,8 @@
 				    fd_set *ou, fd_set *ex, \
 				    const struct timespec *ts, \
 				    const sigset_t *sm); }
+523	AUE_NULL	STD	{ int getloginclass(char *namebuf, \
+				    size_t namelen); }
+524	AUE_NULL	STD	{ int setloginclass(const char *namebuf); }
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master

Added: head/sys/sys/loginclass.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/sys/loginclass.h	Sat Mar  5 12:40:35 2011	(r219304)
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Edward Tomasz Napierala 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 _SYS_LOGINCLASS_H_
+#define	_SYS_LOGINCLASS_H_
+
+/*
+ * Exactly one of these structures exists per login class.
+ */
+struct loginclass {
+	LIST_ENTRY(loginclass)	lc_next;
+	char			lc_name[MAXLOGNAME];
+	u_int			lc_refcount;
+};
+
+void	loginclass_hold(struct loginclass *lc);
+void	loginclass_free(struct loginclass *lc);
+struct loginclass	*loginclass_find(const char *name);
+
+#endif /* !_SYS_LOGINCLASS_H_ */
+

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/sys/priv.h	Sat Mar  5 12:40:35 2011	(r219304)
@@ -156,6 +156,7 @@
 #define	PRIV_PROC_LIMIT		160	/* Exceed user process limit. */
 #define	PRIV_PROC_SETLOGIN	161	/* Can call setlogin. */
 #define	PRIV_PROC_SETRLIMIT	162	/* Can raise resources limits. */
+#define	PRIV_PROC_SETLOGINCLASS	163	/* Can call setloginclass(2). */
 
 /* System V IPC privileges.
  */

Modified: head/sys/sys/ucred.h
==============================================================================
--- head/sys/sys/ucred.h	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/sys/sys/ucred.h	Sat Mar  5 12:40:35 2011	(r219304)
@@ -35,6 +35,8 @@
 
 #include 
 
+struct loginclass;
+
 /*
  * Credentials.
  *
@@ -54,7 +56,7 @@ struct ucred {
 	struct uidinfo	*cr_uidinfo;	/* per euid resource consumption */
 	struct uidinfo	*cr_ruidinfo;	/* per ruid resource consumption */
 	struct prison	*cr_prison;	/* jail(2) */
-	void		*cr_pspare;	/* general use */
+	struct loginclass	*cr_loginclass; /* login class */
 	u_int		cr_flags;	/* credential flags */
 	void 		*cr_pspare2[2];	/* general use 2 */
 #define	cr_endcopy	cr_label

Modified: head/usr.bin/id/id.1
==============================================================================
--- head/usr.bin/id/id.1	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/usr.bin/id/id.1	Sat Mar  5 12:40:35 2011	(r219304)
@@ -31,7 +31,7 @@
 .\"	@(#)id.1	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd September 26, 2006
+.Dd March 5, 2011
 .Dt ID 1
 .Os
 .Sh NAME
@@ -51,6 +51,8 @@
 .Fl P
 .Op Ar user
 .Nm
+.Fl c
+.Nm
 .Fl g Op Fl nr
 .Op Ar user
 .Nm
@@ -89,6 +91,8 @@ Display the id as a password file entry.
 Ignored for compatibility with other
 .Nm
 implementations.
+.It Fl c
+Display current login class.
 .It Fl g
 Display the effective group ID as a number.
 .It Fl n

Modified: head/usr.bin/id/id.c
==============================================================================
--- head/usr.bin/id/id.c	Sat Mar  5 09:42:00 2011	(r219303)
+++ head/usr.bin/id/id.c	Sat Mar  5 12:40:35 2011	(r219304)
@@ -74,11 +74,13 @@ main(int argc, char *argv[])
 	struct group *gr;
 	struct passwd *pw;
 	int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag;
-	int Aflag;
+	int Aflag, cflag;
+	int error;
 	const char *myname;
+	char loginclass[MAXLOGNAME];
 
 	Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0;
-	Aflag = 0;
+	Aflag = cflag = 0;
 
 	myname = strrchr(argv[0], '/');
 	myname = (myname != NULL) ? myname + 1 : argv[0];
@@ -92,7 +94,7 @@ main(int argc, char *argv[])
 	}
 
 	while ((ch = getopt(argc, argv,
-	    (isgroups || iswhoami) ? "" : "APGMagnpru")) != -1)
+	    (isgroups || iswhoami) ? "" : "APGMacgnpru")) != -1)
 		switch(ch) {
 #ifdef USE_BSM_AUDIT
 		case 'A':
@@ -110,6 +112,9 @@ main(int argc, char *argv[])
 			break;
 		case 'a':
 			break;
+		case 'c':
+			cflag = 1;
+			break;
 		case 'g':
 			gflag = 1;
 			break;
@@ -158,6 +163,14 @@ main(int argc, char *argv[])
 	}
 #endif
 
+	if (cflag) {
+		error = getloginclass(loginclass, sizeof(loginclass));
+		if (error != 0)
+			err(1, "loginclass");
+		(void)printf("%s\n", loginclass);
+		exit(0);
+	}
+
 	if (gflag) {
 		id = pw ? pw->pw_gid : rflag ? getgid() : getegid();
 		if (nflag && (gr = getgrgid(id)))
@@ -467,7 +480,7 @@ usage(void)
 	else if (iswhoami)
 		(void)fprintf(stderr, "usage: whoami\n");
 	else
-		(void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n",
+		(void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
 		    "usage: id [user]",
 #ifdef USE_BSM_AUDIT
 		    "       id -A\n",
@@ -477,6 +490,7 @@ usage(void)
 		    "       id -G [-n] [user]",
 		    "       id -M",
 		    "       id -P [user]",
+		    "       id -c",
 		    "       id -g [-nr] [user]",
 		    "       id -p [user]",
 		    "       id -u [-nr] [user]");

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 12:46:24 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9DE52106564A;
	Sat,  5 Mar 2011 12:46:24 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8BAFC8FC1B;
	Sat,  5 Mar 2011 12:46:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25CkO8Q055503;
	Sat, 5 Mar 2011 12:46:24 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25CkOiB055492;
	Sat, 5 Mar 2011 12:46:24 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103051246.p25CkOiB055492@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Sat, 5 Mar 2011 12:46:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219305 - in head/sys: compat/freebsd32 kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 12:46:24 -0000

Author: trasz
Date: Sat Mar  5 12:46:24 2011
New Revision: 219305
URL: http://svn.freebsd.org/changeset/base/219305

Log:
  Regenerate.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/kern/systrace_args.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/compat/freebsd32/freebsd32_proto.h	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -412,4 +412,6 @@
 #define	FREEBSD32_SYS_cap_enter	516
 #define	FREEBSD32_SYS_cap_getmode	517
 #define	FREEBSD32_SYS_freebsd32_pselect	522
-#define	FREEBSD32_SYS_MAXSYSCALL	523
+#define	FREEBSD32_SYS_getloginclass	523
+#define	FREEBSD32_SYS_setloginclass	524
+#define	FREEBSD32_SYS_MAXSYSCALL	525

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -546,4 +546,6 @@ const char *freebsd32_syscallnames[] = {
 	"#520",			/* 520 = pdgetpid */
 	"#521",			/* 521 = pdwait */
 	"freebsd32_pselect",			/* 522 = freebsd32_pselect */
+	"getloginclass",			/* 523 = getloginclass */
+	"setloginclass",			/* 524 = setloginclass */
 };

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/compat/freebsd32/freebsd32_sysent.c	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #include "opt_compat.h"
@@ -583,4 +583,6 @@ struct sysent freebsd32_sysent[] = {
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 520 = pdgetpid */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 521 = pdwait */
 	{ AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 522 = freebsd32_pselect */
+	{ AS(getloginclass_args), (sy_call_t *)getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 523 = getloginclass */
+	{ AS(setloginclass_args), (sy_call_t *)setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 524 = setloginclass */
 };

Modified: head/sys/kern/init_sysent.c
==============================================================================
--- head/sys/kern/init_sysent.c	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/kern/init_sysent.c	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/kern/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #include "opt_compat.h"
@@ -557,4 +557,6 @@ struct sysent sysent[] = {
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 520 = pdgetpid */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 521 = pdwait */
 	{ AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 522 = pselect */
+	{ AS(getloginclass_args), (sy_call_t *)getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 523 = getloginclass */
+	{ AS(setloginclass_args), (sy_call_t *)setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 524 = setloginclass */
 };

Modified: head/sys/kern/syscalls.c
==============================================================================
--- head/sys/kern/syscalls.c	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/kern/syscalls.c	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/kern/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 const char *syscallnames[] = {
@@ -530,4 +530,6 @@ const char *syscallnames[] = {
 	"#520",			/* 520 = pdgetpid */
 	"#521",			/* 521 = pdwait */
 	"pselect",			/* 522 = pselect */
+	"getloginclass",			/* 523 = getloginclass */
+	"setloginclass",			/* 524 = setloginclass */
 };

Modified: head/sys/kern/systrace_args.c
==============================================================================
--- head/sys/kern/systrace_args.c	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/kern/systrace_args.c	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3120,6 +3120,21 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 6;
 		break;
 	}
+	/* getloginclass */
+	case 523: {
+		struct getloginclass_args *p = params;
+		uarg[0] = (intptr_t) p->namebuf; /* char * */
+		uarg[1] = p->namelen; /* size_t */
+		*n_args = 2;
+		break;
+	}
+	/* setloginclass */
+	case 524: {
+		struct setloginclass_args *p = params;
+		uarg[0] = (intptr_t) p->namebuf; /* const char * */
+		*n_args = 1;
+		break;
+	}
 	default:
 		*n_args = 0;
 		break;
@@ -8290,6 +8305,29 @@ systrace_setargdesc(int sysnum, int ndx,
 			break;
 		};
 		break;
+	/* getloginclass */
+	case 523:
+		switch(ndx) {
+		case 0:
+			p = "char *";
+			break;
+		case 1:
+			p = "size_t";
+			break;
+		default:
+			break;
+		};
+		break;
+	/* setloginclass */
+	case 524:
+		switch(ndx) {
+		case 0:
+			p = "const char *";
+			break;
+		default:
+			break;
+		};
+		break;
 	default:
 		break;
 	};

Modified: head/sys/sys/syscall.h
==============================================================================
--- head/sys/sys/syscall.h	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/sys/syscall.h	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/kern/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #define	SYS_syscall	0
@@ -433,4 +433,6 @@
 #define	SYS_cap_enter	516
 #define	SYS_cap_getmode	517
 #define	SYS_pselect	522
-#define	SYS_MAXSYSCALL	523
+#define	SYS_getloginclass	523
+#define	SYS_setloginclass	524
+#define	SYS_MAXSYSCALL	525

Modified: head/sys/sys/syscall.mk
==============================================================================
--- head/sys/sys/syscall.mk	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/sys/syscall.mk	Sat Mar  5 12:46:24 2011	(r219305)
@@ -1,7 +1,7 @@
 # FreeBSD system call names.
 # DO NOT EDIT-- this file is automatically generated.
 # $FreeBSD$
-# created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+# created from FreeBSD: head/sys/kern/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
 MIASM =  \
 	syscall.o \
 	exit.o \
@@ -381,4 +381,6 @@ MIASM =  \
 	lpathconf.o \
 	cap_enter.o \
 	cap_getmode.o \
-	pselect.o
+	pselect.o \
+	getloginclass.o \
+	setloginclass.o

Modified: head/sys/sys/sysproto.h
==============================================================================
--- head/sys/sys/sysproto.h	Sat Mar  5 12:40:35 2011	(r219304)
+++ head/sys/sys/sysproto.h	Sat Mar  5 12:46:24 2011	(r219305)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/kern/syscalls.master 219129 2011-03-01 13:23:37Z rwatson 
+ * created from FreeBSD: head/sys/kern/syscalls.master 219304 2011-03-05 12:40:35Z trasz 
  */
 
 #ifndef _SYS_SYSPROTO_H_
@@ -1671,6 +1671,13 @@ struct pselect_args {
 	char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)];
 	char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)];
 };
+struct getloginclass_args {
+	char namebuf_l_[PADL_(char *)]; char * namebuf; char namebuf_r_[PADR_(char *)];
+	char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)];
+};
+struct setloginclass_args {
+	char namebuf_l_[PADL_(const char *)]; const char * namebuf; char namebuf_r_[PADR_(const char *)];
+};
 int	nosys(struct thread *, struct nosys_args *);
 void	sys_exit(struct thread *, struct sys_exit_args *);
 int	fork(struct thread *, struct fork_args *);
@@ -2034,6 +2041,8 @@ int	lpathconf(struct thread *, struct lp
 int	cap_enter(struct thread *, struct cap_enter_args *);
 int	cap_getmode(struct thread *, struct cap_getmode_args *);
 int	pselect(struct thread *, struct pselect_args *);
+int	getloginclass(struct thread *, struct getloginclass_args *);
+int	setloginclass(struct thread *, struct setloginclass_args *);
 
 #ifdef COMPAT_43
 
@@ -2711,6 +2720,8 @@ int	freebsd7_shmctl(struct thread *, str
 #define	SYS_AUE_cap_enter	AUE_CAP_ENTER
 #define	SYS_AUE_cap_getmode	AUE_CAP_GETMODE
 #define	SYS_AUE_pselect	AUE_SELECT
+#define	SYS_AUE_getloginclass	AUE_NULL
+#define	SYS_AUE_setloginclass	AUE_NULL
 
 #undef PAD_
 #undef PADL_

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 13:27:13 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B7151065672;
	Sat,  5 Mar 2011 13:27:13 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6AF5D8FC15;
	Sat,  5 Mar 2011 13:27:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25DRDkV058615;
	Sat, 5 Mar 2011 13:27:13 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25DRDh6058612;
	Sat, 5 Mar 2011 13:27:13 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201103051327.p25DRDh6058612@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 5 Mar 2011 13:27:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219306 - head/bin/sh
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 13:27:13 -0000

Author: jilles
Date: Sat Mar  5 13:27:13 2011
New Revision: 219306
URL: http://svn.freebsd.org/changeset/base/219306

Log:
  sh: Fix some warnings in code for arithmetic expressions.
  
  Submitted by:	eadler

Modified:
  head/bin/sh/arith_yacc.c
  head/bin/sh/arith_yylex.c

Modified: head/bin/sh/arith_yacc.c
==============================================================================
--- head/bin/sh/arith_yacc.c	Sat Mar  5 12:46:24 2011	(r219305)
+++ head/bin/sh/arith_yacc.c	Sat Mar  5 13:27:13 2011	(r219306)
@@ -198,7 +198,7 @@ again:
 	}
 }
 
-static arith_t binop2(arith_t a, int op, int prec, int noeval)
+static arith_t binop2(arith_t a, int op, int precedence, int noeval)
 {
 	for (;;) {
 		union yystype val;
@@ -221,7 +221,7 @@ static arith_t binop2(arith_t a, int op,
 		a = noeval ? b : do_binop(op, a, b);
 
 		if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX ||
-		    arith_prec(op2) >= prec)
+		    arith_prec(op2) >= precedence)
 			return a;
 
 		op = op2;

Modified: head/bin/sh/arith_yylex.c
==============================================================================
--- head/bin/sh/arith_yylex.c	Sat Mar  5 12:46:24 2011	(r219305)
+++ head/bin/sh/arith_yylex.c	Sat Mar  5 13:27:13 2011	(r219306)
@@ -57,6 +57,7 @@ yylex()
 {
 	int value;
 	const char *buf = arith_buf;
+	char *end;
 	const char *p;
 
 	for (;;) {
@@ -79,7 +80,8 @@ yylex()
 		case '7':
 		case '8':
 		case '9':
-			yylval.val = strtoarith_t(buf, (char **)&arith_buf, 0);
+			yylval.val = strtoarith_t(buf, (char **)&end, 0);
+			arith_buf = end;
 			return ARITH_NUM;
 		case 'A':
 		case 'B':

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 14:41:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22C9A1065675;
	Sat,  5 Mar 2011 14:41:50 +0000 (UTC)
	(envelope-from trasz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 102598FC19;
	Sat,  5 Mar 2011 14:41:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25Efnul066157;
	Sat, 5 Mar 2011 14:41:49 GMT (envelope-from trasz@svn.freebsd.org)
Received: (from trasz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25Efn29066148;
	Sat, 5 Mar 2011 14:41:49 GMT (envelope-from trasz@svn.freebsd.org)
Message-Id: <201103051441.p25Efn29066148@svn.freebsd.org>
From: Edward Tomasz Napierala 
Date: Sat, 5 Mar 2011 14:41:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219307 - in head: bin/ps sys/compat/freebsd32 sys/kern
	sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 14:41:50 -0000

Author: trasz
Date: Sat Mar  5 14:41:49 2011
New Revision: 219307
URL: http://svn.freebsd.org/changeset/base/219307

Log:
  Export login class information via kinfo and make it possible to view
  it using "ps -o class".

Modified:
  head/bin/ps/extern.h
  head/bin/ps/keyword.c
  head/bin/ps/print.c
  head/bin/ps/ps.1
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/kern/kern_proc.c
  head/sys/sys/user.h

Modified: head/bin/ps/extern.h
==============================================================================
--- head/bin/ps/extern.h	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/bin/ps/extern.h	Sat Mar  5 14:41:49 2011	(r219307)
@@ -55,6 +55,7 @@ const	 char *fmt_argv(char **, char *, s
 double	 getpcpu(const KINFO *);
 void	 kvar(KINFO *, VARENT *);
 void	 label(KINFO *, VARENT *);
+void	 loginclass(KINFO *, VARENT *);
 void	 logname(KINFO *, VARENT *);
 void	 longtname(KINFO *, VARENT *);
 void	 lstarted(KINFO *, VARENT *);

Modified: head/bin/ps/keyword.c
==============================================================================
--- head/bin/ps/keyword.c	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/bin/ps/keyword.c	Sat Mar  5 14:41:49 2011	(r219307)
@@ -79,6 +79,8 @@ static VAR var[] = {
 		CHAR, NULL, 0},
 	{"blocked", "", "sigmask", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
 	{"caught", "", "sigcatch", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
+	{"class", "CLASS", NULL, LJUST, loginclass, NULL, MAXLOGNAME-1, 0,
+		CHAR, NULL, 0},
 	{"comm", "COMMAND", NULL, LJUST|DSIZ, ucomm, s_comm,
 		COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0},
 	{"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0,

Modified: head/bin/ps/print.c
==============================================================================
--- head/bin/ps/print.c	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/bin/ps/print.c	Sat Mar  5 14:41:49 2011	(r219307)
@@ -862,6 +862,26 @@ out:
 	return;
 }
 
+void
+loginclass(KINFO *k, VARENT *ve)
+{
+	VAR *v;
+	char *s;
+
+	v = ve->var;
+	/*
+	 * Don't display login class for system processes;
+	 * login classes are used for resource limits,
+	 * and limits don't apply to system processes.
+	 */
+	if (k->ki_p->ki_flag & P_SYSTEM) {
+		(void)printf("%-*s", v->width, "  -");
+		return;
+	}
+	s = k->ki_p->ki_loginclass;
+	(void)printf("%-*s", v->width, *s ? s : "-");
+}
+
 int
 s_comm(KINFO *k)
 {

Modified: head/bin/ps/ps.1
==============================================================================
--- head/bin/ps/ps.1	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/bin/ps/ps.1	Sat Mar  5 14:41:49 2011	(r219307)
@@ -29,7 +29,7 @@
 .\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 24, 2010
+.Dd March 5, 2011
 .Dt PS 1
 .Os
 .Sh NAME
@@ -280,6 +280,8 @@ be very young) it is possible for the su
 fields to exceed 100%.
 .It Cm %mem
 The percentage of real memory used by this process.
+.It Cm class
+Login class associated with the process.
 .It Cm flags
 The flags associated with the process as in
 the include file
@@ -475,6 +477,8 @@ accounting flag (alias
 .Cm acflg )
 .It Cm args
 command and arguments
+.It Cm class
+login class
 .It Cm comm
 command
 .It Cm command

Modified: head/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32.h	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/sys/compat/freebsd32/freebsd32.h	Sat Mar  5 14:41:49 2011	(r219307)
@@ -316,7 +316,8 @@ struct kinfo_proc32 {
 	char	ki_lockname[LOCKNAMELEN+1];
 	char	ki_comm[COMMLEN+1];
 	char	ki_emul[KI_EMULNAMELEN+1];
-	char	ki_sparestrings[68];
+	char	ki_loginclass[LOGINCLASSLEN+1];
+	char	ki_sparestrings[50];
 	int	ki_spareints[KI_NSPARE_INT];
 	u_int	ki_cr_flags;
 	int	ki_jid;

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/sys/kern/kern_proc.c	Sat Mar  5 14:41:49 2011	(r219307)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -745,6 +746,8 @@ fill_kinfo_proc_only(struct proc *p, str
 			if (cred->cr_prison != curthread->td_ucred->cr_prison)
 				kp->ki_jid = cred->cr_prison->pr_id;
 		}
+		strlcpy(kp->ki_loginclass, cred->cr_loginclass->lc_name,
+		    sizeof(kp->ki_loginclass));
 	}
 	ps = p->p_sigacts;
 	if (ps) {
@@ -1059,6 +1062,7 @@ freebsd32_kinfo_proc_out(const struct ki
 	bcopy(ki->ki_lockname, ki32->ki_lockname, LOCKNAMELEN + 1);
 	bcopy(ki->ki_comm, ki32->ki_comm, COMMLEN + 1);
 	bcopy(ki->ki_emul, ki32->ki_emul, KI_EMULNAMELEN + 1);
+	bcopy(ki->ki_loginclass, ki32->ki_loginclass, LOGINCLASSLEN + 1);
 	CP(*ki, *ki32, ki_cr_flags);
 	CP(*ki, *ki32, ki_jid);
 	CP(*ki, *ki32, ki_numthreads);

Modified: head/sys/sys/user.h
==============================================================================
--- head/sys/sys/user.h	Sat Mar  5 13:27:13 2011	(r219306)
+++ head/sys/sys/user.h	Sat Mar  5 14:41:49 2011	(r219307)
@@ -100,6 +100,7 @@
 #define	KI_EMULNAMELEN	16		/* size of returned ki_emul */
 #define KI_NGROUPS	16		/* number of groups in ki_groups */
 #define	LOGNAMELEN	17		/* size of returned ki_login */
+#define	LOGINCLASSLEN	17		/* size of returned ki_loginclass */
 
 /* Flags for the process credential. */
 #define	KI_CRF_CAPABILITY_MODE	0x00000001
@@ -172,12 +173,13 @@ struct kinfo_proc {
 	char	ki_lockname[LOCKNAMELEN+1]; /* lock name */
 	char	ki_comm[COMMLEN+1];	/* command name */
 	char	ki_emul[KI_EMULNAMELEN+1];  /* emulation name */
+	char	ki_loginclass[LOGINCLASSLEN+1]; /* login class */
 	/*
 	 * When adding new variables, take space for char-strings from the
 	 * front of ki_sparestrings, and ints from the end of ki_spareints.
 	 * That way the spare room from both arrays will remain contiguous.
 	 */
-	char	ki_sparestrings[68];	/* spare string space */
+	char	ki_sparestrings[50];	/* spare string space */
 	int	ki_spareints[KI_NSPARE_INT];	/* spare room for growth */
 	u_int	ki_cr_flags;		/* Credential flags */
 	int	ki_jid;			/* Process jail ID */

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 15:18:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02DC31065672;
	Sat,  5 Mar 2011 15:18:12 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E5DA68FC0C;
	Sat,  5 Mar 2011 15:18:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25FIBhD068734;
	Sat, 5 Mar 2011 15:18:11 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25FIBLa068732;
	Sat, 5 Mar 2011 15:18:11 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201103051518.p25FIBLa068732@svn.freebsd.org>
From: Gavin Atkinson 
Date: Sat, 5 Mar 2011 15:18:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219308 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 15:18:12 -0000

Author: gavin
Date: Sat Mar  5 15:18:11 2011
New Revision: 219308
URL: http://svn.freebsd.org/changeset/base/219308

Log:
  Add two missing vertical bars.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==============================================================================
--- head/share/misc/bsd-family-tree	Sat Mar  5 14:41:49 2011	(r219307)
+++ head/share/misc/bsd-family-tree	Sat Mar  5 15:18:11 2011	(r219308)
@@ -229,8 +229,8 @@ FreeBSD 5.2           |      |          
  |     |              |      |                 |                DragonFly 2.2.0
  |  FreeBSD 7.2       |   NetBSD 5.0       OpenBSD 4.5                 |
  |             \      |      |    |            |                       |
- |              |  Mac OS X  |                 |                       |
- |              |    10.6    |                 |                       |
+ |              |  Mac OS X  |    |            |                       |
+ |              |    10.6    |    |            |                       |
  |              |     |      |    |            |                DragonFly 2.4.0
  |              |     |      |    |        OpenBSD 4.6                 |
  |              |     |      |    |            |                       |

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 20:36:42 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DF2D1106564A;
	Sat,  5 Mar 2011 20:36:42 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CDB8F8FC0A;
	Sat,  5 Mar 2011 20:36:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25KagsU075298;
	Sat, 5 Mar 2011 20:36:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25KaglZ075296;
	Sat, 5 Mar 2011 20:36:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103052036.p25KaglZ075296@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 5 Mar 2011 20:36:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219311 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 20:36:43 -0000

Author: dchagin
Date: Sat Mar  5 20:36:42 2011
New Revision: 219311
URL: http://svn.freebsd.org/changeset/base/219311

Log:
  Partially reworked r219042.
  The reason for this is a bug at ktrops() where process dereferenced
  without having a lock. This might cause a panic if ktrace was runned
  with -p flag and the specified process exited between the dropping
  a lock and writing sv_flags.
  
  Since it is impossible to acquire sx lock while holding mtx switch
  to use asynchronous enqueuerequest() instead of writerequest().
  
  Rename ktr_getrequest_ne() to more understandable name [1].
  
  Requested by:	jhb [1]
  
  MFC after:	1 Week

Modified:
  head/sys/kern/kern_ktrace.c

Modified: head/sys/kern/kern_ktrace.c
==============================================================================
--- head/sys/kern/kern_ktrace.c	Sat Mar  5 20:15:32 2011	(r219310)
+++ head/sys/kern/kern_ktrace.c	Sat Mar  5 20:36:42 2011	(r219311)
@@ -138,9 +138,8 @@ static struct sx ktrace_sx;
 static void ktrace_init(void *dummy);
 static int sysctl_kern_ktrace_request_pool(SYSCTL_HANDLER_ARGS);
 static u_int ktrace_resize_pool(u_int oldsize, u_int newsize);
-static struct ktr_request *ktr_getrequest_ne(struct thread *, int type);
+static struct ktr_request *ktr_getrequest_entered(struct thread *td, int type);
 static struct ktr_request *ktr_getrequest(int type);
-static void ktr_submitrequest_ne(struct thread *td, struct ktr_request *req);
 static void ktr_submitrequest(struct thread *td, struct ktr_request *req);
 static void ktr_freeproc(struct proc *p, struct ucred **uc,
     struct vnode **vp);
@@ -150,7 +149,7 @@ static void ktr_writerequest(struct thre
 static int ktrcanset(struct thread *,struct proc *);
 static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *);
 static int ktrops(struct thread *,struct proc *,int,int,struct vnode *);
-static void ktrprocctor_ne(struct thread *, struct proc *p);
+static void ktrprocctor_entered(struct thread *, struct proc *);
 
 /*
  * ktrace itself generates events, such as context switches, which we do not
@@ -272,7 +271,7 @@ CTASSERT(sizeof(((struct ktr_header *)NU
     (sizeof((struct thread *)NULL)->td_name));
 
 static struct ktr_request *
-ktr_getrequest_ne(struct thread *td, int type)
+ktr_getrequest_entered(struct thread *td, int type)
 {
 	struct ktr_request *req;
 	struct proc *p = td->td_proc;
@@ -317,7 +316,7 @@ ktr_getrequest(int type)
 	struct ktr_request *req;
 
 	ktrace_enter(td);
-	req = ktr_getrequest_ne(td, type);
+	req = ktr_getrequest_entered(td, type);
 	if (req == NULL)
 		ktrace_exit(td);
 
@@ -337,7 +336,6 @@ ktr_enqueuerequest(struct thread *td, st
 	mtx_lock(&ktrace_mtx);
 	STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list);
 	mtx_unlock(&ktrace_mtx);
-	ktrace_exit(td);
 }
 
 /*
@@ -377,7 +375,7 @@ ktr_drain(struct thread *td)
  * been cached in the thread.
  */
 static void
-ktr_submitrequest_ne(struct thread *td, struct ktr_request *req)
+ktr_submitrequest(struct thread *td, struct ktr_request *req)
 {
 
 	ktrace_assert(td);
@@ -387,14 +385,6 @@ ktr_submitrequest_ne(struct thread *td, 
 	ktr_writerequest(td, req);
 	ktr_freerequest(req);
 	sx_xunlock(&ktrace_sx);
-}
-
-static void
-ktr_submitrequest(struct thread *td, struct ktr_request *req)
-{
-
-	ktrace_assert(td);
-	ktr_submitrequest_ne(td, req);
 	ktrace_exit(td);
 }
 
@@ -523,12 +513,12 @@ ktrprocexit(struct thread *td)
 		return;
 
 	ktrace_enter(td);
+	req = ktr_getrequest_entered(td, KTR_PROCDTOR);
+	if (req != NULL)
+		ktr_enqueuerequest(td, req);
 	sx_xlock(&ktrace_sx);
 	ktr_drain(td);
 	sx_xunlock(&ktrace_sx);
-	req = ktr_getrequest_ne(td, KTR_PROCDTOR);
-	if (req != NULL)
-		ktr_submitrequest_ne(td, req);
 	PROC_LOCK(p);
 	mtx_lock(&ktrace_mtx);
 	ktr_freeproc(p, &cred, &vp);
@@ -545,21 +535,20 @@ ktrprocexit(struct thread *td)
 }
 
 static void
-ktrprocctor_ne(struct thread *td, struct proc *p)
+ktrprocctor_entered(struct thread *td, struct proc *p)
 {
 	struct ktr_proc_ctor *ktp;
 	struct ktr_request *req;
-	struct thread *td2;
+	struct thread *td2;;
 
 	ktrace_assert(td);
 	td2 = FIRST_THREAD_IN_PROC(p);
-	req = ktr_getrequest_ne(td2, KTR_PROCCTOR);
+	req = ktr_getrequest_entered(td2, KTR_PROCCTOR);
 	if (req == NULL)
 		return;
-
 	ktp = &req->ktr_data.ktr_proc_ctor;
 	ktp->sv_flags = p->p_sysent->sv_flags;
-	ktr_submitrequest_ne(td, req);
+	ktr_enqueuerequest(td2, req);
 }
 
 void
@@ -571,7 +560,7 @@ ktrprocctor(struct proc *p)
 		return;
 
 	ktrace_enter(td);
-	ktrprocctor_ne(td, p);
+	ktrprocctor_entered(td, p);
 	ktrace_exit(td);
 }
 
@@ -721,6 +710,7 @@ ktrpsig(sig, action, mask, code)
 	sigset_t *mask;
 	int code;
 {
+	struct thread *td = curthread;
 	struct ktr_request *req;
 	struct ktr_psig	*kp;
 
@@ -732,13 +722,15 @@ ktrpsig(sig, action, mask, code)
 	kp->action = action;
 	kp->mask = *mask;
 	kp->code = code;
-	ktr_enqueuerequest(curthread, req);
+	ktr_enqueuerequest(td, req);
+	ktrace_exit(td);
 }
 
 void
 ktrcsw(out, user)
 	int out, user;
 {
+	struct thread *td = curthread;
 	struct ktr_request *req;
 	struct ktr_csw *kc;
 
@@ -748,7 +740,8 @@ ktrcsw(out, user)
 	kc = &req->ktr_data.ktr_csw;
 	kc->out = out;
 	kc->user = user;
-	ktr_enqueuerequest(curthread, req);
+	ktr_enqueuerequest(td, req);
+	ktrace_exit(td);
 }
 
 void
@@ -1021,6 +1014,8 @@ ktrops(td, p, ops, facs, vp)
 			ktr_freeproc(p, &tracecred, &tracevp);
 	}
 	mtx_unlock(&ktrace_mtx);
+	if ((p->p_traceflag & KTRFAC_MASK) != 0)
+		ktrprocctor_entered(td, p);
 	PROC_UNLOCK(p);
 	if (tracevp != NULL) {
 		int vfslocked;
@@ -1032,9 +1027,6 @@ ktrops(td, p, ops, facs, vp)
 	if (tracecred != NULL)
 		crfree(tracecred);
 
-	if ((p->p_traceflag & KTRFAC_MASK) != 0)
-		ktrprocctor_ne(td, p);
-
 	return (1);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 20:54:18 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54C0E106566B;
	Sat,  5 Mar 2011 20:54:18 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 43F498FC12;
	Sat,  5 Mar 2011 20:54:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25KsIwM075718;
	Sat, 5 Mar 2011 20:54:18 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25KsIfE075716;
	Sat, 5 Mar 2011 20:54:18 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103052054.p25KsIfE075716@svn.freebsd.org>
From: Dmitry Chagin 
Date: Sat, 5 Mar 2011 20:54:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219312 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 20:54:18 -0000

Author: dchagin
Date: Sat Mar  5 20:54:17 2011
New Revision: 219312
URL: http://svn.freebsd.org/changeset/base/219312

Log:
  Style(9) fix.
  Fix indentation in comment, double ';' in variable declaration.
  
  MFC after:	1 Week

Modified:
  head/sys/kern/kern_ktrace.c

Modified: head/sys/kern/kern_ktrace.c
==============================================================================
--- head/sys/kern/kern_ktrace.c	Sat Mar  5 20:36:42 2011	(r219311)
+++ head/sys/kern/kern_ktrace.c	Sat Mar  5 20:54:17 2011	(r219312)
@@ -111,7 +111,7 @@ static int data_lengths[] = {
 	0,					/* KTR_NAMEI */
 	sizeof(struct ktr_genio),		/* KTR_GENIO */
 	sizeof(struct ktr_psig),		/* KTR_PSIG */
-	sizeof(struct ktr_csw),		/* KTR_CSW */
+	sizeof(struct ktr_csw),			/* KTR_CSW */
 	0,					/* KTR_USER */
 	0,					/* KTR_STRUCT */
 	0,					/* KTR_SYSCTL */
@@ -539,7 +539,7 @@ ktrprocctor_entered(struct thread *td, s
 {
 	struct ktr_proc_ctor *ktp;
 	struct ktr_request *req;
-	struct thread *td2;;
+	struct thread *td2;
 
 	ktrace_assert(td);
 	td2 = FIRST_THREAD_IN_PROC(p);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 21:20:19 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D0721065673;
	Sat,  5 Mar 2011 21:20:19 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D66388FC14;
	Sat,  5 Mar 2011 21:20:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25LKIJh076541;
	Sat, 5 Mar 2011 21:20:18 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25LKI1O076538;
	Sat, 5 Mar 2011 21:20:18 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201103052120.p25LKI1O076538@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 5 Mar 2011 21:20:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219315 - in head/sys/dev/ath: . ath_hal
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 21:20:19 -0000

Author: adrian
Date: Sat Mar  5 21:20:18 2011
New Revision: 219315
URL: http://svn.freebsd.org/changeset/base/219315

Log:
  Change HALDEBUG() to be a macro that conditionally calls the debug output routine.
  
  The earlier way of doing debugging would evaluate the function parameters
  before calling the HALDEBUG. In the case of detailed register debugging
  would mean a -lot- of unneeded register IO and other stuff was going on.
  
  This method evaluates the ath_hal_debug variable before the function
  parameters are evaluated, drastically reducing the amount of overhead
  enabling HAL debugging during compilation.

Modified:
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/ath_hal/ah_internal.h

Modified: head/sys/dev/ath/ah_osdep.c
==============================================================================
--- head/sys/dev/ath/ah_osdep.c	Sat Mar  5 20:59:25 2011	(r219314)
+++ head/sys/dev/ath/ah_osdep.c	Sat Mar  5 21:20:18 2011	(r219315)
@@ -71,7 +71,7 @@ extern	void ath_hal_assert_failed(const 
 		int lineno, const char* msg);
 #endif
 #ifdef AH_DEBUG
-extern	void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...);
+extern	void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...);
 #endif /* AH_DEBUG */
 
 /* NB: put this here instead of the driver to avoid circular references */
@@ -79,7 +79,7 @@ SYSCTL_NODE(_hw, OID_AUTO, ath, CTLFLAG_
 SYSCTL_NODE(_hw_ath, OID_AUTO, hal, CTLFLAG_RD, 0, "Atheros HAL parameters");
 
 #ifdef AH_DEBUG
-static	int ath_hal_debug = 0;
+int ath_hal_debug = 0;
 SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug, CTLFLAG_RW, &ath_hal_debug,
 	    0, "Atheros HAL debugging printfs");
 TUNABLE_INT("hw.ath.hal.debug", &ath_hal_debug);
@@ -136,7 +136,7 @@ ath_hal_ether_sprintf(const u_int8_t *ma
 
 #ifdef AH_DEBUG
 void
-HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
+DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
 {
 	if (ath_hal_debug & mask) {
 		__va_list ap;

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h	Sat Mar  5 20:59:25 2011	(r219314)
+++ head/sys/dev/ath/ath_hal/ah_internal.h	Sat Mar  5 21:20:18 2011	(r219315)
@@ -501,7 +501,14 @@ extern	void ath_hal_free(void *);
 #ifdef AH_DEBUG
 #include "ah_debug.h"
 extern	int ath_hal_debug;
-extern	void HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
+#define	HALDEBUG(_ah, __m, ...) \
+	do {							\
+		if (ath_hal_debug & (__m)) {			\
+			DO_HALDEBUG((_ah), (__m), __VA_ARGS__);	\
+		}						\
+	} while(0);
+
+extern	void DO_HALDEBUG(struct ath_hal *ah, u_int mask, const char* fmt, ...)
 	__printflike(3,4);
 #else
 #define HALDEBUG(_ah, __m, _fmt, ...)

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 22:24:31 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6B55106564A;
	Sat,  5 Mar 2011 22:24:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C54C38FC1B;
	Sat,  5 Mar 2011 22:24:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25MOVhL078128;
	Sat, 5 Mar 2011 22:24:31 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25MOVXk078126;
	Sat, 5 Mar 2011 22:24:31 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103052224.p25MOVXk078126@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 5 Mar 2011 22:24:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219316 -
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 22:24:31 -0000

Author: pjd
Date: Sat Mar  5 22:24:31 2011
New Revision: 219316
URL: http://svn.freebsd.org/changeset/base/219316

Log:
  Simplify zvol_remove_minors() a bit.
  
  MFC after:	1 month

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Mar  5 21:20:18 2011	(r219315)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Mar  5 22:24:31 2011	(r219316)
@@ -753,14 +753,13 @@ zvol_update_volsize(objset_t *os, uint64
 void
 zvol_remove_minors(const char *name)
 {
-	struct g_provider *pp, *pptmp;
 	struct g_geom *gp, *gptmp;
+	struct g_provider *pp;
 	zvol_state_t *zv;
-	char *namebuf;
+	size_t namelen;
+
+	namelen = strlen(name);
 
-	namebuf = kmem_zalloc(strlen(name) + 2, KM_SLEEP);
-	(void) strncpy(namebuf, name, strlen(name));
-	(void) strcat(namebuf, "/");
 	DROP_GIANT();
 	mutex_enter(&zfsdev_state_lock);
 	g_topology_lock();
@@ -772,10 +771,12 @@ zvol_remove_minors(const char *name)
 		zv = pp->private;
 		if (zv == NULL)
 			continue;
-		if (strncmp(namebuf, zv->zv_name, strlen(namebuf)) == 0)
+		if (strcmp(zv->zv_name, name) == 0 ||
+		    (strncmp(zv->zv_name, name, namelen) == 0 &&
+		     zv->zv_name[namelen] == '/')) {
 			(void) zvol_remove_zv(zv);
+		}
 	}
-	kmem_free(namebuf, strlen(name) + 2);
 
 	g_topology_unlock();
 	mutex_exit(&zfsdev_state_lock);

From owner-svn-src-head@FreeBSD.ORG  Sat Mar  5 22:31:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C04721065670;
	Sat,  5 Mar 2011 22:31:03 +0000 (UTC) (envelope-from pjd@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ADBC18FC12;
	Sat,  5 Mar 2011 22:31:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p25MV3QA078299;
	Sat, 5 Mar 2011 22:31:03 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25MV3fd078293;
	Sat, 5 Mar 2011 22:31:03 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201103052231.p25MV3fd078293@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Sat, 5 Mar 2011 22:31:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219317 - in
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 22:31:03 -0000

Author: pjd
Date: Sat Mar  5 22:31:03 2011
New Revision: 219317
URL: http://svn.freebsd.org/changeset/base/219317

Log:
  Make renaming of a ZVOL, ZVOL's parent directory and ZVOL snapshot work.
  
  Reported by:	avg
  MFC after:	1 month

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Sat Mar  5 22:24:31 2011	(r219316)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c	Sat Mar  5 22:31:03 2011	(r219317)
@@ -2312,6 +2312,7 @@ dsl_dataset_snapshot_rename_check(void *
 static void
 dsl_dataset_snapshot_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx)
 {
+	char oldname[MAXPATHLEN], newname[MAXPATHLEN];
 	dsl_dataset_t *ds = arg1;
 	const char *newsnapname = arg2;
 	dsl_dir_t *dd = ds->ds_dir;
@@ -2327,12 +2328,15 @@ dsl_dataset_snapshot_rename_sync(void *a
 	VERIFY(0 == dsl_dataset_get_snapname(ds));
 	err = dsl_dataset_snap_remove(hds, ds->ds_snapname, tx);
 	ASSERT3U(err, ==, 0);
+	dsl_dataset_name(ds, oldname);
 	mutex_enter(&ds->ds_lock);
 	(void) strcpy(ds->ds_snapname, newsnapname);
 	mutex_exit(&ds->ds_lock);
 	err = zap_add(mos, hds->ds_phys->ds_snapnames_zapobj,
 	    ds->ds_snapname, 8, 1, &ds->ds_object, tx);
 	ASSERT3U(err, ==, 0);
+	dsl_dataset_name(ds, newname);
+	zvol_rename_minors(oldname, newname);
 
 	spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa, tx,
 	    "dataset = %llu", ds->ds_object);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Sat Mar  5 22:24:31 2011	(r219316)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c	Sat Mar  5 22:31:03 2011	(r219317)
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "zfs_namecheck.h"
 
 static uint64_t dsl_dir_space_towrite(dsl_dir_t *dd);
@@ -1294,6 +1295,7 @@ dsl_dir_rename_check(void *arg1, void *a
 static void
 dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx)
 {
+	char oldname[MAXPATHLEN], newname[MAXPATHLEN];
 	dsl_dir_t *dd = arg1;
 	struct renamearg *ra = arg2;
 	dsl_pool_t *dp = dd->dd_pool;
@@ -1326,6 +1328,7 @@ dsl_dir_rename_sync(void *arg1, void *ar
 	dmu_buf_will_dirty(dd->dd_dbuf, tx);
 
 	/* remove from old parent zapobj */
+	dsl_dir_name(dd, oldname);
 	err = zap_remove(mos, dd->dd_parent->dd_phys->dd_child_dir_zapobj,
 	    dd->dd_myname, tx);
 	ASSERT3U(err, ==, 0);
@@ -1340,6 +1343,8 @@ dsl_dir_rename_sync(void *arg1, void *ar
 	err = zap_add(mos, ra->newparent->dd_phys->dd_child_dir_zapobj,
 	    dd->dd_myname, 8, 1, &dd->dd_object, tx);
 	ASSERT3U(err, ==, 0);
+	dsl_dir_name(dd, newname);
+	zvol_rename_minors(oldname, newname);
 
 	spa_history_log_internal(LOG_DS_RENAME, dd->dd_pool->dp_spa,
 	    tx, "dataset = %llu", dd->dd_phys->dd_head_dataset_obj);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h	Sat Mar  5 22:24:31 2011	(r219316)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h	Sat Mar  5 22:31:03 2011	(r219317)
@@ -73,6 +73,7 @@ extern void zvol_log_write_minor(void *m
 
 #ifdef __FreeBSD__
 extern int zvol_create_minors(const char *name);
+extern void zvol_rename_minors(const char *oldname, const char *newname);
 #endif
 
 #endif

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Mar  5 22:24:31 2011	(r219316)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c	Sat Mar  5 22:31:03 2011	(r219317)
@@ -3271,8 +3271,6 @@ zfs_ioc_rename(zfs_cmd_t *zc)
 		if (err)
 			return (err);
 	}
-	if (zc->zc_objset_type == DMU_OST_ZVOL)
-		(void) zvol_remove_minor(zc->zc_name);
 	return (dmu_objset_rename(zc->zc_name, zc->zc_value, recursive));
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Mar  5 22:24:31 2011	(r219316)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c	Sat Mar  5 22:31:03 2011	(r219317)
@@ -2223,3 +2223,70 @@ zvol_create_minors(const char *name)
 	kmem_free(osname, MAXPATHLEN);
 	return (0);
 }
+
+static void
+zvol_rename_minor(struct g_geom *gp, const char *newname)
+{
+	struct g_provider *pp;
+	zvol_state_t *zv;
+
+	ASSERT(MUTEX_HELD(&zfsdev_state_lock));
+	g_topology_assert();
+
+	pp = LIST_FIRST(&gp->provider);
+	ASSERT(pp != NULL);
+	zv = pp->private;
+	ASSERT(zv != NULL);
+
+	zv->zv_provider = NULL;
+	g_wither_provider(pp, ENXIO);
+
+	pp = g_new_providerf(gp, "%s/%s", ZVOL_DRIVER, newname);
+	pp->sectorsize = DEV_BSIZE;
+	pp->mediasize = zv->zv_volsize;
+	pp->private = zv;
+	zv->zv_provider = pp;
+	strlcpy(zv->zv_name, newname, sizeof(zv->zv_name));
+	g_error_provider(pp, 0);
+}
+
+void
+zvol_rename_minors(const char *oldname, const char *newname)
+{
+	char name[MAXPATHLEN];
+	struct g_provider *pp;
+	struct g_geom *gp;
+	size_t oldnamelen, newnamelen;
+	zvol_state_t *zv;
+	char *namebuf;
+
+	oldnamelen = strlen(oldname);
+	newnamelen = strlen(newname);
+
+	DROP_GIANT();
+	mutex_enter(&zfsdev_state_lock);
+	g_topology_lock();
+
+	LIST_FOREACH(gp, &zfs_zvol_class.geom, geom) {
+		pp = LIST_FIRST(&gp->provider);
+		if (pp == NULL)
+			continue;
+		zv = pp->private;
+		if (zv == NULL)
+			continue;
+		if (strcmp(zv->zv_name, oldname) == 0) {
+			zvol_rename_minor(gp, newname);
+		} else if (strncmp(zv->zv_name, oldname, oldnamelen) == 0 &&
+		    (zv->zv_name[oldnamelen] == '/' ||
+		     zv->zv_name[oldnamelen] == '@')) {
+			snprintf(name, sizeof(name), "%s%c%s", newname,
+			    zv->zv_name[oldnamelen],
+			    zv->zv_name + oldnamelen + 1);
+			zvol_rename_minor(gp, name);
+		}
+	}
+
+	g_topology_unlock();
+	mutex_exit(&zfsdev_state_lock);
+	PICKUP_GIANT();
+}