From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 00:02:49 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 01:32:11 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 01:45:37 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 02:06:09 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 03:04:04 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 09:12:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2749106564A; Sun, 27 Feb 2011 09:12:24 +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 DF2458FC25; Sun, 27 Feb 2011 09:12: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 p1R9COBN063612; Sun, 27 Feb 2011 09:12:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1R9COAT063609; Sun, 27 Feb 2011 09:12:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201102270912.p1R9COAT063609@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 27 Feb 2011 09:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219080 - in stable/8: include share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 09:12:25 -0000 Author: kib Date: Sun Feb 27 09:12:24 2011 New Revision: 219080 URL: http://svn.freebsd.org/changeset/base/219080 Log: MFC r218881: Add restrict keyword to pthread_sigmask prototype and manpage. Modified: stable/8/include/signal.h stable/8/share/man/man3/pthread_sigmask.3 Directory Properties: stable/8/include/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/8/include/signal.h ============================================================================== --- stable/8/include/signal.h Sun Feb 27 02:06:09 2011 (r219079) +++ stable/8/include/signal.h Sun Feb 27 09:12:24 2011 (r219080) @@ -73,7 +73,8 @@ int raise(int); #if __POSIX_VISIBLE || __XSI_VISIBLE int kill(__pid_t, int); int pthread_kill(__pthread_t, int); -int pthread_sigmask(int, const __sigset_t *, __sigset_t *); +int pthread_sigmask(int, const __sigset_t * __restrict, + __sigset_t * __restrict); int sigaction(int, const struct sigaction * __restrict, struct sigaction * __restrict); int sigaddset(sigset_t *, int); Modified: stable/8/share/man/man3/pthread_sigmask.3 ============================================================================== --- stable/8/share/man/man3/pthread_sigmask.3 Sun Feb 27 02:06:09 2011 (r219079) +++ stable/8/share/man/man3/pthread_sigmask.3 Sun Feb 27 09:12:24 2011 (r219080) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 27, 2000 +.Dd February 19, 2011 .Dt PTHREAD_SIGMASK 3 .Os .Sh NAME @@ -38,7 +38,8 @@ .In pthread.h .In signal.h .Ft int -.Fn pthread_sigmask "int how" "const sigset_t *set" "sigset_t *oset" +.Fn pthread_sigmask "int how" "const sigset_t * restrict set" \ + "sigset_t * restrict oset" .Sh DESCRIPTION The .Fn pthread_sigmask From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 09:47:10 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 10:13:17 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 11:40:20 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 11:49:53 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 12:12:16 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 12:25:47 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 12:28:06 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 12:42:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1406C106566C for ; Sun, 27 Feb 2011 12:42:26 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.161]) by mx1.freebsd.org (Postfix) with ESMTP id A38B58FC0A for ; Sun, 27 Feb 2011 12:42:25 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/YPAwti93leOoBiEJZ3s= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (dslb-088-072-224-251.pools.arcor-ip.net [88.72.224.251]) by post.strato.de (cohen mo43) (RZmta 25.5) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id Q05ef3n1RCEA09 for ; Sun, 27 Feb 2011 13:30:58 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 27 Feb 2011 13:30:58 +0100 Date: Sun, 27 Feb 2011 13:30:58 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20110227123058.GA9092@britannica.bec.de> References: <201102271228.p1RCS6qG087131@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102271228.p1RCS6qG087131@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: svn commit: r219084 - in head: bin/test tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 12:42:26 -0000 On Sun, Feb 27, 2011 at 12:28:06PM +0000, Xin LI wrote: > 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. It is not a popular GNU extension. It is crap only bash supports. Do you really want to encourage that? Joerg From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 13:19:10 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 13:58:20 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 14:24:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73F9110656A4 for ; Sun, 27 Feb 2011 14:24:38 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2FA748FC14 for ; Sun, 27 Feb 2011 14:24:37 +0000 (UTC) Received: from c83-255-51-20.bredband.comhem.se ([83.255.51.20]:25493 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.73) (envelope-from ) id 1PthLd-00008C-3a for svn-src-all@freebsd.org; Sun, 27 Feb 2011 15:11:46 +0100 Received: (qmail 98293 invoked from network); 27 Feb 2011 15:11:43 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 27 Feb 2011 15:11:43 +0100 Received: (qmail 11904 invoked by uid 1001); 27 Feb 2011 15:11:43 +0100 Date: Sun, 27 Feb 2011 15:11:43 +0100 From: Erik Trulsson To: Joerg Sonnenberger Message-ID: <20110227141143.GA11874@owl.midgard.homeip.net> References: <201102271228.p1RCS6qG087131@svn.freebsd.org> <20110227123058.GA9092@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110227123058.GA9092@britannica.bec.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.51.20 X-Scan-Result: No virus found in message 1PthLd-00008C-3a. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1PthLd-00008C-3a eead2d81cc3d9c13df8b70eaf9d52dc8 Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r219084 - in head: bin/test tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 14:24:38 -0000 On Sun, Feb 27, 2011 at 01:30:58PM +0100, Joerg Sonnenberger wrote: > On Sun, Feb 27, 2011 at 12:28:06PM +0000, Xin LI wrote: > > 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. > > It is not a popular GNU extension. It is crap only bash supports. > Do you really want to encourage that? In what way is it 'crap', and in what way would adding support for it be a problem? -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 14:30:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0385D1065673 for ; Sun, 27 Feb 2011 14:30:15 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob.rzone.de (mo-p00-ob.rzone.de [81.169.146.160]) by mx1.freebsd.org (Postfix) with ESMTP id 90D148FC16 for ; Sun, 27 Feb 2011 14:30:14 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/YPAwti93leOoBiEJZ3s= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de (dslb-088-072-224-251.pools.arcor-ip.net [88.72.224.251]) by post.strato.de (klopstock mo59) (RZmta 25.5) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id g0649en1RCr6fA for ; Sun, 27 Feb 2011 15:29:31 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Sun, 27 Feb 2011 15:29:10 +0100 Date: Sun, 27 Feb 2011 15:29:10 +0100 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20110227142910.GA13518@britannica.bec.de> References: <201102271228.p1RCS6qG087131@svn.freebsd.org> <20110227123058.GA9092@britannica.bec.de> <20110227141143.GA11874@owl.midgard.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110227141143.GA11874@owl.midgard.homeip.net> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: svn commit: r219084 - in head: bin/test tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 14:30:15 -0000 On Sun, Feb 27, 2011 at 03:11:43PM +0100, Erik Trulsson wrote: > On Sun, Feb 27, 2011 at 01:30:58PM +0100, Joerg Sonnenberger wrote: > > On Sun, Feb 27, 2011 at 12:28:06PM +0000, Xin LI wrote: > > > 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. > > > > It is not a popular GNU extension. It is crap only bash supports. > > Do you really want to encourage that? > > In what way is it 'crap', and in what way would adding support for it > be a problem? It is completely redundant and inconsistent with pretty much every other test(1) implementation. E.g. it isn't even supported by /bin/test from coretutils. The very presence of this in various shell scripts is a direct result of silently accepting it in bash, even in sh mode. This is just further encouragement to legalize it. Joerg From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 15:48:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA89E106564A for ; Sun, 27 Feb 2011 15:48:14 +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 8DD2F8FC14 for ; Sun, 27 Feb 2011 15:48:14 +0000 (UTC) Received: from outgoing.leidinger.net (p5B32E670.dip.t-dialin.net [91.50.230.112]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id CC2F784400D; Sun, 27 Feb 2011 16:30:32 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id 97E802F25; Sun, 27 Feb 2011 16:30:29 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p1RFUEuI064748; Sun, 27 Feb 2011 16:30:14 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from p5DD458EC.dip.t-dialin.net (p5DD458EC.dip.t-dialin.net [93.212.88.236]) by webmail.leidinger.net (Horde Framework) with HTTP; Sun, 27 Feb 2011 16:30:13 +0100 Message-ID: <20110227163013.67016iavb4r2trgo@webmail.leidinger.net> Date: Sun, 27 Feb 2011 16:30:13 +0100 From: Alexander Leidinger To: Joerg Sonnenberger References: <201102271228.p1RCS6qG087131@svn.freebsd.org> <20110227123058.GA9092@britannica.bec.de> <20110227141143.GA11874@owl.midgard.homeip.net> <20110227142910.GA13518@britannica.bec.de> In-Reply-To: <20110227142910.GA13518@britannica.bec.de> 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: CC2F784400D.A43C7 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: 1299425436.77492@VPQizMNDahcBdd33w45+Xw X-EBL-Spam-Status: No Cc: svn-src-all@freebsd.org Subject: Re: svn commit: r219084 - in head: bin/test tools/regression/bin/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 15:48:16 -0000 Quoting Joerg Sonnenberger (from Sun, 27 Feb 2011 15:29:10 +0100): > On Sun, Feb 27, 2011 at 03:11:43PM +0100, Erik Trulsson wrote: >> On Sun, Feb 27, 2011 at 01:30:58PM +0100, Joerg Sonnenberger wrote: >> > On Sun, Feb 27, 2011 at 12:28:06PM +0000, Xin LI wrote: >> > > 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. >> > >> > It is not a popular GNU extension. It is crap only bash supports. >> > Do you really want to encourage that? >> >> In what way is it 'crap', and in what way would adding support for it >> be a problem? > > It is completely redundant and inconsistent with pretty much every other > test(1) implementation. E.g. it isn't even supported by /bin/test from > coretutils. The very presence of this in various shell scripts is a > direct result of silently accepting it in bash, even in sh mode. This is > just further encouragement to legalize it. For your info, at work we got a script (for Solaris) which had a mix of = and == (and [ ] and [[ ]]) as a delivery of some software. Needless to say it didn't work as expected. I also think that adding support for == encourages bad scripts. Bye, Alexander. -- 10.0 times 0.1 is hardly ever 1.0. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 17:14:07 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 17:30:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5AE1065677; Sun, 27 Feb 2011 17:30:45 +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 B9A9E8FC15; Sun, 27 Feb 2011 17:30: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 p1RHUjjD096316; Sun, 27 Feb 2011 17:30:45 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RHUjc3096314; Sun, 27 Feb 2011 17:30:45 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201102271730.p1RHUjc3096314@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Feb 2011 17:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219087 - stable/8/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 17:30:45 -0000 Author: gjb (doc committer) Date: Sun Feb 27 17:30:45 2011 New Revision: 219087 URL: http://svn.freebsd.org/changeset/base/219087 Log: MFC 212498: Rewording and typo fixes in newfs(8). PR: 150490 Modified: stable/8/sbin/newfs/newfs.8 Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.8 ============================================================================== --- stable/8/sbin/newfs/newfs.8 Sun Feb 27 17:14:06 2011 (r219086) +++ stable/8/sbin/newfs/newfs.8 Sun Feb 27 17:30:45 2011 (r219087) @@ -79,10 +79,10 @@ The following options define the general Erase the content of the disk before making the filesystem. The reserved area in front of the superblock (for bootcode) will not be erased. -This is a relevant option for flash based storage devices that use -wear levelling algorithms. +This option is only relevant for flash based storage devices that use +wear-leveling algorithms. -NB: Erasing may take as long time as writing every sector on the disk. +Erasing may take a long time as it writes to every sector on the disk. .It Fl J Enable journaling on the new file system via gjournal. See From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 18:23:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05C11065675; Sun, 27 Feb 2011 18:23:28 +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 AE9B88FC21; Sun, 27 Feb 2011 18:23: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 p1RINSsg098052; Sun, 27 Feb 2011 18:23:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1RINS5l098050; Sun, 27 Feb 2011 18:23:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201102271823.p1RINS5l098050@svn.freebsd.org> From: Glen Barber Date: Sun, 27 Feb 2011 18:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219088 - stable/8/sbin/quotacheck X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Feb 2011 18:23:28 -0000 Author: gjb (doc committer) Date: Sun Feb 27 18:23:28 2011 New Revision: 219088 URL: http://svn.freebsd.org/changeset/base/219088 Log: MFC 205076 [1]: Fix reference to fsck(8). PR: 154215 Submitted by: Mats Erik Andersson (debian of gisladisker se) Obtained from: uqs [1] Modified: stable/8/sbin/quotacheck/quotacheck.8 Directory Properties: stable/8/sbin/quotacheck/ (props changed) Modified: stable/8/sbin/quotacheck/quotacheck.8 ============================================================================== --- stable/8/sbin/quotacheck/quotacheck.8 Sun Feb 27 17:30:45 2011 (r219087) +++ stable/8/sbin/quotacheck/quotacheck.8 Sun Feb 27 18:23:28 2011 (r219088) @@ -82,7 +82,7 @@ is zero, parallel passes are run as per .Xr fsck 8 . This option is deprecated and parallel passes are always run as per -.Xf fsck 8. +.Xr fsck 8 . .It Fl u Only user quotas listed in .Pa /etc/fstab From owner-svn-src-all@FreeBSD.ORG Sun Feb 27 19:41:41 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 19:44:10 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 21:32:26 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 21:41:12 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Feb 27 22:53:17 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 05:45:31 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 06:54:15 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 07:52:12 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 07:56:07 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: versus@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 08:59:35 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 09:11:46 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 10:03:49 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 13:38:40 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 13:38:41 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 14:47:25 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 14:48:00 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 15:25:39 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 15:26:43 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 15:58:30 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 16:06:23 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 16:39:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3900C1065672; Mon, 28 Feb 2011 16:39:16 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D83F8FC23; Mon, 28 Feb 2011 16:39: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 p1SGdGfN045492; Mon, 28 Feb 2011 16:39:16 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SGdFPf045488; Mon, 28 Feb 2011 16:39:15 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201102281639.p1SGdFPf045488@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 28 Feb 2011 16:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219099 - stable/8/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 16:39:16 -0000 Author: ken Date: Mon Feb 28 16:39:15 2011 New Revision: 219099 URL: http://svn.freebsd.org/changeset/base/219099 Log: MFC: r219036 Silence 'out of chain frames' warnings and bump the number of frames. mps.c: Hide the 'out of chain frames' warning behind MPS_INFO. mps_sas.c: Hide the SIM queue freeze/unfreeze messages behind MPS_INFO. mpsvar.h: Bump the number of chain frames from 1024 to 2048. From testing, it looks like this makes it less likely that we'll run out of chain frames, and it doesn't cost much memory (32K). Modified: stable/8/sys/dev/mps/mps.c stable/8/sys/dev/mps/mps_sas.c stable/8/sys/dev/mps/mpsvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mps/mps.c ============================================================================== --- stable/8/sys/dev/mps/mps.c Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mps.c Mon Feb 28 16:39:15 2011 (r219099) @@ -1705,7 +1705,7 @@ mps_data_cb(void *arg, bus_dma_segment_t sflags, nsegs - i); if (error != 0) { /* Resource shortage, roll back! */ - mps_printf(sc, "out of chain frames\n"); + mps_dprint(sc, MPS_INFO, "out of chain frames\n"); cm->cm_flags |= MPS_CM_FLAGS_CHAIN_FAILED; mps_complete_command(cm); return; Modified: stable/8/sys/dev/mps/mps_sas.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas.c Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mps_sas.c Mon Feb 28 16:39:15 2011 (r219099) @@ -1542,8 +1542,8 @@ mpssas_scsiio_complete(struct mps_softc if ((sassc->flags & MPSSAS_QUEUE_FROZEN) == 0) { xpt_freeze_simq(sassc->sim, 1); sassc->flags |= MPSSAS_QUEUE_FROZEN; - mps_printf(sc, "Error sending command, freezing " - "SIM queue\n"); + mps_dprint(sc, MPS_INFO, "Error sending command, " + "freezing SIM queue\n"); } } @@ -1556,7 +1556,8 @@ mpssas_scsiio_complete(struct mps_softc if (sassc->flags & MPSSAS_QUEUE_FROZEN) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; sassc->flags &= ~MPSSAS_QUEUE_FROZEN; - mps_printf(sc, "Unfreezing SIM queue\n"); + mps_dprint(sc, MPS_INFO, + "Unfreezing SIM queue\n"); } } else { ccb->ccb_h.status |= CAM_DEV_QFRZN; Modified: stable/8/sys/dev/mps/mpsvar.h ============================================================================== --- stable/8/sys/dev/mps/mpsvar.h Mon Feb 28 15:58:30 2011 (r219098) +++ stable/8/sys/dev/mps/mpsvar.h Mon Feb 28 16:39:15 2011 (r219099) @@ -34,7 +34,7 @@ #define MPS_REQ_FRAMES 1024 #define MPS_EVT_REPLY_FRAMES 32 #define MPS_REPLY_FRAMES MPS_REQ_FRAMES -#define MPS_CHAIN_FRAMES 1024 +#define MPS_CHAIN_FRAMES 2048 #define MPS_SENSE_LEN SSD_FULL_SIZE #define MPS_MSI_COUNT 1 #define MPS_SGE64_SIZE 12 From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 17:23:16 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 18:53:07 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 20:37:48 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 20:55:41 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 21:21:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 567AF1065674; Mon, 28 Feb 2011 21:21:25 +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 4429F8FC14; Mon, 28 Feb 2011 21:21: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 p1SLLPvE052215; Mon, 28 Feb 2011 21:21:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SLLPNK052212; Mon, 28 Feb 2011 21:21:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282121.p1SLLPNK052212@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 21:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219104 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 21:21:25 -0000 Author: yongari Date: Mon Feb 28 21:21:24 2011 New Revision: 219104 URL: http://svn.freebsd.org/changeset/base/219104 Log: MFC r217857: Prefer MSI-X to MSI on controllers that support MSI-X. All recent PCIe controllers(RTL8102E or later and RTL8168/8111C or later) supports either 2 or 4 MSI-X messages. Unfortunately vendor did not publicly release RSS related information yet. However switching to MSI-X is one-step forward to support RSS. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 20:55:41 2011 (r219103) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 21:21:24 2011 (r219104) @@ -159,6 +159,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int msix_disable = 0; +TUNABLE_INT("hw.re.msix_disable", &msix_disable); static int prefer_iomap = 0; TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); @@ -1176,7 +1178,7 @@ re_attach(device_t dev) int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; - int msic, reg; + int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1226,18 +1228,51 @@ re_attach(device_t dev) sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - msic = 0; - if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + msic = pci_msi_count(dev); + msixc = pci_msix_count(dev); + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) sc->rl_flags |= RL_FLAG_PCIE; - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + if (bootverbose) { + device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI-X count : %d\n", msixc); + } + if (msix_disable > 0) + msixc = 0; + if (msi_disable > 0) + msic = 0; + /* Prefer MSI-X to MSI. */ + if (msixc > 0) { + msixc = 1; + rid = PCIR_BAR(4); + sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->rl_res_pba == NULL) { + device_printf(sc->rl_dev, + "could not allocate MSI-X PBA resource\n"); + } + if (sc->rl_res_pba != NULL && + pci_alloc_msix(dev, &msixc) == 0) { + if (msixc == 1) { + device_printf(dev, "Using %d MSI-X message\n", + msixc); + sc->rl_flags |= RL_FLAG_MSIX; + } else + pci_release_msi(dev); + } + if ((sc->rl_flags & RL_FLAG_MSIX) == 0) { + if (sc->rl_res_pba != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->rl_res_pba); + sc->rl_res_pba = NULL; + msixc = 0; + } } - if (msic > 0 && msi_disable == 0) { + /* Prefer MSI to INTx. */ + if (msixc == 0 && msic > 0) { msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { - device_printf(dev, "Using %d MSI messages\n", + device_printf(dev, "Using %d MSI message\n", msic); sc->rl_flags |= RL_FLAG_MSI; /* Explicitly set MSI enable bit. */ @@ -1249,10 +1284,12 @@ re_attach(device_t dev) } else pci_release_msi(dev); } + if ((sc->rl_flags & RL_FLAG_MSI) == 0) + msic = 0; } /* Allocate interrupt */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { rid = 0; sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -1539,7 +1576,7 @@ re_attach(device_t dev) #endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); @@ -1631,7 +1668,7 @@ re_detach(device_t dev) } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { if (sc->rl_irq[0] != NULL) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); @@ -1647,6 +1684,10 @@ re_detach(device_t dev) } pci_release_msi(dev); } + if (sc->rl_res_pba) { + rid = PCIR_BAR(4); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); + } if (sc->rl_res) bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, sc->rl_res); Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 20:55:41 2011 (r219103) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 21:21:24 2011 (r219104) @@ -864,6 +864,7 @@ struct rl_softc { struct resource *rl_res; int rl_res_id; int rl_res_type; + struct resource *rl_res_pba; struct resource *rl_irq[RL_MSI_MESSAGES]; void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; @@ -908,6 +909,7 @@ struct rl_softc { #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_MACRESET 0x0400 +#define RL_FLAG_MSIX 0x0800 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 21:25:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD5CF106564A; Mon, 28 Feb 2011 21:25:35 +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 9AF3F8FC0A; Mon, 28 Feb 2011 21:25: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 p1SLPZqO052354; Mon, 28 Feb 2011 21:25:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SLPZhx052351; Mon, 28 Feb 2011 21:25:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282125.p1SLPZhx052351@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 21:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219105 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 21:25:35 -0000 Author: yongari Date: Mon Feb 28 21:25:35 2011 New Revision: 219105 URL: http://svn.freebsd.org/changeset/base/219105 Log: MFC r217857: Prefer MSI-X to MSI on controllers that support MSI-X. All recent PCIe controllers(RTL8102E or later and RTL8168/8111C or later) supports either 2 or 4 MSI-X messages. Unfortunately vendor did not publicly release RSS related information yet. However switching to MSI-X is one-step forward to support RSS. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 21:21:24 2011 (r219104) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 21:25:35 2011 (r219105) @@ -159,6 +159,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int msix_disable = 0; +TUNABLE_INT("hw.re.msix_disable", &msix_disable); static int prefer_iomap = 0; TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); @@ -1177,7 +1179,7 @@ re_attach(device_t dev) int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; - int msic, reg; + int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1227,18 +1229,51 @@ re_attach(device_t dev) sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - msic = 0; - if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + msic = pci_msi_count(dev); + msixc = pci_msix_count(dev); + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) sc->rl_flags |= RL_FLAG_PCIE; - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + if (bootverbose) { + device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI-X count : %d\n", msixc); + } + if (msix_disable > 0) + msixc = 0; + if (msi_disable > 0) + msic = 0; + /* Prefer MSI-X to MSI. */ + if (msixc > 0) { + msixc = 1; + rid = PCIR_BAR(4); + sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->rl_res_pba == NULL) { + device_printf(sc->rl_dev, + "could not allocate MSI-X PBA resource\n"); + } + if (sc->rl_res_pba != NULL && + pci_alloc_msix(dev, &msixc) == 0) { + if (msixc == 1) { + device_printf(dev, "Using %d MSI-X message\n", + msixc); + sc->rl_flags |= RL_FLAG_MSIX; + } else + pci_release_msi(dev); + } + if ((sc->rl_flags & RL_FLAG_MSIX) == 0) { + if (sc->rl_res_pba != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->rl_res_pba); + sc->rl_res_pba = NULL; + msixc = 0; + } } - if (msic > 0 && msi_disable == 0) { + /* Prefer MSI to INTx. */ + if (msixc == 0 && msic > 0) { msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { - device_printf(dev, "Using %d MSI messages\n", + device_printf(dev, "Using %d MSI message\n", msic); sc->rl_flags |= RL_FLAG_MSI; /* Explicitly set MSI enable bit. */ @@ -1250,10 +1285,12 @@ re_attach(device_t dev) } else pci_release_msi(dev); } + if ((sc->rl_flags & RL_FLAG_MSI) == 0) + msic = 0; } /* Allocate interrupt */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { rid = 0; sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -1540,7 +1577,7 @@ re_attach(device_t dev) #endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); @@ -1632,7 +1669,7 @@ re_detach(device_t dev) } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { if (sc->rl_irq[0] != NULL) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); @@ -1648,6 +1685,10 @@ re_detach(device_t dev) } pci_release_msi(dev); } + if (sc->rl_res_pba) { + rid = PCIR_BAR(4); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); + } if (sc->rl_res) bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, sc->rl_res); Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 21:21:24 2011 (r219104) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 21:25:35 2011 (r219105) @@ -864,6 +864,7 @@ struct rl_softc { struct resource *rl_res; int rl_res_id; int rl_res_type; + struct resource *rl_res_pba; struct resource *rl_irq[RL_MSI_MESSAGES]; void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; @@ -908,6 +909,7 @@ struct rl_softc { #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_MACRESET 0x0400 +#define RL_FLAG_MSIX 0x0800 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 21:33:27 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Feb 28 23:28:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A376106564A; Mon, 28 Feb 2011 23:28:36 +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 242698FC08; Mon, 28 Feb 2011 23:28: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 p1SNSa27059970; Mon, 28 Feb 2011 23:28:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNSZZK059958; Mon, 28 Feb 2011 23:28:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201102282328.p1SNSZZK059958@svn.freebsd.org> From: Robert Watson Date: Mon, 28 Feb 2011 23:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:28:36 -0000 Author: rwatson Date: Mon Feb 28 23:28:35 2011 New Revision: 219107 URL: http://svn.freebsd.org/changeset/base/219107 Log: Merge userspace DTrace support from head to stable/8: r209721: Merge from vendor-sys/opensolaris: * add fasttrap files r209731: Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the user segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib r209763: Fix style issues with the previous commit, namely use-tab-instead-of-space and don't use underscores in macro variables. Pointed out by: bde r210292: Fix typo in comment. r210357: MFamd64: Add USD_GETBASE(), USD_SETBASE(), USD_GETLIMIT() and USD_SETLIMIT(). r210611: Bump the witness pendlist to 768 to accomodate the increased number of spinlocks. r211553: Add sysname to struct opensolaris_utsname. This is needed by one DTrace test. r211566: Add a sysname char * to struct opensolaris_utsname. r211606: Add the FreeBSD definition for the fasttrap ioctls. r211607: Add a function compatibility function dtrace_instr_size_isa() that on FreeBSD does the same as dtrace_dis_isize(). r211608: Kernel DTrace support for: o uregs (sson@) o ustack (sson@) o /dev/dtrace/helper device (needed for USDT probes) r211610: Add more compatibility structure members needed by the upcoming fasttrap DTrace device. r211611: Destroy the helper device when unloading. r211613: Fix style issues. r211614: Bump KDTRACE_THREAD_ZERO and use M_ZERO as a malloc flag instead of calling bzero. r211615: Remove an elif and add an or-clause. r211616: Add an extra comment to the SDT probes definition. This allows us to get use '-' in probe names, matching the probe names in Solaris. Add userland SDT probes definitions to sys/sdt.h. r211617: Call the systrace_probe_func() when the error value. r211618: Port this to FreeBSD. We miss some suword functions, so we use copyout. r211738: Port the fasttrap provider to FreeBSD. This provider is responsible for injecting debugging probes in the userland programs and is the basis for the pid provider and the usdt provider. r211744: MD fasttrap implementation. r211745: Replace a pksignal() call with tdksignal(). Pointed out by: kib r211746: Update for the recent location of the fasttrap code. r211747: Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb r211751: Add a trap code for DTrace induced traps. r211752: Add two DTrace trap type values. Used by fasttrap. r211753: Enable fasttrap and make dtraceall depend on fasttrap when building i386 or amd64. r211804: Call the necessary DTrace function pointers when we have different kinds of traps. r211813: Add the necessary DTrace function pointers. r211839: Sync DTrace bits with amd64 and fix the build. r211924: Register an interrupt vector for DTrace return probes. There is some code missing in lapic to make sure that we don't overwrite this entry, but this will be done on a sequent commit. r211925: Replace a memory barrier with a mutex barrier. r211926: Add the path necessary to find fasttrap_isa.h to CFLAGS. r211929: Remove debugging. r212004: When DTrace is enabled, make sure we don't overwrite the IDT_DTRACE_RET entry with an IRQ for some hardware component. Reviewed by: jhb r212093: Make the /dev/dtrace/helper node have the mode 0660. This allows programs that refuse to run as root (pgsql) to install probes when their user is part of the wheel group. r212357: Fix two bugs in DTrace: * when the process exits, remove the associated USDT probes * when the process forks, duplicate the USDT probes. r212465: Avoid a LOR (sleepable after non-sleepable) in fasttrap_tracepoint_enable(). r212494: Revamp locking a bit. This fixes three problems: * processes now can't go away while we are inserting probes (fixes a panic) * if a trap happens, we won't be holding the process lock (fixes a hang) * fix a LOR between the process lock and the fasttrap bucket list lock Thanks to kib for pointing some problems. r212568: Bump __FreeBSD_version to reflect the userland DTrace changes Sponsored by: The FreeBSD Foundation Userspace DTrace work by: rpaulo Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h - copied, changed from r209721, head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/ - copied from r209721, head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/ stable/8/sys/cddl/contrib/opensolaris/uts/sparc/dtrace/ - copied from r209721, head/sys/cddl/contrib/opensolaris/uts/sparc/dtrace/ stable/8/sys/cddl/dev/dtrace/amd64/regset.h - copied unchanged from r211608, head/sys/cddl/dev/dtrace/amd64/regset.h stable/8/sys/cddl/dev/dtrace/i386/regset.h - copied unchanged from r211608, head/sys/cddl/dev/dtrace/i386/regset.h Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/amd64/amd64/machdep.c stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/include/segments.h stable/8/sys/amd64/include/trap.h stable/8/sys/boot/common/ufsread.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c stable/8/sys/cddl/compat/opensolaris/sys/misc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h stable/8/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/8/sys/cddl/dev/dtrace/amd64/instr_size.c stable/8/sys/cddl/dev/dtrace/dtrace_cddl.h stable/8/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/8/sys/cddl/dev/dtrace/dtrace_load.c stable/8/sys/cddl/dev/dtrace/dtrace_unload.c stable/8/sys/cddl/dev/dtrace/i386/dtrace_isa.c stable/8/sys/cddl/dev/dtrace/i386/instr_size.c stable/8/sys/cddl/dev/systrace/systrace.c stable/8/sys/i386/i386/exception.s stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/trap.c stable/8/sys/i386/include/segments.h stable/8/sys/i386/include/trap.h stable/8/sys/kern/kern_dtrace.c stable/8/sys/kern/kern_exec.c stable/8/sys/kern/kern_exit.c stable/8/sys/kern/kern_fork.c stable/8/sys/kern/kern_priv.c stable/8/sys/kern/kern_proc.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_timeout.c stable/8/sys/kern/subr_trap.c stable/8/sys/kern/subr_witness.c stable/8/sys/kern/vfs_cache.c stable/8/sys/kern/vfs_lookup.c stable/8/sys/kern/vfs_syscalls.c stable/8/sys/modules/dtrace/Makefile stable/8/sys/modules/dtrace/dtrace/Makefile stable/8/sys/modules/dtrace/dtraceall/dtraceall.c stable/8/sys/modules/dtrace/fasttrap/Makefile stable/8/sys/net/vnet.c stable/8/sys/opencrypto/deflate.c stable/8/sys/security/mac/mac_framework.c stable/8/sys/security/mac/mac_internal.h stable/8/sys/sys/dtrace_bsd.h stable/8/sys/sys/param.h stable/8/sys/sys/priv.h stable/8/sys/sys/sdt.h stable/8/sys/sys/signal.h stable/8/sys/sys/sysent.h stable/8/sys/tools/vnode_if.awk stable/8/sys/x86/x86/local_apic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/exception.S Mon Feb 28 23:28:35 2011 (r219107) @@ -108,6 +108,10 @@ IDTVEC(dbg) TRAP_NOEN(T_TRCTRAP) IDTVEC(bpt) TRAP_NOEN(T_BPTFLT) +#ifdef KDTRACE_HOOKS +IDTVEC(dtrace_ret) + TRAP_NOEN(T_DTRACE_RET) +#endif /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/machdep.c Mon Feb 28 23:28:35 2011 (r219107) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" +#include "opt_kdtrace.h" #include #include @@ -1094,6 +1095,9 @@ extern inthand_t IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(xmm), IDTVEC(dblfault), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif IDTVEC(fast_syscall), IDTVEC(fast_syscall32); #ifdef DDB @@ -1624,6 +1628,9 @@ hammer_time(u_int64_t modulep, u_int64_t setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/amd64/trap.c Mon Feb 28 23:28:35 2011 (r219107) @@ -113,6 +113,13 @@ dtrace_doubletrap_func_t dtrace_doubletr * implementation opaque. */ systrace_probe_func_t systrace_probe_func; + +/* + * These hooks are necessary for the pid, usdt and fasttrap providers. + */ +dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; +dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; +dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif extern void trap(struct trapframe *frame); @@ -243,6 +250,55 @@ trap(struct trapframe *frame) if (dtrace_trap_func != NULL) if ((*dtrace_trap_func)(frame, type)) goto out; + if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || + type == T_BPTFLT) { + struct reg regs; + + regs.r_r15 = frame->tf_r15; + regs.r_r14 = frame->tf_r14; + regs.r_r13 = frame->tf_r13; + regs.r_r12 = frame->tf_r12; + regs.r_r11 = frame->tf_r11; + regs.r_r10 = frame->tf_r10; + regs.r_r9 = frame->tf_r9; + regs.r_r8 = frame->tf_r8; + regs.r_rdi = frame->tf_rdi; + regs.r_rsi = frame->tf_rsi; + regs.r_rbp = frame->tf_rbp; + regs.r_rbx = frame->tf_rbx; + regs.r_rdx = frame->tf_rdx; + regs.r_rcx = frame->tf_rcx; + regs.r_rax = frame->tf_rax; + regs.r_rip = frame->tf_rip; + regs.r_cs = frame->tf_cs; + regs.r_rflags = frame->tf_rflags; + regs.r_rsp = frame->tf_rsp; + regs.r_ss = frame->tf_ss; + if (frame->tf_flags & TF_HASSEGS) { + regs.r_ds = frame->tf_ds; + regs.r_es = frame->tf_es; + regs.r_fs = frame->tf_fs; + regs.r_gs = frame->tf_gs; + } else { + regs.r_ds = 0; + regs.r_es = 0; + regs.r_fs = 0; + regs.r_gs = 0; + } + if (type == T_DTRACE_PROBE && + dtrace_fasttrap_probe_ptr != NULL && + dtrace_fasttrap_probe_ptr(®s) == 0) + goto out; + if (type == T_BPTFLT && + dtrace_pid_probe_ptr != NULL && + dtrace_pid_probe_ptr(®s) == 0) + goto out; + if (type == T_DTRACE_RET && + dtrace_return_probe_ptr != NULL && + dtrace_return_probe_ptr(®s) == 0) + goto out; + + } #endif if ((frame->tf_rflags & PSL_I) == 0) { Modified: stable/8/sys/amd64/include/segments.h ============================================================================== --- stable/8/sys/amd64/include/segments.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/include/segments.h Mon Feb 28 23:28:35 2011 (r219107) @@ -74,6 +74,13 @@ struct user_segment_descriptor { u_int64_t sd_hibase:8; /* segment base address (msb) */ } __packed; +#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) +#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ + (sd)->sd_hibase = ((b) >> 24); +#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) +#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ + (sd)->sd_hilimit = ((l) >> 16); + /* * System segment descriptors (128 bit wide) */ @@ -207,6 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: stable/8/sys/amd64/include/trap.h ============================================================================== --- stable/8/sys/amd64/include/trap.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/amd64/include/trap.h Mon Feb 28 23:28:35 2011 (r219107) @@ -62,6 +62,8 @@ #define T_MCHK 28 /* machine check trap */ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ +#define T_DTRACE_RET 31 /* DTrace pid return */ +#define T_DTRACE_PROBE 32 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/boot/common/ufsread.c Mon Feb 28 23:28:35 2011 (r219107) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Feb 28 23:28:35 2011 (r219107) @@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$"); char hw_serial[11] = "0"; struct opensolaris_utsname utsname = { - .nodename = "unset" + .nodename = "unset", + .sysname = "SunOS" }; int Modified: stable/8/sys/cddl/compat/opensolaris/sys/misc.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/misc.h Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/compat/opensolaris/sys/misc.h Mon Feb 28 23:28:35 2011 (r219107) @@ -46,6 +46,7 @@ #ifdef _KERNEL struct opensolaris_utsname { char *nodename; + char *sysname; }; extern char hw_serial[11]; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 28 23:28:35 2011 (r219107) @@ -551,20 +551,16 @@ static void dtrace_enabling_provide(dtra static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); static dtrace_state_t *dtrace_anon_grab(void); -#if defined(sun) static uint64_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); static dtrace_helpers_t *dtrace_helpers_create(proc_t *); -#endif static void dtrace_buffer_drop(dtrace_buffer_t *); static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); static int dtrace_ecb_create_enable(dtrace_probe_t *, void *); -#if defined(sun) static void dtrace_helper_provider_destroy(dtrace_helper_provider_t *); -#endif uint16_t dtrace_load16(uintptr_t); uint32_t dtrace_load32(uintptr_t); uint64_t dtrace_load64(uintptr_t); @@ -2784,6 +2780,21 @@ dtrace_dif_variable(dtrace_mstate_t *mst return (dtrace_getreg(lwp->lwp_regs, ndx)); return (0); } +#else + case DIF_VAR_UREGS: { + struct trapframe *tframe; + + if (!dtrace_priv_proc(state)) + return (0); + + if ((tframe = curthread->td_frame) == NULL) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = 0; + return (0); + } + + return (dtrace_getreg(tframe, ndx)); + } #endif case DIF_VAR_CURTHREAD: @@ -2839,7 +2850,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_stackdepth); -#if defined(sun) case DIF_VAR_USTACKDEPTH: if (!dtrace_priv_proc(state)) return (0); @@ -2859,7 +2869,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH; } return (mstate->dtms_ustackdepth); -#endif case DIF_VAR_CALLER: if (!dtrace_priv_kernel(state)) @@ -2896,7 +2905,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_caller); -#if defined(sun) case DIF_VAR_UCALLER: if (!dtrace_priv_proc(state)) return (0); @@ -2920,7 +2928,6 @@ dtrace_dif_variable(dtrace_mstate_t *mst } return (mstate->dtms_ucaller); -#endif case DIF_VAR_PROBEPROV: ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE); @@ -5736,7 +5743,6 @@ dtrace_action_chill(dtrace_mstate_t *mst cpu->cpu_dtrace_chilled += val; } -#if defined(sun) static void dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t *buf, uint64_t arg) @@ -5849,7 +5855,6 @@ dtrace_action_ustack(dtrace_mstate_t *ms out: mstate->dtms_scratch_ptr = old; } -#endif /* * If you're looking for the epicenter of DTrace, you just found it. This @@ -6172,7 +6177,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a (uint32_t *)arg0); continue; -#if defined(sun) case DTRACEACT_JSTACK: case DTRACEACT_USTACK: if (!dtrace_priv_proc(state)) @@ -6214,7 +6218,6 @@ dtrace_probe(dtrace_id_t id, uintptr_t a DTRACE_USTACK_NFRAMES(rec->dtrd_arg) + 1); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); continue; -#endif default: break; @@ -8141,7 +8144,6 @@ dtrace_helper_provide(dof_helper_t *dhp, dtrace_enabling_matchall(); } -#if defined(sun) static void dtrace_helper_provider_remove_one(dof_helper_t *dhp, dof_sec_t *sec, pid_t pid) { @@ -8189,7 +8191,6 @@ dtrace_helper_provider_remove(dof_helper dtrace_helper_provider_remove_one(dhp, sec, pid); } } -#endif /* * DTrace Meta Provider-to-Framework API Functions @@ -8729,7 +8730,6 @@ dtrace_difo_validate(dtrace_difo_t *dp, return (err); } -#if defined(sun) /* * Validate a DTrace DIF object that it is to be used as a helper. Helpers * are much more constrained than normal DIFOs. Specifically, they may @@ -8887,7 +8887,6 @@ dtrace_difo_validate_helper(dtrace_difo_ return (err); } -#endif /* * Returns 1 if the expression in the DIF object can be cached on a per-thread @@ -9219,7 +9218,6 @@ dtrace_difo_init(dtrace_difo_t *dp, dtra dtrace_difo_hold(dp); } -#if defined(sun) static dtrace_difo_t * dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_vstate_t *vstate) { @@ -9263,7 +9261,6 @@ dtrace_difo_duplicate(dtrace_difo_t *dp, dtrace_difo_init(new, vstate); return (new); } -#endif static void dtrace_difo_destroy(dtrace_difo_t *dp, dtrace_vstate_t *vstate) @@ -13791,7 +13788,6 @@ dtrace_anon_property(void) } } -#if defined(sun) /* * DTrace Helper Functions */ @@ -13855,9 +13851,7 @@ dtrace_helper_trace(dtrace_helper_action ((uint64_t *)(uintptr_t)svar->dtsv_data)[curcpu]; } } -#endif -#if defined(sun) static uint64_t dtrace_helper(int which, dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t arg0, uint64_t arg1) @@ -13865,7 +13859,7 @@ dtrace_helper(int which, dtrace_mstate_t uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; uint64_t sarg0 = mstate->dtms_arg[0]; uint64_t sarg1 = mstate->dtms_arg[1]; - uint64_t rval; + uint64_t rval = 0; dtrace_helpers_t *helpers = curproc->p_dtrace_helpers; dtrace_helper_action_t *helper; dtrace_vstate_t *vstate; @@ -14056,9 +14050,7 @@ dtrace_helper_destroygen(int gen) return (0); } -#endif -#if defined(sun) static int dtrace_helper_validate(dtrace_helper_action_t *helper) { @@ -14073,9 +14065,7 @@ dtrace_helper_validate(dtrace_helper_act return (err == 0); } -#endif -#if defined(sun) static int dtrace_helper_action_add(int which, dtrace_ecbdesc_t *ep) { @@ -14622,12 +14612,17 @@ dtrace_helpers_create(proc_t *p) return (help); } -static void -dtrace_helpers_destroy(void) +#if defined(sun) +static +#endif +void +dtrace_helpers_destroy(proc_t *p) { dtrace_helpers_t *help; dtrace_vstate_t *vstate; +#if defined(sun) proc_t *p = curproc; +#endif int i; mutex_enter(&dtrace_lock); @@ -14714,7 +14709,10 @@ dtrace_helpers_destroy(void) mutex_exit(&dtrace_lock); } -static void +#if defined(sun) +static +#endif +void dtrace_helpers_duplicate(proc_t *from, proc_t *to) { dtrace_helpers_t *help, *newhelp; @@ -14795,7 +14793,6 @@ dtrace_helpers_duplicate(proc_t *from, p if (hasprovs) dtrace_helper_provider_register(to, newhelp, NULL); } -#endif #if defined(sun) /* @@ -16466,6 +16463,7 @@ _fini(void) #else static d_ioctl_t dtrace_ioctl; +static d_ioctl_t dtrace_ioctl_helper; static void dtrace_load(void *); static int dtrace_unload(void); #if __FreeBSD_version < 800039 @@ -16474,6 +16472,7 @@ static struct clonedevs *dtrace_clones; static eventhandler_tag eh_tag; /* Event handler tag. */ #else static struct cdev *dtrace_dev; +static struct cdev *helper_dev; #endif void dtrace_invop_init(void); @@ -16488,6 +16487,13 @@ static struct cdevsw dtrace_cdevsw = { .d_name = "dtrace", }; +static struct cdevsw helper_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, + .d_ioctl = dtrace_ioctl_helper, + .d_name = "helper", +}; + #include #if __FreeBSD_version < 800039 #include Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 28 21:33:26 2011 (r219106) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 28 23:28:35 2011 (r219107) @@ -17,6 +17,10 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END + * + * Portions Copyright 2010 The FreeBSD Foundation + * + * $FreeBSD$ */ /* @@ -24,7 +28,9 @@ * Use is subject to license terms. */ +#if defined(sun) #pragma ident "%Z%%M% %I% %E% SMI" +#endif #include #include @@ -32,11 +38,15 @@ #include #include #include +#if defined(sun) #include +#endif #include #include #include +#if defined(sun) #include +#endif #include #include #include @@ -44,9 +54,17 @@ #include #include #include -#include #include +#if defined(sun) #include +#endif +#include +#include +#if !defined(sun) +#include +#include +#include +#endif /* * User-Land Trap-Based Tracing @@ -125,11 +143,20 @@ * never hold the provider lock and creation lock simultaneously */ -static dev_info_t *fasttrap_devi; +static d_open_t fasttrap_open; +static d_ioctl_t fasttrap_ioctl; + +static struct cdevsw fasttrap_cdevsw = { + .d_version = D_VERSION, + .d_open = fasttrap_open, + .d_ioctl = fasttrap_ioctl, + .d_name = "fasttrap", +}; +static struct cdev *fasttrap_cdev; static dtrace_meta_provider_id_t fasttrap_meta_id; -static timeout_id_t fasttrap_timeout; -static kmutex_t fasttrap_cleanup_mtx; +static struct callout fasttrap_timeout; +static struct mtx fasttrap_cleanup_mtx; static uint_t fasttrap_cleanup_work; /* @@ -181,6 +208,10 @@ static void fasttrap_proc_release(fasttr #define FASTTRAP_PROCS_INDEX(pid) ((pid) & fasttrap_procs.fth_mask) +#if !defined(sun) +static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU]; +#endif + static int fasttrap_highbit(ulong_t i) { @@ -229,6 +260,7 @@ fasttrap_hash_str(const char *p) void fasttrap_sigtrap(proc_t *p, kthread_t *t, uintptr_t pc) { +#if defined(sun) sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); sqp->sq_info.si_signo = SIGTRAP; @@ -241,6 +273,17 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t if (t != NULL) aston(t); +#else + ksiginfo_t *ksi = kmem_zalloc(sizeof (ksiginfo_t), KM_SLEEP); + + ksiginfo_init(ksi); + ksi->ksi_signo = SIGTRAP; + ksi->ksi_code = TRAP_DTRACE; + ksi->ksi_addr = (caddr_t)pc; + PROC_LOCK(p); + (void) tdksignal(t, SIGTRAP, ksi); + PROC_UNLOCK(p); +#endif } /* @@ -257,9 +300,9 @@ fasttrap_mod_barrier(uint64_t gen) fasttrap_mod_gen++; - for (i = 0; i < NCPU; i++) { - mutex_enter(&cpu_core[i].cpuc_pid_lock); - mutex_exit(&cpu_core[i].cpuc_pid_lock); + CPU_FOREACH(i) { + mutex_enter(&fasttrap_cpuc_pid_lock[i]); + mutex_exit(&fasttrap_cpuc_pid_lock[i]); } } @@ -274,16 +317,15 @@ fasttrap_pid_cleanup_cb(void *data) fasttrap_provider_t **fpp, *fp; fasttrap_bucket_t *bucket; dtrace_provider_id_t provid; - int i, later; + int i, later = 0; static volatile int in = 0; ASSERT(in == 0); in = 1; - mutex_enter(&fasttrap_cleanup_mtx); while (fasttrap_cleanup_work) { fasttrap_cleanup_work = 0; - mutex_exit(&fasttrap_cleanup_mtx); + mtx_unlock(&fasttrap_cleanup_mtx); later = 0; @@ -349,10 +391,12 @@ fasttrap_pid_cleanup_cb(void *data) mutex_exit(&bucket->ftb_mtx); } - mutex_enter(&fasttrap_cleanup_mtx); + mtx_lock(&fasttrap_cleanup_mtx); } +#if 0 ASSERT(fasttrap_timeout != 0); +#endif /* * If we were unable to remove a retired provider, try again after @@ -364,14 +408,17 @@ fasttrap_pid_cleanup_cb(void *data) * get a chance to do that work if and when the timeout is reenabled * (if detach fails). */ - if (later > 0 && fasttrap_timeout != (timeout_id_t)1) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, hz); + if (later > 0 && callout_active(&fasttrap_timeout)) + callout_reset(&fasttrap_timeout, hz, &fasttrap_pid_cleanup_cb, + NULL); else if (later > 0) fasttrap_cleanup_work = 1; - else - fasttrap_timeout = 0; + else { +#if !defined(sun) + /* Nothing to be done for FreeBSD */ +#endif + } - mutex_exit(&fasttrap_cleanup_mtx); in = 0; } @@ -381,11 +428,11 @@ fasttrap_pid_cleanup_cb(void *data) static void fasttrap_pid_cleanup(void) { - mutex_enter(&fasttrap_cleanup_mtx); + + mtx_lock(&fasttrap_cleanup_mtx); fasttrap_cleanup_work = 1; - if (fasttrap_timeout == 0) - fasttrap_timeout = timeout(&fasttrap_pid_cleanup_cb, NULL, 1); - mutex_exit(&fasttrap_cleanup_mtx); + callout_reset(&fasttrap_timeout, 1, &fasttrap_pid_cleanup_cb, NULL); + mtx_unlock(&fasttrap_cleanup_mtx); } /* @@ -400,9 +447,35 @@ fasttrap_fork(proc_t *p, proc_t *cp) pid_t ppid = p->p_pid; int i; +#if defined(sun) ASSERT(curproc == p); ASSERT(p->p_proc_flag & P_PR_LOCK); +#else + PROC_LOCK_ASSERT(p, MA_OWNED); +#endif +#if defined(sun) ASSERT(p->p_dtrace_count > 0); +#else + if (p->p_dtrace_helpers) { + /* + * dtrace_helpers_duplicate() allocates memory. + */ + _PHOLD(cp); + PROC_UNLOCK(p); + PROC_UNLOCK(cp); + dtrace_helpers_duplicate(p, cp); + PROC_LOCK(cp); + PROC_LOCK(p); + _PRELE(cp); + } + /* + * This check is purposely here instead of in kern_fork.c because, + * for legal resons, we cannot include the dtrace_cddl.h header + * inside kern_fork.c and insert if-clause there. + */ + if (p->p_dtrace_count == 0) + return; +#endif ASSERT(cp->p_dtrace_count == 0); /* @@ -419,9 +492,13 @@ fasttrap_fork(proc_t *p, proc_t *cp) * We don't have to worry about the child process disappearing * because we're in fork(). */ - mutex_enter(&cp->p_lock); +#if defined(sun) + mtx_lock_spin(&cp->p_slock); sprlock_proc(cp); - mutex_exit(&cp->p_lock); + mtx_unlock_spin(&cp->p_slock); +#else + _PHOLD(cp); +#endif /* * Iterate over every tracepoint looking for ones that belong to the @@ -451,8 +528,12 @@ fasttrap_fork(proc_t *p, proc_t *cp) mutex_exit(&bucket->ftb_mtx); } +#if defined(sun) mutex_enter(&cp->p_lock); sprunlock(cp); +#else + _PRELE(cp); +#endif } /* @@ -463,24 +544,30 @@ fasttrap_fork(proc_t *p, proc_t *cp) static void fasttrap_exec_exit(proc_t *p) { +#if defined(sun) ASSERT(p == curproc); - ASSERT(MUTEX_HELD(&p->p_lock)); - - mutex_exit(&p->p_lock); +#endif + PROC_LOCK_ASSERT(p, MA_OWNED); + _PHOLD(p); + PROC_UNLOCK(p); /* * We clean up the pid provider for this process here; user-land * static probes are handled by the meta-provider remove entry point. */ fasttrap_provider_retire(p->p_pid, FASTTRAP_PID_NAME, 0); - - mutex_enter(&p->p_lock); +#if !defined(sun) + if (p->p_dtrace_helpers) + dtrace_helpers_destroy(p); +#endif + PROC_LOCK(p); + _PRELE(p); } /*ARGSUSED*/ static void -fasttrap_pid_provide(void *arg, const dtrace_probedesc_t *desc) +fasttrap_pid_provide(void *arg, dtrace_probedesc_t *desc) { /* * There are no "default" pid probes. @@ -504,7 +591,9 @@ fasttrap_tracepoint_enable(proc_t *p, fa ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid); +#if defined(sun) ASSERT(!(p->p_flag & SVFORK)); +#endif /* * Before we make any modifications, make sure we've imposed a barrier @@ -610,7 +699,9 @@ again: * Increment the count of the number of tracepoints active in * the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#endif p->p_dtrace_count++; return (rc); @@ -666,7 +757,7 @@ fasttrap_tracepoint_disable(proc_t *p, f fasttrap_bucket_t *bucket; fasttrap_provider_t *provider = probe->ftp_prov; fasttrap_tracepoint_t **pp, *tp; - fasttrap_id_t *id, **idp; + fasttrap_id_t *id, **idp = NULL; pid_t pid; uintptr_t pc; @@ -800,7 +891,9 @@ fasttrap_tracepoint_disable(proc_t *p, f * Decrement the count of the number of tracepoints active * in the victim process. */ +#if defined(sun) ASSERT(p->p_proc_flag & P_PR_LOCK); +#endif p->p_dtrace_count--; } @@ -851,26 +944,31 @@ fasttrap_enable_callbacks(void) static void fasttrap_disable_callbacks(void) { +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif + mutex_enter(&fasttrap_count_mtx); ASSERT(fasttrap_pid_count > 0); fasttrap_pid_count--; if (fasttrap_pid_count == 0) { +#if defined(sun) cpu_t *cur, *cpu = CPU; for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_enter(&cur->cpu_ft_lock, RW_WRITER); } - +#endif dtrace_pid_probe_ptr = NULL; dtrace_return_probe_ptr = NULL; - +#if defined(sun) for (cur = cpu->cpu_next_onln; cur != cpu; cur = cur->cpu_next_onln) { rw_exit(&cur->cpu_ft_lock); } +#endif } mutex_exit(&fasttrap_count_mtx); } @@ -880,13 +978,16 @@ static void fasttrap_pid_enable(void *arg, dtrace_id_t id, void *parg) { fasttrap_probe_t *probe = parg; - proc_t *p; + proc_t *p = NULL; int i, rc; + ASSERT(probe != NULL); ASSERT(!probe->ftp_enabled); ASSERT(id == probe->ftp_id); +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif /* * Increment the count of enabled probes on this probe's provider; @@ -911,6 +1012,7 @@ fasttrap_pid_enable(void *arg, dtrace_id * a fork in which the traced process is being born and we're copying * USDT probes. Otherwise, the process is gone so bail. */ +#if defined(sun) if ((p = sprlock(probe->ftp_pid)) == NULL) { if ((curproc->p_flag & SFORKING) == 0) return; @@ -934,12 +1036,23 @@ fasttrap_pid_enable(void *arg, dtrace_id ASSERT(!(p->p_flag & SVFORK)); mutex_exit(&p->p_lock); +#else + if ((p = pfind(probe->ftp_pid)) == NULL) + return; +#endif /* * We have to enable the trap entry point before any user threads have * the chance to execute the trap instruction we're about to place * in their process's text. */ +#ifdef __FreeBSD__ + /* + * pfind() returns a locked process. + */ + _PHOLD(p); + PROC_UNLOCK(p); +#endif fasttrap_enable_callbacks(); /* @@ -967,8 +1080,12 @@ fasttrap_pid_enable(void *arg, dtrace_id i--; } +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PRELE(p); +#endif /* * Since we're not actually enabling this probe, @@ -978,9 +1095,12 @@ fasttrap_pid_enable(void *arg, dtrace_id return; } } - +#if defined(sun) mutex_enter(&p->p_lock); sprunlock(p); +#else + PRELE(p); +#endif probe->ftp_enabled = 1; } @@ -996,18 +1116,22 @@ fasttrap_pid_disable(void *arg, dtrace_i ASSERT(id == probe->ftp_id); + mutex_enter(&provider->ftp_mtx); + /* * We won't be able to acquire a /proc-esque lock on the process * iff the process is dead and gone. In this case, we rely on the * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = sprlock(probe->ftp_pid)) != NULL) { - ASSERT(!(p->p_flag & SVFORK)); - mutex_exit(&p->p_lock); + if ((p = pfind(probe->ftp_pid)) == NULL) { + mutex_exit(&provider->ftp_mtx); + return; } - - mutex_enter(&provider->ftp_mtx); +#ifdef __FreeBSD__ + _PHOLD(p); + PROC_UNLOCK(p); +#endif /* * Disable all the associated tracepoints (for fully enabled probes). @@ -1030,9 +1154,6 @@ fasttrap_pid_disable(void *arg, dtrace_i if (provider->ftp_retired && !provider->ftp_marked) whack = provider->ftp_marked = 1; mutex_exit(&provider->ftp_mtx); - - mutex_enter(&p->p_lock); - sprunlock(p); } else { /* * If the process is dead, we're just waiting for the @@ -1046,12 +1167,17 @@ fasttrap_pid_disable(void *arg, dtrace_i if (whack) fasttrap_pid_cleanup(); +#ifdef __FreeBSD__ + PRELE(p); +#endif if (!probe->ftp_enabled) return; probe->ftp_enabled = 0; +#if defined(sun) ASSERT(MUTEX_HELD(&cpu_lock)); +#endif fasttrap_disable_callbacks(); } @@ -1163,6 +1289,7 @@ fasttrap_proc_lookup(pid_t pid) fasttrap_bucket_t *bucket; fasttrap_proc_t *fprc, *new_fprc; + bucket = &fasttrap_procs.fth_table[FASTTRAP_PROCS_INDEX(pid)]; mutex_enter(&bucket->ftb_mtx); @@ -1189,6 +1316,10 @@ fasttrap_proc_lookup(pid_t pid) new_fprc->ftpc_pid = pid; new_fprc->ftpc_rcount = 1; new_fprc->ftpc_acount = 1; +#if !defined(sun) + mutex_init(&new_fprc->ftpc_mtx, "fasttrap proc mtx", MUTEX_DEFAULT, + NULL); +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 23:36:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8DE01065697; Mon, 28 Feb 2011 23:36:03 +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 A67ED8FC20; Mon, 28 Feb 2011 23:36: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 p1SNa3IA060558; Mon, 28 Feb 2011 23:36:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNa3fF060555; Mon, 28 Feb 2011 23:36:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282336.p1SNa3fF060555@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219108 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:36:03 -0000 Author: yongari Date: Mon Feb 28 23:36:03 2011 New Revision: 219108 URL: http://svn.freebsd.org/changeset/base/219108 Log: MFC r217868: Remove TX taskqueue and directly invoke re_start in interrupt task. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:28:35 2011 (r219107) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 23:36:03 2011 (r219108) @@ -254,9 +254,9 @@ static int re_poll_locked (struct ifnet #endif static int re_intr (void *); static void re_tick (void *); -static void re_tx_task (void *, int); static void re_int_task (void *, int); static void re_start (struct ifnet *); +static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); static void re_init (void *); static void re_init_locked (struct rl_softc *); @@ -1524,7 +1524,6 @@ re_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->rl_txtask, 1, re_tx_task, ifp); TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); /* @@ -1634,7 +1633,6 @@ re_detach(device_t dev) RL_UNLOCK(sc); callout_drain(&sc->rl_stat_callout); taskqueue_drain(taskqueue_fast, &sc->rl_inttask); - taskqueue_drain(taskqueue_fast, &sc->rl_txtask); /* * Force off the IFF_UP flag here, in case someone * still had a BPF descriptor attached to this @@ -2365,7 +2363,7 @@ re_poll_locked(struct ifnet *ifp, enum p re_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int16_t status; @@ -2468,7 +2466,7 @@ re_int_task(void *arg, int npending) } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); RL_UNLOCK(sc); @@ -2673,19 +2671,21 @@ re_encap(struct rl_softc *sc, struct mbu } static void -re_tx_task(void *arg, int npending) +re_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct rl_softc *sc; - ifp = arg; - re_start(ifp); + sc = ifp->if_softc; + RL_LOCK(sc); + re_start_locked(ifp); + RL_UNLOCK(sc); } /* * Main transmit routine for C+ and gigE NICs. */ static void -re_start(struct ifnet *ifp) +re_start_locked(struct ifnet *ifp) { struct rl_softc *sc; struct mbuf *m_head; @@ -2693,13 +2693,9 @@ re_start(struct ifnet *ifp) sc = ifp->if_softc; - RL_LOCK(sc); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) { - RL_UNLOCK(sc); + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) return; - } for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->rl_ldata.rl_tx_free > 1;) { @@ -2729,7 +2725,6 @@ re_start(struct ifnet *ifp) if (sc->rl_ldata.rl_tx_free != sc->rl_ldata.rl_tx_desc_cnt) CSR_WRITE_4(sc, RL_TIMERCNT, 1); #endif - RL_UNLOCK(sc); return; } @@ -2757,8 +2752,6 @@ re_start(struct ifnet *ifp) * Set a timeout in case the chip goes out to lunch. */ sc->rl_watchdog_timer = 5; - - RL_UNLOCK(sc); } static void @@ -3278,7 +3271,7 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); return; } @@ -3289,7 +3282,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); } /* Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:28:35 2011 (r219107) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:36:03 2011 (r219108) @@ -893,7 +893,6 @@ struct rl_softc { int rxcycles; #endif - struct task rl_txtask; struct task rl_inttask; int rl_txstart; From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 23:37:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E73BD106566B; Mon, 28 Feb 2011 23:37:38 +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 D4F468FC0A; Mon, 28 Feb 2011 23:37: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 p1SNbcjd060684; Mon, 28 Feb 2011 23:37:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNbcRO060681; Mon, 28 Feb 2011 23:37:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282337.p1SNbcRO060681@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219109 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:37:39 -0000 Author: yongari Date: Mon Feb 28 23:37:38 2011 New Revision: 219109 URL: http://svn.freebsd.org/changeset/base/219109 Log: MFC r217868: Remove TX taskqueue and directly invoke re_start in interrupt task. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 23:36:03 2011 (r219108) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 23:37:38 2011 (r219109) @@ -254,9 +254,9 @@ static void re_poll_locked (struct ifnet #endif static int re_intr (void *); static void re_tick (void *); -static void re_tx_task (void *, int); static void re_int_task (void *, int); static void re_start (struct ifnet *); +static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); static void re_init (void *); static void re_init_locked (struct rl_softc *); @@ -1525,7 +1525,6 @@ re_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->rl_txtask, 1, re_tx_task, ifp); TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); /* @@ -1635,7 +1634,6 @@ re_detach(device_t dev) RL_UNLOCK(sc); callout_drain(&sc->rl_stat_callout); taskqueue_drain(taskqueue_fast, &sc->rl_inttask); - taskqueue_drain(taskqueue_fast, &sc->rl_txtask); /* * Force off the IFF_UP flag here, in case someone * still had a BPF descriptor attached to this @@ -2360,7 +2358,7 @@ re_poll_locked(struct ifnet *ifp, enum p re_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int16_t status; @@ -2462,7 +2460,7 @@ re_int_task(void *arg, int npending) } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); RL_UNLOCK(sc); @@ -2667,19 +2665,21 @@ re_encap(struct rl_softc *sc, struct mbu } static void -re_tx_task(void *arg, int npending) +re_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct rl_softc *sc; - ifp = arg; - re_start(ifp); + sc = ifp->if_softc; + RL_LOCK(sc); + re_start_locked(ifp); + RL_UNLOCK(sc); } /* * Main transmit routine for C+ and gigE NICs. */ static void -re_start(struct ifnet *ifp) +re_start_locked(struct ifnet *ifp) { struct rl_softc *sc; struct mbuf *m_head; @@ -2687,13 +2687,9 @@ re_start(struct ifnet *ifp) sc = ifp->if_softc; - RL_LOCK(sc); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) { - RL_UNLOCK(sc); + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) return; - } for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->rl_ldata.rl_tx_free > 1;) { @@ -2723,7 +2719,6 @@ re_start(struct ifnet *ifp) if (sc->rl_ldata.rl_tx_free != sc->rl_ldata.rl_tx_desc_cnt) CSR_WRITE_4(sc, RL_TIMERCNT, 1); #endif - RL_UNLOCK(sc); return; } @@ -2751,8 +2746,6 @@ re_start(struct ifnet *ifp) * Set a timeout in case the chip goes out to lunch. */ sc->rl_watchdog_timer = 5; - - RL_UNLOCK(sc); } static void @@ -3272,7 +3265,7 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); return; } @@ -3283,7 +3276,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); } /* Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:36:03 2011 (r219108) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:37:38 2011 (r219109) @@ -893,7 +893,6 @@ struct rl_softc { int rxcycles; #endif - struct task rl_txtask; struct task rl_inttask; int rl_txstart; From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 23:41:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F12C71065670; Mon, 28 Feb 2011 23:41:27 +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 DE2D98FC08; Mon, 28 Feb 2011 23:41: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 p1SNfRsq060995; Mon, 28 Feb 2011 23:41:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNfRis060992; Mon, 28 Feb 2011 23:41:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282341.p1SNfRis060992@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219110 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:41:28 -0000 Author: yongari Date: Mon Feb 28 23:41:27 2011 New Revision: 219110 URL: http://svn.freebsd.org/changeset/base/219110 Log: MFC r217902: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:37:38 2011 (r219109) +++ stable/8/sys/dev/re/if_re.c Mon Feb 28 23:41:27 2011 (r219110) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static int re_poll (struct ifnet *, enu static int re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi (void *); static void re_tick (void *); static void re_int_task (void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range (SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod (SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1574,19 +1579,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1657,31 +1662,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI_MESSAGES; i++) { - if (sc->rl_intrhand[i] != NULL) { - bus_teardown_intr(dev, sc->rl_irq[i], - sc->rl_intrhand[i]); - sc->rl_intrhand[i] = NULL; - } + if (sc->rl_intrhand[0] != NULL) { + bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); + sc->rl_intrhand[0] = NULL; } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { - if (sc->rl_irq[0] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->rl_irq[0]); - sc->rl_irq[0] = NULL; - } - } else { - for (i = 0, rid = 1; i < RL_MSI_MESSAGES; i++, rid++) { - if (sc->rl_irq[i] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->rl_irq[i]); - sc->rl_irq[i] = NULL; - } - } - pci_release_msi(dev); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + rid = 0; + else + rid = 1; + if (sc->rl_irq[0] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->rl_irq[0]); + sc->rl_irq[0] = NULL; } + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0) + pci_release_msi(dev); if (sc->rl_res_pba) { rid = PCIR_BAR(4); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); @@ -1970,6 +1966,7 @@ re_rx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -1993,6 +1990,7 @@ re_jrx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -2478,6 +2476,87 @@ re_int_task(void *arg, int npending) CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS); } +static void +re_intr_msi(void *xsc) +{ + struct rl_softc *sc; + struct ifnet *ifp; + uint16_t intrs, status; + + sc = xsc; + RL_LOCK(sc); + + ifp = sc->rl_ifp; +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + RL_UNLOCK(sc); + return; + } +#endif + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + RL_UNLOCK(sc); + return; + } + + intrs = RL_INTRS_CPLUS; + status = CSR_READ_2(sc, RL_ISR); + CSR_WRITE_2(sc, RL_ISR, status); + if (sc->rl_int_rx_act > 0) { + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + status &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + } + + if (status & (RL_ISR_TIMEOUT_EXPIRED | RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) { + re_rxeof(sc, NULL); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (sc->rl_int_rx_mod != 0 && + (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) != 0) { + /* Rearm one-shot timer. */ + CSR_WRITE_4(sc, RL_TIMERCNT, 1); + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN); + sc->rl_int_rx_act = 1; + } else { + intrs |= RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN; + sc->rl_int_rx_act = 0; + } + } + } + + /* + * Some chips will ignore a second TX request issued + * while an existing transmission is in progress. If + * the transmitter goes idle but there are still + * packets waiting to be sent, we need to restart the + * channel here to flush them out. This only seems to + * be required with the PCIe devices. + */ + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_DESC_UNAVAIL)) && + (sc->rl_flags & RL_FLAG_PCIE)) + CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)) + re_txeof(sc); + + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + re_start_locked(ifp); + CSR_WRITE_2(sc, RL_IMR, intrs); + } + RL_UNLOCK(sc); +} + static int re_encap(struct rl_softc *sc, struct mbuf **m_head) { @@ -3007,18 +3086,35 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); #endif -#ifdef RE_TX_MODERATION /* * Initialize the timer interrupt register so that * a timer interrupt will be generated once the timer * reaches a certain number of ticks. The timer is - * reloaded on each transmit. This gives us TX interrupt + * reloaded on each transmit. + */ +#ifdef RE_TX_MODERATION + /* + * Use timer interrupt register to moderate TX interrupt * moderation, which dramatically improves TX frame rate. */ if (sc->rl_type == RL_8169) CSR_WRITE_4(sc, RL_TIMERINT_8169, 0x800); else CSR_WRITE_4(sc, RL_TIMERINT, 0x400); +#else + /* + * Use timer interrupt register to moderate RX interrupt + * moderation. + */ + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, + RL_USECS(sc->rl_int_rx_mod)); + } else { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, RL_USECS(0)); + } #endif /* @@ -3535,6 +3631,7 @@ re_add_sysctls(struct rl_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; + int error; ctx = device_get_sysctl_ctx(sc->rl_dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); @@ -3542,6 +3639,26 @@ re_add_sysctls(struct rl_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", "Statistics Information"); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + return; + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, + sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + /* Pull in device tunables. */ + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->rl_dev), + device_get_unit(sc->rl_dev), "int_rx_mod", &sc->rl_int_rx_mod); + if (error == 0) { + if (sc->rl_int_rx_mod < RL_TIMER_MIN || + sc->rl_int_rx_mod > RL_TIMER_MAX) { + device_printf(sc->rl_dev, "int_rx_mod value out of " + "range; using default: %d\n", + RL_TIMER_DEFAULT); + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + } + } + } static int @@ -3619,3 +3736,29 @@ done: return (error); } + +static int +sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) +{ + int error, value; + + if (arg1 == NULL) + return (EINVAL); + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + if (value < low || value > high) + return (EINVAL); + *(int *)arg1 = value; + + return (0); +} + +static int +sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) +{ + + return (sysctl_int_range(oidp, arg1, arg2, req, RL_TIMER_MIN, + RL_TIMER_MAX)); +} Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:37:38 2011 (r219109) +++ stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:41:27 2011 (r219110) @@ -497,6 +497,14 @@ #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + /* * Gigabit PHY access register (8169 only) */ @@ -896,6 +904,8 @@ struct rl_softc { struct task rl_inttask; int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 From owner-svn-src-all@FreeBSD.ORG Mon Feb 28 23:46:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A263106564A; Mon, 28 Feb 2011 23:46:59 +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 8711E8FC14; Mon, 28 Feb 2011 23:46:59 +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 p1SNkx1b061456; Mon, 28 Feb 2011 23:46:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1SNkxPf061452; Mon, 28 Feb 2011 23:46:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201102282346.p1SNkxPf061452@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 28 Feb 2011 23:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219111 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 23:46:59 -0000 Author: yongari Date: Mon Feb 28 23:46:59 2011 New Revision: 219111 URL: http://svn.freebsd.org/changeset/base/219111 Log: MFC r217902: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Mon Feb 28 23:41:27 2011 (r219110) +++ stable/7/sys/dev/re/if_re.c Mon Feb 28 23:46:59 2011 (r219111) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static void re_poll (struct ifnet *, en static void re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi (void *); static void re_tick (void *); static void re_int_task (void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range (SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod (SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1575,19 +1580,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1658,31 +1663,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI_MESSAGES; i++) { - if (sc->rl_intrhand[i] != NULL) { - bus_teardown_intr(dev, sc->rl_irq[i], - sc->rl_intrhand[i]); - sc->rl_intrhand[i] = NULL; - } + if (sc->rl_intrhand[0] != NULL) { + bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); + sc->rl_intrhand[0] = NULL; } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { - if (sc->rl_irq[0] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->rl_irq[0]); - sc->rl_irq[0] = NULL; - } - } else { - for (i = 0, rid = 1; i < RL_MSI_MESSAGES; i++, rid++) { - if (sc->rl_irq[i] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->rl_irq[i]); - sc->rl_irq[i] = NULL; - } - } - pci_release_msi(dev); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + rid = 0; + else + rid = 1; + if (sc->rl_irq[0] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->rl_irq[0]); + sc->rl_irq[0] = NULL; } + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0) + pci_release_msi(dev); if (sc->rl_res_pba) { rid = PCIR_BAR(4); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); @@ -1971,6 +1967,7 @@ re_rx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -1994,6 +1991,7 @@ re_jrx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -2472,6 +2470,87 @@ re_int_task(void *arg, int npending) CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS); } +static void +re_intr_msi(void *xsc) +{ + struct rl_softc *sc; + struct ifnet *ifp; + uint16_t intrs, status; + + sc = xsc; + RL_LOCK(sc); + + ifp = sc->rl_ifp; +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + RL_UNLOCK(sc); + return; + } +#endif + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + RL_UNLOCK(sc); + return; + } + + intrs = RL_INTRS_CPLUS; + status = CSR_READ_2(sc, RL_ISR); + CSR_WRITE_2(sc, RL_ISR, status); + if (sc->rl_int_rx_act > 0) { + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + status &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + } + + if (status & (RL_ISR_TIMEOUT_EXPIRED | RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) { + re_rxeof(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (sc->rl_int_rx_mod != 0 && + (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) != 0) { + /* Rearm one-shot timer. */ + CSR_WRITE_4(sc, RL_TIMERCNT, 1); + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN); + sc->rl_int_rx_act = 1; + } else { + intrs |= RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN; + sc->rl_int_rx_act = 0; + } + } + } + + /* + * Some chips will ignore a second TX request issued + * while an existing transmission is in progress. If + * the transmitter goes idle but there are still + * packets waiting to be sent, we need to restart the + * channel here to flush them out. This only seems to + * be required with the PCIe devices. + */ + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_DESC_UNAVAIL)) && + (sc->rl_flags & RL_FLAG_PCIE)) + CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)) + re_txeof(sc); + + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + re_start_locked(ifp); + CSR_WRITE_2(sc, RL_IMR, intrs); + } + RL_UNLOCK(sc); +} + static int re_encap(struct rl_softc *sc, struct mbuf **m_head) { @@ -3001,18 +3080,35 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); #endif -#ifdef RE_TX_MODERATION /* * Initialize the timer interrupt register so that * a timer interrupt will be generated once the timer * reaches a certain number of ticks. The timer is - * reloaded on each transmit. This gives us TX interrupt + * reloaded on each transmit. + */ +#ifdef RE_TX_MODERATION + /* + * Use timer interrupt register to moderate TX interrupt * moderation, which dramatically improves TX frame rate. */ if (sc->rl_type == RL_8169) CSR_WRITE_4(sc, RL_TIMERINT_8169, 0x800); else CSR_WRITE_4(sc, RL_TIMERINT, 0x400); +#else + /* + * Use timer interrupt register to moderate RX interrupt + * moderation. + */ + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, + RL_USECS(sc->rl_int_rx_mod)); + } else { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, RL_USECS(0)); + } #endif /* @@ -3529,6 +3625,7 @@ re_add_sysctls(struct rl_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; + int error; ctx = device_get_sysctl_ctx(sc->rl_dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); @@ -3536,6 +3633,26 @@ re_add_sysctls(struct rl_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", "Statistics Information"); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + return; + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, + sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + /* Pull in device tunables. */ + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->rl_dev), + device_get_unit(sc->rl_dev), "int_rx_mod", &sc->rl_int_rx_mod); + if (error == 0) { + if (sc->rl_int_rx_mod < RL_TIMER_MIN || + sc->rl_int_rx_mod > RL_TIMER_MAX) { + device_printf(sc->rl_dev, "int_rx_mod value out of " + "range; using default: %d\n", + RL_TIMER_DEFAULT); + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + } + } + } static int @@ -3613,3 +3730,29 @@ done: return (error); } + +static int +sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) +{ + int error, value; + + if (arg1 == NULL) + return (EINVAL); + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + if (value < low || value > high) + return (EINVAL); + *(int *)arg1 = value; + + return (0); +} + +static int +sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) +{ + + return (sysctl_int_range(oidp, arg1, arg2, req, RL_TIMER_MIN, + RL_TIMER_MAX)); +} Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:41:27 2011 (r219110) +++ stable/7/sys/pci/if_rlreg.h Mon Feb 28 23:46:59 2011 (r219111) @@ -497,6 +497,14 @@ #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + /* * Gigabit PHY access register (8169 only) */ @@ -896,6 +904,8 @@ struct rl_softc { struct task rl_inttask; int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:01:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF848106568D; Tue, 1 Mar 2011 00:01:34 +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 9408F8FC1A; Tue, 1 Mar 2011 00:01: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 p2101YRZ062633; Tue, 1 Mar 2011 00:01:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2101YGI062630; Tue, 1 Mar 2011 00:01:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010001.p2101YGI062630@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219112 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:01:34 -0000 Author: yongari Date: Tue Mar 1 00:01:34 2011 New Revision: 219112 URL: http://svn.freebsd.org/changeset/base/219112 Log: MFC r217911: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Feb 28 23:46:59 2011 (r219111) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:01:34 2011 (r219112) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1376,6 +1377,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Mon Feb 28 23:46:59 2011 (r219111) +++ stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:01:34 2011 (r219112) @@ -176,6 +176,7 @@ #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:02:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD60B106566B; Tue, 1 Mar 2011 00:02:46 +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 B12E48FC21; Tue, 1 Mar 2011 00:02: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 p2102kZw062766; Tue, 1 Mar 2011 00:02:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2102kFN062763; Tue, 1 Mar 2011 00:02:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010002.p2102kFN062763@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219113 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:02:47 -0000 Author: yongari Date: Tue Mar 1 00:02:46 2011 New Revision: 219113 URL: http://svn.freebsd.org/changeset/base/219113 Log: MFC r217911: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:01:34 2011 (r219112) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:02:46 2011 (r219113) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1377,6 +1378,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:01:34 2011 (r219112) +++ stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:02:46 2011 (r219113) @@ -176,6 +176,7 @@ #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:04:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C4371065672; Tue, 1 Mar 2011 00:04:35 +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 14D928FC2E; Tue, 1 Mar 2011 00:04: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 p2104YWg062948; Tue, 1 Mar 2011 00:04:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2104YeB062946; Tue, 1 Mar 2011 00:04:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010004.p2104YeB062946@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219114 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:04:35 -0000 Author: yongari Date: Tue Mar 1 00:04:34 2011 New Revision: 219114 URL: http://svn.freebsd.org/changeset/base/219114 Log: MFC r218289: Disable TX IP checksum offloading for RTL8168C controllers. The controller in question generates frames with bad IP checksum value if packets contain IP options. For instance, packets generated by ping(8) with record route option have wrong IP checksum value. The controller correctly computes checksum for normal TCP/UDP packets though. There are two known RTL8168/8111C variants in market and the issue I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure RL_HWREV_8168C also has the same issue but it would be better to assume it has the same issue since they shall share same core. RTL8102E which is supposed to be released at the time of RTL8168/8111C announcement does not have the issue. Tested by: Konstantin V. Krotov ( kkv <> insysnet dot ru ) Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Tue Mar 1 00:02:46 2011 (r219113) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:04:34 2011 (r219114) @@ -1527,7 +1527,16 @@ re_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = re_ioctl; ifp->if_start = re_start; - ifp->if_hwassist = RE_CSUM_FEATURES | CSUM_TSO; + /* + * RTL8168/8111C generates wrong IP checksummed frame if the + * packet has IP options so disable TX IP checksum offloading. + */ + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || + sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist = CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; @@ -3209,6 +3218,7 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; + uint32_t rev; int error = 0; switch (command) { @@ -3294,9 +3304,14 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - ifp->if_hwassist |= RE_CSUM_FEATURES; - else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { + rev = sc->rl_hwrev->rl_rev; + if (rev == RL_HWREV_8168C || + rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist |= RE_CSUM_FEATURES; + } else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:05:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 312DE106564A; Tue, 1 Mar 2011 00:05:47 +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 05BA48FC19; Tue, 1 Mar 2011 00:05: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 p2105kMH063089; Tue, 1 Mar 2011 00:05:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2105kRh063087; Tue, 1 Mar 2011 00:05:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010005.p2105kRh063087@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219115 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:05:47 -0000 Author: yongari Date: Tue Mar 1 00:05:46 2011 New Revision: 219115 URL: http://svn.freebsd.org/changeset/base/219115 Log: MFC r218289: Disable TX IP checksum offloading for RTL8168C controllers. The controller in question generates frames with bad IP checksum value if packets contain IP options. For instance, packets generated by ping(8) with record route option have wrong IP checksum value. The controller correctly computes checksum for normal TCP/UDP packets though. There are two known RTL8168/8111C variants in market and the issue I observed happened on RL_HWREV_8168C_SPIN2. I'm not sure RL_HWREV_8168C also has the same issue but it would be better to assume it has the same issue since they shall share same core. RTL8102E which is supposed to be released at the time of RTL8168/8111C announcement does not have the issue. Tested by: Konstantin V. Krotov ( kkv <> insysnet dot ru ) Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:04:34 2011 (r219114) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:05:46 2011 (r219115) @@ -1528,7 +1528,16 @@ re_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = re_ioctl; ifp->if_start = re_start; - ifp->if_hwassist = RE_CSUM_FEATURES | CSUM_TSO; + /* + * RTL8168/8111C generates wrong IP checksummed frame if the + * packet has IP options so disable TX IP checksum offloading. + */ + if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C || + sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist = CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP; + ifp->if_hwassist |= CSUM_TSO; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4; ifp->if_capenable = ifp->if_capabilities; ifp->if_init = re_init; @@ -3203,6 +3212,7 @@ re_ioctl(struct ifnet *ifp, u_long comma struct rl_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; + uint32_t rev; int error = 0; switch (command) { @@ -3288,9 +3298,14 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; - if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) - ifp->if_hwassist |= RE_CSUM_FEATURES; - else + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) { + rev = sc->rl_hwrev->rl_rev; + if (rev == RL_HWREV_8168C || + rev == RL_HWREV_8168C_SPIN2) + ifp->if_hwassist |= CSUM_TCP | CSUM_UDP; + else + ifp->if_hwassist |= RE_CSUM_FEATURES; + } else ifp->if_hwassist &= ~RE_CSUM_FEATURES; reinit = 1; } From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:07:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1107106564A; Tue, 1 Mar 2011 00:07:38 +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 8571F8FC08; Tue, 1 Mar 2011 00:07: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 p2107cc0063281; Tue, 1 Mar 2011 00:07:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2107chi063278; Tue, 1 Mar 2011 00:07:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010007.p2107chi063278@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219116 - in stable/8/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:07:38 -0000 Author: yongari Date: Tue Mar 1 00:07:38 2011 New Revision: 219116 URL: http://svn.freebsd.org/changeset/base/219116 Log: MFC r218760: Add initial support for RTL8401E PCIe Fast Ethernet. PR: 154789 Modified: stable/8/sys/dev/re/if_re.c stable/8/sys/pci/if_rlreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Tue Mar 1 00:05:46 2011 (r219115) +++ stable/8/sys/dev/re/if_re.c Tue Mar 1 00:07:38 2011 (r219116) @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1377,6 +1378,7 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8401E: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1502,8 +1504,11 @@ re_attach(device_t dev) } /* Take PHY out of power down mode. */ - if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) { CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); + if (hw_rev->rl_rev == RL_HWREV_8401E) + CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) & ~0x08); + } if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); Modified: stable/8/sys/pci/if_rlreg.h ============================================================================== --- stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:05:46 2011 (r219115) +++ stable/8/sys/pci/if_rlreg.h Tue Mar 1 00:07:38 2011 (r219116) @@ -160,6 +160,7 @@ #define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 #define RL_HWREV_8102EL 0x24800000 #define RL_HWREV_8102EL_SPIN1 0x24C00000 #define RL_HWREV_8168D 0x28000000 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:08:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18435106566C; Tue, 1 Mar 2011 00:08:50 +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 E0B5A8FC1E; Tue, 1 Mar 2011 00:08: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 p2108nYm063399; Tue, 1 Mar 2011 00:08:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2108nM2063396; Tue, 1 Mar 2011 00:08:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010008.p2108nM2063396@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219117 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:08:50 -0000 Author: yongari Date: Tue Mar 1 00:08:49 2011 New Revision: 219117 URL: http://svn.freebsd.org/changeset/base/219117 Log: MFC r218760: Add initial support for RTL8401E PCIe Fast Ethernet. PR: 154789 Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Tue Mar 1 00:07:38 2011 (r219116) +++ stable/7/sys/dev/re/if_re.c Tue Mar 1 00:08:49 2011 (r219117) @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1378,6 +1379,7 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8401E: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | @@ -1503,8 +1505,11 @@ re_attach(device_t dev) } /* Take PHY out of power down mode. */ - if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) + if ((sc->rl_flags & RL_FLAG_PHYWAKE_PM) != 0) { CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80); + if (hw_rev->rl_rev == RL_HWREV_8401E) + CSR_WRITE_1(sc, 0xD1, CSR_READ_1(sc, 0xD1) & ~0x08); + } if ((sc->rl_flags & RL_FLAG_PHYWAKE) != 0) { re_gmii_writereg(dev, 1, 0x1f, 0); re_gmii_writereg(dev, 1, 0x0e, 0); Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:07:38 2011 (r219116) +++ stable/7/sys/pci/if_rlreg.h Tue Mar 1 00:08:49 2011 (r219117) @@ -160,6 +160,7 @@ #define RL_HWREV_8110S 0x04000000 #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 +#define RL_HWREV_8401E 0x24000000 #define RL_HWREV_8102EL 0x24800000 #define RL_HWREV_8102EL_SPIN1 0x24C00000 #define RL_HWREV_8168D 0x28000000 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:11:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5799106566B; Tue, 1 Mar 2011 00:11:44 +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 99B648FC16; Tue, 1 Mar 2011 00:11: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 p210BiDQ063668; Tue, 1 Mar 2011 00:11:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p210Bi0C063666; Tue, 1 Mar 2011 00:11:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010011.p210Bi0C063666@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219118 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:11:44 -0000 Author: yongari Date: Tue Mar 1 00:11:44 2011 New Revision: 219118 URL: http://svn.freebsd.org/changeset/base/219118 Log: MFC r217914: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: stable/8/share/man/man4/re.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Tue Mar 1 00:08:49 2011 (r219117) +++ stable/8/share/man/man4/re.4 Tue Mar 1 00:11:44 2011 (r219118) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:13:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49E80106566C; Tue, 1 Mar 2011 00:13:51 +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 1E20C8FC1A; Tue, 1 Mar 2011 00:13: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 p210Dps5063886; Tue, 1 Mar 2011 00:13:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p210DpUL063884; Tue, 1 Mar 2011 00:13:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201103010013.p210DpUL063884@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 1 Mar 2011 00:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219119 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 00:13:51 -0000 Author: yongari Date: Tue Mar 1 00:13:50 2011 New Revision: 219119 URL: http://svn.freebsd.org/changeset/base/219119 Log: MFC r217914: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: stable/7/share/man/man4/re.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Mar 1 00:11:44 2011 (r219118) +++ stable/7/share/man/man4/re.4 Tue Mar 1 00:13:50 2011 (r219119) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 00:37:46 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 03:07:25 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 03:08:26 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 03:11:29 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 03:25:18 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 04:21:57 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 08:52:10 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 10:10:51 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 11:04:30 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 11:47:16 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 11:47:52 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:10:56 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:14:28 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:23:37 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:24:49 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:28:27 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:30:23 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:32:08 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 13:35:48 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 14:43:38 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 14:53:37 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 14:53:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1271065798; Tue, 1 Mar 2011 14:53: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 892358FC08; Tue, 1 Mar 2011 14:53:46 +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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 14:53:47 -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-all@FreeBSD.ORG Tue Mar 1 14:54:14 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 15:21:04 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 16:42:29 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 17:15:44 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 17:22:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC6131065670; Tue, 1 Mar 2011 17:22:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 94AEF8FC1C; Tue, 1 Mar 2011 17:22:25 +0000 (UTC) Received: by eyg7 with SMTP id 7so1953979eyg.13 for ; Tue, 01 Mar 2011 09:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UWwJacA8A3wS3HJXB8OQcThxQUwsMJzkXCGBgriTPc0=; b=UjulS1mZ0Kc0M9qzXaaunQAIEpp3cIBaSO1Vmf5+gDLo3QIN3CGpQBitTIi+00hPam OTGfYtw/qh4q5DxVN5wVEMkIOgA0LHpHMdJbmezXzWeo1fm3Qew3QHN4Vxd2NdDvGFKB QCEUldQf5je94NnwrU7f223KeSLTLtBo1CyIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=iHP88OpSEGbS5GUvRsTEj8vn3VrnHQRZI1T6vc1BpCV+kErgzjXqD7rT26Ohvu3d2X fopHYTBfY7HKXJYXr7yjwBn8lzXZTZsq7tum+Clh19O1udhboTlTPJUmfiOgsHmtyynt cfxZfRYWSl684v6orfq96wDPiFwZ3dbckUI/w= MIME-Version: 1.0 Received: by 10.213.29.198 with SMTP id r6mr2785989ebc.48.1298998502351; Tue, 01 Mar 2011 08:55:02 -0800 (PST) Received: by 10.213.23.13 with HTTP; Tue, 1 Mar 2011 08:55:02 -0800 (PST) In-Reply-To: <201102282328.p1SNSZZK059958@svn.freebsd.org> References: <201102282328.p1SNSZZK059958@svn.freebsd.org> Date: Tue, 1 Mar 2011 11:55:02 -0500 Message-ID: From: Ryan Stone To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:22:26 -0000 I'm a bit confused. The 8.2 release notes claim that userland dtrace support was added to 8.2. Is this incorrect? http://www.freebsd.org/releases/8.2R/relnotes.html Userland support for the dtrace(1) subsystem has been added. This allows inspection of userland software itself and its correlation with the kernel, thus allowing a much better picture of what exactly is going on behind the scenes. The dtruss(1) utility has been added and libproc has been updated to support the facility.[r214983] From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 17:37:58 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 17:39:28 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 17:40:33 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 17:47:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2CA2106566B; Tue, 1 Mar 2011 17:47:41 +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 7948B8FC17; Tue, 1 Mar 2011 17:47:41 +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 AB04446B2E; Tue, 1 Mar 2011 12:47:40 -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: Date: Tue, 1 Mar 2011 17:47:39 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201102282328.p1SNSZZK059958@svn.freebsd.org> To: Ryan Stone X-Mailer: Apple Mail (2.1082) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 17:47:41 -0000 On 1 Mar 2011, at 16:55, Ryan Stone wrote: > I'm a bit confused. The 8.2 release notes claim that userland dtrace > support was added to 8.2. Is this incorrect? >=20 > http://www.freebsd.org/releases/8.2R/relnotes.html >=20 > Userland support for the dtrace(1) subsystem has been added. This > allows inspection of userland software itself and its correlation with > the kernel, thus allowing a much better picture of what exactly is > going on behind the scenes. The dtruss(1) utility has been added and > libproc has been updated to support the facility.[r214983] I think that's accurate but slightly misleading; the description of what = is possible above was the case in 8.2, but there was a significant chunk = of stuff not in 8.2 that I would also think of as part of userland = dtrace. So dtruss(1) worked fine, but that relies on tracing of kernel = bits, whereas the userland dtrace stuff I just MFC'd has to do with = userspace components (such as applications, language runtimes, and so = on) can expose their own probes, and be instrumented. So perhaps I = should have said "even more userland DTrace", but realistically, this = was a significant part of what most people would call userland DTrace. Robert= From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 18:05:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA9B1065674; Tue, 1 Mar 2011 18:05:58 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39EFC8FC15; Tue, 1 Mar 2011 18:05: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 p21I5wX5046867; Tue, 1 Mar 2011 18:05:58 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21I5w53046865; Tue, 1 Mar 2011 18:05:58 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201103011805.p21I5w53046865@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 1 Mar 2011 18:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219142 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 18:05:58 -0000 Author: jh Date: Tue Mar 1 18:05:57 2011 New Revision: 219142 URL: http://svn.freebsd.org/changeset/base/219142 Log: MFC r187105 by obrien: Fix issue where ata_atapicmd() can never really return EBUSY which is expected in acd_fixate(). This should fix various problems folks are having with 'burncd' reporting "burncd: ioctl(CDRIOCFIXATE): Input/output error" during the fixate phase when "fixate" is issued together with the "data" command. PR: 95979 Modified: stable/7/sys/dev/ata/ata-queue.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-queue.c ============================================================================== --- stable/7/sys/dev/ata/ata-queue.c Tue Mar 1 17:39:27 2011 (r219141) +++ stable/7/sys/dev/ata/ata-queue.c Tue Mar 1 18:05:57 2011 (r219142) @@ -443,7 +443,8 @@ ata_completed(void *context, int dummy) printf("\n"); } - if ((request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? + if (!request->result && + (request->u.atapi.sense.key & ATA_SENSE_KEY_MASK ? request->u.atapi.sense.key & ATA_SENSE_KEY_MASK : request->error)) request->result = EIO; From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 18:29:43 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 19:01:47 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 20:27:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 165351065675; Tue, 1 Mar 2011 20:27:03 +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 046588FC17; Tue, 1 Mar 2011 20:27: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 p21KR2Kd056796; Tue, 1 Mar 2011 20:27:02 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21KR2js056794; Tue, 1 Mar 2011 20:27:02 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012027.p21KR2js056794@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219143 - stable/8/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:27:03 -0000 Author: dchagin Date: Tue Mar 1 20:27:02 2011 New Revision: 219143 URL: http://svn.freebsd.org/changeset/base/219143 Log: MFC r217743: Style(9) fix. Modified: stable/8/sys/compat/linux/linux_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_signal.c ============================================================================== --- stable/8/sys/compat/linux/linux_signal.c Tue Mar 1 18:05:57 2011 (r219142) +++ stable/8/sys/compat/linux/linux_signal.c Tue Mar 1 20:27:02 2011 (r219143) @@ -526,7 +526,7 @@ linux_kill(struct thread *td, struct lin * Allow signal 0 as a means to check for privileges */ if (!LINUX_SIG_VALID(args->signum) && args->signum != 0) - return EINVAL; + return (EINVAL); if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ) tmp.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)]; From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 20:44:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CA7B106566C; Tue, 1 Mar 2011 20:44:15 +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 ECB3B8FC08; Tue, 1 Mar 2011 20:44: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 p21KiERO058086; Tue, 1 Mar 2011 20:44:14 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21KiEks058073; Tue, 1 Mar 2011 20:44:14 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012044.p21KiEks058073@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219144 - in stable/8/sys: amd64/amd64 amd64/linux32 compat/linprocfs fs/procfs i386/linux kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:44:15 -0000 Author: dchagin Date: Tue Mar 1 20:44:14 2011 New Revision: 219144 URL: http://svn.freebsd.org/changeset/base/219144 Log: MFC r217896: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. Modified: stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/amd64/linux32/linux32_machdep.c stable/8/sys/compat/linprocfs/linprocfs.c stable/8/sys/fs/procfs/procfs_dbregs.c stable/8/sys/fs/procfs/procfs_fpregs.c stable/8/sys/fs/procfs/procfs_map.c stable/8/sys/fs/procfs/procfs_regs.c stable/8/sys/i386/linux/linux_machdep.c stable/8/sys/kern/kern_jail.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/sysent.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/amd64/amd64/vm_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -445,7 +445,7 @@ cpu_set_upcall_kse(struct thread *td, vo cpu_thread_clean(td); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* * Set the trap frame to point at the beginning of the uts * function. @@ -496,7 +496,7 @@ cpu_set_user_tls(struct thread *td, void return (EINVAL); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { td->td_pcb->pcb_gsbase = (register_t)tls_base; return (0); } Modified: stable/8/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/amd64/linux32/linux32_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -231,7 +231,7 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL. */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); return (error); } Modified: stable/8/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/8/sys/compat/linprocfs/linprocfs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/compat/linprocfs/linprocfs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -927,7 +927,7 @@ do { \ #ifdef COMPAT_FREEBSD32 env_vector32 = NULL; - if ((p->p_sysent->sv_flags & SV_ILP32) != 0) { + if (SV_PROC_FLAG(p, SV_ILP32) != 0) { env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, M_TEMP, M_WAITOK); elm_len = sizeof(int32_t); Modified: stable/8/sys/fs/procfs/procfs_dbregs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_dbregs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_dbregs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -107,7 +107,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_fpregs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_fpregs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -106,7 +106,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_map.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_map.c Tue Mar 1 20:44:14 2011 (r219144) @@ -100,8 +100,8 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 - if (curproc->p_sysent->sv_flags & SV_ILP32) { - if (!(p->p_sysent->sv_flags & SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (!(SV_PROC_FLAG(p, SV_ILP32))) return (EOPNOTSUPP); wrap32 = 1; } Modified: stable/8/sys/fs/procfs/procfs_regs.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_regs.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/fs/procfs/procfs_regs.c Tue Mar 1 20:44:14 2011 (r219144) @@ -106,7 +106,7 @@ procfs_doprocregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: stable/8/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/8/sys/i386/linux/linux_machdep.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/i386/linux/linux_machdep.c Tue Mar 1 20:44:14 2011 (r219144) @@ -146,8 +146,8 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) - error = linux_proc_init(td, 0, 0); + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) + error = linux_proc_init(td, 0, 0); return (error); } Modified: stable/8/sys/kern/kern_jail.c ============================================================================== --- stable/8/sys/kern/kern_jail.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/kern/kern_jail.c Tue Mar 1 20:44:14 2011 (r219144) @@ -745,7 +745,7 @@ kern_jail_set(struct thread *td, struct } #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32; error = vfs_copyopt(opts, "host.hostid", &hid32, sizeof(hid32)); @@ -1972,7 +1972,7 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32 = pr->pr_hostid; error = vfs_setopt(opts, "host.hostid", &hid32, sizeof(hid32)); Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/kern/sys_process.c Tue Mar 1 20:44:14 2011 (r219144) @@ -781,7 +781,7 @@ kern_ptrace(struct thread *td, int req, * Set the wrap controls accordingly. */ if (SV_CURPROC_FLAG(SV_ILP32)) { - if (td2->td_proc->p_sysent->sv_flags & SV_ILP32) + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32)) safe = 1; wrap32 = 1; } Modified: stable/8/sys/sys/sysent.h ============================================================================== --- stable/8/sys/sys/sysent.h Tue Mar 1 20:27:02 2011 (r219143) +++ stable/8/sys/sys/sysent.h Tue Mar 1 20:44:14 2011 (r219144) @@ -116,8 +116,10 @@ struct sysentvec { #define SV_AOUT 0x008000 #define SV_ABI_MASK 0xff -#define SV_CURPROC_FLAG(x) (curproc->p_sysent->sv_flags & (x)) -#define SV_CURPROC_ABI() (curproc->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) +#define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) +#define SV_CURPROC_ABI() SV_PROC_ABI(curproc) /* same as ELFOSABI_XXX, to prevent header pollution */ #define SV_ABI_LINUX 3 #define SV_ABI_FREEBSD 9 From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 20:48:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D179D1065674; Tue, 1 Mar 2011 20:48:03 +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 BF52A8FC19; Tue, 1 Mar 2011 20:48: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 p21Km3WN058425; Tue, 1 Mar 2011 20:48:03 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21Km3iq058423; Tue, 1 Mar 2011 20:48:03 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201103012048.p21Km3iq058423@svn.freebsd.org> From: Dmitry Chagin Date: Tue, 1 Mar 2011 20:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219145 - stable/8/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 20:48:03 -0000 Author: dchagin Date: Tue Mar 1 20:48:03 2011 New Revision: 219145 URL: http://svn.freebsd.org/changeset/base/219145 Log: MFC r218005: Style(9) fix. Modified: stable/8/sys/compat/linux/linux_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_misc.c ============================================================================== --- stable/8/sys/compat/linux/linux_misc.c Tue Mar 1 20:44:14 2011 (r219144) +++ stable/8/sys/compat/linux/linux_misc.c Tue Mar 1 20:48:03 2011 (r219145) @@ -886,7 +886,7 @@ linux_waitpid(struct thread *td, struct return copyout(&tmpstat, args->status, sizeof(int)); } - return 0; + return (0); } int From owner-svn-src-all@FreeBSD.ORG Tue Mar 1 20:51:41 2011 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Mar 1 21:16:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCCF6106566C; Tue, 1 Mar 2011 21:16:55 +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 BB1718FC18; Tue, 1 Mar 2011 21:16: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 p21LGtKo060455; Tue, 1 Mar 2011 21:16:55 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LGtT1060452; Tue, 1 Mar 2011 21:16:55 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201103012116.p21LGtT1060452@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 1 Mar 2011 21:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219147 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2011 21:16:56 -0000 Author: edwin Date: Tue Mar 1 21:16:55 2011 New Revision: 219147 URL: http://svn.freebsd.org/changeset/base/219147 Log: Vendor Import of tzdata2011b USA/Mercer County, North Dakota - Moved from Mountain time to Central time. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/northamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Tue Mar 1 20:51:41 2011 (r219146) +++ vendor/tzdata/dist/northamerica Tue Mar 1 21:16:55 2011 (r219147) @@ -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: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Tue Mar  1 20:51:41 2011	(r219146)
+++ vendor/tzdata/dist/zone.tab	Tue Mar  1 21:16:55 2011	(r219147)
@@ -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-all@FreeBSD.ORG  Tue Mar  1 21:20:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1104A1065673;
	Tue,  1 Mar 2011 21:20:04 +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 3419C8FC12;
	Tue,  1 Mar 2011 21:20: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 p21LK2nY060685;
	Tue, 1 Mar 2011 21:20:02 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LK2la060684;
	Tue, 1 Mar 2011 21:20:02 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012120.p21LK2la060684@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:20:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219148 - vendor/tzdata/tzdata2011b
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:20:04 -0000

Author: edwin
Date: Tue Mar  1 21:20:01 2011
New Revision: 219148
URL: http://svn.freebsd.org/changeset/base/219148

Log:
  Tag of tzdata2011b

Added:
  vendor/tzdata/tzdata2011b/
     - copied from r219147, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  1 21:24:51 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar  1 21:29:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25BDB106566C;
	Tue,  1 Mar 2011 21:29:01 +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 137648FC15;
	Tue,  1 Mar 2011 21:29:01 +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 p21LT0DN061427;
	Tue, 1 Mar 2011 21:29:00 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LT0Ab061424;
	Tue, 1 Mar 2011 21:29:00 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012129.p21LT0Ab061424@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:29:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219150 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:29:01 -0000

Author: edwin
Date: Tue Mar  1 21:29:00 2011
New Revision: 219150
URL: http://svn.freebsd.org/changeset/base/219150

Log:
  MFC of 219149, tzdata2011b:
  
  USA/Mercer County, North Dakota - Moved from Mountain time to Central time.

Modified:
  stable/8/share/zoneinfo/northamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/northamerica
==============================================================================
--- stable/8/share/zoneinfo/northamerica	Tue Mar  1 21:24:50 2011	(r219149)
+++ stable/8/share/zoneinfo/northamerica	Tue Mar  1 21:29:00 2011	(r219150)
@@ -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: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Tue Mar  1 21:24:50 2011	(r219149)
+++ stable/8/share/zoneinfo/zone.tab	Tue Mar  1 21:29:00 2011	(r219150)
@@ -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-all@FreeBSD.ORG  Tue Mar  1 21:29:09 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CB1C1065787;
	Tue,  1 Mar 2011 21:29:09 +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 42C4F8FC17;
	Tue,  1 Mar 2011 21:29: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 p21LT962061476;
	Tue, 1 Mar 2011 21:29:09 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LT9hu061473;
	Tue, 1 Mar 2011 21:29:09 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012129.p21LT9hu061473@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:29:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219151 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:29:09 -0000

Author: edwin
Date: Tue Mar  1 21:29:08 2011
New Revision: 219151
URL: http://svn.freebsd.org/changeset/base/219151

Log:
  MFC of 219149, tzdata2011b:
  
  USA/Mercer County, North Dakota - Moved from Mountain time to Central time.

Modified:
  stable/7/share/zoneinfo/northamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/northamerica
==============================================================================
--- stable/7/share/zoneinfo/northamerica	Tue Mar  1 21:29:00 2011	(r219150)
+++ stable/7/share/zoneinfo/northamerica	Tue Mar  1 21:29:08 2011	(r219151)
@@ -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: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Tue Mar  1 21:29:00 2011	(r219150)
+++ stable/7/share/zoneinfo/zone.tab	Tue Mar  1 21:29:08 2011	(r219151)
@@ -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-all@FreeBSD.ORG  Tue Mar  1 21:29:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89AF510656AB;
	Tue,  1 Mar 2011 21:29:16 +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 7743C8FC18;
	Tue,  1 Mar 2011 21:29: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 p21LTGqq061511;
	Tue, 1 Mar 2011 21:29:16 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LTGSI061508;
	Tue, 1 Mar 2011 21:29:16 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201103012129.p21LTGSI061508@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 1 Mar 2011 21:29:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219152 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:29:16 -0000

Author: edwin
Date: Tue Mar  1 21:29:16 2011
New Revision: 219152
URL: http://svn.freebsd.org/changeset/base/219152

Log:
  MFC of 219149, tzdata2011b:
  
  USA/Mercer County, North Dakota - Moved from Mountain time to Central time.

Modified:
  stable/6/share/zoneinfo/northamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/northamerica
==============================================================================
--- stable/6/share/zoneinfo/northamerica	Tue Mar  1 21:29:08 2011	(r219151)
+++ stable/6/share/zoneinfo/northamerica	Tue Mar  1 21:29:16 2011	(r219152)
@@ -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: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Tue Mar  1 21:29:08 2011	(r219151)
+++ stable/6/share/zoneinfo/zone.tab	Tue Mar  1 21:29:16 2011	(r219152)
@@ -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-all@FreeBSD.ORG  Tue Mar  1 21:47:06 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar  1 21:48:22 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Tue Mar  1 21:51:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84E4C106566C;
	Tue,  1 Mar 2011 21:51:32 +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 7209D8FC08;
	Tue,  1 Mar 2011 21:51:32 +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 p21LpWQf063199;
	Tue, 1 Mar 2011 21:51:32 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LpWTq063194;
	Tue, 1 Mar 2011 21:51:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103012151.p21LpWTq063194@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Mar 2011 21:51:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219155 - in stable/8/sys: amd64/linux32
	compat/freebsd32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:51:32 -0000

Author: kib
Date: Tue Mar  1 21:51:32 2011
New Revision: 219155
URL: http://svn.freebsd.org/changeset/base/219155

Log:
  MFC r210431:
  Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() may
  serve as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32.
  
  MFC r210451:
  Use forward declartion for enum uio_seg in imgact.h. This allows to remove
  inclusion of sys/uio.h from the header.
  
  MFC r210498:
  Revert r210451, and the similar part of the r210431. The forward-declaration
  for the enum tag when enum definition is not complete is not allowed by
  C99, and is gcc extension.
  
  MFC r210501:
  Remove unneeded includes.
  
  Requested by:	dchagin

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/compat/freebsd32/freebsd32_misc.c
  stable/8/sys/compat/freebsd32/freebsd32_util.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Tue Mar  1 21:51:32 2011	(r219155)
@@ -60,10 +60,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
-#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -107,105 +106,6 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
-/*
- * Custom version of exec_copyin_args() so that we can translate
- * the pointers.
- */
-static int
-linux_exec_copyin_args(struct image_args *args, char *fname,
-    enum uio_seg segflg, char **argv, char **envv)
-{
-	char *argp, *envp;
-	u_int32_t *p32, arg;
-	size_t length;
-	int error;
-
-	bzero(args, sizeof(*args));
-	if (argv == NULL)
-		return (EFAULT);
-
-	/*
-	 * Allocate temporary demand zeroed space for argument and
-	 *	environment strings
-	 */
-	args->buf = (char *)kmem_alloc_wait(exec_map,
-	    PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
-	if (args->buf == NULL)
-		return (ENOMEM);
-	args->begin_argv = args->buf;
-	args->endp = args->begin_argv;
-	args->stringspace = ARG_MAX;
-
-	args->fname = args->buf + ARG_MAX;
-
-	/*
-	 * Copy the file name.
-	 */
-	error = (segflg == UIO_SYSSPACE) ?
-	    copystr(fname, args->fname, PATH_MAX, &length) :
-	    copyinstr(fname, args->fname, PATH_MAX, &length);
-	if (error != 0)
-		goto err_exit;
-
-	/*
-	 * extract arguments first
-	 */
-	p32 = (u_int32_t *)argv;
-	for (;;) {
-		error = copyin(p32++, &arg, sizeof(arg));
-		if (error)
-			goto err_exit;
-		if (arg == 0)
-			break;
-		argp = PTRIN(arg);
-		error = copyinstr(argp, args->endp, args->stringspace, &length);
-		if (error) {
-			if (error == ENAMETOOLONG)
-				error = E2BIG;
-
-			goto err_exit;
-		}
-		args->stringspace -= length;
-		args->endp += length;
-		args->argc++;
-	}
-
-	args->begin_envv = args->endp;
-
-	/*
-	 * extract environment strings
-	 */
-	if (envv) {
-		p32 = (u_int32_t *)envv;
-		for (;;) {
-			error = copyin(p32++, &arg, sizeof(arg));
-			if (error)
-				goto err_exit;
-			if (arg == 0)
-				break;
-			envp = PTRIN(arg);
-			error = copyinstr(envp, args->endp, args->stringspace,
-			    &length);
-			if (error) {
-				if (error == ENAMETOOLONG)
-					error = E2BIG;
-				goto err_exit;
-			}
-			args->stringspace -= length;
-			args->endp += length;
-			args->envc++;
-		}
-	}
-
-	return (0);
-
-err_exit:
-	kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
-	    PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
-	args->buf = NULL;
-	return (error);
-}
-
 int
 linux_execve(struct thread *td, struct linux_execve_args *args)
 {
@@ -220,8 +120,8 @@ linux_execve(struct thread *td, struct l
 		printf(ARGS(execve, "%s"), path);
 #endif
 
-	error = linux_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
-	    args->envp);
+	error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
+	    args->argp, args->envp);
 	free(path, M_TEMP);
 	if (error == 0)
 		error = kern_execve(td, &eargs, NULL);

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/amd64/linux32/syscalls.master	Tue Mar  1 21:51:32 2011	(r219155)
@@ -54,8 +54,8 @@
 				    l_int mode); }
 9	AUE_LINK	STD	{ int linux_link(char *path, char *to); }
 10	AUE_UNLINK	STD	{ int linux_unlink(char *path); }
-11	AUE_EXECVE	STD	{ int linux_execve(char *path, char **argp, \
-				    char **envp); }
+11	AUE_EXECVE	STD	{ int linux_execve(char *path, u_int32_t *argp, \
+				    u_int32_t *envp); }
 12	AUE_CHDIR	STD	{ int linux_chdir(char *path); }
 13	AUE_NULL	STD	{ int linux_time(l_time_t *tm); }
 14	AUE_MKNOD	STD	{ int linux_mknod(char *path, l_int mode, \

Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar  1 21:51:32 2011	(r219155)
@@ -265,7 +265,7 @@ freebsd32_sigaltstack(struct thread *td,
  * Custom version of exec_copyin_args() so that we can translate
  * the pointers.
  */
-static int
+int
 freebsd32_exec_copyin_args(struct image_args *args, char *fname,
     enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv)
 {

Modified: stable/8/sys/compat/freebsd32/freebsd32_util.h
==============================================================================
--- stable/8/sys/compat/freebsd32/freebsd32_util.h	Tue Mar  1 21:48:22 2011	(r219154)
+++ stable/8/sys/compat/freebsd32/freebsd32_util.h	Tue Mar  1 21:51:32 2011	(r219155)
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -101,5 +102,8 @@ int	freebsd32_copyiniov(struct iovec32 *
 	    struct iovec **iov, int error);
 void	freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32);
 
+struct image_args;
+int freebsd32_exec_copyin_args(struct image_args *args, char *fname,
+	    enum uio_seg segflg, u_int32_t *argv, u_int32_t *envv);
 
 #endif /* !_COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ */

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  1 21:52:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 98421106564A;
	Tue,  1 Mar 2011 21:52:24 +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 6D1EE8FC17;
	Tue,  1 Mar 2011 21:52: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 p21LqOCb063302;
	Tue, 1 Mar 2011 21:52:24 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p21LqOmb063298;
	Tue, 1 Mar 2011 21:52:24 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103012152.p21LqOmb063298@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 1 Mar 2011 21:52:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219156 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 21:52:24 -0000

Author: kib
Date: Tue Mar  1 21:52:24 2011
New Revision: 219156
URL: http://svn.freebsd.org/changeset/base/219156

Log:
  Regen.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -59,8 +59,8 @@ struct linux_unlink_args {
 };
 struct linux_execve_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
-	char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)];
-	char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)];
+	char argp_l_[PADL_(u_int32_t *)]; u_int32_t * argp; char argp_r_[PADR_(u_int32_t *)];
+	char envp_l_[PADL_(u_int32_t *)]; u_int32_t * envp; char envp_r_[PADR_(u_int32_t *)];
 };
 struct linux_chdir_args {
 	char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Tue Mar  1 21:51:32 2011	(r219155)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Tue Mar  1 21:52:24 2011	(r219156)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
  */
 
 #include "opt_compat.h"

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  1 22:07:26 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92B37106566B;
	Tue,  1 Mar 2011 22:07:26 +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 3AA118FC08;
	Tue,  1 Mar 2011 22:07:25 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id B2262CA940;
	Wed,  2 Mar 2011 01:07:22 +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 304889339; Wed, 02 Mar 2011 01:07:22 +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
	p21M7MWu021926; Wed, 2 Mar 2011 01:07:22 +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 p21M7HLZ021925; 
	Wed, 2 Mar 2011 01:07:17 +0300 (MSK) (envelope-from dchagin)
Date: Wed, 2 Mar 2011 01:07:15 +0300
From: Chagin Dmitry 
To: Konstantin Belousov 
Message-ID: <20110301220715.GA21912@dchagin.static.corbina.ru>
References: <201103012151.p21LpWTq063194@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft"
Content-Disposition: inline
In-Reply-To: <201103012151.p21LpWTq063194@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219155 - in stable/8/sys: amd64/linux32
 compat/freebsd32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 01 Mar 2011 22:07:26 -0000


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

On Tue, Mar 01, 2011 at 09:51:32PM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Tue Mar  1 21:51:32 2011
> New Revision: 219155
> URL: http://svn.freebsd.org/changeset/base/219155
>=20
> Log:
>   MFC r210431:
>   Remove the linux_exec_copyin_args(), freebsd32_exec_copyin_args() may
>   serve as well. COMPAT_FREEBSD32 is a prerequisite for COMPAT_LINUX32.
>  =20
>   MFC r210451:
>   Use forward declartion for enum uio_seg in imgact.h. This allows to rem=
ove
>   inclusion of sys/uio.h from the header.
>  =20
>   MFC r210498:
>   Revert r210451, and the similar part of the r210431. The forward-declar=
ation
>   for the enum tag when enum definition is not complete is not allowed by
>   C99, and is gcc extension.
>  =20
>   MFC r210501:
>   Remove unneeded includes.
>  =20
>   Requested by:	dchagin

thnx!!

--=20
Have fun!
chd

--/04w6evG8XlLl3ft
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk1tbhAACgkQ0t2Tb3OO/O3cuQCbBEp16TDU6+LX/Y/LlGsmdAMe
yMUAoI78g1Z4pWE7qrxtTo6FGJInvs6T
=POop
-----END PGP SIGNATURE-----

--/04w6evG8XlLl3ft--

From owner-svn-src-all@FreeBSD.ORG  Tue Mar  1 22:44:43 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 00:24:08 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 00:29:14 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 00:29:14 -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-all@FreeBSD.ORG  Wed Mar  2 00:36:28 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A0BE7106566C;
	Wed,  2 Mar 2011 00:36:28 +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 85DCD8FC0A;
	Wed,  2 Mar 2011 00:36: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 p220aSP4072103;
	Wed, 2 Mar 2011 00:36:28 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p220aSei072100;
	Wed, 2 Mar 2011 00:36:28 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103020036.p220aSei072100@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 2 Mar 2011 00:36:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219159 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 00:36:28 -0000

Author: kib
Date: Wed Mar  2 00:36:28 2011
New Revision: 219159
URL: http://svn.freebsd.org/changeset/base/219159

Log:
  MFC r218972:
  Move the  max_threads_per_proc and max_threads_hits variables to the
  file where they are used. Declare the kern.threads sysctl node at the
  same location. Since no external use for the variables exists, make them
  static.
  
  MFC r218976 (by pluknet):
  Clean up the now unused #include statement.

Modified:
  stable/8/sys/kern/kern_thr.c
  stable/8/sys/kern/kern_thread.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_thr.c
==============================================================================
--- stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thr.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -55,6 +56,16 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
+
+static int max_threads_per_proc = 1500;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW,
+	&max_threads_per_proc, 0, "Limit on threads per proc");
+
+static int max_threads_hits;
+SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
+	&max_threads_hits, 0, "");
+
 #ifdef COMPAT_FREEBSD32
 
 static inline int
@@ -73,9 +84,6 @@ suword_lwpid(void *addr, lwpid_t lwpid)
 #define suword_lwpid	suword
 #endif
 
-extern int max_threads_per_proc;
-extern int max_threads_hits;
-
 static int create_thread(struct thread *td, mcontext_t *ctx,
 			 void (*start_func)(void *), void *arg,
 			 char *stack_base, size_t stack_size,

Modified: stable/8/sys/kern/kern_thread.c
==============================================================================
--- stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:29:14 2011	(r219158)
+++ stable/8/sys/kern/kern_thread.c	Wed Mar  2 00:36:28 2011	(r219159)
@@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -64,16 +63,6 @@ __FBSDID("$FreeBSD$");
  */
 static uma_zone_t thread_zone;
 
-SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, "thread allocation");
-
-int max_threads_per_proc = 1500;
-SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_per_proc, CTLFLAG_RW,
-	&max_threads_per_proc, 0, "Limit on threads per proc");
-
-int max_threads_hits;
-SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD,
-	&max_threads_hits, 0, "");
-
 TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads);
 static struct mtx zombie_lock;
 MTX_SYSINIT(zombie_lock, &zombie_lock, "zombie lock", MTX_SPIN);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:01:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 99552106564A;
	Wed,  2 Mar 2011 06:01:49 +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 6B03E8FC0C;
	Wed,  2 Mar 2011 06:01: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 p2261nms082355;
	Wed, 2 Mar 2011 06:01:49 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2261nWi082353;
	Wed, 2 Mar 2011 06:01:49 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020601.p2261nWi082353@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:01:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219160 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:01:50 -0000

Author: dchagin
Date: Wed Mar  2 06:01:49 2011
New Revision: 219160
URL: http://svn.freebsd.org/changeset/base/219160

Log:
  MFC r218028:
  To avoid excessive code duplication move struct rusage translation
  to a separate function.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 00:36:28 2011	(r219159)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
@@ -106,6 +106,28 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
+static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
+{
+	lru->ru_utime.tv_sec = ru->ru_utime.tv_sec;
+	lru->ru_utime.tv_usec = ru->ru_utime.tv_usec;
+	lru->ru_stime.tv_sec = ru->ru_stime.tv_sec;
+	lru->ru_stime.tv_usec = ru->ru_stime.tv_usec;
+	lru->ru_maxrss = ru->ru_maxrss;
+	lru->ru_ixrss = ru->ru_ixrss;
+	lru->ru_idrss = ru->ru_idrss;
+	lru->ru_isrss = ru->ru_isrss;
+	lru->ru_minflt = ru->ru_minflt;
+	lru->ru_majflt = ru->ru_majflt;
+	lru->ru_nswap = ru->ru_nswap;
+	lru->ru_inblock = ru->ru_inblock;
+	lru->ru_oublock = ru->ru_oublock;
+	lru->ru_msgsnd = ru->ru_msgsnd;
+	lru->ru_msgrcv = ru->ru_msgrcv;
+	lru->ru_nsignals = ru->ru_nsignals;
+	lru->ru_nvcsw = ru->ru_nvcsw;
+	lru->ru_nivcsw = ru->ru_nivcsw;
+}
+
 int
 linux_execve(struct thread *td, struct linux_execve_args *args)
 {
@@ -1124,24 +1146,7 @@ linux_getrusage(struct thread *td, struc
 	if (error != 0)
 		return (error);
 	if (uap->rusage != NULL) {
-		s32.ru_utime.tv_sec = s.ru_utime.tv_sec;
-		s32.ru_utime.tv_usec = s.ru_utime.tv_usec;
-		s32.ru_stime.tv_sec = s.ru_stime.tv_sec;
-		s32.ru_stime.tv_usec = s.ru_stime.tv_usec;
-		s32.ru_maxrss = s.ru_maxrss;
-		s32.ru_ixrss = s.ru_ixrss;
-		s32.ru_idrss = s.ru_idrss;
-		s32.ru_isrss = s.ru_isrss;
-		s32.ru_minflt = s.ru_minflt;
-		s32.ru_majflt = s.ru_majflt;
-		s32.ru_nswap = s.ru_nswap;
-		s32.ru_inblock = s.ru_inblock;
-		s32.ru_oublock = s.ru_oublock;
-		s32.ru_msgsnd = s.ru_msgsnd;
-		s32.ru_msgrcv = s.ru_msgrcv;
-		s32.ru_nsignals = s.ru_nsignals;
-		s32.ru_nvcsw = s.ru_nvcsw;
-		s32.ru_nivcsw = s.ru_nivcsw;
+		bsd_to_linux_rusage(&s, &s32);
 		error = copyout(&s32, uap->rusage, sizeof(s32));
 	}
 	return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:03:54 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4E371065673;
	Wed,  2 Mar 2011 06:03:54 +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 D11208FC15;
	Wed,  2 Mar 2011 06: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 p2263sTe082447;
	Wed, 2 Mar 2011 06:03:54 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2263sKa082442;
	Wed, 2 Mar 2011 06:03:54 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020603.p2263sKa082442@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:03:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219161 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:03:55 -0000

Author: dchagin
Date: Wed Mar  2 06:03:54 2011
New Revision: 219161
URL: http://svn.freebsd.org/changeset/base/219161

Log:
  MFC r218030:
  Implement a variation of the linux_common_wait() which should
  be used by linuxolator itself.
  
  Move linux_wait4() to MD path as it requires native struct
  rusage translation to struct l_rusage on linux32/amd64.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/compat/linux/linux_misc.h
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -66,6 +67,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1268,3 +1270,44 @@ linux_set_thread_area(struct thread *td,
 
 	return (0);
 }
+
+int
+linux_wait4(struct thread *td, struct linux_wait4_args *args)
+{
+	int error, options;
+	struct rusage ru, *rup;
+	struct l_rusage lru;
+	struct proc *p;
+
+#ifdef DEBUG
+	if (ldebug(wait4))
+		printf(ARGS(wait4, "%d, %p, %d, %p"),
+		    args->pid, (void *)args->status, args->options,
+		    (void *)args->rusage);
+#endif
+
+	options = (args->options & (WNOHANG | WUNTRACED));
+	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
+	if (args->options & __WCLONE)
+		options |= WLINUXCLONE;
+
+	if (args->rusage != NULL)
+		rup = &ru;
+	else
+		rup = NULL;
+	error = linux_common_wait(td, args->pid, args->status, options, rup);
+	if (error)
+		return (error);
+
+	p = td->td_proc;
+	PROC_LOCK(p);
+	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
+	PROC_UNLOCK(p);
+
+	if (args->rusage != NULL) {
+		bsd_to_linux_rusage(rup, &lru);
+		error = copyout(&lru, args->rusage, sizeof(lru));
+	}
+
+	return (error);
+}

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -847,35 +847,17 @@ linux_futimesat(struct thread *td, struc
 }
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
 
-#define __WCLONE 0x80000000
-
 int
-linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
+linux_common_wait(struct thread *td, int pid, int *status,
+    int options, struct rusage *ru)
 {
-	int error, options, tmpstat;
-
-#ifdef DEBUG
-	if (ldebug(waitpid))
-		printf(ARGS(waitpid, "%d, %p, %d"),
-		    args->pid, (void *)args->status, args->options);
-#endif
-	/*
-	 * this is necessary because the test in kern_wait doesn't work
-	 * because we mess with the options here
-	 */
-	if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
-		return (EINVAL);
+	int error, tmpstat;
 
-	options = (args->options & (WNOHANG | WUNTRACED));
-	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
-	if (args->options & __WCLONE)
-		options |= WLINUXCLONE;
-
-	error = kern_wait(td, args->pid, &tmpstat, options, NULL);
+	error = kern_wait(td, pid, &tmpstat, options, ru);
 	if (error)
-		return error;
+		return (error);
 
-	if (args->status) {
+	if (status) {
 		tmpstat &= 0xffff;
 		if (WIFSIGNALED(tmpstat))
 			tmpstat = (tmpstat & 0xffffff80) |
@@ -883,60 +865,38 @@ linux_waitpid(struct thread *td, struct 
 		else if (WIFSTOPPED(tmpstat))
 			tmpstat = (tmpstat & 0xffff00ff) |
 			    (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8);
-		return copyout(&tmpstat, args->status, sizeof(int));
+		error = copyout(&tmpstat, status, sizeof(int));
 	}
 
-	return (0);
+	return (error);
 }
 
 int
-linux_wait4(struct thread *td, struct linux_wait4_args *args)
+linux_waitpid(struct thread *td, struct linux_waitpid_args *args)
 {
-	int error, options, tmpstat;
-	struct rusage ru, *rup;
-	struct proc *p;
-
+	int options;
+ 
 #ifdef DEBUG
-	if (ldebug(wait4))
-		printf(ARGS(wait4, "%d, %p, %d, %p"),
-		    args->pid, (void *)args->status, args->options,
-		    (void *)args->rusage);
+	if (ldebug(waitpid))
+		printf(ARGS(waitpid, "%d, %p, %d"),
+		    args->pid, (void *)args->status, args->options);
 #endif
-
+	/*
+	 * this is necessary because the test in kern_wait doesn't work
+	 * because we mess with the options here
+	 */
+	if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE))
+		return (EINVAL);
+   
 	options = (args->options & (WNOHANG | WUNTRACED));
 	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
 	if (args->options & __WCLONE)
 		options |= WLINUXCLONE;
 
-	if (args->rusage != NULL)
-		rup = &ru;
-	else
-		rup = NULL;
-	error = kern_wait(td, args->pid, &tmpstat, options, rup);
-	if (error)
-		return error;
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
-	if (args->status) {
-		tmpstat &= 0xffff;
-		if (WIFSIGNALED(tmpstat))
-			tmpstat = (tmpstat & 0xffffff80) |
-			    BSD_TO_LINUX_SIGNAL(WTERMSIG(tmpstat));
-		else if (WIFSTOPPED(tmpstat))
-			tmpstat = (tmpstat & 0xffff00ff) |
-			    (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8);
-		error = copyout(&tmpstat, args->status, sizeof(int));
-	}
-	if (args->rusage != NULL && error == 0)
-		error = copyout(&ru, args->rusage, sizeof(ru));
-
-	return (error);
+	return (linux_common_wait(td, args->pid, args->status, options, NULL));
 }
 
+
 int
 linux_mknod(struct thread *td, struct linux_mknod_args *args)
 {

Modified: stable/8/sys/compat/linux/linux_misc.h
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.h	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/compat/linux/linux_misc.h	Wed Mar  2 06:03:54 2011	(r219161)
@@ -67,4 +67,9 @@ extern const char *linux_platform;
 
 extern int stclohz;
 
+#define __WCLONE 0x80000000
+
+int linux_common_wait(struct thread *td, int pid, int *status,
+			int options, struct rusage *ru);
+
 #endif	/* _LINUX_MISC_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:01:49 2011	(r219160)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:03:54 2011	(r219161)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1312,3 +1313,40 @@ linux_mq_getsetattr(struct thread *td, s
 #endif
 }
 
+int
+linux_wait4(struct thread *td, struct linux_wait4_args *args)
+{
+	int error, options;
+	struct rusage ru, *rup;
+	struct proc *p;
+
+#ifdef DEBUG
+	if (ldebug(wait4))
+		printf(ARGS(wait4, "%d, %p, %d, %p"),
+		    args->pid, (void *)args->status, args->options,
+		    (void *)args->rusage);
+#endif
+
+	options = (args->options & (WNOHANG | WUNTRACED));
+	/* WLINUXCLONE should be equal to __WCLONE, but we make sure */
+	if (args->options & __WCLONE)
+		options |= WLINUXCLONE;
+
+	if (args->rusage != NULL)
+		rup = &ru;
+	else
+		rup = NULL;
+	error = linux_common_wait(td, args->pid, args->status, options, rup);
+	if (error)
+		return (error);
+
+	p = td->td_proc;
+	PROC_LOCK(p);
+	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
+	PROC_UNLOCK(p);
+
+	if (args->rusage != NULL)
+		error = copyout(&ru, args->rusage, sizeof(ru));
+
+	return (error);
+}

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:06:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C8061065672;
	Wed,  2 Mar 2011 06:06:38 +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 49C298FC13;
	Wed,  2 Mar 2011 06:06: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 p2266cA3082552;
	Wed, 2 Mar 2011 06:06:38 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2266cTJ082550;
	Wed, 2 Mar 2011 06:06:38 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020606.p2266cTJ082550@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:06:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219162 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:06:38 -0000

Author: dchagin
Date: Wed Mar  2 06:06:38 2011
New Revision: 219162
URL: http://svn.freebsd.org/changeset/base/219162

Log:
  MFC r218031:
  Style(9) fixes.

Modified:
  stable/8/sys/compat/linux/linux_misc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:03:54 2011	(r219161)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:06:38 2011	(r219162)
@@ -160,7 +160,7 @@ linux_sysinfo(struct thread *td, struct 
 	sysinfo.freebig = 0;
 	sysinfo.mem_unit = 1;
 
-	return copyout(&sysinfo, args->info, sizeof(sysinfo));
+	return (copyout(&sysinfo, args->info, sizeof(sysinfo)));
 }
 
 int
@@ -216,7 +216,7 @@ linux_brk(struct thread *td, struct linu
 	else
 		td->td_retval[0] = (long)old;
 
-	return 0;
+	return (0);
 }
 
 #if defined(__i386__)
@@ -468,7 +468,7 @@ cleanup:
 		vm_map_remove(kernel_map, (vm_offset_t)a_out,
 		    (vm_offset_t)a_out + PAGE_SIZE);
 
-	return error;
+	return (error);
 }
 
 #endif	/* __i386__ */
@@ -562,7 +562,7 @@ select_out:
 	if (ldebug(select))
 		printf(LMSG("select_out -> %d"), error);
 #endif
-	return error;
+	return (error);
 }
 
 int
@@ -602,7 +602,7 @@ linux_mremap(struct thread *td, struct l
 
 	if (args->new_len > args->old_len) {
 		td->td_retval[0] = 0;
-		return ENOMEM;
+		return (ENOMEM);
 	}
 
 	if (args->new_len < args->old_len) {
@@ -613,7 +613,7 @@ linux_mremap(struct thread *td, struct l
 	}
 
 	td->td_retval[0] = error ? 0 : (uintptr_t)args->addr;
-	return error;
+	return (error);
 }
 
 #define LINUX_MS_ASYNC       0x0001
@@ -629,7 +629,7 @@ linux_msync(struct thread *td, struct li
 	bsd_args.len = (uintptr_t)args->len;
 	bsd_args.flags = args->fl & ~LINUX_MS_SYNC;
 
-	return msync(td, &bsd_args);
+	return (msync(td, &bsd_args));
 }
 
 int
@@ -647,9 +647,9 @@ linux_time(struct thread *td, struct lin
 	microtime(&tv);
 	tm = tv.tv_sec;
 	if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm))))
-		return error;
+		return (error);
 	td->td_retval[0] = tm;
-	return 0;
+	return (0);
 }
 
 struct l_times_argv {
@@ -702,12 +702,12 @@ linux_times(struct thread *td, struct li
 		tms.tms_cstime = CONVTCK(cstime);
 
 		if ((error = copyout(&tms, args->buf, sizeof(tms))))
-			return error;
+			return (error);
 	}
 
 	microuptime(&tv);
 	td->td_retval[0] = (int)CONVTCK(tv);
-	return 0;
+	return (0);
 }
 
 int
@@ -766,7 +766,7 @@ linux_utime(struct thread *td, struct li
 	if (args->times) {
 		if ((error = copyin(args->times, &lut, sizeof lut))) {
 			LFREEPATH(fname);
-			return error;
+			return (error);
 		}
 		tv[0].tv_sec = lut.l_actime;
 		tv[0].tv_usec = 0;
@@ -1003,11 +1003,11 @@ linux_personality(struct thread *td, str
 		printf(ARGS(personality, "%lu"), (unsigned long)args->per);
 #endif
 	if (args->per != 0)
-		return EINVAL;
+		return (EINVAL);
 
 	/* Yes Jim, it's still a Linux... */
 	td->td_retval[0] = 0;
-	return 0;
+	return (0);
 }
 
 struct l_itimerval {
@@ -1085,7 +1085,7 @@ linux_nice(struct thread *td, struct lin
 	bsd_args.which = PRIO_PROCESS;
 	bsd_args.who = 0;		/* current process */
 	bsd_args.prio = args->inc;
-	return setpriority(td, &bsd_args);
+	return (setpriority(td, &bsd_args));
 }
 
 int
@@ -1312,12 +1312,12 @@ linux_sched_setscheduler(struct thread *
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	bsd.pid = args->pid;
 	bsd.param = (struct sched_param *)args->param;
-	return sched_setscheduler(td, &bsd);
+	return (sched_setscheduler(td, &bsd));
 }
 
 int
@@ -1347,7 +1347,7 @@ linux_sched_getscheduler(struct thread *
 		break;
 	}
 
-	return error;
+	return (error);
 }
 
 int
@@ -1372,9 +1372,9 @@ linux_sched_get_priority_max(struct thre
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return sched_get_priority_max(td, &bsd);
+	return (sched_get_priority_max(td, &bsd));
 }
 
 int
@@ -1399,9 +1399,9 @@ linux_sched_get_priority_min(struct thre
 		bsd.policy = SCHED_RR;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return sched_get_priority_min(td, &bsd);
+	return (sched_get_priority_min(td, &bsd));
 }
 
 #define REBOOT_CAD_ON	0x89abcdef
@@ -1426,7 +1426,7 @@ linux_reboot(struct thread *td, struct l
 #endif
 
 	if (args->magic1 != REBOOT_MAGIC1)
-		return EINVAL;
+		return (EINVAL);
 
 	switch (args->magic2) {
 	case REBOOT_MAGIC2:
@@ -1434,7 +1434,7 @@ linux_reboot(struct thread *td, struct l
 	case REBOOT_MAGIC2B:
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
 
 	switch (args->cmd) {
@@ -1452,9 +1452,9 @@ linux_reboot(struct thread *td, struct l
 		bsd_args.opt = RB_POWEROFF;
 		break;
 	default:
-		return EINVAL;
+		return (EINVAL);
 	}
-	return reboot(td, &bsd_args);
+	return (reboot(td, &bsd_args));
 }
 
 
@@ -1592,7 +1592,7 @@ linux_getsid(struct thread *td, struct l
 #endif
 
 	bsd.pid = args->pid;
-	return getsid(td, &bsd);
+	return (getsid(td, &bsd));
 }
 
 int
@@ -1617,7 +1617,7 @@ linux_getpriority(struct thread *td, str
 	bsd_args.who = args->who;
 	error = getpriority(td, &bsd_args);
 	td->td_retval[0] = 20 - td->td_retval[0];
-	return error;
+	return (error);
 }
 
 int

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:08:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DC531065670;
	Wed,  2 Mar 2011 06:08: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 6BF6E8FC13;
	Wed,  2 Mar 2011 06:08: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 p2268g0h082638;
	Wed, 2 Mar 2011 06:08:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2268giO082636;
	Wed, 2 Mar 2011 06:08:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020608.p2268giO082636@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:08:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219163 - stable/8/sys/amd64/linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:08:42 -0000

Author: dchagin
Date: Wed Mar  2 06:08:42 2011
New Revision: 219163
URL: http://svn.freebsd.org/changeset/base/219163

Log:
  MFC r218059:
  Fix my style(9) bg introduced in r218028.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:06:38 2011	(r219162)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
@@ -108,8 +108,10 @@ bsd_to_linux_sigaltstack(int bsa)
 	return (lsa);
 }
 
-static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
+static void
+bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru)
 {
+
 	lru->ru_utime.tv_sec = ru->ru_utime.tv_sec;
 	lru->ru_utime.tv_usec = ru->ru_utime.tv_usec;
 	lru->ru_stime.tv_sec = ru->ru_stime.tv_sec;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:09:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8C3B1065674;
	Wed,  2 Mar 2011 06:09:52 +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 BCCDD8FC08;
	Wed,  2 Mar 2011 06:09:52 +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 p2269q24082708;
	Wed, 2 Mar 2011 06:09:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2269q2Y082705;
	Wed, 2 Mar 2011 06:09:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020609.p2269q2Y082705@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:09:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219164 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:09:53 -0000

Author: dchagin
Date: Wed Mar  2 06:09:52 2011
New Revision: 219164
URL: http://svn.freebsd.org/changeset/base/219164

Log:
  MFC r218100:
  The kern_wait() code already removes the SIGCHLD signal for the waited
  process. Removing other SIGCHLD signals is not needed and may cause
  problems.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 06:09:52 2011	(r219164)
@@ -1279,7 +1279,6 @@ linux_wait4(struct thread *td, struct li
 	int error, options;
 	struct rusage ru, *rup;
 	struct l_rusage lru;
-	struct proc *p;
 
 #ifdef DEBUG
 	if (ldebug(wait4))
@@ -1300,12 +1299,6 @@ linux_wait4(struct thread *td, struct li
 	error = linux_common_wait(td, args->pid, args->status, options, rup);
 	if (error)
 		return (error);
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
 	if (args->rusage != NULL) {
 		bsd_to_linux_rusage(rup, &lru);
 		error = copyout(&lru, args->rusage, sizeof(lru));

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:08:42 2011	(r219163)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 06:09:52 2011	(r219164)
@@ -1318,7 +1318,6 @@ linux_wait4(struct thread *td, struct li
 {
 	int error, options;
 	struct rusage ru, *rup;
-	struct proc *p;
 
 #ifdef DEBUG
 	if (ldebug(wait4))
@@ -1339,12 +1338,6 @@ linux_wait4(struct thread *td, struct li
 	error = linux_common_wait(td, args->pid, args->status, options, rup);
 	if (error)
 		return (error);
-
-	p = td->td_proc;
-	PROC_LOCK(p);
-	sigqueue_delete(&p->p_sigqueue, SIGCHLD);
-	PROC_UNLOCK(p);
-
 	if (args->rusage != NULL)
 		error = copyout(&ru, args->rusage, sizeof(ru));
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:11:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72C72106567A;
	Wed,  2 Mar 2011 06:11: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 4712B8FC2E;
	Wed,  2 Mar 2011 06:11: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 p226BgrH082813;
	Wed, 2 Mar 2011 06:11:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226Bg6B082810;
	Wed, 2 Mar 2011 06:11:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020611.p226Bg6B082810@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:11:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219165 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:11:42 -0000

Author: dchagin
Date: Wed Mar  2 06:11:41 2011
New Revision: 219165
URL: http://svn.freebsd.org/changeset/base/219165

Log:
  MFC r218101:
  Change linux futex syscall definition to match actual linux one.

Modified:
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/i386/linux/syscalls.master
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:09:52 2011	(r219164)
+++ stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:11:41 2011	(r219165)
@@ -405,8 +405,8 @@
 237	AUE_NULL	STD	{ int linux_fremovexattr(void); }
 238	AUE_NULL	STD	{ int linux_tkill(int tid, int sig); }
 239	AUE_SENDFILE	UNIMPL	linux_sendfile64
-240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
-					struct l_timespec *timeout, void *uaddr2, int val3); }
+240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, uint32_t val, \
+					struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); }
 241	AUE_NULL	STD	{ int linux_sched_setaffinity(l_pid_t pid, l_uint len, \
 					l_ulong *user_mask_ptr); }
 242	AUE_NULL	STD	{ int linux_sched_getaffinity(l_pid_t pid, l_uint len, \

Modified: stable/8/sys/i386/linux/syscalls.master
==============================================================================
--- stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:09:52 2011	(r219164)
+++ stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:11:41 2011	(r219165)
@@ -407,8 +407,8 @@
 237	AUE_NULL	STD	{ int linux_fremovexattr(void); }
 238	AUE_NULL	STD	{ int linux_tkill(int tid, int sig); }
 239	AUE_SENDFILE	UNIMPL	linux_sendfile64
-240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, int val, \
-					struct l_timespec *timeout, void *uaddr2, int val3); }
+240	AUE_NULL	STD	{ int linux_sys_futex(void *uaddr, int op, uint32_t val, \
+					struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); }
 241	AUE_NULL	STD	{ int linux_sched_setaffinity(l_pid_t pid, l_uint len, \
 					l_ulong *user_mask_ptr); }
 242	AUE_NULL	STD	{ int linux_sched_getaffinity(l_pid_t pid, l_uint len, \

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:13:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65CF2106564A;
	Wed,  2 Mar 2011 06:13:04 +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 52EBA8FC0A;
	Wed,  2 Mar 2011 06:13: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 p226D4rG082880;
	Wed, 2 Mar 2011 06:13:04 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226D419082873;
	Wed, 2 Mar 2011 06:13:04 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020613.p226D419082873@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:13:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219166 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:13:04 -0000

Author: dchagin
Date: Wed Mar  2 06:13:03 2011
New Revision: 219166
URL: http://svn.freebsd.org/changeset/base/219166

Log:
  Regen for r219165.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c
  stable/8/sys/i386/linux/linux_proto.h
  stable/8/sys/i386/linux/linux_syscall.h
  stable/8/sys/i386/linux/linux_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -734,10 +734,10 @@ struct linux_tkill_args {
 struct linux_sys_futex_args {
 	char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)];
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
-	char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)];
+	char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)];
 	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
-	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
-	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
+	char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)];
+	char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)];
 };
 struct linux_sched_setaffinity_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219155 2011-03-01 21:51:32Z kib 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #include "opt_compat.h"

Modified: stable/8/sys/i386/linux/linux_proto.h
==============================================================================
--- stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -731,10 +731,10 @@ struct linux_tkill_args {
 struct linux_sys_futex_args {
 	char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)];
 	char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)];
-	char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)];
+	char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)];
 	char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)];
-	char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)];
-	char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)];
+	char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)];
+	char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)];
 };
 struct linux_sched_setaffinity_args {
 	char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
@@ -1277,6 +1277,13 @@ int	linux_vmsplice(struct thread *, stru
 
 #endif /* COMPAT_FREEBSD6 */
 
+
+#ifdef COMPAT_FREEBSD7
+
+#define	nosys	linux_nosys
+
+#endif /* COMPAT_FREEBSD7 */
+
 #define	LINUX_SYS_AUE_linux_fork	AUE_FORK
 #define	LINUX_SYS_AUE_linux_open	AUE_OPEN_RWTC
 #define	LINUX_SYS_AUE_linux_waitpid	AUE_WAIT4

Modified: stable/8/sys/i386/linux/linux_syscall.h
==============================================================================
--- stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/i386/linux/linux_sysent.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:11:41 2011	(r219165)
+++ stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:13:03 2011	(r219166)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/i386/linux/syscalls.master 184789 2008-11-09 10:45:13Z ed 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
  */
 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:18:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72521106566B;
	Wed,  2 Mar 2011 06:18:22 +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 280B88FC13;
	Wed,  2 Mar 2011 06:18: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 p226IMLw083049;
	Wed, 2 Mar 2011 06:18:22 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226IMkA083046;
	Wed, 2 Mar 2011 06:18:22 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020618.p226IMkA083046@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:18:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219167 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:18:22 -0000

Author: dchagin
Date: Wed Mar  2 06:18:21 2011
New Revision: 219167
URL: http://svn.freebsd.org/changeset/base/219167

Log:
  MFC r218117:
  Implement a futex BITSET op.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/compat/linux/linux_futex.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:13:03 2011	(r219166)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:18:21 2011	(r219167)
@@ -79,6 +79,7 @@ struct futex {
 	struct sx	f_lck;
 	uint32_t	*f_uaddr;
 	uint32_t	f_refcount;
+	uint32_t	f_bitset;
 	LIST_ENTRY(futex) f_list;
 	TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc;
 };
@@ -264,15 +265,25 @@ futex_sleep(struct futex *f, struct wait
 }
 
 static int
-futex_wake(struct futex *f, int n)
+futex_wake(struct futex *f, int n, uint32_t bitset)
 {
 	struct waiting_proc *wp, *wpt;
 	int count = 0;
 
+	if (bitset == 0)
+		return (EINVAL);
+
 	FUTEX_ASSERT_LOCKED(f);
 	TAILQ_FOREACH_SAFE(wp, &f->f_waiting_proc, wp_list, wpt) {
 		LINUX_CTR3(sys_futex, "futex_wake uaddr %p wp %p ref %d",
 		    f->f_uaddr, wp, f->f_refcount);
+		/*
+		 * Unless we find a matching bit in
+		 * the bitset, continue searching.
+		 */
+		if (!(wp->wp_futex->f_bitset & bitset))
+			continue;
+
 		wp->wp_flags |= FUTEX_WP_REMOVED;
 		TAILQ_REMOVE(&f->f_waiting_proc, wp, wp_list);
 		wakeup_one(wp);
@@ -325,13 +336,18 @@ futex_requeue(struct futex *f, int n, st
 }
 
 static int
-futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts)
+futex_wait(struct futex *f, struct waiting_proc *wp, struct l_timespec *ts,
+    uint32_t bitset)
 {
 	struct l_timespec timeout = {0, 0};
 	struct timeval tv = {0, 0};
 	int timeout_hz;
 	int error;
 
+	if (bitset == 0)
+		return (EINVAL);
+	f->f_bitset = bitset;
+
 	if (ts != NULL) {
 		error = copyin(ts, &timeout, sizeof(timeout));
 		if (error)
@@ -457,13 +473,18 @@ linux_sys_futex(struct thread *td, struc
 
 	switch (args->op) {
 	case LINUX_FUTEX_WAIT:
+		args->val3 = FUTEX_BITSET_MATCH_ANY;
+		/* FALLTHROUGH */
+
+	case LINUX_FUTEX_WAIT_BITSET:
 
-		LINUX_CTR2(sys_futex, "WAIT val %d uaddr %p",
-		    args->val, args->uaddr);
+		LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d val3 %d",
+		    args->uaddr, args->val, args->val3);
 #ifdef DEBUG
 		if (ldebug(sys_futex))
-			printf(ARGS(sys_futex, "futex_wait val %d uaddr %p"),
-			    args->val, args->uaddr);
+			printf(ARGS(sys_futex,
+			    "futex_wait uaddr %p val %d val3 %d"),
+			    args->uaddr, args->val, args->val3);
 #endif
 		error = futex_get(args->uaddr, &wp, &f, FUTEX_CREATE_WP);
 		if (error)
@@ -476,19 +497,24 @@ linux_sys_futex(struct thread *td, struc
 			return (error);
 		}
 		if (val != args->val) {
-			LINUX_CTR3(sys_futex, "WAIT uaddr %p val %d != uval %d",
-			    args->uaddr, args->val, val);
+			LINUX_CTR4(sys_futex,
+			    "WAIT uaddr %p val %d != uval %d val3 %d",
+			    args->uaddr, args->val, val, args->val3);
 			futex_put(f, wp);
 			return (EWOULDBLOCK);
 		}
 
-		error = futex_wait(f, wp, args->timeout);
+		error = futex_wait(f, wp, args->timeout, args->val3);
 		break;
 
 	case LINUX_FUTEX_WAKE:
+		args->val3 = FUTEX_BITSET_MATCH_ANY;
+		/* FALLTHROUGH */
+
+	case LINUX_FUTEX_WAKE_BITSET:
 
-		LINUX_CTR2(sys_futex, "WAKE val %d uaddr %p",
-		    args->val, args->uaddr);
+		LINUX_CTR3(sys_futex, "WAKE uaddr %p val % d val3 %d",
+		    args->uaddr, args->val, args->val3);
 
 		/*
 		 * XXX: Linux is able to cope with different addresses
@@ -497,8 +523,8 @@ linux_sys_futex(struct thread *td, struc
 		 */
 #ifdef DEBUG
 		if (ldebug(sys_futex))
-			printf(ARGS(sys_futex, "futex_wake val %d uaddr %p"),
-			    args->val, args->uaddr);
+			printf(ARGS(sys_futex, "futex_wake uaddr %p val %d val3 %d"),
+			    args->uaddr, args->val, args->val3);
 #endif
 		error = futex_get(args->uaddr, NULL, &f, FUTEX_DONTCREATE);
 		if (error)
@@ -507,7 +533,7 @@ linux_sys_futex(struct thread *td, struc
 			td->td_retval[0] = 0;
 			return (error);
 		}
-		td->td_retval[0] = futex_wake(f, args->val);
+		td->td_retval[0] = futex_wake(f, args->val, args->val3);
 		futex_put(f, NULL);
 		break;
 
@@ -615,16 +641,16 @@ linux_sys_futex(struct thread *td, struc
 			return (EFAULT);
 		}
 
-		ret = futex_wake(f, args->val);
+		ret = futex_wake(f, args->val, args->val3);
 
 		if (op_ret > 0) {
 			op_ret = 0;
 			nrwake = (int)(unsigned long)args->timeout;
 
 			if (f2 != NULL)
-				op_ret += futex_wake(f2, nrwake);
+				op_ret += futex_wake(f2, nrwake, args->val3);
 			else
-				op_ret += futex_wake(f, nrwake);
+				op_ret += futex_wake(f, nrwake, args->val3);
 			ret += op_ret;
 
 		}
@@ -672,13 +698,6 @@ linux_sys_futex(struct thread *td, struc
 		}
 		return (EINVAL);
 
-	case LINUX_FUTEX_WAIT_BITSET:
-		/* not yet implemented */
-		linux_msg(td,
-			  "linux_sys_futex: "
-			  "op FUTEX_WAIT_BITSET not implemented\n");
-		return (ENOSYS);
-
 	case LINUX_FUTEX_WAIT_REQUEUE_PI:
 		/* not yet implemented */
 		linux_msg(td,
@@ -787,7 +806,7 @@ retry:
 			if (error)
 				return (error);
 			if (f != NULL) {
-				futex_wake(f, 1);
+				futex_wake(f, 1, FUTEX_BITSET_MATCH_ANY);
 				futex_put(f, NULL);
 			}
 		}

Modified: stable/8/sys/compat/linux/linux_futex.h
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:13:03 2011	(r219166)
+++ stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:18:21 2011	(r219167)
@@ -49,6 +49,7 @@ extern struct mtx futex_mtx;
 #define LINUX_FUTEX_UNLOCK_PI		 7
 #define LINUX_FUTEX_TRYLOCK_PI		 8
 #define LINUX_FUTEX_WAIT_BITSET		 9
+#define LINUX_FUTEX_WAKE_BITSET		10
 #define LINUX_FUTEX_WAIT_REQUEUE_PI	11
 
 #define LINUX_FUTEX_PRIVATE_FLAG	128
@@ -72,6 +73,7 @@ extern struct mtx futex_mtx;
 #define	FUTEX_WAITERS		0x80000000
 #define	FUTEX_OWNER_DIED	0x40000000
 #define	FUTEX_TID_MASK		0x3fffffff
+#define	FUTEX_BITSET_MATCH_ANY	0xffffffff
 
 void	release_futexes(struct proc *);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:19:32 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 517861065675;
	Wed,  2 Mar 2011 06:19:32 +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 3F6FB8FC23;
	Wed,  2 Mar 2011 06:19:32 +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 p226JW45083122;
	Wed, 2 Mar 2011 06:19:32 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226JWbK083119;
	Wed, 2 Mar 2011 06:19:32 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020619.p226JWbK083119@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:19:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219168 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:19:32 -0000

Author: dchagin
Date: Wed Mar  2 06:19:31 2011
New Revision: 219168
URL: http://svn.freebsd.org/changeset/base/219168

Log:
  MFC r218118:
  Yet another unimplemented futex operation, print out about it.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/compat/linux/linux_futex.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:18:21 2011	(r219167)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:19:31 2011	(r219168)
@@ -705,6 +705,13 @@ linux_sys_futex(struct thread *td, struc
 			  "op FUTEX_WAIT_REQUEUE_PI not implemented\n");
 		return (ENOSYS);
 
+	case LINUX_FUTEX_CMP_REQUEUE_PI:
+		/* not yet implemented */
+		linux_msg(td,
+			    "linux_sys_futex: "
+			    "op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n");
+		return (ENOSYS);
+
 	default:
 		linux_msg(td,
 			  "linux_sys_futex: unknown op %d\n", args->op);

Modified: stable/8/sys/compat/linux/linux_futex.h
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:18:21 2011	(r219167)
+++ stable/8/sys/compat/linux/linux_futex.h	Wed Mar  2 06:19:31 2011	(r219168)
@@ -51,6 +51,7 @@ extern struct mtx futex_mtx;
 #define LINUX_FUTEX_WAIT_BITSET		 9
 #define LINUX_FUTEX_WAKE_BITSET		10
 #define LINUX_FUTEX_WAIT_REQUEUE_PI	11
+#define LINUX_FUTEX_CMP_REQUEUE_PI	12
 
 #define LINUX_FUTEX_PRIVATE_FLAG	128
 #define LINUX_FUTEX_CLOCK_REALTIME	256

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:21:21 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8A26D106566C;
	Wed,  2 Mar 2011 06:21:21 +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 780BB8FC12;
	Wed,  2 Mar 2011 06:21: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 p226LLZu083220;
	Wed, 2 Mar 2011 06:21:21 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226LLar083218;
	Wed, 2 Mar 2011 06:21:21 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020621.p226LLar083218@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:21:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219169 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:21:21 -0000

Author: dchagin
Date: Wed Mar  2 06:21:21 2011
New Revision: 219169
URL: http://svn.freebsd.org/changeset/base/219169

Log:
  MFC r218646:
  The bitset field of freshly created futex should be initialized
  explicity. Otherwise, REQUEUE operations fails.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:19:31 2011	(r219168)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 06:21:21 2011	(r219169)
@@ -194,6 +194,7 @@ retry:
 		tmpf = malloc(sizeof(*tmpf), M_FUTEX, M_WAITOK | M_ZERO);
 		tmpf->f_uaddr = uaddr;
 		tmpf->f_refcount = 1;
+		tmpf->f_bitset = FUTEX_BITSET_MATCH_ANY;
 		FUTEX_INIT(tmpf);
 		TAILQ_INIT(&tmpf->f_waiting_proc);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:22:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E77561065670;
	Wed,  2 Mar 2011 06:22: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 D58918FC16;
	Wed,  2 Mar 2011 06:22: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 p226MIEX083300;
	Wed, 2 Mar 2011 06:22:18 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226MIEg083298;
	Wed, 2 Mar 2011 06:22:18 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020622.p226MIEg083298@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:22:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219170 - stable/8/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:22:19 -0000

Author: dchagin
Date: Wed Mar  2 06:22:18 2011
New Revision: 219170
URL: http://svn.freebsd.org/changeset/base/219170

Log:
  MFC r218609:
  Remove unused since r134586 thr_exit1() declaration.

Modified:
  stable/8/sys/sys/proc.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/proc.h
==============================================================================
--- stable/8/sys/sys/proc.h	Wed Mar  2 06:21:21 2011	(r219169)
+++ stable/8/sys/sys/proc.h	Wed Mar  2 06:22:18 2011	(r219170)
@@ -897,7 +897,6 @@ int	thread_unsuspend_one(struct thread *
 void	thread_unthread(struct thread *td);
 void	thread_wait(struct proc *p);
 struct thread	*thread_find(struct proc *p, lwpid_t tid);
-void	thr_exit1(void);
 
 #endif	/* _KERNEL */
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:23:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B860106566B;
	Wed,  2 Mar 2011 06:23:20 +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 0FF648FC0A;
	Wed,  2 Mar 2011 06:23: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 p226NJbB083368;
	Wed, 2 Mar 2011 06:23:19 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226NJ4G083365;
	Wed, 2 Mar 2011 06:23:19 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020623.p226NJ4G083365@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:23:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219171 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:23:20 -0000

Author: dchagin
Date: Wed Mar  2 06:23:19 2011
New Revision: 219171
URL: http://svn.freebsd.org/changeset/base/219171

Log:
  MFC r218610:
  The fourth argument of linux_clone is a pointer to the TLS.
  Change clone syscall definition to match actual linux one.

Modified:
  stable/8/sys/amd64/linux32/syscalls.master
  stable/8/sys/i386/linux/syscalls.master
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/syscalls.master
==============================================================================
--- stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:22:18 2011	(r219170)
+++ stable/8/sys/amd64/linux32/syscalls.master	Wed Mar  2 06:23:19 2011	(r219171)
@@ -213,9 +213,8 @@
 118	AUE_FSYNC	NOPROTO	{ int fsync(int fd); }
 119	AUE_SIGRETURN	STD	{ int linux_sigreturn( \
 				    struct l_sigframe *sfp); }
-; linux uses some strange calling convention here so we have to use the dummy arg
 120	AUE_RFORK	STD	{ int linux_clone(l_int flags, void *stack, \
-				    void *parent_tidptr, int dummy, void * child_tidptr); }
+				    void *parent_tidptr, void *tls, void * child_tidptr); }
 121	AUE_SYSCTL	STD	{ int linux_setdomainname(char *name, \
 				    int len); }
 122	AUE_NULL	STD	{ int linux_newuname( \

Modified: stable/8/sys/i386/linux/syscalls.master
==============================================================================
--- stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:22:18 2011	(r219170)
+++ stable/8/sys/i386/linux/syscalls.master	Wed Mar  2 06:23:19 2011	(r219171)
@@ -214,9 +214,8 @@
 118	AUE_FSYNC	NOPROTO	{ int fsync(int fd); }
 119	AUE_SIGRETURN	STD	{ int linux_sigreturn( \
 				    struct l_sigframe *sfp); }
-; linux uses some strange calling convention here so we have to use the dummy arg
 120	AUE_RFORK	STD	{ int linux_clone(l_int flags, void *stack, \
-				    void *parent_tidptr, int dummy, void * child_tidptr); }
+				    void *parent_tidptr, void *tls, void * child_tidptr); }
 121	AUE_SYSCTL	STD	{ int linux_setdomainname(char *name, \
 				    int len); }
 122	AUE_NULL	STD	{ int linux_newuname( \

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 06:24:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C3F0106566C;
	Wed,  2 Mar 2011 06:24:46 +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 795B38FC1B;
	Wed,  2 Mar 2011 06:24: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 p226OkgR083434;
	Wed, 2 Mar 2011 06:24:46 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p226OkHs083427;
	Wed, 2 Mar 2011 06:24:46 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103020624.p226OkHs083427@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 06:24:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219172 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 06:24:46 -0000

Author: dchagin
Date: Wed Mar  2 06:24:46 2011
New Revision: 219172
URL: http://svn.freebsd.org/changeset/base/219172

Log:
  Regen for r219171.

Modified:
  stable/8/sys/amd64/linux32/linux32_proto.h
  stable/8/sys/amd64/linux32/linux32_syscall.h
  stable/8/sys/amd64/linux32/linux32_sysent.c
  stable/8/sys/i386/linux/linux_proto.h
  stable/8/sys/i386/linux/linux_syscall.h
  stable/8/sys/i386/linux/linux_sysent.c

Modified: stable/8/sys/amd64/linux32/linux32_proto.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_proto.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -375,7 +375,7 @@ struct linux_clone_args {
 	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 	char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)];
 	char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)];
-	char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)];
+	char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)];
 	char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)];
 };
 struct linux_setdomainname_args {

Modified: stable/8/sys/amd64/linux32/linux32_syscall.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_syscall.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/amd64/linux32/linux32_sysent.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/amd64/linux32/linux32_sysent.c	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #include "opt_compat.h"

Modified: stable/8/sys/i386/linux/linux_proto.h
==============================================================================
--- stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_proto.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -378,7 +378,7 @@ struct linux_clone_args {
 	char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
 	char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)];
 	char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)];
-	char dummy_l_[PADL_(int)]; int dummy; char dummy_r_[PADR_(int)];
+	char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)];
 	char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)];
 };
 struct linux_setdomainname_args {

Modified: stable/8/sys/i386/linux/linux_syscall.h
==============================================================================
--- stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_syscall.h	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #define	LINUX_SYS_exit	1

Modified: stable/8/sys/i386/linux/linux_sysent.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:23:19 2011	(r219171)
+++ stable/8/sys/i386/linux/linux_sysent.c	Wed Mar  2 06:24:46 2011	(r219172)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219165 2011-03-02 06:11:41Z dchagin 
+ * created from FreeBSD: stable/8/sys/i386/linux/syscalls.master 219171 2011-03-02 06:23:19Z dchagin 
  */
 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 09:30:46 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 09:53:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AB21E106566B;
	Wed,  2 Mar 2011 09:53:13 +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 986E18FC25;
	Wed,  2 Mar 2011 09:53: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 p229rDfv090290;
	Wed, 2 Mar 2011 09:53:13 GMT (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p229rD4L090286;
	Wed, 2 Mar 2011 09:53:13 GMT (envelope-from netchild@svn.freebsd.org)
Message-Id: <201103020953.p229rD4L090286@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 2 Mar 2011 09:53:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 09:53:13 -0000

Author: netchild
Date: Wed Mar  2 09:53:13 2011
New Revision: 219173
URL: http://svn.freebsd.org/changeset/base/219173

Log:
  MFC r215664:
    By using the 32-bit Linux version of Sun's Java Development Kit 1.6
    on FreeBSD (amd64), invocations of "javac" (or "java") eventually
    end with the output of "Killed" and exit code 137.
  
    This is caused by:
    1. After calling exec() in multithreaded linux program threads are not
       destroyed and continue running. They get killed after program being
       executed finishes.
  
    2. linux_exit_group doesn't return correct exit code when called not
       from group leader. Which happens regularly using sun jvm.
  
    The submitters fix this in a similar way to how NetBSD handles this.
  
    I took the PRs away from dchagin, who seems to be out of touch of
    this since a while (no response from him).
  
    The patches committed here are from [2], with some little modifications
    from me to the style.
  
    PR:                141439 [1], 144194 [2]
    Submitted by:        Stefan Schmidt , gk
    Reviewed by:        rdivacky (in april 2010)
  
  MFC r215675:
    Do not take the process lock. The assignment to u_short inside the
    properly aligned structure is atomic on all supported architectures, and
    the thread that should see side-effect of assignment is the same thread
    that does assignment.
  
    Use a more appropriate conditional to detect the linux ABI.
  
    Suggested by:        kib

Modified:
  stable/8/sys/compat/linux/linux_emul.c
  stable/8/sys/compat/linux/linux_emul.h
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/kern/kern_exit.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -155,7 +155,7 @@ void
 linux_proc_exit(void *arg __unused, struct proc *p)
 {
 	struct linux_emuldata *em;
-	int error;
+	int error, shared_flags, shared_xstat;
 	struct thread *td = FIRST_THREAD_IN_PROC(p);
 	int *child_clear_tid;
 	struct proc *q, *nq;
@@ -187,6 +187,8 @@ linux_proc_exit(void *arg __unused, stru
 	}
 
 	EMUL_SHARED_WLOCK(&emul_shared_lock);
+	shared_flags = em->shared->flags;
+	shared_xstat = em->shared->xstat;
 	LIST_REMOVE(em, threads);
 
 	em->shared->refs--;
@@ -196,6 +198,9 @@ linux_proc_exit(void *arg __unused, stru
 	} else	
 		EMUL_SHARED_WUNLOCK(&emul_shared_lock);
 
+	if ((shared_flags & EMUL_SHARED_HASXSTAT) != 0)
+		p->p_xstat = shared_xstat;
+
 	if (child_clear_tid != NULL) {
 		struct linux_sys_futex_args cup;
 		int null = 0;
@@ -257,6 +262,10 @@ linux_proc_exec(void *arg __unused, stru
 	if (__predict_false(imgp->sysent == &elf_linux_sysvec
 	    && p->p_sysent != &elf_linux_sysvec))
 		linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0);
+	if (__predict_false((p->p_sysent->sv_flags & SV_ABI_MASK) ==
+	    SV_ABI_LINUX))
+		/* Kill threads regardless of imgp->sysent value */
+		linux_kill_threads(FIRST_THREAD_IN_PROC(p), SIGKILL);
 	if (__predict_false(imgp->sysent != &elf_linux_sysvec
 	    && p->p_sysent == &elf_linux_sysvec)) {
 		struct linux_emuldata *em;
@@ -334,3 +343,29 @@ linux_set_tid_address(struct thread *td,
 	EMUL_UNLOCK(&emul_lock);
 	return 0;
 }
+
+void
+linux_kill_threads(struct thread *td, int sig)
+{
+	struct linux_emuldata *em, *td_em, *tmp_em;
+	struct proc *sp;
+
+	td_em = em_find(td->td_proc, EMUL_DONTLOCK);
+
+	KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n"));
+
+	EMUL_SHARED_RLOCK(&emul_shared_lock);
+	LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) {
+		if (em->pid == td_em->pid)
+			continue;
+
+		sp = pfind(em->pid);
+		if ((sp->p_flag & P_WEXIT) == 0)
+			psignal(sp, sig);
+		PROC_UNLOCK(sp);
+#ifdef DEBUG
+		printf(LMSG("linux_kill_threads: kill PID %d\n"), em->pid);
+#endif
+	}
+	EMUL_SHARED_RUNLOCK(&emul_shared_lock);
+}

Modified: stable/8/sys/compat/linux/linux_emul.h
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 09:53:13 2011	(r219173)
@@ -31,8 +31,12 @@
 #ifndef _LINUX_EMUL_H_
 #define	_LINUX_EMUL_H_
 
+#define EMUL_SHARED_HASXSTAT	0x01
+
 struct linux_emuldata_shared {
 	int	refs;
+	int	flags;
+	int	xstat;
 	pid_t	group_pid;
 
 	LIST_HEAD(, linux_emuldata) threads; /* head of list of linux threads */
@@ -76,6 +80,7 @@ int	linux_proc_init(struct thread *, pid
 void	linux_proc_exit(void *, struct proc *);
 void	linux_schedtail(void *, struct proc *);
 void	linux_proc_exec(void *, struct proc *, struct image_params *);
+void	linux_kill_threads(struct thread *, int);
 
 extern struct sx	emul_shared_lock;
 extern struct mtx	emul_lock;

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -1655,34 +1655,23 @@ linux_setdomainname(struct thread *td, s
 int
 linux_exit_group(struct thread *td, struct linux_exit_group_args *args)
 {
-	struct linux_emuldata *em, *td_em, *tmp_em;
-	struct proc *sp;
+	struct linux_emuldata *em;
 
 #ifdef DEBUG
 	if (ldebug(exit_group))
 		printf(ARGS(exit_group, "%i"), args->error_code);
 #endif
 
-	if (linux_use26(td)) {
-		td_em = em_find(td->td_proc, EMUL_DONTLOCK);
-
-		KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n"));
-
-		EMUL_SHARED_RLOCK(&emul_shared_lock);
-		LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) {
-			if (em->pid == td_em->pid)
-				continue;
-
-			sp = pfind(em->pid);
-			psignal(sp, SIGKILL);
-			PROC_UNLOCK(sp);
-#ifdef DEBUG
-			printf(LMSG("linux_sys_exit_group: kill PID %d\n"), em->pid);
-#endif
-		}
-
-		EMUL_SHARED_RUNLOCK(&emul_shared_lock);
+	em = em_find(td->td_proc, EMUL_DONTLOCK);
+	if (em->shared->refs > 1) {
+		EMUL_SHARED_WLOCK(&emul_shared_lock);
+		em->shared->flags |= EMUL_SHARED_HASXSTAT;
+		em->shared->xstat = W_EXITCODE(args->error_code, 0);
+		EMUL_SHARED_WUNLOCK(&emul_shared_lock);
+		if (linux_use26(td))
+			linux_kill_threads(td, SIGKILL);
 	}
+
 	/*
 	 * XXX: we should send a signal to the parent if
 	 * SIGNAL_EXIT_GROUP is set. We ignore that (temporarily?)

Modified: stable/8/sys/kern/kern_exit.c
==============================================================================
--- stable/8/sys/kern/kern_exit.c	Wed Mar  2 06:24:46 2011	(r219172)
+++ stable/8/sys/kern/kern_exit.c	Wed Mar  2 09:53:13 2011	(r219173)
@@ -200,6 +200,7 @@ exit1(struct thread *td, int rv)
 	while (p->p_lock > 0)
 		msleep(&p->p_lock, &p->p_mtx, PWAIT, "exithold", 0);
 
+	p->p_xstat = rv;	/* Let event handler change exit status */
 	PROC_UNLOCK(p);
 	/* Drain the limit callout while we don't have the proc locked */
 	callout_drain(&p->p_limco);
@@ -242,6 +243,7 @@ exit1(struct thread *td, int rv)
 	 * P_PPWAIT is set; we will wakeup the parent below.
 	 */
 	PROC_LOCK(p);
+	rv = p->p_xstat;	/* Event handler could change exit status */
 	stopprofclock(p);
 	p->p_flag &= ~(P_TRACED | P_PPWAIT);
 
@@ -421,7 +423,6 @@ exit1(struct thread *td, int rv)
 
 	/* Save exit status. */
 	PROC_LOCK(p);
-	p->p_xstat = rv;
 	p->p_xthread = td;
 
 	/* Tell the prison that we are gone. */

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 11:04:50 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 11:09:34 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 12:49:27 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B490F1065672;
	Wed,  2 Mar 2011 12:49:27 +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 4BDD28FC0C;
	Wed,  2 Mar 2011 12:49:26 +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 p22CnMga052424
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 2 Mar 2011 14:49:22 +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
	p22CnMbd039545; Wed, 2 Mar 2011 14:49:22 +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 p22CnMdp039544; 
	Wed, 2 Mar 2011 14:49:22 +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: Wed, 2 Mar 2011 14:49:22 +0200
From: Kostik Belousov 
To: Alexander Leidinger 
Message-ID: <20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
References: <201103020953.p229rD4L090286@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="QlWQyIlDgLScNVjS"
Content-Disposition: inline
In-Reply-To: <201103020953.p229rD4L090286@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Spam-Status: No, score=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05,
	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: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 12:49:27 -0000


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

On Wed, Mar 02, 2011 at 09:53:13AM +0000, Alexander Leidinger wrote:
> Author: netchild
> Date: Wed Mar  2 09:53:13 2011
> New Revision: 219173
> URL: http://svn.freebsd.org/changeset/base/219173
>=20
> Log:
>   MFC r215664:
>     By using the 32-bit Linux version of Sun's Java Development Kit 1.6
>     on FreeBSD (amd64), invocations of "javac" (or "java") eventually
>     end with the output of "Killed" and exit code 137.
>  =20
>     This is caused by:
>     1. After calling exec() in multithreaded linux program threads are not
>        destroyed and continue running. They get killed after program being
>        executed finishes.
>  =20
>     2. linux_exit_group doesn't return correct exit code when called not
>        from group leader. Which happens regularly using sun jvm.
>  =20
>     The submitters fix this in a similar way to how NetBSD handles this.
>  =20
>     I took the PRs away from dchagin, who seems to be out of touch of
>     this since a while (no response from him).
>  =20
>     The patches committed here are from [2], with some little modificatio=
ns
>     from me to the style.
>  =20
>     PR:                141439 [1], 144194 [2]
>     Submitted by:        Stefan Schmidt , gk
>     Reviewed by:        rdivacky (in april 2010)
>  =20
>   MFC r215675:
>     Do not take the process lock. The assignment to u_short inside the
>     properly aligned structure is atomic on all supported architectures, =
and
>     the thread that should see side-effect of assignment is the same thre=
ad
>     that does assignment.
>  =20
>     Use a more appropriate conditional to detect the linux ABI.
>  =20
>     Suggested by:        kib
See r215706, that was a followup to the commit. Without it, stable/8
is broken:

/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c: In function=
 'linux_proc_exec':
/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: =
dereferencing pointer to incomplete type
/usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265: error: =
'SV_ABI_MASK' undeclared (first use in this function)

--QlWQyIlDgLScNVjS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk1uPNIACgkQC3+MBN1Mb4hUAwCgpOVoaKNH+jBLgKTTll2gG5wz
VR4AoK2hSX7D6mOpWQL7+G1cwU36i/Jc
=Kipt
-----END PGP SIGNATURE-----

--QlWQyIlDgLScNVjS--

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 13:06:48 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A03D3106564A;
	Wed,  2 Mar 2011 13:06:48 +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 8E2C68FC13;
	Wed,  2 Mar 2011 13:06: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 p22D6mx8010471;
	Wed, 2 Mar 2011 13:06:48 GMT (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22D6mmL010469;
	Wed, 2 Mar 2011 13:06:48 GMT (envelope-from netchild@svn.freebsd.org)
Message-Id: <201103021306.p22D6mmL010469@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 2 Mar 2011 13:06:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219176 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 13:06:48 -0000

Author: netchild
Date: Wed Mar  2 13:06:47 2011
New Revision: 219176
URL: http://svn.freebsd.org/changeset/base/219176

Log:
  Fix kernel build with MFC of r215706:
    Fix linux kernel module breakage introduced in r215675, by including
    .
  
  Pointyhat to:	netchild
  Noticed by:	kib

Modified:
  stable/8/sys/compat/linux/linux_emul.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 11:09:34 2011	(r219175)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 13:06:47 2011	(r219176)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 13:23:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35028106564A;
	Wed,  2 Mar 2011 13:23:15 +0000 (UTC)
	(envelope-from netchild@freebsd.org)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id D9DB18FC13;
	Wed,  2 Mar 2011 13:23:14 +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 1BF94844015;
	Wed,  2 Mar 2011 14:07:50 +0100 (CET)
Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 8434E22FF;
	Wed,  2 Mar 2011 14:07:41 +0100 (CET)
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p22D7Mwu066782;
	Wed, 2 Mar 2011 14:07:22 +0100 (CET)
	(envelope-from netchild@FreeBSD.org)
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
	14:07:21 +0100
Message-ID: <20110302140721.10490r8jxq10xfk0@webmail.leidinger.net>
Date: Wed, 02 Mar 2011 14:07:21 +0100
From: Alexander Leidinger 
To: Kostik Belousov 
References: <201103020953.p229rD4L090286@svn.freebsd.org>
	<20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110302124922.GZ78089@deviant.kiev.zoral.com.ua>
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: 1BF94844015.A855D
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: netchild@freebsd.org
X-EBL-MailScanner-Watermark: 1299676070.61095@cGzmAy1CfdUTI4jU3yhgvg
X-EBL-Spam-Status: No
Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org
Subject: Re: svn commit: r219173 - in stable/8/sys: compat/linux kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 13:23:15 -0000

Quoting Kostik Belousov  (from Wed, 2 Mar 2011  
14:49:22 +0200):

> On Wed, Mar 02, 2011 at 09:53:13AM +0000, Alexander Leidinger wrote:
>> Author: netchild
>> Date: Wed Mar  2 09:53:13 2011
>> New Revision: 219173
>> URL: http://svn.freebsd.org/changeset/base/219173

> See r215706, that was a followup to the commit. Without it, stable/8
> is broken:
>
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c: In  
> function 'linux_proc_exec':
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265:  
> error: dereferencing pointer to incomplete type
> /usr/bsd/src/sys/modules/linux/../../compat/linux/linux_emul.c:265:  
> error: 'SV_ABI_MASK' undeclared (first use in this function)

Double pointyhat to me...

Commit in progress.

Thanks,
Alexander.

-- 
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
Behind every great man, there is a woman -- urging him on.
		-- Harry Mudd, "I, Mudd", stardate 4513.3


From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 14:03:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B17A7106564A;
	Wed,  2 Mar 2011 14:03:31 +0000 (UTC)
	(envelope-from ndenev@gmail.com)
Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com
	[209.85.215.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 951208FC1E;
	Wed,  2 Mar 2011 14:03:30 +0000 (UTC)
Received: by ewy28 with SMTP id 28so2252437ewy.13
	for ; Wed, 02 Mar 2011 06:03:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:subject:mime-version:content-type:from
	:in-reply-to:date:cc:content-transfer-encoding:message-id:references
	:to:x-mailer; bh=pOFFf/8g/FCuQ0IdmO6O6HHM773H/4OmHcghQ2nCAro=;
	b=Tix2Z2qnMAuaE7KfeDU65R+g8Sbc3GM5po1BlAMAawZ8WB9ll0o1I/K6AtwdU9nG1K
	CxXt6lcGYHA23pMbXXwHz6OKrq25skZ8hKvQcccVxdn7EJ2rMRALE+U+qlOB0a5DZ8xz
	KiUxTgy77Zj/ppV3kF28bxX4igBbzF15K4Ug8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=subject:mime-version:content-type:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=bS5cVK0XWNsqdmYjl4XU09UtV8DpxT49W0/sGw5OpAcL/7Pzfbwa0gKuKbaiOI+tEM
	t+tL3mSSaG/0+mMKRmVV66qpLBCMs6IAojlT+6VgC7Y+AfY1b+7Z8tLYMNJmb/DE2Sqo
	aDlSAyk4CvK7sN85b971hey3+9UbKjBxobi5Y=
Received: by 10.213.27.78 with SMTP id h14mr183932ebc.17.1299074608128;
	Wed, 02 Mar 2011 06:03:28 -0800 (PST)
Received: from mytaht-2.totalterror.net (93-152-151-19.ddns.onlinedirect.bg
	[93.152.151.19])
	by mx.google.com with ESMTPS id t5sm1538548eeh.20.2011.03.02.06.03.22
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 02 Mar 2011 06:03:22 -0800 (PST)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Nikolay Denev 
In-Reply-To: <201102282328.p1SNSZZK059958@svn.freebsd.org>
Date: Wed, 2 Mar 2011 16:03:20 +0200
Content-Transfer-Encoding: 7bit
Message-Id: <8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
References: <201102282328.p1SNSZZK059958@svn.freebsd.org>
To: Robert Watson 
X-Mailer: Apple Mail (2.1082)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64
	amd64/include boot/common cddl/compat/opensolaris/kern
	cddl/compat/opensolaris/sys
	cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 14:03:31 -0000

On 1 Mar, 2011, at 01:28 , Robert Watson wrote:

> Author: rwatson
> Date: Mon Feb 28 23:28:35 2011
> New Revision: 219107
> URL: http://svn.freebsd.org/changeset/base/219107
> 
> Log:
>  Merge userspace DTrace support from head to stable/8:
> 

Hi,

It seems that the dtruss script in RELENG_8 has "/usr/bin/sh" as interpreter.
This appears to be fixed in head.

Regards,
Nikolay


From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 14:39:26 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 14:56:58 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 15:41:01 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 16:03:19 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 16:06:57 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 16:15:11 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 16:16:09 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 17:13:07 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 17:19:55 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 18:53:13 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 19:09:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49E4C106566B;
	Wed,  2 Mar 2011 19:09:50 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 365EF8FC17;
	Wed,  2 Mar 2011 19:09: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 p22J9oCg037564;
	Wed, 2 Mar 2011 19:09:50 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22J9nkg037551;
	Wed, 2 Mar 2011 19:09:49 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103021909.p22J9nkg037551@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 2 Mar 2011 19:09:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219187 - in stable/8/sys/amd64: amd64 ia32 include
	linux32
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:09:50 -0000

Author: jkim
Date: Wed Mar  2 19:09:49 2011
New Revision: 219187
URL: http://svn.freebsd.org/changeset/base/219187

Log:
  MFC:	r216634, r216673
  
  Improve PCB flags handling and make it more robust.  Add two new functions
  for manipulating pcb_flags.  These inline functions are very similar to
  atomic_set_int(9) and atomic_clear_int(9) but without unnecessary LOCK
  prefix for SMP.  Add comments about the rationale.  Use these functions
  wherever possible.  Although there are some places where it is not strictly
  necessary (e.g., a PCB is copied to create a new PCB), it is done across
  the board for sake of consistency.  Turn pcb_full_iret into a PCB flag as
  it is safe now.  Move rarely used fields before pcb_flags and reduce size
  of pcb_flags to four bytes.  Fix some style(9) nits in pcb.h while I am in
  the neighborhood.

Modified:
  stable/8/sys/amd64/amd64/cpu_switch.S
  stable/8/sys/amd64/amd64/exception.S
  stable/8/sys/amd64/amd64/fpu.c
  stable/8/sys/amd64/amd64/genassym.c
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/sys_machdep.c
  stable/8/sys/amd64/amd64/vm_machdep.c
  stable/8/sys/amd64/ia32/ia32_reg.c
  stable/8/sys/amd64/ia32/ia32_signal.c
  stable/8/sys/amd64/include/pcb.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/amd64/linux32/linux32_sysvec.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/cpu_switch.S
==============================================================================
--- stable/8/sys/amd64/amd64/cpu_switch.S	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/cpu_switch.S	Wed Mar  2 19:09:49 2011	(r219187)
@@ -94,7 +94,7 @@ END(cpu_throw)
 ENTRY(cpu_switch)
 	/* Switch to new thread.  First, save context. */
 	movq	TD_PCB(%rdi),%r8
-	movb	$1,PCB_FULL_IRET(%r8)
+	orl	$PCB_FULL_IRET,PCB_FLAGS(%r8)
 
 	movq	(%rsp),%rax			/* Hardware registers */
 	movq	%r15,PCB_R15(%r8)

Modified: stable/8/sys/amd64/amd64/exception.S
==============================================================================
--- stable/8/sys/amd64/amd64/exception.S	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/exception.S	Wed Mar  2 19:09:49 2011	(r219187)
@@ -170,7 +170,7 @@ alltraps:
 	jz	alltraps_testi		/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -243,7 +243,7 @@ alltraps_noen:
 	jz	1f	/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 1:	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -294,7 +294,7 @@ IDTVEC(page)
 	jz	1f			/* already running with kernel GS.base */
 	swapgs
 	movq	PCPU(CURPCB),%rdi
-	movb	$0,PCB_FULL_IRET(%rdi)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%rdi)
 1:	movq	%cr2,%rdi		/* preserve %cr2 before ..  */
 	movq	%rdi,TF_ADDR(%rsp)	/* enabling interrupts. */
 	movw	%fs,TF_FS(%rsp)
@@ -324,7 +324,7 @@ IDTVEC(prot)
 	jz	2f			/* already running with kernel GS.base */
 1:	swapgs
 2:	movq	PCPU(CURPCB),%rdi
-	movb	$1,PCB_FULL_IRET(%rdi)	/* always full iret from GPF */
+	orl	$PCB_FULL_IRET,PCB_FLAGS(%rdi)	/* always full iret from GPF */
 	movw	%fs,TF_FS(%rsp)
 	movw	%gs,TF_GS(%rsp)
 	movw	%es,TF_ES(%rsp)
@@ -356,7 +356,7 @@ IDTVEC(fast_syscall)
 	movw	%es,TF_ES(%rsp)
 	movw	%ds,TF_DS(%rsp)
 	movq	PCPU(CURPCB),%r11
-	movb	$0,PCB_FULL_IRET(%r11)
+	andl	$~PCB_FULL_IRET,PCB_FLAGS(%r11)
 	sti
 	movq	$KUDSEL,TF_SS(%rsp)
 	movq	$KUCSEL,TF_CS(%rsp)
@@ -661,8 +661,8 @@ doreti_exit:
 	 */
 	testb	$SEL_RPL_MASK,TF_CS(%rsp)
 	jz	ld_regs
-	cmpb	$0,PCB_FULL_IRET(%r8)
-	je	ld_regs
+	testl	$PCB_FULL_IRET,PCB_FLAGS(%r8)
+	jz	ld_regs
 	testl	$TF_HASSEGS,TF_FLAGS(%rsp)
 	je	set_segs
 

Modified: stable/8/sys/amd64/amd64/fpu.c
==============================================================================
--- stable/8/sys/amd64/amd64/fpu.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/fpu.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -426,9 +426,11 @@ fpudna(void)
 		fxrstor(&fpu_initialstate);
 		if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__)
 			fldcw(pcb->pcb_initial_fpucw);
-		pcb->pcb_flags |= PCB_FPUINITDONE;
 		if (PCB_USER_FPU(pcb))
-			pcb->pcb_flags |= PCB_USERFPUINITDONE;
+			set_pcb_flags(pcb,
+			    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+		else
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
 	} else
 		fxrstor(pcb->pcb_save);
 	critical_exit();
@@ -443,7 +445,7 @@ fpudrop()
 	KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread"));
 	CRITICAL_ASSERT(td);
 	PCPU_SET(fpcurthread, NULL);
-	td->td_pcb->pcb_flags &= ~PCB_FPUINITDONE;
+	clear_pcb_flags(td->td_pcb, PCB_FPUINITDONE);
 	start_emulating();
 }
 
@@ -483,8 +485,10 @@ fpuuserinited(struct thread *td)
 
 	pcb = td->td_pcb;
 	if (PCB_USER_FPU(pcb))
-		pcb->pcb_flags |= PCB_FPUINITDONE;
-	pcb->pcb_flags |= PCB_USERFPUINITDONE;
+		set_pcb_flags(pcb,
+		    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+	else
+		set_pcb_flags(pcb, PCB_FPUINITDONE);
 }
 
 /*
@@ -500,7 +504,7 @@ fpusetregs(struct thread *td, struct sav
 	if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) {
 		fxrstor(addr);
 		critical_exit();
-		pcb->pcb_flags |= PCB_FPUINITDONE | PCB_USERFPUINITDONE;
+		set_pcb_flags(pcb, PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	} else {
 		critical_exit();
 		bcopy(addr, &td->td_pcb->pcb_user_save, sizeof(*addr));
@@ -609,8 +613,8 @@ fpu_kern_enter(struct thread *td, struct
 	fpuexit(td);
 	ctx->prev = pcb->pcb_save;
 	pcb->pcb_save = &ctx->hwstate;
-	pcb->pcb_flags |= PCB_KERNFPU;
-	pcb->pcb_flags &= ~PCB_FPUINITDONE;
+	set_pcb_flags(pcb, PCB_KERNFPU);
+	clear_pcb_flags(pcb, PCB_FPUINITDONE);
 	return (0);
 }
 
@@ -626,16 +630,16 @@ fpu_kern_leave(struct thread *td, struct
 	critical_exit();
 	pcb->pcb_save = ctx->prev;
 	if (pcb->pcb_save == &pcb->pcb_user_save) {
-		if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0)
-			pcb->pcb_flags |= PCB_FPUINITDONE;
-		else
-			pcb->pcb_flags &= ~PCB_FPUINITDONE;
-		pcb->pcb_flags &= ~PCB_KERNFPU;
+		if ((pcb->pcb_flags & PCB_USERFPUINITDONE) != 0) {
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
+			clear_pcb_flags(pcb, PCB_KERNFPU);
+		} else
+			clear_pcb_flags(pcb, PCB_FPUINITDONE | PCB_KERNFPU);
 	} else {
 		if ((ctx->flags & FPU_KERN_CTX_FPUINITDONE) != 0)
-			pcb->pcb_flags |= PCB_FPUINITDONE;
+			set_pcb_flags(pcb, PCB_FPUINITDONE);
 		else
-			pcb->pcb_flags &= ~PCB_FPUINITDONE;
+			clear_pcb_flags(pcb, PCB_FPUINITDONE);
 		KASSERT(!PCB_USER_FPU(pcb), ("unpaired fpu_kern_leave"));
 	}
 	return (0);
@@ -652,7 +656,7 @@ fpu_kern_thread(u_int flags)
 	KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save"));
 	KASSERT(PCB_USER_FPU(pcb), ("recursive call"));
 
-	pcb->pcb_flags |= PCB_KERNFPU;
+	set_pcb_flags(pcb, PCB_KERNFPU);
 	return (0);
 }
 

Modified: stable/8/sys/amd64/amd64/genassym.c
==============================================================================
--- stable/8/sys/amd64/amd64/genassym.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/genassym.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -145,22 +145,22 @@ ASSYM(PCB_DR2, offsetof(struct pcb, pcb_
 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
+ASSYM(PCB_GDT, offsetof(struct pcb, pcb_gdt));
+ASSYM(PCB_IDT, offsetof(struct pcb, pcb_idt));
+ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt));
+ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr));
 ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags));
 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
 ASSYM(PCB_GS32SD, offsetof(struct pcb, pcb_gs32sd));
 ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp));
 ASSYM(PCB_SAVEFPU, offsetof(struct pcb, pcb_save));
 ASSYM(PCB_SAVEFPU_SIZE, sizeof(struct savefpu));
-ASSYM(PCB_FULL_IRET, offsetof(struct pcb, pcb_full_iret));
-ASSYM(PCB_GDT, offsetof(struct pcb, pcb_gdt));
-ASSYM(PCB_IDT, offsetof(struct pcb, pcb_idt));
-ASSYM(PCB_LDT, offsetof(struct pcb, pcb_ldt));
-ASSYM(PCB_TR, offsetof(struct pcb, pcb_tr));
 ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save));
 ASSYM(PCB_SIZE, sizeof(struct pcb));
+ASSYM(PCB_FULL_IRET, PCB_FULL_IRET);
 ASSYM(PCB_DBREGS, PCB_DBREGS);
-ASSYM(PCB_32BIT, PCB_32BIT);
 ASSYM(PCB_GS32BIT, PCB_GS32BIT);
+ASSYM(PCB_32BIT, PCB_32BIT);
 
 ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0));
 

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -300,6 +300,7 @@ void
 sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
 {
 	struct sigframe sf, *sfp;
+	struct pcb *pcb;
 	struct proc *p;
 	struct thread *td;
 	struct sigacts *psp;
@@ -309,6 +310,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	int oonstack;
 
 	td = curthread;
+	pcb = td->td_pcb;
 	p = td->td_proc;
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	sig = ksi->ksi_signo;
@@ -328,8 +330,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */
 	get_fpcontext(td, &sf.sf_uc.uc_mcontext);
 	fpstate_drop(td);
-	sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase;
-	sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase;
+	sf.sf_uc.uc_mcontext.mc_fsbase = pcb->pcb_fsbase;
+	sf.sf_uc.uc_mcontext.mc_gsbase = pcb->pcb_gsbase;
 	bzero(sf.sf_uc.uc_mcontext.mc_spare,
 	    sizeof(sf.sf_uc.uc_mcontext.mc_spare));
 	bzero(sf.sf_uc.__spare__, sizeof(sf.sf_uc.__spare__));
@@ -393,7 +395,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, 
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -417,13 +419,17 @@ sigreturn(td, uap)
 	} */ *uap;
 {
 	ucontext_t uc;
-	struct proc *p = td->td_proc;
+	struct pcb *pcb;
+	struct proc *p;
 	struct trapframe *regs;
 	ucontext_t *ucp;
 	long rflags;
 	int cs, error, ret;
 	ksiginfo_t ksi;
 
+	pcb = td->td_pcb;
+	p = td->td_proc;
+
 	error = copyin(uap->sigcntxp, &uc, sizeof(uc));
 	if (error != 0) {
 		uprintf("pid %d (%s): sigreturn copyin failed\n",
@@ -482,8 +488,8 @@ sigreturn(td, uap)
 		return (ret);
 	}
 	bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs));
-	td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase;
-	td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase;
+	pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase;
+	pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase;
 
 #if defined(COMPAT_43)
 	if (ucp->uc_mcontext.mc_onstack & 1)
@@ -493,7 +499,7 @@ sigreturn(td, uap)
 #endif
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 
@@ -862,9 +868,9 @@ exec_setregs(td, entry, stack, ps_string
 	
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
-	pcb->pcb_flags &= ~(PCB_32BIT | PCB_GS32BIT);
+	clear_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT);
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW__;
-	pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 
 	bzero((char *)regs, sizeof(struct trapframe));
 	regs->tf_rip = entry;
@@ -899,7 +905,7 @@ exec_setregs(td, entry, stack, ps_string
 			 */
 			reset_dbregs();
 		}
-		pcb->pcb_flags &= ~PCB_DBREGS;
+		clear_pcb_flags(pcb, PCB_DBREGS);
 	}
 
 	/*
@@ -1912,7 +1918,7 @@ set_regs(struct thread *td, struct reg *
 		tp->tf_fs = regs->r_fs;
 		tp->tf_gs = regs->r_gs;
 		tp->tf_flags = TF_HASSEGS;
-		td->td_pcb->pcb_full_iret = 1;
+		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	}
 	return (0);
 }
@@ -2004,8 +2010,10 @@ set_fpregs(struct thread *td, struct fpr
 int
 get_mcontext(struct thread *td, mcontext_t *mcp, int flags)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 	PROC_LOCK(curthread->td_proc);
 	mcp->mc_onstack = sigonstack(tp->tf_rsp);
@@ -2043,8 +2051,8 @@ get_mcontext(struct thread *td, mcontext
 	mcp->mc_flags = tp->tf_flags;
 	mcp->mc_len = sizeof(*mcp);
 	get_fpcontext(td, mcp);
-	mcp->mc_fsbase = td->td_pcb->pcb_fsbase;
-	mcp->mc_gsbase = td->td_pcb->pcb_gsbase;
+	mcp->mc_fsbase = pcb->pcb_fsbase;
+	mcp->mc_gsbase = pcb->pcb_gsbase;
 	bzero(mcp->mc_spare, sizeof(mcp->mc_spare));
 	return (0);
 }
@@ -2058,10 +2066,12 @@ get_mcontext(struct thread *td, mcontext
 int
 set_mcontext(struct thread *td, const mcontext_t *mcp)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 	long rflags;
 	int ret;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 	if (mcp->mc_len != sizeof(*mcp) ||
 	    (mcp->mc_flags & ~_MC_FLAG_MASK) != 0)
@@ -2098,10 +2108,10 @@ set_mcontext(struct thread *td, const mc
 		tp->tf_gs = mcp->mc_gs;
 	}
 	if (mcp->mc_flags & _MC_HASBASES) {
-		td->td_pcb->pcb_fsbase = mcp->mc_fsbase;
-		td->td_pcb->pcb_gsbase = mcp->mc_gsbase;
+		pcb->pcb_fsbase = mcp->mc_fsbase;
+		pcb->pcb_gsbase = mcp->mc_gsbase;
 	}
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -2155,8 +2165,8 @@ fpstate_drop(struct thread *td)
 	 * sendsig() is the only caller of fpugetuserregs()... perhaps we just
 	 * have too many layers.
 	 */
-	curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE |
-	    PCB_USERFPUINITDONE);
+	clear_pcb_flags(curthread->td_pcb,
+	    PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	critical_exit();
 }
 
@@ -2270,7 +2280,7 @@ set_dbregs(struct thread *td, struct dbr
 		pcb->pcb_dr6 = dbregs->dr[6];
 		pcb->pcb_dr7 = dbregs->dr[7];
 
-		pcb->pcb_flags |= PCB_DBREGS;
+		set_pcb_flags(pcb, PCB_DBREGS);
 	}
 
 	return (0);

Modified: stable/8/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/sys_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/sys_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -119,7 +119,7 @@ sysarch_ldt(struct thread *td, struct sy
 		error = amd64_get_ldt(td, largs);
 		break;
 	case I386_SET_LDT:
-		td->td_pcb->pcb_full_iret = 1;
+		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 		if (largs->descs != NULL) {
 			lp = malloc(largs->num * sizeof(struct
 			    user_segment_descriptor), M_TEMP, M_WAITOK);
@@ -143,7 +143,7 @@ update_gdt_gsbase(struct thread *td, uin
 
 	if (td != curthread)
 		return;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	critical_enter();
 	sd = PCPU_GET(gs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -158,7 +158,7 @@ update_gdt_fsbase(struct thread *td, uin
 
 	if (td != curthread)
 		return;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	critical_enter();
 	sd = PCPU_GET(fs32p);
 	sd->sd_lobase = base & 0xffffff;
@@ -214,7 +214,7 @@ sysarch(td, uap)
 		if (!error) {
 			pcb->pcb_fsbase = i386base;
 			td->td_frame->tf_fs = _ufssel;
-			pcb->pcb_full_iret = 1;
+			set_pcb_flags(pcb, PCB_FULL_IRET);
 			update_gdt_fsbase(td, i386base);
 		}
 		break;
@@ -226,7 +226,7 @@ sysarch(td, uap)
 		error = copyin(uap->parms, &i386base, sizeof(i386base));
 		if (!error) {
 			pcb->pcb_gsbase = i386base;
-			pcb->pcb_full_iret = 1;
+			set_pcb_flags(pcb, PCB_FULL_IRET);
 			td->td_frame->tf_gs = _ugssel;
 			update_gdt_gsbase(td, i386base);
 		}
@@ -240,7 +240,7 @@ sysarch(td, uap)
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_fsbase = a64base;
-				pcb->pcb_full_iret = 1;
+				set_pcb_flags(pcb, PCB_FULL_IRET);
 				td->td_frame->tf_fs = _ufssel;
 			} else
 				error = EINVAL;
@@ -256,7 +256,7 @@ sysarch(td, uap)
 		if (!error) {
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				pcb->pcb_gsbase = a64base;
-				pcb->pcb_full_iret = 1;
+				set_pcb_flags(pcb, PCB_FULL_IRET);
 				td->td_frame->tf_gs = _ugssel;
 			} else
 				error = EINVAL;
@@ -543,7 +543,7 @@ amd64_set_ldt(td, uap, descs)
 	    uap->start, uap->num, (void *)uap->descs);
 #endif
 
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	p = td->td_proc;
 	if (descs == NULL) {
 		/* Free descriptors */

Modified: stable/8/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/vm_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/amd64/vm_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -190,7 +190,7 @@ cpu_fork(td1, p2, td2, flags)
 	pcb2->pcb_tssp = NULL;
 
 	/* New segment registers. */
-	pcb2->pcb_full_iret = 1;
+	set_pcb_flags(pcb2, PCB_FULL_IRET);
 
 	/* Copy the LDT, if necessary. */
 	mdp1 = &td1->td_proc->p_md;
@@ -275,7 +275,7 @@ cpu_thread_exit(struct thread *td)
 	/* Disable any hardware breakpoints. */
 	if (pcb->pcb_flags & PCB_DBREGS) {
 		reset_dbregs();
-		pcb->pcb_flags &= ~PCB_DBREGS;
+		clear_pcb_flags(pcb, PCB_DBREGS);
 	}
 }
 
@@ -385,9 +385,9 @@ cpu_set_upcall(struct thread *td, struct
 	 * values here.
 	 */
 	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
-	pcb2->pcb_flags &= ~(PCB_FPUINITDONE | PCB_USERFPUINITDONE);
+	clear_pcb_flags(pcb2, PCB_FPUINITDONE | PCB_USERFPUINITDONE);
 	pcb2->pcb_save = &pcb2->pcb_user_save;
-	pcb2->pcb_full_iret = 1;
+	set_pcb_flags(pcb2, PCB_FULL_IRET);
 
 	/*
 	 * Create a new fresh stack for the new thread.
@@ -491,18 +491,20 @@ cpu_set_upcall_kse(struct thread *td, vo
 int
 cpu_set_user_tls(struct thread *td, void *tls_base)
 {
+	struct pcb *pcb;
 
 	if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
 		return (EINVAL);
 
+	pcb = td->td_pcb;
 #ifdef COMPAT_FREEBSD32
 	if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) {
-		td->td_pcb->pcb_gsbase = (register_t)tls_base;
+		pcb->pcb_gsbase = (register_t)tls_base;
 		return (0);
 	}
 #endif
-	td->td_pcb->pcb_fsbase = (register_t)tls_base;
-	td->td_pcb->pcb_full_iret = 1;
+	pcb->pcb_fsbase = (register_t)tls_base;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 

Modified: stable/8/sys/amd64/ia32/ia32_reg.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_reg.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/ia32/ia32_reg.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -125,7 +125,7 @@ set_regs32(struct thread *td, struct reg
 	tp->tf_fs = regs->r_fs;
 	tp->tf_es = regs->r_es;
 	tp->tf_ds = regs->r_ds;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	tp->tf_flags = TF_HASSEGS;
 	tp->tf_rdi = regs->r_edi;
 	tp->tf_rsi = regs->r_esi;

Modified: stable/8/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- stable/8/sys/amd64/ia32/ia32_signal.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/ia32/ia32_signal.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -129,8 +129,10 @@ ia32_set_fpcontext(struct thread *td, co
 static int
 ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags)
 {
+	struct pcb *pcb;
 	struct trapframe *tp;
 
+	pcb = td->td_pcb;
 	tp = td->td_frame;
 
 	PROC_LOCK(curthread->td_proc);
@@ -162,11 +164,11 @@ ia32_get_mcontext(struct thread *td, str
 	mcp->mc_ss = tp->tf_ss;
 	mcp->mc_len = sizeof(*mcp);
 	ia32_get_fpcontext(td, mcp);
-	mcp->mc_fsbase = td->td_pcb->pcb_fsbase;
-	mcp->mc_gsbase = td->td_pcb->pcb_gsbase;
+	mcp->mc_fsbase = pcb->pcb_fsbase;
+	mcp->mc_gsbase = pcb->pcb_gsbase;
 	bzero(mcp->mc_spare1, sizeof(mcp->mc_spare1));
 	bzero(mcp->mc_spare2, sizeof(mcp->mc_spare2));
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -208,7 +210,7 @@ ia32_set_mcontext(struct thread *td, con
 	tp->tf_rflags = rflags;
 	tp->tf_rsp = mcp->mc_esp;
 	tp->tf_ss = mcp->mc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (0);
 }
 
@@ -405,7 +407,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksi
 	regs->tf_ss = _udatasel;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	/* leave user %fs and %gs untouched */
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
@@ -528,7 +530,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *
 	regs->tf_ss = _udatasel;
 	regs->tf_ds = _udatasel;
 	regs->tf_es = _udatasel;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	/* XXXKIB leave user %fs and %gs untouched */
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
@@ -623,7 +625,7 @@ freebsd4_freebsd32_sigreturn(td, uap)
 	regs->tf_gs = ucp->uc_mcontext.mc_gs;
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 #endif	/* COMPAT_FREEBSD4 */
@@ -712,7 +714,7 @@ freebsd32_sigreturn(td, uap)
 	regs->tf_flags = TF_HASSEGS;
 
 	kern_sigprocmask(td, SIG_SETMASK, &ucp->uc_sigmask, NULL, 0);
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	return (EJUSTRETURN);
 }
 
@@ -755,8 +757,7 @@ ia32_setregs(td, entry, stack, ps_string
 	fpstate_drop(td);
 
 	/* Return via doreti so that we can change to a different %cs */
-	pcb->pcb_flags |= PCB_32BIT;
-	pcb->pcb_flags &= ~PCB_GS32BIT;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
+	clear_pcb_flags(pcb, PCB_GS32BIT);
 	td->td_retval[1] = 0;
 }

Modified: stable/8/sys/amd64/include/pcb.h
==============================================================================
--- stable/8/sys/amd64/include/pcb.h	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/include/pcb.h	Wed Mar  2 19:09:49 2011	(r219187)
@@ -66,7 +66,13 @@ struct pcb {
 	register_t	pcb_dr6;
 	register_t	pcb_dr7;
 
-	u_long		pcb_flags;
+	struct region_descriptor pcb_gdt;
+	struct region_descriptor pcb_idt;
+	struct region_descriptor pcb_ldt;
+	uint16_t	pcb_tr;
+
+	u_int		pcb_flags;
+#define	PCB_FULL_IRET	0x01	/* full iret is required */
 #define	PCB_DBREGS	0x02	/* process using debug registers */
 #define	PCB_KERNFPU	0x04	/* kernel uses fpu */
 #define	PCB_FPUINITDONE	0x08	/* fpu state is initialized */
@@ -76,26 +82,52 @@ struct pcb {
 
 	uint16_t	pcb_initial_fpucw;
 
-	caddr_t		pcb_onfault; /* copyin/out fault recovery */
+	/* copyin/out fault recovery */
+	caddr_t		pcb_onfault;
 
 	/* 32-bit segment descriptor */
 	struct user_segment_descriptor pcb_gs32sd;
+
 	/* local tss, with i/o bitmap; NULL for common */
 	struct amd64tss *pcb_tssp;
-	struct	savefpu	*pcb_save;
-	char		pcb_full_iret;
 
-	struct region_descriptor pcb_gdt;
-	struct region_descriptor pcb_idt;
-	struct region_descriptor pcb_ldt;
-	uint16_t	pcb_tr;
-
-	struct	savefpu pcb_user_save;
+	struct savefpu	*pcb_save;
+	struct savefpu	pcb_user_save;
 };
 
 #ifdef _KERNEL
 struct trapframe;
 
+/*
+ * The pcb_flags is only modified by current thread, or by other threads
+ * when current thread is stopped.  However, current thread may change it
+ * from the interrupt context in cpu_switch(), or in the trap handler.
+ * When we read-modify-write pcb_flags from C sources, compiler may generate
+ * code that is not atomic regarding the interrupt handler.  If a trap or
+ * interrupt happens and any flag is modified from the handler, it can be
+ * clobbered with the cached value later.  Therefore, we implement setting
+ * and clearing flags with single-instruction functions, which do not race
+ * with possible modification of the flags from the trap or interrupt context,
+ * because traps and interrupts are executed only on instruction boundary.
+ */
+static __inline void
+set_pcb_flags(struct pcb *pcb, const u_int flags)
+{
+
+	__asm __volatile("orl %1,%0"
+	    : "=m" (pcb->pcb_flags) : "ir" (flags), "m" (pcb->pcb_flags)
+	    : "cc");
+}
+
+static __inline void
+clear_pcb_flags(struct pcb *pcb, const u_int flags)
+{
+
+	__asm __volatile("andl %1,%0"
+	    : "=m" (pcb->pcb_flags) : "ir" (~flags), "m" (pcb->pcb_flags)
+	    : "cc");
+}
+
 void	makectx(struct trapframe *, struct pcb *);
 int	savectx(struct pcb *);
 #endif

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -616,6 +616,7 @@ linux_clone(struct thread *td, struct li
 	if (args->flags & LINUX_CLONE_SETTLS) {
 		struct user_segment_descriptor sd;
 		struct l_user_desc info;
+		struct pcb *pcb;
 		int a[2];
 
 		error = copyin((void *)td->td_frame->tf_rsi, &info,
@@ -645,10 +646,11 @@ linux_clone(struct thread *td, struct li
 				    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
 				    sd.sd_long, sd.sd_def32, sd.sd_gran);
 #endif
-			td2->td_pcb->pcb_gsbase = (register_t)info.base_addr;
-/* XXXKIB		td2->td_pcb->pcb_gs32sd = sd; */
+			pcb = td2->td_pcb;
+			pcb->pcb_gsbase = (register_t)info.base_addr;
+/* XXXKIB		pcb->pcb_gs32sd = sd; */
 			td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
-			td2->td_pcb->pcb_flags |= PCB_GS32BIT | PCB_32BIT;
+			set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
 		}
 	}
 
@@ -1178,6 +1180,7 @@ linux_set_thread_area(struct thread *td,
 {
 	struct l_user_desc info;
 	struct user_segment_descriptor sd;
+	struct pcb *pcb;
 	int a[2];
 	int error;
 
@@ -1266,8 +1269,9 @@ linux_set_thread_area(struct thread *td,
 		    sd.sd_gran);
 #endif
 
-	td->td_pcb->pcb_gsbase = (register_t)info.base_addr;
-	td->td_pcb->pcb_flags |= PCB_32BIT | PCB_GS32BIT;
+	pcb = td->td_pcb;
+	pcb->pcb_gsbase = (register_t)info.base_addr;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT);
 	update_gdt_gsbase(td, info.base_addr);
 
 	return (0);

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 18:53:12 2011	(r219186)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:09:49 2011	(r219187)
@@ -422,7 +422,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -545,7 +545,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t 
 	regs->tf_fs = _ufssel;
 	regs->tf_gs = _ugssel;
 	regs->tf_flags = TF_HASSEGS;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 	PROC_LOCK(p);
 	mtx_lock(&psp->ps_mtx);
 }
@@ -643,7 +643,7 @@ linux_sigreturn(struct thread *td, struc
 	regs->tf_rflags = eflags;
 	regs->tf_rsp    = frame.sf_sc.sc_esp_at_signal;
 	regs->tf_ss     = frame.sf_sc.sc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 
 	return (EJUSTRETURN);
 }
@@ -742,7 +742,7 @@ linux_rt_sigreturn(struct thread *td, st
 	regs->tf_rflags = eflags;
 	regs->tf_rsp    = context->sc_esp_at_signal;
 	regs->tf_ss     = context->sc_ss;
-	td->td_pcb->pcb_full_iret = 1;
+	set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
 
 	/*
 	 * call sigaltstack & ignore results..
@@ -879,9 +879,8 @@ exec_linux_setregs(td, entry, stack, ps_
 	fpstate_drop(td);
 
 	/* Do full restore on return so that we can change to a different %cs */
-	pcb->pcb_flags |= PCB_32BIT;
-	pcb->pcb_flags &= ~PCB_GS32BIT;
-	pcb->pcb_full_iret = 1;
+	set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET);
+	clear_pcb_flags(pcb, PCB_GS32BIT);
 	td->td_retval[1] = 0;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:27:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D0D6106564A;
	Wed,  2 Mar 2011 19:27:01 +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 726668FC0C;
	Wed,  2 Mar 2011 19:27:01 +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 p22JR1SU040256;
	Wed, 2 Mar 2011 19:27:01 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JR1Sp040254;
	Wed, 2 Mar 2011 19:27:01 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021927.p22JR1Sp040254@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:27:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219188 - stable/8/sys/net
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:27:01 -0000

Author: jhb
Date: Wed Mar  2 19:27:01 2011
New Revision: 219188
URL: http://svn.freebsd.org/changeset/base/219188

Log:
  MFC 217805:
  Fix a LOR by dropping the global ifnet locks while allocating a new ifnet
  table in if_grow().  The order of the SYSINIT's for ifnet state were swapped
  so that the various locks were initialized before being used.

Modified:
  stable/8/sys/net/if.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Mar  2 19:09:49 2011	(r219187)
+++ stable/8/sys/net/if.c	Wed Mar  2 19:27:01 2011	(r219188)
@@ -275,6 +275,7 @@ ifindex_alloc_locked(u_short *idxp)
 
 	IFNET_WLOCK_ASSERT();
 
+retry:
 	/*
 	 * Try to find an empty slot below V_if_index.  If we fail, take the
 	 * next slot.
@@ -287,10 +288,12 @@ ifindex_alloc_locked(u_short *idxp)
 	/* Catch if_index overflow. */
 	if (idx < 1)
 		return (ENOSPC);
+	if (idx >= V_if_indexlim) {
+		if_grow();
+		goto retry;
+	}
 	if (idx > V_if_index)
 		V_if_index = idx;
-	if (V_if_index >= V_if_indexlim)
-		if_grow();
 	*idxp = idx;
 	return (0);
 }
@@ -360,10 +363,12 @@ vnet_if_init(const void *unused __unused
 
 	TAILQ_INIT(&V_ifnet);
 	TAILQ_INIT(&V_ifg_head);
+	IFNET_WLOCK();
 	if_grow();				/* create initial table */
+	IFNET_WUNLOCK();
 	vnet_if_clone_init();
 }
-VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_init,
+VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init,
     NULL);
 
 /* ARGSUSED*/
@@ -374,7 +379,7 @@ if_init(void *dummy __unused)
 	IFNET_LOCK_INIT();
 	if_clone_init();
 }
-SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_SECOND, if_init, NULL);
+SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL);
 
 
 #ifdef VIMAGE
@@ -394,16 +399,25 @@ VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_IN
 static void
 if_grow(void)
 {
+	int oldlim;
 	u_int n;
 	struct ifindex_entry *e;
 
-	V_if_indexlim <<= 1;
-	n = V_if_indexlim * sizeof(*e);
+	IFNET_WLOCK_ASSERT();
+	oldlim = V_if_indexlim;
+	IFNET_WUNLOCK();
+	n = (oldlim << 1) * sizeof(*e);
 	e = malloc(n, M_IFNET, M_WAITOK | M_ZERO);
+	IFNET_WLOCK();
+	if (V_if_indexlim != oldlim) {
+		free(e, M_IFNET);
+		return;
+	}
 	if (V_ifindex_table != NULL) {
 		memcpy((caddr_t)e, (caddr_t)V_ifindex_table, n/2);
 		free((caddr_t)V_ifindex_table, M_IFNET);
 	}
+	V_if_indexlim <<= 1;
 	V_ifindex_table = e;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:29:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 128D6106566C;
	Wed,  2 Mar 2011 19:29:25 +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 F3D3A8FC08;
	Wed,  2 Mar 2011 19:29: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 p22JTOtJ040589;
	Wed, 2 Mar 2011 19:29:24 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JTOXt040587;
	Wed, 2 Mar 2011 19:29:24 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021929.p22JTOXt040587@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:29:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219189 - stable/8/contrib/csup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:29:25 -0000

Author: jhb
Date: Wed Mar  2 19:29:24 2011
New Revision: 219189
URL: http://svn.freebsd.org/changeset/base/219189

Log:
  MFC 217858: Remove dead code.

Modified:
  stable/8/contrib/csup/updater.c
Directory Properties:
  stable/8/contrib/csup/   (props changed)

Modified: stable/8/contrib/csup/updater.c
==============================================================================
--- stable/8/contrib/csup/updater.c	Wed Mar  2 19:27:01 2011	(r219188)
+++ stable/8/contrib/csup/updater.c	Wed Mar  2 19:29:24 2011	(r219189)
@@ -770,7 +770,6 @@ updater_docoll(struct updater *up, struc
 			if (sr->sr_serverattr == NULL)
 				return (UPDATER_ERR_PROTO);
 
-			error = 0;
 			error = updater_rcsedit(up, fup, name, rcsopt);
 			if (error)
 				return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:29:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25583106566B;
	Wed,  2 Mar 2011 19:29:36 +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 13DC88FC16;
	Wed,  2 Mar 2011 19:29: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 p22JTZ1a040639;
	Wed, 2 Mar 2011 19:29:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JTZYC040637;
	Wed, 2 Mar 2011 19:29:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103021929.p22JTZYC040637@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 19:29:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219190 - stable/7/contrib/csup
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:29:36 -0000

Author: jhb
Date: Wed Mar  2 19:29:35 2011
New Revision: 219190
URL: http://svn.freebsd.org/changeset/base/219190

Log:
  MFC 217858: Remove dead code.

Modified:
  stable/7/contrib/csup/updater.c
Directory Properties:
  stable/7/contrib/csup/   (props changed)

Modified: stable/7/contrib/csup/updater.c
==============================================================================
--- stable/7/contrib/csup/updater.c	Wed Mar  2 19:29:24 2011	(r219189)
+++ stable/7/contrib/csup/updater.c	Wed Mar  2 19:29:35 2011	(r219190)
@@ -770,7 +770,6 @@ updater_docoll(struct updater *up, struc
 			if (sr->sr_serverattr == NULL)
 				return (UPDATER_ERR_PROTO);
 
-			error = 0;
 			error = updater_rcsedit(up, fup, name, rcsopt);
 			if (error)
 				return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:31:53 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFC1B106566B;
	Wed,  2 Mar 2011 19:31:53 +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 BCEBF8FC16;
	Wed,  2 Mar 2011 19:31: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 p22JVrwA040880;
	Wed, 2 Mar 2011 19:31:53 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JVrgf040876;
	Wed, 2 Mar 2011 19:31:53 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021931.p22JVrgf040876@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:31:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219191 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:31:53 -0000

Author: dchagin
Date: Wed Mar  2 19:31:53 2011
New Revision: 219191
URL: http://svn.freebsd.org/changeset/base/219191

Log:
  MFC r218612:
  In preparation for moving linux_clone () to a MI path
  move the TLS code in a separate function.
  
  Use function parameter instead of direct using register.

Modified:
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:29:35 2011	(r219190)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
@@ -496,6 +496,50 @@ linux_vfork(struct thread *td, struct li
 	return (0);
 }
 
+static int
+linux_set_cloned_tls(struct thread *td, void *desc)
+{
+	struct user_segment_descriptor sd;
+	struct l_user_desc info;
+	struct pcb *pcb;
+	int error;
+	int a[2];
+
+	error = copyin(desc, &info, sizeof(struct l_user_desc));
+	if (error) {
+		printf(LMSG("copyin failed!"));
+	} else {
+		/* We might copy out the entry_number as GUGS32_SEL. */
+		info.entry_number = GUGS32_SEL;
+		error = copyout(&info, desc, sizeof(struct l_user_desc));
+		if (error)
+			printf(LMSG("copyout failed!"));
+
+		a[0] = LINUX_LDT_entry_a(&info);
+		a[1] = LINUX_LDT_entry_b(&info);
+
+		memcpy(&sd, &a, sizeof(a));
+#ifdef DEBUG
+		if (ldebug(clone))
+			printf("Segment created in clone with "
+			    "CLONE_SETTLS: lobase: %x, hibase: %x, "
+			    "lolimit: %x, hilimit: %x, type: %i, "
+			    "dpl: %i, p: %i, xx: %i, long: %i, "
+			    "def32: %i, gran: %i\n", sd.sd_lobase,
+			    sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
+			    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
+			    sd.sd_long, sd.sd_def32, sd.sd_gran);
+#endif
+		pcb = td->td_pcb;
+		pcb->pcb_gsbase = (register_t)info.base_addr;
+/* XXXKIB	pcb->pcb_gs32sd = sd; */
+		td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
+		set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
+	}
+
+	return (error);
+}
+
 int
 linux_clone(struct thread *td, struct linux_clone_args *args)
 {
@@ -613,46 +657,8 @@ linux_clone(struct thread *td, struct li
 	if (args->stack)
 		td2->td_frame->tf_rsp = PTROUT(args->stack);
 
-	if (args->flags & LINUX_CLONE_SETTLS) {
-		struct user_segment_descriptor sd;
-		struct l_user_desc info;
-		struct pcb *pcb;
-		int a[2];
-
-		error = copyin((void *)td->td_frame->tf_rsi, &info,
-		    sizeof(struct l_user_desc));
-		if (error) {
-			printf(LMSG("copyin failed!"));
-		} else {
-			/* We might copy out the entry_number as GUGS32_SEL. */
-			info.entry_number = GUGS32_SEL;
-			error = copyout(&info, (void *)td->td_frame->tf_rsi,
-			    sizeof(struct l_user_desc));
-			if (error)
-				printf(LMSG("copyout failed!"));
-
-			a[0] = LINUX_LDT_entry_a(&info);
-			a[1] = LINUX_LDT_entry_b(&info);
-
-			memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
-			if (ldebug(clone))
-				printf("Segment created in clone with "
-				    "CLONE_SETTLS: lobase: %x, hibase: %x, "
-				    "lolimit: %x, hilimit: %x, type: %i, "
-				    "dpl: %i, p: %i, xx: %i, long: %i, "
-				    "def32: %i, gran: %i\n", sd.sd_lobase,
-				    sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit,
-				    sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx,
-				    sd.sd_long, sd.sd_def32, sd.sd_gran);
-#endif
-			pcb = td2->td_pcb;
-			pcb->pcb_gsbase = (register_t)info.base_addr;
-/* XXXKIB		pcb->pcb_gs32sd = sd; */
-			td2->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL);
-			set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT);
-		}
-	}
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
 
 #ifdef DEBUG
 	if (ldebug(clone))

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:29:35 2011	(r219190)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
@@ -387,6 +387,62 @@ linux_vfork(struct thread *td, struct li
 	return (0);
 }
 
+static int
+linux_set_cloned_tls(struct thread *td, void *desc)
+{
+	struct segment_descriptor sd;
+	struct l_user_desc info;
+	int idx, error;
+	int a[2];
+
+	error = copyin(desc, &info, sizeof(struct l_user_desc));
+	if (error) {
+		printf(LMSG("copyin failed!"));
+	} else {
+		idx = info.entry_number;
+
+		/* 
+		 * looks like we're getting the idx we returned
+		 * in the set_thread_area() syscall
+		 */
+		if (idx != 6 && idx != 3) {
+			printf(LMSG("resetting idx!"));
+			idx = 3;
+		}
+
+		/* this doesnt happen in practice */
+		if (idx == 6) {
+	   		/* we might copy out the entry_number as 3 */
+		   	info.entry_number = 3;
+			error = copyout(&info, desc, sizeof(struct l_user_desc));
+			if (error)
+				printf(LMSG("copyout failed!"));
+		}
+
+		a[0] = LINUX_LDT_entry_a(&info);
+		a[1] = LINUX_LDT_entry_b(&info);
+
+		memcpy(&sd, &a, sizeof(a));
+#ifdef DEBUG
+		if (ldebug(clone))
+			printf("Segment created in clone with "
+			"CLONE_SETTLS: lobase: %x, hibase: %x, "
+			"lolimit: %x, hilimit: %x, type: %i, "
+			"dpl: %i, p: %i, xx: %i, def32: %i, "
+			"gran: %i\n", sd.sd_lobase, sd.sd_hibase,
+			sd.sd_lolimit, sd.sd_hilimit, sd.sd_type,
+			sd.sd_dpl, sd.sd_p, sd.sd_xx,
+			sd.sd_def32, sd.sd_gran);
+#endif
+
+		/* set %gs */
+		td->td_pcb->pcb_gsd = sd;
+		td->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
+	}
+
+	return (error);
+}
+
 int
 linux_clone(struct thread *td, struct linux_clone_args *args)
 {
@@ -505,60 +561,8 @@ linux_clone(struct thread *td, struct li
 	if (args->stack)
    	   	td2->td_frame->tf_esp = (unsigned int)args->stack;
 
-	if (args->flags & LINUX_CLONE_SETTLS) {
-   	   	struct l_user_desc info;
-   	   	int idx;
-	   	int a[2];
-		struct segment_descriptor sd;
-
-	   	error = copyin((void *)td->td_frame->tf_esi, &info, sizeof(struct l_user_desc));
-		if (error) {
-			printf(LMSG("copyin failed!"));
-		} else {
-		
-			idx = info.entry_number;
-		
-			/* 
-			 * looks like we're getting the idx we returned
-			 * in the set_thread_area() syscall
-			 */
-			if (idx != 6 && idx != 3) {
-				printf(LMSG("resetting idx!"));
-				idx = 3;
-			}
-
-			/* this doesnt happen in practice */
-			if (idx == 6) {
-		   		/* we might copy out the entry_number as 3 */
-			   	info.entry_number = 3;
-				error = copyout(&info, (void *) td->td_frame->tf_esi, sizeof(struct l_user_desc));
-				if (error)
-					printf(LMSG("copyout failed!"));
-			}
-
-			a[0] = LINUX_LDT_entry_a(&info);
-			a[1] = LINUX_LDT_entry_b(&info);
-
-			memcpy(&sd, &a, sizeof(a));
-#ifdef DEBUG
-		if (ldebug(clone))
-		   	printf("Segment created in clone with CLONE_SETTLS: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase,
-			sd.sd_hibase,
-			sd.sd_lolimit,
-			sd.sd_hilimit,
-			sd.sd_type,
-			sd.sd_dpl,
-			sd.sd_p,
-			sd.sd_xx,
-			sd.sd_def32,
-			sd.sd_gran);
-#endif
-
-			/* set %gs */
-			td2->td_pcb->pcb_gsd = sd;
-			td2->td_pcb->pcb_gs = GSEL(GUGS_SEL, SEL_UPL);
-		}
-	} 
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
 
 #ifdef DEBUG
 	if (ldebug(clone))

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:33:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47B46106566C;
	Wed,  2 Mar 2011 19:33:47 +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 35BB18FC15;
	Wed,  2 Mar 2011 19:33: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 p22JXl5N041090;
	Wed, 2 Mar 2011 19:33:47 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JXl6q041085;
	Wed, 2 Mar 2011 19:33:47 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021933.p22JXl6q041085@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:33:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219192 - in stable/8/sys: amd64/linux32 i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:33:47 -0000

Author: dchagin
Date: Wed Mar  2 19:33:46 2011
New Revision: 219192
URL: http://svn.freebsd.org/changeset/base/219192

Log:
  MFC r218613:
  In preparation for moving linux_clone() to a MI path
  introduce linux_set_upcall_kse() which is used for MD works.

Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/i386/linux/linux.h
  stable/8/sys/i386/linux/linux_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
@@ -920,4 +920,6 @@ struct linux_robust_list_head {
 	l_uintptr_t			pending_list;
 };
 
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
 #endif /* !_AMD64_LINUX_H_ */

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
@@ -655,7 +655,7 @@ linux_clone(struct thread *td, struct li
 	 * intact.
 	 */
 	if (args->stack)
-		td2->td_frame->tf_rsp = PTROUT(args->stack);
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
 
 	if (args->flags & LINUX_CLONE_SETTLS)
 		linux_set_cloned_tls(td2, args->tls);
@@ -694,6 +694,15 @@ linux_clone(struct thread *td, struct li
 	return (0);
 }
 
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+	td->td_frame->tf_rsp = stack;
+
+	return (0);
+}
+
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
@@ -880,4 +880,6 @@ struct linux_robust_list_head {
 	struct linux_robust_list	*pending_list;
 };
 
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
 #endif /* !_I386_LINUX_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:31:53 2011	(r219191)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
@@ -559,7 +559,7 @@ linux_clone(struct thread *td, struct li
 	 * this is what normal fork() does so we just keep the tf_esp arg intact
 	 */
 	if (args->stack)
-   	   	td2->td_frame->tf_esp = (unsigned int)args->stack;
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
 
 	if (args->flags & LINUX_CLONE_SETTLS)
 		linux_set_cloned_tls(td2, args->tls);
@@ -597,6 +597,15 @@ linux_clone(struct thread *td, struct li
 	return (0);
 }
 
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+	td->td_frame->tf_esp = stack;
+
+	return (0);
+}
+
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:36:06 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91277106566B;
	Wed,  2 Mar 2011 19:36:06 +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 7D5D28FC0C;
	Wed,  2 Mar 2011 19:36: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 p22Ja6mB041410;
	Wed, 2 Mar 2011 19:36:06 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Ja66I041400;
	Wed, 2 Mar 2011 19:36:06 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021936.p22Ja66I041400@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:36:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219193 - in stable/8/sys: amd64/linux32 compat/linux
	conf i386/linux modules/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:36:06 -0000

Author: dchagin
Date: Wed Mar  2 19:36:06 2011
New Revision: 219193
URL: http://svn.freebsd.org/changeset/base/219193

Log:
  MFC r218616:
  Move linux_clone(), linux_fork(), linux_vfork() to a MI path.

Added:
  stable/8/sys/compat/linux/linux_fork.c
     - copied unchanged from r218616, head/sys/compat/linux/linux_fork.c
Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/amd64/linux32/linux32_machdep.c
  stable/8/sys/conf/files.amd64
  stable/8/sys/conf/files.i386
  stable/8/sys/conf/files.pc98
  stable/8/sys/i386/linux/linux.h
  stable/8/sys/i386/linux/linux_machdep.c
  stable/8/sys/modules/linux/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 19:36:06 2011	(r219193)
@@ -921,5 +921,6 @@ struct linux_robust_list_head {
 };
 
 int linux_set_upcall_kse(struct thread *td, register_t stack);
+int linux_set_cloned_tls(struct thread *td, void *desc);
 
 #endif /* !_AMD64_LINUX_H_ */

Modified: stable/8/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/amd64/linux32/linux32_machdep.c	Wed Mar  2 19:36:06 2011	(r219193)
@@ -409,94 +409,6 @@ linux_old_select(struct thread *td, stru
 }
 
 int
-linux_fork(struct thread *td, struct linux_fork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(fork))
-		printf(ARGS(fork, ""));
-#endif
-
-	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	return (0);
-}
-
-int
-linux_vfork(struct thread *td, struct linux_vfork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(vfork))
-		printf(ARGS(vfork, ""));
-#endif
-
-	/* Exclude RFPPWAIT */
-	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	if (error == 0) {
-	   	td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	PROC_LOCK(p2);
-	p2->p_flag |= P_PPWAIT;
-	PROC_UNLOCK(p2);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	/* wait for the children to exit, ie. emulate vfork */
-	PROC_LOCK(p2);
-	while (p2->p_flag & P_PPWAIT)
-		cv_wait(&p2->p_pwait, &p2->p_mtx);
-	PROC_UNLOCK(p2);
-
-	return (0);
-}
-
-static int
 linux_set_cloned_tls(struct thread *td, void *desc)
 {
 	struct user_segment_descriptor sd;
@@ -541,160 +453,6 @@ linux_set_cloned_tls(struct thread *td, 
 }
 
 int
-linux_clone(struct thread *td, struct linux_clone_args *args)
-{
-	int error, ff = RFPROC | RFSTOPPED;
-	struct proc *p2;
-	struct thread *td2;
-	int exit_signal;
-	struct linux_emuldata *em;
-
-#ifdef DEBUG
-	if (ldebug(clone)) {
-		printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, "
-		    "child tid: %p"), (unsigned)args->flags,
-		    args->stack, args->parent_tidptr, args->child_tidptr);
-	}
-#endif
-
-	exit_signal = args->flags & 0x000000ff;
-	if (LINUX_SIG_VALID(exit_signal)) {
-		if (exit_signal <= LINUX_SIGTBLSZ)
-			exit_signal =
-			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
-	} else if (exit_signal != 0)
-		return (EINVAL);
-
-	if (args->flags & LINUX_CLONE_VM)
-		ff |= RFMEM;
-	if (args->flags & LINUX_CLONE_SIGHAND)
-		ff |= RFSIGSHARE;
-	/*
-	 * XXX: In Linux, sharing of fs info (chroot/cwd/umask)
-	 * and open files is independant.  In FreeBSD, its in one
-	 * structure but in reality it does not cause any problems
-	 * because both of these flags are usually set together.
-	 */
-	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
-		ff |= RFFDG;
-
-	/*
-	 * Attempt to detect when linux_clone(2) is used for creating
-	 * kernel threads. Unfortunately despite the existence of the
-	 * CLONE_THREAD flag, version of linuxthreads package used in
-	 * most popular distros as of beginning of 2005 doesn't make
-	 * any use of it. Therefore, this detection relies on
-	 * empirical observation that linuxthreads sets certain
-	 * combination of flags, so that we can make more or less
-	 * precise detection and notify the FreeBSD kernel that several
-	 * processes are in fact part of the same threading group, so
-	 * that special treatment is necessary for signal delivery
-	 * between those processes and fd locking.
-	 */
-	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
-		ff |= RFTHREAD;
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID)
-		if (args->parent_tidptr == NULL)
-			return (EINVAL);
-
-	error = fork1(td, ff, 0, &p2);
-	if (error)
-		return (error);
-
-	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
-	   	sx_xlock(&proctree_lock);
-		PROC_LOCK(p2);
-		proc_reparent(p2, td->td_proc->p_pptr);
-		PROC_UNLOCK(p2);
-		sx_xunlock(&proctree_lock);
-	}
-
-	/* create the emuldata */
-	error = linux_proc_init(td, p2->p_pid, args->flags);
-	/* reference it - no need to check this */
-	em = em_find(p2, EMUL_DOLOCK);
-	KASSERT(em != NULL, ("clone: emuldata not found.\n"));
-	/* and adjust it */
-
-	if (args->flags & LINUX_CLONE_THREAD) {
-#ifdef notyet
-	   	PROC_LOCK(p2);
-	   	p2->p_pgrp = td->td_proc->p_pgrp;
-	   	PROC_UNLOCK(p2);
-#endif
-		exit_signal = 0;
-	}
-
-	if (args->flags & LINUX_CLONE_CHILD_SETTID)
-		em->child_set_tid = args->child_tidptr;
-	else
-	   	em->child_set_tid = NULL;
-
-	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
-		em->child_clear_tid = args->child_tidptr;
-	else
-	   	em->child_clear_tid = NULL;
-
-	EMUL_UNLOCK(&emul_lock);
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
-		error = copyout(&p2->p_pid, args->parent_tidptr,
-		    sizeof(p2->p_pid));
-		if (error)
-			printf(LMSG("copyout failed!"));
-	}
-
-	PROC_LOCK(p2);
-	p2->p_sigparent = exit_signal;
-	PROC_UNLOCK(p2);
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	/*
-	 * In a case of stack = NULL, we are supposed to COW calling process
-	 * stack. This is what normal fork() does, so we just keep tf_rsp arg
-	 * intact.
-	 */
-	if (args->stack)
-		linux_set_upcall_kse(td2, PTROUT(args->stack));
-
-	if (args->flags & LINUX_CLONE_SETTLS)
-		linux_set_cloned_tls(td2, args->tls);
-
-#ifdef DEBUG
-	if (ldebug(clone))
-		printf(LMSG("clone: successful rfork to %d, "
-		    "stack %p sig = %d"), (int)p2->p_pid, args->stack,
-		    exit_signal);
-#endif
-	if (args->flags & LINUX_CLONE_VFORK) {
-	   	PROC_LOCK(p2);
-	   	p2->p_flag |= P_PPWAIT;
-	   	PROC_UNLOCK(p2);
-	}
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
-
-	if (args->flags & LINUX_CLONE_VFORK) {
-		/* wait for the children to exit, ie. emulate vfork */
-		PROC_LOCK(p2);
-		while (p2->p_flag & P_PPWAIT)
-			cv_wait(&p2->p_pwait, &p2->p_mtx);
-		PROC_UNLOCK(p2);
-	}
-
-	return (0);
-}
-
-int
 linux_set_upcall_kse(struct thread *td, register_t stack)
 {
 

Copied: stable/8/sys/compat/linux/linux_fork.c (from r218616, head/sys/compat/linux/linux_fork.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:36:06 2011	(r219193, copy of r218616, head/sys/compat/linux/linux_fork.c)
@@ -0,0 +1,297 @@
+/*-
+ * Copyright (c) 2004 Tim J. Robbins
+ * Copyright (c) 2002 Doug Rabson
+ * Copyright (c) 2000 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer
+ *    in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_compat.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#ifdef COMPAT_LINUX32
+#include 
+#include 
+#else
+#include 
+#include 
+#endif
+#include 
+#include 
+
+
+int
+linux_fork(struct thread *td, struct linux_fork_args *args)
+{
+	int error;
+	struct proc *p2;
+	struct thread *td2;
+
+#ifdef DEBUG
+	if (ldebug(fork))
+		printf(ARGS(fork, ""));
+#endif
+
+	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
+		return (error);
+
+	if (error == 0) {
+		td->td_retval[0] = p2->p_pid;
+		td->td_retval[1] = 0;
+	}
+
+	if (td->td_retval[1] == 1)
+		td->td_retval[0] = 0;
+	error = linux_proc_init(td, td->td_retval[0], 0);
+	if (error)
+		return (error);
+
+	td2 = FIRST_THREAD_IN_PROC(p2);
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	return (0);
+}
+
+int
+linux_vfork(struct thread *td, struct linux_vfork_args *args)
+{
+	int error;
+	struct proc *p2;
+	struct thread *td2;
+
+#ifdef DEBUG
+	if (ldebug(vfork))
+		printf(ARGS(vfork, ""));
+#endif
+
+	/* Exclude RFPPWAIT */
+	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
+		return (error);
+	if (error == 0) {
+	   	td->td_retval[0] = p2->p_pid;
+		td->td_retval[1] = 0;
+	}
+	/* Are we the child? */
+	if (td->td_retval[1] == 1)
+		td->td_retval[0] = 0;
+	error = linux_proc_init(td, td->td_retval[0], 0);
+	if (error)
+		return (error);
+
+	PROC_LOCK(p2);
+	p2->p_flag |= P_PPWAIT;
+	PROC_UNLOCK(p2);
+
+	td2 = FIRST_THREAD_IN_PROC(p2);
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	/* wait for the children to exit, ie. emulate vfork */
+	PROC_LOCK(p2);
+	while (p2->p_flag & P_PPWAIT)
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
+	PROC_UNLOCK(p2);
+
+	return (0);
+}
+
+int
+linux_clone(struct thread *td, struct linux_clone_args *args)
+{
+	int error, ff = RFPROC | RFSTOPPED;
+	struct proc *p2;
+	struct thread *td2;
+	int exit_signal;
+	struct linux_emuldata *em;
+
+#ifdef DEBUG
+	if (ldebug(clone)) {
+		printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, "
+		    "child tid: %p"), (unsigned)args->flags,
+		    args->stack, args->parent_tidptr, args->child_tidptr);
+	}
+#endif
+
+	exit_signal = args->flags & 0x000000ff;
+	if (LINUX_SIG_VALID(exit_signal)) {
+		if (exit_signal <= LINUX_SIGTBLSZ)
+			exit_signal =
+			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
+	} else if (exit_signal != 0)
+		return (EINVAL);
+
+	if (args->flags & LINUX_CLONE_VM)
+		ff |= RFMEM;
+	if (args->flags & LINUX_CLONE_SIGHAND)
+		ff |= RFSIGSHARE;
+	/*
+	 * XXX: In Linux, sharing of fs info (chroot/cwd/umask)
+	 * and open files is independant.  In FreeBSD, its in one
+	 * structure but in reality it does not cause any problems
+	 * because both of these flags are usually set together.
+	 */
+	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
+		ff |= RFFDG;
+
+	/*
+	 * Attempt to detect when linux_clone(2) is used for creating
+	 * kernel threads. Unfortunately despite the existence of the
+	 * CLONE_THREAD flag, version of linuxthreads package used in
+	 * most popular distros as of beginning of 2005 doesn't make
+	 * any use of it. Therefore, this detection relies on
+	 * empirical observation that linuxthreads sets certain
+	 * combination of flags, so that we can make more or less
+	 * precise detection and notify the FreeBSD kernel that several
+	 * processes are in fact part of the same threading group, so
+	 * that special treatment is necessary for signal delivery
+	 * between those processes and fd locking.
+	 */
+	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
+		ff |= RFTHREAD;
+
+	if (args->flags & LINUX_CLONE_PARENT_SETTID)
+		if (args->parent_tidptr == NULL)
+			return (EINVAL);
+
+	error = fork1(td, ff, 0, &p2);
+	if (error)
+		return (error);
+
+	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
+	   	sx_xlock(&proctree_lock);
+		PROC_LOCK(p2);
+		proc_reparent(p2, td->td_proc->p_pptr);
+		PROC_UNLOCK(p2);
+		sx_xunlock(&proctree_lock);
+	}
+
+	/* create the emuldata */
+	error = linux_proc_init(td, p2->p_pid, args->flags);
+	/* reference it - no need to check this */
+	em = em_find(p2, EMUL_DOLOCK);
+	KASSERT(em != NULL, ("clone: emuldata not found."));
+	/* and adjust it */
+
+	if (args->flags & LINUX_CLONE_THREAD) {
+#ifdef notyet
+	   	PROC_LOCK(p2);
+	   	p2->p_pgrp = td->td_proc->p_pgrp;
+	   	PROC_UNLOCK(p2);
+#endif
+		exit_signal = 0;
+	}
+
+	if (args->flags & LINUX_CLONE_CHILD_SETTID)
+		em->child_set_tid = args->child_tidptr;
+	else
+	   	em->child_set_tid = NULL;
+
+	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
+		em->child_clear_tid = args->child_tidptr;
+	else
+	   	em->child_clear_tid = NULL;
+
+	EMUL_UNLOCK(&emul_lock);
+
+	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
+		error = copyout(&p2->p_pid, args->parent_tidptr,
+		    sizeof(p2->p_pid));
+		if (error)
+			printf(LMSG("copyout failed!"));
+	}
+
+	PROC_LOCK(p2);
+	p2->p_sigparent = exit_signal;
+	PROC_UNLOCK(p2);
+	td2 = FIRST_THREAD_IN_PROC(p2);
+	/*
+	 * In a case of stack = NULL, we are supposed to COW calling process
+	 * stack. This is what normal fork() does, so we just keep tf_rsp arg
+	 * intact.
+	 */
+	if (args->stack)
+		linux_set_upcall_kse(td2, PTROUT(args->stack));
+
+	if (args->flags & LINUX_CLONE_SETTLS)
+		linux_set_cloned_tls(td2, args->tls);
+
+#ifdef DEBUG
+	if (ldebug(clone))
+		printf(LMSG("clone: successful rfork to %d, "
+		    "stack %p sig = %d"), (int)p2->p_pid, args->stack,
+		    exit_signal);
+#endif
+	if (args->flags & LINUX_CLONE_VFORK) {
+	   	PROC_LOCK(p2);
+	   	p2->p_flag |= P_PPWAIT;
+	   	PROC_UNLOCK(p2);
+	}
+
+	/*
+	 * Make this runnable after we are finished with it.
+	 */
+	thread_lock(td2);
+	TD_SET_CAN_RUN(td2);
+	sched_add(td2, SRQ_BORING);
+	thread_unlock(td2);
+
+	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
+
+	if (args->flags & LINUX_CLONE_VFORK) {
+		/* wait for the children to exit, ie. emulate vfork */
+		PROC_LOCK(p2);
+		while (p2->p_flag & P_PPWAIT)
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
+		PROC_UNLOCK(p2);
+	}
+
+	return (0);
+}

Modified: stable/8/sys/conf/files.amd64
==============================================================================
--- stable/8/sys/conf/files.amd64	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.amd64	Wed Mar  2 19:36:06 2011	(r219193)
@@ -266,6 +266,7 @@ amd64/linux32/linux32_sysent.c	optional	
 amd64/linux32/linux32_sysvec.c	optional	compat_linux32
 compat/linux/linux_emul.c	optional	compat_linux32
 compat/linux/linux_file.c	optional	compat_linux32
+compat/linux/linux_fork.c	optional	compat_linux32
 compat/linux/linux_futex.c	optional	compat_linux32
 compat/linux/linux_getcwd.c	optional	compat_linux32
 compat/linux/linux_ioctl.c	optional	compat_linux32

Modified: stable/8/sys/conf/files.i386
==============================================================================
--- stable/8/sys/conf/files.i386	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.i386	Wed Mar  2 19:36:06 2011	(r219193)
@@ -71,6 +71,7 @@ compat/linprocfs/linprocfs.c	optional li
 compat/linsysfs/linsysfs.c	optional linsysfs
 compat/linux/linux_emul.c	optional compat_linux
 compat/linux/linux_file.c	optional compat_linux
+compat/linux/linux_fork.c	optional compat_linux
 compat/linux/linux_futex.c	optional compat_linux
 compat/linux/linux_getcwd.c	optional compat_linux
 compat/linux/linux_ioctl.c	optional compat_linux

Modified: stable/8/sys/conf/files.pc98
==============================================================================
--- stable/8/sys/conf/files.pc98	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/conf/files.pc98	Wed Mar  2 19:36:06 2011	(r219193)
@@ -42,6 +42,7 @@ compat/linprocfs/linprocfs.c	optional li
 compat/linsysfs/linsysfs.c	optional linsysfs
 compat/linux/linux_emul.c	optional compat_linux
 compat/linux/linux_file.c	optional compat_linux
+compat/linux/linux_fork.c	optional compat_linux
 compat/linux/linux_futex.c	optional compat_linux
 compat/linux/linux_getcwd.c	optional compat_linux
 compat/linux/linux_ioctl.c	optional compat_linux

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 19:36:06 2011	(r219193)
@@ -881,5 +881,6 @@ struct linux_robust_list_head {
 };
 
 int linux_set_upcall_kse(struct thread *td, register_t stack);
+int linux_set_cloned_tls(struct thread *td, void *desc);
 
 #endif /* !_I386_LINUX_H_ */

Modified: stable/8/sys/i386/linux/linux_machdep.c
==============================================================================
--- stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/i386/linux/linux_machdep.c	Wed Mar  2 19:36:06 2011	(r219193)
@@ -300,94 +300,6 @@ linux_old_select(struct thread *td, stru
 }
 
 int
-linux_fork(struct thread *td, struct linux_fork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(fork))
-		printf(ARGS(fork, ""));
-#endif
-
-	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	return (0);
-}
-
-int
-linux_vfork(struct thread *td, struct linux_vfork_args *args)
-{
-	int error;
-	struct proc *p2;
-	struct thread *td2;
-
-#ifdef DEBUG
-	if (ldebug(vfork))
-		printf(ARGS(vfork, ""));
-#endif
-
-	/* exclude RFPPWAIT */
-	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
-		return (error);
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
-	error = linux_proc_init(td, td->td_retval[0], 0);
-	if (error)
-		return (error);
-
-	PROC_LOCK(p2);
-	p2->p_flag |= P_PPWAIT;
-	PROC_UNLOCK(p2);
-
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	/* wait for the children to exit, ie. emulate vfork */
-	PROC_LOCK(p2);
-	while (p2->p_flag & P_PPWAIT)
-		cv_wait(&p2->p_pwait, &p2->p_mtx);
-	PROC_UNLOCK(p2);
-
-	return (0);
-}
-
-static int
 linux_set_cloned_tls(struct thread *td, void *desc)
 {
 	struct segment_descriptor sd;
@@ -444,160 +356,6 @@ linux_set_cloned_tls(struct thread *td, 
 }
 
 int
-linux_clone(struct thread *td, struct linux_clone_args *args)
-{
-	int error, ff = RFPROC | RFSTOPPED;
-	struct proc *p2;
-	struct thread *td2;
-	int exit_signal;
-	struct linux_emuldata *em;
-
-#ifdef DEBUG
-	if (ldebug(clone)) {
-   	   	printf(ARGS(clone, "flags %x, stack %x, parent tid: %x, child tid: %x"),
-		    (unsigned int)args->flags, (unsigned int)args->stack, 
-		    (unsigned int)args->parent_tidptr, (unsigned int)args->child_tidptr);
-	}
-#endif
-
-	exit_signal = args->flags & 0x000000ff;
-	if (LINUX_SIG_VALID(exit_signal)) {
-		if (exit_signal <= LINUX_SIGTBLSZ)
-			exit_signal =
-			    linux_to_bsd_signal[_SIG_IDX(exit_signal)];
-	} else if (exit_signal != 0)
-		return (EINVAL);
-
-	if (args->flags & LINUX_CLONE_VM)
-		ff |= RFMEM;
-	if (args->flags & LINUX_CLONE_SIGHAND)
-		ff |= RFSIGSHARE;
-	/* 
-	 * XXX: in linux sharing of fs info (chroot/cwd/umask)
-	 * and open files is independant. in fbsd its in one
-	 * structure but in reality it doesn't cause any problems
-	 * because both of these flags are usually set together.
-	 */
-	if (!(args->flags & (LINUX_CLONE_FILES | LINUX_CLONE_FS)))
-		ff |= RFFDG;
-
-	/*
-	 * Attempt to detect when linux_clone(2) is used for creating
-	 * kernel threads. Unfortunately despite the existence of the
-	 * CLONE_THREAD flag, version of linuxthreads package used in
-	 * most popular distros as of beginning of 2005 doesn't make
-	 * any use of it. Therefore, this detection relies on
-	 * empirical observation that linuxthreads sets certain
-	 * combination of flags, so that we can make more or less
-	 * precise detection and notify the FreeBSD kernel that several
-	 * processes are in fact part of the same threading group, so
-	 * that special treatment is necessary for signal delivery
-	 * between those processes and fd locking.
-	 */
-	if ((args->flags & 0xffffff00) == LINUX_THREADING_FLAGS)
-		ff |= RFTHREAD;
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID)
-		if (args->parent_tidptr == NULL)
-			return (EINVAL);
-
-	error = fork1(td, ff, 0, &p2);
-	if (error)
-		return (error);
-
-	if (args->flags & (LINUX_CLONE_PARENT | LINUX_CLONE_THREAD)) {
-	   	sx_xlock(&proctree_lock);
-		PROC_LOCK(p2);
-		proc_reparent(p2, td->td_proc->p_pptr);
-		PROC_UNLOCK(p2);
-		sx_xunlock(&proctree_lock);
-	}
-	
-	/* create the emuldata */
-	error = linux_proc_init(td, p2->p_pid, args->flags);
-	/* reference it - no need to check this */
-	em = em_find(p2, EMUL_DOLOCK);
-	KASSERT(em != NULL, ("clone: emuldata not found.\n"));
-	/* and adjust it */
-
-	if (args->flags & LINUX_CLONE_THREAD) {
-	   	/* XXX: linux mangles pgrp and pptr somehow
-		 * I think it might be this but I am not sure.
-		 */
-#ifdef notyet
-	   	PROC_LOCK(p2);
-	   	p2->p_pgrp = td->td_proc->p_pgrp;
-	   	PROC_UNLOCK(p2);
-#endif
-	 	exit_signal = 0;
-	}
-
-	if (args->flags & LINUX_CLONE_CHILD_SETTID)
-		em->child_set_tid = args->child_tidptr;
-	else
-	   	em->child_set_tid = NULL;
-
-	if (args->flags & LINUX_CLONE_CHILD_CLEARTID)
-		em->child_clear_tid = args->child_tidptr;
-	else
-	   	em->child_clear_tid = NULL;
-
-	EMUL_UNLOCK(&emul_lock);
-
-	if (args->flags & LINUX_CLONE_PARENT_SETTID) {
-		error = copyout(&p2->p_pid, args->parent_tidptr, sizeof(p2->p_pid));
-		if (error)
-			printf(LMSG("copyout failed!"));
-	}
-
-	PROC_LOCK(p2);
-	p2->p_sigparent = exit_signal;
-	PROC_UNLOCK(p2);
-	td2 = FIRST_THREAD_IN_PROC(p2);
-	/* 
-	 * in a case of stack = NULL we are supposed to COW calling process stack
-	 * this is what normal fork() does so we just keep the tf_esp arg intact
-	 */
-	if (args->stack)
-		linux_set_upcall_kse(td2, PTROUT(args->stack));
-
-	if (args->flags & LINUX_CLONE_SETTLS)
-		linux_set_cloned_tls(td2, args->tls);
-
-#ifdef DEBUG
-	if (ldebug(clone))
-		printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"),
-		    (long)p2->p_pid, args->stack, exit_signal);
-#endif
-	if (args->flags & LINUX_CLONE_VFORK) {
-	   	PROC_LOCK(p2);
-		p2->p_flag |= P_PPWAIT;
-	   	PROC_UNLOCK(p2);
-	}
-
-	/*
-	 * Make this runnable after we are finished with it.
-	 */
-	thread_lock(td2);
-	TD_SET_CAN_RUN(td2);
-	sched_add(td2, SRQ_BORING);
-	thread_unlock(td2);
-
-	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
-
-	if (args->flags & LINUX_CLONE_VFORK) {
-   	   	/* wait for the children to exit, ie. emulate vfork */
-   	   	PROC_LOCK(p2);
-		while (p2->p_flag & P_PPWAIT)
-			cv_wait(&p2->p_pwait, &p2->p_mtx);
-		PROC_UNLOCK(p2);
-	}
-
-	return (0);
-}
-
-int
 linux_set_upcall_kse(struct thread *td, register_t stack)
 {
 

Modified: stable/8/sys/modules/linux/Makefile
==============================================================================
--- stable/8/sys/modules/linux/Makefile	Wed Mar  2 19:33:46 2011	(r219192)
+++ stable/8/sys/modules/linux/Makefile	Wed Mar  2 19:36:06 2011	(r219193)
@@ -8,7 +8,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINU
 .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
 
 KMOD=	linux
-SRCS=	linux${SFX}_dummy.c linux_emul.c linux_file.c \
+SRCS=	linux_fork.c linux${SFX}_dummy.c linux_emul.c linux_file.c \
 	linux_futex.c linux_getcwd.c linux_ioctl.c linux_ipc.c \
 	linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
 	linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:38:14 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CC9D1065670;
	Wed,  2 Mar 2011 19:38:14 +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 1B7408FC14;
	Wed,  2 Mar 2011 19:38: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 p22JcEk7041811;
	Wed, 2 Mar 2011 19:38:14 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JcDnL041809;
	Wed, 2 Mar 2011 19:38:13 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021938.p22JcDnL041809@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:38:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219194 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:38:14 -0000

Author: dchagin
Date: Wed Mar  2 19:38:13 2011
New Revision: 219194
URL: http://svn.freebsd.org/changeset/base/219194

Log:
  MFC r218617:
  Remove bogus include 

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:36:06 2011	(r219193)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:38:13 2011	(r219194)
@@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 #ifdef COMPAT_LINUX32
 #include 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:39:43 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DDAC106564A;
	Wed,  2 Mar 2011 19:39:43 +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 0C5F88FC08;
	Wed,  2 Mar 2011 19:39: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 p22JdgiW042123;
	Wed, 2 Mar 2011 19:39:42 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Jdg3T042121;
	Wed, 2 Mar 2011 19:39:42 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021939.p22Jdg3T042121@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:39:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219195 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:39:43 -0000

Author: dchagin
Date: Wed Mar  2 19:39:42 2011
New Revision: 219195
URL: http://svn.freebsd.org/changeset/base/219195

Log:
  MFC r218618:
  Slightly rewrite linux_fork:
  
  1) Remove bogus error checking.
  2) A new process exit from kernel through fork_trampoline(),
     so remove bogus check.

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:38:13 2011	(r219194)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 19:39:42 2011	(r219195)
@@ -67,13 +67,9 @@ linux_fork(struct thread *td, struct lin
 	if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0)
 		return (error);
 
-	if (error == 0) {
-		td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
+	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
 
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)
 		return (error);
@@ -106,13 +102,10 @@ linux_vfork(struct thread *td, struct li
 	/* Exclude RFPPWAIT */
 	if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0)
 		return (error);
-	if (error == 0) {
-	   	td->td_retval[0] = p2->p_pid;
-		td->td_retval[1] = 0;
-	}
-	/* Are we the child? */
-	if (td->td_retval[1] == 1)
-		td->td_retval[0] = 0;
+
+   	td->td_retval[0] = p2->p_pid;
+	td->td_retval[1] = 0;
+
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)
 		return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:41:09 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7788106564A;
	Wed,  2 Mar 2011 19:41:09 +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 AC1518FC08;
	Wed,  2 Mar 2011 19:41: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 p22Jf9fR042392;
	Wed, 2 Mar 2011 19:41:09 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Jf9cW042388;
	Wed, 2 Mar 2011 19:41:09 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021941.p22Jf9cW042388@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:41:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219196 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:41:10 -0000

Author: dchagin
Date: Wed Mar  2 19:41:09 2011
New Revision: 219196
URL: http://svn.freebsd.org/changeset/base/219196

Log:
  MFC r218621:
  Rename used_requeue and use it as bitwise field to store more flags.
  Reimplement used_requeue logic with LINUX_XDEPR_REQUEUEOP flag.

Modified:
  stable/8/sys/compat/linux/linux_emul.c
  stable/8/sys/compat/linux/linux_emul.h
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_emul.c
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_emul.c	Wed Mar  2 19:41:09 2011	(r219196)
@@ -87,7 +87,7 @@ linux_proc_init(struct thread *td, pid_t
 		em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO);
 		em->pid = child;
 		em->pdeath_signal = 0;
-		em->used_requeue = 0;
+		em->flags = 0;
 		em->robust_futexes = NULL;
 		if (flags & LINUX_CLONE_THREAD) {
 			/* handled later in the code */

Modified: stable/8/sys/compat/linux/linux_emul.h
==============================================================================
--- stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_emul.h	Wed Mar  2 19:41:09 2011	(r219196)
@@ -55,7 +55,7 @@ struct linux_emuldata {
 	struct linux_emuldata_shared *shared;
 
 	int	pdeath_signal;		/* parent death signal */
-	int	used_requeue;		/* uses deprecated futex op */
+	int	flags;			/* different emuldata flags */
 
 	struct	linux_robust_list_head	*robust_futexes;
 
@@ -76,6 +76,10 @@ struct linux_emuldata	*em_find(struct pr
 #define	EMUL_DOLOCK		1
 #define	EMUL_DONTLOCK		0
 
+/* emuldata flags */
+#define	LINUX_XDEPR_REQUEUEOP	0x00000001	/* uses deprecated
+						   futex REQUEUE op*/
+
 int	linux_proc_init(struct thread *, pid_t, int);
 void	linux_proc_exit(void *, struct proc *);
 void	linux_schedtail(void *, struct proc *);

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:39:42 2011	(r219195)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:41:09 2011	(r219196)
@@ -691,11 +691,11 @@ linux_sys_futex(struct thread *td, struc
 		 * FUTEX_REQUEUE returned EINVAL.
 		 */
 		em = em_find(td->td_proc, EMUL_DONTLOCK);
-		if (em->used_requeue == 0) {
+		if ((em->flags & LINUX_XDEPR_REQUEUEOP) == 0) {
 			linux_msg(td,
 				  "linux_sys_futex: "
 				  "unsupported futex_requeue op\n");
-			em->used_requeue = 1;
+			em->flags |= LINUX_XDEPR_REQUEUEOP;
 		}
 		return (EINVAL);
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:43:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A217B1065670;
	Wed,  2 Mar 2011 19:43:31 +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 907DA8FC17;
	Wed,  2 Mar 2011 19:43: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 p22JhV85042835;
	Wed, 2 Mar 2011 19:43:31 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JhVhb042833;
	Wed, 2 Mar 2011 19:43:31 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021943.p22JhVhb042833@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:43:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219197 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:43:31 -0000

Author: dchagin
Date: Wed Mar  2 19:43:31 2011
New Revision: 219197
URL: http://svn.freebsd.org/changeset/base/219197

Log:
  MFC r218654, r218655:
  Stop printing the LOR, as this is expected behavior.
  Remove comment about 'ftlk' LOR.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:41:09 2011	(r219196)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:43:31 2011	(r219197)
@@ -88,7 +88,7 @@ struct futex_list futex_list;
 
 #define FUTEX_LOCK(f)		sx_xlock(&(f)->f_lck)
 #define FUTEX_UNLOCK(f)		sx_xunlock(&(f)->f_lck)
-#define FUTEX_INIT(f)		sx_init_flags(&(f)->f_lck, "ftlk", 0)
+#define FUTEX_INIT(f)		sx_init_flags(&(f)->f_lck, "ftlk", SX_DUPOK)
 #define FUTEX_DESTROY(f)	sx_destroy(&(f)->f_lck)
 #define FUTEX_ASSERT_LOCKED(f)	sx_assert(&(f)->f_lck, SA_XLOCKED)
 
@@ -565,8 +565,7 @@ linux_sys_futex(struct thread *td, struc
 
 		/*
 		 * To avoid deadlocks return EINVAL if second futex
-		 * exists at this time. Otherwise create the new futex
-		 * and ignore false positive LOR which thus happens.
+		 * exists at this time.
 		 *
 		 * Glibc fall back to FUTEX_WAKE in case of any error
 		 * returned by FUTEX_CMP_REQUEUE.

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:45:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B87D5106564A;
	Wed,  2 Mar 2011 19:45:50 +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 8A1CB8FC13;
	Wed,  2 Mar 2011 19:45: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 p22Jjomb043336;
	Wed, 2 Mar 2011 19:45:50 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JjoAN043332;
	Wed, 2 Mar 2011 19:45:50 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021945.p22JjoAN043332@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:45:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219198 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:45:50 -0000

Author: dchagin
Date: Wed Mar  2 19:45:50 2011
New Revision: 219198
URL: http://svn.freebsd.org/changeset/base/219198

Log:
  MFC r218658, r218668:
  Sort include files in the alphabetical order.

Modified:
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/compat/linux/linux_futex.c
  stable/8/sys/i386/linux/linux_sysvec.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -60,8 +60,8 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex.
 #include 
 #include 
 #endif
-#include 
 #include 
+#include 
 #include 
 
 MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes");

Modified: stable/8/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysvec.c	Wed Mar  2 19:43:31 2011	(r219197)
+++ stable/8/sys/i386/linux/linux_sysvec.c	Wed Mar  2 19:45:50 2011	(r219198)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:46:45 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E42E6106564A;
	Wed,  2 Mar 2011 19:46:45 +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 D2E5E8FC20;
	Wed,  2 Mar 2011 19:46: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 p22Jkj3F043525;
	Wed, 2 Mar 2011 19:46:45 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JkjP9043523;
	Wed, 2 Mar 2011 19:46:45 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021946.p22JkjP9043523@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:46:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219199 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:46:46 -0000

Author: dchagin
Date: Wed Mar  2 19:46:45 2011
New Revision: 219199
URL: http://svn.freebsd.org/changeset/base/219199

Log:
  MFC r218686:
  Style(9) fix. Do not initialize variables in the declarations.

Modified:
  stable/8/sys/compat/linux/linux_futex.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_futex.c
==============================================================================
--- stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:45:50 2011	(r219198)
+++ stable/8/sys/compat/linux/linux_futex.c	Wed Mar  2 19:46:45 2011	(r219199)
@@ -448,8 +448,8 @@ linux_sys_futex(struct thread *td, struc
 	int clockrt, nrwake, op_ret, ret, val;
 	struct linux_emuldata *em;
 	struct waiting_proc *wp;
-	struct futex *f, *f2 = NULL;
-	int error = 0;
+	struct futex *f, *f2;
+	int error;
 
 	/*
 	 * Our implementation provides only privates futexes. Most of the apps
@@ -472,6 +472,9 @@ linux_sys_futex(struct thread *td, struc
 		args->op != LINUX_FUTEX_WAIT_REQUEUE_PI)
 		return (ENOSYS);
 
+	error = 0;
+	f = f2 = NULL;
+
 	switch (args->op) {
 	case LINUX_FUTEX_WAIT:
 		args->val3 = FUTEX_BITSET_MATCH_ANY;

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:48:19 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFEB1106566C;
	Wed,  2 Mar 2011 19:48:19 +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 BE8928FC08;
	Wed,  2 Mar 2011 19:48: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 p22JmJMc043850;
	Wed, 2 Mar 2011 19:48:19 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JmJod043847;
	Wed, 2 Mar 2011 19:48:19 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021948.p22JmJod043847@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:48:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219200 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:48:20 -0000

Author: dchagin
Date: Wed Mar  2 19:48:19 2011
New Revision: 219200
URL: http://svn.freebsd.org/changeset/base/219200

Log:
  MFC r218717:
  Put the macro declaration in the relevant include file for future use.

Modified:
  stable/8/sys/compat/linux/linux_misc.c
  stable/8/sys/compat/linux/linux_signal.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 19:46:45 2011	(r219199)
+++ stable/8/sys/compat/linux/linux_misc.c	Wed Mar  2 19:48:19 2011	(r219200)
@@ -92,9 +92,6 @@ __FBSDID("$FreeBSD$");
 
 int stclohz;				/* Statistics clock frequency */
 
-#define BSD_TO_LINUX_SIGNAL(sig)	\
-	(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
-
 static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = {
 	RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK,
 	RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE,

Modified: stable/8/sys/compat/linux/linux_signal.h
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.h	Wed Mar  2 19:46:45 2011	(r219199)
+++ stable/8/sys/compat/linux/linux_signal.h	Wed Mar  2 19:48:19 2011	(r219200)
@@ -40,4 +40,7 @@ void ksiginfo_to_lsiginfo(ksiginfo_t *ks
 
 #define LINUX_SIG_VALID(sig)	((sig) <= LINUX_NSIG && (sig) > 0)
 
+#define BSD_TO_LINUX_SIGNAL(sig)				\
+	(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
+
 #endif /* _LINUX_SIGNAL_H_ */

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 19:49:38 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5BFAD1065677;
	Wed,  2 Mar 2011 19:49:38 +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 316328FC19;
	Wed,  2 Mar 2011 19:49: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 p22JncPm044100;
	Wed, 2 Mar 2011 19:49:38 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22JncMd044098;
	Wed, 2 Mar 2011 19:49:38 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103021949.p22JncMd044098@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 19:49:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219201 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 19:49:38 -0000

Author: dchagin
Date: Wed Mar  2 19:49:37 2011
New Revision: 219201
URL: http://svn.freebsd.org/changeset/base/219201

Log:
  MFC r218718:
  Style(9) fix. Wrap long lines in linux_rt_sigtimedwait().

Modified:
  stable/8/sys/compat/linux/linux_signal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:48:19 2011	(r219200)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:49:37 2011	(r219201)
@@ -457,8 +457,9 @@ linux_rt_sigtimedwait(struct thread *td,
 			return (error);
 #ifdef DEBUG
 		if (ldebug(rt_sigtimedwait))
-			printf(LMSG("linux_rt_sigtimedwait: incoming timeout (%d/%d)\n"),
-				ltv.tv_sec, ltv.tv_usec);
+			printf(LMSG("linux_rt_sigtimedwait: "
+			    "incoming timeout (%d/%d)\n"),
+			    ltv.tv_sec, ltv.tv_usec);
 #endif
 		tv.tv_sec = (long)ltv.tv_sec;
 		tv.tv_usec = (suseconds_t)ltv.tv_usec;
@@ -477,8 +478,9 @@ linux_rt_sigtimedwait(struct thread *td,
 				timevalclear(&tv);
 #ifdef DEBUG
 			if (ldebug(rt_sigtimedwait))
-				printf(LMSG("linux_rt_sigtimedwait: converted timeout (%jd/%ld)\n"),
-					(intmax_t)tv.tv_sec, tv.tv_usec);
+				printf(LMSG("linux_rt_sigtimedwait: "
+				    "converted timeout (%jd/%ld)\n"),
+				    (intmax_t)tv.tv_sec, tv.tv_usec);
 #endif
 		}
 		TIMEVAL_TO_TIMESPEC(&tv, &ts);
@@ -487,7 +489,8 @@ linux_rt_sigtimedwait(struct thread *td,
 	error = kern_sigtimedwait(td, bset, &info, tsa);
 #ifdef DEBUG
 	if (ldebug(rt_sigtimedwait))
-		printf(LMSG("linux_rt_sigtimedwait: sigtimedwait returning (%d)\n"), error);
+		printf(LMSG("linux_rt_sigtimedwait: "
+		    "sigtimedwait returning (%d)\n"), error);
 #endif
 	if (error)
 		return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 20:01:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B6B95106566C;
	Wed,  2 Mar 2011 20:01:24 +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 8BB7A8FC1B;
	Wed,  2 Mar 2011 20:01: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 p22K1OVZ045514;
	Wed, 2 Mar 2011 20:01:24 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K1OHx045512;
	Wed, 2 Mar 2011 20:01:24 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022001.p22K1OHx045512@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:01:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219202 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:01:24 -0000

Author: dchagin
Date: Wed Mar  2 20:01:24 2011
New Revision: 219202
URL: http://svn.freebsd.org/changeset/base/219202

Log:
  MFC r218719 (by hand, depends on r209592):
  Make a linux_rt_sigtimedwait() system call is actually working.
  
  1) Translate the native signal number in the appropriate Linux signal.
  2) Remove bogus code, which can lead to a panic as it calls
     kern_sigtimedwait with the same ksiginfo.
  3) Return the corresponding signal number.

Modified:
  stable/8/sys/compat/linux/linux_signal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 19:49:37 2011	(r219201)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:01:24 2011	(r219202)
@@ -431,7 +431,7 @@ int
 linux_rt_sigtimedwait(struct thread *td,
 	struct linux_rt_sigtimedwait_args *args)
 {
-	int error;
+	int error, sig;
 	l_timeval ltv;
 	struct timeval tv;
 	struct timespec ts, *tsa;
@@ -495,19 +495,15 @@ linux_rt_sigtimedwait(struct thread *td,
 	if (error)
 		return (error);
 
+	sig = BSD_TO_LINUX_SIGNAL(info.ksi_signo);
+
 	if (args->ptr) {
 		memset(&linfo, 0, sizeof(linfo));
-		linfo.lsi_signo = info.ksi_signo;
+		ksiginfo_to_lsiginfo(&info, &linfo, sig);
 		error = copyout(&linfo, args->ptr, sizeof(linfo));
 	}
-
-	/* Repost if we got an error. */
-	if (error && info.ksi_signo) {
-		PROC_LOCK(td->td_proc);
-		tdsignal(td->td_proc, td, info.ksi_signo, &info);
-		PROC_UNLOCK(td->td_proc);
-	} else
-		td->td_retval[0] = info.ksi_signo; 
+	if (error == 0)
+		td->td_retval[0] = sig; 
 
 	return (error);
 }
@@ -590,7 +586,7 @@ linux_do_tkill(struct thread *td, l_int 
 	ksi.ksi_pid = proc->p_pid;
 	ksi.ksi_uid = proc->p_ucred->cr_ruid;
 
-	error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
+	error = pksignal(p, ksi.ksi_signo, &ksi);
 
 out:
 	PROC_UNLOCK(p);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 20:02:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED3AB106564A;
	Wed,  2 Mar 2011 20:02:52 +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 C1E258FC14;
	Wed,  2 Mar 2011 20:02:52 +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 p22K2q4a045637;
	Wed, 2 Mar 2011 20:02:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K2q24045633;
	Wed, 2 Mar 2011 20:02:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022002.p22K2q24045633@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:02:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219203 - in stable/8/sys: amd64/linux32 compat/linux
	i386/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:02:53 -0000

Author: dchagin
Date: Wed Mar  2 20:02:52 2011
New Revision: 219203
URL: http://svn.freebsd.org/changeset/base/219203

Log:
  MFC r218720:
  For realtime signals fill the sigval value.

Modified:
  stable/8/sys/amd64/linux32/linux.h
  stable/8/sys/compat/linux/linux_signal.c
  stable/8/sys/i386/linux/linux.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux.h
==============================================================================
--- stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/amd64/linux32/linux.h	Wed Mar  2 20:02:52 2011	(r219203)
@@ -306,6 +306,7 @@ struct l_new_utsname {
 #define	LINUX_SIGPOLL		LINUX_SIGIO
 #define	LINUX_SIGPWR		30
 #define	LINUX_SIGSYS		31
+#define	LINUX_SIGRTMIN		32
 
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/compat/linux/linux_signal.c	Wed Mar  2 20:02:52 2011	(r219203)
@@ -649,4 +649,8 @@ ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_
 		lsi->lsi_uid = ksi->ksi_uid;
 		break;
 	}
+	if (sig >= LINUX_SIGRTMIN) {
+		lsi->lsi_int = ksi->ksi_info.si_value.sival_int;
+		lsi->lsi_ptr = PTROUT(ksi->ksi_info.si_value.sival_ptr);
+	}
 }

Modified: stable/8/sys/i386/linux/linux.h
==============================================================================
--- stable/8/sys/i386/linux/linux.h	Wed Mar  2 20:01:24 2011	(r219202)
+++ stable/8/sys/i386/linux/linux.h	Wed Mar  2 20:02:52 2011	(r219203)
@@ -281,6 +281,7 @@ struct l_new_utsname {
 #define	LINUX_SIGPOLL		LINUX_SIGIO
 #define	LINUX_SIGPWR		30
 #define	LINUX_SIGSYS		31
+#define	LINUX_SIGRTMIN		32
 
 #define	LINUX_SIGTBLSZ		31
 #define	LINUX_NSIG_WORDS	2

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 20:04:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1736A106564A;
	Wed,  2 Mar 2011 20:04: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 049F88FC08;
	Wed,  2 Mar 2011 20:04: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 p22K4sLF045909;
	Wed, 2 Mar 2011 20:04:54 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K4sKI045902;
	Wed, 2 Mar 2011 20:04:54 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022004.p22K4sKI045902@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:04:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219204 - in stable/8/sys: amd64/amd64 amd64/include
	i386/i386 i386/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:04:55 -0000

Author: dchagin
Date: Wed Mar  2 20:04:54 2011
New Revision: 219204
URL: http://svn.freebsd.org/changeset/base/219204

Log:
  MFC r218744:
  To avoid excessive code duplication create wrapper for fill regs
  from stack frame. Change the trap() code to use newly created function
  instead of explicit regs assignment.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/trap.c
  stable/8/sys/amd64/include/reg.h
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/trap.c
  stable/8/sys/i386/include/reg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -1848,6 +1848,12 @@ fill_regs(struct thread *td, struct reg 
 	struct trapframe *tp;
 
 	tp = td->td_frame;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_r15 = tp->tf_r15;
 	regs->r_r14 = tp->tf_r14;
 	regs->r_r13 = tp->tf_r13;

Modified: stable/8/sys/amd64/amd64/trap.c
==============================================================================
--- stable/8/sys/amd64/amd64/trap.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/amd64/trap.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -253,38 +253,8 @@ trap(struct trapframe *frame)
 	if (type == T_DTRACE_PROBE || type == T_DTRACE_RET ||
 	    type == T_BPTFLT) {
 		struct reg regs;
-
-		regs.r_r15 = frame->tf_r15;
-		regs.r_r14 = frame->tf_r14;
-		regs.r_r13 = frame->tf_r13;
-		regs.r_r12 = frame->tf_r12;
-		regs.r_r11 = frame->tf_r11;
-		regs.r_r10 = frame->tf_r10;
-		regs.r_r9  = frame->tf_r9;
-		regs.r_r8  = frame->tf_r8;
-		regs.r_rdi = frame->tf_rdi;
-		regs.r_rsi = frame->tf_rsi;
-		regs.r_rbp = frame->tf_rbp;
-		regs.r_rbx = frame->tf_rbx;
-		regs.r_rdx = frame->tf_rdx;
-		regs.r_rcx = frame->tf_rcx;
-		regs.r_rax = frame->tf_rax;
-		regs.r_rip = frame->tf_rip;
-		regs.r_cs = frame->tf_cs;
-		regs.r_rflags = frame->tf_rflags;
-		regs.r_rsp = frame->tf_rsp;
-		regs.r_ss = frame->tf_ss;
-		if (frame->tf_flags & TF_HASSEGS) {
-			regs.r_ds = frame->tf_ds;
-			regs.r_es = frame->tf_es;
-			regs.r_fs = frame->tf_fs;
-			regs.r_gs = frame->tf_gs;
-		} else {
-			regs.r_ds = 0;
-			regs.r_es = 0;
-			regs.r_fs = 0;
-			regs.r_gs = 0;
-		}
+		
+		fill_frame_regs(frame, ®s);
 		if (type == T_DTRACE_PROBE &&
 		    dtrace_fasttrap_probe_ptr != NULL &&
 		    dtrace_fasttrap_probe_ptr(®s) == 0)

Modified: stable/8/sys/amd64/include/reg.h
==============================================================================
--- stable/8/sys/amd64/include/reg.h	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/amd64/include/reg.h	Wed Mar  2 20:04:54 2011	(r219204)
@@ -130,6 +130,7 @@ struct dbreg {
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
 int	fill_regs(struct thread *, struct reg *);
+int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);
 int	fill_fpregs(struct thread *, struct fpreg *);
 int	set_fpregs(struct thread *, struct fpreg *);

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/i386/machdep.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -3113,6 +3113,13 @@ fill_regs(struct thread *td, struct reg 
 
 	tp = td->td_frame;
 	pcb = td->td_pcb;
+	regs->r_gs = pcb->pcb_gs;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_fs = tp->tf_fs;
 	regs->r_es = tp->tf_es;
 	regs->r_ds = tp->tf_ds;
@@ -3128,7 +3135,6 @@ fill_regs(struct thread *td, struct reg 
 	regs->r_eflags = tp->tf_eflags;
 	regs->r_esp = tp->tf_esp;
 	regs->r_ss = tp->tf_ss;
-	regs->r_gs = pcb->pcb_gs;
 	return (0);
 }
 

Modified: stable/8/sys/i386/i386/trap.c
==============================================================================
--- stable/8/sys/i386/i386/trap.c	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/i386/trap.c	Wed Mar  2 20:04:54 2011	(r219204)
@@ -275,21 +275,7 @@ trap(struct trapframe *frame)
 	    type == T_BPTFLT) {
 		struct reg regs;
 
-		regs.r_fs = frame->tf_fs;
-		regs.r_es = frame->tf_es;
-		regs.r_ds = frame->tf_ds;
-		regs.r_edi = frame->tf_edi;
-		regs.r_esi = frame->tf_esi;
-		regs.r_ebp = frame->tf_ebp;
-		regs.r_ebx = frame->tf_ebx;
-		regs.r_edx = frame->tf_edx;
-		regs.r_ecx = frame->tf_ecx;
-		regs.r_eax = frame->tf_eax;
-		regs.r_eip = frame->tf_eip;
-		regs.r_cs = frame->tf_cs;
-		regs.r_eflags = frame->tf_eflags;
-		regs.r_esp = frame->tf_esp;
-		regs.r_ss = frame->tf_ss;
+		fill_frame_regs(frame, ®s);
 		if (type == T_DTRACE_PROBE &&
 		    dtrace_fasttrap_probe_ptr != NULL &&
 		    dtrace_fasttrap_probe_ptr(®s) == 0)

Modified: stable/8/sys/i386/include/reg.h
==============================================================================
--- stable/8/sys/i386/include/reg.h	Wed Mar  2 20:02:52 2011	(r219203)
+++ stable/8/sys/i386/include/reg.h	Wed Mar  2 20:04:54 2011	(r219204)
@@ -161,6 +161,7 @@ struct dbreg {
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
 int	fill_regs(struct thread *, struct reg *);
+int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);
 int	fill_fpregs(struct thread *, struct fpreg *);
 int	set_fpregs(struct thread *, struct fpreg *);

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 20:08:52 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5C061065673;
	Wed,  2 Mar 2011 20:08:52 +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 A47438FC15;
	Wed,  2 Mar 2011 20:08:52 +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 p22K8q0V046322;
	Wed, 2 Mar 2011 20:08:52 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22K8qZv046320;
	Wed, 2 Mar 2011 20:08:52 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022008.p22K8qZv046320@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 20:08:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219205 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 20:08:52 -0000

Author: dchagin
Date: Wed Mar  2 20:08:52 2011
New Revision: 219205
URL: http://svn.freebsd.org/changeset/base/219205

Log:
  MFC r218879:
  Do not clobber %rdx.
  Before calling vfork() syscall the linux user-space stores the current PID
  in the %rdx and restore it when the parent process leaves the kernel.

Modified:
  stable/8/sys/compat/linux/linux_fork.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/compat/linux/linux_fork.c
==============================================================================
--- stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 20:04:54 2011	(r219204)
+++ stable/8/sys/compat/linux/linux_fork.c	Wed Mar  2 20:08:52 2011	(r219205)
@@ -104,7 +104,6 @@ linux_vfork(struct thread *td, struct li
 		return (error);
 
    	td->td_retval[0] = p2->p_pid;
-	td->td_retval[1] = 0;
 
 	error = linux_proc_init(td, td->td_retval[0], 0);
 	if (error)

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 21:39:09 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 21:51:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58AF41065678;
	Wed,  2 Mar 2011 21:51:00 +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 370258FC13;
	Wed,  2 Mar 2011 21:51: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 p22Lp06F056450;
	Wed, 2 Mar 2011 21:51:00 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Lp0qJ056448;
	Wed, 2 Mar 2011 21:51:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103022151.p22Lp0qJ056448@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 21:51:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219207 - stable/8/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:51:00 -0000

Author: jhb
Date: Wed Mar  2 21:50:59 2011
New Revision: 219207
URL: http://svn.freebsd.org/changeset/base/219207

Log:
  MFC 217239:
  Add a nested include of  to make the sysctl(9) manpage
  accurate.   is one of the very few headers similar to
   for which nested includes is allowed.

Modified:
  stable/8/sys/sys/sysctl.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/sysctl.h
==============================================================================
--- stable/8/sys/sys/sysctl.h	Wed Mar  2 21:39:08 2011	(r219206)
+++ stable/8/sys/sys/sysctl.h	Wed Mar  2 21:50:59 2011	(r219207)
@@ -114,6 +114,8 @@ struct ctlname {
 #define CTL_AUTO_START	0x100
 
 #ifdef _KERNEL
+#include 
+
 #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
 	struct sysctl_req *req
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 21:51:22 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C538F1065783;
	Wed,  2 Mar 2011 21:51:22 +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 B3E178FC12;
	Wed,  2 Mar 2011 21:51: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 p22LpM0o056512;
	Wed, 2 Mar 2011 21:51:22 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22LpMGt056510;
	Wed, 2 Mar 2011 21:51:22 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103022151.p22LpMGt056510@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 2 Mar 2011 21:51:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219208 - stable/7/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 21:51:22 -0000

Author: jhb
Date: Wed Mar  2 21:51:22 2011
New Revision: 219208
URL: http://svn.freebsd.org/changeset/base/219208

Log:
  MFC 217239:
  Add a nested include of  to make the sysctl(9) manpage
  accurate.   is one of the very few headers similar to
   for which nested includes is allowed.

Modified:
  stable/7/sys/sys/sysctl.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sys/sysctl.h
==============================================================================
--- stable/7/sys/sys/sysctl.h	Wed Mar  2 21:50:59 2011	(r219207)
+++ stable/7/sys/sys/sysctl.h	Wed Mar  2 21:51:22 2011	(r219208)
@@ -113,6 +113,8 @@ struct ctlname {
 #define CTL_AUTO_START	0x100
 
 #ifdef _KERNEL
+#include 
+
 #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \
 	struct sysctl_req *req
 

From owner-svn-src-all@FreeBSD.ORG  Wed Mar  2 21:59:43 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 21:59:54 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Wed Mar  2 22:44:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82B581065677;
	Wed,  2 Mar 2011 22:44:04 +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 706FF8FC19;
	Wed,  2 Mar 2011 22:44: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 p22Mi4s1062051;
	Wed, 2 Mar 2011 22:44:04 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p22Mi4pt062049;
	Wed, 2 Mar 2011 22:44:04 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103022244.p22Mi4pt062049@svn.freebsd.org>
From: Dmitry Chagin 
Date: Wed, 2 Mar 2011 22:44:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219211 - stable/8/sys/amd64/include
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 02 Mar 2011 22:44:04 -0000

Author: dchagin
Date: Wed Mar  2 22:44:04 2011
New Revision: 219211
URL: http://svn.freebsd.org/changeset/base/219211

Log:
  Direct commit: fix cryptodev module build when COMPAT_FREEBSD32 option
  is enabled. To avoid header pollution put trapframe declaration here.
  
  Noticed by:	kib
  Pointyhat to:	me

Modified:
  stable/8/sys/amd64/include/reg.h

Modified: stable/8/sys/amd64/include/reg.h
==============================================================================
--- stable/8/sys/amd64/include/reg.h	Wed Mar  2 21:59:53 2011	(r219210)
+++ stable/8/sys/amd64/include/reg.h	Wed Mar  2 22:44:04 2011	(r219211)
@@ -129,6 +129,8 @@ struct dbreg {
 /*
  * XXX these interfaces are MI, so they should be declared in a MI place.
  */
+struct trapframe;
+
 int	fill_regs(struct thread *, struct reg *);
 int	fill_frame_regs(struct trapframe *, struct reg *);
 int	set_regs(struct thread *, struct reg *);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 00:24:56 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D8B4106566C;
	Thu,  3 Mar 2011 00:24:56 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 76EA18FC0A;
	Thu,  3 Mar 2011 00:24: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 p230OuUK072482;
	Thu, 3 Mar 2011 00:24:56 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p230Ouur072454;
	Thu, 3 Mar 2011 00:24:56 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103030024.p230Ouur072454@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 3 Mar 2011 00:24:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219212 - in stable/8/sys: amd64/amd64 amd64/include
	arm/arm arm/include conf dev/mem i386/i386 i386/include
	ia64/ia64 ia64/include mips/include mips/mips modules/mem
	pc98/pc98 powerpc/...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 00:24:56 -0000

Author: jkim
Date: Thu Mar  3 00:24:55 2011
New Revision: 219212
URL: http://svn.freebsd.org/changeset/base/219212

Log:
  MFC:	r217515, r217519, r217539
  
  Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().
  Compile sys/dev/mem/memutil.c for all supported platforms and remove now
  unnecessary dev_mem_md_init().  Consistently define mem_range_softc from
  mem.c for all platforms.  Add missing #include guards for machine/memdev.h
  and sys/memrange.h.  Clean up some nearby style(9) nits.

Modified:
  stable/8/sys/amd64/amd64/machdep.c
  stable/8/sys/amd64/amd64/mem.c
  stable/8/sys/amd64/include/memdev.h
  stable/8/sys/arm/arm/mem.c
  stable/8/sys/arm/include/memdev.h
  stable/8/sys/conf/files
  stable/8/sys/conf/files.amd64
  stable/8/sys/conf/files.i386
  stable/8/sys/conf/files.pc98
  stable/8/sys/dev/mem/memdev.c
  stable/8/sys/dev/mem/memutil.c
  stable/8/sys/i386/i386/machdep.c
  stable/8/sys/i386/i386/mem.c
  stable/8/sys/i386/include/memdev.h
  stable/8/sys/ia64/ia64/mem.c
  stable/8/sys/ia64/include/memdev.h
  stable/8/sys/mips/include/memdev.h
  stable/8/sys/mips/mips/mem.c
  stable/8/sys/modules/mem/Makefile
  stable/8/sys/pc98/pc98/machdep.c
  stable/8/sys/powerpc/include/memdev.h
  stable/8/sys/powerpc/powerpc/mem.c
  stable/8/sys/sparc64/include/memdev.h
  stable/8/sys/sparc64/sparc64/mem.c
  stable/8/sys/sun4v/include/memdev.h
  stable/8/sys/sys/memrange.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/8/sys/amd64/amd64/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/amd64/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -193,8 +192,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 struct mtx dt_lock;	/* lock for GDT and LDT */
 
 static void

Modified: stable/8/sys/amd64/amd64/mem.c
==============================================================================
--- stable/8/sys/amd64/amd64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/amd64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -214,10 +216,3 @@ memioctl(struct cdev *dev __unused, u_lo
 	}
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-	if (mem_range_softc.mr_op != NULL)
-		mem_range_softc.mr_op->init(&mem_range_softc);
-}

Modified: stable/8/sys/amd64/include/memdev.h
==============================================================================
--- stable/8/sys/amd64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/amd64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_ioctl_t	memioctl;
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/arm/arm/mem.c
==============================================================================
--- stable/8/sys/arm/arm/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/arm/arm/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -163,8 +165,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 	/* else panic! */
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/arm/include/memdev.h
==============================================================================
--- stable/8/sys/arm/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/arm/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_mmap_t	memmmap;
 #define		memioctl	(d_ioctl_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files	Thu Mar  3 00:24:55 2011	(r219212)
@@ -1248,6 +1248,7 @@ dev/mcd/mcd.c			optional mcd isa nowerro
 dev/mcd/mcd_isa.c		optional mcd isa nowerror
 dev/md/md.c			optional md
 dev/mem/memdev.c		optional mem
+dev/mem/memutil.c		optional mem
 dev/mfi/mfi.c			optional mfi
 dev/mfi/mfi_debug.c		optional mfi
 dev/mfi/mfi_pci.c		optional mfi pci

Modified: stable/8/sys/conf/files.amd64
==============================================================================
--- stable/8/sys/conf/files.amd64	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.amd64	Thu Mar  3 00:24:55 2011	(r219212)
@@ -212,7 +212,6 @@ dev/hwpmc/hwpmc_x86.c		optional	hwpmc
 dev/kbd/kbd.c			optional	atkbd | sc | ukbd
 dev/lindev/full.c		optional	lindev
 dev/lindev/lindev.c		optional	lindev
-dev/mem/memutil.c		optional	mem
 dev/nfe/if_nfe.c		optional	nfe pci
 dev/nve/if_nve.c		optional	nve pci
 dev/nvram/nvram.c		optional	nvram isa

Modified: stable/8/sys/conf/files.i386
==============================================================================
--- stable/8/sys/conf/files.i386	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.i386	Thu Mar  3 00:24:55 2011	(r219212)
@@ -210,7 +210,6 @@ dev/kbd/kbd.c			optional atkbd | sc | uk
 dev/le/if_le_isa.c		optional le isa
 dev/lindev/full.c		optional lindev
 dev/lindev/lindev.c		optional lindev
-dev/mem/memutil.c		optional mem
 dev/mse/mse.c			optional mse
 dev/mse/mse_isa.c		optional mse isa
 dev/nfe/if_nfe.c		optional nfe pci

Modified: stable/8/sys/conf/files.pc98
==============================================================================
--- stable/8/sys/conf/files.pc98	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/conf/files.pc98	Thu Mar  3 00:24:55 2011	(r219212)
@@ -111,7 +111,6 @@ dev/kbd/kbd.c			optional pckbd | sc | uk
 dev/le/if_le_cbus.c		optional le isa
 dev/lindev/full.c		optional lindev
 dev/lindev/lindev.c		optional lindev
-dev/mem/memutil.c		optional mem
 dev/mse/mse.c			optional mse
 dev/mse/mse_cbus.c		optional mse isa
 dev/sbni/if_sbni.c		optional sbni

Modified: stable/8/sys/dev/mem/memdev.c
==============================================================================
--- stable/8/sys/dev/mem/memdev.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/dev/mem/memdev.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -80,7 +81,7 @@ mem_modevent(module_t mod __unused, int 
 	case MOD_LOAD:
 		if (bootverbose)
 			printf("mem: \n");
-		dev_mem_md_init(); /* Machine dependant bit */
+		mem_range_init();
 		memdev = make_dev(&mem_cdevsw, CDEV_MINOR_MEM,
 			UID_ROOT, GID_KMEM, 0640, "mem");
 		kmemdev = make_dev(&mem_cdevsw, CDEV_MINOR_KMEM,
@@ -88,6 +89,7 @@ mem_modevent(module_t mod __unused, int 
 		break;
 
 	case MOD_UNLOAD:
+		mem_range_destroy();
 		destroy_dev(memdev);
 		destroy_dev(kmemdev);
 		break;

Modified: stable/8/sys/dev/mem/memutil.c
==============================================================================
--- stable/8/sys/dev/mem/memutil.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/dev/mem/memutil.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -28,35 +28,64 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
+static struct rwlock	mr_lock;
+
 /*
  * Implementation-neutral, kernel-callable functions for manipulating
  * memory range attributes.
  */
+void
+mem_range_init(void)
+{
+
+	if (mem_range_softc.mr_op == NULL)
+		return;
+	rw_init(&mr_lock, "memrange");
+	mem_range_softc.mr_op->init(&mem_range_softc);
+}
+
+void
+mem_range_destroy(void)
+{
+
+	if (mem_range_softc.mr_op == NULL)
+		return;
+	rw_destroy(&mr_lock);
+}
+
 int
 mem_range_attr_get(struct mem_range_desc *mrd, int *arg)
 {
-	/* can we handle this? */
+	int nd;
+
 	if (mem_range_softc.mr_op == NULL)
 		return (EOPNOTSUPP);
-
-	if (*arg == 0)
+	nd = *arg;
+	rw_rlock(&mr_lock);
+	if (nd == 0)
 		*arg = mem_range_softc.mr_ndesc;
 	else
-		bcopy(mem_range_softc.mr_desc, mrd,
-			(*arg) * sizeof(struct mem_range_desc));
+		bcopy(mem_range_softc.mr_desc, mrd, nd * sizeof(*mrd));
+	rw_runlock(&mr_lock);
 	return (0);
 }
 
 int
 mem_range_attr_set(struct mem_range_desc *mrd, int *arg)
 {
-	/* can we handle this? */
+	int ret;
+
 	if (mem_range_softc.mr_op == NULL)
 		return (EOPNOTSUPP);
-
-	return (mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg));
+	rw_wlock(&mr_lock);
+	ret = mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg);
+	rw_wunlock(&mr_lock);
+	return (ret);
 }

Modified: stable/8/sys/i386/i386/machdep.c
==============================================================================
--- stable/8/sys/i386/i386/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/i386/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -239,8 +238,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 static void
 cpu_startup(dummy)
 	void *dummy;

Modified: stable/8/sys/i386/i386/mem.c
==============================================================================
--- stable/8/sys/i386/i386/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/i386/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -72,10 +72,11 @@ __FBSDID("$FreeBSD$");
  */
 MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
 
+struct mem_range_softc mem_range_softc;
+
 static struct sx memsxlock;
 SX_SYSINIT(memsxlockinit, &memsxlock, "/dev/mem lock");
 
-
 /* ARGSUSED */
 int
 memrw(struct cdev *dev, struct uio *uio, int flags)
@@ -233,10 +234,3 @@ memioctl(struct cdev *dev __unused, u_lo
 	}
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-	if (mem_range_softc.mr_op != NULL)
-		mem_range_softc.mr_op->init(&mem_range_softc);
-}

Modified: stable/8/sys/i386/include/memdev.h
==============================================================================
--- stable/8/sys/i386/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/i386/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 d_ioctl_t	memioctl;
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/ia64/ia64/mem.c
==============================================================================
--- stable/8/sys/ia64/ia64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/ia64/ia64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -167,8 +167,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 	*paddr = IA64_PHYS_TO_RR7(offset);
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/ia64/include/memdev.h
==============================================================================
--- stable/8/sys/ia64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/ia64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/mips/include/memdev.h
==============================================================================
--- stable/8/sys/mips/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/mips/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -27,6 +27,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -35,4 +38,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/mips/mips/mem.c
==============================================================================
--- stable/8/sys/mips/mips/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/mips/mips/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -164,8 +164,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/modules/mem/Makefile
==============================================================================
--- stable/8/sys/modules/mem/Makefile	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/modules/mem/Makefile	Thu Mar  3 00:24:55 2011	(r219212)
@@ -5,10 +5,7 @@
 .PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
 
 KMOD=	mem
-SRCS=	memdev.c mem.c
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
-SRCS+=	memutil.c
-.endif
+SRCS=	memdev.c mem.c memutil.c
 .if ${MACHINE_ARCH} == "i386"
 SRCS+=	i686_mem.c k6_mem.c
 .endif

Modified: stable/8/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/8/sys/pc98/pc98/machdep.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -207,8 +206,6 @@ struct pcpu __pcpu[MAXCPU];
 
 struct mtx icu_lock;
 
-struct mem_range_softc mem_range_softc;
-
 static void
 cpu_startup(dummy)
 	void *dummy;

Modified: stable/8/sys/powerpc/include/memdev.h
==============================================================================
--- stable/8/sys/powerpc/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/powerpc/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define	memioctl	(d_ioctl_t *)NULL
 d_mmap_t	memmmap;
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/powerpc/powerpc/mem.c
==============================================================================
--- stable/8/sys/powerpc/powerpc/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/powerpc/powerpc/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -181,8 +181,3 @@ memmmap(struct cdev *dev, vm_offset_t of
 
 	return (0);
 }
-
-void
-dev_mem_md_init(void)
-{
-}

Modified: stable/8/sys/sparc64/include/memdev.h
==============================================================================
--- stable/8/sys/sparc64/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sparc64/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 #define		memmmap		(d_mmap_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/sparc64/sparc64/mem.c
==============================================================================
--- stable/8/sys/sparc64/sparc64/mem.c	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sparc64/sparc64/mem.c	Thu Mar  3 00:24:55 2011	(r219212)
@@ -188,9 +188,3 @@ memrw(struct cdev *dev, struct uio *uio,
 		kmem_free_wakeup(kernel_map, ova, PAGE_SIZE * colors);
 	return (error);
 }
-
-void
-dev_mem_md_init(void)
-{
-
-}

Modified: stable/8/sys/sun4v/include/memdev.h
==============================================================================
--- stable/8/sys/sun4v/include/memdev.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sun4v/include/memdev.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -26,6 +26,9 @@
  * $FreeBSD$
  */
 
+#ifndef _MACHINE_MEMDEV_H_
+#define	_MACHINE_MEMDEV_H_
+
 #define	CDEV_MINOR_MEM	0
 #define	CDEV_MINOR_KMEM	1
 
@@ -34,4 +37,4 @@ d_read_t	memrw;
 #define		memioctl	(d_ioctl_t *)NULL
 #define		memmmap		(d_mmap_t *)NULL
 
-void		dev_mem_md_init(void);
+#endif /* _MACHINE_MEMDEV_H_ */

Modified: stable/8/sys/sys/memrange.h
==============================================================================
--- stable/8/sys/sys/memrange.h	Wed Mar  2 22:44:04 2011	(r219211)
+++ stable/8/sys/sys/memrange.h	Thu Mar  3 00:24:55 2011	(r219212)
@@ -4,6 +4,9 @@
  * $FreeBSD$
  */
 
+#ifndef _SYS_MEMRANGE_H_
+#define	_SYS_MEMRANGE_H_
+
 /* Memory range attributes */
 #define MDF_UNCACHEABLE		(1<<0)	/* region not cached */
 #define MDF_WRITECOMBINE	(1<<1)	/* region supports "write combine" action */
@@ -65,7 +68,12 @@ struct mem_range_softc 
 
 extern struct mem_range_softc mem_range_softc;
 
-extern int mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
-extern int mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
+extern void	mem_range_init(void);
+extern void	mem_range_destroy(void);
+
+extern int	mem_range_attr_get(struct mem_range_desc *mrd, int *arg);
+extern int	mem_range_attr_set(struct mem_range_desc *mrd, int *arg);
+
+#endif /* _KERNEL */
 
-#endif
+#endif /* _SYS_MEMRANGE_H_ */

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 00:43:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55731106564A;
	Thu,  3 Mar 2011 00:43:36 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 293FC8FC12;
	Thu,  3 Mar 2011 00:43: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 p230haDJ074950;
	Thu, 3 Mar 2011 00:43:36 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p230hakk074948;
	Thu, 3 Mar 2011 00:43:36 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103030043.p230hakk074948@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 3 Mar 2011 00:43:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219213 - stable/8/sys/dev/acpica
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 00:43:36 -0000

Author: jkim
Date: Thu Mar  3 00:43:35 2011
New Revision: 219213
URL: http://svn.freebsd.org/changeset/base/219213

Log:
  MFC:	r218685, r218687
  
  Copy just enough data for the resource type.

Modified:
  stable/8/sys/dev/acpica/acpi_resource.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_resource.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_resource.c	Thu Mar  3 00:24:55 2011	(r219212)
+++ stable/8/sys/dev/acpica/acpi_resource.c	Thu Mar  3 00:43:35 2011	(r219213)
@@ -60,32 +60,35 @@ static ACPI_STATUS
 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
 {
     struct lookup_irq_request *req;
+    size_t len;
     u_int irqnum, irq;
 
     switch (res->Type) {
     case ACPI_RESOURCE_TYPE_IRQ:
+	irqnum = res->Data.Irq.InterruptCount;
+	irq = res->Data.Irq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ);
+	break;
     case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
-	if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
-	    irqnum = res->Data.Irq.InterruptCount;
-	    irq = res->Data.Irq.Interrupts[0];
-	} else {
-	    irqnum = res->Data.ExtendedIrq.InterruptCount;
-	    irq = res->Data.ExtendedIrq.Interrupts[0];
-	}
-	if (irqnum != 1)
-	    break;
-	req = (struct lookup_irq_request *)context;
-	if (req->counter != req->rid) {
-	    req->counter++;
-	    break;
-	}
-	req->found = 1;
-	KASSERT(irq == rman_get_start(req->res),
-	    ("IRQ resources do not match"));
-	bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
-	return (AE_CTRL_TERMINATE);
+	irqnum = res->Data.ExtendedIrq.InterruptCount;
+	irq = res->Data.ExtendedIrq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ);
+	break;
+    default:
+	return (AE_OK);
+    }
+    if (irqnum != 1)
+	return (AE_OK);
+    req = (struct lookup_irq_request *)context;
+    if (req->counter != req->rid) {
+	req->counter++;
+	return (AE_OK);
     }
-    return (AE_OK);
+    req->found = 1;
+    KASSERT(irq == rman_get_start(req->res),
+	("IRQ resources do not match"));
+    bcopy(res, req->acpi_res, len);
+    return (AE_CTRL_TERMINATE);
 }
 
 ACPI_STATUS

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 03:02:06 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 05:56:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6BB0F106566C;
	Thu,  3 Mar 2011 05:56: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 58E028FC15;
	Thu,  3 Mar 2011 05:56: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 p235uTgZ003480;
	Thu, 3 Mar 2011 05:56:29 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p235uTa0003478;
	Thu, 3 Mar 2011 05:56:29 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <201103030556.p235uTa0003478@svn.freebsd.org>
From: Dmitry Chagin 
Date: Thu, 3 Mar 2011 05:56:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219215 - stable/8/sys/compat/linux
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 05:56:29 -0000

Author: dchagin
Date: Thu Mar  3 05:56:29 2011
New Revision: 219215
URL: http://svn.freebsd.org/changeset/base/219215

Log:
  Unbreak the build. pksignal added by r209592.
  
  Pointyhat to:	dchagin

Modified:
  stable/8/sys/compat/linux/linux_signal.c

Modified: stable/8/sys/compat/linux/linux_signal.c
==============================================================================
--- stable/8/sys/compat/linux/linux_signal.c	Thu Mar  3 03:02:06 2011	(r219214)
+++ stable/8/sys/compat/linux/linux_signal.c	Thu Mar  3 05:56:29 2011	(r219215)
@@ -586,7 +586,7 @@ linux_do_tkill(struct thread *td, l_int 
 	ksi.ksi_pid = proc->p_pid;
 	ksi.ksi_uid = proc->p_ucred->cr_ruid;
 
-	error = pksignal(p, ksi.ksi_signo, &ksi);
+	error = tdsignal(p, NULL, ksi.ksi_signo, &ksi);
 
 out:
 	PROC_UNLOCK(p);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 08:09:49 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 08:30:29 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 08:38:32 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 09:44:30 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EA914106564A;
	Thu,  3 Mar 2011 09:44:30 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D6B4B8FC1E;
	Thu,  3 Mar 2011 09:44: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 p239iUWF016712;
	Thu, 3 Mar 2011 09:44:30 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p239iUXe016705;
	Thu, 3 Mar 2011 09:44:30 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103030944.p239iUXe016705@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 09:44:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219219 - in stable/8/contrib/xz: . po src/common
	src/liblzma/api/lzma src/liblzma/common src/xz
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 09:44:31 -0000

Author: mm
Date: Thu Mar  3 09:44:30 2011
New Revision: 219219
URL: http://svn.freebsd.org/changeset/base/219219

Log:
  MFC r219001:
  Update xz to release 5.0.1

Modified:
  stable/8/contrib/xz/ChangeLog   (contents, props changed)
  stable/8/contrib/xz/FREEBSD-upgrade   (contents, props changed)
  stable/8/contrib/xz/THANKS   (contents, props changed)
  stable/8/contrib/xz/po/cs.po
  stable/8/contrib/xz/po/de.po
  stable/8/contrib/xz/po/it.po
  stable/8/contrib/xz/po/xz.pot
  stable/8/contrib/xz/src/common/sysdefs.h
  stable/8/contrib/xz/src/liblzma/api/lzma/lzma.h
  stable/8/contrib/xz/src/liblzma/api/lzma/version.h
  stable/8/contrib/xz/src/liblzma/common/common.h
  stable/8/contrib/xz/src/xz/file_io.c
  stable/8/contrib/xz/src/xz/suffix.c
  stable/8/contrib/xz/src/xz/util.h
Directory Properties:
  stable/8/contrib/xz/   (props changed)
  stable/8/contrib/xz/AUTHORS   (props changed)
  stable/8/contrib/xz/COPYING   (props changed)
  stable/8/contrib/xz/FREEBSD-Xlist   (props changed)
  stable/8/contrib/xz/README   (props changed)
  stable/8/contrib/xz/TODO   (props changed)
  stable/8/contrib/xz/po/   (props changed)
  stable/8/contrib/xz/src/   (props changed)

Modified: stable/8/contrib/xz/ChangeLog
==============================================================================
--- stable/8/contrib/xz/ChangeLog	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/ChangeLog	Thu Mar  3 09:44:30 2011	(r219219)
@@ -1,3 +1,125 @@
+commit 7232fcf96bf4bd5f9cd4fc6c93ca2912c665e004
+Author: Lasse Collin 
+Date:   Fri Jan 28 20:26:38 2011 +0200
+
+    Bump package version and liblzma soname to 5.0.1.
+
+commit 5fbce0b8d96dc96775aa0215e3581addc830e23d
+Author: Lasse Collin 
+Date:   Fri Jan 28 20:16:57 2011 +0200
+
+    Update NEWS for 5.0.1.
+
+commit 03ebd1bbb314f9f204940219a835c883bf442475
+Author: Lasse Collin 
+Date:   Wed Jan 26 12:19:08 2011 +0200
+
+    xz: Fix --force on setuid/setgid/sticky and multi-hardlink files.
+    
+    xz didn't compress setuid/setgid/sticky files and files
+    with multiple hard links even with --force. This bug was
+    introduced in 23ac2c44c3ac76994825adb7f9a8f719f78b5ee4.
+    
+    Thanks to Charles Wilson.
+
+commit 7bd0a5e7ccc354f7c2e95c8bc27569c820f6a136
+Author: Lasse Collin 
+Date:   Tue Jan 18 21:25:24 2011 +0200
+
+    Updated THANKS.
+
+commit f71c4e16e913f660977526f0ef8d2acdf458d7c9
+Author: Lasse Collin 
+Date:   Tue Jan 18 21:23:50 2011 +0200
+
+    Add alloc_size and malloc attributes to a few functions.
+    
+    Thanks to Cristian Rodríguez for the original patch.
+
+commit 316cbe24465143edde8f6ffb7532834b7b2ea93f
+Author: Lasse Collin 
+Date:   Mon Dec 13 16:36:33 2010 +0200
+
+    Scripts: Fix gzip and bzip2 support in xzdiff.
+
+commit 9311774c493c19deab51ded919dcd2e9c4aa2829
+Author: Lasse Collin 
+Date:   Sun Dec 12 21:23:55 2010 +0200
+
+    Build: Enable ASM on DJGPP by default.
+
+commit 4a42aaee282fc73b482581684d65110506d5efdd
+Author: Lasse Collin 
+Date:   Sun Dec 12 16:09:42 2010 +0200
+
+    Updated THANKS.
+
+commit ce56f63c41ee210e6308090eb6d49221fdf67d6c
+Author: Lasse Collin 
+Date:   Sun Dec 12 16:07:11 2010 +0200
+
+    Add missing PRIx32 and PRIx64 compatibility definitions.
+    
+    This fixes portability to systems that lack C99 inttypes.h.
+    
+    Thanks to Juan Manuel Guerrero.
+
+commit e6baedddcf54e7da049ebc49183565b99facd4c7
+Author: Lasse Collin 
+Date:   Sun Dec 12 14:50:04 2010 +0200
+
+    DOS-like: Treat \ and : as directory separators in addition to /.
+    
+    Juan Manuel Guerrero had fixed this in his XZ Utils port
+    to DOS/DJGPP. The bug affects also Windows and OS/2.
+
+commit b7afd3e22a8fac115b75c738d40d3eb1de7e286f
+Author: Lasse Collin 
+Date:   Tue Dec 7 18:52:04 2010 +0200
+
+    Translations: Fix Czech translation of "sparse file".
+    
+    Thanks to Petr Hubený and Marek Černocký.
+
+commit 3e564704bc6f463cb2db11e3f3f0dbd71d85992e
+Author: Lasse Collin 
+Date:   Mon Nov 15 14:28:26 2010 +0200
+
+    liblzma: Document the return value of lzma_lzma_preset().
+
+commit 2964d8d691ed92abdcf214888d79ad6d79774735
+Author: Jonathan Nieder 
+Date:   Fri Nov 12 15:22:13 2010 -0600
+
+    Simplify paths in generated API docs
+    
+    Currently the file list generated by Doxygen has src/ at the
+    beginning of each path.  Paths like common/sysdefs.h and
+    liblzma/api/lzma.h are easier to read without such a prefix.
+    
+    Builds from a separate build directory with
+    
+    	mkdir build
+    	cd build
+    	../configure
+    	doxygen Doxyfile
+    
+    include an even longer prefix /home/someone/src/xz/src; this
+    patch has the nice side-effect of eliminating that prefix, too.
+    
+    Fixes: http://bugs.debian.org/572273
+
+commit 37c25658efd25b034266daf87cd381d20d1df776
+Author: Lasse Collin 
+Date:   Tue Oct 26 15:48:48 2010 +0300
+
+    Build: Copy the example programs to $docdir/examples.
+    
+    The example programs by Daniel Mealha Cabrita were included
+    in the git repository, but I had forgot to add them to
+    Makefile.am. Thus, they didn't get included in the source
+    package at all by "make dist".
+
 commit e45929260cd902036efd40c5610a8d0a50d5712b
 Author: Lasse Collin 
 Date:   Sat Oct 23 17:25:52 2010 +0300

Modified: stable/8/contrib/xz/FREEBSD-upgrade
==============================================================================
--- stable/8/contrib/xz/FREEBSD-upgrade	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/FREEBSD-upgrade	Thu Mar  3 09:44:30 2011	(r219219)
@@ -4,7 +4,7 @@ xz
 
 The source code is pulled with git:
 
-	git clone git://ctrl.tukaani.org/xz.git xz
+	git clone http://git.tukaani.org/xz.git xz
 
 ChangeLog is generated with:
 	

Modified: stable/8/contrib/xz/THANKS
==============================================================================
--- stable/8/contrib/xz/THANKS	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/THANKS	Thu Mar  3 09:44:30 2011	(r219219)
@@ -22,6 +22,7 @@ has been important. :-) In alphabetical 
   - Gilles Espinasse
   - Denis Excoffier
   - Mike Frysinger
+  - Juan Manuel Guerrero
   - Joachim Henke
   - Peter Ivanov
   - Jouk Jansen
@@ -46,6 +47,7 @@ has been important. :-) In alphabetical 
   - Mikko Pouru
   - Robert Readman
   - Bernhard Reutner-Fischer
+  - Cristian Rodríguez
   - Christian von Roques
   - Jukka Salmi
   - Alexandre Sauvé

Modified: stable/8/contrib/xz/po/cs.po
==============================================================================
--- stable/8/contrib/xz/po/cs.po	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/po/cs.po	Thu Mar  3 09:44:30 2011	(r219219)
@@ -6,8 +6,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xz-utils\n"
 "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
-"POT-Creation-Date: 2010-10-23 17:48+0300\n"
-"PO-Revision-Date: 2010-09-17 18:54+0200\n"
+"POT-Creation-Date: 2010-12-03 11:25+0100\n"
+"PO-Revision-Date: 2010-12-03 11:32+0100\n"
 "Last-Translator: Marek Černocký \n"
 "Language-Team: Czech \n"
 "Language: cs\n"
@@ -30,7 +30,8 @@ msgstr "%s: Neznámý typ kontroly integ
 
 #: src/xz/args.c:382
 msgid "Only one file can be specified with `--files' or `--files0'."
-msgstr "Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
+msgstr ""
+"Spolu s pÅ™epínaÄi „--files“ nebo „--files0“ může být zadán pouze jeden soubor"
 
 #: src/xz/args.c:445
 #, c-format
@@ -51,7 +52,8 @@ msgstr "Použití přednastavení v rež
 
 #: src/xz/coder.c:131
 msgid "The exact options of the presets may vary between software versions."
-msgstr "Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
+msgstr ""
+"Přesné volby u přednastavení se mohou lišit mezi různými verzemi softwaru."
 
 #: src/xz/coder.c:157
 msgid "The .lzma format supports only the LZMA1 filter"
@@ -72,8 +74,12 @@ msgstr "Dekomprimace bude vyžadovat %s 
 
 #: src/xz/coder.c:247
 #, c-format
-msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
-msgstr "PÅ™izpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB"
+msgid ""
+"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
+"memory usage limit of %s MiB"
+msgstr ""
+"Přizpůsobit velikost slovníku LZMA%c z %s MiB na %s MiB, tak aby nebylo "
+"pÅ™ekroÄeno omezení použitelné pamÄ›ti %s MiB"
 
 #. TRANSLATORS: When compression or decompression finishes,
 #. and xz is going to remove the source file, xz first checks
@@ -153,7 +159,8 @@ msgstr "%s: Selhalo zavření souboru: %
 #: src/xz/file_io.c:762 src/xz/file_io.c:946
 #, c-format
 msgid "%s: Seeking failed when trying to create a sparse file: %s"
-msgstr "%s: Selhalo nastavení pozice při pokusu o vytvoření záložního souboru: %s"
+msgstr ""
+"%s: Selhalo nastavení pozice při pokusu o vytvoření souboru řídké matice: %s"
 
 #: src/xz/file_io.c:821
 #, c-format
@@ -312,10 +319,12 @@ msgstr "  Zarovnání proudu:        %s\
 #: src/xz/list.c:693
 msgid ""
 "  Streams:\n"
-"    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding"
+"    Stream    Blocks      CompOffset    UncompOffset        CompSize      "
+"UncompSize  Ratio  Check      Padding"
 msgstr ""
 "  Proudy:\n"
-"     Proud     Bloky     KomprPozice   NekomprPozice   KomprVelikost NekomprVelikost  Poměr  Kontrola   Zarovnání"
+"     Proud     Bloky     KomprPozice   NekomprPozice   KomprVelikost "
+"NekomprVelikost  Poměr  Kontrola   Zarovnání"
 
 #. TRANSLATORS: The second line is column headings. All
 #. except Check are right aligned; Check is left aligned.
@@ -323,10 +332,12 @@ msgstr ""
 #, c-format
 msgid ""
 "  Blocks:\n"
-"    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check"
+"    Stream     Block      CompOffset    UncompOffset       TotalSize      "
+"UncompSize  Ratio  Check"
 msgstr ""
 "  Bloky:\n"
-"     Proud      Blok     KomprPozice   NekomprPozice    CelkVelikost NekomprVelikost  Poměr  Kontrola"
+"     Proud      Blok     KomprPozice   NekomprPozice    CelkVelikost "
+"NekomprVelikost  Poměr  Kontrola"
 
 #. TRANSLATORS: These are additional column headings
 #. for the most verbose listing mode. CheckVal
@@ -397,16 +408,24 @@ msgstr "%s: NeoÄekávaný konec vstupu 
 
 #: src/xz/main.c:120
 #, c-format
-msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
-msgstr "%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou použít „--files0“ místo „--files“?"
+msgid ""
+"%s: Null character found when reading filenames; maybe you meant to use `--"
+"files0' instead of `--files'?"
+msgstr ""
+"%s: Byl nalezen nulový znak pÅ™i Ätení názvů souborů; nechtÄ›li jste náhodou "
+"použít „--files0“ místo „--files“?"
 
 #: src/xz/main.c:174
 msgid "Compression and decompression with --robot are not supported yet."
 msgstr "Komprimace a dekomprimace s pÅ™epínaÄem --robot není zatím podporovaná."
 
 #: src/xz/main.c:231
-msgid "Cannot read data from standard input when reading filenames from standard input"
-msgstr "Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu naÄítají názvy souborů"
+msgid ""
+"Cannot read data from standard input when reading filenames from standard "
+"input"
+msgstr ""
+"Ze standardního vstupu nelze Äíst data, když se ze standardního vstupu "
+"naÄítají názvy souborů"
 
 #: src/xz/message.c:792 src/xz/message.c:842
 msgid "Internal error (bug)"
@@ -422,7 +441,8 @@ msgstr "Žádná kontrola integrity; int
 
 #: src/xz/message.c:811
 msgid "Unsupported type of integrity check; not verifying file integrity"
-msgstr "Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
+msgstr ""
+"Nepodporovaný typ kontroly integrity; integrita souboru se nebude ověřovat"
 
 #: src/xz/message.c:818
 msgid "Memory usage limit reached"
@@ -471,8 +491,11 @@ msgstr ""
 "\n"
 
 #: src/xz/message.c:1091
-msgid "Mandatory arguments to long options are mandatory for short options too.\n"
-msgstr "Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké pÅ™epínaÄe.\n"
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
+msgstr ""
+"Povinné argumenty pro dlouhé pÅ™epínaÄe jsou povinné rovněž pro krátké "
+"pÅ™epínaÄe.\n"
 
 #: src/xz/message.c:1095
 msgid " Operation mode:\n"
@@ -505,8 +528,10 @@ msgid ""
 "  -c, --stdout        write to standard output and don't delete input files"
 msgstr ""
 " -k, --keep            zachovat (nemazat) vstupní soubory\n"
-" -f, --force           vynutit přepis výstupního souboru a de/komprimovat odkazy\n"
-" -c, --stdout          zapisovat na standardní výstup a nemazat vstupní soubory"
+" -f, --force           vynutit přepis výstupního souboru a de/komprimovat "
+"odkazy\n"
+" -c, --stdout          zapisovat na standardní výstup a nemazat vstupní "
+"soubory"
 
 #: src/xz/message.c:1113
 msgid ""
@@ -514,15 +539,19 @@ msgid ""
 "  -S, --suffix=.SUF   use the suffix `.SUF' on compressed files\n"
 "      --files[=FILE]  read filenames to process from FILE; if FILE is\n"
 "                      omitted, filenames are read from the standard input;\n"
-"                      filenames must be terminated with the newline character\n"
+"                      filenames must be terminated with the newline "
+"character\n"
 "      --files0[=FILE] like --files but use the null character as terminator"
 msgstr ""
-"     --no-sparse       nevytvářet při dekomprimaci záložní soubory\n"
+"     --no-sparse       nevytvářet při dekomprimaci soubory řídkých matic\n"
 " -S, --suffix=.PRIP    použít u komprimovaných souborů příponu „.PRIP“\n"
-"     --files[=SOUBOR]  Äíst názvy souborů, které se mají zpracovat, ze SOUBORu;\n"
-"                       pokud není SOUBOR zadán, Äte se ze standardního vstupu;\n"
+"     --files[=SOUBOR]  Äíst názvy souborů, které se mají zpracovat, ze "
+"SOUBORu;\n"
+"                       pokud není SOUBOR zadán, Äte se ze standardního "
+"vstupu;\n"
 "                       názvy souborů musí být zakonÄeny znakem nového řádku\n"
-"     --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový znak"
+"     --files0[=SOUBOR] stejné jako --files, ale použít k zakonÄování nulový "
+"znak"
 
 #: src/xz/message.c:1121
 msgid ""
@@ -541,20 +570,26 @@ msgid ""
 msgstr ""
 " -F, --format=FORMÃT   formát souboru k zakódování nebo dekódování; možné\n"
 "                       hodnoty jsou „auto“ (výchozí), „xz“, „lzma“ a „raw“\n"
-" -C, --check=KONTROLA  typ kontroly integrity: „none“ (používejte s rozmyslem),\n"
+" -C, --check=KONTROLA  typ kontroly integrity: „none“ (používejte s "
+"rozmyslem),\n"
 "                       „crc32“, „crc64“ (výchozí) nebo „sha256“"
 
 #: src/xz/message.c:1130
 msgid ""
-"  -0 ... -9           compression preset; default is 6; take compressor *and*\n"
-"                      decompressor memory usage into account before using 7-9!"
-msgstr ""
-" -0 .. -9              přednastavení komprimace; výchozí je 6; než použijete\n"
-"                       hodnoty 7 – 9, vezměte do úvahy množství použité paměti"
+"  -0 ... -9           compression preset; default is 6; take compressor "
+"*and*\n"
+"                      decompressor memory usage into account before using "
+"7-9!"
+msgstr ""
+" -0 .. -9              přednastavení komprimace; výchozí je 6; než "
+"použijete\n"
+"                       hodnoty 7 – 9, vezměte do úvahy množství použité "
+"paměti"
 
 #: src/xz/message.c:1134
 msgid ""
-"  -e, --extreme       try to improve compression ratio by using more CPU time;\n"
+"  -e, --extreme       try to improve compression ratio by using more CPU "
+"time;\n"
 "                      does not affect decompressor memory requirements"
 msgstr ""
 " -e, --extreme         zkusit zlepÅ¡it pomÄ›r komprimace využitím více Äasu\n"
@@ -566,22 +601,27 @@ msgid ""
 "      --memlimit-compress=LIMIT\n"
 "      --memlimit-decompress=LIMIT\n"
 "  -M, --memlimit=LIMIT\n"
-"                      set memory usage limit for compression, decompression,\n"
+"                      set memory usage limit for compression, "
+"decompression,\n"
 "                      or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
 msgstr ""
 "     --memlimit-compress=LIMIT\n"
 "     --memlimit-decompress=LIMIT\n"
 " -M, --memlimit=LIMIT\n"
 "                       nastaví omezení použitelné paměti pro komprimaci,\n"
-"                       dekomprimaci nebo obojí; LIMIT je v bajtech, % z paměti\n"
+"                       dekomprimaci nebo obojí; LIMIT je v bajtech, % z "
+"paměti\n"
 "                       RAM nebo 0 pro výchozí"
 
 #: src/xz/message.c:1146
 msgid ""
-"      --no-adjust     if compression settings exceed the memory usage limit,\n"
-"                      give an error instead of adjusting the settings downwards"
+"      --no-adjust     if compression settings exceed the memory usage "
+"limit,\n"
+"                      give an error instead of adjusting the settings "
+"downwards"
 msgstr ""
-"     --no-adjust       pokud nastavení komprimace přesáhne omezení použitelné\n"
+"     --no-adjust       pokud nastavení komprimace přesáhne omezení "
+"použitelné\n"
 "                       paměti, předat chybu namísto snížení nastavení"
 
 #: src/xz/message.c:1152
@@ -590,13 +630,16 @@ msgid ""
 " Custom filter chain for compression (alternative for using presets):"
 msgstr ""
 "\n"
-"Vlastní omezující filtr pro komprimaci (alternativa k použití přednastavených):"
+"Vlastní omezující filtr pro komprimaci (alternativa k použití "
+"přednastavených):"
 
 #: src/xz/message.c:1161
 msgid ""
 "\n"
-"  --lzma1[=OPTS]      LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
-"  --lzma2[=OPTS]      more of the following options (valid values; default):\n"
+"  --lzma1[=OPTS]      LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
+"or\n"
+"  --lzma2[=OPTS]      more of the following options (valid values; "
+"default):\n"
 "                        preset=PRE reset options to a preset (0-9[e])\n"
 "                        dict=NUM   dictionary size (4KiB - 1536MiB; 8MiB)\n"
 "                        lc=NUM     number of literal context bits (0-4; 3)\n"
@@ -604,20 +647,29 @@ msgid ""
 "                        pb=NUM     number of position bits (0-4; 2)\n"
 "                        mode=MODE  compression mode (fast, normal; normal)\n"
 "                        nice=NUM   nice length of a match (2-273; 64)\n"
-"                        mf=NAME    match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
-"                        depth=NUM  maximum search depth; 0=automatic (default)"
-msgstr ""
-"\n"
-" --lzma1[=VOLBY]       LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam žádné\n"
-" --lzma2[=VOLBY]       nebo více následujících voleb (platné hodnoty; výchozí):\n"
-"                         preset=PŘE změnit volby na PŘEdnastavené (0 – 9[e])\n"
-"                         dict=POČ   velikost slovníku (4 KiB – 1536 MiB; 8 MiB)\n"
-"                         lc=POÄŒ     poÄet kontextových bitů literálu (0 – 4; 3)\n"
-"                         lp=POÄŒ     poÄet poziÄních bitů literálu (0 – 4; 0)\n"
+"                        mf=NAME    match finder (hc3, hc4, bt2, bt3, bt4; "
+"bt4)\n"
+"                        depth=NUM  maximum search depth; 0=automatic "
+"(default)"
+msgstr ""
+"\n"
+" --lzma1[=VOLBY]       LZMA1 nebo LZMA2; VOLBY je Äárkou oddÄ›lovaný seznam "
+"žádné\n"
+" --lzma2[=VOLBY]       nebo více následujících voleb (platné hodnoty; "
+"výchozí):\n"
+"                         preset=PŘE změnit volby na PŘEdnastavené (0 – 9"
+"[e])\n"
+"                         dict=POČ   velikost slovníku (4 KiB – 1536 MiB; 8 "
+"MiB)\n"
+"                         lc=POÄŒ     poÄet kontextových bitů literálu (0 – 4; "
+"3)\n"
+"                         lp=POÄŒ     poÄet poziÄních bitů literálu (0 – 4; "
+"0)\n"
 "                         pb=POÄŒ     poÄet poziÄních bitů (0 – 4; 2)\n"
 "                         mode=REŽIM režim komprimace (fast, normal; normal)\n"
 "                         nice=NUM   příznivá délka shody (2 – 273; 64)\n"
-"                         mf=NÃZEV   hledání shod (hc3, hc4, bt2, bt3, bt4; bt4)\n"
+"                         mf=NÃZEV   hledání shod (hc3, hc4, bt2, bt3, bt4; "
+"bt4)\n"
 "                         depth=POČ  maximální hloubka prohledávání;\n"
 "                                    0 = automaticky (výchozí)"
 
@@ -652,7 +704,8 @@ msgid ""
 msgstr ""
 "\n"
 " --delta[=VOLBY]       Filtr Delta; platné VOLBY (platné hodnoty; výchozí):\n"
-"                         dist=POÄŒ   vzdálenost mezi bajty, které jsou odeÄítány\n"
+"                         dist=POČ   vzdálenost mezi bajty, které jsou "
+"odeÄítány\n"
 "                                    jeden od druhého (1 – 256; 1)"
 
 #: src/xz/message.c:1196
@@ -665,10 +718,12 @@ msgstr ""
 
 #: src/xz/message.c:1199
 msgid ""
-"  -q, --quiet         suppress warnings; specify twice to suppress errors too\n"
+"  -q, --quiet         suppress warnings; specify twice to suppress errors "
+"too\n"
 "  -v, --verbose       be verbose; specify twice for even more verbose"
 msgstr ""
-" -q, --quiet           potlaÄit varování; zadáním dvakrát, potlaÄíte i chyby\n"
+" -q, --quiet           potlaÄit varování; zadáním dvakrát, potlaÄíte i "
+"chyby\n"
 " -v, --verbose         podrobnější zprávy; zadáním dvakrát, budou ještě\n"
 "                       podrobnější"
 
@@ -677,17 +732,20 @@ msgid "  -Q, --no-warn       make warnin
 msgstr " -Q, --no-warn         způsobí, že varování neovlivní stav ukonÄení"
 
 #: src/xz/message.c:1206
-msgid "      --robot         use machine-parsable messages (useful for scripts)"
+msgid ""
+"      --robot         use machine-parsable messages (useful for scripts)"
 msgstr ""
 "     --robot           použít strojovÄ› analyzovatelné zprávy (užiteÄné pro\n"
 "                       skripty)"
 
 #: src/xz/message.c:1209
 msgid ""
-"      --info-memory   display the total amount of RAM and the currently active\n"
+"      --info-memory   display the total amount of RAM and the currently "
+"active\n"
 "                      memory usage limits, and exit"
 msgstr ""
-"     --info-memory     zobrazit celkové množství pamÄ›ti RAM a souÄasné aktivní\n"
+"     --info-memory     zobrazit celkové množství pamÄ›ti RAM a souÄasné "
+"aktivní\n"
 "                       omezení použitelné pamÄ›ti a skonÄit"
 
 #: src/xz/message.c:1212
@@ -695,7 +753,8 @@ msgid ""
 "  -h, --help          display the short help (lists only the basic options)\n"
 "  -H, --long-help     display this long help and exit"
 msgstr ""
-" -h, --help            zobrazit krátkou nápovÄ›du (vypíše jen základní pÅ™epínaÄe)\n"
+" -h, --help            zobrazit krátkou nápovědu (vypíše jen základní "
+"pÅ™epínaÄe)\n"
 " -H, --long-help       zobrazit tuto úplnou nápovÄ›du a skonÄit"
 
 #: src/xz/message.c:1216
@@ -704,7 +763,8 @@ msgid ""
 "  -H, --long-help     display the long help (lists also the advanced options)"
 msgstr ""
 " -h, --help            zobrazit tuto zkrácenou nápovÄ›du a skonÄit\n"
-" -H, --long-help       zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé pÅ™epínaÄe)"
+" -H, --long-help       zobrazit úplnou nápovÄ›du (vypíše i pokroÄilé "
+"pÅ™epínaÄe)"
 
 #: src/xz/message.c:1221
 msgid "  -V, --version       display the version number and exit"
@@ -716,7 +776,8 @@ msgid ""
 "With no FILE, or when FILE is -, read standard input.\n"
 msgstr ""
 "\n"
-"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního vstupu.\n"
+"Pokud SOUBOR není zadán nebo pokud je -, bude se Äíst ze standardního "
+"vstupu.\n"
 
 #. TRANSLATORS: This message indicates the bug reporting address
 #. for this package. Please add _another line_ saying
@@ -763,8 +824,11 @@ msgstr "Vybraný vyhledávaÄ shod vyža
 
 #: src/xz/suffix.c:79 src/xz/suffix.c:164
 #, c-format
-msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
-msgstr "%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do standardního výstupu"
+msgid ""
+"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
+msgstr ""
+"%s: S pÅ™epínaÄem --format=raw je vyžadován --sufix=.PRIP, vyjma zápisu do "
+"standardního výstupu"
 
 #: src/xz/suffix.c:99
 #, c-format
@@ -793,7 +857,9 @@ msgstr "%s: Neplatná jednotka s předpo
 
 #: src/xz/util.c:105
 msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
-msgstr "Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a „GiB“ (2^30 B)."
+msgstr ""
+"Platné jednotky s předponami jsou „KiB“ (2^10 B), „MiB“ (2^20 B) a "
+"„GiB“ (2^30 B)."
 
 #: src/xz/util.c:122
 #, c-format
@@ -827,37 +893,49 @@ msgstr "Neznámá chyba"
 #~ msgstr "%s MiB (%s bajtů)\n"
 
 #~ msgid ""
-#~ "  -e, --extreme       use more CPU time when encoding to increase compression\n"
+#~ "  -e, --extreme       use more CPU time when encoding to increase "
+#~ "compression\n"
 #~ "                      ratio without increasing memory usage of the decoder"
 #~ msgstr ""
-#~ " -e, --extreme         využít více procesorového Äasu pro kódování, Äímž se\n"
-#~ "                       zvýší kompresní poměr bez zvýšení paměti použité kodérem"
+#~ " -e, --extreme         využít více procesorového Äasu pro kódování, Äímž "
+#~ "se\n"
+#~ "                       zvýší kompresní poměr bez zvýšení paměti použité "
+#~ "kodérem"
 
 #~ msgid ""
-#~ "  -M, --memory=NUM    use roughly NUM bytes of memory at maximum; 0 indicates\n"
+#~ "  -M, --memory=NUM    use roughly NUM bytes of memory at maximum; 0 "
+#~ "indicates\n"
 #~ "                      the default setting, which is 40 % of total RAM"
 #~ msgstr ""
-#~ " -M, --memory=POČ      použít zhruba POČ bajtů paměti jako maximum; 0 znamená\n"
-#~ "                       výchozí nastavení, což je 40% celkového množství paměti"
+#~ " -M, --memory=POČ      použít zhruba POČ bajtů paměti jako maximum; 0 "
+#~ "znamená\n"
+#~ "                       výchozí nastavení, což je 40% celkového množství "
+#~ "paměti"
 
 #~ msgid ""
 #~ "\n"
-#~ "  --subblock[=OPTS]   Subblock filter; valid OPTS (valid values; default):\n"
+#~ "  --subblock[=OPTS]   Subblock filter; valid OPTS (valid values; "
+#~ "default):\n"
 #~ "                        size=NUM   number of bytes of data per subblock\n"
 #~ "                                   (1 - 256Mi; 4Ki)\n"
-#~ "                        rle=NUM    run-length encoder chunk size (0-256; 0)"
+#~ "                        rle=NUM    run-length encoder chunk size (0-256; "
+#~ "0)"
 #~ msgstr ""
 #~ "\n"
-#~ " --subblock[=VOLBY]    Subblokový filtr; platné VOLBY (platné hodnoty; výchozí):\n"
+#~ " --subblock[=VOLBY]    Subblokový filtr; platné VOLBY (platné hodnoty; "
+#~ "výchozí):\n"
 #~ "                         size=POÄŒ   poÄet bajtů dat na subblok\n"
 #~ "                                    (1 - 256 Mi; 4 Ki)\n"
-#~ "                         rle=POČ    velikost dávky pro kodér run-length (0-256; 0)"
+#~ "                         rle=POČ    velikost dávky pro kodér run-length "
+#~ "(0-256; 0)"
 
 #~ msgid ""
-#~ "On this system and configuration, this program will use a maximum of roughly\n"
+#~ "On this system and configuration, this program will use a maximum of "
+#~ "roughly\n"
 #~ "%s MiB RAM and "
 #~ msgstr ""
-#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze zhruba\n"
+#~ "Na tomto systému a s tímto nastavením použije tento program maximum ze "
+#~ "zhruba\n"
 #~ "%s MiB RAM a "
 
 #~ msgid ""

Modified: stable/8/contrib/xz/po/de.po
==============================================================================
--- stable/8/contrib/xz/po/de.po	Thu Mar  3 08:38:31 2011	(r219218)
+++ stable/8/contrib/xz/po/de.po	Thu Mar  3 09:44:30 2011	(r219219)
@@ -6,11 +6,10 @@ msgid ""
 msgstr ""
 "Project-Id-Version: XZ Utils 4.999.9beta\n"
 "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
-"POT-Creation-Date: 2010-10-23 17:48+0300\n"
+"POT-Creation-Date: 2010-09-11 17:07+0200\n"
 "PO-Revision-Date: 2010-09-07 20:27+0200\n"
 "Last-Translator:  \n"
 "Language-Team: German\n"
-"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -28,7 +27,8 @@ msgstr "%s: Integritäts-Check Typ nicht
 
 #: src/xz/args.c:382
 msgid "Only one file can be specified with `--files' or `--files0'."
-msgstr "Nur ein file kann als Argument für --files oder --files0 angegeben werden."
+msgstr ""
+"Nur ein file kann als Argument für --files oder --files0 angegeben werden."
 
 #: src/xz/args.c:445
 #, c-format
@@ -41,7 +41,8 @@ msgstr "Maximal vier Filter möglich"
 
 #: src/xz/coder.c:108
 msgid "Memory usage limit is too low for the given filter setup."
-msgstr "Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
+msgstr ""
+"Das Speicher Limit ist zu niedrig für die gegebene Filter Konfiguration."
 
 #: src/xz/coder.c:129
 msgid "Using a preset in raw mode is discouraged."
@@ -49,7 +50,9 @@ msgstr "Verwendung der Voreinstellung im
 
 #: src/xz/coder.c:131
 msgid "The exact options of the presets may vary between software versions."
-msgstr "Die genauen Optionen der Voreinstellung können zwischen Software Versionen variieren."
+msgstr ""
+"Die genauen Optionen der Voreinstellung können zwischen Software Versionen "
+"variieren."
 
 #: src/xz/coder.c:157
 msgid "The .lzma format supports only the LZMA1 filter"
@@ -70,8 +73,12 @@ msgstr "Dekompression wird %s MiB Speich
 
 #: src/xz/coder.c:247
 #, c-format
-msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
-msgstr "Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das Speicher Nutzungslimit von %s MiB zu übersteigen"
+msgid ""
+"Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the "
+"memory usage limit of %s MiB"
+msgstr ""
+"Passte LZMA%c Wörterbuch Größe von %s MiB to %s MiB an, um nicht das "
+"Speicher Nutzungslimit von %s MiB zu übersteigen"
 
 #. TRANSLATORS: When compression or decompression finishes,
 #. and xz is going to remove the source file, xz first checks
@@ -86,7 +93,8 @@ msgstr "Passte LZMA%c Wörterbuch Größ
 #: src/xz/file_io.c:137
 #, c-format
 msgid "%s: File seems to have been moved, not removing"
-msgstr "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
+msgstr ""
+"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
 
 #: src/xz/file_io.c:144 src/xz/file_io.c:590
 #, c-format
@@ -141,7 +149,8 @@ msgstr "%s: Eingabedatei hat mehr als ei
 #: src/xz/file_io.c:714
 #, c-format
 msgid "Error restoring the O_APPEND flag to standard output: %s"
-msgstr "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
+msgstr ""
+"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
 
 #: src/xz/file_io.c:726
 #, c-format
@@ -151,7 +160,8 @@ msgstr "%s: Fehler beim Schießen der Da
 #: src/xz/file_io.c:762 src/xz/file_io.c:946
 #, c-format
 msgid "%s: Seeking failed when trying to create a sparse file: %s"
-msgstr "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
+msgstr ""
+"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
 
 #: src/xz/file_io.c:821
 #, c-format
@@ -202,7 +212,7 @@ msgstr "Kein"
 #. but the Check ID is known (here 2). This and other "Unknown-N"
 #. strings are used in tables, so the width must not exceed ten
 #. columns with a fixed-width font. It's OK to omit the dash if
-#. you need space for one extra letter, but don't use spaces.
+#. you need space for one extra letter.
 #: src/xz/list.c:69
 msgid "Unknown-2"
 msgstr "Unbek.2"
@@ -310,10 +320,12 @@ msgstr "  Strom Auffüllung:    %s\n"
 #: src/xz/list.c:693
 msgid ""
 "  Streams:\n"
-"    Stream    Blocks      CompOffset    UncompOffset        CompSize      UncompSize  Ratio  Check      Padding"
+"    Stream    Blocks      CompOffset    UncompOffset        CompSize      "
+"UncompSize  Ratio  Check      Padding"
 msgstr ""
 "  Ströme:\n"
-"     Strom    Blöcke      KompOffset    UnkompOffset       KompGröße     UnkompGröße  Verh.  Check   Auffüllung"
+"     Strom    Blöcke      KompOffset    UnkompOffset       KompGröße     "
+"UnkompGröße  Verh.  Check   Auffüllung"
 
 #. TRANSLATORS: The second line is column headings. All
 #. except Check are right aligned; Check is left aligned.
@@ -321,10 +333,12 @@ msgstr ""
 #, c-format
 msgid ""
 "  Blocks:\n"
-"    Stream     Block      CompOffset    UncompOffset       TotalSize      UncompSize  Ratio  Check"
+"    Stream     Block      CompOffset    UncompOffset       TotalSize      "
+"UncompSize  Ratio  Check"
 msgstr ""
 "  Blöcke:\n"
-"     Strom     Block      KompOffset    UnkompOffset      TotalGröße     UnkompGröße  Verh.  Check"
+"     Strom     Block      KompOffset    UnkompOffset      TotalGröße     "
+"UnkompGröße  Verh.  Check"
 
 #. TRANSLATORS: These are additional column headings
 #. for the most verbose listing mode. CheckVal
@@ -376,7 +390,8 @@ msgstr "   Anzahl Dateien:     %s\n"
 
 #: src/xz/list.c:1072
 msgid "--list works only on .xz files (--format=xz or --format=auto)"
-msgstr "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
+msgstr ""
+"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
 
 #: src/xz/list.c:1078
 msgid "--list does not support reading from standard input"
@@ -394,69 +409,79 @@ msgstr "%s: Unerwartetes Ende beim Lesen
 
 #: src/xz/main.c:120
 #, c-format
-msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
-msgstr "%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--files0' statt `--files'?"
+msgid ""
+"%s: Null character found when reading filenames; maybe you meant to use `--"
+"files0' instead of `--files'?"
+msgstr ""
+"%s: Null Charakter gefunden beim Lesen der Dateinamen; Meinten Sie `--"
+"files0' statt `--files'?"
 
 #: src/xz/main.c:174
 msgid "Compression and decompression with --robot are not supported yet."
 msgstr "Kompression und Dekompression mit --robot ist noch nicht unterstützt."
 
 #: src/xz/main.c:231
-msgid "Cannot read data from standard input when reading filenames from standard input"
-msgstr "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von der Standardeingabe gelesen werden"
+msgid ""
+"Cannot read data from standard input when reading filenames from standard "
+"input"
+msgstr ""
+"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von "
+"der Standardeingabe gelesen werden"
 
-#: src/xz/message.c:792 src/xz/message.c:842
+#: src/xz/message.c:800 src/xz/message.c:844
 msgid "Internal error (bug)"
 msgstr "Interner Fehler (Bug)"
 
-#: src/xz/message.c:799
+#: src/xz/message.c:807
 msgid "Cannot establish signal handlers"
 msgstr "Kann Signal Routine nicht setzen"
 
-#: src/xz/message.c:808
+#: src/xz/message.c:816
 msgid "No integrity check; not verifying file integrity"
 msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
 
-#: src/xz/message.c:811
+#: src/xz/message.c:819
 msgid "Unsupported type of integrity check; not verifying file integrity"
-msgstr "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht überprüfen"
+msgstr ""
+"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht "
+"überprüfen"
 
-#: src/xz/message.c:818
+#: src/xz/message.c:826
 msgid "Memory usage limit reached"
 msgstr "Speicher-Limit erreicht"
 
-#: src/xz/message.c:821
+#: src/xz/message.c:829
 msgid "File format not recognized"
 msgstr "Datei Format nicht erkannt"
 
-#: src/xz/message.c:824
+#: src/xz/message.c:832
 msgid "Unsupported options"
 msgstr "Optionen nicht unterstützt"
 
-#: src/xz/message.c:827
+#: src/xz/message.c:835
 msgid "Compressed data is corrupt"
 msgstr "Komprimierte Daten sind korrupt"
 
-#: src/xz/message.c:830
+#: src/xz/message.c:838
 msgid "Unexpected end of input"
 msgstr "Unerwartetes Eingabe Ende"
 
-#: src/xz/message.c:881
+#: src/xz/message.c:886
 #, c-format
 msgid "%s MiB of memory is required. The limit is %s."
 msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
 
-#: src/xz/message.c:1048
+#: src/xz/message.c:1053
 #, c-format
 msgid "%s: Filter chain: %s\n"
 msgstr "%s: Filter Kette: %s\n"
 
-#: src/xz/message.c:1058
+#: src/xz/message.c:1063
 #, c-format
 msgid "Try `%s --help' for more information."
 msgstr "Versuchen Sie `%s --help' für mehr Informationen."
 
-#: src/xz/message.c:1084
+#: src/xz/message.c:1089
 #, c-format
 msgid ""
 "Usage: %s [OPTION]... [FILE]...\n"
@@ -467,17 +492,18 @@ msgstr ""
 "Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
 "\n"
 
-#: src/xz/message.c:1091
-msgid "Mandatory arguments to long options are mandatory for short options too.\n"
+#: src/xz/message.c:1096
+msgid ""
+"Mandatory arguments to long options are mandatory for short options too.\n"
 msgstr ""
 "Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n"
 "zwingend.\n"
 
-#: src/xz/message.c:1095
+#: src/xz/message.c:1100
 msgid " Operation mode:\n"
 msgstr " Operationsmodus:\n"
 
-#: src/xz/message.c:1098
+#: src/xz/message.c:1103
 msgid ""
 "  -z, --compress      force compression\n"
 "  -d, --decompress    force decompression\n"
@@ -489,7 +515,7 @@ msgstr ""
 "  -t, --test            überprüfe Datei Integrität\n"
 "  -l, --list            liste Datei Informationen"
 
-#: src/xz/message.c:1104
+#: src/xz/message.c:1109
 msgid ""
 "\n"
 " Operation modifiers:\n"
@@ -497,7 +523,7 @@ msgstr ""
 "\n"
 " Operationsmodifikatoren:\n"
 
-#: src/xz/message.c:1107
+#: src/xz/message.c:1112
 msgid ""
 "  -k, --keep          keep (don't delete) input files\n"
 "  -f, --force         force overwrite of output file and (de)compress links\n"
@@ -509,13 +535,14 @@ msgstr ""
 "  -c, --stdout          schreibe nach Standard Output und lösche nicht die\n"
 "                        Eingabedateien"
 
-#: src/xz/message.c:1113
+#: src/xz/message.c:1118
 msgid ""
 "      --no-sparse     do not create sparse files when decompressing\n"
 "  -S, --suffix=.SUF   use the suffix `.SUF' on compressed files\n"
 "      --files[=FILE]  read filenames to process from FILE; if FILE is\n"
 "                      omitted, filenames are read from the standard input;\n"
-"                      filenames must be terminated with the newline character\n"
+"                      filenames must be terminated with the newline "
+"character\n"
 "      --files0[=FILE] like --files but use the null character as terminator"
 msgstr ""
 "      --no-sparse       erzeuge keine sparse Datei beim Dekomprimieren\n"
@@ -524,9 +551,10 @@ msgstr ""
 "                        DATEI nicht angegeben wurde, werden Dateinamen\n"
 "                        von Standard Input gelesen. Dateinamen müssen mit\n"
 "                        einem Zeilenumbruch voneinander getrennt werden\n"
-"      --files0=[DATEI]  wie --files, aber benutze den Null Charakter als Trenner"
+"      --files0=[DATEI]  wie --files, aber benutze den Null Charakter als "
+"Trenner"
 
-#: src/xz/message.c:1121
+#: src/xz/message.c:1126
 msgid ""
 "\n"
 " Basic file format and compression options:\n"
@@ -534,62 +562,76 @@ msgstr ""
 "\n"
 " Grundlegende Optionen für Dateiformat und Kompression:\n"
 
-#: src/xz/message.c:1123
+#: src/xz/message.c:1128
 msgid ""
 "  -F, --format=FMT    file format to encode or decode; possible values are\n"
 "                      `auto' (default), `xz', `lzma', and `raw'\n"
 "  -C, --check=CHECK   integrity check type: `none' (use with caution),\n"
 "                      `crc32', `crc64' (default), or `sha256'"
 msgstr ""
-"  -F, --format=FMT      Dateiformat zur Kodierung oder Dekodierung; mögliche\n"
-"                        Werte sind `auto' (Voreinstellung), `xz', `lzma' und\n"
+"  -F, --format=FMT      Dateiformat zur Kodierung oder Dekodierung; "
+"mögliche\n"
+"                        Werte sind `auto' (Voreinstellung), `xz', `lzma' "
+"und\n"
 "                        `raw'\n"
-"  -C, --check=CHECK     Typ des Integritätschecks: `none' (Vorsicht), `crc32',\n"
+"  -C, --check=CHECK     Typ des Integritätschecks: `none' (Vorsicht), "
+"`crc32',\n"
 "                        `crc64' (Voreinstellung), oder `sha256'"
 
-#: src/xz/message.c:1130
+#: src/xz/message.c:1135
 msgid ""
-"  -0 ... -9           compression preset; default is 6; take compressor *and*\n"
-"                      decompressor memory usage into account before using 7-9!"
-msgstr ""
-"  -0 .. -9              Kompressionseinstellung; Voreinstellung is 6. Beachten\n"
-"                        Sie den Speicherverbrauch des Komprimieres *und* des\n"
+"  -0 ... -9           compression preset; default is 6; take compressor "
+"*and*\n"
+"                      decompressor memory usage into account before using 7-"
+"9!"
+msgstr ""
+"  -0 .. -9              Kompressionseinstellung; Voreinstellung is 6. "
+"Beachten\n"
+"                        Sie den Speicherverbrauch des Komprimieres *und* "
+"des\n"
 "                        Dekomprimierers, wenn Sie 7-9 benutzen!"
 
-#: src/xz/message.c:1134
+#: src/xz/message.c:1139
 msgid ""
-"  -e, --extreme       try to improve compression ratio by using more CPU time;\n"
+"  -e, --extreme       try to improve compression ratio by using more CPU "
+"time;\n"
 "                      does not affect decompressor memory requirements"
 msgstr ""
-"  -e, --extreme         Versuche durch stärkere CPU Nutzung das Kompressions-\n"
+"  -e, --extreme         Versuche durch stärkere CPU Nutzung das "
+"Kompressions-\n"
 "                        verhältnis zu verbessern. Das beeinflusst nicht den\n"
 "                        Speicherbedarf des Dekomprimierers."
 
-#: src/xz/message.c:1139
+#: src/xz/message.c:1144
 #, no-c-format
 msgid ""

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

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 09:49:04 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69C1D106566C;
	Thu,  3 Mar 2011 09:49:04 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F2C28FC15;
	Thu,  3 Mar 2011 09:49: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 p239n4r5016939;
	Thu, 3 Mar 2011 09:49:04 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p239n4St016938;
	Thu, 3 Mar 2011 09:49:04 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103030949.p239n4St016938@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 09:49:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219220 - stable/8/contrib/xz
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 09:49:04 -0000

Author: mm
Date: Thu Mar  3 09:49:03 2011
New Revision: 219220
URL: http://svn.freebsd.org/changeset/base/219220

Log:
  Delete wrong mergepoints.

Modified:
Directory Properties:
  stable/8/contrib/xz/AUTHORS   (props changed)
  stable/8/contrib/xz/COPYING   (props changed)
  stable/8/contrib/xz/FREEBSD-Xlist   (props changed)
  stable/8/contrib/xz/README   (props changed)
  stable/8/contrib/xz/TODO   (props changed)
  stable/8/contrib/xz/po/   (props changed)
  stable/8/contrib/xz/src/   (props changed)

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 10:25:41 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:15:01 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:28:57 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:29:48 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:31:08 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:45:55 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 11:52:08 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E5BA1065672;
	Thu,  3 Mar 2011 11:52:08 +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 3C69B8FC2C;
	Thu,  3 Mar 2011 11:52: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 p23Bq8mB028412;
	Thu, 3 Mar 2011 11:52:08 GMT (envelope-from nyan@svn.freebsd.org)
Received: (from nyan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Bq8O3028410;
	Thu, 3 Mar 2011 11:52:08 GMT (envelope-from nyan@svn.freebsd.org)
Message-Id: <201103031152.p23Bq8O3028410@svn.freebsd.org>
From: Takahashi Yoshihiro 
Date: Thu, 3 Mar 2011 11:52:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219226 - stable/8/sys/pc98/pc98
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 11:52:08 -0000

Author: nyan
Date: Thu Mar  3 11:52:07 2011
New Revision: 219226
URL: http://svn.freebsd.org/changeset/base/219226

Log:
  MFC: revision 218843
  
    To avoid excessive code duplication create wrapper for fill regs
    from stack frame.

Modified:
  stable/8/sys/pc98/pc98/machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/pc98/pc98/machdep.c
==============================================================================
--- stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 11:45:54 2011	(r219225)
+++ stable/8/sys/pc98/pc98/machdep.c	Thu Mar  3 11:52:07 2011	(r219226)
@@ -2432,6 +2432,13 @@ fill_regs(struct thread *td, struct reg 
 
 	tp = td->td_frame;
 	pcb = td->td_pcb;
+	regs->r_gs = pcb->pcb_gs;
+	return (fill_frame_regs(tp, regs));
+}
+
+int
+fill_frame_regs(struct trapframe *tp, struct reg *regs)
+{
 	regs->r_fs = tp->tf_fs;
 	regs->r_es = tp->tf_es;
 	regs->r_ds = tp->tf_ds;
@@ -2447,7 +2454,6 @@ fill_regs(struct thread *td, struct reg 
 	regs->r_eflags = tp->tf_eflags;
 	regs->r_esp = tp->tf_esp;
 	regs->r_ss = tp->tf_ss;
-	regs->r_gs = pcb->pcb_gs;
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 13:13:08 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 13:15:07 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 14:31:40 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E8EFD1065670;
	Thu,  3 Mar 2011 14:31:40 +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 D6EFF8FC0A;
	Thu,  3 Mar 2011 14:31: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 p23EVep1040666;
	Thu, 3 Mar 2011 14:31:40 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23EVeVu040664;
	Thu, 3 Mar 2011 14:31:40 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201103031431.p23EVeVu040664@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 3 Mar 2011 14:31:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219227 - stable/8/share/man/man4
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 14:31:41 -0000

Author: gjb (doc committer)
Date: Thu Mar  3 14:31:40 2011
New Revision: 219227
URL: http://svn.freebsd.org/changeset/base/219227

Log:
  MFC 216074[1], 219086:
  
  Fix device name in usb_quirk(4).
  
  PR:		155074
  Obtained from:	ru [1]

Modified:
  stable/8/share/man/man4/usb_quirk.4
Directory Properties:
  stable/8/share/man/man4/   (props changed)

Modified: stable/8/share/man/man4/usb_quirk.4
==============================================================================
--- stable/8/share/man/man4/usb_quirk.4	Thu Mar  3 11:52:07 2011	(r219226)
+++ stable/8/share/man/man4/usb_quirk.4	Thu Mar  3 14:31:40 2011	(r219227)
@@ -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 ucom"
+.Cd "device usb_quirk"
 .Ed
 .Pp
 Alternatively, to load the module at boot
@@ -183,7 +183,6 @@ device which appears as a USB device on
 usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT
 .Ed
 .Sh SEE ALSO
-.Xr usb_quirk 4 ,
 .Xr usbconfig 5
 .Sh HISTORY
 The

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 15:27:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55370106564A;
	Thu,  3 Mar 2011 15:27:07 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 440AC8FC0C;
	Thu,  3 Mar 2011 15:27: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 p23FR7tm048518;
	Thu, 3 Mar 2011 15:27:07 GMT (envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23FR7lm048516;
	Thu, 3 Mar 2011 15:27:07 GMT (envelope-from kensmith@svn.freebsd.org)
Message-Id: <201103031527.p23FR7lm048516@svn.freebsd.org>
From: Ken Smith 
Date: Thu, 3 Mar 2011 15:27:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-svnadmin@freebsd.org
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219228 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 15:27:07 -0000

Author: kensmith
Date: Thu Mar  3 15:27:06 2011
New Revision: 219228
URL: http://svn.freebsd.org/changeset/base/219228

Log:
  Turn over releng/8.2 and releng/7.4 to secteam.
  
  Approved by:	core (implicit)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==============================================================================
--- svnadmin/conf/approvers	Thu Mar  3 14:31:40 2011	(r219227)
+++ svnadmin/conf/approvers	Thu Mar  3 15:27:06 2011	(r219228)
@@ -19,10 +19,8 @@
 #^head/				re
 #^stable/8/			re
 #^stable/7/			re
-^releng/8.2/			re
-^releng/7.4/			re
-^releng/8.[0-1]/		(security-officer|so)
-^releng/7.[0-3]/		(security-officer|so)
+^releng/8.[0-2]/		(security-officer|so)
+^releng/7.[0-4]/		(security-officer|so)
 ^releng/6.[0-4]/		(security-officer|so)
 ^releng/5.[0-5]/		(security-officer|so)
 ^releng/4.[3-9]/		(security-officer|so)

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 16:16:49 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 16:22:39 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:22:40 -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-all@FreeBSD.ORG  Thu Mar  3 16:58:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D025106566B;
	Thu,  3 Mar 2011 16:58:00 +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 EF0508FC1C;
	Thu,  3 Mar 2011 16:57:59 +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 p23Gvx8S053219;
	Thu, 3 Mar 2011 16:57:59 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GvxJF053218;
	Thu, 3 Mar 2011 16:57:59 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <201103031657.p23GvxJF053218@svn.freebsd.org>
From: Robert Watson 
Date: Thu, 3 Mar 2011 16:57:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219230 - stable/8/cddl/contrib/dtracetoolkit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:00 -0000

Author: rwatson
Date: Thu Mar  3 16:57:59 2011
New Revision: 219230
URL: http://svn.freebsd.org/changeset/base/219230

Log:
  Merge r211786 from head to stable/8:
  
    Port dtruss to FreeBSD.
  
    Sponsored by:	The FreeBSD Foundation
  
  Reported by:	Nikolay Denev 
  Original commit by:	rpaulo

Modified:
  stable/8/cddl/contrib/dtracetoolkit/dtruss
Directory Properties:
  stable/8/cddl/contrib/dtracetoolkit/   (props changed)

Modified: stable/8/cddl/contrib/dtracetoolkit/dtruss
==============================================================================
--- stable/8/cddl/contrib/dtracetoolkit/dtruss	Thu Mar  3 16:16:49 2011	(r219229)
+++ stable/8/cddl/contrib/dtracetoolkit/dtruss	Thu Mar  3 16:57:59 2011	(r219230)
@@ -1,4 +1,4 @@
-#!/usr/bin/sh
+#!/bin/sh
 #
 # dtruss - print process system call time details.
 #          Written using DTrace (Solaris 10 3/05).
@@ -240,7 +240,7 @@ syscall:::entry
  */
 
 /* print 3 args, return as hex */
-syscall::lwp_sigmask:return
+syscall::sigprocmask:return
 /self->start/
 {
 	/* calculate elapsed time */
@@ -268,10 +268,11 @@ syscall::lwp_sigmask:return
 }
 
 /* print 3 args, arg0 as a string */
+syscall::access*:return,
 syscall::stat*:return, 
 syscall::lstat*:return, 
-syscall::open*:return,
-syscall::resolvepath:return
+syscall::readlink*:return,
+syscall::open*:return
 /self->start/
 {
 	/* calculate elapsed time */
@@ -329,7 +330,6 @@ syscall::*read*:return
 }
 
 /* print 0 arg output */
-syscall::gtime:return,
 syscall::*fork*:return
 /self->start/
 {
@@ -357,9 +357,6 @@ syscall::*fork*:return
 }
 
 /* print 1 arg output */
-syscall::brk:return,
-syscall::times:return,
-syscall::stime:return,
 syscall::close:return
 /self->start/
 {
@@ -387,7 +384,7 @@ syscall::close:return
 }
 
 /* print 2 arg output */
-syscall::utime:return,
+syscall::utimes:return,
 syscall::munmap:return
 /self->start/
 {

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 16:58:55 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D5951065687;
	Thu,  3 Mar 2011 16:58:55 +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 667F68FC1A;
	Thu,  3 Mar 2011 16:58:55 +0000 (UTC)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 0C5CE46B2D;
	Thu,  3 Mar 2011 11:58:55 -0500 (EST)
Date: Thu, 3 Mar 2011 16:58:54 +0000 (GMT)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: Nikolay Denev 
In-Reply-To: <8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
Message-ID: 
References: <201102282328.p1SNSZZK059958@svn.freebsd.org>
	<8748736E-CD0A-4002-88C6-0D4090013C9C@gmail.com>
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-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r219107 - in stable/8/sys: amd64/amd64 amd64/include
 boot/common cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys
 cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensol...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:55 -0000


On Wed, 2 Mar 2011, Nikolay Denev wrote:

> On 1 Mar, 2011, at 01:28 , Robert Watson wrote:
>
>> Author: rwatson Date: Mon Feb 28 23:28:35 2011 New Revision: 219107 URL: 
>> http://svn.freebsd.org/changeset/base/219107
>>
>> Log:
>>  Merge userspace DTrace support from head to stable/8:
>
> It seems that the dtruss script in RELENG_8 has "/usr/bin/sh" as 
> interpreter. This appears to be fixed in head.

Ni Nikolay:

Indeed, I was unaware of the userspace changes in cddl/contrib/dtracetoolkit, 
so I've now merged r211786 to stable/8 as 219230.  Could you give it a try and 
let me know how that works out for you?

Thanks,

Robert Watson
University of Cambridge
Computer Laboratory

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 16:58:59 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 703B0106568A;
	Thu,  3 Mar 2011 16:58:59 +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 46CD88FC2D;
	Thu,  3 Mar 2011 16:58:59 +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 p23GwxkG053311;
	Thu, 3 Mar 2011 16:58:59 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GwxvJ053309;
	Thu, 3 Mar 2011 16:58:59 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031658.p23GwxvJ053309@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 16:58:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219231 - stable/8/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:58:59 -0000

Author: jhb
Date: Thu Mar  3 16:58:58 2011
New Revision: 219231
URL: http://svn.freebsd.org/changeset/base/219231

Log:
  MFC 218270:
  Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
  TASKQUEUE_DEFINE macros.  All the places that use these macros to create
  taskqueues assume that the operation succeeds.

Modified:
  stable/8/sys/sys/taskqueue.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/taskqueue.h
==============================================================================
--- stable/8/sys/sys/taskqueue.h	Thu Mar  3 16:57:59 2011	(r219230)
+++ stable/8/sys/sys/taskqueue.h	Thu Mar  3 16:58:58 2011	(r219231)
@@ -94,7 +94,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create(#name, M_NOWAIT, (enqueue), (context));	\
+	    taskqueue_create(#name, M_WAITOK, (enqueue), (context));	\
 	init;								\
 }									\
 									\
@@ -118,7 +118,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create_fast(#name, M_NOWAIT, (enqueue),		\
+	    taskqueue_create_fast(#name, M_WAITOK, (enqueue),		\
 	    (context));							\
 	init;								\
 }									\

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 16:59:20 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FFE1106591C;
	Thu,  3 Mar 2011 16:59:20 +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 7EAA38FC18;
	Thu,  3 Mar 2011 16:59: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 p23GxK6x053368;
	Thu, 3 Mar 2011 16:59:20 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23GxKra053366;
	Thu, 3 Mar 2011 16:59:20 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031659.p23GxKra053366@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 16:59:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219232 - stable/7/sys/sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 16:59:20 -0000

Author: jhb
Date: Thu Mar  3 16:59:20 2011
New Revision: 219232
URL: http://svn.freebsd.org/changeset/base/219232

Log:
  MFC 218270:
  Use M_WAITOK rather than M_NOWAIT when creating taskqueues via the
  TASKQUEUE_DEFINE macros.  All the places that use these macros to create
  taskqueues assume that the operation succeeds.

Modified:
  stable/7/sys/sys/taskqueue.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sys/taskqueue.h
==============================================================================
--- stable/7/sys/sys/taskqueue.h	Thu Mar  3 16:58:58 2011	(r219231)
+++ stable/7/sys/sys/taskqueue.h	Thu Mar  3 16:59:20 2011	(r219232)
@@ -96,7 +96,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create(#name, M_NOWAIT, (enqueue), (context));	\
+	    taskqueue_create(#name, M_WAITOK, (enqueue), (context));	\
 	init;								\
 }									\
 									\
@@ -120,7 +120,7 @@ static void								\
 taskqueue_define_##name(void *arg)					\
 {									\
 	taskqueue_##name =						\
-	    taskqueue_create_fast(#name, M_NOWAIT, (enqueue),		\
+	    taskqueue_create_fast(#name, M_WAITOK, (enqueue),		\
 	    (context));							\
 	init;								\
 }									\

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:04:45 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 974151065674;
	Thu,  3 Mar 2011 17:04:45 +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 85ACC8FC0A;
	Thu,  3 Mar 2011 17:04: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 p23H4jsq053847;
	Thu, 3 Mar 2011 17:04:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23H4jcf053845;
	Thu, 3 Mar 2011 17:04:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031704.p23H4jcf053845@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:04:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219233 - stable/7/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:04:45 -0000

Author: jhb
Date: Thu Mar  3 17:04:45 2011
New Revision: 219233
URL: http://svn.freebsd.org/changeset/base/219233

Log:
  MFC 200761,218272:
  Always assert that the turnstile chain lock is held in turnstile_wait()
  and remove a duplicate hash lookup.

Modified:
  stable/7/sys/kern/subr_turnstile.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/subr_turnstile.c
==============================================================================
--- stable/7/sys/kern/subr_turnstile.c	Thu Mar  3 16:59:20 2011	(r219232)
+++ stable/7/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:45 2011	(r219233)
@@ -687,8 +687,8 @@ turnstile_wait(struct turnstile *ts, str
 	 * turnstile already in use by this lock.
 	 */
 	tc = TC_LOOKUP(ts->ts_lockobj);
-	if (ts == td->td_turnstile) {
 	mtx_assert(&tc->tc_lock, MA_OWNED);
+	if (ts == td->td_turnstile) {
 #ifdef TURNSTILE_PROFILING
 		tc->tc_depth++;
 		if (tc->tc_depth > tc->tc_max_depth) {
@@ -697,7 +697,6 @@ turnstile_wait(struct turnstile *ts, str
 				turnstile_max_depth = tc->tc_max_depth;
 		}
 #endif
-		tc = TC_LOOKUP(ts->ts_lockobj);
 		LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash);
 		KASSERT(TAILQ_EMPTY(&ts->ts_pending),
 		    ("thread's turnstile has pending threads"));

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:04:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BF78106575F;
	Thu,  3 Mar 2011 17:04:58 +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 A1F888FC14;
	Thu,  3 Mar 2011 17:04: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 p23H4vPO053910;
	Thu, 3 Mar 2011 17:04:57 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23H4vog053908;
	Thu, 3 Mar 2011 17:04:57 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031704.p23H4vog053908@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:04:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219234 - stable/8/sys/kern
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:04:58 -0000

Author: jhb
Date: Thu Mar  3 17:04:57 2011
New Revision: 219234
URL: http://svn.freebsd.org/changeset/base/219234

Log:
  MFC 200761,218272:
  Always assert that the turnstile chain lock is held in turnstile_wait()
  and remove a duplicate hash lookup.

Modified:
  stable/8/sys/kern/subr_turnstile.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_turnstile.c
==============================================================================
--- stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:45 2011	(r219233)
+++ stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:57 2011	(r219234)
@@ -685,8 +685,8 @@ turnstile_wait(struct turnstile *ts, str
 	 * turnstile already in use by this lock.
 	 */
 	tc = TC_LOOKUP(ts->ts_lockobj);
-	if (ts == td->td_turnstile) {
 	mtx_assert(&tc->tc_lock, MA_OWNED);
+	if (ts == td->td_turnstile) {
 #ifdef TURNSTILE_PROFILING
 		tc->tc_depth++;
 		if (tc->tc_depth > tc->tc_max_depth) {
@@ -695,7 +695,6 @@ turnstile_wait(struct turnstile *ts, str
 				turnstile_max_depth = tc->tc_max_depth;
 		}
 #endif
-		tc = TC_LOOKUP(ts->ts_lockobj);
 		LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash);
 		KASSERT(TAILQ_EMPTY(&ts->ts_pending),
 		    ("thread's turnstile has pending threads"));

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:10:49 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 584B4106566B;
	Thu,  3 Mar 2011 17:10:49 +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 46CFF8FC18;
	Thu,  3 Mar 2011 17:10: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 p23HAnDE054623;
	Thu, 3 Mar 2011 17:10:49 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HAndv054621;
	Thu, 3 Mar 2011 17:10:49 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031710.p23HAndv054621@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:10:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219235 - stable/8/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:10:49 -0000

Author: jhb
Date: Thu Mar  3 17:10:48 2011
New Revision: 219235
URL: http://svn.freebsd.org/changeset/base/219235

Log:
  MFC 218290: Correct include path.

Modified:
  stable/8/sys/conf/files
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Thu Mar  3 17:04:57 2011	(r219234)
+++ stable/8/sys/conf/files	Thu Mar  3 17:10:48 2011	(r219235)
@@ -924,7 +924,7 @@ dev/e1000/e1000_82543.c		optional em | i
 dev/e1000/e1000_82571.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82575.c		optional em | igb \
-	 compile-with "${NORMAL_C} -I$S/dev/igb"
+	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_ich8lan.c	optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em | igb \

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:11:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0FECC1065679;
	Thu,  3 Mar 2011 17:11:12 +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 F2D3D8FC0C;
	Thu,  3 Mar 2011 17:11: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 p23HBBtg054711;
	Thu, 3 Mar 2011 17:11:11 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HBBHL054709;
	Thu, 3 Mar 2011 17:11:11 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031711.p23HBBHL054709@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 17:11:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219236 - stable/7/sys/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:11:12 -0000

Author: jhb
Date: Thu Mar  3 17:11:11 2011
New Revision: 219236
URL: http://svn.freebsd.org/changeset/base/219236

Log:
  MFC 218290: Correct include path.

Modified:
  stable/7/sys/conf/files
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files	Thu Mar  3 17:10:48 2011	(r219235)
+++ stable/7/sys/conf/files	Thu Mar  3 17:11:11 2011	(r219236)
@@ -799,7 +799,7 @@ dev/e1000/e1000_82543.c		optional em | i
 dev/e1000/e1000_82571.c		optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_82575.c		optional em | igb \
-	 compile-with "${NORMAL_C} -I$S/dev/igb"
+	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_ich8lan.c	optional em | igb \
 	compile-with "${NORMAL_C} -I$S/dev/e1000"
 dev/e1000/e1000_api.c		optional em | igb \

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:11:15 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 17:12:24 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9F531065675;
	Thu,  3 Mar 2011 17:12:24 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 982398FC1F;
	Thu,  3 Mar 2011 17:12: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 p23HCO6Z054841;
	Thu, 3 Mar 2011 17:12:24 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23HCO8H054839;
	Thu, 3 Mar 2011 17:12:24 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201103031712.p23HCO8H054839@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 3 Mar 2011 17:12:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219237 - stable/8/libexec/rtld-elf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 17:12:24 -0000

Author: jh
Date: Thu Mar  3 17:12:24 2011
New Revision: 219237
URL: http://svn.freebsd.org/changeset/base/219237

Log:
  MFC r216489:
  
  If dlclose() is called recursively from a _fini() function, the inner
  dlclose() call may unload the object of the outer call prematurely
  because objects are unreferenced before _fini() calls.
  
  Fix this by unreferencing objects after calling objlist_call_fini() in
  dlclose(). Therefore objlist_call_fini() now calls the fini function if
  the reference count of an object is 1. In addition we must restart the
  list_fini traversal after every _fini() call because another dlclose()
  call might have modified the reference counts.
  
  Add an XXX comment to objlist_call_fini() about possible race with
  dlopen().
  
  PR:		133246, 149464

Modified:
  stable/8/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)

Modified: stable/8/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/8/libexec/rtld-elf/rtld.c	Thu Mar  3 17:11:11 2011	(r219236)
+++ stable/8/libexec/rtld-elf/rtld.c	Thu Mar  3 17:12:24 2011	(r219237)
@@ -107,7 +107,7 @@ static int load_needed_objects(Obj_Entry
 static int load_preload_objects(void);
 static Obj_Entry *load_object(const char *, const Obj_Entry *, int);
 static Obj_Entry *obj_from_addr(const void *);
-static void objlist_call_fini(Objlist *, bool, int *);
+static void objlist_call_fini(Objlist *, Obj_Entry *, int *);
 static void objlist_call_init(Objlist *, int *);
 static void objlist_clear(Objlist *);
 static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *);
@@ -1616,36 +1616,56 @@ obj_from_addr(const void *addr)
 
 /*
  * Call the finalization functions for each of the objects in "list"
- * which are unreferenced.  All of the objects are expected to have
- * non-NULL fini functions.
+ * belonging to the DAG of "root" and referenced once. If NULL "root"
+ * is specified, every finalization function will be called regardless
+ * of the reference count and the list elements won't be freed. All of
+ * the objects are expected to have non-NULL fini functions.
  */
 static void
-objlist_call_fini(Objlist *list, bool force, int *lockstate)
+objlist_call_fini(Objlist *list, Obj_Entry *root, int *lockstate)
 {
-    Objlist_Entry *elm, *elm_tmp;
+    Objlist_Entry *elm;
     char *saved_msg;
 
+    assert(root == NULL || root->refcount == 1);
+
     /*
      * Preserve the current error message since a fini function might
      * call into the dynamic linker and overwrite it.
      */
     saved_msg = errmsg_save();
-    STAILQ_FOREACH_SAFE(elm, list, link, elm_tmp) {
-	if (elm->obj->refcount == 0 || force) {
+    do {
+	STAILQ_FOREACH(elm, list, link) {
+	    if (root != NULL && (elm->obj->refcount != 1 ||
+	      objlist_find(&root->dagmembers, elm->obj) == NULL))
+		continue;
 	    dbg("calling fini function for %s at %p", elm->obj->path,
 	        (void *)elm->obj->fini);
 	    LD_UTRACE(UTRACE_FINI_CALL, elm->obj, (void *)elm->obj->fini, 0, 0,
 		elm->obj->path);
 	    /* Remove object from fini list to prevent recursive invocation. */
 	    STAILQ_REMOVE(list, elm, Struct_Objlist_Entry, link);
+	    /*
+	     * XXX: If a dlopen() call references an object while the
+	     * fini function is in progress, we might end up trying to
+	     * unload the referenced object in dlclose() or the object
+	     * won't be unloaded although its fini function has been
+	     * called.
+	     */
 	    wlock_release(rtld_bind_lock, *lockstate);
 	    call_initfini_pointer(elm->obj, elm->obj->fini);
 	    *lockstate = wlock_acquire(rtld_bind_lock);
 	    /* No need to free anything if process is going down. */
-	    if (!force)
+	    if (root != NULL)
 	    	free(elm);
+	    /*
+	     * We must restart the list traversal after every fini call
+	     * because a dlclose() call from the fini function or from
+	     * another thread might have modified the reference counts.
+	     */
+	    break;
 	}
-    }
+    } while (elm != NULL);
     errmsg_restore(saved_msg);
 }
 
@@ -1833,7 +1853,7 @@ rtld_exit(void)
 
     lockstate = wlock_acquire(rtld_bind_lock);
     dbg("rtld_exit()");
-    objlist_call_fini(&list_fini, true, &lockstate);
+    objlist_call_fini(&list_fini, NULL, &lockstate);
     /* No need to remove the items from the list, since we are exiting. */
     if (!libmap_disable)
         lm_fini();
@@ -1946,20 +1966,22 @@ dlclose(void *handle)
     /* Unreference the object and its dependencies. */
     root->dl_refcount--;
 
-    unref_dag(root);
-
-    if (root->refcount == 0) {
+    if (root->refcount == 1) {
 	/*
-	 * The object is no longer referenced, so we must unload it.
+	 * The object will be no longer referenced, so we must unload it.
 	 * First, call the fini functions.
 	 */
-	objlist_call_fini(&list_fini, false, &lockstate);
+	objlist_call_fini(&list_fini, root, &lockstate);
+
+	unref_dag(root);
 
 	/* Finish cleaning up the newly-unreferenced objects. */
 	GDB_STATE(RT_DELETE,&root->linkmap);
 	unload_object(root);
 	GDB_STATE(RT_CONSISTENT,NULL);
-    }
+    } else
+	unref_dag(root);
+
     LD_UTRACE(UTRACE_DLCLOSE_STOP, handle, NULL, 0, 0, NULL);
     wlock_release(rtld_bind_lock, lockstate);
     return 0;

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 17:22:47 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 17:33:22 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:04:10 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:05:18 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:16:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB062106564A;
	Thu,  3 Mar 2011 18:16:35 +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 9FAC18FC08;
	Thu,  3 Mar 2011 18:16: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 p23IGZnh060564;
	Thu, 3 Mar 2011 18:16:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23IGZPM060561;
	Thu, 3 Mar 2011 18:16:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031816.p23IGZPM060561@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:16:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219239 - in stable/8/share/man: man5 man7
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:16:35 -0000

Author: jhb
Date: Thu Mar  3 18:16:35 2011
New Revision: 219239
URL: http://svn.freebsd.org/changeset/base/219239

Log:
  MFC 200597,200599:
  Docmuent NO_KERNEL{CLEAN,CONFIG,DEPEND,OBJ} as necessary.  Update
  documentation on KERNFAST meaning.

Modified:
  stable/8/share/man/man5/make.conf.5
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man5/   (props changed)
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/share/man/man5/make.conf.5
==============================================================================
--- stable/8/share/man/man5/make.conf.5	Thu Mar  3 17:33:22 2011	(r219238)
+++ stable/8/share/man/man5/make.conf.5	Thu Mar  3 18:16:35 2011	(r219239)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 5, 2006
+.Dd December 15, 2009
 .Dt MAKE.CONF 5
 .Os
 .Sh NAME
@@ -369,6 +369,12 @@ It defaults to
 .It Va MODULES_OVERRIDE
 .Pq Vt str
 Set to a list of modules to build instead of all of them.
+.It Va NO_KERNELCLEAN
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} clean"
+during
+.Dq Li "${MAKE} buildkernel" .
 .It Va NO_KERNELCONFIG
 .Pq Vt bool
 Set this to skip running
@@ -381,6 +387,12 @@ Set this to skip running
 .Dq Li "${MAKE} depend"
 during
 .Dq Li "${MAKE} buildkernel" .
+.It Va NO_KERNELOBJ
+.Pq Vt bool
+Set this to skip running
+.Dq Li "${MAKE} obj"
+during
+.Dq Li "${MAKE} buildkernel" .
 .It Va NO_MODULES
 .Pq Vt bool
 Set to not build modules with the kernel.

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 17:33:22 2011	(r219238)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:16:35 2011	(r219239)
@@ -359,9 +359,10 @@ If set, the build target
 .Cm buildkernel
 defaults to setting 
 .Va NO_KERNELCLEAN ,
-.Va NO_KERNELCONFIG
+.Va NO_KERNELCONFIG ,
+.Va NO_KERNELDEPEND 
 and
-.Va NO_KERNELDEPEND .
+.Va NO_KERNELOBJ .
 When set to a value other than
 .Cm 1
 then 
@@ -458,6 +459,12 @@ If set, the build process does not run
 as part of the
 .Cm buildkernel
 target.
+.It Va NO_KERNELOBJ
+If set, the build process does not run
+.Dq make obj
+as part of the
+.Cm buildkernel
+target.
 .It Va NO_DOCUPDATE
 If set, the update process does not update the source of the
 .Fx

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 18:19:11 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:28:21 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:29:55 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 18:49:47 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 04F441065674;
	Thu,  3 Mar 2011 18:49:47 +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 E7B5A8FC08;
	Thu,  3 Mar 2011 18:49: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 p23Inka8062388;
	Thu, 3 Mar 2011 18:49:46 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Inkxq062386;
	Thu, 3 Mar 2011 18:49:46 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031849.p23Inkxq062386@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:49:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219244 - stable/8/share/man/man7
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:49:47 -0000

Author: jhb
Date: Thu Mar  3 18:49:46 2011
New Revision: 219244
URL: http://svn.freebsd.org/changeset/base/219244

Log:
  MFC 217733: Properly document what the top-level `make tinderbox` does.

Modified:
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 18:42:53 2011	(r219243)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:49:46 2011	(r219244)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 31, 2010
+.Dd January 22, 2011
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -229,6 +229,11 @@ This command takes a long time.
 .It Cm update
 Get updated sources as configured in
 .Xr make.conf 5 .
+.It Cm tinderbox
+Execute the same targets as
+.Cm universe .
+In addition print a summary of all failed targets at the end and
+exit with an error if there were any.
 .El
 .Pp
 Kernel specific build targets in

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 18:52:13 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2E36F1065670;
	Thu,  3 Mar 2011 18:52:13 +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 1BEBB8FC13;
	Thu,  3 Mar 2011 18:52: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 p23IqDHt062611;
	Thu, 3 Mar 2011 18:52:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23IqCUo062608;
	Thu, 3 Mar 2011 18:52:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031852.p23IqCUo062608@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 18:52:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219245 - in stable/8: . share/man/man7
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 18:52:13 -0000

Author: jhb
Date: Thu Mar  3 18:52:11 2011
New Revision: 219245
URL: http://svn.freebsd.org/changeset/base/219245

Log:
  MFC 216487,217754,218524:
  - Pass JFLAG as JFLAG from tinderbox to universe.
  - For `make tinderbox` there is no need to print the extra commands.
  - Add a new UNIVERSE_TARGET variable for 'make universe'.  If it is set,
    then that target is invoked for each architecture rather than the
    default action of building world and kernels for each architecture.
  - Add a 'make toolchains' wrapper which uses UNIVERSE_TARGET to build
    toolchains for all architectures.
  - Document JFLAG, MAKE_JUST_KERNELS, and MAKE_JUST_WORLDS variables for
    'make universe'.

Modified:
  stable/8/Makefile   (contents, props changed)
  stable/8/share/man/man7/build.7
Directory Properties:
  stable/8/share/man/man7/   (props changed)

Modified: stable/8/Makefile
==============================================================================
--- stable/8/Makefile	Thu Mar  3 18:49:46 2011	(r219244)
+++ stable/8/Makefile	Thu Mar  3 18:52:11 2011	(r219245)
@@ -25,6 +25,7 @@
 # delete-old-dirs     - Delete obsolete directories.
 # delete-old-files    - Delete obsolete files.
 # delete-old-libs     - Delete obsolete libraries.
+# toolchains          - Build a toolchain for all world and kernel targets.
 #
 # This makefile is simple by design. The FreeBSD make automatically reads
 # the /usr/share/mk/sys.mk unless the -m argument is specified on the
@@ -268,8 +269,10 @@ make: .PHONY
 		${MMAKE} install DESTDIR=${MAKEPATH} BINDIR=
 
 tinderbox:
-	cd ${.CURDIR} && \
-		DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe
+	@cd ${.CURDIR} && ${MAKE} DOING_TINDERBOX=YES universe
+
+toolchains:
+	@cd ${.CURDIR} && ${MAKE} UNIVERSE_TARGET=toolchain universe
 
 #
 # universe
@@ -281,6 +284,12 @@ tinderbox:
 .if make(universe) || make(universe_kernels) || make(tinderbox)
 TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
 
+.if defined(UNIVERSE_TARGET)
+MAKE_JUST_WORLDS=	YES
+.else
+UNIVERSE_TARGET?=	buildworld
+.endif
+
 .if defined(DOING_TINDERBOX)
 FAILFILE=tinderbox.failed
 MAKEFAIL=tee -a ${FAILFILE}
@@ -294,21 +303,22 @@ universe_prologue:
 	@echo ">>> make universe started on ${STARTTIME}"
 	@echo "--------------------------------------------------------------"
 .if defined(DOING_TINDERBOX)
-	rm -f ${FAILFILE}
+	@rm -f ${FAILFILE}
 .endif
 .for target in ${TARGETS}
 universe: universe_${target}
 .ORDER: universe_prologue universe_${target} universe_epilogue
 universe_${target}:
-.if !defined(MAKE_JUST_KERNELS)
 	@echo ">> ${target} started on `LC_ALL=C date`"
+.if !defined(MAKE_JUST_KERNELS)
+	@echo ">> ${target} ${UNIVERSE_TARGET} started on `LC_ALL=C date`"
 	@(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \
-	    ${MAKE} ${JFLAG} buildworld \
+	    ${MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
 	    TARGET=${target} \
-	    > _.${target}.buildworld 2>&1 || \
-	    (echo "${target} world failed," \
-	    "check _.${target}.buildworld for details" | ${MAKEFAIL}))
-	@echo ">> ${target} buildworld completed on `LC_ALL=C date`"
+	    > _.${target}.${UNIVERSE_TARGET} 2>&1 || \
+	    (echo "${target} ${UNIVERSE_TARGET} failed," \
+	    "check _.${target}.${UNIVERSE_TARGET} for details" | ${MAKEFAIL}))
+	@echo ">> ${target} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`"
 .endif
 .if !defined(MAKE_JUST_WORLDS)
 .if exists(${.CURDIR}/sys/${target}/conf/NOTES)

Modified: stable/8/share/man/man7/build.7
==============================================================================
--- stable/8/share/man/man7/build.7	Thu Mar  3 18:49:46 2011	(r219244)
+++ stable/8/share/man/man7/build.7	Thu Mar  3 18:52:11 2011	(r219245)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2011
+.Dd February 10, 2011
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -218,13 +218,14 @@ on how to make it start at boot time.
 Create the build toolchain needed to build the rest of the system.
 For cross-architecture builds, this step creates a cross-toolchain.
 .It Cm universe
-Execute a
+For each architecture,
+execute a
 .Cm buildworld
-and
+followed by a
 .Cm buildkernel
-for all kernels including
-.Pa LINT ,
-for each architecture supported by the build system.
+for all kernels for that architecture,
+including
+.Pa LINT .
 This command takes a long time.
 .It Cm update
 Get updated sources as configured in
@@ -234,6 +235,8 @@ Execute the same targets as
 .Cm universe .
 In addition print a summary of all failed targets at the end and
 exit with an error if there were any.
+.It Cm toolchains
+Create a build toolchain for each architecture supported by the build system.
 .El
 .Pp
 Kernel specific build targets in
@@ -493,6 +496,29 @@ If set, restricts the documentation buil
 specified as its content.
 The default action is to build documentation for all languages.
 .El
+.Pp
+Builds using the
+.Cm universe
+target are influenced by the following
+.Xr make 1
+variables:
+.Bl -tag -width ".Va MAKE_JUST_KERNELS"
+.It Va JFLAG
+Pass the value of this variable to each
+.Xr make 1
+invocation used to build worlds and kernels.
+This can be used to enable multiple jobs within a single architecture's build
+while still building each architecture serially.
+.It Va MAKE_JUST_KERNELS
+Only build kernels for each supported architecture.
+.It Va MAKE_JUST_WORLDS
+Only build worlds for each supported architecture.
+.It Va UNIVERSE_TARGET
+Execute the specified
+.Xr make 1
+target for each supported architecture instead of the default action of
+building a world and one or more kernels.
+.El
 .Sh FILES
 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
 .It Pa /usr/doc/Makefile

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 19:34:09 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 19:49:21 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 19:55:16 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E2721065679;
	Thu,  3 Mar 2011 19:55:16 +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 2A3E48FC17;
	Thu,  3 Mar 2011 19:55: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 p23JtGPW067828;
	Thu, 3 Mar 2011 19:55:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JtGqR067826;
	Thu, 3 Mar 2011 19:55:16 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031955.p23JtGqR067826@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:55:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219246 - stable/8/usr.bin/truss
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:55:16 -0000

Author: jhb
Date: Thu Mar  3 19:55:15 2011
New Revision: 219246
URL: http://svn.freebsd.org/changeset/base/219246

Log:
  MFC 218707: Properly check for errors from waitpid().

Modified:
  stable/8/usr.bin/truss/setup.c
Directory Properties:
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/usr.bin/truss/setup.c
==============================================================================
--- stable/8/usr.bin/truss/setup.c	Thu Mar  3 18:52:11 2011	(r219245)
+++ stable/8/usr.bin/truss/setup.c	Thu Mar  3 19:55:15 2011	(r219246)
@@ -83,7 +83,7 @@ setup_and_wait(char *command[])
 	}
 	
 	/* Only in the parent here */
-	if (waitpid(pid, &waitval, 0) < -1) {
+	if (waitpid(pid, &waitval, 0) < 0) {
 		err(1, "unexpect stop in waitpid");
 		return 0;
 	}
@@ -114,7 +114,7 @@ start_tracing(int pid)
 		err(1, "can not attach to target process");
 
 	child_pid = pid;	
-	if (waitpid(pid, &waitval, 0) < -1) 
+	if (waitpid(pid, &waitval, 0) < 0) 
 		err(1, "Unexpect stop in waitpid");
 
 	return (0);
@@ -133,7 +133,7 @@ restore_proc(int signo __unused)
 
 	/* stop the child so that we can detach */	
 	kill(child_pid, SIGSTOP);
-	if (waitpid(child_pid, &waitval, 0) < -1)
+	if (waitpid(child_pid, &waitval, 0) < 0)
 		err(1, "Unexpected stop in waitpid");
 
 	if (ptrace(PT_DETACH, child_pid, (caddr_t)1, 0) < 0)
@@ -183,7 +183,7 @@ waitevent(struct trussinfo *info)
 	ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal);
 	pending_signal = 0;
 
-	if (waitpid(info->pid, &waitval, 0) < -1) {
+	if (waitpid(info->pid, &waitval, 0) < 0) {
 		err(1, "Unexpected stop in waitpid");
 	}
 	

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 19:55:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DD7C1065767;
	Thu,  3 Mar 2011 19:55:23 +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 33DDD8FC19;
	Thu,  3 Mar 2011 19:55: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 p23JtNjB067896;
	Thu, 3 Mar 2011 19:55:23 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JtNCW067894;
	Thu, 3 Mar 2011 19:55:23 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031955.p23JtNCW067894@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:55:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219247 - stable/7/usr.bin/truss
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:55:25 -0000

Author: jhb
Date: Thu Mar  3 19:55:22 2011
New Revision: 219247
URL: http://svn.freebsd.org/changeset/base/219247

Log:
  MFC 218707: Properly check for errors from waitpid().

Modified:
  stable/7/usr.bin/truss/setup.c
Directory Properties:
  stable/7/usr.bin/truss/   (props changed)

Modified: stable/7/usr.bin/truss/setup.c
==============================================================================
--- stable/7/usr.bin/truss/setup.c	Thu Mar  3 19:55:15 2011	(r219246)
+++ stable/7/usr.bin/truss/setup.c	Thu Mar  3 19:55:22 2011	(r219247)
@@ -83,7 +83,7 @@ setup_and_wait(char *command[])
 	}
 	
 	/* Only in the parent here */
-	if (waitpid(pid, &waitval, 0) < -1) {
+	if (waitpid(pid, &waitval, 0) < 0) {
 		err(1, "unexpect stop in waitpid");
 		return 0;
 	}
@@ -114,7 +114,7 @@ start_tracing(int pid)
 		err(1, "can not attach to target process");
 
 	child_pid = pid;	
-	if (waitpid(pid, &waitval, 0) < -1) 
+	if (waitpid(pid, &waitval, 0) < 0) 
 		err(1, "Unexpect stop in waitpid");
 
 	return (0);
@@ -133,7 +133,7 @@ restore_proc(int signo __unused)
 
 	/* stop the child so that we can detach */	
 	kill(child_pid, SIGSTOP);
-	if (waitpid(child_pid, &waitval, 0) < -1)
+	if (waitpid(child_pid, &waitval, 0) < 0)
 		err(1, "Unexpected stop in waitpid");
 
 	if (ptrace(PT_DETACH, child_pid, (caddr_t)1, 0) < 0)
@@ -183,7 +183,7 @@ waitevent(struct trussinfo *info)
 	ptrace(PT_SYSCALL, info->pid, (caddr_t)1, pending_signal);
 	pending_signal = 0;
 
-	if (waitpid(info->pid, &waitval, 0) < -1) {
+	if (waitpid(info->pid, &waitval, 0) < 0) {
 		err(1, "Unexpected stop in waitpid");
 	}
 	

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 19:57:39 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 235A1106564A;
	Thu,  3 Mar 2011 19:57:39 +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 EC9858FC14;
	Thu,  3 Mar 2011 19:57: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 p23Jvcfg068363;
	Thu, 3 Mar 2011 19:57:38 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Jvct3068361;
	Thu, 3 Mar 2011 19:57:38 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031957.p23Jvct3068361@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:57:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219248 - stable/8/usr.sbin/nfsd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:57:39 -0000

Author: jhb
Date: Thu Mar  3 19:57:38 2011
New Revision: 219248
URL: http://svn.freebsd.org/changeset/base/219248

Log:
  MFC 218777:
  Save a copy of errno before invoking syslog() if accept() or select() fail.
  syslog() can trash the errno value causing nfsd to exit for non-fatal
  errors like ECONNABORTED from accept().

Modified:
  stable/8/usr.sbin/nfsd/nfsd.c
Directory Properties:
  stable/8/usr.sbin/nfsd/   (props changed)

Modified: stable/8/usr.sbin/nfsd/nfsd.c
==============================================================================
--- stable/8/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:55:22 2011	(r219247)
+++ stable/8/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:38 2011	(r219248)
@@ -134,7 +134,7 @@ main(int argc, char **argv)
 	socklen_t len;
 	int on = 1, unregister, reregister, sock;
 	int tcp6sock, ip6flag, tcpflag, tcpsock;
-	int udpflag, ecode, s, srvcnt;
+	int udpflag, ecode, error, s, srvcnt;
 	int bindhostc, bindanyflag, rpcbreg, rpcbregcnt;
 	int stablefd, nfssvc_addsock;
 	char **bindhost = NULL;
@@ -738,8 +738,9 @@ main(int argc, char **argv)
 		if (connect_type_cnt > 1) {
 			if (select(maxsock + 1,
 			    &ready, NULL, NULL, NULL) < 1) {
+				error = errno;
 				syslog(LOG_ERR, "select failed: %m");
-				if (errno == EINTR)
+				if (error == EINTR)
 					continue;
 				nfsd_exit(1);
 			}
@@ -750,9 +751,10 @@ main(int argc, char **argv)
 					len = sizeof(inetpeer);
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inetpeer, &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR, "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}
@@ -772,10 +774,11 @@ main(int argc, char **argv)
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inet6peer,
 					    &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR,
 						     "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 19:57:50 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 632AC1065781;
	Thu,  3 Mar 2011 19:57:50 +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 381468FC18;
	Thu,  3 Mar 2011 19:57: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 p23Jvovm068425;
	Thu, 3 Mar 2011 19:57:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23JvonL068423;
	Thu, 3 Mar 2011 19:57:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103031957.p23JvonL068423@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 19:57:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219249 - stable/7/usr.sbin/nfsd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 19:57:50 -0000

Author: jhb
Date: Thu Mar  3 19:57:49 2011
New Revision: 219249
URL: http://svn.freebsd.org/changeset/base/219249

Log:
  MFC 218777:
  Save a copy of errno before invoking syslog() if accept() or select() fail.
  syslog() can trash the errno value causing nfsd to exit for non-fatal
  errors like ECONNABORTED from accept().

Modified:
  stable/7/usr.sbin/nfsd/nfsd.c
Directory Properties:
  stable/7/usr.sbin/nfsd/   (props changed)

Modified: stable/7/usr.sbin/nfsd/nfsd.c
==============================================================================
--- stable/7/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:38 2011	(r219248)
+++ stable/7/usr.sbin/nfsd/nfsd.c	Thu Mar  3 19:57:49 2011	(r219249)
@@ -128,7 +128,7 @@ main(int argc, char **argv)
 	socklen_t len;
 	int on = 1, unregister, reregister, sock;
 	int tcp6sock, ip6flag, tcpflag, tcpsock;
-	int udpflag, ecode, s, srvcnt;
+	int udpflag, ecode, error, s, srvcnt;
 	int bindhostc, bindanyflag, rpcbreg, rpcbregcnt;
 	char **bindhost = NULL;
 	pid_t pid;
@@ -652,8 +652,9 @@ main(int argc, char **argv)
 		if (connect_type_cnt > 1) {
 			if (select(maxsock + 1,
 			    &ready, NULL, NULL, NULL) < 1) {
+				error = errno;
 				syslog(LOG_ERR, "select failed: %m");
-				if (errno == EINTR)
+				if (error == EINTR)
 					continue;
 				nfsd_exit(1);
 			}
@@ -664,9 +665,10 @@ main(int argc, char **argv)
 					len = sizeof(inetpeer);
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inetpeer, &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR, "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}
@@ -686,10 +688,11 @@ main(int argc, char **argv)
 					if ((msgsock = accept(tcpsock,
 					    (struct sockaddr *)&inet6peer,
 					    &len)) < 0) {
+						error = errno;
 						syslog(LOG_ERR,
 						     "accept failed: %m");
-						if (errno == ECONNABORTED ||
-						    errno == EINTR)
+						if (error == ECONNABORTED ||
+						    error == EINTR)
 							continue;
 						nfsd_exit(1);
 					}

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 20:04:02 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 20:13:44 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B3C21065670;
	Thu,  3 Mar 2011 20:13:44 +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 494EB8FC13;
	Thu,  3 Mar 2011 20:13: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 p23KDicH070277;
	Thu, 3 Mar 2011 20:13:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23KDiHU070275;
	Thu, 3 Mar 2011 20:13:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032013.p23KDiHU070275@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 20:13:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219250 - stable/8/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:13:44 -0000

Author: jhb
Date: Thu Mar  3 20:13:44 2011
New Revision: 219250
URL: http://svn.freebsd.org/changeset/base/219250

Log:
  MFC 218968:
  Properly handle BARs bigger than 4G.  The '1' was treated as an int
  causing the size calculation to be truncated to the size of an int
  (32-bits on all current architectures).

Modified:
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==============================================================================
--- stable/8/sys/dev/pci/pci.c	Thu Mar  3 19:57:49 2011	(r219249)
+++ stable/8/sys/dev/pci/pci.c	Thu Mar  3 20:13:44 2011	(r219250)
@@ -2499,13 +2499,13 @@ pci_add_map(device_t bus, device_t dev, 
 			return (barlen);
 	}
 
-	count = 1 << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (basezero || base == pci_mapbase(testval)) {
 		start = 0;	/* Let the parent decide. */
 		end = ~0ULL;
 	} else {
 		start = base;
-		end = base + (1 << mapsize) - 1;
+		end = base + count - 1;
 	}
 	resource_list_add(rl, type, reg, start, end, count);
 
@@ -3680,7 +3680,7 @@ pci_alloc_map(device_t dev, device_t chi
 	 * another driver, which won't work.
 	 */
 	mapsize = pci_mapsize(testval);
-	count = 1UL << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
 	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 20:14:00 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD62A10656D8;
	Thu,  3 Mar 2011 20:14:00 +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 A6F818FC12;
	Thu,  3 Mar 2011 20:14: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 p23KE0ui070339;
	Thu, 3 Mar 2011 20:14:00 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23KE0P7070337;
	Thu, 3 Mar 2011 20:14:00 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032014.p23KE0P7070337@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 20:14:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219251 - stable/7/sys/dev/pci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 20:14:00 -0000

Author: jhb
Date: Thu Mar  3 20:14:00 2011
New Revision: 219251
URL: http://svn.freebsd.org/changeset/base/219251

Log:
  MFC 218968:
  Properly handle BARs bigger than 4G.  The '1' was treated as an int
  causing the size calculation to be truncated to the size of an int
  (32-bits on all current architectures).

Modified:
  stable/7/sys/dev/pci/pci.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c	Thu Mar  3 20:13:44 2011	(r219250)
+++ stable/7/sys/dev/pci/pci.c	Thu Mar  3 20:14:00 2011	(r219251)
@@ -2469,13 +2469,13 @@ pci_add_map(device_t bus, device_t dev, 
 			return (barlen);
 	}
 
-	count = 1 << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (basezero || base == pci_mapbase(testval)) {
 		start = 0;	/* Let the parent decide. */
 		end = ~0ULL;
 	} else {
 		start = base;
-		end = base + (1 << mapsize) - 1;
+		end = base + count - 1;
 	}
 	resource_list_add(rl, type, reg, start, end, count);
 
@@ -3524,7 +3524,7 @@ pci_alloc_map(device_t dev, device_t chi
 	 * another driver, which won't work.
 	 */
 	mapsize = pci_mapsize(testval);
-	count = 1UL << mapsize;
+	count = (pci_addr_t)1 << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
 	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 20:42:00 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 21:32:41 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 21:42:12 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 21:52:59 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 21:56:08 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 947161065672;
	Thu,  3 Mar 2011 21:56:08 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 688308FC0C;
	Thu,  3 Mar 2011 21:56: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 p23Lu83L080938;
	Thu, 3 Mar 2011 21:56:08 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23Lu8WC080935;
	Thu, 3 Mar 2011 21:56:08 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201103032156.p23Lu8WC080935@svn.freebsd.org>
From: Martin Matuska 
Date: Thu, 3 Mar 2011 21:56:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219253 - in stable/8/cddl/contrib/opensolaris/cmd:
	zpool ztest
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 21:56:08 -0000

Author: mm
Date: Thu Mar  3 21:56:08 2011
New Revision: 219253
URL: http://svn.freebsd.org/changeset/base/219253

Log:
  MFC r212067, r214623
  
  MFC r212067 (pjd):
  Eliminate confusing while () loop. In the first version of the code it was
  there to avoid gotos, but in the current version it serves no purpose.
  
  MFC r214623 (pjd):
  Fix ztest when it is executed by just 'ztest' and not by full path
  '/usr/bin/ztest'.

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Thu Mar  3 20:41:59 2011	(r219252)
+++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Thu Mar  3 21:56:08 2011	(r219253)
@@ -3347,20 +3347,19 @@ is_root_pool(zpool_handle_t *zhp)
 	static boolean_t stated = B_FALSE;
 	char *slash;
 
-	while (!stated) {
+	if (!stated) {
 		stated = B_TRUE;
 		if (statfs("/", &sfs) == -1) {
 			(void) fprintf(stderr,
 			    "Unable to stat root file system: %s.\n",
 			    strerror(errno));
-			break;
+			return (0);
 		}
 		if (strcmp(sfs.f_fstypename, "zfs") != 0)
-			break;
+			return (0);
 		poolname = sfs.f_mntfromname;
 		if ((slash = strchr(poolname, '/')) != NULL)
 			*slash = '\0';
-		break;
 	}
 	return (poolname != NULL && strcmp(poolname, zpool_get_name(zhp)) == 0);
 }

Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu Mar  3 20:41:59 2011	(r219252)
+++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Thu Mar  3 21:56:08 2011	(r219253)
@@ -3362,8 +3362,7 @@ ztest_verify_blocks(char *pool)
 	int isalen;
 	FILE *fp;
 
-	if (realpath(progname, zdb) == NULL)
-		assert(!"realpath() failed");
+	strlcpy(zdb, "/usr/bin/ztest", sizeof(zdb));
 
 	/* zdb lives in /usr/sbin, while ztest lives in /usr/bin */
 	bin = strstr(zdb, "/usr/bin/");

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 22:08:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C44D11065673;
	Thu,  3 Mar 2011 22:08:51 +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 A7DFC8FC16;
	Thu,  3 Mar 2011 22:08: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 p23M8puI082133;
	Thu, 3 Mar 2011 22:08:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23M8pxM082130;
	Thu, 3 Mar 2011 22:08:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032208.p23M8pxM082130@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 22:08:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219254 - in stable/8/sys: kern sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:08:51 -0000

Author: jhb
Date: Thu Mar  3 22:08:51 2011
New Revision: 219254
URL: http://svn.freebsd.org/changeset/base/219254

Log:
  MFC 218969:
  Expose the umtx_key structure and API to the rest of the kernel.

Modified:
  stable/8/sys/kern/kern_umtx.c
  stable/8/sys/sys/umtx.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/kern_umtx.c
==============================================================================
--- stable/8/sys/kern/kern_umtx.c	Thu Mar  3 21:56:08 2011	(r219253)
+++ stable/8/sys/kern/kern_umtx.c	Thu Mar  3 22:08:51 2011	(r219254)
@@ -58,38 +58,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#define TYPE_SIMPLE_WAIT	0
-#define TYPE_CV			1
-#define TYPE_SIMPLE_LOCK	2
-#define TYPE_NORMAL_UMUTEX	3
-#define TYPE_PI_UMUTEX		4
-#define TYPE_PP_UMUTEX		5
-#define TYPE_RWLOCK		6
-
 #define _UMUTEX_TRY		1
 #define _UMUTEX_WAIT		2
 
-/* Key to represent a unique userland synchronous object */
-struct umtx_key {
-	int	hash;
-	int	type;
-	int	shared;
-	union {
-		struct {
-			vm_object_t	object;
-			uintptr_t	offset;
-		} shared;
-		struct {
-			struct vmspace	*vs;
-			uintptr_t	addr;
-		} private;
-		struct {
-			void		*a;
-			uintptr_t	b;
-		} both;
-	} info;
-};
-
 /* Priority inheritance mutex info. */
 struct umtx_pi {
 	/* Owner thread */
@@ -185,10 +156,6 @@ struct umtxq_chain {
 #define	UMTX_CHAINS		128
 #define	UMTX_SHIFTS		(__WORD_BIT - 7)
 
-#define THREAD_SHARE		0
-#define PROCESS_SHARE		1
-#define AUTO_SHARE		2
-
 #define	GET_SHARE(flags)	\
     (((flags) & USYNC_PROCESS_SHARED) == 0 ? THREAD_SHARE : PROCESS_SHARE)
 
@@ -214,10 +181,6 @@ static void umtxq_insert_queue(struct um
 static void umtxq_remove_queue(struct umtx_q *uq, int q);
 static int umtxq_sleep(struct umtx_q *uq, const char *wmesg, int timo);
 static int umtxq_count(struct umtx_key *key);
-static int umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2);
-static int umtx_key_get(void *addr, int type, int share,
-	struct umtx_key *key);
-static void umtx_key_release(struct umtx_key *key);
 static struct umtx_pi *umtx_pi_alloc(int);
 static void umtx_pi_free(struct umtx_pi *pi);
 static void umtx_pi_adjust_locked(struct thread *td, u_char oldpri);
@@ -280,14 +243,6 @@ umtxq_hash(struct umtx_key *key)
 	key->hash = ((n * GOLDEN_RATIO_PRIME) >> UMTX_SHIFTS) % UMTX_CHAINS;
 }
 
-static inline int
-umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
-{
-	return (k1->type == k2->type &&
-		k1->info.both.a == k2->info.both.a &&
-	        k1->info.both.b == k2->info.both.b);
-}
-
 static inline struct umtxq_chain *
 umtxq_getchain(struct umtx_key *key)
 {
@@ -500,7 +455,7 @@ umtxq_sleep(struct umtx_q *uq, const cha
 /*
  * Convert userspace address into unique logical address.
  */
-static int
+int
 umtx_key_get(void *addr, int type, int share, struct umtx_key *key)
 {
 	struct thread *td = curthread;
@@ -546,7 +501,7 @@ umtx_key_get(void *addr, int type, int s
 /*
  * Release key.
  */
-static inline void
+void
 umtx_key_release(struct umtx_key *key)
 {
 	if (key->shared)

Modified: stable/8/sys/sys/umtx.h
==============================================================================
--- stable/8/sys/sys/umtx.h	Thu Mar  3 21:56:08 2011	(r219253)
+++ stable/8/sys/sys/umtx.h	Thu Mar  3 22:08:51 2011	(r219254)
@@ -190,8 +190,58 @@ umtx_wake(u_long *p, int nr_wakeup)
 
 #else
 
+/*
+ * The umtx_key structure is used by both the Linux futex code and the
+ * umtx implementation to map userland addresses to unique keys.
+ */
+
+enum {
+	TYPE_SIMPLE_WAIT,
+	TYPE_CV,
+	TYPE_SIMPLE_LOCK,
+	TYPE_NORMAL_UMUTEX,
+	TYPE_PI_UMUTEX,
+	TYPE_PP_UMUTEX,
+	TYPE_RWLOCK,
+};
+
+/* Key to represent a unique userland synchronous object */
+struct umtx_key {
+	int	hash;
+	int	type;
+	int	shared;
+	union {
+		struct {
+			struct vm_object *object;
+			uintptr_t	offset;
+		} shared;
+		struct {
+			struct vmspace	*vs;
+			uintptr_t	addr;
+		} private;
+		struct {
+			void		*a;
+			uintptr_t	b;
+		} both;
+	} info;
+};
+
+#define THREAD_SHARE		0
+#define PROCESS_SHARE		1
+#define AUTO_SHARE		2
+
 struct thread;
 
+static inline int
+umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
+{
+	return (k1->type == k2->type &&
+		k1->info.both.a == k2->info.both.a &&
+	        k1->info.both.b == k2->info.both.b);
+}
+
+int umtx_key_get(void *, int, int, struct umtx_key *);
+void umtx_key_release(struct umtx_key *);
 struct umtx_q *umtxq_alloc(void);
 void umtxq_free(struct umtx_q *);
 int kern_umtx_wake(struct thread *, void *, int, int);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 22:09:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81B771065694;
	Thu,  3 Mar 2011 22:09:10 +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 6F4018FC1A;
	Thu,  3 Mar 2011 22:09: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 p23M9Abi082193;
	Thu, 3 Mar 2011 22:09:10 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p23M9Amr082190;
	Thu, 3 Mar 2011 22:09:10 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201103032209.p23M9Amr082190@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 3 Mar 2011 22:09:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219255 - in stable/7/sys: kern sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 03 Mar 2011 22:09:10 -0000

Author: jhb
Date: Thu Mar  3 22:09:10 2011
New Revision: 219255
URL: http://svn.freebsd.org/changeset/base/219255

Log:
  MFC 218969:
  Expose the umtx_key structure and API to the rest of the kernel.

Modified:
  stable/7/sys/kern/kern_umtx.c
  stable/7/sys/sys/umtx.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/kern_umtx.c
==============================================================================
--- stable/7/sys/kern/kern_umtx.c	Thu Mar  3 22:08:51 2011	(r219254)
+++ stable/7/sys/kern/kern_umtx.c	Thu Mar  3 22:09:10 2011	(r219255)
@@ -58,38 +58,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#define TYPE_SIMPLE_WAIT	0
-#define TYPE_CV			1
-#define TYPE_SIMPLE_LOCK	2
-#define TYPE_NORMAL_UMUTEX	3
-#define TYPE_PI_UMUTEX		4
-#define TYPE_PP_UMUTEX		5
-#define TYPE_RWLOCK		6
-
 #define _UMUTEX_TRY		1
 #define _UMUTEX_WAIT		2
 
-/* Key to represent a unique userland synchronous object */
-struct umtx_key {
-	int	hash;
-	int	type;
-	int	shared;
-	union {
-		struct {
-			vm_object_t	object;
-			uintptr_t	offset;
-		} shared;
-		struct {
-			struct vmspace	*vs;
-			uintptr_t	addr;
-		} private;
-		struct {
-			void		*a;
-			uintptr_t	b;
-		} both;
-	} info;
-};
-
 /* Priority inheritance mutex info. */
 struct umtx_pi {
 	/* Owner thread */
@@ -185,10 +156,6 @@ struct umtxq_chain {
 #define	UMTX_CHAINS		128
 #define	UMTX_SHIFTS		(__WORD_BIT - 7)
 
-#define THREAD_SHARE		0
-#define PROCESS_SHARE		1
-#define AUTO_SHARE		2
-
 #define	GET_SHARE(flags)	\
     (((flags) & USYNC_PROCESS_SHARED) == 0 ? THREAD_SHARE : PROCESS_SHARE)
 
@@ -214,10 +181,6 @@ static void umtxq_insert_queue(struct um
 static void umtxq_remove_queue(struct umtx_q *uq, int q);
 static int umtxq_sleep(struct umtx_q *uq, const char *wmesg, int timo);
 static int umtxq_count(struct umtx_key *key);
-static int umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2);
-static int umtx_key_get(void *addr, int type, int share,
-	struct umtx_key *key);
-static void umtx_key_release(struct umtx_key *key);
 static struct umtx_pi *umtx_pi_alloc(int);
 static void umtx_pi_free(struct umtx_pi *pi);
 static void umtx_pi_adjust_locked(struct thread *td, u_char oldpri);
@@ -280,14 +243,6 @@ umtxq_hash(struct umtx_key *key)
 	key->hash = ((n * GOLDEN_RATIO_PRIME) >> UMTX_SHIFTS) % UMTX_CHAINS;
 }
 
-static inline int
-umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
-{
-	return (k1->type == k2->type &&
-		k1->info.both.a == k2->info.both.a &&
-	        k1->info.both.b == k2->info.both.b);
-}
-
 static inline struct umtxq_chain *
 umtxq_getchain(struct umtx_key *key)
 {
@@ -500,7 +455,7 @@ umtxq_sleep(struct umtx_q *uq, const cha
 /*
  * Convert userspace address into unique logical address.
  */
-static int
+int
 umtx_key_get(void *addr, int type, int share, struct umtx_key *key)
 {
 	struct thread *td = curthread;
@@ -546,7 +501,7 @@ umtx_key_get(void *addr, int type, int s
 /*
  * Release key.
  */
-static inline void
+void
 umtx_key_release(struct umtx_key *key)
 {
 	if (key->shared)

Modified: stable/7/sys/sys/umtx.h
==============================================================================
--- stable/7/sys/sys/umtx.h	Thu Mar  3 22:08:51 2011	(r219254)
+++ stable/7/sys/sys/umtx.h	Thu Mar  3 22:09:10 2011	(r219255)
@@ -190,8 +190,58 @@ umtx_wake(u_long *p, int nr_wakeup)
 
 #else
 
+/*
+ * The umtx_key structure is used by both the Linux futex code and the
+ * umtx implementation to map userland addresses to unique keys.
+ */
+
+enum {
+	TYPE_SIMPLE_WAIT,
+	TYPE_CV,
+	TYPE_SIMPLE_LOCK,
+	TYPE_NORMAL_UMUTEX,
+	TYPE_PI_UMUTEX,
+	TYPE_PP_UMUTEX,
+	TYPE_RWLOCK,
+};
+
+/* Key to represent a unique userland synchronous object */
+struct umtx_key {
+	int	hash;
+	int	type;
+	int	shared;
+	union {
+		struct {
+			struct vm_object *object;
+			uintptr_t	offset;
+		} shared;
+		struct {
+			struct vmspace	*vs;
+			uintptr_t	addr;
+		} private;
+		struct {
+			void		*a;
+			uintptr_t	b;
+		} both;
+	} info;
+};
+
+#define THREAD_SHARE		0
+#define PROCESS_SHARE		1
+#define AUTO_SHARE		2
+
 struct thread;
 
+static inline int
+umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
+{
+	return (k1->type == k2->type &&
+		k1->info.both.a == k2->info.both.a &&
+	        k1->info.both.b == k2->info.both.b);
+}
+
+int umtx_key_get(void *, int, int, struct umtx_key *);
+void umtx_key_release(struct umtx_key *);
 struct umtx_q *umtxq_alloc(void);
 void umtxq_free(struct umtx_q *);
 int kern_umtx_wake(struct thread *, void *, int, int);

From owner-svn-src-all@FreeBSD.ORG  Thu Mar  3 22:32:32 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Thu Mar  3 22:34:13 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 07:01:46 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 08:41:59 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 09:03:55 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 12:18:51 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3F73E1065676;
	Fri,  4 Mar 2011 12:18:51 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2DBE38FC20;
	Fri,  4 Mar 2011 12:18: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 p24CIpaJ031213;
	Fri, 4 Mar 2011 12:18:51 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24CIpJ3031212;
	Fri, 4 Mar 2011 12:18:51 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103041218.p24CIpJ3031212@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 4 Mar 2011 12:18:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219263 - stable/8/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 12:18:51 -0000

Author: pluknet
Date: Fri Mar  4 12:18:50 2011
New Revision: 219263
URL: http://svn.freebsd.org/changeset/base/219263

Log:
  MFC r219031:
  
   Fix division by zero, causing floating point exception in a drive progress
   command.
  
  Approved by:	avg (mentor), kib (mentor)

Modified:
  stable/8/usr.sbin/mfiutil/mfi_cmd.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c
==============================================================================
--- stable/8/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:02:32 2011	(r219262)
+++ stable/8/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:18:50 2011	(r219263)
@@ -316,7 +316,7 @@ mfi_display_progress(const char *label, 
 
 	printf("%s: %.2f%% complete, after %ds", label,
 	    (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds);
-	if (prog->elapsed_seconds > 10) {
+	if (prog->progress != 0 && prog->elapsed_seconds > 10) {
 		printf(" finished in ");
 		seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) /
 		    prog->progress - prog->elapsed_seconds;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 12:20:14 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A4BC106564A;
	Fri,  4 Mar 2011 12:20:14 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 888508FC17;
	Fri,  4 Mar 2011 12:20: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 p24CKExW031303;
	Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24CKEM6031301;
	Fri, 4 Mar 2011 12:20:14 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201103041220.p24CKEM6031301@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 4 Mar 2011 12:20:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219264 - stable/7/usr.sbin/mfiutil
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 12:20:14 -0000

Author: pluknet
Date: Fri Mar  4 12:20:14 2011
New Revision: 219264
URL: http://svn.freebsd.org/changeset/base/219264

Log:
  MFC r219031:
  
   Fix division by zero, causing floating point exception in a drive progress
   command.
  
  Approved by:	avg (mentor), kib (mentor)

Modified:
  stable/7/usr.sbin/mfiutil/mfi_cmd.c
Directory Properties:
  stable/7/usr.sbin/mfiutil/   (props changed)

Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c
==============================================================================
--- stable/7/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:18:50 2011	(r219263)
+++ stable/7/usr.sbin/mfiutil/mfi_cmd.c	Fri Mar  4 12:20:14 2011	(r219264)
@@ -316,7 +316,7 @@ mfi_display_progress(const char *label, 
 
 	printf("%s: %.2f%% complete, after %ds", label,
 	    (float)prog->progress * 100 / 0xffff, prog->elapsed_seconds);
-	if (prog->elapsed_seconds > 10) {
+	if (prog->progress != 0 && prog->elapsed_seconds > 10) {
 		printf(" finished in ");
 		seconds = (0x10000 * (uint32_t)prog->elapsed_seconds) /
 		    prog->progress - prog->elapsed_seconds;

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 17:07:03 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 17:10:39 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 17:23:10 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 18:37:26 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 18:46:20 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 19:28:28 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 19:53:08 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 20:26:35 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EECE71065672;
	Fri,  4 Mar 2011 20:26:35 +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 C35AC8FC17;
	Fri,  4 Mar 2011 20:26: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 p24KQZSN053076;
	Fri, 4 Mar 2011 20:26:35 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24KQZEL053073;
	Fri, 4 Mar 2011 20:26:35 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103042026.p24KQZEL053073@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 4 Mar 2011 20:26:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219273 - stable/8/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 20:26:36 -0000

Author: brucec
Date: Fri Mar  4 20:26:35 2011
New Revision: 219273
URL: http://svn.freebsd.org/changeset/base/219273

Log:
  MFC r218966, r219124:
  
  Change the return type of vmspace_swap_count to a long to match the other
  vmspace_*_count functions.
  
  While here, clean up some style(9) issues.
  
  PR:	kern/152200

Modified:
  stable/8/sys/vm/swap_pager.c
  stable/8/sys/vm/vm_map.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/vm/swap_pager.c
==============================================================================
--- stable/8/sys/vm/swap_pager.c	Fri Mar  4 19:53:07 2011	(r219272)
+++ stable/8/sys/vm/swap_pager.c	Fri Mar  4 20:26:35 2011	(r219273)
@@ -2408,23 +2408,24 @@ 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.
  */
-int
+long
 vmspace_swap_count(struct vmspace *vmspace)
 {
-	vm_map_t map = &vmspace->vm_map;
+	vm_map_t map;
 	vm_map_entry_t cur;
-	int count = 0;
+	vm_object_t object;
+	long count, n;
 
-	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
-		vm_object_t object;
+	map = &vmspace->vm_map;
+	count = 0;
 
+	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
 		if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 &&
 		    (object = cur->object.vm_object) != NULL) {
 			VM_OBJECT_LOCK(object);
 			if (object->type == OBJT_SWAP &&
 			    object->un_pager.swp.swp_bcount != 0) {
-				int n = (cur->end - cur->start) / PAGE_SIZE;
-
+				n = (cur->end - cur->start) / PAGE_SIZE;
 				count += object->un_pager.swp.swp_bcount *
 				    SWAP_META_PAGES * n / object->size + 1;
 			}

Modified: stable/8/sys/vm/vm_map.h
==============================================================================
--- stable/8/sys/vm/vm_map.h	Fri Mar  4 19:53:07 2011	(r219272)
+++ stable/8/sys/vm/vm_map.h	Fri Mar  4 20:26:35 2011	(r219273)
@@ -382,6 +382,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);
-int vmspace_swap_count (struct vmspace *vmspace);
+long vmspace_swap_count(struct vmspace *vmspace);
 #endif				/* _KERNEL */
 #endif				/* _VM_MAP_ */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 20:30:18 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D05D7106566C;
	Fri,  4 Mar 2011 20:30:18 +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 A50928FC08;
	Fri,  4 Mar 2011 20:30: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 p24KUI5V053312;
	Fri, 4 Mar 2011 20:30:18 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24KUIrA053309;
	Fri, 4 Mar 2011 20:30:18 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103042030.p24KUIrA053309@svn.freebsd.org>
From: Bruce Cran 
Date: Fri, 4 Mar 2011 20:30:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219274 - stable/7/sys/vm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 20:30:18 -0000

Author: brucec
Date: Fri Mar  4 20:30:18 2011
New Revision: 219274
URL: http://svn.freebsd.org/changeset/base/219274

Log:
  MFC r218966, r219124:
  
  Change the return type of vmspace_swap_count to a long to match the other
  vmspace_*_count functions.
  
  While here, clean up some style(9) issues.
  
  PR:   kern/152200

Modified:
  stable/7/sys/vm/swap_pager.c
  stable/7/sys/vm/vm_map.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/vm/swap_pager.c
==============================================================================
--- stable/7/sys/vm/swap_pager.c	Fri Mar  4 20:26:35 2011	(r219273)
+++ stable/7/sys/vm/swap_pager.c	Fri Mar  4 20:30:18 2011	(r219274)
@@ -2266,23 +2266,24 @@ 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.
  */
-int
+long
 vmspace_swap_count(struct vmspace *vmspace)
 {
-	vm_map_t map = &vmspace->vm_map;
+	vm_map_t map;
 	vm_map_entry_t cur;
-	int count = 0;
+	vm_object_t object;
+	long count, n;
 
-	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
-		vm_object_t object;
+	map = &vmspace->vm_map;
+	count = 0;
 
+	for (cur = map->header.next; cur != &map->header; cur = cur->next) {
 		if ((cur->eflags & MAP_ENTRY_IS_SUB_MAP) == 0 &&
 		    (object = cur->object.vm_object) != NULL) {
 			VM_OBJECT_LOCK(object);
 			if (object->type == OBJT_SWAP &&
 			    object->un_pager.swp.swp_bcount != 0) {
-				int n = (cur->end - cur->start) / PAGE_SIZE;
-
+				n = (cur->end - cur->start) / PAGE_SIZE;
 				count += object->un_pager.swp.swp_bcount *
 				    SWAP_META_PAGES * n / object->size + 1;
 			}

Modified: stable/7/sys/vm/vm_map.h
==============================================================================
--- stable/7/sys/vm/vm_map.h	Fri Mar  4 20:26:35 2011	(r219273)
+++ stable/7/sys/vm/vm_map.h	Fri Mar  4 20:30:18 2011	(r219274)
@@ -376,6 +376,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);
-int vmspace_swap_count (struct vmspace *vmspace);
+long vmspace_swap_count(struct vmspace *vmspace);
 #endif				/* _KERNEL */
 #endif				/* _VM_MAP_ */

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 20:37:39 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 22:26:41 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Fri Mar  4 22:59:14 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59F431065670;
	Fri,  4 Mar 2011 22:59:14 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4839D8FC0C;
	Fri,  4 Mar 2011 22:59: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 p24MxEnB067107;
	Fri, 4 Mar 2011 22:59:14 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24MxERW067105;
	Fri, 4 Mar 2011 22:59:14 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042259.p24MxERW067105@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 22:59:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219277 - stable/8/sys/x86/cpufreq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 22:59:14 -0000

Author: jkim
Date: Fri Mar  4 22:59:14 2011
New Revision: 219277
URL: http://svn.freebsd.org/changeset/base/219277

Log:
  MFC:	r219046
  
  Set C1 "I/O then Halt" capability bit for Intel EIST.  Some broken BIOSes
  refuse to load external SSDTs if this bit is unset for _PDC.

Modified:
  stable/8/sys/x86/cpufreq/est.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/x86/cpufreq/est.c
==============================================================================
--- stable/8/sys/x86/cpufreq/est.c	Fri Mar  4 22:26:41 2011	(r219276)
+++ stable/8/sys/x86/cpufreq/est.c	Fri Mar  4 22:59:14 2011	(r219277)
@@ -945,8 +945,11 @@ static int
 est_features(driver_t *driver, u_int *features)
 {
 
-	/* Notify the ACPI CPU that we support direct access to MSRs */
-	*features = ACPI_CAP_PERF_MSRS;
+	/*
+	 * Notify the ACPI CPU that we support direct access to MSRs.
+	 * XXX C1 "I/O then Halt" seems necessary for some broken BIOS.
+	 */
+	*features = ACPI_CAP_PERF_MSRS | ACPI_CAP_C1_IO_HALT;
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 23:12:15 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 473C91065672;
	Fri,  4 Mar 2011 23:12:15 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1AB0C8FC17;
	Fri,  4 Mar 2011 23:12: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 p24NCFjX069058;
	Fri, 4 Mar 2011 23:12:15 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24NCEfE069056;
	Fri, 4 Mar 2011 23:12:14 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042312.p24NCEfE069056@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 23:12:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219278 - stable/7/sys/dev/acpica
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 23:12:15 -0000

Author: jkim
Date: Fri Mar  4 23:12:14 2011
New Revision: 219278
URL: http://svn.freebsd.org/changeset/base/219278

Log:
  MFC:	r218685, r218687
  
  Copy just enough data for the resource type.

Modified:
  stable/7/sys/dev/acpica/acpi_resource.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/acpica/acpi_resource.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_resource.c	Fri Mar  4 22:59:14 2011	(r219277)
+++ stable/7/sys/dev/acpica/acpi_resource.c	Fri Mar  4 23:12:14 2011	(r219278)
@@ -58,32 +58,35 @@ static ACPI_STATUS
 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
 {
     struct lookup_irq_request *req;
+    size_t len;
     u_int irqnum, irq;
 
     switch (res->Type) {
     case ACPI_RESOURCE_TYPE_IRQ:
+	irqnum = res->Data.Irq.InterruptCount;
+	irq = res->Data.Irq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ);
+	break;
     case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
-	if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
-	    irqnum = res->Data.Irq.InterruptCount;
-	    irq = res->Data.Irq.Interrupts[0];
-	} else {
-	    irqnum = res->Data.ExtendedIrq.InterruptCount;
-	    irq = res->Data.ExtendedIrq.Interrupts[0];
-	}
-	if (irqnum != 1)
-	    break;
-	req = (struct lookup_irq_request *)context;
-	if (req->counter != req->rid) {
-	    req->counter++;
-	    break;
-	}
-	req->found = 1;
-	KASSERT(irq == rman_get_start(req->res),
-	    ("IRQ resources do not match"));
-	bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
-	return (AE_CTRL_TERMINATE);
+	irqnum = res->Data.ExtendedIrq.InterruptCount;
+	irq = res->Data.ExtendedIrq.Interrupts[0];
+	len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ);
+	break;
+    default:
+	return (AE_OK);
+    }
+    if (irqnum != 1)
+	return (AE_OK);
+    req = (struct lookup_irq_request *)context;
+    if (req->counter != req->rid) {
+	req->counter++;
+	return (AE_OK);
     }
-    return (AE_OK);
+    req->found = 1;
+    KASSERT(irq == rman_get_start(req->res),
+	("IRQ resources do not match"));
+    bcopy(res, req->acpi_res, len);
+    return (AE_CTRL_TERMINATE);
 }
 
 ACPI_STATUS

From owner-svn-src-all@FreeBSD.ORG  Fri Mar  4 23:43:10 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC1CC106566C;
	Fri,  4 Mar 2011 23:43:10 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9A9C48FC1D;
	Fri,  4 Mar 2011 23:43: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 p24NhAqg072573;
	Fri, 4 Mar 2011 23:43:10 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p24NhAe9072571;
	Fri, 4 Mar 2011 23:43:10 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201103042343.p24NhAe9072571@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 4 Mar 2011 23:43:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219279 - stable/7/sys/i386/cpufreq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 04 Mar 2011 23:43:10 -0000

Author: jkim
Date: Fri Mar  4 23:43:10 2011
New Revision: 219279
URL: http://svn.freebsd.org/changeset/base/219279

Log:
  MFC:	r219046
  
  Set C1 "I/O then Halt" capability bit for Intel EIST.  Some broken BIOSes
  refuse to load external SSDTs if this bit is unset for _PDC.

Modified:
  stable/7/sys/i386/cpufreq/est.c

Modified: stable/7/sys/i386/cpufreq/est.c
==============================================================================
--- stable/7/sys/i386/cpufreq/est.c	Fri Mar  4 23:12:14 2011	(r219278)
+++ stable/7/sys/i386/cpufreq/est.c	Fri Mar  4 23:43:10 2011	(r219279)
@@ -942,8 +942,11 @@ static int
 est_features(driver_t *driver, u_int *features)
 {
 
-	/* Notify the ACPI CPU that we support direct access to MSRs */
-	*features = ACPI_CAP_PERF_MSRS;
+	/*
+	 * Notify the ACPI CPU that we support direct access to MSRs.
+	 * XXX C1 "I/O then Halt" seems necessary for some broken BIOS.
+	 */
+	*features = ACPI_CAP_PERF_MSRS | ACPI_CAP_C1_IO_HALT;
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 00:59:35 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 02:11:23 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BED91106564A;
	Sat,  5 Mar 2011 02:11:23 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A41178FC0A;
	Sat,  5 Mar 2011 02:11: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 p252BNGs089715;
	Sat, 5 Mar 2011 02:11:23 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p252BNFv089712;
	Sat, 5 Mar 2011 02:11:23 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050211.p252BNFv089712@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 02:11:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219283 - in stable/8/etc: periodic/daily rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 02:11:24 -0000

Author: dougb
Date: Sat Mar  5 02:11:23 2011
New Revision: 219283
URL: http://svn.freebsd.org/changeset/base/219283

Log:
  MFC r218961:
  
  Update how accounting log files are rotated, clean up the rc.d script
  a bit.
  
  MFC r218986:
  
  The new accounting file needs to be 644 so that unprivileged users
  can use lastcomm(1)

Modified:
  stable/8/etc/periodic/daily/310.accounting
  stable/8/etc/rc.d/accounting
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/periodic/daily/310.accounting
==============================================================================
--- stable/8/etc/periodic/daily/310.accounting	Sat Mar  5 00:59:34 2011	(r219282)
+++ stable/8/etc/periodic/daily/310.accounting	Sat Mar  5 02:11:23 2011	(r219283)
@@ -41,13 +41,16 @@ case "$daily_accounting_enable" in
 		m=$n
 		n=$(($n - 1))
 	    done
-	    cp -pf acct acct.0 || rc=3
-	    sa -s $daily_accounting_flags || rc=3
+
+	    /etc/rc.d/accounting rotate_log || rc=3
 
 	    case "$daily_accounting_compress" in
 		[Yy][Ee][Ss])
-		    gzip -f acct.0 || rc=3;;
+		    gzip --keep -f acct.0 || rc=3;;
 	    esac
+
+	    sa -s $daily_accounting_flags /var/account/acct.0 &&
+		unlink acct.0 || rc=3
 	fi;;
 
     *)  rc=0;;

Modified: stable/8/etc/rc.d/accounting
==============================================================================
--- stable/8/etc/rc.d/accounting	Sat Mar  5 00:59:34 2011	(r219282)
+++ stable/8/etc/rc.d/accounting	Sat Mar  5 02:11:23 2011	(r219283)
@@ -14,28 +14,31 @@ name="accounting"
 rcvar=`set_rcvar`
 accounting_command="/usr/sbin/accton"
 accounting_file="/var/account/acct"
+
+extra_commands="rotate_log"
+
 start_cmd="accounting_start"
 stop_cmd="accounting_stop"
+rotate_log_cmd="accounting_rotate_log"
 
 accounting_start()
 {
 	local _dir
 
-	_dir=`dirname "$accounting_file"`
-	if [ ! -d `dirname "$_dir"` ]; then
+	_dir="${accounting_file%/*}"
+	if [ ! -d "$_dir" ]; then
 		if ! mkdir -p "$_dir"; then
-			warn "Could not create $_dir."
-			return 1
+			err 1 "Could not create $_dir."
 		fi
 	fi
+
 	if [ ! -e "$accounting_file" ]; then
+		echo -n "Creating accounting file ${accounting_file}"
 		touch "$accounting_file"
+		echo '.'
 	fi
+	chmod 644 "$accounting_file"
 
-	if [ ! -f ${accounting_file} ]; then
-		echo "Creating accounting file ${accounting_file}"
-		( umask 022 ; > ${accounting_file} )
-	fi
 	echo "Turning on accounting."
 	${accounting_command} ${accounting_file}
 }
@@ -46,5 +49,27 @@ accounting_stop()
 	${accounting_command}
 }
 
+accounting_rotate_log()
+{
+	local _dir _file
+
+	_dir="${accounting_file%/*}"
+	cd $_dir
+
+	if checkyesno accounting_enable; then
+		_file=`mktemp newacct-XXXXX`
+		chmod 644 $_file
+		${accounting_command} ${_dir}/${_file}
+	fi
+
+	mv ${accounting_file} ${accounting_file}.0
+
+	if checkyesno accounting_enable; then
+		ln $_file ${accounting_file##*/}
+		${accounting_command} ${accounting_file}
+		unlink $_file
+	fi
+}
+
 load_rc_config $name
 run_rc_command "$1"

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 02:12:36 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B4141065673;
	Sat,  5 Mar 2011 02:12:36 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6062D8FC13;
	Sat,  5 Mar 2011 02:12: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 p252CaPP089916;
	Sat, 5 Mar 2011 02:12:36 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p252CakQ089913;
	Sat, 5 Mar 2011 02:12:36 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050212.p252CakQ089913@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 02:12:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219284 - in stable/7/etc: periodic/daily rc.d
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 02:12:36 -0000

Author: dougb
Date: Sat Mar  5 02:12:36 2011
New Revision: 219284
URL: http://svn.freebsd.org/changeset/base/219284

Log:
  MFC r218961:
  
  Update how accounting log files are rotated, clean up the rc.d script
  a bit.
  
  MFC r218986:
  
  The new accounting file needs to be 644 so that unprivileged users
  can use lastcomm(1)

Modified:
  stable/7/etc/periodic/daily/310.accounting
  stable/7/etc/rc.d/accounting
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/periodic/daily/310.accounting
==============================================================================
--- stable/7/etc/periodic/daily/310.accounting	Sat Mar  5 02:11:23 2011	(r219283)
+++ stable/7/etc/periodic/daily/310.accounting	Sat Mar  5 02:12:36 2011	(r219284)
@@ -41,13 +41,16 @@ case "$daily_accounting_enable" in
 		m=$n
 		n=$(($n - 1))
 	    done
-	    cp -pf acct acct.0 || rc=3
-	    sa -s $daily_accounting_flags || rc=3
+
+	    /etc/rc.d/accounting rotate_log || rc=3
 
 	    case "$daily_accounting_compress" in
 		[Yy][Ee][Ss])
-		    gzip -f acct.0 || rc=3;;
+		    gzip --keep -f acct.0 || rc=3;;
 	    esac
+
+	    sa -s $daily_accounting_flags /var/account/acct.0 &&
+		unlink acct.0 || rc=3
 	fi;;
 
     *)  rc=0;;

Modified: stable/7/etc/rc.d/accounting
==============================================================================
--- stable/7/etc/rc.d/accounting	Sat Mar  5 02:11:23 2011	(r219283)
+++ stable/7/etc/rc.d/accounting	Sat Mar  5 02:12:36 2011	(r219284)
@@ -14,28 +14,31 @@ name="accounting"
 rcvar=`set_rcvar`
 accounting_command="/usr/sbin/accton"
 accounting_file="/var/account/acct"
+
+extra_commands="rotate_log"
+
 start_cmd="accounting_start"
 stop_cmd="accounting_stop"
+rotate_log_cmd="accounting_rotate_log"
 
 accounting_start()
 {
 	local _dir
 
-	_dir=`dirname "$accounting_file"`
-	if [ ! -d `dirname "$_dir"` ]; then
+	_dir="${accounting_file%/*}"
+	if [ ! -d "$_dir" ]; then
 		if ! mkdir -p "$_dir"; then
-			warn "Could not create $_dir."
-			return 1
+			err 1 "Could not create $_dir."
 		fi
 	fi
+
 	if [ ! -e "$accounting_file" ]; then
+		echo -n "Creating accounting file ${accounting_file}"
 		touch "$accounting_file"
+		echo '.'
 	fi
+	chmod 644 "$accounting_file"
 
-	if [ ! -f ${accounting_file} ]; then
-		echo "Creating accounting file ${accounting_file}"
-		( umask 022 ; > ${accounting_file} )
-	fi
 	echo "Turning on accounting."
 	${accounting_command} ${accounting_file}
 }
@@ -46,5 +49,27 @@ accounting_stop()
 	${accounting_command}
 }
 
+accounting_rotate_log()
+{
+	local _dir _file
+
+	_dir="${accounting_file%/*}"
+	cd $_dir
+
+	if checkyesno accounting_enable; then
+		_file=`mktemp newacct-XXXXX`
+		chmod 644 $_file
+		${accounting_command} ${_dir}/${_file}
+	fi
+
+	mv ${accounting_file} ${accounting_file}.0
+
+	if checkyesno accounting_enable; then
+		ln $_file ${accounting_file##*/}
+		${accounting_command} ${accounting_file}
+		unlink $_file
+	fi
+}
+
 load_rc_config $name
 run_rc_command "$1"

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 03:01:14 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:06:39 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:12:51 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:18:56 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:27:15 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:42:05 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 03:46:25 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23E5C106566B;
	Sat,  5 Mar 2011 03:46:25 +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 10C678FC0A;
	Sat,  5 Mar 2011 03:46: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 p253kO3k002113;
	Sat, 5 Mar 2011 03:46:24 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p253kOtW002110;
	Sat, 5 Mar 2011 03:46:24 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050346.p253kOtW002110@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 03:46:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219291 - in stable/8: share/man/man7 usr.bin/checknr
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 03:46:25 -0000

Author: brucec
Date: Sat Mar  5 03:46:24 2011
New Revision: 219291
URL: http://svn.freebsd.org/changeset/base/219291

Log:
  MFC r219096, r219126:
  
  r177626 broke some sentences. Reword them to avoid the duplicate "in".
  
  PR:	121490

Modified:
  stable/8/share/man/man7/security.7
  stable/8/usr.bin/checknr/checknr.c
Directory Properties:
  stable/8/share/man/man7/   (props changed)
  stable/8/usr.bin/checknr/   (props changed)

Modified: stable/8/share/man/man7/security.7
==============================================================================
--- stable/8/share/man/man7/security.7	Sat Mar  5 03:42:03 2011	(r219290)
+++ stable/8/share/man/man7/security.7	Sat Mar  5 03:46:24 2011	(r219291)
@@ -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 originally.
 .Pp
 Security remedies should always be implemented with a multi-layered
 .Dq onion peel

Modified: stable/8/usr.bin/checknr/checknr.c
==============================================================================
--- stable/8/usr.bin/checknr/checknr.c	Sat Mar  5 03:42:03 2011	(r219290)
+++ stable/8/usr.bin/checknr/checknr.c	Sat Mar  5 03:46:24 2011	(r219291)
@@ -83,7 +83,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 */
 } stk[MAXSTK];
 int stktop;
 

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 03:54:38 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 04:04:23 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 04:06:12 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 89515106566C;
	Sat,  5 Mar 2011 04:06:12 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 769018FC0A;
	Sat,  5 Mar 2011 04:06: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 p2546CQ5003977;
	Sat, 5 Mar 2011 04:06:12 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2546CSr003975;
	Sat, 5 Mar 2011 04:06:12 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050406.p2546CSr003975@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 04:06:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219294 - stable/8/usr.bin/stat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:06:12 -0000

Author: dougb
Date: Sat Mar  5 04:06:12 2011
New Revision: 219294
URL: http://svn.freebsd.org/changeset/base/219294

Log:
  MFC r218535:
  
  Synthesize the change from NetBSD's 1.33:
  
  "Do not crash if a date cannot be represented (localtime returning
  NULL), use the Epoch value instead."
  
  Obtained from:  njoly@NetBSD.org

Modified:
  stable/8/usr.bin/stat/stat.c
Directory Properties:
  stable/8/usr.bin/stat/   (props changed)

Modified: stable/8/usr.bin/stat/stat.c
==============================================================================
--- stable/8/usr.bin/stat/stat.c	Sat Mar  5 04:04:23 2011	(r219293)
+++ stable/8/usr.bin/stat/stat.c	Sat Mar  5 04:06:12 2011	(r219294)
@@ -30,7 +30,7 @@
 #include 
 #if 0
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $"
+__RCSID("$NetBSD: stat.c,v 1.33 2011/01/15 22:54:10 njoly Exp $"
 "$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $");
 #endif
 #endif
@@ -731,6 +731,10 @@ format1(const struct stat *st,
 		small = (sizeof(ts.tv_sec) == 4);
 		data = ts.tv_sec;
 		tm = localtime(&ts.tv_sec);
+		if (tm == NULL) {
+			ts.tv_sec = 0;
+			tm = localtime(&ts.tv_sec);
+		}
 		(void)strftime(path, sizeof(path), timefmt, tm);
 		sdata = path;
 		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX |

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 04:08:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 985991065670;
	Sat,  5 Mar 2011 04:08:07 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 859428FC16;
	Sat,  5 Mar 2011 04:08: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 p25487PD004161;
	Sat, 5 Mar 2011 04:08:07 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254875B004159;
	Sat, 5 Mar 2011 04:08:07 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201103050408.p254875B004159@svn.freebsd.org>
From: Doug Barton 
Date: Sat, 5 Mar 2011 04:08:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219295 - stable/7/usr.bin/stat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:08:07 -0000

Author: dougb
Date: Sat Mar  5 04:08:07 2011
New Revision: 219295
URL: http://svn.freebsd.org/changeset/base/219295

Log:
  MFC r218535:
  
  Synthesize the change from NetBSD's 1.33:
  
  "Do not crash if a date cannot be represented (localtime returning
  NULL), use the Epoch value instead."
  
  Obtained from:  njoly@NetBSD.org

Modified:
  stable/7/usr.bin/stat/stat.c
Directory Properties:
  stable/7/usr.bin/stat/   (props changed)

Modified: stable/7/usr.bin/stat/stat.c
==============================================================================
--- stable/7/usr.bin/stat/stat.c	Sat Mar  5 04:06:12 2011	(r219294)
+++ stable/7/usr.bin/stat/stat.c	Sat Mar  5 04:08:07 2011	(r219295)
@@ -30,7 +30,7 @@
 #include 
 #if 0
 #ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $"
+__RCSID("$NetBSD: stat.c,v 1.33 2011/01/15 22:54:10 njoly Exp $"
 "$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $");
 #endif
 #endif
@@ -724,6 +724,10 @@ format1(const struct stat *st,
 		small = (sizeof(ts.tv_sec) == 4);
 		data = ts.tv_sec;
 		tm = localtime(&ts.tv_sec);
+		if (tm == NULL) {
+			ts.tv_sec = 0;
+			tm = localtime(&ts.tv_sec);
+		}
 		(void)strftime(path, sizeof(path), timefmt, tm);
 		sdata = path;
 		formats = FMTF_DECIMAL | FMTF_OCTAL | FMTF_UNSIGNED | FMTF_HEX |

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 04:11:07 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27A01106566C;
	Sat,  5 Mar 2011 04:11:07 +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 112CB8FC1A;
	Sat,  5 Mar 2011 04:11: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 p254B6J1004527;
	Sat, 5 Mar 2011 04:11:06 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254B6FW004516;
	Sat, 5 Mar 2011 04:11:06 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050411.p254B6FW004516@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:11:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219296 - in stable/7: lib/libc/yp lib/libkse/thread
	libexec/talkd share/man/man7 sys/boot/i386/cdboot
	sys/boot/pc98/cdboot sys/dev/ti sys/i386/isa usr.bin/checknr
	usr.bin/xlint/lint1
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:11:07 -0000

Author: brucec
Date: Sat Mar  5 04:11:06 2011
New Revision: 219296
URL: http://svn.freebsd.org/changeset/base/219296

Log:
  MFC r177626, r219096, r219126:
  
  Fix some "in in" typos in comments.
  
  PR:		121490
  Submitted by:	Anatoly Borodin 

Modified:
  stable/7/lib/libc/yp/xdryp.c
  stable/7/lib/libkse/thread/thr_sig.c
  stable/7/libexec/talkd/announce.c
  stable/7/share/man/man7/security.7
  stable/7/sys/boot/i386/cdboot/cdboot.s
  stable/7/sys/boot/pc98/cdboot/cdboot.s
  stable/7/sys/dev/ti/if_ti.c
  stable/7/sys/i386/isa/vesa.c
  stable/7/usr.bin/checknr/checknr.c
  stable/7/usr.bin/xlint/lint1/lint1.h
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)
  stable/7/lib/libkse/   (props changed)
  stable/7/libexec/talkd/   (props changed)
  stable/7/share/man/man7/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/usr.bin/checknr/   (props changed)
  stable/7/usr.bin/xlint/   (props changed)

Modified: stable/7/lib/libc/yp/xdryp.c
==============================================================================
--- stable/7/lib/libc/yp/xdryp.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/lib/libc/yp/xdryp.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -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: stable/7/lib/libkse/thread/thr_sig.c
==============================================================================
--- stable/7/lib/libkse/thread/thr_sig.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/lib/libkse/thread/thr_sig.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -663,7 +663,7 @@ thr_sig_find(struct kse *curkse, int sig
 	 * Enter a loop to look for threads that have the signal
 	 * unmasked.  POSIX specifies that a thread in a sigwait
 	 * will get the signal over any other threads.  Second
-	 * preference will be threads in in a sigsuspend.  Third
+	 * preference will be threads in a sigsuspend.  Third
 	 * preference will be the current thread.  If none of the
 	 * above, then the signal is delivered to the first thread
 	 * that is found.  Note that if a custom handler is not

Modified: stable/7/libexec/talkd/announce.c
==============================================================================
--- stable/7/libexec/talkd/announce.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/libexec/talkd/announce.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -91,7 +91,7 @@ announce(CTL_MSG *request, const char *r
  * Build a block of characters containing the message.
  * It is sent blank filled and in a single block to
  * try to keep the message in one piece if the recipient
- * in in vi at the time
+ * in vi at the time
  */
 int
 print_mesg(const char *tty, CTL_MSG *request,

Modified: stable/7/share/man/man7/security.7
==============================================================================
--- stable/7/share/man/man7/security.7	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/share/man/man7/security.7	Sat Mar  5 04:11:06 2011	(r219296)
@@ -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: stable/7/sys/boot/i386/cdboot/cdboot.s
==============================================================================
--- stable/7/sys/boot/i386/cdboot/cdboot.s	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/boot/i386/cdboot/cdboot.s	Sat Mar  5 04:11:06 2011	(r219296)
@@ -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: stable/7/sys/boot/pc98/cdboot/cdboot.s
==============================================================================
--- stable/7/sys/boot/pc98/cdboot/cdboot.s	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/boot/pc98/cdboot/cdboot.s	Sat Mar  5 04:11:06 2011	(r219296)
@@ -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: stable/7/sys/dev/ti/if_ti.c
==============================================================================
--- stable/7/sys/dev/ti/if_ti.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/dev/ti/if_ti.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -3685,7 +3685,7 @@ ti_ioctl2(struct cdev *dev, u_long cmd, 
 		 * to the Tigon board you're interested in.  This seems
 		 * like a not-so-good way to do things, since unless you
 		 * subsequently specify the unit number of the device
-		 * you're interested in in every ioctl, you'll only be
+		 * you're interested in every ioctl, you'll only be
 		 * able to debug one board at a time.
 		 */
 		error = 0;

Modified: stable/7/sys/i386/isa/vesa.c
==============================================================================
--- stable/7/sys/i386/isa/vesa.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/sys/i386/isa/vesa.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -1392,7 +1392,7 @@ get_palette(video_adapter_t *adp, int ba
 	}
 	free(r, M_DEVBUF);
 
-	/* if error && bits != 6 at this point, we are in in trouble... XXX */
+	/* if error && bits != 6 at this point, we are in trouble... XXX */
 	return error;
 }
 

Modified: stable/7/usr.bin/checknr/checknr.c
==============================================================================
--- stable/7/usr.bin/checknr/checknr.c	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/usr.bin/checknr/checknr.c	Sat Mar  5 04:11:06 2011	(r219296)
@@ -83,7 +83,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;
 

Modified: stable/7/usr.bin/xlint/lint1/lint1.h
==============================================================================
--- stable/7/usr.bin/xlint/lint1/lint1.h	Sat Mar  5 04:08:07 2011	(r219295)
+++ stable/7/usr.bin/xlint/lint1/lint1.h	Sat Mar  5 04:11:06 2011	(r219296)
@@ -325,7 +325,7 @@ typedef	struct dinfo {
 	u_int	d_mscl : 1;	/* multiple storage classes */
 	u_int	d_terr : 1;	/* invalid type combination */
 	u_int	d_nedecl : 1;	/* 1 if at least a tag is declared */
-	u_int	d_vararg : 1;	/* ... in in current function decl. */
+	u_int	d_vararg : 1;	/* ... in current function decl. */
 	u_int	d_proto : 1;	/* current funct. decl. is prototype */
 	u_int	d_notyp : 1;	/* set if no type specifier was present */
 	u_int	d_asm : 1;	/* set if d_ctx == AUTO and asm() present */

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 04:15:46 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2667106566C;
	Sat,  5 Mar 2011 04:15:46 +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 9EC668FC0A;
	Sat,  5 Mar 2011 04:15: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 p254FkBB005074;
	Sat, 5 Mar 2011 04:15:46 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254Fkei005072;
	Sat, 5 Mar 2011 04:15:46 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050415.p254Fkei005072@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:15:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219297 - stable/8/contrib/lukemftp/src
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:15:46 -0000

Author: brucec
Date: Sat Mar  5 04:15:46 2011
New Revision: 219297
URL: http://svn.freebsd.org/changeset/base/219297

Log:
  MFC r219081:
  
  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

Modified:
  stable/8/contrib/lukemftp/src/main.c
Directory Properties:
  stable/8/contrib/lukemftp/   (props changed)

Modified: stable/8/contrib/lukemftp/src/main.c
==============================================================================
--- stable/8/contrib/lukemftp/src/main.c	Sat Mar  5 04:11:06 2011	(r219296)
+++ stable/8/contrib/lukemftp/src/main.c	Sat Mar  5 04:15:46 2011	(r219297)
@@ -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-all@FreeBSD.ORG  Sat Mar  5 04:18:29 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 76508106564A;
	Sat,  5 Mar 2011 04:18:29 +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 632018FC12;
	Sat,  5 Mar 2011 04:18: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 p254ITTT005364;
	Sat, 5 Mar 2011 04:18:29 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254ITht005362;
	Sat, 5 Mar 2011 04:18:29 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050418.p254ITht005362@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:18:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219298 - stable/7/contrib/lukemftp/src
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:18:29 -0000

Author: brucec
Date: Sat Mar  5 04:18:29 2011
New Revision: 219298
URL: http://svn.freebsd.org/changeset/base/219298

Log:
  MFC r219081:
  
  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

Modified:
  stable/7/contrib/lukemftp/src/main.c
Directory Properties:
  stable/7/contrib/lukemftp/   (props changed)

Modified: stable/7/contrib/lukemftp/src/main.c
==============================================================================
--- stable/7/contrib/lukemftp/src/main.c	Sat Mar  5 04:15:46 2011	(r219297)
+++ stable/7/contrib/lukemftp/src/main.c	Sat Mar  5 04:18:29 2011	(r219298)
@@ -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-all@FreeBSD.ORG  Sat Mar  5 04:19:38 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 04:27:02 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6EE51065670;
	Sat,  5 Mar 2011 04:27:02 +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 B3ECB8FC0A;
	Sat,  5 Mar 2011 04:27: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 p254R2Fb006449;
	Sat, 5 Mar 2011 04:27:02 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254R2en006446;
	Sat, 5 Mar 2011 04:27:02 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050427.p254R2en006446@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:27:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219300 - stable/8/lib/libc/rpc/PSD.doc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:27:02 -0000

Author: brucec
Date: Sat Mar  5 04:27:02 2011
New Revision: 219300
URL: http://svn.freebsd.org/changeset/base/219300

Log:
  MFC r218965, 219055:
  
  Fix typos - remove duplicate "is".
  
  PR:		docs/154934

Modified:
  stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms
==============================================================================
--- stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:19:38 2011	(r219299)
+++ stable/8/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:27:02 2011	(r219300)
@@ -71,7 +71,7 @@ manual page.
 .I "The Highest Layer:"
 .IX RPC "The Highest Layer"
 The highest layer is totally transparent to the operating system,
-machine and network upon which is is run.  It's probably best to
+machine and network upon which it is run.  It's probably best to
 think of this level as a way of
 .I using
 RPC, rather than as

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 04:33:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A6AFC106566B;
	Sat,  5 Mar 2011 04:33:42 +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 921408FC12;
	Sat,  5 Mar 2011 04:33: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 p254Xgvq007254;
	Sat, 5 Mar 2011 04:33:42 GMT (envelope-from brucec@svn.freebsd.org)
Received: (from brucec@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p254XgGx007248;
	Sat, 5 Mar 2011 04:33:42 GMT (envelope-from brucec@svn.freebsd.org)
Message-Id: <201103050433.p254XgGx007248@svn.freebsd.org>
From: Bruce Cran 
Date: Sat, 5 Mar 2011 04:33:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219301 - in stable/7: lib/libc/rpc/PSD.doc sbin/growfs
	share/doc/papers/devfs sys/fs/nullfs usr.bin/tip/tip
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 04:33:42 -0000

Author: brucec
Date: Sat Mar  5 04:33:42 2011
New Revision: 219301
URL: http://svn.freebsd.org/changeset/base/219301

Log:
  MFC r218965, r219055:
  
  Fix typos - remove duplicate "is".
  
  PR:           docs/154934
  Submitted by: Eitan Adler 

Modified:
  stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms
  stable/7/sbin/growfs/growfs.c
  stable/7/share/doc/papers/devfs/paper.me
  stable/7/sys/fs/nullfs/null_vnops.c
  stable/7/usr.bin/tip/tip/tip.h
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)
  stable/7/sbin/growfs/   (props changed)
  stable/7/share/doc/papers/devfs/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/usr.bin/tip/   (props changed)

Modified: stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms
==============================================================================
--- stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/lib/libc/rpc/PSD.doc/rpc.prog.ms	Sat Mar  5 04:33:42 2011	(r219301)
@@ -71,7 +71,7 @@ manual page.
 .I "The Highest Layer:"
 .IX RPC "The Highest Layer"
 The highest layer is totally transparent to the operating system,
-machine and network upon which is is run.  It's probably best to
+machine and network upon which it is run.  It's probably best to
 think of this level as a way of
 .I using
 RPC, rather than as

Modified: stable/7/sbin/growfs/growfs.c
==============================================================================
--- stable/7/sbin/growfs/growfs.c	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/sbin/growfs/growfs.c	Sat Mar  5 04:33:42 2011	(r219301)
@@ -646,7 +646,7 @@ cond_bl_upd(ufs2_daddr_t *block, struct 
 		/*
 		 * Copy the block back immediately.
 		 *
-		 * XXX	If src is is from an indirect block we have
+		 * XXX	If src is from an indirect block we have
 		 *	to implement copy on write here in case of
 		 *	active snapshots.
 		 */

Modified: stable/7/share/doc/papers/devfs/paper.me
==============================================================================
--- stable/7/share/doc/papers/devfs/paper.me	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/share/doc/papers/devfs/paper.me	Sat Mar  5 04:33:42 2011	(r219301)
@@ -779,7 +779,7 @@ The entry points to the device driver ar
 structure, removing the need for the devsw[] array and allowing
 device drivers to use separate entrypoints for various minor numbers.
 .lp
-This is is very convenient for devices which have a ``control''
+This is very convenient for devices which have a ``control''
 device for management and tuning.  The control device, almost always
 have entirely separate open/close/ioctl implementations [MD.C].
 .lp

Modified: stable/7/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/7/sys/fs/nullfs/null_vnops.c	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/sys/fs/nullfs/null_vnops.c	Sat Mar  5 04:33:42 2011	(r219301)
@@ -631,7 +631,7 @@ null_islocked(struct vop_islocked_args *
  * as soon as possible.
  *
  * Note, we can't release any resources nor remove vnode from hash before 
- * appropriate VXLOCK stuff is is done because other process can find this
+ * appropriate VXLOCK stuff is done because other process can find this
  * vnode in hash during inactivation and may be sitting in vget() and waiting
  * for null_inactive to unlock vnode. Thus we will do all those in VOP_RECLAIM.
  */

Modified: stable/7/usr.bin/tip/tip/tip.h
==============================================================================
--- stable/7/usr.bin/tip/tip/tip.h	Sat Mar  5 04:27:02 2011	(r219300)
+++ stable/7/usr.bin/tip/tip/tip.h	Sat Mar  5 04:33:42 2011	(r219301)
@@ -259,7 +259,7 @@ int	intflag;		/* recognized interrupt */
 int	stoprompt;		/* for interrupting a prompt session */
 int	timedout;		/* ~> transfer timedout */
 int	cumode;			/* simulating the "cu" program */
-int	bits8;			/* terminal is is 8-bit mode */
+int	bits8;			/* terminal is 8-bit mode */
 #define STRIP_PAR	(bits8 ? 0377 : 0177)
 
 char	fname[PATH_MAX];	/* file name buffer for ~< */

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 08:56:42 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6DA01065670;
	Sat,  5 Mar 2011 08:56:42 +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 C56BD8FC12;
	Sat,  5 Mar 2011 08:56: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 p258uggX026599;
	Sat, 5 Mar 2011 08:56:42 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p258ugj2026597;
	Sat, 5 Mar 2011 08:56:42 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201103050856.p258ugj2026597@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Sat, 5 Mar 2011 08:56:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219302 - stable/8/sys/modules/usb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 08:56:43 -0000

Author: glebius
Date: Sat Mar  5 08:56:42 2011
New Revision: 219302
URL: http://svn.freebsd.org/changeset/base/219302

Log:
  MFHead 219059:
    Connect uep.ko to build
  
    PR:           kern/155044
    Submitted by: Carl 

Modified:
  stable/8/sys/modules/usb/Makefile
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/modules/usb/Makefile
==============================================================================
--- stable/8/sys/modules/usb/Makefile	Sat Mar  5 04:33:42 2011	(r219301)
+++ stable/8/sys/modules/usb/Makefile	Sat Mar  5 08:56:42 2011	(r219302)
@@ -28,7 +28,7 @@
 SUBDIR = usb
 SUBDIR += ehci musb ohci uhci xhci uss820dci ${_at91dci} ${_atmegadci}
 SUBDIR += rum run uath upgt ural zyd ${_urtw}
-SUBDIR += atp uhid ukbd ums udbp ufm
+SUBDIR += atp uhid ukbd ums udbp ufm uep
 SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
 	  umct umodem umoscom uplcom uslcom uvisor uvscom
 SUBDIR += uether aue axe cdce cue kue rue udav uhso ipheth

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 09:42:01 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5AE281065675;
	Sat,  5 Mar 2011 09:42:01 +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 49A268FC0C;
	Sat,  5 Mar 2011 09:42:01 +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 p259g1Mr030940;
	Sat, 5 Mar 2011 09:42:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p259g1wW030937;
	Sat, 5 Mar 2011 09:42:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201103050942.p259g1wW030937@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 5 Mar 2011 09:42:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219303 - stable/8/sys/crypto/aesni
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 09:42:01 -0000

Author: kib
Date: Sat Mar  5 09:42:00 2011
New Revision: 219303
URL: http://svn.freebsd.org/changeset/base/219303

Log:
  MFC r219178:
  Fix a bug in the result of manual assembly.
  
  PR:	kern/155118

Modified:
  stable/8/sys/crypto/aesni/aeskeys_amd64.S
  stable/8/sys/crypto/aesni/aeskeys_i386.S
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/crypto/aesni/aeskeys_amd64.S
==============================================================================
--- stable/8/sys/crypto/aesni/aeskeys_amd64.S	Sat Mar  5 08:56:42 2011	(r219302)
+++ stable/8/sys/crypto/aesni/aeskeys_amd64.S	Sat Mar  5 09:42:00 2011	(r219303)
@@ -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: stable/8/sys/crypto/aesni/aeskeys_i386.S
==============================================================================
--- stable/8/sys/crypto/aesni/aeskeys_i386.S	Sat Mar  5 08:56:42 2011	(r219302)
+++ stable/8/sys/crypto/aesni/aeskeys_i386.S	Sat Mar  5 09:42:00 2011	(r219303)
@@ -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-all@FreeBSD.ORG  Sat Mar  5 12:40:36 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 12:46:24 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 13:27:13 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 14:41:50 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 15:18:12 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 19:22:58 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 553FB106566C;
	Sat,  5 Mar 2011 19:22:58 +0000 (UTC) (envelope-from das@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 447298FC12;
	Sat,  5 Mar 2011 19:22: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 p25JMw7G073716;
	Sat, 5 Mar 2011 19:22:58 GMT (envelope-from das@svn.freebsd.org)
Received: (from das@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id p25JMwLU073713;
	Sat, 5 Mar 2011 19:22:58 GMT (envelope-from das@svn.freebsd.org)
Message-Id: <201103051922.p25JMwLU073713@svn.freebsd.org>
From: David Schultz 
Date: Sat, 5 Mar 2011 19:22:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-svnadmin@freebsd.org
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r219309 - svnadmin/conf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 19:22:58 -0000

Author: das
Date: Sat Mar  5 19:22:57 2011
New Revision: 219309
URL: http://svn.freebsd.org/changeset/base/219309

Log:
  Please welcome Steve Kargl as a new src committer.  Steve has been
  working on improvements to our math library for many years, and
  forcing him to commit his changes himself is long overdue.  He has
  also been active on the mailing lists in other areas.  I will be his
  mental.
  
  Approved by:	core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Sat Mar  5 15:18:11 2011	(r219308)
+++ svnadmin/conf/access	Sat Mar  5 19:22:57 2011	(r219309)
@@ -125,6 +125,7 @@ jpaetzel
 julian
 kaiw
 kan
+kargl
 kato
 ken
 kensmith

Modified: svnadmin/conf/mentors
==============================================================================
--- svnadmin/conf/mentors	Sat Mar  5 15:18:11 2011	(r219308)
+++ svnadmin/conf/mentors	Sat Mar  5 19:22:57 2011	(r219309)
@@ -19,6 +19,7 @@ hselasky	thompsa
 jinmei		gnn
 jonathan	rwatson
 jpaetzel	kib
+kargl		das
 miwi		rwatson
 nork		imp
 pluknet		avg		Co-mentor: kib

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 19:30:31 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6936A106566B;
	Sat,  5 Mar 2011 19:30:31 +0000 (UTC)
	(envelope-from lwindschuh@googlemail.com)
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 15C658FC18;
	Sat,  5 Mar 2011 19:30:30 +0000 (UTC)
Received: by iwn33 with SMTP id 33so3320121iwn.13
	for ; Sat, 05 Mar 2011 11:30:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type:content-transfer-encoding;
	bh=uGAiTaGoEJHzqzni6eed6lVfGyp5WVkXMbwEGFB5smE=;
	b=O925TPcarBg0s2B8PYeZ3URh1aIqkICmPszwnFxYTk8aPpg5rX5W4WcfYN4kjFNrwq
	XroETSTHsX6XOm8nyeg+sN/4ziDLOlkbEc/QaUzY4+ROfwdqADKgbGX/HlqM21BpuKfl
	0IG9wIA3UPUyVhJ4xjCqTXKd+RRwjQnVjLwzQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	b=ae+/VuRSi1gN5aAQjPmIjyouMndDSoXT1AJ8WO03XfyI8zmtiB+0oGGK1qT+bstIuc
	aPtxvSUYp0EB86fF5aUDXRbb5ciGAmxLJ8d+SRYJcVplLYptlx8/iODEr+7PuAmIfTz7
	t5qOjyRdyAdG6AkRNyHsY/32JuPpvlcFmIgSw=
MIME-Version: 1.0
Received: by 10.42.231.193 with SMTP id jr1mr2641926icb.23.1299351764151; Sat,
	05 Mar 2011 11:02:44 -0800 (PST)
Received: by 10.231.46.16 with HTTP; Sat, 5 Mar 2011 11:02:44 -0800 (PST)
In-Reply-To: <201102231323.p1NDNSVH061525@svn.freebsd.org>
References: <201102231323.p1NDNSVH061525@svn.freebsd.org>
Date: Sat, 5 Mar 2011 20:02:44 +0100
Message-ID: 
From: Lucius Windschuh 
To: John Baldwin , dchagin@freebsd.org,
	svn-src-all@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: 
Subject: Re: svn commit: r218970 - in head/sys: compat/linux sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 19:30:31 -0000

Hi John, hi Dmitry.

2011/2/23 John Baldwin :
> New Revision: 218970
> [...]
> Log:
> =A0Use umtx_key objects to uniquely identify futexes. =A0Private futexes =
in
> =A0different processes that happen to use the same user address in the
> =A0separate processes will now be treated as distinct futexes rather than=
 the
> =A0same futex. =A0We can now honor shared futexes properly by mapping the=
m to a
> =A0PROCESS_SHARED umtx_key. =A0Private futexes use THREAD_SHARED umtx_key
> =A0objects.

This change breaks linux-jdk-1.6.0, at least for me on FreeBSD 9 i386:

$ /usr/local/linux-sun-jdk1.6.0/bin/java
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -d32          use a 32-bit data model if available

    -d64          use a 64-bit data model if available
    -client       to select the "client" VM
    -server       to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is server,
                  because you are running on a server-class machine.

    -cp 
    -classpath 
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D=3D
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:...|:]
    -enableassertions[:...|:]
                  enable assertions
    -da[:...|:]
    -disableassertions[:...|:]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:[=3D]
                  load native agent library , e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=3Dhelp and -agentlib:hprof=3Dh=
elp
    -agentpath:[=3D]
                  load native agent library by full pathname
    -javaagent:[=3D]
                  load Java programming language agent, see java.lang.instr=
ument
    -splash:
                  show splash screen with specified image
^T
load: 1.62  cmd: java 4007 [futex] 3.33r 0.00u 0.00s 0% 10784k
(... wait a while)
^T
load: 1.62  cmd: java 4007 [futex] 4.45r 0.00u 0.00s 0% 10784k
(... doesn't finish)

With r218969, the process finishes as expected.

BTW, is there an easy way to debug such futex issues, other than
perhaps linux_kdump?

Lucius

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 20:36:42 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 20:39:03 2011
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C858E106564A;
	Sat,  5 Mar 2011 20:39:03 +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 961A98FC13;
	Sat,  5 Mar 2011 20:39:01 +0000 (UTC)
Received: from corbina.ru (mail.post.ru [195.14.50.16])
	by contrabass.post.ru (Postfix) with ESMTP id 803EECBC08;
	Sat,  5 Mar 2011 22:45:34 +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 306122270; Sat, 05 Mar 2011 22:45: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
	p25JjXCK003972; Sat, 5 Mar 2011 22:45:33 +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 p25JjSbl003971; 
	Sat, 5 Mar 2011 22:45:28 +0300 (MSK) (envelope-from dchagin)
Date: Sat, 5 Mar 2011 22:45:28 +0300
From: Chagin Dmitry 
To: Lucius Windschuh 
Message-ID: <20110305194528.GA3892@dchagin.static.corbina.ru>
References: <201102231323.p1NDNSVH061525@svn.freebsd.org>
	
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn"
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-all@freebsd.org, John Baldwin 
Subject: Re: svn commit: r218970 - in head/sys: compat/linux sys
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 05 Mar 2011 20:39:03 -0000


--bp/iNruPH9dso1Pn
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 05, 2011 at 08:02:44PM +0100, Lucius Windschuh wrote:
> Hi John, hi Dmitry.
>=20
> 2011/2/23 John Baldwin :
> > New Revision: 218970
> > [...]
> > Log:
> > =9AUse umtx_key objects to uniquely identify futexes. =9APrivate futexe=
s in
> > =9Adifferent processes that happen to use the same user address in the
> > =9Aseparate processes will now be treated as distinct futexes rather th=
an the
> > =9Asame futex. =9AWe can now honor shared futexes properly by mapping t=
hem to a
> > =9APROCESS_SHARED umtx_key. =9APrivate futexes use THREAD_SHARED umtx_k=
ey
> > =9Aobjects.
>=20
> This change breaks linux-jdk-1.6.0, at least for me on FreeBSD 9 i386:
>=20
> $ /usr/local/linux-sun-jdk1.6.0/bin/java
> Usage: java [-options] class [args...]
>            (to execute a class)
>    or  java [-options] -jar jarfile [args...]
>            (to execute a jar file)
>=20
> where options include:
>     -d32          use a 32-bit data model if available
>=20
>     -d64          use a 64-bit data model if available
>     -client       to select the "client" VM
>     -server       to select the "server" VM
>     -hotspot      is a synonym for the "client" VM  [deprecated]
>                   The default VM is server,
>                   because you are running on a server-class machine.
>=20
>     -cp 
>     -classpath 
>                   A : separated list of directories, JAR archives,
>                   and ZIP archives to search for class files.
>     -D=3D
>                   set a system property
>     -verbose[:class|gc|jni]
>                   enable verbose output
>     -version      print product version and exit
>     -version:
>                   require the specified version to run
>     -showversion  print product version and continue
>     -jre-restrict-search | -jre-no-restrict-search
>                   include/exclude user private JREs in the version search
>     -? -help      print this help message
>     -X            print help on non-standard options
>     -ea[:...|:]
>     -enableassertions[:...|:]
>                   enable assertions
>     -da[:...|:]
>     -disableassertions[:...|:]
>                   disable assertions
>     -esa | -enablesystemassertions
>                   enable system assertions
>     -dsa | -disablesystemassertions
>                   disable system assertions
>     -agentlib:[=3D]
>                   load native agent library , e.g. -agentlib:hpr=
of
>                     see also, -agentlib:jdwp=3Dhelp and -agentlib:hprof=
=3Dhelp
>     -agentpath:[=3D]
>                   load native agent library by full pathname
>     -javaagent:[=3D]
>                   load Java programming language agent, see java.lang.ins=
trument
>     -splash:
>                   show splash screen with specified image
> ^T
> load: 1.62  cmd: java 4007 [futex] 3.33r 0.00u 0.00s 0% 10784k
> (... wait a while)
> ^T
> load: 1.62  cmd: java 4007 [futex] 4.45r 0.00u 0.00s 0% 10784k
> (... doesn't finish)
>=20
> With r218969, the process finishes as expected.
>=20
> BTW, is there an easy way to debug such futex issues, other than
> perhaps linux_kdump?
>=20

try r219242. kdump now (in HEAD) decode linux syscalls. also see ktr(4).

--=20
Have fun!
chd

--bp/iNruPH9dso1Pn
Content-Type: application/pgp-signature

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

iEYEARECAAYFAk1yktgACgkQ0t2Tb3OO/O1ibQCcDm55jkP0ymMx1xdJOKE4d1tl
f2kAoLaG8/gXtDaLBlTPPp2ndk0W4xJT
=zhne
-----END PGP SIGNATURE-----

--bp/iNruPH9dso1Pn--

From owner-svn-src-all@FreeBSD.ORG  Sat Mar  5 20:54:18 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 21:20:19 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 22:24:31 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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-all@FreeBSD.ORG  Sat Mar  5 22:31:03 2011
Return-Path: 
Delivered-To: svn-src-all@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-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
	user" and " projects" \)" 
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();
+}