From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 00:14:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 222D3106566C; Sun, 10 Jan 2010 00:14:05 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105DC8FC0A; Sun, 10 Jan 2010 00:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0A0E45t058318; Sun, 10 Jan 2010 00:14:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A0E4xv058316; Sun, 10 Jan 2010 00:14:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001100014.o0A0E4xv058316@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 10 Jan 2010 00:14: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: r201966 - head/sys/boot/ia64/efi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 00:14:05 -0000 Author: marcel Date: Sun Jan 10 00:14:04 2010 New Revision: 201966 URL: http://svn.freebsd.org/changeset/base/201966 Log: Remove debugging printf(). There's no need to print the image base address anymore. Modified: head/sys/boot/ia64/efi/main.c Modified: head/sys/boot/ia64/efi/main.c ============================================================================== --- head/sys/boot/ia64/efi/main.c Sun Jan 10 00:08:26 2010 (r201965) +++ head/sys/boot/ia64/efi/main.c Sun Jan 10 00:14:04 2010 (r201966) @@ -127,8 +127,6 @@ main(int argc, CHAR16 *argv[]) /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); - printf("Image base: 0x%016lx\n", (u_long)img->ImageBase); - printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 03:46:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4725E106566C; Sun, 10 Jan 2010 03:46:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35DFC8FC08; Sun, 10 Jan 2010 03:46: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 o0A3k9rn005661; Sun, 10 Jan 2010 03:46:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A3k9a9005660; Sun, 10 Jan 2010 03:46:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100346.o0A3k9a9005660@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 03:46: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: r201972 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 03:46:09 -0000 Author: imp Date: Sun Jan 10 03:46:08 2010 New Revision: 201972 URL: http://svn.freebsd.org/changeset/base/201972 Log: Merge from projects/mips to head by hand: special ld script for 64-bit octeon link. Added: - copied unchanged from r201971, projects/mips/sys/conf/ldscript.mips.octeon1.64 Directory Properties: head/sys/conf/ldscript.mips.octeon1.64 (props changed) Copied: head/sys/conf/ldscript.mips.octeon1.64 (from r201971, projects/mips/sys/conf/ldscript.mips.octeon1.64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.octeon1.64 Sun Jan 10 03:46:08 2010 (r201972, copy of r201971, projects/mips/sys/conf/ldscript.mips.octeon1.64) @@ -0,0 +1,61 @@ +TARGET(elf64-tradbigmips) +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) +/* __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ +PHDRS { + text PT_LOAD FLAGS ( 5 ) ; +} + +SECTIONS { + + .text _start : { + *(.text) + /*(.dynamic)*/ + etext = .; + _etext = .; + . = ALIGN(0x2000); + } : text + + .rodata ALIGN(0x2000) : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data . : { + _rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata . : { + _small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } + + .sbss . : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) + _small_end = .; + . = ALIGN(32); + } + + .bss . : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 03:47:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 012B01065692; Sun, 10 Jan 2010 03:47:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF2FE8FC14; Sun, 10 Jan 2010 03:47: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 o0A3lC57005936; Sun, 10 Jan 2010 03:47:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A3lCv9005935; Sun, 10 Jan 2010 03:47:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100347.o0A3lCv9005935@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 03:47: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: r201973 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 03:47:13 -0000 Author: imp Date: Sun Jan 10 03:47:12 2010 New Revision: 201973 URL: http://svn.freebsd.org/changeset/base/201973 Log: Merge from projects/mips to head by hand: mips64 ld script for the kernel. Added: - copied unchanged from r201972, projects/mips/sys/conf/ldscript.mips.mips64 Directory Properties: head/sys/conf/ldscript.mips.mips64 (props changed) Copied: head/sys/conf/ldscript.mips.mips64 (from r201972, projects/mips/sys/conf/ldscript.mips.mips64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.mips64 Sun Jan 10 03:47:12 2010 (r201973, copy of r201972, projects/mips/sys/conf/ldscript.mips.mips64) @@ -0,0 +1,303 @@ +/*- + * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Juniper Networks, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD: projects/mips/sys/conf/ldscript.mips 191079 2009-04-14 22:53:22Z gonzo $ + */ + +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", + "elf64-tradlittlemips") + +OUTPUT_ARCH(mips) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = KERNLOADADDR + SIZEOF_HEADERS; + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t.*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t.*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r.*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r.*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d.*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d.*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s.*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s.*) + } + .rel.sbss : + { + *(.rel.sbss) + *(.rel.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rela.sbss : + { + *(.rela.sbss) + *(.rela.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rel.sdata2 : + { + *(.rel.sdata2) + *(.rel.sdata2.*) + *(.rel.gnu.linkonce.s2.*) + } + .rela.sdata2 : + { + *(.rela.sdata2) + *(.rela.sdata2.*) + *(.rela.gnu.linkonce.s2.*) + } + .rel.sbss2 : + { + *(.rel.sbss2) + *(.rel.sbss2.*) + *(.rel.gnu.linkonce.sb2.*) + } + .rela.sbss2 : + { + *(.rela.sbss2) + *(.rela.sbss2.*) + *(.rela.gnu.linkonce.sb2.*) + } + .rel.bss : + { + *(.rel.bss) + *(.rel.bss.*) + *(.rel.gnu.linkonce.b.*) + } + .rela.bss : + { + *(.rela.bss) + *(.rela.bss.*) + *(.rela.gnu.linkonce.b.*) + } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0x1000000 + .text : + { + *(.trap) + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf64.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } =0x1000000 + .fini : + { + KEEP (*(.fini)) + } =0x1000000 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .reginfo : { *(.reginfo) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + . = ALIGN(0x2000) + (. & (0x2000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .plt : { *(.plt) } + _gp = ALIGN(16) + 0x7ff0; + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(64 / 8); + } + . = ALIGN(64 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 04:48:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9372D106566B; Sun, 10 Jan 2010 04:48:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82D638FC08; Sun, 10 Jan 2010 04:48: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 o0A4mQmX019291; Sun, 10 Jan 2010 04:48:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A4mQXf019290; Sun, 10 Jan 2010 04:48:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100448.o0A4mQXf019290@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 04:48: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: r201974 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 04:48:26 -0000 Author: imp Date: Sun Jan 10 04:48:26 2010 New Revision: 201974 URL: http://svn.freebsd.org/changeset/base/201974 Log: Merge from projects/mips to head by hand: Special linker file for octeon1 in pseudo-32-bit mode. Added: - copied unchanged from r201973, projects/mips/sys/conf/ldscript.mips.octeon1.32 Directory Properties: head/sys/conf/ldscript.mips.octeon1.32 (props changed) Copied: head/sys/conf/ldscript.mips.octeon1.32 (from r201973, projects/mips/sys/conf/ldscript.mips.octeon1.32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.octeon1.32 Sun Jan 10 04:48:26 2010 (r201974, copy of r201973, projects/mips/sys/conf/ldscript.mips.octeon1.32) @@ -0,0 +1,58 @@ +/* + * This product includes software developed by the University of + * California, Berkeley and its contributors." +*/ +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) + +SECTIONS { + . = KERNLOADADDR + SIZEOF_HEADERS; + .text . : { + *(.text) + *(.dynamic) + etext = .; + _etext = .; + . = ALIGN(0x2000); + } + + .rodata ALIGN(0x2000) : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data . : { + _rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata . : { + _small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } + + .sbss . : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) + _small_end = .; + . = ALIGN(32); + } + + .bss . : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 04:49:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61E331065695; Sun, 10 Jan 2010 04:49:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51A978FC16; Sun, 10 Jan 2010 04:49: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 o0A4nDMT019523; Sun, 10 Jan 2010 04:49:13 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A4nDYJ019522; Sun, 10 Jan 2010 04:49:13 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100449.o0A4nDYJ019522@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 04:49: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: r201975 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 04:49:13 -0000 Author: imp Date: Sun Jan 10 04:49:13 2010 New Revision: 201975 URL: http://svn.freebsd.org/changeset/base/201975 Log: Merge from projects/mips to head by hand: loader script for octeon1 in n32 abi mode. Added: - copied unchanged from r201974, projects/mips/sys/conf/ldscript.mips.octeon1.n32 Directory Properties: head/sys/conf/ldscript.mips.octeon1.n32 (props changed) Copied: head/sys/conf/ldscript.mips.octeon1.n32 (from r201974, projects/mips/sys/conf/ldscript.mips.octeon1.n32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.octeon1.n32 Sun Jan 10 04:49:13 2010 (r201975, copy of r201974, projects/mips/sys/conf/ldscript.mips.octeon1.n32) @@ -0,0 +1,57 @@ +TARGET(elf32-ntradbigmips) +OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips", "elf32-ntradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); + +SECTIONS { + + .text . : { + *(.text) + *(.dynamic) + etext = .; + _etext = .; + . = ALIGN(0x2000); + } + + .rodata ALIGN(0x2000) : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data . : { + _rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata . : { + _small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } + + .sbss . : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) + _small_end = .; + . = ALIGN(32); + } + + .bss . : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:01:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C97D106566C; Sun, 10 Jan 2010 05:01:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 625A38FC0A; Sun, 10 Jan 2010 05:01: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 o0A51lGA022306; Sun, 10 Jan 2010 05:01:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A51lkH022305; Sun, 10 Jan 2010 05:01:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100501.o0A51lkH022305@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:01: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: r201976 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:01:47 -0000 Author: imp Date: Sun Jan 10 05:01:47 2010 New Revision: 201976 URL: http://svn.freebsd.org/changeset/base/201976 Log: Merge from projects/mips to head by hand: Placeholder for ptrace machine specific stuff... This will likely be used to report CP2 or CP3 registers on those CPUs that have them... Added: - copied unchanged from r201975, projects/mips/sys/mips/mips/ptrace_machdep.c Directory Properties: head/sys/mips/mips/ptrace_machdep.c (props changed) Copied: head/sys/mips/mips/ptrace_machdep.c (from r201975, projects/mips/sys/mips/mips/ptrace_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/ptrace_machdep.c Sun Jan 10 05:01:47 2010 (r201976, copy of r201975, projects/mips/sys/mips/mips/ptrace_machdep.c) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2009 M. Warner Losh. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#if 0 +#include +__FBSDID("$FreeBSD$"); + +/* + * This file is a place holder for MIPS. Some models of MIPS may need special + * functions here, but for now nothing is needed. The MI parts of ptrace + * suffice. + */ +#endif From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:05:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF90106566C; Sun, 10 Jan 2010 05:05:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 747428FC0C; Sun, 10 Jan 2010 05:05:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0A55XUX023161; Sun, 10 Jan 2010 05:05:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A55XWD023160; Sun, 10 Jan 2010 05:05:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100505.o0A55XWD023160@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:05:33 +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: r201977 - head/sys/mips/sentry5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:05:33 -0000 Author: imp Date: Sun Jan 10 05:05:33 2010 New Revision: 201977 URL: http://svn.freebsd.org/changeset/base/201977 Log: These files have been moved on the branch. Delete them here before copying them from the branch. Deleted: head/sys/mips/sentry5/siba_cc.c head/sys/mips/sentry5/siba_mips.c head/sys/mips/sentry5/siba_sdram.c From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:07:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280CB106568F; Sun, 10 Jan 2010 05:07:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2B5C8FC08; Sun, 10 Jan 2010 05:07: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 o0A57TXH023628; Sun, 10 Jan 2010 05:07:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A57TMb023627; Sun, 10 Jan 2010 05:07:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100507.o0A57TMb023627@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:07: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: r201978 - head/sys/dev/siba/siba X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:07:30 -0000 Author: imp Date: Sun Jan 10 05:07:29 2010 New Revision: 201978 URL: http://svn.freebsd.org/changeset/base/201978 Log: Merge from projects/mips to head by hand: Merge the siba bus device. This was moved from mips to dev because siba bus can be in other architectures, like ARM. Added: - copied from r201977, projects/mips/sys/dev/siba/ Directory Properties: head/sys/dev/siba/siba/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:11:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA446106566C; Sun, 10 Jan 2010 05:11:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B298FC25; Sun, 10 Jan 2010 05:11: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 o0A5BRTw024524; Sun, 10 Jan 2010 05:11:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5BRRk024523; Sun, 10 Jan 2010 05:11:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100511.o0A5BRRk024523@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:11: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: r201979 - head/sys/mips/rmi/dev X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:11:28 -0000 Author: imp Date: Sun Jan 10 05:11:27 2010 New Revision: 201979 URL: http://svn.freebsd.org/changeset/base/201979 Log: Merge from projects/mips to head by hand: Copy sys/dev/rmi to sys/mips/rmi/dev [sic]. For devices that are on only one SoC, or family of SoC, we place them under sys//dev. I'll fix the build problems this causes as best I can since rmi kernel require external toolchains due to lack of support for rmi op-codes in the ancient binutils we have in the tree. Added: - copied from r201978, projects/mips/sys/dev/rmi/ Directory Properties: head/sys/mips/rmi/dev/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:15:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C93106566C; Sun, 10 Jan 2010 05:15:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1FC8FC0A; Sun, 10 Jan 2010 05: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 o0A5FkOd025570; Sun, 10 Jan 2010 05:15:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5Fk7N025568; Sun, 10 Jan 2010 05:15:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100515.o0A5Fk7N025568@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:15: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: r201981 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:15:46 -0000 Author: imp Date: Sun Jan 10 05:15:46 2010 New Revision: 201981 URL: http://svn.freebsd.org/changeset/base/201981 Log: Merge from projects/mips to head by hand: Merge support for MX25L spi flash. Added: - copied unchanged from r201980, projects/mips/sys/dev/flash/mx25l.c Directory Properties: head/sys/dev/flash/mx25l.c (props changed) Copied: head/sys/dev/flash/mx25l.c (from r201980, projects/mips/sys/dev/flash/mx25l.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/flash/mx25l.c Sun Jan 10 05:15:46 2010 (r201981, copy of r201980, projects/mips/sys/dev/flash/mx25l.c) @@ -0,0 +1,479 @@ +/*- + * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2009 Oleksandr Tymoshenko. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "spibus_if.h" + +#include + +struct mx25l_flash_ident +{ + const char *name; + uint8_t manufacturer_id; + uint16_t device_id; + unsigned int sectorsize; + unsigned int sectorcount; +}; + +struct mx25l_softc +{ + device_t sc_dev; + uint8_t sc_manufacturer_id; + uint16_t sc_device_id; + unsigned int sc_sectorsize; + struct mtx sc_mtx; + struct disk *sc_disk; + struct proc *sc_p; + struct bio_queue_head sc_bio_queue; +}; + +#define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define M25PXX_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define M25PXX_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ + "mx25l", MTX_DEF) +#define M25PXX_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define M25PXX_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define M25PXX_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +/* disk routines */ +static int mx25l_open(struct disk *dp); +static int mx25l_close(struct disk *dp); +static int mx25l_ioctl(struct disk *, u_long, void *, int, struct thread *); +static void mx25l_strategy(struct bio *bp); +static void mx25l_task(void *arg); + +struct mx25l_flash_ident flash_devices[] = { + { "mx25ll32", 0xc2, 0x2016, 64 * 1024, 64 }, + { "mx25ll64", 0xc2, 0x2017, 64 * 1024, 128 }, + { "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256 }, + { "s25fl128", 0x01, 0x2018, 64 * 1024, 256 }, +}; + +static uint8_t +mx25l_get_status(device_t dev) +{ + uint8_t txBuf[2], rxBuf[2]; + struct spi_command cmd; + int err; + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + txBuf[0] = CMD_READ_STATUS; + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; + cmd.rx_cmd_sz = 2; + cmd.tx_cmd_sz = 2; + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); + return (rxBuf[1]); +} + +static void +mx25l_wait_for_device_ready(device_t dev) +{ + while ((mx25l_get_status(dev) & STATUS_WIP)) + continue; +} + +static struct mx25l_flash_ident* +mx25l_get_device_ident(struct mx25l_softc *sc) +{ + device_t dev = sc->sc_dev; + uint8_t txBuf[8], rxBuf[8]; + struct spi_command cmd; + uint8_t manufacturer_id; + uint16_t dev_id; + int err, i; + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + txBuf[0] = CMD_READ_IDENT; + cmd.tx_cmd = &txBuf; + cmd.rx_cmd = &rxBuf; + /* + * Some compatible devices has extended two-bytes ID + * We'll use only manufacturer/deviceid atm + */ + cmd.tx_cmd_sz = 4; + cmd.rx_cmd_sz = 4; + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); + if (err) + return (NULL); + + manufacturer_id = rxBuf[1]; + dev_id = (rxBuf[2] << 8) | (rxBuf[3]); + + for (i = 0; + i < sizeof(flash_devices)/sizeof(struct mx25l_flash_ident); i++) { + if ((flash_devices[i].manufacturer_id == manufacturer_id) && + (flash_devices[i].device_id == dev_id)) + return &flash_devices[i]; + } + + printf("Unknown SPI flash device. Vendor: %02x, device id: %04x\n", + manufacturer_id, dev_id); + return (NULL); +} + +static void +mx25l_set_writable(device_t dev, int writable) +{ + uint8_t txBuf[1], rxBuf[1]; + struct spi_command cmd; + int err; + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + txBuf[0] = writable ? CMD_WRITE_ENABLE : CMD_WRITE_DISABLE; + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; + cmd.rx_cmd_sz = 1; + cmd.tx_cmd_sz = 1; + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); +} + +static void +mx25l_erase_sector(device_t dev, off_t sector) +{ + uint8_t txBuf[4], rxBuf[4]; + struct spi_command cmd; + int err; + + mx25l_wait_for_device_ready(dev); + mx25l_set_writable(dev, 1); + + memset(&cmd, 0, sizeof(cmd)); + memset(txBuf, 0, sizeof(txBuf)); + memset(rxBuf, 0, sizeof(rxBuf)); + + txBuf[0] = CMD_SECTOR_ERASE; + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; + cmd.rx_cmd_sz = 4; + cmd.tx_cmd_sz = 4; + txBuf[1] = ((sector >> 16) & 0xff); + txBuf[2] = ((sector >> 8) & 0xff); + txBuf[3] = (sector & 0xff); + err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); +} + +static int +mx25l_write(device_t dev, off_t offset, caddr_t data, off_t count) +{ + struct mx25l_softc *sc; + uint8_t txBuf[8], rxBuf[8]; + struct spi_command cmd; + off_t write_offset; + long bytes_to_write, bytes_writen; + device_t pdev; + int err = 0; + + pdev = device_get_parent(dev); + sc = device_get_softc(dev); + + cmd.tx_cmd_sz = 4; + cmd.rx_cmd_sz = 4; + + bytes_writen = 0; + write_offset = offset; + + /* + * Sanity checks + */ + KASSERT(count % sc->sc_sectorsize == 0, + ("count for BIO_WRITE is not sector size (%d bytes) aligned", + sc->sc_sectorsize)); + + KASSERT(offset % sc->sc_sectorsize == 0, + ("offset for BIO_WRITE is not sector size (%d bytes) aligned", + sc->sc_sectorsize)); + + /* + * Assume here that we write per-sector only + * and sector size should be 256 bytes aligned + */ + KASSERT(write_offset % FLASH_PAGE_SIZE == 0, + ("offset for BIO_WRITE is not page size (%d bytes) aligned", + FLASH_PAGE_SIZE)); + + /* + * Maximum write size for CMD_PAGE_PROGRAM is + * FLASH_PAGE_SIZE, so split data to chunks + * FLASH_PAGE_SIZE bytes eash and write them + * one by one + */ + while (bytes_writen < count) { + /* + * If we crossed sector boundary - erase next sector + */ + if (((offset + bytes_writen) % sc->sc_sectorsize) == 0) + mx25l_erase_sector(dev, offset + bytes_writen); + + txBuf[0] = CMD_PAGE_PROGRAM; + txBuf[1] = ((write_offset >> 16) & 0xff); + txBuf[2] = ((write_offset >> 8) & 0xff); + txBuf[3] = (write_offset & 0xff); + + bytes_to_write = MIN(FLASH_PAGE_SIZE, + count - bytes_writen); + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; + cmd.tx_data = data + bytes_writen; + cmd.tx_data_sz = bytes_to_write; + cmd.rx_data = data + bytes_writen; + cmd.rx_data_sz = bytes_to_write; + + /* + * Eash completed write operation resets WEL + * (write enable latch) to disabled state, + * so we re-enable it here + */ + mx25l_wait_for_device_ready(dev); + mx25l_set_writable(dev, 1); + + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + if (err) + break; + + bytes_writen += bytes_to_write; + write_offset += bytes_to_write; + } + + return (err); +} + +static int +mx25l_read(device_t dev, off_t offset, caddr_t data, off_t count) +{ + struct mx25l_softc *sc; + uint8_t txBuf[8], rxBuf[8]; + struct spi_command cmd; + device_t pdev; + int err = 0; + + pdev = device_get_parent(dev); + sc = device_get_softc(dev); + + /* + * Sanity checks + */ + KASSERT(count % sc->sc_sectorsize == 0, + ("count for BIO_WRITE is not sector size (%d bytes) aligned", + sc->sc_sectorsize)); + + KASSERT(offset % sc->sc_sectorsize == 0, + ("offset for BIO_WRITE is not sector size (%d bytes) aligned", + sc->sc_sectorsize)); + + txBuf[0] = CMD_FAST_READ; + cmd.tx_cmd_sz = 5; + cmd.rx_cmd_sz = 5; + + txBuf[1] = ((offset >> 16) & 0xff); + txBuf[2] = ((offset >> 8) & 0xff); + txBuf[3] = (offset & 0xff); + /* Dummy byte */ + txBuf[4] = 0; + + cmd.tx_cmd = txBuf; + cmd.rx_cmd = rxBuf; + cmd.tx_data = data; + cmd.tx_data_sz = count; + cmd.rx_data = data; + cmd.rx_data_sz = count; + + err = SPIBUS_TRANSFER(pdev, dev, &cmd); + + return (err); +} + +static int +mx25l_probe(device_t dev) +{ + device_set_desc(dev, "M25Pxx Flash Family"); + return (0); +} + +static int +mx25l_attach(device_t dev) +{ + struct mx25l_softc *sc; + struct mx25l_flash_ident *ident; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + M25PXX_LOCK_INIT(sc); + + ident = mx25l_get_device_ident(sc); + if (ident == NULL) + return (ENXIO); + + mx25l_wait_for_device_ready(sc->sc_dev); + + sc->sc_disk = disk_alloc(); + sc->sc_disk->d_open = mx25l_open; + sc->sc_disk->d_close = mx25l_close; + sc->sc_disk->d_strategy = mx25l_strategy; + sc->sc_disk->d_ioctl = mx25l_ioctl; + sc->sc_disk->d_name = "flash/spi"; + sc->sc_disk->d_drv1 = sc; + sc->sc_disk->d_maxsize = DFLTPHYS; + sc->sc_disk->d_sectorsize = ident->sectorsize; + sc->sc_disk->d_mediasize = ident->sectorsize * ident->sectorcount; + sc->sc_disk->d_unit = device_get_unit(sc->sc_dev); + sc->sc_disk->d_dump = NULL; /* NB: no dumps */ + /* Sectorsize for erase operations */ + sc->sc_sectorsize = ident->sectorsize; + + /* NB: use stripesize to hold the erase/region size for RedBoot */ + sc->sc_disk->d_stripesize = ident->sectorsize; + + disk_create(sc->sc_disk, DISK_VERSION); + bioq_init(&sc->sc_bio_queue); + + kproc_create(&mx25l_task, sc, &sc->sc_p, 0, 0, "task: mx25l flash"); + device_printf(sc->sc_dev, "%s, sector %d bytes, %d sectors\n", + ident->name, ident->sectorsize, ident->sectorcount); + + return (0); +} + +static int +mx25l_detach(device_t dev) +{ + + return (EIO); +} + +static int +mx25l_open(struct disk *dp) +{ + return (0); +} + +static int +mx25l_close(struct disk *dp) +{ + + return (0); +} + +static int +mx25l_ioctl(struct disk *dp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + + return (EINVAL); +} + +static void +mx25l_strategy(struct bio *bp) +{ + struct mx25l_softc *sc; + + sc = (struct mx25l_softc *)bp->bio_disk->d_drv1; + M25PXX_LOCK(sc); + bioq_disksort(&sc->sc_bio_queue, bp); + wakeup(sc); + M25PXX_UNLOCK(sc); +} + +static void +mx25l_task(void *arg) +{ + struct mx25l_softc *sc = (struct mx25l_softc*)arg; + struct bio *bp; + device_t dev; + + for (;;) { + dev = sc->sc_dev; + M25PXX_LOCK(sc); + do { + bp = bioq_first(&sc->sc_bio_queue); + if (bp == NULL) + msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); + } while (bp == NULL); + bioq_remove(&sc->sc_bio_queue, bp); + M25PXX_UNLOCK(sc); + + switch (bp->bio_cmd) { + case BIO_READ: + bp->bio_error = mx25l_read(dev, bp->bio_offset, + bp->bio_data, bp->bio_bcount); + break; + case BIO_WRITE: + bp->bio_error = mx25l_write(dev, bp->bio_offset, + bp->bio_data, bp->bio_bcount); + break; + default: + bp->bio_error = EINVAL; + } + + + biodone(bp); + } +} + +static devclass_t mx25l_devclass; + +static device_method_t mx25l_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mx25l_probe), + DEVMETHOD(device_attach, mx25l_attach), + DEVMETHOD(device_detach, mx25l_detach), + + { 0, 0 } +}; + +static driver_t mx25l_driver = { + "mx25l", + mx25l_methods, + sizeof(struct mx25l_softc), +}; + +DRIVER_MODULE(mx25l, spibus, mx25l_driver, mx25l_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:16:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100DF106568F; Sun, 10 Jan 2010 05:16:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA62C8FC19; Sun, 10 Jan 2010 05: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 o0A5GtSS025876; Sun, 10 Jan 2010 05:16:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5GtXA025874; Sun, 10 Jan 2010 05:16:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100516.o0A5GtXA025874@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:16: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: r201982 - head/sys/dev/flash X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:16:56 -0000 Author: imp Date: Sun Jan 10 05:16:55 2010 New Revision: 201982 URL: http://svn.freebsd.org/changeset/base/201982 Log: Merge from projects/mips to head by hand: merge register definitions for mx25l flash. Added: - copied unchanged from r201981, projects/mips/sys/dev/flash/mx25lreg.h Directory Properties: head/sys/dev/flash/mx25lreg.h (props changed) Copied: head/sys/dev/flash/mx25lreg.h (from r201981, projects/mips/sys/dev/flash/mx25lreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/flash/mx25lreg.h Sun Jan 10 05:16:55 2010 (r201982, copy of r201981, projects/mips/sys/dev/flash/mx25lreg.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __MX25LREG_H__ +#define __MX25LREG_H__ + +/* + * Commands + */ +#define CMD_WRITE_ENABLE 0x06 +#define CMD_WRITE_DISABLE 0x04 +#define CMD_READ_IDENT 0x9F +#define CMD_READ_STATUS 0x05 +#define CMD_WRITE_STATUS 0x01 +#define CMD_READ 0x03 +#define CMD_FAST_READ 0x0B +#define CMD_PAGE_PROGRAM 0x02 +#define CMD_SECTOR_ERASE 0xD8 +#define CMD_BULK_ERASE 0xC7 + +/* + * Status register flags + */ +#define STATUS_SRWD (1 << 7) +#define STATUS_BP2 (1 << 4) +#define STATUS_BP1 (1 << 3) +#define STATUS_BP0 (1 << 2) +#define STATUS_WEL (1 << 1) +#define STATUS_WIP (1 << 0) + +#define FLASH_PAGE_SIZE 256 + +#endif /* __MX25LREG_H__ */ + From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:28:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB9B106566C; Sun, 10 Jan 2010 05:28:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9DD8FC15; Sun, 10 Jan 2010 05: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 o0A5SaGH028460; Sun, 10 Jan 2010 05:28:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5SawI028458; Sun, 10 Jan 2010 05:28:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100528.o0A5SawI028458@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:28: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: r201983 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:28:37 -0000 Author: imp Date: Sun Jan 10 05:28:36 2010 New Revision: 201983 URL: http://svn.freebsd.org/changeset/base/201983 Log: Merge r192355 from projects/mips to head by hand: r192355 | gonzo | 2009-05-18 17:20:56 -0600 (Mon, 18 May 2009) | 2 lines - Add support for MX25Lxxx SPI flash (readonly atm) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 10 05:16:55 2010 (r201982) +++ head/sys/conf/files Sun Jan 10 05:28:36 2010 (r201983) @@ -933,6 +933,7 @@ dev/firewire/if_fwip.c optional fwip dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/flash/at45d.c optional at45d +dev/flash/mx25l.c optional mx25l dev/fxp/if_fxp.c optional fxp inet dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:34:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DBAE106566B; Sun, 10 Jan 2010 05:34:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D32B8FC0C; Sun, 10 Jan 2010 05:34: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 o0A5YkRB029860; Sun, 10 Jan 2010 05:34:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5Yk0V029858; Sun, 10 Jan 2010 05:34:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100534.o0A5Yk0V029858@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:34: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: r201984 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:34:46 -0000 Author: imp Date: Sun Jan 10 05:34:46 2010 New Revision: 201984 URL: http://svn.freebsd.org/changeset/base/201984 Log: Merge r187428, r191079, r195533, r195669, r197004, r197012 and r197015 from projects/mips to head by hand: r197015 | imp | 2009-09-08 21:59:46 -0600 (Tue, 08 Sep 2009) | 2 lines Prefer PTR_LA over a naked la to work with 64-bits.. r197012 | imp | 2009-09-08 21:46:04 -0600 (Tue, 08 Sep 2009) | 3 lines Use proper set of flags to build the tramp. this gets 64-bit almost building and lets me debug the 'almost' :) r197004 | imp | 2009-09-08 18:47:12 -0600 (Tue, 08 Sep 2009) | 2 lines Use ${LDSCRIPT_NAME} in preference to ldscript.$M. r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines - Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default now (as it should be) r195533 | imp | 2009-07-10 01:21:26 -0600 (Fri, 10 Jul 2009) | 4 lines Add in the emulation selection when linking... We're still not 100% of the way there, but we're better with it. hack.so build now, but we die when we try to link it in. r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines - Revert changes accidentally killed by merge operation r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines - Add trampoline stuff for bootloaders that do not support ELF - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with KERNLOADADDR/TRAMPLOADADDR and clean configs Modified: head/sys/conf/Makefile.mips Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Sun Jan 10 05:28:36 2010 (r201983) +++ head/sys/conf/Makefile.mips Sun Jan 10 05:34:46 2010 (r201984) @@ -28,35 +28,83 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" +LDSCRIPT_NAME?=ldscript.$M +SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}} +SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}} + # XXX: Such sweeping assumptions... MACHINE=mips MACHINE_ARCH=mips +KERNLOADADDR?=0x80001000 +# This obscure value is defined by CFE for WR160N +# To be changed later +TRAMPLOADADDR?=0x807963c0 MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} # We default to the MIPS32 ISA, if none specified in the # kernel configuration file. ARCH_FLAGS?=-march=mips32 +EXTRA_FLAGS=-fno-pic -mno-abicalls -G0 HACK_EXTRA_FLAGS=-shared .if defined(TARGET_BIG_ENDIAN) CFLAGS+=-EB SYSTEM_LD+=-EB +EXTRA_FLAGS+=-EB +TRAMP_LDFLAGS+=-Wl,-EB HACK_EXTRA_FLAGS+=-EB -Wl,-EB +.if defined(TARGET_64BIT) +SYSTEM_LD+=-m elf64btsmip_fbsd +HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd +.endif .else CFLAGS+=-EL SYSTEM_LD+=-EL +EXTRA_FLAGS+=-EL +TRAMP_LDFLAGS+=-Wl,-EL HACK_EXTRA_FLAGS+=-EL -Wl,-EL +.if defined(TARGET_64BIT) +SYSTEM_LD+=-m elf64ltsmip_fbsd +HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd +.endif .endif + # We add the -fno-pic flag to kernels because otherwise performance # is extremely poor, as well as -mno-abicalls to force no ABI usage. -CFLAGS+=-fno-pic -mno-abicalls -G0 $(ARCH_FLAGS) -HACK_EXTRA_FLAGS+=-fno-pic -mno-abicalls -G0 $(ARCH_FLAGS) +CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) +HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) # XXX hardcoded kernel entry point ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE +KERNEL_EXTRA=trampoline +trampoline: ${KERNEL_KO}.tramp.bin +${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \ + $S/$M/$M/inckern.S + ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ + -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp + sed s/${KERNLOADADDR}/${TRAMPLOADADDR}/ ${LDSCRIPT_NAME} | \ + sed s/" + SIZEOF_HEADERS"// > ${LDSCRIPT_NAME}.tramp.noheader + # Generate .S file that setups stack and jumps to trampoline + echo "#include " >tmphack.S + echo "ENTRY(_start)" >>tmphack.S + echo "PTR_LA t0, kernel_end" >>tmphack.S + echo "move sp, t0" >>tmphack.S + echo "add sp, 0x2000" >>tmphack.S + echo "and sp, ~0x7" >>tmphack.S + echo "PTR_LA t0, _startC" >>tmphack.S + echo "j t0" >>tmphack.S + echo "END(_start)" >>tmphack.S + echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h + ${CC} -O -nostdlib -I. -I$S ${HACK_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ + -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader tmphack.S \ + $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \ + -o ${KERNEL_KO}.tramp.noheader + ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ + ${KERNEL_KO}.tramp.bin \ + %BEFORE_DEPEND %OBJS @@ -69,6 +117,12 @@ ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE %CLEAN +CLEAN+= ${LDSCRIPT_NAME} ${LDSCRIPT_NAME}.tramp.noheader \ + ${KERNEL_KO}.tramp.noheader ${KERNEL_KO}.tramp.bin + +${LDSCRIPT_NAME}: $S/conf/${LDSCRIPT_NAME} + cat $S/conf/${LDSCRIPT_NAME}|sed s/KERNLOADADDR/${KERNLOADADDR}/g \ + > ${LDSCRIPT_NAME} %RULES .include "$S/conf/kern.post.mk" From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:36:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2048E106566B; Sun, 10 Jan 2010 05:36:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1066D8FC15; Sun, 10 Jan 2010 05:36: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 o0A5acuK030324; Sun, 10 Jan 2010 05:36:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5acVV030322; Sun, 10 Jan 2010 05:36:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100536.o0A5acVV030322@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05:36: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: r201985 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:36:39 -0000 Author: imp Date: Sun Jan 10 05:36:38 2010 New Revision: 201985 URL: http://svn.freebsd.org/changeset/base/201985 Log: Merge r187418 from projects/mips to head by hand: r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines - Add trampoline stuff for bootloaders that do not support ELF - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with KERNLOADADDR/TRAMPLOADADDR and clean configs Modified: head/sys/conf/ldscript.mips Modified: head/sys/conf/ldscript.mips ============================================================================== --- head/sys/conf/ldscript.mips Sun Jan 10 05:34:46 2010 (r201984) +++ head/sys/conf/ldscript.mips Sun Jan 10 05:36:38 2010 (r201985) @@ -43,7 +43,7 @@ PROVIDE (_DYNAMIC = 0); SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x80100000 + SIZEOF_HEADERS; + . = KERNLOADADDR + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 05:46:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D616106566B; Sun, 10 Jan 2010 05:46:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BAE18FC1C; Sun, 10 Jan 2010 05: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 o0A5kKIs032460; Sun, 10 Jan 2010 05:46:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A5kK7o032457; Sun, 10 Jan 2010 05:46:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001100546.o0A5kK7o032457@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 05: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: r201986 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 05:46:20 -0000 Author: imp Date: Sun Jan 10 05:46:19 2010 New Revision: 201986 URL: http://svn.freebsd.org/changeset/base/201986 Log: Merge from projects/mips to head by hand: r200593 | imp | 2009-12-15 16:22:19 -0700 (Tue, 15 Dec 2009) | 4 lines Remove the now-obsolete comments about compile-with. There are no compile-with lines in this file at all. So we don't need two warnings about them. r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198311 | neel | 2009-10-20 18:56:13 -0600 (Tue, 20 Oct 2009) | 8 lines Update options.mips to support config options required to build the SWARM kernel. The SWARM kernel does not build yet but at least it gets past the kernel config stage. r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r196315 | imp | 2009-08-17 06:37:06 -0600 (Mon, 17 Aug 2009) | 5 lines Like qdivrem, remove the other quad_t support stuff from 64-bit kernels. r195331 | imp | 2009-07-03 20:49:17 -0600 (Fri, 03 Jul 2009) | 4 lines Merge in new cfe environment passing of kenv for swarm/sibyte boards. Submitted by: Neelkanth Natu r195732 | gonzo | 2009-07-16 20:28:27 -0600 (Thu, 16 Jul 2009) | 2 lines - Add DES and Blowfish implementstions to build. Required by crypto(4) r195437 | imp | 2009-07-07 23:57:58 -0600 (Tue, 07 Jul 2009) | 2 lines The kernel isn't quite ready for this to be optional... r195401 | imp | 2009-07-06 02:16:25 -0600 (Mon, 06 Jul 2009) | 4 lines Only build qdivrem on 32-bit ISA... r195331 | imp | 2009-07-03 20:49:17 -0600 (Fri, 03 Jul 2009) | 4 lines Merge in new cfe environment passing of kenv for swarm/sibyte boards. Submitted by: Neelkanth Natu r195165 | gonzo | 2009-06-29 11:36:47 -0600 (Mon, 29 Jun 2009) | 2 lines - add sys_machdep.c to build r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default we assume that there is no FPU, because majority of SoC does not have it. r191085 | gonzo | 2009-04-14 20:41:35 -0600 (Tue, 14 Apr 2009) | 2 lines - mainbus.c seems not to be used, disconnect it from build r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines - Add trampoline stuff for bootloaders that do not support ELF - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with KERNLOADADDR/TRAMPLOADADDR and clean configs r187415 | gonzo | 2009-01-18 16:49:02 -0700 (Sun, 18 Jan 2009) | 3 lines - Move Silicon Backplanes code out to system-wide level (dev/siba) as it's going to be used not only for siba5 devices. Modified: head/sys/conf/files.mips head/sys/conf/options.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sun Jan 10 05:36:38 2010 (r201985) +++ head/sys/conf/files.mips Sun Jan 10 05:46:19 2010 (r201986) @@ -5,10 +5,6 @@ # All rights reserved. # JNPR: files.mips,v 1.11 2007/08/09 12:25:35 katta # -# The long compile-with and dependency lines are required because of -# limitations in config: backslash-newline doesn't work in strings, and -# dependency lines other than the first are silently ignored. -# # ---------------------------------------------------------------------- # Phase 2 # ---------------------------------------------------------------------- @@ -20,10 +16,6 @@ # JNPR: files.mips,v 1.11 2007/08/09 12:25:35 katta # $FreeBSD$ # -# The long compile-with and dependency lines are required because of -# limitations in config: backslash-newline doesn't work in strings, and -# dependency lines other than the first are silently ignored. -# # ---------------------------------------------------------------------- # Phase 2 # ---------------------------------------------------------------------- @@ -38,14 +30,13 @@ mips/mips/cpu.c standard mips/mips/elf_machdep.c standard mips/mips/exception.S standard mips/mips/gdb_machdep.c standard -mips/mips/mainbus.c standard +# mips/mips/mainbus.c standard mips/mips/pmap.c standard mips/mips/trap.c standard mips/mips/vm_machdep.c standard # ---------------------------------------------------------------------- # Phase 4 # ---------------------------------------------------------------------- -mips/mips/tick.c standard # ---------------------------------------------------------------------- # Phase 5 # ---------------------------------------------------------------------- @@ -54,6 +45,7 @@ mips/mips/pm_machdep.c standard mips/mips/swtch.S standard mips/mips/tlb.S standard +mips/mips/bus_space_generic.c standard mips/mips/busdma_machdep.c standard mips/mips/cache.c standard mips/mips/cache_mipsNN.c standard @@ -63,30 +55,32 @@ mips/mips/db_interface.c optional ddb mips/mips/db_trace.c optional ddb mips/mips/dump_machdep.c standard mips/mips/in_cksum.c optional inet -mips/mips/intr_machdep.c standard mips/mips/locore.S standard no-obj mips/mips/mem.c optional mem mips/mips/nexus.c standard mips/mips/stack_machdep.c optional ddb | stack mips/mips/support.S standard +mips/mips/sys_machdep.c standard mips/mips/swtch.S standard mips/mips/uio_machdep.c standard +crypto/blowfish/bf_enc.c optional crypto | ipsec +crypto/des/des_enc.c optional crypto | ipsec | netsmb geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd geom/geom_mbr.c optional geom_mbr geom/geom_mbr_enc.c optional geom_mbr libkern/ashldi3.c standard libkern/ashrdi3.c standard -libkern/divdi3.c standard +libkern/divdi3.c optional isa_mips32 libkern/ffsl.c standard libkern/fls.c standard libkern/flsl.c standard libkern/lshrdi3.c standard libkern/memmove.c standard -libkern/moddi3.c standard -libkern/qdivrem.c standard -libkern/udivdi3.c standard -libkern/umoddi3.c standard +libkern/moddi3.c optional isa_mips32 +libkern/qdivrem.c optional isa_mips32 +libkern/udivdi3.c optional isa_mips32 +libkern/umoddi3.c optional isa_mips32 #XXX: We can't use these versions, as strcmp.c is included conf/files #libkern/mips/strcmp.S standard @@ -94,5 +88,10 @@ libkern/umoddi3.c standard dev/cfe/cfe_api.c optional cfe dev/cfe/cfe_console.c optional cfe_console +dev/cfe/cfe_env.c optional cfe_env #dev/cfe/cfe_resource.c optional cfe # not yet needed +dev/siba/siba.c optional siba +dev/siba/siba_pcib.c optional siba pci +dev/siba/siba_cc.c optional siba +#mips/sentry5/siba_mips.c optional siba # not yet Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sun Jan 10 05:36:38 2010 (r201985) +++ head/sys/conf/options.mips Sun Jan 10 05:46:19 2010 (r201986) @@ -31,8 +31,9 @@ CPU_MIPS4KC opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h -CPU_NOFPU opt_global.h CPU_SENTRY5 opt_global.h +CPU_HAVEFPU opt_global.h +CPU_SB1 opt_global.h ISA_MIPS1 opt_cputype.h ISA_MIPS3 opt_cputype.h @@ -44,14 +45,30 @@ ISA_MIPS64v2 opt_cputype.h YAMON opt_global.h CFE opt_global.h CFE_CONSOLE opt_global.h +CFE_ENV opt_global.h +CFE_ENV_SIZE opt_global.h KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h PHYSADDR opt_global.h -SOFTFLOAT opt_global.h - +PHYS_ADDR_64BIT opt_global.h +NOFPU opt_global.h TARGET_OCTEON opt_global.h TARGET_EMULATOR opt_ddb.h +TARGET_XLR_XLS opt_global.h TICK_USE_YAMON_FREQ opt_global.h TICK_USE_MALTA_RTC opt_global.h + +# +# The MIPS architecture does not have separate memory and i/o address space +# like x86. However some MIPS processors provide a memory-mapped window that +# maps onto the PCI I/O space. +# +PCI_IOSPACE_SIZE opt_global.h +PCI_IOSPACE_ADDR opt_global.h + +# +# The highest memory address that can be used by the kernel in units of KB. +# +MAXMEM opt_global.h From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 07:18:53 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00452106566C; Sun, 10 Jan 2010 07:18:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 72E268FC19; Sun, 10 Jan 2010 07:18:52 +0000 (UTC) Received: from besplex.bde.org (c122-106-175-149.carlnfd1.nsw.optusnet.com.au [122.106.175.149]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0A7ImEV004925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 10 Jan 2010 18:18:49 +1100 Date: Sun, 10 Jan 2010 18:18:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jaakko Heinonen In-Reply-To: <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> Message-ID: <20100110181132.D1354@besplex.bde.org> References: <201001080757.o087vhrr009799@svn.freebsd.org> <20100109051536.R57595@delplex.bde.org> <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> 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: r201773 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 07:18:53 -0000 On Fri, 8 Jan 2010, Jaakko Heinonen wrote: > Does following patch look reasonable? > > - Fix style bugs introduced in r201773. > - Change the type of nodes_max to u_int and use "%u" format string to > convert its value. > Index: sys/fs/tmpfs/tmpfs_vfsops.c > =================================================================== > --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 201818) > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) > * allowed to use, based on the maximum size the user passed in > * the mount structure. A value of zero is treated as if the > * maximum available space was requested. */ > - if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) > + if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE) > pages = SIZE_MAX; I think you should change this to use howmany() (or set size_max and join the else clause) too. > else > pages = howmany(size_max, PAGE_SIZE); OK. Gleb Kurtsou reported a more interesting problem related to large values of `pages' being too large. I'll let you look at this... IIRC he made the byte limit UINT_MAX. Perhaps it should be a small fraction of the address space (UINT_MAX is still larger than physically possible for 32-bit systems). Bruce From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 08:02:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC33A106566B; Sun, 10 Jan 2010 08:02:07 +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 BBB8E8FC12; Sun, 10 Jan 2010 08:02: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 o0A827ff062194; Sun, 10 Jan 2010 08:02:07 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A827qE062190; Sun, 10 Jan 2010 08:02:07 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001100802.o0A827qE062190@svn.freebsd.org> From: Ruslan Ermilov Date: Sun, 10 Jan 2010 08:02: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: r201989 - in head: contrib/one-true-awk usr.bin/awk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 08:02:07 -0000 Author: ru Date: Sun Jan 10 08:02:07 2010 New Revision: 201989 URL: http://svn.freebsd.org/changeset/base/201989 Log: Apply patches directly to sources. Their effect is as follows: - Make one-true-awk respect locale's collating order in [a-z] bracket expressions, until a more complete fix (like handing BREs) is ready. - Don't require a space between -[fv] and its argument. Deleted: head/usr.bin/awk/b.c.diff head/usr.bin/awk/main.c.diff head/usr.bin/awk/run.c.diff Modified: head/contrib/one-true-awk/b.c head/contrib/one-true-awk/main.c head/contrib/one-true-awk/run.c head/usr.bin/awk/Makefile Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sun Jan 10 07:18:35 2010 (r201988) +++ head/contrib/one-true-awk/b.c Sun Jan 10 08:02:07 2010 (r201989) @@ -24,6 +24,9 @@ THIS SOFTWARE. /* lasciate ogne speranza, voi ch'intrate. */ +#include +__FBSDID("$FreeBSD$"); + #define DEBUG #include @@ -285,9 +288,21 @@ int quoted(char **pp) /* pick up next th return c; } +static int collate_range_cmp(int a, int b) +{ + static char s[2][2]; + + if ((uschar)a == (uschar)b) + return 0; + s[0][0] = a; + s[1][0] = b; + return (strcoll(s[0], s[1])); +} + char *cclenter(const char *argp) /* add a character class */ { int i, c, c2; + int j; uschar *p = (uschar *) argp; uschar *op, *bp; static uschar *buf = 0; @@ -306,15 +321,18 @@ char *cclenter(const char *argp) /* add c2 = *p++; if (c2 == '\\') c2 = quoted((char **) &p); - if (c > c2) { /* empty; ignore */ + if (collate_range_cmp(c, c2) > 0) { bp--; i--; continue; } - while (c < c2) { + for (j = 0; j < NCHARS; j++) { + if ((collate_range_cmp(c, j) > 0) || + collate_range_cmp(j, c2) > 0) + continue; if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) FATAL("out of space for character class [%.10s...] 2", p); - *bp++ = ++c; + *bp++ = j; i++; } continue; Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Sun Jan 10 07:18:35 2010 (r201988) +++ head/contrib/one-true-awk/main.c Sun Jan 10 08:02:07 2010 (r201989) @@ -22,7 +22,10 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20091126"; +#include +__FBSDID("$FreeBSD$"); + +const char *version = "version 20091126 (FreeBSD)"; #define DEBUG #include @@ -58,6 +61,7 @@ int main(int argc, char *argv[]) const char *fs = NULL; setlocale(LC_CTYPE, ""); + setlocale(LC_COLLATE, ""); setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = argv[0]; if (argc == 1) { @@ -86,13 +90,18 @@ int main(int argc, char *argv[]) safe = 1; break; case 'f': /* next argument is program filename */ - argc--; - argv++; - if (argc <= 1) - FATAL("no program filename"); - if (npfile >= MAX_PFILE - 1) - FATAL("too many -f options"); - pfile[npfile++] = argv[1]; + if (argv[1][2] != 0) { /* arg is -fsomething */ + if (npfile >= MAX_PFILE - 1) + FATAL("too many -f options"); + pfile[npfile++] = &argv[1][2]; + } else { /* arg is -f something */ + argc--; argv++; + if (argc <= 1) + FATAL("no program filename"); + if (npfile >= MAX_PFILE - 1) + FATAL("too many -f options"); + pfile[npfile++] = argv[1]; + } break; case 'F': /* set field separator */ if (argv[1][2] != 0) { /* arg is -Fsomething */ @@ -111,8 +120,14 @@ int main(int argc, char *argv[]) WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ - if (argv[1][2] == '\0' && --argc > 1 && isclvar((++argv)[1])) - setclvar(argv[1]); + if (argv[1][2] != 0) { /* arg is -vsomething */ + if (argv[1][2] != 0) + setclvar(&argv[1][2]); + } else { /* arg is -v something */ + argc--; argv++; + if (argc > 1 && isclvar(argv[1])) + setclvar(argv[1]); + } break; case 'd': dbg = atoi(&argv[1][2]); Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Sun Jan 10 07:18:35 2010 (r201988) +++ head/contrib/one-true-awk/run.c Sun Jan 10 08:02:07 2010 (r201989) @@ -22,6 +22,9 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ +#include +__FBSDID("$FreeBSD$"); + #define DEBUG #include #include @@ -653,7 +656,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[ j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { - i = strcmp(getsval(x), getsval(y)); + i = strcoll(getsval(x), getsval(y)); } tempfree(x); tempfree(y); Modified: head/usr.bin/awk/Makefile ============================================================================== --- head/usr.bin/awk/Makefile Sun Jan 10 07:18:35 2010 (r201988) +++ head/usr.bin/awk/Makefile Sun Jan 10 08:02:07 2010 (r201989) @@ -27,10 +27,4 @@ proctab.c: maketab build-tools: maketab maketab: ytab.h ${AWKSRC}/maketab.c -.for f in b.c main.c run.c -${f}: ${AWKSRC}/${f} ${.CURDIR}/${f}.diff - patch -s -b .orig -o ${.TARGET} < ${.CURDIR}/${f}.diff ${AWKSRC}/${f} -CLEANFILES+= ${f} -.endfor - .include From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 09:03:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C2D106566C; Sun, 10 Jan 2010 09:03:29 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id BF4058FC08; Sun, 10 Jan 2010 09:03:28 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0A93Pmm040373; Sun, 10 Jan 2010 12:03:25 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263114206; bh=q7UdsxG+HedhiZlQvaUJRlGSh13o2Dpp4gCA+IZ46BM=; l=143; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=Z8y6jqKILLTilsdLdvaxkb2ILCjTtiZKuYEqoRaJnEP4WV24ztdcIpafSJrBBkDSX nn3k/fFJsX0OytKmGN+B11X7VR/xYoDEf03djSyq81xseBGznoeq5HD+eYbHCgqyoU aLNikqHI0QO0rLAnxRIHznmYc7eX4QRyiRJjZTYo= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0A93OJb040372; Sun, 10 Jan 2010 12:03:24 +0300 (MSK) (envelope-from ache) Date: Sun, 10 Jan 2010 12:03:22 +0300 From: Andrey Chernov To: Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100110090321.GA40262@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001052020.o05KKVEp002337@svn.freebsd.org> <20100107050409.GA85573@nagual.pp.ru> <20100108030937.Q56559@delplex.bde.org> <20100108061123.GA13136@nagual.pp.ru> <20100108062634.GA14489@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100108062634.GA14489@nagual.pp.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 09:03:29 -0000 Well. Since I see no objections so far, I'll plan to commit strcmp()->strcoll() replacement in alphasort() soon. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 09:20:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2218C106566C; Sun, 10 Jan 2010 09:20:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1169B8FC08; Sun, 10 Jan 2010 09:20: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 o0A9Ku6K079423; Sun, 10 Jan 2010 09:20:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A9Kukc079420; Sun, 10 Jan 2010 09:20:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001100920.o0A9Kukc079420@svn.freebsd.org> From: Alexander Motin Date: Sun, 10 Jan 2010 09:20: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: r201990 - in head/sys: cam/ata dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 09:20:57 -0000 Author: mav Date: Sun Jan 10 09:20:56 2010 New Revision: 201990 URL: http://svn.freebsd.org/changeset/base/201990 Log: - Report SATA in legacy emulation mode still as SATA. - Make ATA XPT able to handle such case. Modified: head/sys/cam/ata/ata_xpt.c head/sys/dev/ata/ata-all.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Jan 10 08:02:07 2010 (r201989) +++ head/sys/cam/ata/ata_xpt.c Sun Jan 10 09:20:56 2010 (r201990) @@ -1001,7 +1001,6 @@ typedef struct { union ccb *request_ccb; struct ccb_pathinq *cpi; int counter; - int found; } ata_scan_bus_info; /* @@ -1049,14 +1048,11 @@ ata_scan_bus(struct cam_periph *periph, } scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; - if (scan_info->cpi->transport == XPORT_ATA) - scan_info->found = 0x0003; - else - scan_info->found = 0x8001; - scan_info->counter = 0; /* If PM supported, probe it first. */ if (scan_info->cpi->hba_inquiry & PI_SATAPM) - scan_info->counter = 15; + scan_info->counter = scan_info->cpi->max_target; + else + scan_info->counter = 0; work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { @@ -1073,10 +1069,11 @@ ata_scan_bus(struct cam_periph *periph, /* Free the current request path- we're done with it. */ xpt_free_path(work_ccb->ccb_h.path); /* If there is PMP... */ - if (scan_info->counter == 15) { + if ((scan_info->cpi->hba_inquiry & PI_SATAPM) && + (scan_info->counter == scan_info->cpi->max_target)) { if (work_ccb->ccb_h.ppriv_field1 != 0) { /* everything else willbe probed by it */ - scan_info->found = 0x8000; + goto done; } else { struct ccb_trans_settings cts; @@ -1091,11 +1088,10 @@ ata_scan_bus(struct cam_periph *periph, xpt_action((union ccb *)&cts); } } -take_next: - /* Take next device. Wrap from 15 (PM) to 0. */ - scan_info->counter = (scan_info->counter + 1 ) & 0x0f; - if (scan_info->counter > scan_info->cpi->max_target - - ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? 1 : 0)) { + if (scan_info->counter == + ((scan_info->cpi->hba_inquiry & PI_SATAPM) ? + 0 : scan_info->cpi->max_target)) { +done: xpt_free_ccb(work_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; @@ -1104,9 +1100,10 @@ take_next: xpt_done(request_ccb); break; } + /* Take next device. Wrap from max (PMP) to 0. */ + scan_info->counter = (scan_info->counter + 1 ) % + (scan_info->cpi->max_target + 1); scan_next: - if ((scan_info->found & (1 << scan_info->counter)) == 0) - goto take_next; status = xpt_create_path(&path, xpt_periph, scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sun Jan 10 08:02:07 2010 (r201989) +++ head/sys/dev/ata/ata-all.c Sun Jan 10 09:20:56 2010 (r201990) @@ -1473,7 +1473,7 @@ ataaction(struct cam_sim *sim, union ccb d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; - if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + if (ch->flags & ATA_SATA) { if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) d->revision = cts->xport_specific.sata.revision; if (cts->xport_specific.ata.valid & CTS_SATA_VALID_MODE) { @@ -1497,8 +1497,6 @@ ataaction(struct cam_sim *sim, union ccb } if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) d->bytecount = cts->xport_specific.ata.bytecount; - if (ch->flags & ATA_SATA) - d->bytecount = min(8192, d->bytecount); } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -1515,7 +1513,7 @@ ataaction(struct cam_sim *sim, union ccb d = &ch->user[ccb->ccb_h.target_id]; cts->protocol = PROTO_ATA; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; - if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; cts->xport_specific.sata.mode = d->mode; @@ -1604,7 +1602,7 @@ ataaction(struct cam_sim *sim, union ccb strncpy(cpi->hba_vid, "ATA", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); - if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) + if (ch->flags & ATA_SATA) cpi->transport = XPORT_SATA; else cpi->transport = XPORT_ATA; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 09:31:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C85531065693; Sun, 10 Jan 2010 09:31:57 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B70CC8FC1F; Sun, 10 Jan 2010 09:31: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 o0A9VvDt081882; Sun, 10 Jan 2010 09:31:57 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0A9VvFx081880; Sun, 10 Jan 2010 09:31:57 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001100931.o0A9VvFx081880@svn.freebsd.org> From: David Xu Date: Sun, 10 Jan 2010 09:31: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: r201991 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 09:31:57 -0000 Author: davidxu Date: Sun Jan 10 09:31:57 2010 New Revision: 201991 URL: http://svn.freebsd.org/changeset/base/201991 Log: Make a chain be a list of queues, and make threads waiting for same key coalesce to same queue, this makes searching path shorter and improves performance. Also fix comments about shared PI-mutex. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sun Jan 10 09:20:56 2010 (r201990) +++ head/sys/kern/kern_umtx.c Sun Jan 10 09:31:57 2010 (r201991) @@ -144,20 +144,38 @@ struct umtx_q { /* Inherited priority from PP mutex */ u_char uq_inherited_pri; + + /* Spare queue ready to be reused */ + struct umtxq_queue *uq_spare_queue; + + /* The queue we on */ + struct umtxq_queue *uq_cur_queue; }; TAILQ_HEAD(umtxq_head, umtx_q); +/* Per-key wait-queue */ +struct umtxq_queue { + struct umtxq_head head; + struct umtx_key key; + LIST_ENTRY(umtxq_queue) link; + int length; +}; + +LIST_HEAD(umtxq_list, umtxq_queue); + /* Userland lock object's wait-queue chain */ struct umtxq_chain { /* Lock for this chain. */ struct mtx uc_lock; /* List of sleep queues. */ - struct umtxq_head uc_queue[2]; + struct umtxq_list uc_queue[2]; #define UMTX_SHARED_QUEUE 0 #define UMTX_EXCLUSIVE_QUEUE 1 + LIST_HEAD(, umtxq_queue) uc_spare_queue; + /* Busy flag */ char uc_busy; @@ -166,6 +184,7 @@ struct umtxq_chain { /* All PI in the list */ TAILQ_HEAD(,umtx_pi) uc_pi_list; + }; #define UMTXQ_LOCKED_ASSERT(uc) mtx_assert(&(uc)->uc_lock, MA_OWNED) @@ -247,8 +266,9 @@ umtxq_sysinit(void *arg __unused) for (j = 0; j < UMTX_CHAINS; ++j) { mtx_init(&umtxq_chains[i][j].uc_lock, "umtxql", NULL, MTX_DEF | MTX_DUPOK); - TAILQ_INIT(&umtxq_chains[i][j].uc_queue[0]); - TAILQ_INIT(&umtxq_chains[i][j].uc_queue[1]); + LIST_INIT(&umtxq_chains[i][j].uc_queue[0]); + LIST_INIT(&umtxq_chains[i][j].uc_queue[1]); + LIST_INIT(&umtxq_chains[i][j].uc_spare_queue); TAILQ_INIT(&umtxq_chains[i][j].uc_pi_list); umtxq_chains[i][j].uc_busy = 0; umtxq_chains[i][j].uc_waiters = 0; @@ -265,6 +285,8 @@ umtxq_alloc(void) struct umtx_q *uq; uq = malloc(sizeof(struct umtx_q), M_UMTX, M_WAITOK | M_ZERO); + uq->uq_spare_queue = malloc(sizeof(struct umtxq_queue), M_UMTX, M_WAITOK | M_ZERO); + TAILQ_INIT(&uq->uq_spare_queue->head); TAILQ_INIT(&uq->uq_pi_contested); uq->uq_inherited_pri = PRI_MAX; return (uq); @@ -273,6 +295,8 @@ umtxq_alloc(void) void umtxq_free(struct umtx_q *uq) { + MPASS(uq->uq_spare_queue != NULL); + free(uq->uq_spare_queue, M_UMTX); free(uq, M_UMTX); } @@ -371,27 +395,72 @@ umtxq_unbusy(struct umtx_key *key) wakeup_one(uc); } +static struct umtxq_queue * +umtxq_queue_lookup(struct umtx_key *key, int q) +{ + struct umtxq_queue *uh; + struct umtxq_chain *uc; + + uc = umtxq_getchain(key); + UMTXQ_LOCKED_ASSERT(uc); + LIST_FOREACH(uh, &uc->uc_queue[q], link) { + if (umtx_key_match(&uh->key, key)) + return (uh); + } + + return (NULL); +} + static inline void umtxq_insert_queue(struct umtx_q *uq, int q) { + struct umtxq_queue *uh; struct umtxq_chain *uc; uc = umtxq_getchain(&uq->uq_key); UMTXQ_LOCKED_ASSERT(uc); - TAILQ_INSERT_TAIL(&uc->uc_queue[q], uq, uq_link); + KASSERT((uq->uq_flags & UQF_UMTXQ) == 0, ("umtx_q is already on queue")); + uh = umtxq_queue_lookup(&uq->uq_key, UMTX_SHARED_QUEUE); + if (uh != NULL) { + LIST_INSERT_HEAD(&uc->uc_spare_queue, uq->uq_spare_queue, link); + } else { + uh = uq->uq_spare_queue; + uh->key = uq->uq_key; + LIST_INSERT_HEAD(&uc->uc_queue[q], uh, link); + } + uq->uq_spare_queue = NULL; + + TAILQ_INSERT_TAIL(&uh->head, uq, uq_link); + uh->length++; uq->uq_flags |= UQF_UMTXQ; + uq->uq_cur_queue = uh; + return; } static inline void umtxq_remove_queue(struct umtx_q *uq, int q) { struct umtxq_chain *uc; + struct umtxq_queue *uh; uc = umtxq_getchain(&uq->uq_key); UMTXQ_LOCKED_ASSERT(uc); if (uq->uq_flags & UQF_UMTXQ) { - TAILQ_REMOVE(&uc->uc_queue[q], uq, uq_link); + uh = uq->uq_cur_queue; + TAILQ_REMOVE(&uh->head, uq, uq_link); + uh->length--; uq->uq_flags &= ~UQF_UMTXQ; + if (TAILQ_EMPTY(&uh->head)) { + KASSERT(uh->length == 0, + ("inconsistent umtxq_queue length")); + LIST_REMOVE(uh, link); + } else { + uh = LIST_FIRST(&uc->uc_spare_queue); + KASSERT(uh != NULL, ("uc_spare_queue is empty")); + LIST_REMOVE(uh, link); + } + uq->uq_spare_queue = uh; + uq->uq_cur_queue = NULL; } } @@ -402,18 +471,14 @@ static int umtxq_count(struct umtx_key *key) { struct umtxq_chain *uc; - struct umtx_q *uq; - int count = 0; + struct umtxq_queue *uh; uc = umtxq_getchain(key); UMTXQ_LOCKED_ASSERT(uc); - TAILQ_FOREACH(uq, &uc->uc_queue[UMTX_SHARED_QUEUE], uq_link) { - if (umtx_key_match(&uq->uq_key, key)) { - if (++count > 1) - break; - } - } - return (count); + uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); + if (uh != NULL) + return (uh->length); + return (0); } /* @@ -424,20 +489,17 @@ static int umtxq_count_pi(struct umtx_key *key, struct umtx_q **first) { struct umtxq_chain *uc; - struct umtx_q *uq; - int count = 0; + struct umtxq_queue *uh; *first = NULL; uc = umtxq_getchain(key); UMTXQ_LOCKED_ASSERT(uc); - TAILQ_FOREACH(uq, &uc->uc_queue[UMTX_SHARED_QUEUE], uq_link) { - if (umtx_key_match(&uq->uq_key, key)) { - if (++count > 1) - break; - *first = uq; - } + uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); + if (uh != NULL) { + *first = TAILQ_FIRST(&uh->head); + return (uh->length); } - return (count); + return (0); } /* @@ -448,18 +510,20 @@ static int umtxq_signal_queue(struct umtx_key *key, int n_wake, int q) { struct umtxq_chain *uc; - struct umtx_q *uq, *next; + struct umtxq_queue *uh; + struct umtx_q *uq; int ret; ret = 0; uc = umtxq_getchain(key); UMTXQ_LOCKED_ASSERT(uc); - TAILQ_FOREACH_SAFE(uq, &uc->uc_queue[q], uq_link, next) { - if (umtx_key_match(&uq->uq_key, key)) { + uh = umtxq_queue_lookup(key, q); + if (uh != NULL) { + while ((uq = TAILQ_FIRST(&uh->head)) != NULL) { umtxq_remove_queue(uq, q); wakeup(uq); if (++ret >= n_wake) - break; + return (ret); } } return (ret); @@ -1524,12 +1588,8 @@ umtxq_sleep_pi(struct umtx_q *uq, struct if (pi->pi_owner == NULL) { /* XXX * Current, We only support process private PI-mutex, - * non-contended PI-mutexes are locked in userland. - * Process shared PI-mutex should always be initialized - * by kernel and be registered in kernel, locking should - * always be done by kernel to avoid security problems. - * For process private PI-mutex, we can find owner - * thread and boost its priority safely. + * we need a faster way to find an owner thread for + * process-shared mutex (not available yet). */ mtx_unlock_spin(&umtx_lock); PROC_LOCK(curproc); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 11:02:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD7D8106566C; Sun, 10 Jan 2010 11:02:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A186A8FC0C; Sun, 10 Jan 2010 11:02: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 o0AB2AHV006052; Sun, 10 Jan 2010 11:02:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AB2ANx006050; Sun, 10 Jan 2010 11:02:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001101102.o0AB2ANx006050@svn.freebsd.org> From: Alexander Motin Date: Sun, 10 Jan 2010 11:02: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: r201993 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 11:02:10 -0000 Author: mav Date: Sun Jan 10 11:02:10 2010 New Revision: 201993 URL: http://svn.freebsd.org/changeset/base/201993 Log: Report which of IXP700 legacy ATA channels is SATA. Modified: head/sys/dev/ata/chipsets/ata-ati.c Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 10 10:42:58 2010 (r201992) +++ head/sys/dev/ata/chipsets/ata-ati.c Sun Jan 10 11:02:10 2010 (r201993) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ati_chipinit(device_t dev); +static int ata_ati_ixp700_ch_attach(device_t dev); static int ata_ati_setmode(device_t dev, int target, int mode); /* misc defines */ @@ -121,7 +122,7 @@ ata_ati_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); device_t smbdev; - int satacfg; + uint8_t satacfg; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; @@ -145,13 +146,16 @@ ata_ati_chipinit(device_t dev) (satacfg & 0x01) == 0 ? "disabled" : "enabled", (satacfg & 0x08) == 0 ? "" : "combined mode, ", (satacfg & 0x10) == 0 ? "primary" : "secondary"); - + ctlr->chipset_data = (void *)(uintptr_t)satacfg; /* * If SATA controller is enabled but combined mode is disabled, * we have only one PATA channel. Ignore a non-existent channel. */ if ((satacfg & 0x09) == 0x01) ctlr->ichannels &= ~(1 << ((satacfg & 0x10) >> 4)); + else { + ctlr->ch_attach = ata_ati_ixp700_ch_attach; + } } break; } @@ -161,6 +165,23 @@ ata_ati_chipinit(device_t dev) } static int +ata_ati_ixp700_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + uint8_t satacfg = (uint8_t)(uintptr_t)ctlr->chipset_data; + + /* Setup the usual register normal pci style. */ + if (ata_pci_ch_attach(dev)) + return ENXIO; + + /* One of channels is PATA, another is SATA. */ + if (ch->unit == ((satacfg & 0x10) >> 4)) + ch->flags |= ATA_SATA; + return (0); +} + +static int ata_ati_setmode(device_t dev, int target, int mode) { device_t parent = device_get_parent(dev); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 12:03:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 662031065676; Sun, 10 Jan 2010 12:03:53 +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 54FE48FC19; Sun, 10 Jan 2010 12:03: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 o0AC3rYq019643; Sun, 10 Jan 2010 12:03:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AC3rV2019641; Sun, 10 Jan 2010 12:03:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001101203.o0AC3rV2019641@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 10 Jan 2010 12:03: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: r201995 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 12:03:53 -0000 Author: bz Date: Sun Jan 10 12:03:53 2010 New Revision: 201995 URL: http://svn.freebsd.org/changeset/base/201995 Log: Correct a typo. MFC after: 5 days Modified: head/sys/net/if_epair.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Sun Jan 10 11:25:34 2010 (r201994) +++ head/sys/net/if_epair.c Sun Jan 10 12:03:53 2010 (r201995) @@ -323,7 +323,7 @@ epair_add_ifp_for_draining(struct ifnet STAILQ_FOREACH(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next) if (elm->ifp == ifp) break; - /* If the ipf is there already, return success. */ + /* If the ifp is there already, return success. */ if (elm != NULL) return (0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 14:30:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE5C4106566B; Sun, 10 Jan 2010 14:30:30 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC4CD8FC16; Sun, 10 Jan 2010 14:30: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 o0AEUUhZ051920; Sun, 10 Jan 2010 14:30:30 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AEUURS051917; Sun, 10 Jan 2010 14:30:30 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201001101430.o0AEUURS051917@svn.freebsd.org> From: Colin Percival Date: Sun, 10 Jan 2010 14:30: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: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 14:30:31 -0000 Author: cperciva Date: Sun Jan 10 14:30:30 2010 New Revision: 201999 URL: http://svn.freebsd.org/changeset/base/201999 Log: Give a less silly response to a silly request. Prior to this commit, fread/fwrite calls with size * nmemb > SIZE_MAX were handled by reading or writing (size_t)(size * nmemb) bytes; for example, on 32-bit platforms, fread(ptr, 641, 6700417, f) would read 1 byte and indicate that the requested 6700417 blocks had been read. This commit adds a check for such integer overflows, and treats them as if an overly large request was passed to read/write; i.e., it sets errno to EINVAL, sets the error indicator on the file, and returns a short object count (0, to be specific). The overflow check involves an integer division, so as a performance optimization we check first to see if both size and nmemb are less than 2^16; if they are, no overflow is possible and we avoid the division. We assume here that size_t is at least 32 bits; this appears to be true on all platforms FreeBSD supports. Although this commit fixes an integer overflow, it is not likely to have any security implications, since any program which would be affected by this bug fix is quite clearly already very confused. Reviewed by: kib MFC after: 1 month Modified: head/lib/libc/stdio/fread.c head/lib/libc/stdio/fwrite.c Modified: head/lib/libc/stdio/fread.c ============================================================================== --- head/lib/libc/stdio/fread.c Sun Jan 10 13:30:45 2010 (r201998) +++ head/lib/libc/stdio/fread.c Sun Jan 10 14:30:30 2010 (r201999) @@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fread.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include +#include #include #include #include "un-namespace.h" @@ -69,8 +71,27 @@ __fread(void * __restrict buf, size_t si /* * ANSI and SUSv2 require a return value of 0 if size or count are 0. */ - if ((resid = count * size) == 0) + if ((count == 0) || (size == 0)) return (0); + + /* + * Check for integer overflow. As an optimization, first check that + * at least one of {count, size} is at least 2^16, since if both + * values are less than that, their product can't possible overflow + * (size_t is always at least 32 bits on FreeBSD). + */ + if (((count | size) > 0xFFFF) && + (count > SIZE_MAX / size)) { + errno = EINVAL; + fp->_flags |= __SERR; + return (0); + } + + /* + * Compute the (now required to not overflow) number of bytes to + * read and actually do the work. + */ + resid = count * size; ORIENT(fp, -1); if (fp->_r < 0) fp->_r = 0; Modified: head/lib/libc/stdio/fwrite.c ============================================================================== --- head/lib/libc/stdio/fwrite.c Sun Jan 10 13:30:45 2010 (r201998) +++ head/lib/libc/stdio/fwrite.c Sun Jan 10 14:30:30 2010 (r201999) @@ -37,6 +37,8 @@ static char sccsid[] = "@(#)fwrite.c 8.1 __FBSDID("$FreeBSD$"); #include "namespace.h" +#include +#include #include #include "un-namespace.h" #include "local.h" @@ -60,10 +62,24 @@ fwrite(buf, size, count, fp) /* * ANSI and SUSv2 require a return value of 0 if size or count are 0. */ - n = count * size; - if (n == 0) + if ((count == 0) || (size == 0)) return (0); + /* + * Check for integer overflow. As an optimization, first check that + * at least one of {count, size} is at least 2^16, since if both + * values are less than that, their product can't possible overflow + * (size_t is always at least 32 bits on FreeBSD). + */ + if (((count | size) > 0xFFFF) && + (count > SIZE_MAX / size)) { + errno = EINVAL; + fp->_flags |= __SERR; + return (0); + } + + n = count * size; + iov.iov_base = (void *)buf; uio.uio_resid = iov.iov_len = n; uio.uio_iov = &iov; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 14:48:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB7881065670; Sun, 10 Jan 2010 14:48:42 +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 DA2328FC1C; Sun, 10 Jan 2010 14:48: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 o0AEmgrQ055984; Sun, 10 Jan 2010 14:48:42 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AEmgKi055982; Sun, 10 Jan 2010 14:48:42 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001101448.o0AEmgKi055982@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 10 Jan 2010 14:48: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: r202000 - head/sys/dev/ae X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 14:48:43 -0000 Author: gavin Date: Sun Jan 10 14:48:42 2010 New Revision: 202000 URL: http://svn.freebsd.org/changeset/base/202000 Log: Don't panic on attach if we can't allocate ifp Approved by: ed (mentor) MFC after: 2 weeks Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Sun Jan 10 14:30:30 2010 (r201999) +++ head/sys/dev/ae/if_ae.c Sun Jan 10 14:48:42 2010 (r202000) @@ -367,6 +367,7 @@ ae_attach(device_t dev) if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure.\n"); error = ENXIO; + goto fail; } ifp->if_softc = sc; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 15:12:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC509106566B; Sun, 10 Jan 2010 15:12:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9E748FC08; Sun, 10 Jan 2010 15: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 o0AFCFwX061254; Sun, 10 Jan 2010 15:12:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AFCFgB061252; Sun, 10 Jan 2010 15:12:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001101512.o0AFCFgB061252@svn.freebsd.org> From: Marius Strobl Date: Sun, 10 Jan 2010 15:12: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: r202003 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 15:12:16 -0000 Author: marius Date: Sun Jan 10 15:12:15 2010 New Revision: 202003 URL: http://svn.freebsd.org/changeset/base/202003 Log: - According to OpenSolaris it's sufficient to align the MSIs of a device in the table based on the count rather than the maxcount. Also the previous code didn't work properly as it would have been necessary to reserve the entire maxcount range in order keep later requests from filling the spare MSIs between count and maxcount, which would be complicated to unreserve in fire_release_msi(). - For MSIs with filters rather than handlers only don't clear the event queue interrupt via fire_intr_clear() since given that these are executed directly would clear it while we're still processing the event queue, which in turn would lead to lost MSIs. - Save one level of indentation in fire_setup_intr(). - Correct a bug in fire_teardown_intr() which prevented it from correctly restoring the MSI in the resource, causing allocation of a resource representing an MSI to fail after the first pass when repeatedly loading and unloading a driver module. Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Sun Jan 10 14:55:38 2010 (r202002) +++ head/sys/sparc64/pci/fire.c Sun Jan 10 15:12:15 2010 (r202003) @@ -83,6 +83,8 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +struct fire_msiqarg; + static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, @@ -94,6 +96,9 @@ static void fire_intr_clear(void *arg); static void fire_intr_disable(void *arg); static void fire_intr_enable(void *arg); static int fire_intr_register(struct fire_softc *sc, u_int ino); +static inline void fire_msiq_common(struct intr_vector *iv, + struct fire_msiqarg *fmqa); +static void fire_msiq_filter(void *cookie); static void fire_msiq_handler(void *cookie); static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino, driver_filter_t handler, void *arg); @@ -184,6 +189,13 @@ struct fire_icarg { bus_addr_t fica_clr; }; +static const struct intr_controller fire_msiqc_filter = { + fire_intr_enable, + fire_intr_disable, + fire_intr_assign, + NULL +}; + struct fire_msiqarg { struct fire_icarg fmqa_fica; struct mtx fmqa_mtx; @@ -1611,7 +1623,7 @@ fire_intr_clear(void *arg) */ static int -fire_alloc_msi(device_t dev, device_t child, int count, int maxcount, +fire_alloc_msi(device_t dev, device_t child, int count, int maxcount __unused, int *irqs) { struct fire_softc *sc; @@ -1637,16 +1649,11 @@ fire_alloc_msi(device_t dev, device_t ch mtx_unlock(&sc->sc_msi_mtx); return (ENXIO); } - /* - * It's unclear whether we need to actually align the MSIs in the - * mapping table based on the maxcount or just the count. We use - * maxcount to be on the safe side. - */ - for (i = 0; i + maxcount < sc->sc_msi_count; i += maxcount) { - for (j = i; j < i + maxcount; j++) + for (i = 0; i + count < sc->sc_msi_count; i += count) { + for (j = i; j < i + count; j++) if (isclr(sc->sc_msi_bitmap, j) == 0) break; - if (j == i + maxcount) { + if (j == i + count) { for (j = 0; j < count; j++) { setbit(sc->sc_msiq_bitmap, msiqrun + j); setbit(sc->sc_msi_bitmap, i + j); @@ -1765,33 +1772,67 @@ fire_msiq_handler(void *cookie) { struct intr_vector *iv; struct fire_msiqarg *fmqa; - struct fire_softc *sc; - struct fo_msiq_record *qrec; - device_t dev; - uint64_t word0; - u_int head, msi, msiq; iv = cookie; fmqa = iv->iv_icarg; - sc = fmqa->fmqa_fica.fica_sc; - dev = sc->sc_dev; - msiq = fmqa->fmqa_msiq; /* * Note that since fire_intr_clear() will clear the event queue - * interrupt after the filter/handler associated with the MSI [sic] - * has been executed we have to protect the access to the event queue - * as otherwise nested event queue interrupts cause corruption of the + * interrupt after the handler associated with the MSI [sic] has + * been executed we have to protect the access to the event queue as + * otherwise nested event queue interrupts cause corruption of the * event queue on MP machines. Obviously especially when abandoning * the 1:1 mapping it would be better to not clear the event queue - * interrupt after each filter/handler invocation but only once when - * the outstanding MSIs have been processed but unfortunately that + * interrupt after each handler invocation but only once when the + * outstanding MSIs have been processed but unfortunately that * doesn't work well and leads to interrupt storms with controllers/ - * drivers which don't mask interrupts while the filter/handler is - * executed. Maybe delaying clearing the MSI until after the filter/ - * handler has been executed could be used to work around this but - * that's not the intended usage and might in turn cause lost MSIs. + * drivers which don't mask interrupts while the handler is executed. + * Maybe delaying clearing the MSI until after the handler has been + * executed could be used to work around this but that's not the + * intended usage and might in turn cause lost MSIs. */ mtx_lock_spin(&fmqa->fmqa_mtx); + fire_msiq_common(iv, fmqa); + mtx_unlock_spin(&fmqa->fmqa_mtx); +} + +static void +fire_msiq_filter(void *cookie) +{ + struct intr_vector *iv; + struct fire_msiqarg *fmqa; + + iv = cookie; + fmqa = iv->iv_icarg; + /* + * For filters we don't use fire_intr_clear() since it would clear + * the event queue interrupt while we're still processing the event + * queue as filters and associated post-filter handler are executed + * directly, which in turn would lead to lost MSIs. So we clear the + * event queue interrupt only once after processing the event queue. + * Given that this still guarantees the filters to not be executed + * concurrently and no other CPU can clear the event queue interrupt + * while the event queue is still processed, we don't even need to + * interlock the access to the event queue in this case. + */ + critical_enter(); + fire_msiq_common(iv, fmqa); + FIRE_PCI_WRITE_8(fmqa->fmqa_fica.fica_sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); + critical_exit(); +} + +static inline void +fire_msiq_common(struct intr_vector *iv, struct fire_msiqarg *fmqa) +{ + struct fire_softc *sc; + struct fo_msiq_record *qrec; + device_t dev; + uint64_t word0; + u_int head, msi, msiq; + + sc = fmqa->fmqa_fica.fica_sc; + dev = sc->sc_dev; + msiq = fmqa->fmqa_msiq; head = (FIRE_PCI_READ_8(sc, fmqa->fmqa_head) & FO_PCI_EQ_HD_MASK) >> FO_PCI_EQ_HD_SHFT; qrec = &fmqa->fmqa_base[head]; @@ -1833,7 +1874,6 @@ fire_msiq_handler(void *cookie) FIRE_PCI_READ_8(sc, FO_PCI_EQ_CTRL_CLR_BASE + msiq) | FO_PCI_EQ_CTRL_CLR_COVERR); } - mtx_unlock_spin(&fmqa->fmqa_mtx); } static int @@ -1872,31 +1912,32 @@ fire_setup_intr(device_t dev, device_t c intr, arg, cookiep); rman_set_start(ires, msi); rman_set_end(ires, msi); - if (error == 0) { - /* - * XXX inject our event queue handler. - */ + if (error != 0) + return (error); + /* + * XXX inject our event queue handler. + */ + if (filt != NULL) { + intr_vectors[vec].iv_func = fire_msiq_filter; + intr_vectors[vec].iv_ic = &fire_msiqc_filter; + } else intr_vectors[vec].iv_func = fire_msiq_handler; - /* - * Record the MSI/MSI-X as long as we we use a 1:1 - * mapping. - */ - ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> - fmqa_msi = msi; - FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + - (msiq << 3), FO_PCI_EQ_CTRL_SET_EN); - msi <<= 3; - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & - ~FO_PCI_MSI_MAP_EQNUM_MASK) | - ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & - FO_PCI_MSI_MAP_EQNUM_MASK)); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, - FO_PCI_MSI_CLR_EQWR_N); - FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, - FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | - FO_PCI_MSI_MAP_V); - } + /* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */ + ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> + fmqa_msi = msi; + FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3), + FO_PCI_EQ_CTRL_SET_EN); + msi <<= 3; + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + (FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) & + ~FO_PCI_MSI_MAP_EQNUM_MASK) | + ((msiq << FO_PCI_MSI_MAP_EQNUM_SHFT) & + FO_PCI_MSI_MAP_EQNUM_MASK)); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_CLR_BASE + msi, + FO_PCI_MSI_CLR_EQWR_N); + FIRE_PCI_WRITE_8(sc, FO_PCI_MSI_MAP_BASE + msi, + FIRE_PCI_READ_8(sc, FO_PCI_MSI_MAP_BASE + msi) | + FO_PCI_MSI_MAP_V); return (error); } @@ -1945,14 +1986,16 @@ fire_teardown_intr(device_t dev, device_ (0 << FO_PCI_EQ_TL_SHFT) & FO_PCI_EQ_TL_MASK); FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_HD_BASE + msiq, (0 << FO_PCI_EQ_HD_SHFT) & FO_PCI_EQ_HD_MASK); + intr_vectors[vec].iv_ic = &fire_ic; /* * The MD interrupt code needs the vector rather than the MSI. */ rman_set_start(ires, vec); rman_set_end(ires, vec); error = bus_generic_teardown_intr(dev, child, ires, cookie); + msi >>= 3; rman_set_start(ires, msi); - rman_set_end(ires, msi >> 3); + rman_set_end(ires, msi); return (error); } return (bus_generic_teardown_intr(dev, child, ires, cookie)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 15:44:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADF77106566B; Sun, 10 Jan 2010 15:44:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B47C8FC1B; Sun, 10 Jan 2010 15:44: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 o0AFim0Z068488; Sun, 10 Jan 2010 15:44:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AFim1o068482; Sun, 10 Jan 2010 15:44:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001101544.o0AFim1o068482@svn.freebsd.org> From: Marius Strobl Date: Sun, 10 Jan 2010 15:44: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: r202006 - in head/sys: conf modules modules/epic sparc64/conf sparc64/ebus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 15:44:48 -0000 Author: marius Date: Sun Jan 10 15:44:48 2010 New Revision: 202006 URL: http://svn.freebsd.org/changeset/base/202006 Log: Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245. It's named after the driver doing the same job in OpenSolaris. Added: head/sys/modules/epic/ head/sys/modules/epic/Makefile (contents, props changed) head/sys/sparc64/ebus/epic.c (contents, props changed) Modified: head/sys/conf/files.sparc64 head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Sun Jan 10 15:25:45 2010 (r202005) +++ head/sys/conf/files.sparc64 Sun Jan 10 15:44:48 2010 (r202006) @@ -67,6 +67,7 @@ libkern/flsl.c standard libkern/memmove.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus +sparc64/ebus/epic.c optional epic ebus sparc64/fhc/clkbrd.c optional fhc sparc64/fhc/fhc.c optional fhc sparc64/isa/isa.c optional isa Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jan 10 15:25:45 2010 (r202005) +++ head/sys/modules/Makefile Sun Jan 10 15:44:48 2010 (r202006) @@ -81,6 +81,7 @@ SUBDIR= ${_3dfx} \ ${_em} \ en \ ${_ep} \ + ${_epic} \ ${_et} \ ${_ex} \ ${_exca} \ @@ -602,6 +603,7 @@ _sound= sound .if ${MACHINE_ARCH} == "sparc64" _auxio= auxio _em= em +_epic= epic _i2c= i2c _igb= igb .if ${MK_CDDL} != "no" || defined(ALL_MODULES) Added: head/sys/modules/epic/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/epic/Makefile Sun Jan 10 15:44:48 2010 (r202006) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../sparc64/ebus + +KMOD= epic +SRCS= device_if.h epic.c bus_if.h ofw_bus_if.h + +.include Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Jan 10 15:25:45 2010 (r202005) +++ head/sys/sparc64/conf/GENERIC Sun Jan 10 15:44:48 2010 (r202006) @@ -150,6 +150,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device epic # Sun Fire V215/V245 LEDs # Serial (COM) ports device puc # Multi-channel uarts Added: head/sys/sparc64/ebus/epic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/ebus/epic.c Sun Jan 10 15:44:48 2010 (r202006) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2009 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#define EPIC_DELAY 10000 + +#define EPIC_NREG 1 +#define EPIC_FW_LED 0 + +#define EPIC_FW_LED_DATA 0x40 +#define EPIC_FW_LED_ADDR 0x41 +#define EPIC_FW_LED_WRITE_MASK 0x80 + +#define EPIC_FW_VERSION 0x05 +#define EPIC_LED_STATE0 0x06 + +#define EPIC_LED_ALERT_MASK 0x0c +#define EPIC_LED_ALERT_OFF 0x00 +#define EPIC_LED_ALERT_ON 0x04 + +#define EPIC_LED_POWER_MASK 0x30 +#define EPIC_LED_POWER_OFF 0x00 +#define EPIC_LED_POWER_ON 0x10 +#define EPIC_LED_POWER_SB_BLINK 0x20 +#define EPIC_LED_POWER_FAST_BLINK 0x30 + +static struct resource_spec epic_res_spec[] = { + { SYS_RES_MEMORY, EPIC_FW_LED, RF_ACTIVE }, + { -1, 0 } +}; + +struct epic_softc { + struct mtx sc_mtx; + struct resource *sc_res[EPIC_NREG]; + struct cdev *sc_led_dev_alert; + struct cdev *sc_led_dev_power; +}; + +#define EPIC_FW_LED_READ(sc, off) ({ \ + uint8_t __val; \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + __val = bus_read_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA);\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ); \ + DELAY(EPIC_DELAY); \ + __val; \ +}) + +#define EPIC_FW_LED_WRITE(sc, off, mask, val) do { \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, (off));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_ADDR, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + (mask)); \ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_WRITE_MASK, \ + 1, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ + bus_write_1((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, (val));\ + bus_barrier((sc)->sc_res[EPIC_FW_LED], EPIC_FW_LED_DATA, 1, \ + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ + DELAY(EPIC_DELAY); \ +} while (0) + +#define EPIC_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, "epic mtx", NULL, MTX_DEF) +#define EPIC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) +#define EPIC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define EPIC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) + +static device_probe_t epic_probe; +static device_attach_t epic_attach; +static device_detach_t epic_detach; + +static void epic_led_alert(void *arg, int onoff); +static void epic_led_power(void *arg, int onoff); + +static device_method_t epic_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, epic_probe), + DEVMETHOD(device_attach, epic_attach), + DEVMETHOD(device_detach, epic_detach), + + KOBJMETHOD_END +}; + +static devclass_t epic_devclass; + +DEFINE_CLASS_0(epic, epic_driver, epic_methods, + sizeof(struct epic_softc)); +DRIVER_MODULE(epic, ebus, epic_driver, epic_devclass, 0, 0); + +static int +epic_probe(device_t dev) +{ + const char* compat; + + compat = ofw_bus_get_compat(dev); + if (compat != NULL && strcmp(ofw_bus_get_name(dev), + "env-monitor") == 0 && strcmp(compat, "epic") == 0) { + device_set_desc(dev, "Sun Fire V215/V245 LEDs"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +epic_attach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + if (bus_alloc_resources(dev, epic_res_spec, sc->sc_res)) { + device_printf(dev, "failed to allocate resources\n"); + bus_release_resources(dev, epic_res_spec, sc->sc_res); + return (ENXIO); + } + + EPIC_LOCK_INIT(sc); + + if (bootverbose) + device_printf(dev, "version 0x%x\n", + EPIC_FW_LED_READ(sc, EPIC_FW_VERSION)); + + sc->sc_led_dev_alert = led_create(epic_led_alert, sc, "alert"); + sc->sc_led_dev_power = led_create(epic_led_power, sc, "power"); + + return (0); +} + +static int +epic_detach(device_t dev) +{ + struct epic_softc *sc; + + sc = device_get_softc(dev); + + led_destroy(sc->sc_led_dev_alert); + led_destroy(sc->sc_led_dev_power); + + bus_release_resources(dev, epic_res_spec, sc->sc_res); + + EPIC_LOCK_DESTROY(sc); + + return (0); +} + +static void +epic_led_alert(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_ALERT_MASK, + onoff ? EPIC_LED_ALERT_ON : EPIC_LED_ALERT_OFF); + EPIC_UNLOCK(sc); +} + +static void +epic_led_power(void *arg, int onoff) +{ + struct epic_softc *sc; + + sc = (struct epic_softc *)arg; + + EPIC_LOCK(sc); + EPIC_FW_LED_WRITE(sc, EPIC_LED_STATE0, EPIC_LED_POWER_MASK, + onoff ? EPIC_LED_POWER_ON : EPIC_LED_POWER_OFF); + EPIC_UNLOCK(sc); +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 16:04:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D61AA1065679; Sun, 10 Jan 2010 16:04:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5D908FC12; Sun, 10 Jan 2010 16: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 o0AG4t6T073084; Sun, 10 Jan 2010 16:04:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AG4tQt073082; Sun, 10 Jan 2010 16:04:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001101604.o0AG4tQt073082@svn.freebsd.org> From: Marius Strobl Date: Sun, 10 Jan 2010 16:04: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: r202010 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:04:55 -0000 Author: marius Date: Sun Jan 10 16:04:55 2010 New Revision: 202010 URL: http://svn.freebsd.org/changeset/base/202010 Log: Now that everything required to properly support Sun Fire V215/V245 is in place (r201932 and r202003 were the last parts missing), hook up fire(4). Modified: head/sys/conf/files.sparc64 Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Sun Jan 10 16:04:32 2010 (r202009) +++ head/sys/conf/files.sparc64 Sun Jan 10 16:04:55 2010 (r202010) @@ -74,6 +74,7 @@ sparc64/isa/isa.c optional isa sparc64/isa/isa_dma.c optional isa sparc64/isa/ofw_isa.c optional ebus | isa sparc64/pci/apb.c optional pci +sparc64/pci/fire.c optional pci sparc64/pci/ofw_pcib.c optional pci sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 16:05:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17D0E106566B; Sun, 10 Jan 2010 16:05:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00B0C8FC15; Sun, 10 Jan 2010 16:05: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 o0AG55TX073172; Sun, 10 Jan 2010 16:05:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AG55a2073170; Sun, 10 Jan 2010 16:05:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001101605.o0AG55a2073170@svn.freebsd.org> From: Alexander Motin Date: Sun, 10 Jan 2010 16:05:05 +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: r202011 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 16:05:06 -0000 Author: mav Date: Sun Jan 10 16:05:05 2010 New Revision: 202011 URL: http://svn.freebsd.org/changeset/base/202011 Log: While AHCI specification tells that multi-vector MSI doesn't use global IS register, nVidia chipsets have different oppinion, requiring every interrupt to be acknowledged there. While there, add interrupt descriptions in multi-vector MSI mode. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Jan 10 16:04:55 2010 (r202010) +++ head/sys/dev/ahci/ahci.c Sun Jan 10 16:05:05 2010 (r202011) @@ -570,6 +570,12 @@ ahci_setup_interrupt(device_t dev) device_printf(dev, "unable to setup interrupt\n"); return ENXIO; } + if (ctlr->numirqs > 1) { + bus_describe_intr(dev, ctlr->irqs[i].r_irq, + ctlr->irqs[i].handle, + ctlr->irqs[i].mode == AHCI_IRQ_MODE_ONE ? + "ch%d" : "%d", i); + } } return (0); } @@ -622,8 +628,14 @@ ahci_intr_one(void *data) int unit; unit = irq->r_irq_rid - 1; + /* Some controllers have edge triggered IS. */ + if (ctlr->quirks & AHCI_Q_EDGEIS) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); if ((arg = ctlr->interrupt[unit].argument)) ctlr->interrupt[unit].function(arg); + /* AHCI declares level triggered IS. */ + if (!(ctlr->quirks & AHCI_Q_EDGEIS)) + ATA_OUTL(ctlr->r_mem, AHCI_IS, 1 << unit); } static struct resource * From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 17:44:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2407B106568B; Sun, 10 Jan 2010 17:44:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B9E8FC25; Sun, 10 Jan 2010 17:44: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 o0AHiMt6095310; Sun, 10 Jan 2010 17:44:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AHiM2d095302; Sun, 10 Jan 2010 17:44:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101744.o0AHiM2d095302@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 17:44: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: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 17:44:23 -0000 Author: imp Date: Sun Jan 10 17:44:22 2010 New Revision: 202019 URL: http://svn.freebsd.org/changeset/base/202019 Log: Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. # This is the resolution of removing it from DEFAULTS... MFC after: 5 days Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/amd64/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -75,6 +75,7 @@ options MAC # TrustedBSD MAC Framewor options FLOWTABLE # per-cpu routing cache #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/i386/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -75,6 +75,7 @@ options AUDIT # Security event auditi options MAC # TrustedBSD MAC Framework options FLOWTABLE # per-cpu routing cache #options KDTRACE_HOOKS # Kernel DTrace hooks +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/ia64/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -67,6 +67,7 @@ options WITNESS # Enable checks to det options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) +options INCLUDE_CONFIG_FILE # Include this file in kernel # Various "busses" device firewire # FireWire bus code Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/pc98/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -75,6 +75,7 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/powerpc/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -66,6 +66,7 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB #Enable the kernel debugger Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/sparc64/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -72,6 +72,7 @@ options PRINTF_BUFR_SIZE=128 # Prevent options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Sun Jan 10 17:15:36 2010 (r202018) +++ head/sys/sun4v/conf/GENERIC Sun Jan 10 17:44:22 2010 (r202019) @@ -66,6 +66,7 @@ options PRINTF_BUFR_SIZE=128 # Prevent options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. @@ -219,4 +220,3 @@ device ccd # on most arches and in most cases 1000Hz pessimizes performance # its choice was not adequately researched options HZ=100 - From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 18:39:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB251065672; Sun, 10 Jan 2010 18:39:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D70E8FC0C; Sun, 10 Jan 2010 18:39: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 o0AIdTwO007644; Sun, 10 Jan 2010 18:39:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AIdTrY007642; Sun, 10 Jan 2010 18:39:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001101839.o0AIdTrY007642@svn.freebsd.org> From: Marius Strobl Date: Sun, 10 Jan 2010 18:39: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: r202023 - head/sys/sparc64/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 18:39:29 -0000 Author: marius Date: Sun Jan 10 18:39:29 2010 New Revision: 202023 URL: http://svn.freebsd.org/changeset/base/202023 Log: When setting up MSIs with a filter ensure that the event queue interrupt is cleared as it might have triggered before and given we supply NULL as ic_clear, inthand_add() won't do this for us in this case. Modified: head/sys/sparc64/pci/fire.c Modified: head/sys/sparc64/pci/fire.c ============================================================================== --- head/sys/sparc64/pci/fire.c Sun Jan 10 18:09:33 2010 (r202022) +++ head/sys/sparc64/pci/fire.c Sun Jan 10 18:39:29 2010 (r202023) @@ -1882,6 +1882,7 @@ fire_setup_intr(device_t dev, device_t c void **cookiep) { struct fire_softc *sc; + struct fire_msiqarg *fmqa; u_long vec; int error; u_int msi, msiq; @@ -1914,17 +1915,24 @@ fire_setup_intr(device_t dev, device_t c rman_set_end(ires, msi); if (error != 0) return (error); + fmqa = intr_vectors[vec].iv_icarg; /* * XXX inject our event queue handler. */ if (filt != NULL) { intr_vectors[vec].iv_func = fire_msiq_filter; intr_vectors[vec].iv_ic = &fire_msiqc_filter; + /* + * Ensure the event queue interrupt is cleared, it + * might have triggered before. Given we supply NULL + * as ic_clear, inthand_add() won't do this for us. + */ + FIRE_PCI_WRITE_8(sc, fmqa->fmqa_fica.fica_clr, + INTCLR_IDLE); } else intr_vectors[vec].iv_func = fire_msiq_handler; /* Record the MSI/MSI-X as long as we we use a 1:1 mapping. */ - ((struct fire_msiqarg *)intr_vectors[vec].iv_icarg)-> - fmqa_msi = msi; + fmqa->fmqa_msi = msi; FIRE_PCI_WRITE_8(sc, FO_PCI_EQ_CTRL_SET_BASE + (msiq << 3), FO_PCI_EQ_CTRL_SET_EN); msi <<= 3; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 18:53:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A4D106568B; Sun, 10 Jan 2010 18:53:15 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7697B8FC13; Sun, 10 Jan 2010 18:53: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 o0AIrFNs010698; Sun, 10 Jan 2010 18:53:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AIrF32010696; Sun, 10 Jan 2010 18:53:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001101853.o0AIrF32010696@svn.freebsd.org> From: Andrew Thompson Date: Sun, 10 Jan 2010 18:53: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: r202024 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 18:53:15 -0000 Author: thompsa Date: Sun Jan 10 18:53:15 2010 New Revision: 202024 URL: http://svn.freebsd.org/changeset/base/202024 Log: Change the second usb example for ulpt to one describing libusb which would be more common. Modified: head/share/man/man5/devfs.rules.5 Modified: head/share/man/man5/devfs.rules.5 ============================================================================== --- head/share/man/man5/devfs.rules.5 Sun Jan 10 18:39:29 2010 (r202023) +++ head/share/man/man5/devfs.rules.5 Sun Jan 10 18:53:15 2010 (r202024) @@ -100,13 +100,15 @@ The first line declares and starts a new .Va localrules and the number 10. .Pp -To make all the -.Xr ulpt 4 -devices accessible to their owner and the +To give +.Xr usbconfig 8 +and +.Xr libusb 3 +enabled applications permission to all usb devices for their owner and the .Dq Li usb group, a similar rule may be used: .Pp -.Dl "add path 'ulpt*' mode 0660 group usb" +.Dl "add path 'usb/*' mode 0660 group usb" .Sh SEE ALSO .Xr glob 3 , .Xr devfs 5 , From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:18:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40A341065670; Sun, 10 Jan 2010 19:18:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31A0E8FC17; Sun, 10 Jan 2010 19:18: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 o0AJIoE2016321; Sun, 10 Jan 2010 19:18:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJIomp016319; Sun, 10 Jan 2010 19:18:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001101918.o0AJIomp016319@svn.freebsd.org> From: Andrew Thompson Date: Sun, 10 Jan 2010 19:18: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: r202025 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:18:50 -0000 Author: thompsa Date: Sun Jan 10 19:18:49 2010 New Revision: 202025 URL: http://svn.freebsd.org/changeset/base/202025 Log: Reset variable fields in case the transfer is opened again Submitted by: Hans Petter Selasky Modified: head/lib/libusb/libusb20.c Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Sun Jan 10 18:53:15 2010 (r202024) +++ head/lib/libusb/libusb20.c Sun Jan 10 19:18:49 2010 (r202025) @@ -130,8 +130,19 @@ libusb20_tr_close(struct libusb20_transf if (xfer->ppBuffer) { free(xfer->ppBuffer); } - /* clear some fields */ + /* reset variable fields in case the transfer is opened again */ + xfer->priv_sc0 = 0; + xfer->priv_sc1 = 0; xfer->is_opened = 0; + xfer->is_pending = 0; + xfer->is_cancel = 0; + xfer->is_draining = 0; + xfer->is_restart = 0; + xfer->status = 0; + xfer->flags = 0; + xfer->nFrames = 0; + xfer->aFrames = 0; + xfer->timeout = 0; xfer->maxFrames = 0; xfer->maxTotalLength = 0; xfer->maxPacketLen = 0; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:21:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6070A1065696; Sun, 10 Jan 2010 19:21:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 516548FC1E; Sun, 10 Jan 2010 19:21: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 o0AJLNXH016913; Sun, 10 Jan 2010 19:21:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJLNQx016911; Sun, 10 Jan 2010 19:21:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001101921.o0AJLNQx016911@svn.freebsd.org> From: Andrew Thompson Date: Sun, 10 Jan 2010 19:21: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: r202026 - head/usr.sbin/usbconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:21:23 -0000 Author: thompsa Date: Sun Jan 10 19:21:23 2010 New Revision: 202026 URL: http://svn.freebsd.org/changeset/base/202026 Log: Print error messages to stderr. Submitted by: Hans Petter Selasky Modified: head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Sun Jan 10 19:18:49 2010 (r202025) +++ head/usr.sbin/usbconfig/usbconfig.c Sun Jan 10 19:21:23 2010 (r202026) @@ -175,7 +175,7 @@ be_dev_remove_quirk(struct libusb20_back error = libusb20_be_remove_dev_quirk(pbe, &q); if (error) { - printf("Removing quirk '%s' failed, continuing.\n", str); + fprintf(stderr, "Removing quirk '%s' failed, continuing.\n", str); } return; } @@ -198,7 +198,7 @@ be_dev_add_quirk(struct libusb20_backend error = libusb20_be_add_dev_quirk(pbe, &q); if (error) { - printf("Adding quirk '%s' failed, continuing.\n", str); + fprintf(stderr, "Adding quirk '%s' failed, continuing.\n", str); } return; } @@ -257,7 +257,7 @@ get_int(const char *s) static void duplicate_option(const char *ptr) { - printf("Syntax error: " + fprintf(stderr, "Syntax error: " "Duplicate option: '%s'\n", ptr); exit(1); } @@ -265,7 +265,7 @@ duplicate_option(const char *ptr) static void usage(void) { - printf("" + fprintf(stderr, "" "usbconfig - configure the USB subsystem" "\n" "usage: usbconfig -u -a -i [cmds...]" "\n" "usage: usbconfig -d [ugen]. -i [cmds...]" "\n" @@ -349,7 +349,7 @@ flush_command(struct libusb20_backend *p if (opt->got_set_template) { opt->got_any--; if (libusb20_be_set_template(pbe, opt->template)) { - printf("Setting USB template %u failed, " + fprintf(stderr, "Setting USB template %u failed, " "continuing.\n", opt->template); } } From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:39:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76129106566B; Sun, 10 Jan 2010 19:39:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6692D8FC08; Sun, 10 Jan 2010 19:39: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 o0AJd88j020835; Sun, 10 Jan 2010 19:39:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJd8DA020829; Sun, 10 Jan 2010 19:39:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101939.o0AJd8DA020829@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19:39: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: r202027 - head/sys/mips/idt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:39:08 -0000 Author: imp Date: Sun Jan 10 19:39:08 2010 New Revision: 202027 URL: http://svn.freebsd.org/changeset/base/202027 Log: Merge from projects/mips to head by hand: r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines Centralize initialization of pcpu, and set curthread early... r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r194216 | gonzo | 2009-06-14 15:16:23 -0600 (Sun, 14 Jun 2009) | 2 lines - Fix prototypes to make compiler happy r194215 | gonzo | 2009-06-14 15:16:04 -0600 (Sun, 14 Jun 2009) | 2 lines - Get rid of mask_fn and fix pre_filter/post_filter functions' prototypes r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. Modified: head/sys/mips/idt/files.idt head/sys/mips/idt/idt_machdep.c head/sys/mips/idt/obio.c head/sys/mips/idt/uart_bus_rc32434.c head/sys/mips/idt/uart_cpu_rc32434.c Modified: head/sys/mips/idt/files.idt ============================================================================== --- head/sys/mips/idt/files.idt Sun Jan 10 19:21:23 2010 (r202026) +++ head/sys/mips/idt/files.idt Sun Jan 10 19:39:08 2010 (r202027) @@ -6,3 +6,5 @@ mips/idt/if_kr.c optional kr mips/idt/obio.c standard mips/idt/uart_cpu_rc32434.c optional uart mips/idt/uart_bus_rc32434.c optional uart +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Modified: head/sys/mips/idt/idt_machdep.c ============================================================================== --- head/sys/mips/idt/idt_machdep.c Sun Jan 10 19:21:23 2010 (r202026) +++ head/sys/mips/idt/idt_machdep.c Sun Jan 10 19:39:08 2010 (r202027) @@ -76,6 +76,12 @@ extern int *edata; extern int *end; void +platform_cpu_init() +{ + /* Nothing special */ +} + +void platform_halt(void) { @@ -131,6 +137,9 @@ platform_start(__register_t a0, __regist kernend = round_page((vm_offset_t)&end); memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + /* Initialize pcpu stuff */ + mips_pcpu0_init(); + /* * Looking for mem=XXM argument */ Modified: head/sys/mips/idt/obio.c ============================================================================== --- head/sys/mips/idt/obio.c Sun Jan 10 19:21:23 2010 (r202026) +++ head/sys/mips/idt/obio.c Sun Jan 10 19:39:08 2010 (r202027) @@ -76,8 +76,10 @@ static int obio_setup_intr(device_t, dev static int obio_teardown_intr(device_t, device_t, struct resource *, void *); -static void obio_mask_irq(unsigned int irq) +static void +obio_mask_irq(void *arg) { + unsigned int irq = (unsigned int)arg; int ip_bit, mask, mask_register; /* mask IRQ */ @@ -88,8 +90,10 @@ static void obio_mask_irq(unsigned int i ICU_REG_WRITE(mask_register, mask | ip_bit); } -static void obio_unmask_irq(unsigned int irq) +static void +obio_unmask_irq(void *arg) { + unsigned int irq = (unsigned int)arg; int ip_bit, mask, mask_register; /* unmask IRQ */ @@ -274,7 +278,7 @@ obio_setup_intr(device_t dev, device_t c event = sc->sc_eventstab[irq]; if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, irq, - (mask_fn)obio_mask_irq, (mask_fn)obio_unmask_irq, + obio_mask_irq, obio_unmask_irq, NULL, NULL, "obio intr%d:", irq); Modified: head/sys/mips/idt/uart_bus_rc32434.c ============================================================================== --- head/sys/mips/idt/uart_bus_rc32434.c Sun Jan 10 19:21:23 2010 (r202026) +++ head/sys/mips/idt/uart_bus_rc32434.c Sun Jan 10 19:39:08 2010 (r202027) @@ -88,10 +88,10 @@ uart_rc32434_probe(device_t dev) sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); sc->sc_sysdev->bas.regshft = 2; - sc->sc_sysdev->bas.bst = 0; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(IDT_BASE_UART0); sc->sc_bas.regshft = 2; - sc->sc_bas.bst = 0; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(IDT_BASE_UART0); return (uart_bus_probe(dev, 2, 330000000UL/2, 0, 0)); Modified: head/sys/mips/idt/uart_cpu_rc32434.c ============================================================================== --- head/sys/mips/idt/uart_cpu_rc32434.c Sun Jan 10 19:21:23 2010 (r202026) +++ head/sys/mips/idt/uart_cpu_rc32434.c Sun Jan 10 19:39:08 2010 (r202027) @@ -71,7 +71,7 @@ uart_cpu_getdev(int devtype, struct uart /* Got it. Fill in the instance and return it. */ di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = 0; + di->bas.bst = mips_bus_space_generic; di->bas.regshft = 2; di->bas.rclk = 330000000UL/2; /* IPbus clock */ di->baudrate = 115200; @@ -79,7 +79,7 @@ uart_cpu_getdev(int devtype, struct uart di->stopbits = 1; di->parity = UART_PARITY_NONE; uart_bus_space_io = 0; - uart_bus_space_mem = 0; + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(maddr); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:42:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33E0E106568B; Sun, 10 Jan 2010 19:42:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2438FC19; Sun, 10 Jan 2010 19:42: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 o0AJgJQC021556; Sun, 10 Jan 2010 19:42:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJgJt2021555; Sun, 10 Jan 2010 19:42:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101942.o0AJgJt2021555@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19:42: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: r202028 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:42:20 -0000 Author: imp Date: Sun Jan 10 19:42:19 2010 New Revision: 202028 URL: http://svn.freebsd.org/changeset/base/202028 Log: Remove files that were deleted in the projects/mips branch. Deleted: head/sys/mips/include/bus_octeon.h head/sys/mips/include/intr.h head/sys/mips/include/pltfm.h From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:43:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC7E1065697; Sun, 10 Jan 2010 19:43:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 567958FC1F; Sun, 10 Jan 2010 19:43: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 o0AJhBG9021760; Sun, 10 Jan 2010 19:43:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJhBlH021758; Sun, 10 Jan 2010 19:43:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101943.o0AJhBlH021758@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19:43: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: r202029 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:43:11 -0000 Author: imp Date: Sun Jan 10 19:43:11 2010 New Revision: 202029 URL: http://svn.freebsd.org/changeset/base/202029 Log: Merge from projects/mips to head by hand: Copy over new cdefs.h.. Added: - copied unchanged from r202028, projects/mips/sys/mips/include/cdefs.h Directory Properties: head/sys/mips/include/cdefs.h (props changed) Copied: head/sys/mips/include/cdefs.h (from r202028, projects/mips/sys/mips/include/cdefs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/cdefs.h Sun Jan 10 19:43:11 2010 (r202029, copy of r202028, projects/mips/sys/mips/include/cdefs.h) @@ -0,0 +1,54 @@ +/* $NetBSD: cdefs.h,v 1.12 2006/08/27 19:04:30 matt Exp $ */ + +/* + * Copyright (c) 1995 Carnegie-Mellon University. + * All rights reserved. + * + * Author: Chris G. Demetriou + * + * Permission to use, copy, modify and distribute this software and + * its documentation is hereby granted, provided that both the copyright + * notice and this permission notice appear in all copies of the + * software, derivative works or modified versions, and any portions + * thereof, and that both notices appear in supporting documentation. + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. + * + * Carnegie Mellon requests users of this software to return to + * + * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU + * School of Computer Science + * Carnegie Mellon University + * Pittsburgh PA 15213-3890 + * + * any improvements or extensions that they make and grant Carnegie the + * rights to redistribute these changes. + */ + +#ifndef _MIPS_CDEFS_H_ +#define _MIPS_CDEFS_H_ + +/* MIPS Subprogram Interface Model */ +#define _MIPS_SIM_ABIX32 4 /* 64 bit safe, ILP32 o32 model */ +#define _MIPS_SIM_ABI64 3 +#define _MIPS_SIM_NABI32 2 /* 64bit safe, ILP32 n32 model */ +#define _MIPS_SIM_ABI32 1 + +#define _MIPS_BSD_API_LP32 _MIPS_SIM_ABI32 +#define _MIPS_BSD_API_LP32_64CLEAN _MIPS_SIM_ABIX32 +#define _MIPS_BSD_API_N32 _MIPS_SIM_NABI32 +#define _MIPS_BSD_API_LP64 _MIPS_SIM_ABI64 + +#if defined(__mips_n64) +#define _MIPS_BSD_API _MIPS_BSD_API_LP64 +#elif defined(__mips_n32) +#define _MIPS_BSD_API _MIPS_BSD_API_N32 +#elif defined(__mips_o64) +#define _MIPS_BSD_API _MIPS_BSD_API_LP32_64CLEAN +#else +#define _MIPS_BSD_API _MIPS_BSD_API_LP32 +#endif + +#endif /* !_MIPS_CDEFS_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:44:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A398A106566B; Sun, 10 Jan 2010 19:44:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7B78FC14; Sun, 10 Jan 2010 19:44: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 o0AJi8qK022040; Sun, 10 Jan 2010 19:44:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJi8Q1022039; Sun, 10 Jan 2010 19:44:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101944.o0AJi8Q1022039@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19:44: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: r202030 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:44:08 -0000 Author: imp Date: Sun Jan 10 19:44:08 2010 New Revision: 202030 URL: http://svn.freebsd.org/changeset/base/202030 Log: Merge from projects/mips to head by hand: Merge in rmi's fls64 code... Added: - copied unchanged from r202029, projects/mips/sys/mips/include/fls64.h Directory Properties: head/sys/mips/include/fls64.h (props changed) Copied: head/sys/mips/include/fls64.h (from r202029, projects/mips/sys/mips/include/fls64.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/include/fls64.h Sun Jan 10 19:44:08 2010 (r202030, copy of r202029, projects/mips/sys/mips/include/fls64.h) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + * + * RMI_BSD */ +#ifndef _MIPS_FLS64_H_ +#define _MIPS_FLS64_H_ + +/* + * Find Last Set bit (64 bit) + */ +static inline int +fls64(__uint64_t mask) +{ + int bit; + + if (mask == 0) + return (0); + for (bit = 1; ((mask & 0x1ULL) == 0); bit++) + mask = mask >> 1; + return (bit); +} +#endif From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:50:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D561065679; Sun, 10 Jan 2010 19:50:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92BCA8FC25; Sun, 10 Jan 2010 19:50: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 o0AJoOJc023449; Sun, 10 Jan 2010 19:50:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJoOSO023427; Sun, 10 Jan 2010 19:50:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101950.o0AJoOSO023427@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19:50: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: r202031 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:50:24 -0000 Author: imp Date: Sun Jan 10 19:50:24 2010 New Revision: 202031 URL: http://svn.freebsd.org/changeset/base/202031 Log: Merge from projects/mips to head by hand: r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r200343 | imp | 2009-12-09 18:44:11 -0700 (Wed, 09 Dec 2009) | 4 lines Get the sense of this right. We use uintpr_t for bus_addr_t when we're building everything except octeon && 32-bit. As note before, we need a clearner way, but at least now the hack is right. r199760 | imp | 2009-11-24 10:15:22 -0700 (Tue, 24 Nov 2009) | 2 lines Add in Cavium's CID. Report what the unknown CID is. r199754 | imp | 2009-11-24 09:32:31 -0700 (Tue, 24 Nov 2009) | 6 lines Include opt_cputype.h for all .c and .S files referencing TARGET_OCTEON. Spell ld script name right. r199599 | imp | 2009-11-20 09:32:26 -0700 (Fri, 20 Nov 2009) | 2 lines Another kludge for 64-bit bus_addr_t with 32-bit pointers... r199496 | gonzo | 2009-11-18 15:52:05 -0700 (Wed, 18 Nov 2009) | 5 lines - Add cpu_init_interrupts function that is supposed to prepeare stuff required for spinning out interrupts later - Add API for managing intrcnt/intrnames arrays - Some minor style(9) fixes r198958 | rrs | 2009-11-05 11:15:47 -0700 (Thu, 05 Nov 2009) | 2 lines For XLR adds extern for its bus space routines r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198666 | imp | 2009-10-29 18:37:50 -0600 (Thu, 29 Oct 2009) | 2 lines Add some newer MIPS CO cores. r198665 | imp | 2009-10-29 18:37:04 -0600 (Thu, 29 Oct 2009) | 4 lines db_expr_t is really closer to a register_t. Submitted by: bde@ r198531 | gonzo | 2009-10-27 18:01:20 -0600 (Tue, 27 Oct 2009) | 3 lines - Remove bunch of declared but not defined cach-related variables - Add mips_picache_linesize and mips_pdcache_linesize variables r198354 | neel | 2009-10-21 20:51:31 -0600 (Wed, 21 Oct 2009) | 9 lines Get rid of the hardcoded constants to define cacheable memory: SDRAM_ADDR_START, SDRAM_ADDR_END and SDRAM_MEM_SIZE Instead we now keep a copy of the memory regions enumerated by platform-specific code and use that to determine whether an address is cacheable or not. r198310 | gonzo | 2009-10-20 17:13:08 -0600 (Tue, 20 Oct 2009) | 5 lines - Commit missing part of "bt" fix: store PC register in pcb_context struct in cpu_switch and use it in stack_trace function later. pcb_regs contains state of the process stored by exception handler and therefor is not valid for sleeping processes. r198207 | imp | 2009-10-18 08:57:04 -0600 (Sun, 18 Oct 2009) | 2 lines Undo spamage of last MFC. r198206 | imp | 2009-10-18 08:56:33 -0600 (Sun, 18 Oct 2009) | 3 lines _ALIGN has to return u_long, since pointers don't fit into u_int in 64-bit mips. r198182 | gonzo | 2009-10-16 18:22:07 -0600 (Fri, 16 Oct 2009) | 11 lines - Use PC/RA/SP values as arguments for stacktrace_subr instead of trapframe. Context info could be obtained from other sources (see below) no only from td_pcb field - Do not show a0..a3 values unless they're obtained from the stack. These are only confirmed values. - Fix bt command in DDB. Previous implementation used thread's trapframe structure as a source info for trace unwinding, but this structure is filled only when exception occurs. Valid register values for sleeping processes are in pcb_context array. For curthread use pc/sp/ra for current frame r198181 | gonzo | 2009-10-16 16:52:18 -0600 (Fri, 16 Oct 2009) | 2 lines - Get rid of label_t. It came from NetBSD and was used only in one place r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r198066 | gonzo | 2009-10-13 19:43:53 -0600 (Tue, 13 Oct 2009) | 5 lines - Move stack tracing function to db_trace.c - Axe unused extern MipsXXX declarations - Move all declarations for functions in exceptions.S/swtch.S from trap.c to respective headers r197685 | gonzo | 2009-10-01 14:05:36 -0600 (Thu, 01 Oct 2009) | 2 lines - Sync caches properly when dealing with sf_buf r196215 | imp | 2009-08-14 10:15:18 -0600 (Fri, 14 Aug 2009) | 6 lines (u_int) is the wrong type here. Use unsigned long instead, even though that's only less wrong... r196199 | imp | 2009-08-13 13:47:13 -0600 (Thu, 13 Aug 2009) | 7 lines Use unsigned long instead of unsigned for the integer casts here. The former works for both ILP32 and LP64 programming models, while the latter fails LP64. r196089 | gonzo | 2009-08-09 19:49:59 -0600 (Sun, 09 Aug 2009) | 4 lines - Make i/d cache size field 32-bit to prevent overflow Submited by: Neelkanth Natu r195582 | imp | 2009-07-10 13:07:07 -0600 (Fri, 10 Jul 2009) | 2 lines fix prototype for MipsEmulateBranch. r195581 | imp | 2009-07-10 13:06:43 -0600 (Fri, 10 Jul 2009) | 2 lines Better definitions for a few types for n32/n64. r195580 | imp | 2009-07-10 13:06:15 -0600 (Fri, 10 Jul 2009) | 5 lines Fixed aligned macros... r195478 | gonzo | 2009-07-08 16:28:36 -0600 (Wed, 08 Jul 2009) | 5 lines - Port busdma code from FreeBSD/arm. This is more mature version that takes into account all limitation to DMA memory (boundaries, alignment) and implements bounce pages. - Add BUS_DMASYNC_POSTREAD case to bus_dmamap_sync_buf r195440 | imp | 2009-07-08 00:01:37 -0600 (Wed, 08 Jul 2009) | 2 lines Fix atomic_store_64 prototype for 64-bit systems. r195392 | imp | 2009-07-05 20:27:03 -0600 (Sun, 05 Jul 2009) | 3 lines The MCOUNT macro isn't going to work in 64-bit mode. Add a note to this effect. r195391 | imp | 2009-07-05 20:22:51 -0600 (Sun, 05 Jul 2009) | 3 lines Provide a macro for PTR_ADDU as well. We may need to implement this differently for N32... Use PTR_ADDU in DO_AST macro. r195390 | imp | 2009-07-05 20:22:06 -0600 (Sun, 05 Jul 2009) | 4 lines Change the addu here to daddu. addu paranoina prodded by: jmallet@ r195382 | imp | 2009-07-05 15:16:26 -0600 (Sun, 05 Jul 2009) | 5 lines addu and subu are special. We need to use daddu and dsubu here to get proper behavior. Submitted by: jmallet@ r195370 | imp | 2009-07-05 09:20:16 -0600 (Sun, 05 Jul 2009) | 6 lines The SB1 has cohernet memory, so add it. Also, Maxmem is better as a long. Submitted by: Neelkanth Natu r195369 | imp | 2009-07-05 09:19:28 -0600 (Sun, 05 Jul 2009) | 4 lines The SB1 needs a special value for the cache field of the pte. Submitted by: Neelkanth Natu r195368 | imp | 2009-07-05 09:18:06 -0600 (Sun, 05 Jul 2009) | 2 lines compute the areas to save registers in for 64-bit access correctly. r195367 | imp | 2009-07-05 09:17:11 -0600 (Sun, 05 Jul 2009) | 3 lines First cut at 64-bit types. not 100% sure these are all correct for N32 ABI. r195366 | imp | 2009-07-05 09:16:27 -0600 (Sun, 05 Jul 2009) | 3 lines Trim unreferenced goo. SDRAM likely should be next, but it is still referenced. r195365 | imp | 2009-07-05 09:13:24 -0600 (Sun, 05 Jul 2009) | 9 lines First cut at atomics for 64-bit machines and SMP machines. # Note: Cavium provided a port that has atomics similar to these, but # that does a syncw; sync; atomic; sync; syncw where we just do the classic # mips 'atomic' operation (eg ll; frob; sc). It is unclear to me why # the extra is needed. Since my initial target is one core, I'll defer # investigation until I bring up multiple cores. syncw is an octeon specific # instruction. r195359 | imp | 2009-07-05 02:14:00 -0600 (Sun, 05 Jul 2009) | 4 lines Bring in cdefs.h from NetBSD to define ABI goo. Obtained from: NetBSD r195358 | imp | 2009-07-05 02:13:19 -0600 (Sun, 05 Jul 2009) | 4 lines Pull in machine/cdefs.h for the ABI definitions. Provide a PTR_LA, ala sgi, and use it in preference to a bare 'la' so that it gets translated to a 'dla' for the 64-bit pointer ABIs. r195357 | imp | 2009-07-05 01:01:34 -0600 (Sun, 05 Jul 2009) | 2 lines Use uintptr_t rather than unsigned here for 64-bit correctness. r195356 | imp | 2009-07-05 01:00:51 -0600 (Sun, 05 Jul 2009) | 6 lines Define __ELF_WORD_SIZE appropriately for n64. Note for N32 I believe this is correct. While registers are 64-bit, n32 is a 32-bit ABI and lives in a 32-bit world (with explicit 64-bit registers, however). Change an 8, which was 4 + 4 or sizeof(int) + SZREG to be a simple '4 + SZREG' to reflect the actual offset of the structure in question. r195355 | imp | 2009-07-05 00:56:51 -0600 (Sun, 05 Jul 2009) | 7 lines (1) Use uintptr_t in preference to unsigned. The latter isn't right for 64-bit case, while the former is. (2) include a SB1 specific coherency mapping Submitted by: Neelkanth Nath (2) r195352 | imp | 2009-07-05 00:44:37 -0600 (Sun, 05 Jul 2009) | 3 lines db_expr_t should be a intptr_t, not an int. These expressions can be addresses or numbers, and that's a intptr_t if I ever saw one. r195351 | imp | 2009-07-05 00:43:01 -0600 (Sun, 05 Jul 2009) | 4 lines Define COP0_SYNC for SB1 CPU. Submitted by: Neelkanth Natu r195350 | imp | 2009-07-05 00:39:37 -0600 (Sun, 05 Jul 2009) | 7 lines Switch to ABI agnostic ta0-ta3. Provide defs for this in the right places. Provide n32/n64 register name defintions. This should have no effect for the O32 builds that everybody else uses, but should help make N64 builds possible (lots of other changes are needed for that). Obtained from: NetBSD (for the regdef.h changes) r195128 | gonzo | 2009-06-27 17:27:41 -0600 (Sat, 27 Jun 2009) | 4 lines - Add support for handling TLS area address in kernel space. From the userland point of view get/set operations are performed using sysarch(2) call. r195076 | gonzo | 2009-06-26 13:54:06 -0600 (Fri, 26 Jun 2009) | 2 lines - Add guards to ensure that these files are included only once r194469 | gonzo | 2009-06-18 22:43:49 -0600 (Thu, 18 Jun 2009) | 16 lines - Mark temp variable as "earlyclobber" in assembler inline in atomic_fetchadd_32. Without it gcc would use it as input register for v and sometimes generate following code for function call like atomic_fetchadd_32(&(fp)->f_count, -1): 801238b4: 2402ffff li v0,-1 801238b8: c2230018 ll v1,24(s1) 801238bc: 00431021 addu v0,v0,v1 801238c0: e2220018 sc v0,24(s1) 801238c4: 1040fffc beqz v0,801238b8 801238c8: 00000000 nop Which is definitly wrong because if sc fails v0 is set to 0 and previous value of -1 is overriden hence whole operation turns to bogus r194164 | imp | 2009-06-14 00:14:25 -0600 (Sun, 14 Jun 2009) | 3 lines bye bye. This is no longer referenced, but much code from it will resurface for a bus-space implementation. r194160 | imp | 2009-06-14 00:10:36 -0600 (Sun, 14 Jun 2009) | 3 lines Cavium-specific goo is no longer necessary here. Of course, I now have to write a bus space for cavium, but that shouldn't be too hard. r194157 | imp | 2009-06-14 00:01:46 -0600 (Sun, 14 Jun 2009) | 2 lines Move this to a more approrpiate plae. r194156 | imp | 2009-06-13 23:29:13 -0600 (Sat, 13 Jun 2009) | 2 lines Bring this in from the cavium port. r193487 | gonzo | 2009-06-05 02:37:11 -0600 (Fri, 05 Jun 2009) | 2 lines - Use restoreintr instead of enableint while accessing pcpu in DO_AST r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default we assume that there is no FPU, because majority of SoC does not have it. r192817 | gonzo | 2009-05-26 10:35:05 -0600 (Tue, 26 May 2009) | 2 lines - Add type cast for atomic_cmpset_acq_ptr arguments r192792 | gonzo | 2009-05-26 00:01:17 -0600 (Tue, 26 May 2009) | 2 lines - Remove now unused NetBSDism intr.h r192177 | gonzo | 2009-05-15 20:39:13 -0600 (Fri, 15 May 2009) | 4 lines - Add MIPS_IS_KSEG0_ADDR, MIPS_IS_KSEG1_ADDR and MIPS_IS_VALID_PTR macroses thet check if address belongs to KSEG0, KSEG1 or both of them respectively. r191589 | gonzo | 2009-04-27 13:18:55 -0600 (Mon, 27 Apr 2009) | 3 lines - Cast argument to proper type in order to avoid warnings like "shift value is too large for given type" r191577 | gonzo | 2009-04-27 12:29:59 -0600 (Mon, 27 Apr 2009) | 4 lines - Use naming convention the same as MIPS spec does: eliminate _sel1 sufix and just use selector number. e.g. mips_rd_config_sel1 -> mips_rd_config1 - Add WatchHi/WatchLo accessors for selctors 1..3 (for debug purposes) r191451 | gonzo | 2009-04-23 22:17:21 -0600 (Thu, 23 Apr 2009) | 4 lines - Define accessor functions for CP0 Config(16) register selects 1, 2, 3. Content of these registers is defined in MIPS spec and can be used for obtaining info about CPU capabilities. r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. Modified: head/sys/mips/include/_align.h head/sys/mips/include/_bus.h head/sys/mips/include/_types.h head/sys/mips/include/asm.h head/sys/mips/include/atomic.h head/sys/mips/include/bus.h head/sys/mips/include/cache.h head/sys/mips/include/cache_mipsNN.h head/sys/mips/include/cpu.h head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuinfo.h head/sys/mips/include/cpuregs.h head/sys/mips/include/db_machdep.h head/sys/mips/include/elf.h head/sys/mips/include/endian.h head/sys/mips/include/float.h head/sys/mips/include/hwfunc.h head/sys/mips/include/intr_machdep.h head/sys/mips/include/kdb.h head/sys/mips/include/locore.h head/sys/mips/include/md_var.h head/sys/mips/include/param.h head/sys/mips/include/pcb.h head/sys/mips/include/pmap.h head/sys/mips/include/proc.h head/sys/mips/include/profile.h head/sys/mips/include/psl.h head/sys/mips/include/pte.h head/sys/mips/include/regdef.h head/sys/mips/include/regnum.h head/sys/mips/include/trap.h head/sys/mips/include/ucontext.h Modified: head/sys/mips/include/_align.h ============================================================================== --- head/sys/mips/include/_align.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/_align.h Sun Jan 10 19:50:24 2010 (r202031) @@ -44,10 +44,10 @@ /* * Round p (pointer or byte index) up to a correctly-aligned value for all - * data types (int, long, ...). The result is u_int and must be cast to + * data types (int, long, ...). The result is u_long and must be cast to * any desired pointer type. */ #define _ALIGNBYTES 7 -#define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) +#define _ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #endif /* !_MIPS_INCLUDE__ALIGN_H_ */ Modified: head/sys/mips/include/_bus.h ============================================================================== --- head/sys/mips/include/_bus.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/_bus.h Sun Jan 10 19:50:24 2010 (r202031) @@ -31,19 +31,20 @@ #ifndef MIPS_INCLUDE__BUS_H #define MIPS_INCLUDE__BUS_H -#ifdef TARGET_OCTEON -#include "_bus_octeon.h" -#else /* * Bus address and size types */ +#include "opt_cputype.h" +#if !(defined(TARGET_OCTEON) && defined(ISA_MIPS32)) typedef uintptr_t bus_addr_t; +#else +typedef uint64_t bus_addr_t; +#endif typedef uintptr_t bus_size_t; /* * Access methods for bus resources and address space. */ -typedef long bus_space_tag_t; -typedef u_long bus_space_handle_t; -#endif +typedef struct bus_space *bus_space_tag_t; +typedef bus_addr_t bus_space_handle_t; #endif /* MIPS_INCLUDE__BUS_H */ Modified: head/sys/mips/include/_types.h ============================================================================== --- head/sys/mips/include/_types.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/_types.h Sun Jan 10 19:50:24 2010 (r202031) @@ -54,7 +54,7 @@ typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef long __int64_t; typedef unsigned long __uint64_t; #else @@ -79,14 +79,14 @@ typedef unsigned long long __uint64_t; */ typedef __int32_t __clock_t; /* clock()... */ typedef unsigned int __cpumask_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __critical_t; #else typedef __int32_t __critical_t; #endif typedef double __double_t; typedef double __float_t; -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __intfptr_t; typedef __int64_t __intptr_t; #else @@ -102,14 +102,14 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; -#if defined(__mips64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(__mips_n32) typedef __int64_t __register_t; typedef __int64_t f_register_t; #else typedef __int32_t __register_t; typedef __int32_t f_register_t; #endif -#ifdef __mips64 +#ifdef __mips_n64 typedef __int64_t __ptrdiff_t; typedef __int64_t __segsz_t; typedef __uint64_t __size_t; @@ -134,13 +134,16 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; -#if defined(__mips64) || defined(ISA_MIPS64) +#if defined(__mips_n64) || defined(__mips_n32) typedef __uint64_t __u_register_t; +#else +typedef __uint32_t __u_register_t; +#endif +#if defined(__mips_n64) typedef __uint64_t __vm_offset_t; typedef __uint64_t __vm_paddr_t; typedef __uint64_t __vm_size_t; #else -typedef __uint32_t __u_register_t; typedef __uint32_t __vm_offset_t; typedef __uint32_t __vm_paddr_t; typedef __uint32_t __vm_size_t; @@ -162,8 +165,4 @@ typedef char * __va_list; typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ #endif -typedef struct label_t { - __register_t val[13]; -} label_t; - #endif /* !_MACHINE__TYPES_H_ */ Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/asm.h Sun Jan 10 19:50:24 2010 (r202031) @@ -60,6 +60,7 @@ #include #endif #include +#include #undef __FBSDID #if !defined(lint) && !defined(STRIP_FBSDID) @@ -281,7 +282,7 @@ _C_LABEL(x): * Macros to panic and printf from assembly language. */ #define PANIC(msg) \ - la a0, 9f; \ + PTR_LA a0, 9f; \ jal _C_LABEL(panic); \ nop; \ MSG(msg) @@ -289,7 +290,7 @@ _C_LABEL(x): #define PANIC_KSEG0(msg, reg) PANIC(msg) #define PRINTF(msg) \ - la a0, 9f; \ + PTR_LA a0, 9f; \ jal _C_LABEL(printf); \ nop; \ MSG(msg) @@ -308,23 +309,24 @@ _C_LABEL(x): */ #define DO_AST \ 44: \ - la s0, _C_LABEL(disableintr) ;\ + PTR_LA s0, _C_LABEL(disableintr) ;\ jalr s0 ;\ nop ;\ + move a0, v0 ;\ GET_CPU_PCPU(s1) ;\ lw s3, PC_CURPCB(s1) ;\ lw s1, PC_CURTHREAD(s1) ;\ lw s2, TD_FLAGS(s1) ;\ li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ and s2, s0 ;\ - la s0, _C_LABEL(enableintr) ;\ + PTR_LA s0, _C_LABEL(restoreintr) ;\ jalr s0 ;\ nop ;\ beq s2, zero, 4f ;\ nop ;\ - la s0, _C_LABEL(ast) ;\ + PTR_LA s0, _C_LABEL(ast) ;\ jalr s0 ;\ - addu a0, s3, U_PCB_REGS ;\ + PTR_ADDU a0, s3, U_PCB_REGS ;\ j 44b ;\ nop ;\ 4: @@ -361,12 +363,15 @@ _C_LABEL(x): */ #if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32 +/* #if !defined(__mips_n64) */ #define REG_L lw #define REG_S sw #define REG_LI li #define REG_PROLOGUE .set push #define REG_EPILOGUE .set pop #define SZREG 4 +#define PTR_LA la +#define PTR_ADDU addu #else #define REG_L ld #define REG_S sd @@ -374,6 +379,8 @@ _C_LABEL(x): #define REG_PROLOGUE .set push ; .set mips3 #define REG_EPILOGUE .set pop #define SZREG 8 +#define PTR_LA dla +#define PTR_ADDU daddu #endif /* _MIPS_BSD_API */ #define mfc0_macro(data, spr) \ Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/atomic.h Sun Jan 10 19:50:24 2010 (r202031) @@ -34,6 +34,17 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +/* + * Note: All the 64-bit atomic operations are only atomic when running + * in 64-bit mode. It is assumed that code compiled for n32 and n64 + * fits into this definition and no further safeties are needed. + * + * It is also assumed that the add, subtract and other arithmetic is + * done on numbers not pointers. The special rules for n32 pointers + * do not have atomic operations defined for them, but generally shouldn't + * need atomic operations. + */ + static __inline void mips_sync(void) { @@ -126,7 +137,7 @@ atomic_subtract_32(__volatile uint32_t * "1:\tll %0, %3\n\t" /* load old value */ "subu %0, %2\n\t" /* calculate new value */ "sc %0, %1\n\t" /* attempt to store */ - "beqz %0, 1b\n\t" /* spin if failed */ + "beqz %0, 1b\n\t" /* spin if failed */ : "=&r" (temp), "=m" (*p) : "r" (v), "m" (*p) : "memory"); @@ -166,6 +177,110 @@ atomic_readandset_32(__volatile uint32_t return result; } +#if defined(__mips_n64) || defined(__mips_n32) +static __inline void +atomic_set_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "or %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); + +} + +static __inline void +atomic_clear_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + v = ~v; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "and %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline void +atomic_add_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "daddu %0, %2, %0\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline void +atomic_subtract_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "dsubu %0, %2\n\t" /* calculate new value */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* spin if failed */ + : "=&r" (temp), "=m" (*p) + : "r" (v), "m" (*p) + : "memory"); +} + +static __inline uint64_t +atomic_readandclear_64(__volatile uint64_t *addr) +{ + uint64_t result,temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %3\n\t" /* load old value */ + "li %1, 0\n\t" /* value to store */ + "scd %1, %2\n\t" /* attempt to store */ + "beqz %1, 1b\n\t" /* if the store failed, spin */ + : "=&r"(result), "=&r"(temp), "=m" (*addr) + : "m" (*addr) + : "memory"); + + return result; +} + +static __inline uint64_t +atomic_readandset_64(__volatile uint64_t *addr, uint64_t value) +{ + uint64_t result,temp; + + __asm __volatile ( + "1:\n\t" + "lld %0,%3\n\t" /* Load old value*/ + "or %1,$0,%4\n\t" + "scd %1,%2\n\t" /* attempt to store */ + "beqz %1, 1b\n\t" /* if the store failed, spin */ + : "=&r"(result), "=&r"(temp), "=m" (*addr) + : "m" (*addr), "r" (value) + : "memory"); + + return result; +} +#endif + #define ATOMIC_ACQ_REL(NAME, WIDTH) \ static __inline void \ atomic_##NAME##_acq_##WIDTH(__volatile uint##WIDTH##_t *p, uint##WIDTH##_t v)\ @@ -194,7 +309,7 @@ ATOMIC_ACQ_REL(set, 32) ATOMIC_ACQ_REL(clear, 32) ATOMIC_ACQ_REL(add, 32) ATOMIC_ACQ_REL(subtract, 32) -#if 0 +#if defined(__mips_n64) || defined(__mips_n32) ATOMIC_ACQ_REL(set, 64) ATOMIC_ACQ_REL(clear, 64) ATOMIC_ACQ_REL(add, 64) @@ -226,8 +341,22 @@ atomic_store_rel_##WIDTH(__volatile uint ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) -void atomic_store_64 (__volatile uint64_t *, uint64_t *); -void atomic_load_64 (__volatile uint64_t *, uint64_t *); +#if !defined(__mips_n64) && !defined(__mips_n32) +void atomic_store_64(__volatile uint64_t *, uint64_t *); +void atomic_load_64(__volatile uint64_t *, uint64_t *); +#else +static __inline void +atomic_store_64(__volatile uint64_t *p, uint64_t *v) +{ + *p = *v; +} + +static __inline void +atomic_load_64(__volatile uint64_t *p, uint64_t *v) +{ + *v = *p; +} +#endif #undef ATOMIC_STORE_LOAD @@ -294,11 +423,83 @@ atomic_fetchadd_32(__volatile uint32_t * "addu %2, %3, %0\n\t" /* calculate new value */ "sc %2, %1\n\t" /* attempt to store */ "beqz %2, 1b\n\t" /* spin if failed */ - : "=&r" (value), "=m" (*p), "=r" (temp) + : "=&r" (value), "=m" (*p), "=&r" (temp) : "r" (v), "m" (*p)); return (value); } +#if defined(__mips_n64) || defined(__mips_n32) +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +static __inline uint64_t +atomic_cmpset_64(__volatile uint64_t* p, uint64_t cmpval, uint64_t newval) +{ + uint64_t ret; + + __asm __volatile ( + "1:\n\t" + "lld %0, %4\n\t" /* load old value */ + "bne %0, %2, 2f\n\t" /* compare */ + "move %0, %3\n\t" /* value to store */ + "scd %0, %1\n\t" /* attempt to store */ + "beqz %0, 1b\n\t" /* if it failed, spin */ + "j 3f\n\t" + "2:\n\t" + "li %0, 0\n\t" + "3:\n" + : "=&r" (ret), "=m" (*p) + : "r" (cmpval), "r" (newval), "m" (*p) + : "memory"); + + return ret; +} + +/* + * Atomically compare the value stored at *p with cmpval and if the + * two values are equal, update the value of *p with newval. Returns + * zero if the compare failed, nonzero otherwise. + */ +static __inline uint64_t +atomic_cmpset_acq_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +{ + int retval; + + retval = atomic_cmpset_64(p, cmpval, newval); + mips_sync(); + return (retval); +} + +static __inline uint64_t +atomic_cmpset_rel_64(__volatile uint64_t *p, uint64_t cmpval, uint64_t newval) +{ + mips_sync(); + return (atomic_cmpset_64(p, cmpval, newval)); +} + +/* + * Atomically add the value of v to the integer pointed to by p and return + * the previous value of *p. + */ +static __inline uint64_t +atomic_fetchadd_64(__volatile uint64_t *p, uint64_t v) +{ + uint64_t value, temp; + + __asm __volatile ( + "1:\n\t" + "lld %0, %1\n\t" /* load old value */ + "daddu %2, %3, %0\n\t" /* calculate new value */ + "scd %2, %1\n\t" /* attempt to store */ + "beqz %2, 1b\n\t" /* spin if failed */ + : "=&r" (value), "=m" (*p), "=&r" (temp) + : "r" (v), "m" (*p)); + return (value); +} +#endif + /* Operations on chars. */ #define atomic_set_char atomic_set_8 #define atomic_set_acq_char atomic_set_acq_8 @@ -349,7 +550,13 @@ atomic_fetchadd_32(__volatile uint32_t * #define atomic_readandset_int atomic_readandset_32 #define atomic_fetchadd_int atomic_fetchadd_32 -#ifdef __mips64 +/* + * I think the following is right, even for n32. For n32 the pointers + * are still 32-bits, so we need to operate on them as 32-bit quantities, + * even though they are sign extended in operation. For longs, there's + * no question because they are always 32-bits. + */ +#ifdef __mips_n64 /* Operations on longs. */ #define atomic_set_long atomic_set_64 #define atomic_set_acq_long atomic_set_acq_64 @@ -371,27 +578,7 @@ atomic_fetchadd_32(__volatile uint32_t * #define atomic_fetchadd_long atomic_fetchadd_64 #define atomic_readandclear_long atomic_readandclear_64 -/* Operations on pointers. */ -#define atomic_set_ptr atomic_set_64 -#define atomic_set_acq_ptr atomic_set_acq_64 -#define atomic_set_rel_ptr atomic_set_rel_64 -#define atomic_clear_ptr atomic_clear_64 -#define atomic_clear_acq_ptr atomic_clear_acq_64 -#define atomic_clear_rel_ptr atomic_clear_rel_64 -#define atomic_add_ptr atomic_add_64 -#define atomic_add_acq_ptr atomic_add_acq_64 -#define atomic_add_rel_ptr atomic_add_rel_64 -#define atomic_subtract_ptr atomic_subtract_64 -#define atomic_subtract_acq_ptr atomic_subtract_acq_64 -#define atomic_subtract_rel_ptr atomic_subtract_rel_64 -#define atomic_cmpset_ptr atomic_cmpset_64 -#define atomic_cmpset_acq_ptr atomic_cmpset_acq_64 -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64 -#define atomic_load_acq_ptr atomic_load_acq_64 -#define atomic_store_rel_ptr atomic_store_rel_64 -#define atomic_readandclear_ptr atomic_readandclear_64 - -#else /* __mips64 */ +#else /* !__mips_n64 */ /* Operations on longs. */ #define atomic_set_long atomic_set_32 @@ -421,25 +608,26 @@ atomic_fetchadd_32(__volatile uint32_t * atomic_fetchadd_32((volatile u_int *)(p), (u_int)(v)) #define atomic_readandclear_long atomic_readandclear_32 +#endif /* __mips_n64 */ + /* Operations on pointers. */ -#define atomic_set_ptr atomic_set_32 -#define atomic_set_acq_ptr atomic_set_acq_32 -#define atomic_set_rel_ptr atomic_set_rel_32 -#define atomic_clear_ptr atomic_clear_32 -#define atomic_clear_acq_ptr atomic_clear_acq_32 -#define atomic_clear_rel_ptr atomic_clear_rel_32 -#define atomic_add_ptr atomic_add_32 -#define atomic_add_acq_ptr atomic_add_acq_32 -#define atomic_add_rel_ptr atomic_add_rel_32 -#define atomic_subtract_ptr atomic_subtract_32 -#define atomic_subtract_acq_ptr atomic_subtract_acq_32 -#define atomic_subtract_rel_ptr atomic_subtract_rel_32 -#define atomic_cmpset_ptr atomic_cmpset_32 -#define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 -#define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 -#define atomic_load_acq_ptr atomic_load_acq_32 -#define atomic_store_rel_ptr atomic_store_rel_32 -#define atomic_readandclear_ptr atomic_readandclear_32 -#endif /* __mips64 */ +#define atomic_set_ptr atomic_set_long +#define atomic_set_acq_ptr atomic_set_acq_long +#define atomic_set_rel_ptr atomic_set_rel_long +#define atomic_clear_ptr atomic_clear_long +#define atomic_clear_acq_ptr atomic_clear_acq_long +#define atomic_clear_rel_ptr atomic_clear_rel_long +#define atomic_add_ptr atomic_add_long +#define atomic_add_acq_ptr atomic_add_acq_long +#define atomic_add_rel_ptr atomic_add_rel_long +#define atomic_subtract_ptr atomic_subtract_long +#define atomic_subtract_acq_ptr atomic_subtract_acq_long +#define atomic_subtract_rel_ptr atomic_subtract_rel_long +#define atomic_cmpset_ptr atomic_cmpset_long +#define atomic_cmpset_acq_ptr atomic_cmpset_acq_long +#define atomic_cmpset_rel_ptr atomic_cmpset_rel_long +#define atomic_load_acq_ptr atomic_load_acq_long +#define atomic_store_rel_ptr atomic_store_rel_long +#define atomic_readandclear_ptr atomic_readandclear_long #endif /* ! _MACHINE_ATOMIC_H_ */ Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/bus.h Sun Jan 10 19:50:24 2010 (r202031) @@ -1,8 +1,7 @@ -/* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */ +/* $NetBSD: bus.h,v 1.11 2003/07/28 17:35:54 thorpej Exp $ */ + /*- - * $Id: bus.h,v 1.6 2007/08/09 11:23:32 katta Exp $ - * - * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. + * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -38,7 +37,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Copyright (c) 1996 Charles M. Hannum. All rights reserved. * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. * Modified: head/sys/mips/include/cache.h ============================================================================== --- head/sys/mips/include/cache.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cache.h Sun Jan 10 19:50:24 2010 (r202031) @@ -37,6 +37,9 @@ * $FreeBSD$ */ +#ifndef _MACHINE_CACHE_H_ +#define _MACHINE_CACHE_H_ + /* * Cache operations. * @@ -156,50 +159,8 @@ struct mips_cache_ops { extern struct mips_cache_ops mips_cache_ops; /* PRIMARY CACHE VARIABLES */ -extern u_int mips_picache_size; -extern u_int mips_picache_line_size; -extern u_int mips_picache_ways; -extern u_int mips_picache_way_size; -extern u_int mips_picache_way_mask; - -extern u_int mips_pdcache_size; /* and unified */ -extern u_int mips_pdcache_line_size; -extern u_int mips_pdcache_ways; -extern u_int mips_pdcache_way_size; -extern u_int mips_pdcache_way_mask; -extern int mips_pdcache_write_through; - -extern int mips_pcache_unified; - -/* SECONDARY CACHE VARIABLES */ -extern u_int mips_sicache_size; -extern u_int mips_sicache_line_size; -extern u_int mips_sicache_ways; -extern u_int mips_sicache_way_size; -extern u_int mips_sicache_way_mask; - -extern u_int mips_sdcache_size; /* and unified */ -extern u_int mips_sdcache_line_size; -extern u_int mips_sdcache_ways; -extern u_int mips_sdcache_way_size; -extern u_int mips_sdcache_way_mask; -extern int mips_sdcache_write_through; - -extern int mips_scache_unified; - -/* TERTIARY CACHE VARIABLES */ -extern u_int mips_tcache_size; /* always unified */ -extern u_int mips_tcache_line_size; -extern u_int mips_tcache_ways; -extern u_int mips_tcache_way_size; -extern u_int mips_tcache_way_mask; -extern int mips_tcache_write_through; - -extern u_int mips_dcache_align; -extern u_int mips_dcache_align_mask; - -extern u_int mips_cache_alias_mask; -extern u_int mips_cache_prefer_mask; +extern int mips_picache_linesize; +extern int mips_pdcache_linesize; #define __mco_noargs(prefix, x) \ do { \ @@ -259,3 +220,4 @@ void mips_config_cache(struct mips_cp void mips_dcache_compute_align(void); #include +#endif /* _MACHINE_CACHE_H_ */ Modified: head/sys/mips/include/cache_mipsNN.h ============================================================================== --- head/sys/mips/include/cache_mipsNN.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cache_mipsNN.h Sun Jan 10 19:50:24 2010 (r202031) @@ -36,6 +36,8 @@ * * $FreeBSD$ */ +#ifndef _MACHINE_CACHE_MIPSNN_H_ +#define _MACHINE_CACHE_MIPSNN_H_ void mipsNN_cache_init(struct mips_cpuinfo *); @@ -65,3 +67,5 @@ void mipsNN_pdcache_wbinv_range_index_12 void mipsNN_pdcache_inv_range_128(vm_offset_t, vm_size_t); void mipsNN_pdcache_wb_range_128(vm_offset_t, vm_size_t); #endif + +#endif /* _MACHINE_CACHE_MIPSNN_H_ */ Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cpu.h Sun Jan 10 19:50:24 2010 (r202031) @@ -56,21 +56,30 @@ #define MIPS_RESERVED_ADDR 0xbfc80000 #define MIPS_KSEG0_LARGEST_PHYS 0x20000000 -#define MIPS_CACHED_TO_PHYS(x) ((unsigned)(x) & 0x1fffffff) -#define MIPS_PHYS_TO_CACHED(x) ((unsigned)(x) | MIPS_CACHED_MEMORY_ADDR) -#define MIPS_UNCACHED_TO_PHYS(x) ((unsigned)(x) & 0x1fffffff) -#define MIPS_PHYS_TO_UNCACHED(x) ((unsigned)(x) | MIPS_UNCACHED_MEMORY_ADDR) +#define MIPS_CACHED_TO_PHYS(x) ((uintptr_t)(x) & 0x1fffffff) +#define MIPS_PHYS_TO_CACHED(x) ((uintptr_t)(x) | MIPS_CACHED_MEMORY_ADDR) +#define MIPS_UNCACHED_TO_PHYS(x) ((uintptr_t)(x) & 0x1fffffff) +#define MIPS_PHYS_TO_UNCACHED(x) ((uintptr_t)(x) | MIPS_UNCACHED_MEMORY_ADDR) #define MIPS_PHYS_MASK (0x1fffffff) #define MIPS_PA_2_K1VA(x) (MIPS_KSEG1_START | ((x) & MIPS_PHYS_MASK)) -#define MIPS_VA_TO_CINDEX(x) ((unsigned)(x) & 0xffffff | MIPS_CACHED_MEMORY_ADDR) +#define MIPS_VA_TO_CINDEX(x) ((uintptr_t)(x) & 0xffffff | MIPS_CACHED_MEMORY_ADDR) #define MIPS_CACHED_TO_UNCACHED(x) (MIPS_PHYS_TO_UNCACHED(MIPS_CACHED_TO_PHYS(x))) -#define MIPS_PHYS_TO_KSEG0(x) ((unsigned)(x) | MIPS_KSEG0_START) -#define MIPS_PHYS_TO_KSEG1(x) ((unsigned)(x) | MIPS_KSEG1_START) -#define MIPS_KSEG0_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK) -#define MIPS_KSEG1_TO_PHYS(x) ((unsigned)(x) & MIPS_PHYS_MASK) +#define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START) +#define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | MIPS_KSEG1_START) +#define MIPS_KSEG0_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) +#define MIPS_KSEG1_TO_PHYS(x) ((uintptr_t)(x) & MIPS_PHYS_MASK) + +#define MIPS_IS_KSEG0_ADDR(x) \ + (((vm_offset_t)(x) >= MIPS_KSEG0_START) && \ + ((vm_offset_t)(x) <= MIPS_KSEG0_END)) +#define MIPS_IS_KSEG1_ADDR(x) \ + (((vm_offset_t)(x) >= MIPS_KSEG1_START) && \ + ((vm_offset_t)(x) <= MIPS_KSEG1_END)) +#define MIPS_IS_VALID_PTR(x) (MIPS_IS_KSEG0_ADDR(x) || \ + MIPS_IS_KSEG1_ADDR(x)) /* * Status register. @@ -154,7 +163,11 @@ * The bits in the CONFIG register */ #define CFG_K0_UNCACHED 2 +#if defined(CPU_SB1) +#define CFG_K0_COHERENT 5 /* cacheable coherent */ +#else #define CFG_K0_CACHED 3 +#endif /* * The bits in the context register. Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cpufunc.h Sun Jan 10 19:50:24 2010 (r202031) @@ -183,20 +183,46 @@ mips_wr_ ## n (uint32_t a0) \ mips_barrier(); \ } struct __hack +#define MIPS_RDRW32_COP0_SEL(n,r,s) \ +static __inline uint32_t \ +mips_rd_ ## n ## s(void) \ +{ \ + int v0; \ + __asm __volatile ("mfc0 %[v0], $"__XSTRING(r)", "__XSTRING(s)";" \ + : [v0] "=&r"(v0)); \ + mips_barrier(); \ + return (v0); \ +} \ +static __inline void \ +mips_wr_ ## n ## s(uint32_t a0) \ +{ \ + __asm __volatile ("mtc0 %[a0], $"__XSTRING(r)", "__XSTRING(s)";" \ + __XSTRING(COP0_SYNC)";" \ + "nop;" \ + "nop;" \ + : \ + : [a0] "r"(a0)); \ + mips_barrier(); \ +} struct __hack + #ifdef TARGET_OCTEON static __inline void mips_sync_icache (void) { - __asm __volatile ( - ".set mips64\n" - ".word 0x041f0000\n" - "nop\n" - ".set mips0\n" - : : ); + __asm __volatile ( + ".set push\n" + ".set mips64\n" + ".word 0x041f0000\n" /* xxx ICACHE */ + "nop\n" + ".set pop\n" + : : ); } #endif MIPS_RDRW32_COP0(compare, MIPS_COP_0_COMPARE); MIPS_RDRW32_COP0(config, MIPS_COP_0_CONFIG); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 1); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 2); +MIPS_RDRW32_COP0_SEL(config, MIPS_COP_0_CONFIG, 3); MIPS_RDRW32_COP0(count, MIPS_COP_0_COUNT); MIPS_RDRW32_COP0(index, MIPS_COP_0_TLB_INDEX); MIPS_RDRW32_COP0(wired, MIPS_COP_0_TLB_WIRED); @@ -211,18 +237,13 @@ MIPS_RDRW32_COP0(entryhi, MIPS_COP_0_TLB MIPS_RDRW32_COP0(pagemask, MIPS_COP_0_TLB_PG_MASK); MIPS_RDRW32_COP0(prid, MIPS_COP_0_PRID); MIPS_RDRW32_COP0(watchlo, MIPS_COP_0_WATCH_LO); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 1); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 2); +MIPS_RDRW32_COP0_SEL(watchlo, MIPS_COP_0_WATCH_LO, 3); MIPS_RDRW32_COP0(watchhi, MIPS_COP_0_WATCH_HI); - -static __inline uint32_t -mips_rd_config_sel1(void) -{ - int v0; - __asm __volatile("mfc0 %[v0], $16, 1 ;" - : [v0] "=&r" (v0)); - mips_barrier(); - return (v0); -} - +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 1); +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 2); +MIPS_RDRW32_COP0_SEL(watchhi, MIPS_COP_0_WATCH_HI, 3); #undef MIPS_RDRW32_COP0 static __inline register_t Modified: head/sys/mips/include/cpuinfo.h ============================================================================== --- head/sys/mips/include/cpuinfo.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cpuinfo.h Sun Jan 10 19:50:24 2010 (r202031) @@ -57,11 +57,11 @@ struct mips_cpuinfo { u_int16_t tlb_nentries; u_int8_t icache_virtual; struct { - u_int8_t ic_size; + u_int32_t ic_size; u_int8_t ic_linesize; u_int8_t ic_nways; u_int16_t ic_nsets; - u_int8_t dc_size; + u_int32_t dc_size; u_int8_t dc_linesize; u_int8_t dc_nways; u_int16_t dc_nsets; Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/cpuregs.h Sun Jan 10 19:50:24 2010 (r202031) @@ -103,6 +103,8 @@ /* CPU dependent mtc0 hazard hook */ #ifdef TARGET_OCTEON #define COP0_SYNC nop; nop; nop; nop; nop; +#elif defined(CPU_SB1) +#define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop #else #define COP0_SYNC /* nothing */ #endif @@ -848,6 +850,10 @@ #define MIPS_4KEc_R2 0x90 /* MIPS 4KEc_R2 ISA 32 Rel 2 */ #define MIPS_4KEmp_R2 0x91 /* MIPS 4KEm/4KEp_R2 ISA 32 Rel 2 */ #define MIPS_4KSd 0x92 /* MIPS 4KSd ISA 32 Rel 2 */ +#define MIPS_24K 0x93 /* MIPS 24Kc/24Kf ISA 32 Rel 2 */ +#define MIPS_34K 0x95 /* MIPS 34K ISA 32 R2 MT */ +#define MIPS_24KE 0x96 /* MIPS 24KEc ISA 32 Rel 2 */ +#define MIPS_74K 0x97 /* MIPS 74Kc/74Kf ISA 32 Rel 2 */ /* * AMD (company ID 3) use the processor ID field to donote the CPU core Modified: head/sys/mips/include/db_machdep.h ============================================================================== --- head/sys/mips/include/db_machdep.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/db_machdep.h Sun Jan 10 19:50:24 2010 (r202031) @@ -46,7 +46,7 @@ typedef struct trapframe db_regs_t; extern db_regs_t ddb_regs; /* register state */ typedef vm_offset_t db_addr_t; /* address - unsigned */ -typedef int db_expr_t; /* expression - signed */ +typedef register_t db_expr_t; /* expression - signed */ #if BYTE_ORDER == _BIG_ENDIAN #define BYTE_MSF (1) @@ -94,6 +94,7 @@ db_addr_t next_instr_address(db_addr_t, int db_inst_type(int); void db_dump_tlb(int, int); db_addr_t branch_taken(int inst, db_addr_t pc); -void stacktrace_subr(db_regs_t *, int (*)(const char *, ...)); +void stacktrace_subr(register_t pc, register_t sp, register_t ra, int (*)(const char *, ...)); +int kdbpeek(int *); #endif /* !_MIPS_DB_MACHDEP_H_ */ Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/elf.h Sun Jan 10 19:50:24 2010 (r202031) @@ -41,8 +41,12 @@ /* Information taken from MIPS ABI supplemental */ #ifndef __ELF_WORD_SIZE +#if defined(__mips_n64) +#define __ELF_WORD_SIZE 64 /* Used by */ +#else #define __ELF_WORD_SIZE 32 /* Used by */ #endif +#endif #include /* Definitions common to all 32 bit architectures. */ #include /* Definitions common to all 64 bit architectures. */ #include Modified: head/sys/mips/include/endian.h ============================================================================== --- head/sys/mips/include/endian.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/endian.h Sun Jan 10 19:50:24 2010 (r202031) @@ -108,12 +108,12 @@ __bswap64_var(__uint64_t _x) ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56))); } -#define __bswap16(x) (__uint16_t)(__is_constant(x) ? __bswap16_const(x) : \ - __bswap16_var(x)) -#define __bswap32(x) (__uint32_t)(__is_constant(x) ? __bswap32_const(x) : \ - __bswap32_var(x)) -#define __bswap64(x) (__uint64_t)(__is_constant(x) ? __bswap64_const(x) : \ - __bswap64_var(x)) +#define __bswap16(x) (__uint16_t)(__is_constant(x) ? \ + __bswap16_const((__uint16_t)x) : __bswap16_var((__uint16_t)x)) +#define __bswap32(x) (__uint32_t)(__is_constant(x) ? \ + __bswap32_const((__uint32_t)x) : __bswap32_var((__uint32_t)x)) +#define __bswap64(x) (__uint64_t)(__is_constant(x) ? \ + __bswap64_const((__uint64_t)x) : __bswap64_var((__uint64_t)x)) #ifdef __MIPSEB__ #define __htonl(x) ((__uint32_t)(x)) Modified: head/sys/mips/include/float.h ============================================================================== --- head/sys/mips/include/float.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/float.h Sun Jan 10 19:50:24 2010 (r202031) @@ -42,10 +42,10 @@ extern int __flt_rounds(void); __END_DECLS #define FLT_RADIX 2 /* b */ -#ifdef SOFTFLOAT -#define FLT_ROUNDS -1 -#else +#ifdef CPU_HAVEFPU #define FLT_ROUNDS __flt_rounds() /* FP addition rounds to nearest */ +#else +#define FLT_ROUNDS -1 #endif /* * XXXMIPS: MIPS32 has both float and double type, so set FLT_EVAL_METHOD Modified: head/sys/mips/include/hwfunc.h ============================================================================== --- head/sys/mips/include/hwfunc.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/hwfunc.h Sun Jan 10 19:50:24 2010 (r202031) @@ -29,7 +29,7 @@ #define _MACHINE_HWFUNC_H_ struct trapframe; - +struct timecounter; /* * Hooks downward into hardware functionality. */ @@ -39,4 +39,12 @@ void platform_intr(struct trapframe *); void platform_reset(void); void platform_start(__register_t, __register_t, __register_t, __register_t); +/* For clocks and ticks and such */ +void platform_initclocks(void); +uint64_t platform_get_frequency(void); +unsigned platform_get_timecount(struct timecounter *); + +/* For hardware specific CPU initialization */ +void platform_cpu_init(void); +void platform_secondary_init(void); #endif /* !_MACHINE_HWFUNC_H_ */ Modified: head/sys/mips/include/intr_machdep.h ============================================================================== --- head/sys/mips/include/intr_machdep.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/intr_machdep.h Sun Jan 10 19:50:24 2010 (r202031) @@ -29,15 +29,48 @@ #ifndef _MACHINE_INTR_MACHDEP_H_ #define _MACHINE_INTR_MACHDEP_H_ +#ifdef TARGET_XLR_XLS +/* + * XLR/XLS uses its own intr_machdep.c and has + * a different number of interupts. This probably + * should be placed somewhere else. + */ + +struct mips_intrhand { + struct intr_event *mih_event; + driver_intr_t *mih_disable; + volatile long *cntp; /* interrupt counter */ +}; + +extern struct mips_intrhand mips_intr_handlers[]; +#define XLR_MAX_INTR 64 + +#else #define NHARD_IRQS 6 #define NSOFT_IRQS 2 +#endif struct trapframe; -void cpu_establish_hardintr(const char *, int (*)(void*), void (*)(void*), +void cpu_init_interrupts(void); +void cpu_establish_hardintr(const char *, driver_filter_t *, driver_intr_t *, void *, int, int, void **); -void cpu_establish_softintr(const char *, int (*)(void*), void (*)(void*), +void cpu_establish_softintr(const char *, driver_filter_t *, void (*)(void*), void *, int, int, void **); void cpu_intr(struct trapframe *); +/* + * Opaque datatype that represents intr counter + */ +typedef unsigned long* mips_intrcnt_t; + +mips_intrcnt_t mips_intrcnt_create(const char *); +void mips_intrcnt_setname(mips_intrcnt_t, const char *); + +static __inline void +mips_intrcnt_inc(mips_intrcnt_t counter) +{ + if (counter) + atomic_add_long(counter, 1); +} #endif /* !_MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/mips/include/kdb.h ============================================================================== --- head/sys/mips/include/kdb.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/kdb.h Sun Jan 10 19:50:24 2010 (r202031) @@ -47,4 +47,8 @@ kdb_cpu_trap(int vector, int _) { } +static __inline void +kdb_cpu_sync_icache(unsigned char *addr, size_t size) +{ +} #endif /* _MACHINE_KDB_H_ */ Modified: head/sys/mips/include/locore.h ============================================================================== --- head/sys/mips/include/locore.h Sun Jan 10 19:44:08 2010 (r202030) +++ head/sys/mips/include/locore.h Sun Jan 10 19:50:24 2010 (r202031) @@ -60,6 +60,7 @@ typedef int mips_prid_t; /* 0x09 unannounced */ /* 0x0a unannounced */ #define MIPS_PRID_CID_LEXRA 0x0b /* Lexra */ +#define MIPS_PRID_CID_CAVIUM 0x0d /* Cavium */ #define MIPS_PRID_COPTS(x) (((x) >> 24) & 0x00ff) /* Company Options */ #ifdef _KERNEL *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:53:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6E3106568B; Sun, 10 Jan 2010 19:53:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 612138FC29; Sun, 10 Jan 2010 19: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 o0AJrbfe024199; Sun, 10 Jan 2010 19:53:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJrbHY024198; Sun, 10 Jan 2010 19:53:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101953.o0AJrbHY024198@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19: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: r202032 - head/sys/mips/alchemy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:53:37 -0000 Author: imp Date: Sun Jan 10 19:53:37 2010 New Revision: 202032 URL: http://svn.freebsd.org/changeset/base/202032 Log: Merge from projects/mips to head by hand: Merge support for very early alchemy port. I wouldn't merge this except I don't want it to get lost when we retire projects/mips. Should be consiered pre-alpha at this stage. Also, alchemy is now owned by rmi, but started out life as a separate processor line, so I'm leaving it in its own directory rather than try to shoe-horn it into the unrelated rmi directory. Its future location is an open question. Added: - copied from r202031, projects/mips/sys/mips/alchemy/ Directory Properties: head/sys/mips/alchemy/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 19:54:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B13D1065693; Sun, 10 Jan 2010 19:54:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12EBC8FC25; Sun, 10 Jan 2010 19:54: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 o0AJsIFb024372; Sun, 10 Jan 2010 19:54:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AJsITF024370; Sun, 10 Jan 2010 19:54:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001101954.o0AJsITF024370@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 19: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: r202033 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 19:54:19 -0000 Author: imp Date: Sun Jan 10 19:54:18 2010 New Revision: 202033 URL: http://svn.freebsd.org/changeset/base/202033 Log: Merge from projects/mips to head by hand: ALCHEMY config file. Added: - copied unchanged from r202032, projects/mips/sys/mips/conf/ALCHEMY Directory Properties: head/sys/mips/conf/ALCHEMY (props changed) Copied: head/sys/mips/conf/ALCHEMY (from r202032, projects/mips/sys/mips/conf/ALCHEMY) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/ALCHEMY Sun Jan 10 19:54:18 2010 (r202033, copy of r202032, projects/mips/sys/mips/conf/ALCHEMY) @@ -0,0 +1,66 @@ +# ALCHEMY -- Generic kernel for Alchemy Au1xxx CPUs. +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident ALCHEMY + +makeoptions ARCH_FLAGS=-march=mips32 +makeoptions MIPS_LITTLE_ENDIAN=defined + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" + +include "../alchemy/std.alchemy" + +hints "ALCHEMY.hints" #Default places to look for devices. + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +# options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=admsw0 +options BOOTP_COMPAT + +# options FFS #Berkeley Fast Filesystem +# options SOFTUPDATES #Enable FFS soft updates support +# options UFS_ACL #Support for access control lists +# options UFS_DIRHASH #Improve performance on big directories +options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" + + +# Debugging for use in -current +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +device loop +device ether +device uart +# device md From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:03:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91CCF106566B; Sun, 10 Jan 2010 20:03:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82EEB8FC1B; Sun, 10 Jan 2010 20:03: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 o0AK3G43026436; Sun, 10 Jan 2010 20:03:16 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AK3G3w026433; Sun, 10 Jan 2010 20:03:16 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102003.o0AK3G3w026433@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:03: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: r202034 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:03:16 -0000 Author: imp Date: Sun Jan 10 20:03:16 2010 New Revision: 202034 URL: http://svn.freebsd.org/changeset/base/202034 Log: Merge from projects/mips to head by hand: I think these are the relevant changes, but definitely are a superset of them. Software archaeologists are invited to check the branch itself for the details. r199695 | imp | 2009-11-23 00:49:50 -0700 (Mon, 23 Nov 2009) | 2 lines Specify loader script and load address r198263 | neel | 2009-10-19 22:31:20 -0600 (Mon, 19 Oct 2009) | 7 lines The default KERNLOADADDR does not work on MALTA hardware. On my platform the "First free SDRAM address" reported by YAMON is 0x800b6e61. So use a conservative KERNLOADADDR of 0x80100000. Approved by: imp (mentor) r194163 | imp | 2009-06-14 00:12:21 -0600 (Sun, 14 Jun 2009) | 2 lines Kludge: pretend to be ISA_MIPS32 for the moment. r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default we assume that there is no FPU, because majority of SoC does not have it. r187461 | gonzo | 2009-01-19 21:24:03 -0700 (Mon, 19 Jan 2009) | 3 lines - KERNLOADADDR should be defined with makeoption. Redboot loads kernel now r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines - Add trampoline stuff for bootloaders that do not support ELF - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with KERNLOADADDR/TRAMPLOADADDR and clean configs Modified: head/sys/mips/conf/MALTA head/sys/mips/conf/SENTRY5 Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Sun Jan 10 19:54:18 2010 (r202033) +++ head/sys/mips/conf/MALTA Sun Jan 10 20:03:16 2010 (r202034) @@ -21,6 +21,7 @@ ident MALTA #makeoptions ARCH_FLAGS=-march=mips32 makeoptions MIPS_LITTLE_ENDIAN=defined +makeoptions KERNLOADADDR=0x80100000 options YAMON @@ -33,6 +34,8 @@ options TICK_USE_YAMON_FREQ=defined include "../malta/std.malta" +options ISA_MIPS32 + hints "MALTA.hints" #Default places to look for devices. makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Sun Jan 10 19:54:18 2010 (r202033) +++ head/sys/mips/conf/SENTRY5 Sun Jan 10 20:03:16 2010 (r202034) @@ -26,9 +26,8 @@ ident SENTRY5 cpu CPU_MIPS4KC -options CPU_NOFPU options ISA_MIPS32 -options CPU_SENTRY5 # XXX should this be a +options CPU_SENTRY5 # XXX should this be a # sub-cpu option? # XXX only siba should be hardwired for now; we will use @@ -37,50 +36,43 @@ files "../sentry5/files.sentry5" hints "SENTRY5.hints" # sentry5 normally ships with cfe firmware; use the console for now -options CFE -options CFE_CONSOLE -options ALT_BREAK_TO_DEBUGGER - -# cfe loader expects kernel at 0x80001000 for mips32 w/o backwards -# offsets in the linked elf image (see ldscript hack) -# XXX can we conditionalize the linker stuff on options CFE? -options KERNVIRTADDR=0x80001000 - -makeoptions LDSCRIPT_NAME= ldscript.mips.cfe +options CFE +options CFE_CONSOLE +options ALT_BREAK_TO_DEBUGGER #makeoptions ARCH_FLAGS=-march=mips32 makeoptions MIPS_LITTLE_ENDIAN=defined makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" -options DDB -options KDB +options DDB +options KDB -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options PSEUDOFS #Pseudo-filesystem framework -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current -options INVARIANTS -options INVARIANT_SUPPORT +options INVARIANTS +options INVARIANT_SUPPORT -#options BUS_DEBUG +#options BUS_DEBUG #makeoptions BUS_DEBUG device siba # Sonics SiliconBackplane device pci # siba_pcib -device bfe # XXX will build both pci and siba -device miibus # attachments +# device bfe # XXX will build both pci and siba +# device miibus # attachments # pci devices # notyet: #device ath # in pci slot #device ath_hal # pci chip support -#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device usb # USB Bus (required) device uhci # UHCI PCI->USB interface From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:06:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 218A9106566B; Sun, 10 Jan 2010 20:06:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 117B98FC12; Sun, 10 Jan 2010 20:06: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 o0AK6Ffa027153; Sun, 10 Jan 2010 20:06:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AK6ECt027143; Sun, 10 Jan 2010 20:06:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102006.o0AK6ECt027143@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:06: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: r202035 - head/sys/mips/malta X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:06:15 -0000 Author: imp Date: Sun Jan 10 20:06:14 2010 New Revision: 202035 URL: http://svn.freebsd.org/changeset/base/202035 Log: Merge from projects/mips to head by hand: r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r196836 | gonzo | 2009-09-04 13:02:11 -0600 (Fri, 04 Sep 2009) | 2 lines - Clean out some XXXMIPS comments that's not relevant now r196236 | imp | 2009-08-14 19:03:13 -0600 (Fri, 14 Aug 2009) | 3 lines Fix style error replicated multiple times. Move to mips_bus_space_generic for octeon obio impl. r195496 | imp | 2009-07-09 09:04:52 -0600 (Thu, 09 Jul 2009) | 2 lines Don't force ISA_MIPS32. r195495 | imp | 2009-07-09 09:04:24 -0600 (Thu, 09 Jul 2009) | 4 lines Make the yamon function pointer stuff 64-bit safe. Make the base unsigned long, and sign extend the address of the function we're calling through. r195494 | imp | 2009-07-09 08:54:09 -0600 (Thu, 09 Jul 2009) | 3 lines Addresses should be unsigned long. Make the address constants unsigned long. r194929 | gonzo | 2009-06-24 16:42:52 -0600 (Wed, 24 Jun 2009) | 6 lines - Do not use hardcoded uart speed - Call mips_timer_early_init before initializing uart in order to make DELAY usable for ns8250 driver Submitted by: Neelkanth Natu r194212 | gonzo | 2009-06-14 14:54:46 -0600 (Sun, 14 Jun 2009) | 2 lines - Fix prototypes to make compiler happy r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default we assume that there is no FPU, because majority of SoC does not have it. r192788 | gonzo | 2009-05-25 22:51:56 -0600 (Mon, 25 May 2009) | 3 lines - Provide proper pre_thread/post_ithread functions for GT PCI controller. r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. Modified: head/sys/mips/malta/files.malta head/sys/mips/malta/gt_pci.c head/sys/mips/malta/malta_machdep.c head/sys/mips/malta/maltareg.h head/sys/mips/malta/obio.c head/sys/mips/malta/std.malta head/sys/mips/malta/uart_bus_maltausart.c head/sys/mips/malta/uart_cpu_maltausart.c head/sys/mips/malta/yamon.h Modified: head/sys/mips/malta/files.malta ============================================================================== --- head/sys/mips/malta/files.malta Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/files.malta Sun Jan 10 20:06:14 2010 (r202035) @@ -7,3 +7,5 @@ mips/malta/uart_bus_maltausart.c optiona dev/uart/uart_dev_ns8250.c optional uart mips/malta/malta_machdep.c standard mips/malta/yamon.c standard +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Modified: head/sys/mips/malta/gt_pci.c ============================================================================== --- head/sys/mips/malta/gt_pci.c Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/gt_pci.c Sun Jan 10 20:06:14 2010 (r202035) @@ -91,11 +91,16 @@ __FBSDID("$FreeBSD$"); #define OCW3_POLL_IRQ(x) ((x) & 0x7f) #define OCW3_POLL_PENDING (1U << 7) +struct gt_pci_softc; + +struct gt_pci_intr_cookie { + int irq; + struct gt_pci_softc *sc; +}; + struct gt_pci_softc { device_t sc_dev; bus_space_tag_t sc_st; - bus_space_tag_t sc_pciio; - bus_space_tag_t sc_pcimem; bus_space_handle_t sc_ioh_icu1; bus_space_handle_t sc_ioh_icu2; bus_space_handle_t sc_ioh_elcr; @@ -109,6 +114,7 @@ struct gt_pci_softc { struct resource *sc_irq; struct intr_event *sc_eventstab[ICU_LEN]; + struct gt_pci_intr_cookie sc_intr_cookies[ICU_LEN]; uint16_t sc_imask; uint16_t sc_elcr; @@ -117,6 +123,52 @@ struct gt_pci_softc { void *sc_ih; }; +static void gt_pci_set_icus(struct gt_pci_softc *); +static int gt_pci_intr(void *v); +static int gt_pci_probe(device_t); +static int gt_pci_attach(device_t); +static int gt_pci_activate_resource(device_t, device_t, int, int, + struct resource *); +static int gt_pci_setup_intr(device_t, device_t, struct resource *, + int, driver_filter_t *, driver_intr_t *, void *, void **); +static int gt_pci_teardown_intr(device_t, device_t, struct resource *, void*); +static int gt_pci_maxslots(device_t ); +static int gt_pci_conf_setup(struct gt_pci_softc *, int, int, int, int, + uint32_t *); +static uint32_t gt_pci_read_config(device_t, u_int, u_int, u_int, u_int, int); +static void gt_pci_write_config(device_t, u_int, u_int, u_int, u_int, + uint32_t, int); +static int gt_pci_route_interrupt(device_t pcib, device_t dev, int pin); +static struct resource * gt_pci_alloc_resource(device_t, device_t, int, + int *, u_long, u_long, u_long, u_int); + +static void +gt_pci_mask_irq(void *source) +{ + struct gt_pci_intr_cookie *cookie = source; + struct gt_pci_softc *sc = cookie->sc; + int irq = cookie->irq; + + sc->sc_imask |= (1 << irq); + sc->sc_elcr |= (1 << irq); + + gt_pci_set_icus(sc); +} + +static void +gt_pci_unmask_irq(void *source) +{ + struct gt_pci_intr_cookie *cookie = source; + struct gt_pci_softc *sc = cookie->sc; + int irq = cookie->irq; + + /* Enable it, set trigger mode. */ + sc->sc_imask &= ~(1 << irq); + sc->sc_elcr &= ~(1 << irq); + + gt_pci_set_icus(sc); +} + static void gt_pci_set_icus(struct gt_pci_softc *sc) { @@ -126,14 +178,14 @@ gt_pci_set_icus(struct gt_pci_softc *sc) else sc->sc_imask |= (1U << 2); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, PIC_OCW1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, PIC_OCW1, sc->sc_imask & 0xff); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, PIC_OCW1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, PIC_OCW1, (sc->sc_imask >> 8) & 0xff); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_elcr, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_elcr, 0, sc->sc_elcr & 0xff); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_elcr, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_elcr, 1, (sc->sc_elcr >> 8) & 0xff); } @@ -145,9 +197,9 @@ gt_pci_intr(void *v) int irq; for (;;) { - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, PIC_OCW3, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, PIC_OCW3, OCW3_SEL | OCW3_P); - irq = bus_space_read_1(sc->sc_pciio, sc->sc_ioh_icu1, PIC_OCW3); + irq = bus_space_read_1(sc->sc_st, sc->sc_ioh_icu1, PIC_OCW3); if ((irq & OCW3_POLL_PENDING) == 0) { return FILTER_HANDLED; @@ -156,9 +208,9 @@ gt_pci_intr(void *v) irq = OCW3_POLL_IRQ(irq); if (irq == 2) { - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, PIC_OCW3, OCW3_SEL | OCW3_P); - irq = bus_space_read_1(sc->sc_pciio, sc->sc_ioh_icu2, + irq = bus_space_read_1(sc->sc_st, sc->sc_ioh_icu2, PIC_OCW3); if (irq & OCW3_POLL_PENDING) irq = OCW3_POLL_IRQ(irq) + 8; @@ -177,13 +229,13 @@ gt_pci_intr(void *v) /* Send a specific EOI to the 8259. */ if (irq > 7) { - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, PIC_OCW2, OCW2_SELECT | OCW2_EOI | OCW2_SL | OCW2_ILS(irq & 7)); irq = 2; } - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, PIC_OCW2, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, PIC_OCW2, OCW2_SELECT | OCW2_EOI | OCW2_SL | OCW2_ILS(irq)); } @@ -208,8 +260,7 @@ gt_pci_attach(device_t dev) busno = 0; sc->sc_dev = dev; sc->sc_busno = busno; - sc->sc_pciio = MIPS_BUS_SPACE_IO; - sc->sc_pcimem = MIPS_BUS_SPACE_MEM; + sc->sc_st = mips_bus_space_generic; /* Use KSEG1 to access IO ports for it is uncached */ sc->sc_io = MIPS_PHYS_TO_KSEG1(MALTA_PCI0_IO_BASE); @@ -239,11 +290,11 @@ gt_pci_attach(device_t dev) * Map the PIC/ELCR registers. */ #if 0 - if (bus_space_map(sc->sc_pciio, 0x4d0, 2, 0, &sc->sc_ioh_elcr) != 0) + if (bus_space_map(sc->sc_st, 0x4d0, 2, 0, &sc->sc_ioh_elcr) != 0) device_printf(dev, "unable to map ELCR registers\n"); - if (bus_space_map(sc->sc_pciio, IO_ICU1, 2, 0, &sc->sc_ioh_icu1) != 0) + if (bus_space_map(sc->sc_st, IO_ICU1, 2, 0, &sc->sc_ioh_icu1) != 0) device_printf(dev, "unable to map ICU1 registers\n"); - if (bus_space_map(sc->sc_pciio, IO_ICU2, 2, 0, &sc->sc_ioh_icu2) != 0) + if (bus_space_map(sc->sc_st, IO_ICU2, 2, 0, &sc->sc_ioh_icu2) != 0) device_printf(dev, "unable to map ICU2 registers\n"); #else sc->sc_ioh_elcr = sc->sc_io + 0x4d0; @@ -262,58 +313,58 @@ gt_pci_attach(device_t dev) * Initialize the 8259s. */ /* reset, program device, 4 bytes */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 0, ICW1_RESET | ICW1_IC4); /* * XXX: values from NetBSD's */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 1, 0/*XXX*/); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 1, 1 << 2); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 1, ICW4_8086); /* mask all interrupts */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 0, sc->sc_imask & 0xff); /* enable special mask mode */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 1, OCW3_SEL | OCW3_ESMM | OCW3_SMM); /* read IRR by default */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu1, 1, OCW3_SEL | OCW3_RR); /* reset, program device, 4 bytes */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 0, ICW1_RESET | ICW1_IC4); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 1, 0/*XXX*/); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 1, 1 << 2); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 1, ICW4_8086); /* mask all interrupts */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 0, sc->sc_imask & 0xff); /* enable special mask mode */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 1, OCW3_SEL | OCW3_ESMM | OCW3_SMM); /* read IRR by default */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu2, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_icu2, 1, OCW3_SEL | OCW3_RR); /* * Default all interrupts to edge-triggered. */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_elcr, 0, + bus_space_write_1(sc->sc_st, sc->sc_ioh_elcr, 0, sc->sc_elcr & 0xff); - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_elcr, 1, + bus_space_write_1(sc->sc_st, sc->sc_ioh_elcr, 1, (sc->sc_elcr >> 8) & 0xff); /* @@ -570,12 +621,12 @@ gt_pci_alloc_resource(device_t bus, devi break; case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; - bt = sc->sc_pcimem; + bt = sc->sc_st; bh = sc->sc_mem; break; case SYS_RES_IOPORT: rm = &sc->sc_io_rman; - bt = sc->sc_pciio; + bt = sc->sc_st; bh = sc->sc_io; break; default: @@ -632,10 +683,13 @@ gt_pci_setup_intr(device_t dev, device_t panic("%s: bad irq or type", __func__); event = sc->sc_eventstab[irq]; + sc->sc_intr_cookies[irq].irq = irq; + sc->sc_intr_cookies[irq].sc = sc; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - (mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq, - (mask_fn)mips_unmask_irq, NULL, "gt_pci intr%d:", irq); + error = intr_event_create(&event, + (void *)&sc->sc_intr_cookies[irq], 0, irq, + gt_pci_mask_irq, gt_pci_unmask_irq, + NULL, NULL, "gt_pci intr%d:", irq); if (error) return 0; sc->sc_eventstab[irq] = event; @@ -644,12 +698,7 @@ gt_pci_setup_intr(device_t dev, device_t intr_event_add_handler(event, device_get_nameunit(child), filt, handler, arg, intr_priority(flags), flags, cookiep); - /* Enable it, set trigger mode. */ - sc->sc_imask &= ~(1 << irq); - sc->sc_elcr &= ~(1 << irq); - - gt_pci_set_icus(sc); - + gt_pci_unmask_irq((void *)&sc->sc_intr_cookies[irq]); return 0; } @@ -657,6 +706,12 @@ static int gt_pci_teardown_intr(device_t dev, device_t child, struct resource *res, void *cookie) { + struct gt_pci_softc *sc = device_get_softc(dev); + int irq; + + irq = rman_get_start(res); + gt_pci_mask_irq((void *)&sc->sc_intr_cookies[irq]); + return (intr_event_remove_handler(cookie)); } Modified: head/sys/mips/malta/malta_machdep.c ============================================================================== --- head/sys/mips/malta/malta_machdep.c Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/malta_machdep.c Sun Jan 10 20:06:14 2010 (r202035) @@ -97,6 +97,12 @@ static int malta_lcd_offs[] = { MALTA_ASCIIPOS7 }; +void +platform_cpu_init() +{ + /* Nothing special */ +} + /* * Put character to Malta LCD at given position. */ @@ -226,6 +232,52 @@ platform_trap_exit(void) } +static uint64_t +malta_cpu_freq(void) +{ + uint64_t platform_counter_freq = 0; + +#if defined(TICK_USE_YAMON_FREQ) + /* + * If we are running on a board which uses YAMON firmware, + * then query CPU pipeline clock from the syscon object. + * If unsuccessful, use hard-coded default. + */ + platform_counter_freq = yamon_getcpufreq(); + +#elif defined(TICK_USE_MALTA_RTC) + /* + * If we are running on a board with the MC146818 RTC, + * use it to determine CPU pipeline clock frequency. + */ + u_int64_t counterval[2]; + + /* Set RTC to binary mode. */ + writertc(RTC_STATUSB, (rtcin(RTC_STATUSB) | RTCSB_BCD)); + + /* Busy-wait for falling edge of RTC update. */ + while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) + ; + while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) + ; + counterval[0] = mips_rd_count(); + + /* Busy-wait for falling edge of RTC update. */ + while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) + ; + while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) + ; + counterval[1] = mips_rd_count(); + + platform_counter_freq = counterval[1] - counterval[0]; +#endif + + if (platform_counter_freq == 0) + platform_counter_freq = MIPS_DEFAULT_HZ; + + return (platform_counter_freq); +} + void platform_start(__register_t a0, __register_t a1, __register_t a2, __register_t a3) @@ -242,6 +294,10 @@ platform_start(__register_t a0, __regist kernend = round_page((vm_offset_t)&end); memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + mips_pcpu0_init(); + platform_counter_freq = malta_cpu_freq(); + mips_timer_early_init(platform_counter_freq); + cninit(); printf("entry: platform_start()\n"); @@ -262,44 +318,5 @@ platform_start(__register_t a0, __regist realmem = btoc(memsize); mips_init(); - do { -#if defined(TICK_USE_YAMON_FREQ) - /* - * If we are running on a board which uses YAMON firmware, - * then query CPU pipeline clock from the syscon object. - * If unsuccessful, use hard-coded default. - */ - platform_counter_freq = yamon_getcpufreq(); - if (platform_counter_freq == 0) - platform_counter_freq = MIPS_DEFAULT_HZ; - -#elif defined(TICK_USE_MALTA_RTC) - /* - * If we are running on a board with the MC146818 RTC, - * use it to determine CPU pipeline clock frequency. - */ - u_int64_t counterval[2]; - - /* Set RTC to binary mode. */ - writertc(RTC_STATUSB, (rtcin(RTC_STATUSB) | RTCSB_BCD)); - - /* Busy-wait for falling edge of RTC update. */ - while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) - ; - while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) - ; - counterval[0] = mips_rd_count(); - - /* Busy-wait for falling edge of RTC update. */ - while (((rtcin(RTC_STATUSA) & RTCSA_TUP) == 0)) - ; - while (((rtcin(RTC_STATUSA)& RTCSA_TUP) != 0)) - ; - counterval[1] = mips_rd_count(); - - platform_counter_freq = counterval[1] - counterval[0]; -#endif - } while(0); - mips_timer_init_params(platform_counter_freq, 0); } Modified: head/sys/mips/malta/maltareg.h ============================================================================== --- head/sys/mips/malta/maltareg.h Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/maltareg.h Sun Jan 10 20:06:14 2010 (r202035) @@ -94,37 +94,37 @@ 15 Secondary IDE Secondary IDE slot/Compact flash connector */ -#define MALTA_SYSTEMRAM_BASE 0x00000000 /* System RAM: */ +#define MALTA_SYSTEMRAM_BASE 0x00000000ul /* System RAM: */ #define MALTA_SYSTEMRAM_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM1_BASE 0x08000000 /* PCI 1 memory: */ +#define MALTA_PCIMEM1_BASE 0x08000000ul /* PCI 1 memory: */ #define MALTA_PCIMEM1_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM2_BASE 0x10000000 /* PCI 2 memory: */ +#define MALTA_PCIMEM2_BASE 0x10000000ul /* PCI 2 memory: */ #define MALTA_PCIMEM2_SIZE 0x08000000 /* 128 MByte */ -#define MALTA_PCIMEM3_BASE 0x18000000 /* PCI 3 memory */ +#define MALTA_PCIMEM3_BASE 0x18000000ul /* PCI 3 memory */ #define MALTA_PCIMEM3_SIZE 0x03e00000 /* 62 MByte */ -#define MALTA_CORECTRL_BASE 0x1be00000 /* Core control: */ +#define MALTA_CORECTRL_BASE 0x1be00000ul /* Core control: */ #define MALTA_CORECTRL_SIZE 0x00200000 /* 2 MByte */ -#define MALTA_RESERVED_BASE1 0x1c000000 /* Reserved: */ +#define MALTA_RESERVED_BASE1 0x1c000000ul /* Reserved: */ #define MALTA_RESERVED_SIZE1 0x02000000 /* 32 MByte */ -#define MALTA_MONITORFLASH_BASE 0x1e000000 /* Monitor Flash: */ +#define MALTA_MONITORFLASH_BASE 0x1e000000ul /* Monitor Flash: */ #define MALTA_MONITORFLASH_SIZE 0x003e0000 /* 4 MByte */ #define MALTA_MONITORFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */ -#define MALTA_FILEFLASH_BASE 0x1e3e0000 /* File Flash (for monitor): */ +#define MALTA_FILEFLASH_BASE 0x1e3e0000ul /* File Flash (for monitor): */ #define MALTA_FILEFLASH_SIZE 0x00020000 /* 128 KByte */ #define MALTA_FILEFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */ -#define MALTA_RESERVED_BASE2 0x1e400000 /* Reserved: */ +#define MALTA_RESERVED_BASE2 0x1e400000ul /* Reserved: */ #define MALTA_RESERVED_SIZE2 0x00c00000 /* 12 MByte */ -#define MALTA_FPGA_BASE 0x1f000000 /* FPGA: */ +#define MALTA_FPGA_BASE 0x1f000000ul /* FPGA: */ #define MALTA_FPGA_SIZE 0x00c00000 /* 12 MByte */ #define MALTA_NMISTATUS (MALTA_FPGA_BASE + 0x24) @@ -191,10 +191,10 @@ #define MALTA_I2COUT 0x10 #define MALTA_I2CSEL 0x18 -#define MALTA_BOOTROM_BASE 0x1fc00000 /* Boot ROM: */ +#define MALTA_BOOTROM_BASE 0x1fc00000ul /* Boot ROM: */ #define MALTA_BOOTROM_SIZE 0x00400000 /* 4 MByte */ -#define MALTA_REVISION 0x1fc00010 +#define MALTA_REVISION 0x1fc00010ul #define MALTA_REV_FPGRV 0xff0000 /* CBUS FPGA revision */ #define MALTA_REV_CORID 0x00fc00 /* Core Board ID */ #define MALTA_REV_CORRV 0x000300 /* Core Board Revision */ Modified: head/sys/mips/malta/obio.c ============================================================================== --- head/sys/mips/malta/obio.c Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/obio.c Sun Jan 10 20:06:14 2010 (r202035) @@ -63,20 +63,18 @@ int obio_attach(device_t); * A bit tricky and hackish. Since we need OBIO to rely * on PCI we make it pseudo-pci device. But there should * be only one such device, so we use this static flag - * to prevent false positives on every realPCI device probe. + * to prevent false positives on every real PCI device probe. */ static int have_one = 0; int obio_probe(device_t dev) { - if(!have_one) - { + if (!have_one) { have_one = 1; return 0; } - else - return (ENXIO); + return (ENXIO); } int @@ -84,7 +82,7 @@ obio_attach(device_t dev) { struct obio_softc *sc = device_get_softc(dev); - sc->oba_st = MIPS_BUS_SPACE_IO; + sc->oba_st = mips_bus_space_generic; sc->oba_addr = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); sc->oba_size = MALTA_PCIMEM3_SIZE; sc->oba_rman.rm_type = RMAN_ARRAY; Modified: head/sys/mips/malta/std.malta ============================================================================== --- head/sys/mips/malta/std.malta Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/std.malta Sun Jan 10 20:06:14 2010 (r202035) @@ -2,8 +2,7 @@ files "../malta/files.malta" cpu CPU_MIPS4KC -options ISA_MIPS32 -options SOFTFLOAT +#options ISA_MIPS32 device pci device ata device atadisk Modified: head/sys/mips/malta/uart_bus_maltausart.c ============================================================================== --- head/sys/mips/malta/uart_bus_maltausart.c Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/uart_bus_maltausart.c Sun Jan 10 20:06:14 2010 (r202035) @@ -28,10 +28,6 @@ * code written by Olivier Houchard. */ -/* - * XXXMIPS: This file is hacked from arm/... . XXXMIPS here means this file is - * experimental and was written for MIPS32 port. - */ #include "opt_uart.h" #include @@ -53,9 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * XXXMIPS: - */ #include #include "uart_if.h" @@ -88,9 +81,9 @@ uart_malta_probe(device_t dev) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_sysdev->bas.bst = 0; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - sc->sc_bas.bst = 0; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); return(uart_bus_probe(dev, 0, 0, 0, 0)); } Modified: head/sys/mips/malta/uart_cpu_maltausart.c ============================================================================== --- head/sys/mips/malta/uart_cpu_maltausart.c Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/uart_cpu_maltausart.c Sun Jan 10 20:06:14 2010 (r202035) @@ -29,10 +29,6 @@ * Skeleton of this file was based on respective code for ARM * code written by Olivier Houchard. */ -/* - * XXXMIPS: This file is hacked from arm/... . XXXMIPS here means this file is - * experimental and was written for MIPS32 port. - */ #include "opt_uart.h" #include @@ -67,16 +63,16 @@ uart_cpu_getdev(int devtype, struct uart { di->ops = uart_getops(&uart_ns8250_class); di->bas.chan = 0; - di->bas.bst = 0; + di->bas.bst = mips_bus_space_generic; + di->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); di->bas.regshft = 0; di->bas.rclk = 0; - di->baudrate = 115200; + di->baudrate = 0; /* retain the baudrate configured by YAMON */ di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; - uart_bus_space_io = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); - di->bas.bsh = MIPS_PHYS_TO_KSEG1(MALTA_UART0ADR); + uart_bus_space_io = NULL; + uart_bus_space_mem = mips_bus_space_generic; return (0); } Modified: head/sys/mips/malta/yamon.h ============================================================================== --- head/sys/mips/malta/yamon.h Sun Jan 10 20:03:16 2010 (r202034) +++ head/sys/mips/malta/yamon.h Sun Jan 10 20:06:14 2010 (r202035) @@ -38,7 +38,7 @@ #ifndef _MALTA_YAMON_H_ #define _MALTA_YAMON_H_ -#define YAMON_FUNCTION_BASE 0x1fc00500 +#define YAMON_FUNCTION_BASE 0x1fc00500ul #define YAMON_PRINT_COUNT_OFS (YAMON_FUNCTION_BASE + 0x04) #define YAMON_EXIT_OFS (YAMON_FUNCTION_BASE + 0x20) @@ -53,7 +53,7 @@ #define YAMON_GETCHAR_OFS (YAMON_FUNCTION_BASE + 0x50) #define YAMON_SYSCON_READ_OFS (YAMON_FUNCTION_BASE + 0x54) -#define YAMON_FUNC(ofs) (*(uint32_t *)(MIPS_PHYS_TO_KSEG0(ofs))) +#define YAMON_FUNC(ofs) ((long)(*(int32_t *)(MIPS_PHYS_TO_KSEG0(ofs)))) typedef void (*t_yamon_print_count)(uint32_t port, char *s, uint32_t count); #define YAMON_PRINT_COUNT(s, count) \ From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:09:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4078F1065672; Sun, 10 Jan 2010 20:09:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30D2A8FC0C; Sun, 10 Jan 2010 20:09: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 o0AK9VFU027908; Sun, 10 Jan 2010 20:09:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AK9VtG027902; Sun, 10 Jan 2010 20:09:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102009.o0AK9VtG027902@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:09: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: r202036 - head/sys/mips/sentry5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:09:31 -0000 Author: imp Date: Sun Jan 10 20:09:30 2010 New Revision: 202036 URL: http://svn.freebsd.org/changeset/base/202036 Log: Merge from projects/mips to head by hand: r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines Centralize initialization of pcpu, and set curthread early... r201631 | neel | 2010-01-05 23:42:08 -0700 (Tue, 05 Jan 2010) | 5 lines Remove all CFE-specific code from locore.S. The CFE entrypoint initialization is now done in platform-specific code. Approved by: imp (mentor) r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r196236 | imp | 2009-08-14 19:03:13 -0600 (Fri, 14 Aug 2009) | 3 lines Fix style error replicated multiple times. Move to mips_bus_space_generic for octeon obio impl. r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r187415 | gonzo | 2009-01-18 16:49:02 -0700 (Sun, 18 Jan 2009) | 3 lines - Move Silicon Backplanes code out to system-wide level (dev/siba) as it's going to be used not only for siba5 devices. Modified: head/sys/mips/sentry5/files.sentry5 head/sys/mips/sentry5/obio.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sentry5/uart_bus_sbusart.c head/sys/mips/sentry5/uart_cpu_sbusart.c Modified: head/sys/mips/sentry5/files.sentry5 ============================================================================== --- head/sys/mips/sentry5/files.sentry5 Sun Jan 10 20:06:14 2010 (r202035) +++ head/sys/mips/sentry5/files.sentry5 Sun Jan 10 20:09:30 2010 (r202036) @@ -4,11 +4,6 @@ # for USB 1.1 OHCI, Ethernet and IPSEC cores # which are believed to be devices we have drivers for # which just need to be tweaked for attachment to an SSB system bus. - mips/sentry5/s5_machdep.c standard -dev/siba/siba.c optional siba -dev/siba/siba_pcib.c optional siba pci -mips/sentry5/siba_cc.c optional siba - -# notyet -#mips/sentry5/siba_mips.c optional siba +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Modified: head/sys/mips/sentry5/obio.c ============================================================================== --- head/sys/mips/sentry5/obio.c Sun Jan 10 20:06:14 2010 (r202035) +++ head/sys/mips/sentry5/obio.c Sun Jan 10 20:09:30 2010 (r202036) @@ -72,13 +72,11 @@ static int have_one = 0; int obio_probe(device_t dev) { - if(!have_one) - { + if (!have_one) { have_one = 1; return 0; } - else - return (ENXIO); + return (ENXIO); } int @@ -119,7 +117,6 @@ obio_alloc_resource(device_t bus, device { struct resource *rv; struct rman *rm; - bus_space_tag_t bt = 0; bus_space_handle_t bh = 0; struct obio_softc *sc = device_get_softc(bus); @@ -131,7 +128,6 @@ obio_alloc_resource(device_t bus, device return (NULL); case SYS_RES_IOPORT: rm = &sc->oba_rman; - bt = sc->oba_st; bh = sc->oba_addr; start = bh; break; @@ -146,7 +142,7 @@ obio_alloc_resource(device_t bus, device if (type == SYS_RES_IRQ) return (rv); rman_set_rid(rv, *rid); - rman_set_bustag(rv, bt); + rman_set_bustag(rv, mips_bus_space_generic); rman_set_bushandle(rv, bh); if (0) { Modified: head/sys/mips/sentry5/s5_machdep.c ============================================================================== --- head/sys/mips/sentry5/s5_machdep.c Sun Jan 10 20:06:14 2010 (r202035) +++ head/sys/mips/sentry5/s5_machdep.c Sun Jan 10 20:09:30 2010 (r202036) @@ -79,14 +79,15 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef CFE -extern uint32_t cfe_handle; -extern uint32_t cfe_vector; -#endif - extern int *edata; extern int *end; +void +platform_cpu_init() +{ + /* Nothing special */ +} + static void mips_init(void) { @@ -177,8 +178,8 @@ platform_trap_exit(void) } void -platform_start(__register_t a0 __unused, __register_t a1 __unused, - __register_t a2 __unused, __register_t a3 __unused) +platform_start(__register_t a0, __register_t a1, __register_t a2, + __register_t a3) { vm_offset_t kernend; uint64_t platform_counter_freq; @@ -187,20 +188,24 @@ platform_start(__register_t a0 __unused, kernend = round_page((vm_offset_t)&end); memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + /* Initialize pcpu stuff */ + mips_pcpu0_init(); + #ifdef CFE /* * Initialize CFE firmware trampolines before * we initialize the low-level console. + * + * CFE passes the following values in registers: + * a0: firmware handle + * a2: firmware entry point + * a3: entry point seal */ - if (cfe_handle != 0) - cfe_init(cfe_handle, cfe_vector); + if (a3 == CFE_EPTSEAL) + cfe_init(a0, a2); #endif cninit(); -#ifdef CFE - if (cfe_handle == 0) - panic("CFE was not detected by locore.\n"); -#endif mips_init(); # if 0 Modified: head/sys/mips/sentry5/uart_bus_sbusart.c ============================================================================== --- head/sys/mips/sentry5/uart_bus_sbusart.c Sun Jan 10 20:06:14 2010 (r202035) +++ head/sys/mips/sentry5/uart_bus_sbusart.c Sun Jan 10 20:09:30 2010 (r202036) @@ -85,9 +85,9 @@ uart_malta_probe(device_t dev) sc->sc_sysdev = SLIST_FIRST(&uart_sysdevs); sc->sc_class = &uart_ns8250_class; bcopy(&sc->sc_sysdev->bas, &sc->sc_bas, sizeof(sc->sc_bas)); - sc->sc_sysdev->bas.bst = 0; + sc->sc_sysdev->bas.bst = mips_bus_space_generic; sc->sc_sysdev->bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); - sc->sc_bas.bst = 0; + sc->sc_bas.bst = mips_bus_space_generic; sc->sc_bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); return(uart_bus_probe(dev, 0, 0, 0, 0)); } Modified: head/sys/mips/sentry5/uart_cpu_sbusart.c ============================================================================== --- head/sys/mips/sentry5/uart_cpu_sbusart.c Sun Jan 10 20:06:14 2010 (r202035) +++ head/sys/mips/sentry5/uart_cpu_sbusart.c Sun Jan 10 20:09:30 2010 (r202036) @@ -76,7 +76,7 @@ uart_cpu_getdev(int devtype, struct uart di->parity = UART_PARITY_NONE; uart_bus_space_io = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); - uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(SENTRY5_UART1ADR); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:11:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E961106566C; Sun, 10 Jan 2010 20:11:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF448FC0A; Sun, 10 Jan 2010 20:11: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 o0AKBAoU028334; Sun, 10 Jan 2010 20:11:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKBAZq028328; Sun, 10 Jan 2010 20:11:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102011.o0AKBAZq028328@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:11: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: r202037 - head/sys/mips/adm5120 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:11:10 -0000 Author: imp Date: Sun Jan 10 20:11:10 2010 New Revision: 202037 URL: http://svn.freebsd.org/changeset/base/202037 Log: Merge from projects/mips to head by hand: r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines Centralize initialization of pcpu, and set curthread early... r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198154 | rrs | 2009-10-15 15:03:32 -0600 (Thu, 15 Oct 2009) | 10 lines Does 4 things: 1) Adds future RMI directories 2) Places intr_machdep.c in specfic files.arch pointing to the generic intr_machdep.c. This allows us to have an architecture dependant intr_machdep.c (which we will need for RMI) in the machine specific directory 3) removes intr_machdep.c from files.mips 4) Adds some TARGET_XLR_XLS ifdef's for the machine specific intra_machdep.h. We may need to look at finding a better place to put this. But first I want to get this thing compiling. r194213 | gonzo | 2009-06-14 15:04:54 -0600 (Sun, 14 Jun 2009) | 2 lines - Fix prototype and implementation of admsw_shutdown r192790 | gonzo | 2009-05-25 23:52:24 -0600 (Mon, 25 May 2009) | 2 lines - Provide proper pre_ithread/post_ithread functions r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. Modified: head/sys/mips/adm5120/adm5120_machdep.c head/sys/mips/adm5120/files.adm5120 head/sys/mips/adm5120/if_admsw.c head/sys/mips/adm5120/obio.c head/sys/mips/adm5120/uart_cpu_adm5120.c Modified: head/sys/mips/adm5120/adm5120_machdep.c ============================================================================== --- head/sys/mips/adm5120/adm5120_machdep.c Sun Jan 10 20:09:30 2010 (r202036) +++ head/sys/mips/adm5120/adm5120_machdep.c Sun Jan 10 20:11:10 2010 (r202037) @@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$"); extern int *edata; extern int *end; +void +platform_cpu_init() +{ + /* Nothing special */ +} + static void mips_init(void) { @@ -148,6 +154,9 @@ platform_start(__register_t a0 __unused, kernend = round_page((vm_offset_t)&end); memset(&edata, 0, kernend - (vm_offset_t)(&edata)); + /* Initialize pcpu stuff */ + mips_pcpu0_init(); + cninit(); mips_init(); mips_timer_init_params(platform_counter_freq, 0); Modified: head/sys/mips/adm5120/files.adm5120 ============================================================================== --- head/sys/mips/adm5120/files.adm5120 Sun Jan 10 20:09:30 2010 (r202036) +++ head/sys/mips/adm5120/files.adm5120 Sun Jan 10 20:11:10 2010 (r202037) @@ -9,3 +9,5 @@ mips/adm5120/obio.c standard mips/adm5120/uart_bus_adm5120.c optional uart mips/adm5120/uart_cpu_adm5120.c optional uart mips/adm5120/uart_dev_adm5120.c optional uart +mips/mips/intr_machdep.c standard +mips/mips/tick.c standard Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Sun Jan 10 20:09:30 2010 (r202036) +++ head/sys/mips/adm5120/if_admsw.c Sun Jan 10 20:11:10 2010 (r202037) @@ -528,7 +528,7 @@ admsw_attach(device_t dev) ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO, 0, NULL); ifmedia_set(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO); - ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER); + ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);; /* Setup interface parameters */ ifp->if_softc = sc; Modified: head/sys/mips/adm5120/obio.c ============================================================================== --- head/sys/mips/adm5120/obio.c Sun Jan 10 20:09:30 2010 (r202036) +++ head/sys/mips/adm5120/obio.c Sun Jan 10 20:11:10 2010 (r202037) @@ -120,6 +120,39 @@ static int obio_setup_intr(device_t, dev static int obio_teardown_intr(device_t, device_t, struct resource *, void *); + +static void +obio_mask_irq(void *source) +{ + int irq; + uint32_t irqmask; + uint32_t reg; + + irq = (int)source; + irqmask = 1 << irq; + + /* disable IRQ */ + reg = REG_READ(ICU_DISABLE_REG); + REG_WRITE(ICU_DISABLE_REG, (reg | irqmask)); +} + +static void +obio_unmask_irq(void *source) +{ + int irq; + uint32_t irqmask; + uint32_t reg; + + irq = (int)source; + irqmask = 1 << irq; + + /* disable IRQ */ + reg = REG_READ(ICU_DISABLE_REG); + REG_WRITE(ICU_DISABLE_REG, (reg & ~irqmask)); + +} + + static int obio_probe(device_t dev) { @@ -269,7 +302,7 @@ obio_activate_resource(device_t bus, dev vaddr = (void *)MIPS_PHYS_TO_KSEG1((intptr_t)rman_get_start(r)); rman_set_virtual(r, vaddr); - rman_set_bustag(r, MIPS_BUS_SPACE_MEM); + rman_set_bustag(r, mips_bus_space_generic); rman_set_bushandle(r, (bus_space_handle_t)vaddr); } @@ -321,7 +354,7 @@ obio_setup_intr(device_t dev, device_t c event = sc->sc_eventstab[irq]; if (event == NULL) { error = intr_event_create(&event, (void *)irq, 0, irq, - (mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq, + obio_mask_irq, obio_unmask_irq, NULL, NULL, "obio intr%d:", irq); sc->sc_eventstab[irq] = event; @@ -343,6 +376,8 @@ obio_setup_intr(device_t dev, device_t c /* enable */ REG_WRITE(ICU_ENABLE_REG, irqmask); + obio_unmask_irq((void*)irq); + return (0); } @@ -351,7 +386,7 @@ obio_teardown_intr(device_t dev, device_ void *cookie) { struct obio_softc *sc = device_get_softc(dev); - int irq, result; + int irq, result, priority; uint32_t irqmask; irq = rman_get_start(ires); @@ -361,10 +396,18 @@ obio_teardown_intr(device_t dev, device_ if (sc->sc_eventstab[irq] == NULL) panic("Trying to teardown unoccupied IRQ"); - irqmask = 1 << irq; /* only used as a mask from here on */ + irqmask = (1 << irq); + priority = irq_priorities[irq]; - /* disable this irq in HW */ - REG_WRITE(ICU_DISABLE_REG, irqmask); + if (priority == INTR_FIQ) + REG_WRITE(ICU_MODE_REG, REG_READ(ICU_MODE_REG) & ~irqmask); + else + REG_WRITE(ICU_MODE_REG, REG_READ(ICU_MODE_REG) | irqmask); + + /* disable */ + irqmask = REG_READ(ICU_ENABLE_REG); + irqmask &= ~(1 << irq); + REG_WRITE(ICU_ENABLE_REG, irqmask); result = intr_event_remove_handler(cookie); if (!result) { Modified: head/sys/mips/adm5120/uart_cpu_adm5120.c ============================================================================== --- head/sys/mips/adm5120/uart_cpu_adm5120.c Sun Jan 10 20:09:30 2010 (r202036) +++ head/sys/mips/adm5120/uart_cpu_adm5120.c Sun Jan 10 20:11:10 2010 (r202037) @@ -67,7 +67,7 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(&uart_adm5120_uart_class); di->bas.chan = 0; - di->bas.bst = 0; + di->bas.bst = mips_bus_space_generic; di->bas.regshft = 0; di->bas.rclk = 0; di->baudrate = 115200; @@ -76,7 +76,7 @@ uart_cpu_getdev(int devtype, struct uart di->parity = UART_PARITY_NONE; uart_bus_space_io = 0; - uart_bus_space_mem = MIPS_PHYS_TO_KSEG1(ADM5120_BASE_UART0); + uart_bus_space_mem = mips_bus_space_generic; di->bas.bsh = MIPS_PHYS_TO_KSEG1(ADM5120_BASE_UART0); return (0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:12:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1051B1065694; Sun, 10 Jan 2010 20:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC14B8FC1B; Sun, 10 Jan 2010 20:12: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 o0AKCHQE028636; Sun, 10 Jan 2010 20:12:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKCHgG028633; Sun, 10 Jan 2010 20:12:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102012.o0AKCHgG028633@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:12:17 +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: r202038 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:12:18 -0000 Author: imp Date: Sun Jan 10 20:12:17 2010 New Revision: 202038 URL: http://svn.freebsd.org/changeset/base/202038 Log: Merge from projects/mips to head by hand: Copy over inckern.S for crunched kernel support. Added: - copied unchanged from r202037, projects/mips/sys/mips/mips/inckern.S Directory Properties: head/sys/mips/mips/inckern.S (props changed) Copied: head/sys/mips/mips/inckern.S (from r202037, projects/mips/sys/mips/mips/inckern.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/inckern.S Sun Jan 10 20:12:17 2010 (r202038, copy of r202037, projects/mips/sys/mips/mips/inckern.S) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "opt_kernname.h" + +#include +__FBSDID("$FreeBSD$") +.section ".real_kernel","aw" +.globl kernel_start; +kernel_start: +.incbin KERNNAME +.globl kernel_end; +kernel_end: From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:13:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D355106566B; Sun, 10 Jan 2010 20:13:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846FB8FC0C; Sun, 10 Jan 2010 20:13:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AKD5KP028843; Sun, 10 Jan 2010 20:13:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKD55o028841; Sun, 10 Jan 2010 20:13:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102013.o0AKD55o028841@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:13:05 +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: r202039 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:13:05 -0000 Author: imp Date: Sun Jan 10 20:13:05 2010 New Revision: 202039 URL: http://svn.freebsd.org/changeset/base/202039 Log: Merge from projects/mips to head by hand: Copy over sys_machdep.c Added: - copied unchanged from r202038, projects/mips/sys/mips/mips/sys_machdep.c Directory Properties: head/sys/mips/mips/sys_machdep.c (props changed) Copied: head/sys/mips/mips/sys_machdep.c (from r202038, projects/mips/sys/mips/mips/sys_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/sys_machdep.c Sun Jan 10 20:13:05 2010 (r202039, copy of r202038, projects/mips/sys/mips/mips/sys_machdep.c) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#ifndef _SYS_SYSPROTO_H_ +struct sysarch_args { + int op; + char *parms; +}; +#endif + +int +sysarch(td, uap) + struct thread *td; + register struct sysarch_args *uap; +{ + int error; + void *tlsbase; + + switch (uap->op) { + case MIPS_SET_TLS : + td->td_md.md_tls = (void*)uap->parms; + error = 0; + break; + + case MIPS_GET_TLS : + tlsbase = td->td_md.md_tls; + error = copyout(&tlsbase, uap->parms, sizeof(tlsbase)); + break; + default: + error = EINVAL; + } + return (error); +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:13:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7849B1065692; Sun, 10 Jan 2010 20:13:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 692EF8FC1B; Sun, 10 Jan 2010 20:13: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 o0AKDw6u029076; Sun, 10 Jan 2010 20:13:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKDwVl029074; Sun, 10 Jan 2010 20:13:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102013.o0AKDwVl029074@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:13: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: r202040 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:13:58 -0000 Author: imp Date: Sun Jan 10 20:13:58 2010 New Revision: 202040 URL: http://svn.freebsd.org/changeset/base/202040 Log: Merge from projects/mips to head by hand: Copy over elf_trampoline.c for crunched kernel support. Added: - copied unchanged from r202039, projects/mips/sys/mips/mips/elf_trampoline.c Directory Properties: head/sys/mips/mips/elf_trampoline.c (props changed) Copied: head/sys/mips/mips/elf_trampoline.c (from r202039, projects/mips/sys/mips/mips/elf_trampoline.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/elf_trampoline.c Sun Jan 10 20:13:58 2010 (r202040, copy of r202039, projects/mips/sys/mips/mips/elf_trampoline.c) @@ -0,0 +1,147 @@ +/*- + * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#ifdef __mips_n64 +#include +#else +#include +#endif +#include +#include +#include +#include + +/* + * Since we are compiled outside of the normal kernel build process, we + * need to include opt_global.h manually. + */ +#include "opt_global.h" +#include "opt_kernname.h" + +extern char kernel_start[]; +extern char kernel_end[]; + +static __inline void * +memcpy(void *dst, const void *src, size_t len) +{ + const char *s = src; + char *d = dst; + + while (len) { + if (0 && len >= 4 && !((vm_offset_t)d & 3) && + !((vm_offset_t)s & 3)) { + *(uint32_t *)d = *(uint32_t *)s; + s += 4; + d += 4; + len -= 4; + } else { + *d++ = *s++; + len--; + } + } + return (dst); +} + +static __inline void +bzero(void *addr, size_t count) +{ + char *tmp = (char *)addr; + + while (count > 0) { + if (count >= 4 && !((vm_offset_t)tmp & 3)) { + *(uint32_t *)tmp = 0; + tmp += 4; + count -= 4; + } else { + *tmp = 0; + tmp++; + count--; + } + } +} + +/* + * Relocate PT_LOAD segements of kernel ELF image to their respective + * virtual addresses and return entry point + */ +void * +load_kernel(void * kstart) +{ +#ifdef __mips_n64 + Elf64_Ehdr *eh; + Elf64_Phdr phdr[64] /* XXX */; +#else + Elf32_Ehdr *eh; + Elf32_Phdr phdr[64] /* XXX */; +#endif + int i; + void *entry_point; + +#ifdef __mips_n64 + eh = (Elf64_Ehdr *)kstart; +#else + eh = (Elf32_Ehdr *)kstart; +#endif + entry_point = (void*)eh->e_entry; + memcpy(phdr, (void *)(kstart + eh->e_phoff ), + eh->e_phnum * sizeof(phdr[0])); + + for (i = 0; i < eh->e_phnum; i++) { + volatile char c; + + if (phdr[i].p_type != PT_LOAD) + continue; + + memcpy((void *)(phdr[i].p_vaddr), + (void*)(kstart + phdr[i].p_offset), phdr[i].p_filesz); + /* Clean space from oversized segments, eg: bss. */ + if (phdr[i].p_filesz < phdr[i].p_memsz) + bzero((void *)(phdr[i].p_vaddr + phdr[i].p_filesz), + phdr[i].p_memsz - phdr[i].p_filesz); + } + + return entry_point; +} + +void +_startC(register_t a0, register_t a1, register_t a2, register_t a3) +{ + unsigned int * code; + int i; + void (*entry_point)(register_t, register_t, register_t, register_t); + + /* + * Relocate segment to the predefined memory location + * Most likely it will be KSEG0/KSEG1 address + */ + entry_point = load_kernel(kernel_start); + + /* Pass saved registers to original _start */ + entry_point(a0, a1, a2, a3); +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:14:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B61B8106566B; Sun, 10 Jan 2010 20:14:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5EEB8FC17; Sun, 10 Jan 2010 20:14: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 o0AKEcWh029262; Sun, 10 Jan 2010 20:14:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKEcJB029245; Sun, 10 Jan 2010 20:14:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102014.o0AKEcJB029245@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:14: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: r202041 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:14:38 -0000 Author: imp Date: Sun Jan 10 20:14:38 2010 New Revision: 202041 URL: http://svn.freebsd.org/changeset/base/202041 Log: Merge from projects/mips to head by hand: copy over the generic bus space implementation... Added: - copied unchanged from r202040, projects/mips/sys/mips/mips/bus_space_generic.c Directory Properties: head/sys/mips/mips/bus_space_generic.c (props changed) Copied: head/sys/mips/mips/bus_space_generic.c (from r202040, projects/mips/sys/mips/mips/bus_space_generic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/bus_space_generic.c Sun Jan 10 20:14:38 2010 (r202041, copy of r202040, projects/mips/sys/mips/mips/bus_space_generic.c) @@ -0,0 +1,590 @@ +/* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */ +/*- + * $Id: bus.h,v 1.6 2007/08/09 11:23:32 katta Exp $ + * + * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/* + * Copyright (c) 1996 Charles M. Hannum. All rights reserved. + * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +static struct bus_space generic_space = { + /* cookie */ + (void *) 0, + + /* mapping/unmapping */ + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, + + /* allocation/deallocation */ + NULL, + NULL, + + /* barrier */ + generic_bs_barrier, + + /* read (single) */ + generic_bs_r_1, + generic_bs_r_2, + generic_bs_r_4, + NULL, + + /* read multiple */ + generic_bs_rm_1, + generic_bs_rm_2, + generic_bs_rm_4, + NULL, + + /* read region */ + generic_bs_rr_1, + generic_bs_rr_2, + generic_bs_rr_4, + NULL, + + /* write (single) */ + generic_bs_w_1, + generic_bs_w_2, + generic_bs_w_4, + NULL, + + /* write multiple */ + generic_bs_wm_1, + generic_bs_wm_2, + generic_bs_wm_4, + NULL, + + /* write region */ + NULL, + generic_bs_wr_2, + generic_bs_wr_4, + NULL, + + /* set multiple */ + NULL, + NULL, + NULL, + NULL, + + /* set region */ + NULL, + generic_bs_sr_2, + generic_bs_sr_4, + NULL, + + /* copy */ + NULL, + generic_bs_c_2, + NULL, + NULL, + + /* read (single) stream */ + generic_bs_r_1, + generic_bs_r_2, + generic_bs_r_4, + NULL, + + /* read multiple stream */ + generic_bs_rm_1, + generic_bs_rm_2, + generic_bs_rm_4, + NULL, + + /* read region stream */ + generic_bs_rr_1, + generic_bs_rr_2, + generic_bs_rr_4, + NULL, + + /* write (single) stream */ + generic_bs_w_1, + generic_bs_w_2, + generic_bs_w_4, + NULL, + + /* write multiple stream */ + generic_bs_wm_1, + generic_bs_wm_2, + generic_bs_wm_4, + NULL, + + /* write region stream */ + NULL, + generic_bs_wr_2, + generic_bs_wr_4, + NULL, +}; + +/* Ultra-gross kludge */ +#include "opt_cputype.h" +#if defined(TARGET_OCTEON) && defined(ISA_MIPS32) +#include +#define rd8(a) oct_read8(a) +#define rd16(a) oct_read16(a) +#define rd32(a) oct_read32(a) +#define wr8(a, v) oct_write8(a, v) +#define wr16(a, v) oct_write16(a, v) +#define wr32(a, v) oct_write32(a, v) +#else +#define rd8(a) readb(a) +#define rd16(a) readw(a) +#define rd32(a) readl(a) +#define wr8(a, v) writeb(a, v) +#define wr16(a, v) writew(a, v) +#define wr32(a, v) writel(a, v) +#endif + +/* generic bus_space tag */ +bus_space_tag_t mips_bus_space_generic = &generic_space; + +int +generic_bs_map(void *t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} + +void +generic_bs_unmap(void *t __unused, bus_space_handle_t bh __unused, + bus_size_t size __unused) +{ + + /* Do nothing */ +} + +int +generic_bs_subregion(void *t __unused, bus_space_handle_t handle __unused, + bus_size_t offset __unused, bus_size_t size __unused, + bus_space_handle_t *nhandle __unused) +{ + + printf("SUBREGION?!?!?!\n"); + /* Do nothing */ + return (0); +} + +uint8_t +generic_bs_r_1(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd8(handle + offset)); +} + +uint16_t +generic_bs_r_2(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd16(handle + offset)); +} + +uint32_t +generic_bs_r_4(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd32(handle + offset)); +} + + +void +generic_bs_rm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t *addr, size_t count) +{ + + while (count--) + *addr++ = rd8(bsh + offset); +} + +void +generic_bs_rm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + *addr++ = rd16(baddr); +} + +void +generic_bs_rm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + *addr++ = rd32(baddr); +} + + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle and starting at `offset' and copy into + * buffer provided. + */ +void +generic_bs_rr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd8(baddr); + baddr += 1; + } +} + +void +generic_bs_rr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd16(baddr); + baddr += 2; + } +} + +void +generic_bs_rr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd32(baddr); + baddr += 4; + } +} + +/* + * Write the 1, 2, 4, or 8 byte value `value' to bus space + * described by tag/handle/offset. + */ +void +generic_bs_w_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value) +{ + + wr8(bsh + offset, value); +} + +void +generic_bs_w_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value) +{ + + wr16(bsh + offset, value); +} + +void +generic_bs_w_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value) +{ + + wr32(bsh + offset, value); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer + * provided to bus space described by tag/handle/offset. + */ +void +generic_bs_wm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr8(baddr, *addr++); +} + +void +generic_bs_wm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr16(baddr, *addr++); +} + +void +generic_bs_wm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr32(baddr, *addr++); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided + * to bus space described by tag/handle starting at `offset'. + */ +void +generic_bs_wr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr8(baddr, *addr++); + baddr += 1; + } +} + +void +generic_bs_wr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr16(baddr, *addr++); + baddr += 2; + } +} + +void +generic_bs_wr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr32(baddr, *addr++); + baddr += 4; + } +} + +/* + * Write the 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle/offset `count' times. + */ +void +generic_bs_sm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr8(addr, value); +} + +void +generic_bs_sm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr16(addr, value); +} + +void +generic_bs_sm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr32(addr, value); +} + +/* + * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle starting at `offset'. + */ +void +generic_bs_sr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr++) + wr8(addr, value); +} + +void +generic_bs_sr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 2) + wr16(addr, value); +} + +void +generic_bs_sr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 4) + wr32(addr, value); +} + +/* + * Copy `count' 1, 2, 4, or 8 byte values from bus space starting + * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. + */ +void +generic_bs_c_1(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1++, addr2++) + wr8(addr2, rd8(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += (count - 1), addr2 += (count - 1); + count != 0; count--, addr1--, addr2--) + wr8(addr2, rd8(addr1)); + } +} + +void +generic_bs_c_2(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1 += 2, addr2 += 2) + wr16(addr2, rd16(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += 2 * (count - 1), addr2 += 2 * (count - 1); + count != 0; count--, addr1 -= 2, addr2 -= 2) + wr16(addr2, rd16(addr1)); + } +} + +void +generic_bs_c_4(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1 += 4, addr2 += 4) + wr32(addr2, rd32(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1); + count != 0; count--, addr1 -= 4, addr2 -= 4) + wr32(addr2, rd32(addr1)); + } +} + +void +generic_bs_barrier(void *t __unused, + bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, + int flags) +{ +#if 0 + if (flags & BUS_SPACE_BARRIER_WRITE) + mips_dcache_wbinv_all(); +#endif +} From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:22:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C05106566C; Sun, 10 Jan 2010 20:22:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709C68FC19; Sun, 10 Jan 2010 20:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AKM5fM031071; Sun, 10 Jan 2010 20:22:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKM5pd031069; Sun, 10 Jan 2010 20:22:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102022.o0AKM5pd031069@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:22:05 +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: r202044 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:22:05 -0000 Author: imp Date: Sun Jan 10 20:22:05 2010 New Revision: 202044 URL: http://svn.freebsd.org/changeset/base/202044 Log: Fix mis-merge from projects/mips... the diff didn't apply correctly and I didn't notice until after the commit. Modified: head/sys/mips/include/bus.h Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Sun Jan 10 20:21:42 2010 (r202043) +++ head/sys/mips/include/bus.h Sun Jan 10 20:22:05 2010 (r202044) @@ -67,843 +67,662 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter * $FreeBSD$ -*/ + */ #ifndef _MACHINE_BUS_H_ -#define _MACHINE_BUS_H_ +#define _MACHINE_BUS_H_ -#ifdef TARGET_OCTEON -#include -#else #include -#include - -/* - * Values for the mips bus space tag, not to be used directly by MI code. - */ -#define MIPS_BUS_SPACE_IO 0 /* space is i/o space */ -#define MIPS_BUS_SPACE_MEM 1 /* space is mem space */ - - -#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF -#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXSIZE 0xFFFFFFFF /* Maximum supported size */ -#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF -#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF -#define BUS_SPACE_MAXADDR 0xFFFFFFFF - -#define BUS_SPACE_UNRESTRICTED (~0) - -/* - * Map a region of device bus space into CPU virtual address space. - */ -static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, - bus_space_handle_t *bshp); - -static __inline int -bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) -{ - - *bshp = addr; - return (0); -} - -/* - * Unmap a region of device bus space. - */ - -void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, - bus_size_t size); - -/* - * Get a new handle for a subregion of an already-mapped area of bus space. - */ - -int bus_space_subregion(bus_space_tag_t t, bus_space_handle_t bsh, - bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp); - -/* - * Allocate a region of memory that is accessible to devices in bus space. - */ - -int bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, - bus_addr_t rend, bus_size_t size, bus_size_t align, - bus_size_t boundary, int flags, bus_addr_t *addrp, - bus_space_handle_t *bshp); - -/* - * Free a region of bus space accessible memory. - */ - -void bus_space_free(bus_space_tag_t t, bus_space_handle_t bsh, - bus_size_t size); - - -/* - * Read a 1, 2, 4, or 8 byte quantity from bus space - * described by tag/handle/offset. - */ -static __inline u_int8_t bus_space_read_1(bus_space_tag_t tag, - bus_space_handle_t handle, - bus_size_t offset); - -static __inline u_int16_t bus_space_read_2(bus_space_tag_t tag, - bus_space_handle_t handle, - bus_size_t offset); - -static __inline u_int32_t bus_space_read_4(bus_space_tag_t tag, - bus_space_handle_t handle, - bus_size_t offset); - -static __inline u_int8_t -bus_space_read_1(bus_space_tag_t tag, bus_space_handle_t handle, - bus_size_t offset) -{ - - if (tag == MIPS_BUS_SPACE_IO) - return (inb(handle + offset)); - return (readb(handle + offset)); -} - -static __inline u_int16_t -bus_space_read_2(bus_space_tag_t tag, bus_space_handle_t handle, - bus_size_t offset) -{ - - if (tag == MIPS_BUS_SPACE_IO) - return (inw(handle + offset)); - return (readw(handle + offset)); -} - -static __inline u_int32_t -bus_space_read_4(bus_space_tag_t tag, bus_space_handle_t handle, - bus_size_t offset) -{ - - if (tag == MIPS_BUS_SPACE_IO) - return (inl(handle + offset)); - return (readl(handle + offset)); -} - -#if 0 /* Cause a link error for bus_space_read_8 */ -#define bus_space_read_8(t, h, o) !!! bus_space_read_8 unimplemented !!! -#endif - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle/offset and copy into buffer provided. - */ -static __inline void bus_space_read_multi_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int8_t *addr, - size_t count); - -static __inline void bus_space_read_multi_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t *addr, - size_t count); - -static __inline void bus_space_read_multi_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t *addr, - size_t count); - -static __inline void -bus_space_read_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t *addr, size_t count) -{ - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - *addr++ = inb(bsh + offset); - else - while (count--) - *addr++ = readb(bsh + offset); -} - -static __inline void -bus_space_read_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - *addr++ = inw(baddr); - else - while (count--) - *addr++ = readw(baddr); -} - -static __inline void -bus_space_read_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - *addr++ = inl(baddr); - else - while (count--) - *addr++ = readl(baddr); -} - -#if 0 /* Cause a link error for bus_space_read_multi_8 */ -#define bus_space_read_multi_8 !!! bus_space_read_multi_8 unimplemented !!! -#endif - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle and starting at `offset' and copy into - * buffer provided. - */ -static __inline void bus_space_read_region_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int8_t *addr, - size_t count); - -static __inline void bus_space_read_region_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t *addr, - size_t count); - -static __inline void bus_space_read_region_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t *addr, - size_t count); - - -static __inline void -bus_space_read_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - *addr++ = inb(baddr); - baddr += 1; - } - else - while (count--) { - *addr++ = readb(baddr); - baddr += 1; - } -} - -static __inline void -bus_space_read_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - *addr++ = inw(baddr); - baddr += 2; - } - else - while (count--) { - *addr++ = readw(baddr); - baddr += 2; - } -} - -static __inline void -bus_space_read_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - *addr++ = inl(baddr); - baddr += 4; - } - else - while (count--) { - *addr++ = readb(baddr); - baddr += 4; - } -} - -#if 0 /* Cause a link error for bus_space_read_region_8 */ -#define bus_space_read_region_8 !!! bus_space_read_region_8 unimplemented !!! -#endif - -/* - * Write the 1, 2, 4, or 8 byte value `value' to bus space - * described by tag/handle/offset. - */ +struct bus_space { + /* cookie */ + void *bs_cookie; + + /* mapping/unmapping */ + int (*bs_map) (void *, bus_addr_t, bus_size_t, + int, bus_space_handle_t *); + void (*bs_unmap) (void *, bus_space_handle_t, bus_size_t); + int (*bs_subregion) (void *, bus_space_handle_t, + bus_size_t, bus_size_t, bus_space_handle_t *); + + /* allocation/deallocation */ + int (*bs_alloc) (void *, bus_addr_t, bus_addr_t, + bus_size_t, bus_size_t, bus_size_t, int, + bus_addr_t *, bus_space_handle_t *); + void (*bs_free) (void *, bus_space_handle_t, + bus_size_t); + + /* get kernel virtual address */ + /* barrier */ + void (*bs_barrier) (void *, bus_space_handle_t, + bus_size_t, bus_size_t, int); + + /* read (single) */ + u_int8_t (*bs_r_1) (void *, bus_space_handle_t, bus_size_t); + u_int16_t (*bs_r_2) (void *, bus_space_handle_t, bus_size_t); + u_int32_t (*bs_r_4) (void *, bus_space_handle_t, bus_size_t); + u_int64_t (*bs_r_8) (void *, bus_space_handle_t, bus_size_t); + + /* read multiple */ + void (*bs_rm_1) (void *, bus_space_handle_t, bus_size_t, + u_int8_t *, bus_size_t); + void (*bs_rm_2) (void *, bus_space_handle_t, bus_size_t, + u_int16_t *, bus_size_t); + void (*bs_rm_4) (void *, bus_space_handle_t, + bus_size_t, u_int32_t *, bus_size_t); + void (*bs_rm_8) (void *, bus_space_handle_t, + bus_size_t, u_int64_t *, bus_size_t); + + /* read region */ + void (*bs_rr_1) (void *, bus_space_handle_t, + bus_size_t, u_int8_t *, bus_size_t); + void (*bs_rr_2) (void *, bus_space_handle_t, + bus_size_t, u_int16_t *, bus_size_t); + void (*bs_rr_4) (void *, bus_space_handle_t, + bus_size_t, u_int32_t *, bus_size_t); + void (*bs_rr_8) (void *, bus_space_handle_t, + bus_size_t, u_int64_t *, bus_size_t); + + /* write (single) */ + void (*bs_w_1) (void *, bus_space_handle_t, + bus_size_t, u_int8_t); + void (*bs_w_2) (void *, bus_space_handle_t, + bus_size_t, u_int16_t); + void (*bs_w_4) (void *, bus_space_handle_t, + bus_size_t, u_int32_t); + void (*bs_w_8) (void *, bus_space_handle_t, + bus_size_t, u_int64_t); + + /* write multiple */ + void (*bs_wm_1) (void *, bus_space_handle_t, + bus_size_t, const u_int8_t *, bus_size_t); + void (*bs_wm_2) (void *, bus_space_handle_t, + bus_size_t, const u_int16_t *, bus_size_t); + void (*bs_wm_4) (void *, bus_space_handle_t, + bus_size_t, const u_int32_t *, bus_size_t); + void (*bs_wm_8) (void *, bus_space_handle_t, + bus_size_t, const u_int64_t *, bus_size_t); + + /* write region */ + void (*bs_wr_1) (void *, bus_space_handle_t, + bus_size_t, const u_int8_t *, bus_size_t); + void (*bs_wr_2) (void *, bus_space_handle_t, + bus_size_t, const u_int16_t *, bus_size_t); + void (*bs_wr_4) (void *, bus_space_handle_t, + bus_size_t, const u_int32_t *, bus_size_t); + void (*bs_wr_8) (void *, bus_space_handle_t, + bus_size_t, const u_int64_t *, bus_size_t); + + /* set multiple */ + void (*bs_sm_1) (void *, bus_space_handle_t, + bus_size_t, u_int8_t, bus_size_t); + void (*bs_sm_2) (void *, bus_space_handle_t, + bus_size_t, u_int16_t, bus_size_t); + void (*bs_sm_4) (void *, bus_space_handle_t, + bus_size_t, u_int32_t, bus_size_t); + void (*bs_sm_8) (void *, bus_space_handle_t, + bus_size_t, u_int64_t, bus_size_t); + + /* set region */ + void (*bs_sr_1) (void *, bus_space_handle_t, + bus_size_t, u_int8_t, bus_size_t); + void (*bs_sr_2) (void *, bus_space_handle_t, + bus_size_t, u_int16_t, bus_size_t); + void (*bs_sr_4) (void *, bus_space_handle_t, + bus_size_t, u_int32_t, bus_size_t); + void (*bs_sr_8) (void *, bus_space_handle_t, + bus_size_t, u_int64_t, bus_size_t); + + /* copy */ + void (*bs_c_1) (void *, bus_space_handle_t, bus_size_t, + bus_space_handle_t, bus_size_t, bus_size_t); + void (*bs_c_2) (void *, bus_space_handle_t, bus_size_t, + bus_space_handle_t, bus_size_t, bus_size_t); + void (*bs_c_4) (void *, bus_space_handle_t, bus_size_t, + bus_space_handle_t, bus_size_t, bus_size_t); + void (*bs_c_8) (void *, bus_space_handle_t, bus_size_t, + bus_space_handle_t, bus_size_t, bus_size_t); + + /* read stream (single) */ + u_int8_t (*bs_r_1_s) (void *, bus_space_handle_t, bus_size_t); + u_int16_t (*bs_r_2_s) (void *, bus_space_handle_t, bus_size_t); + u_int32_t (*bs_r_4_s) (void *, bus_space_handle_t, bus_size_t); + u_int64_t (*bs_r_8_s) (void *, bus_space_handle_t, bus_size_t); + + /* read multiple stream */ + void (*bs_rm_1_s) (void *, bus_space_handle_t, bus_size_t, + u_int8_t *, bus_size_t); + void (*bs_rm_2_s) (void *, bus_space_handle_t, bus_size_t, + u_int16_t *, bus_size_t); + void (*bs_rm_4_s) (void *, bus_space_handle_t, + bus_size_t, u_int32_t *, bus_size_t); + void (*bs_rm_8_s) (void *, bus_space_handle_t, + bus_size_t, u_int64_t *, bus_size_t); + + /* read region stream */ + void (*bs_rr_1_s) (void *, bus_space_handle_t, + bus_size_t, u_int8_t *, bus_size_t); + void (*bs_rr_2_s) (void *, bus_space_handle_t, + bus_size_t, u_int16_t *, bus_size_t); + void (*bs_rr_4_s) (void *, bus_space_handle_t, + bus_size_t, u_int32_t *, bus_size_t); + void (*bs_rr_8_s) (void *, bus_space_handle_t, + bus_size_t, u_int64_t *, bus_size_t); + + /* write stream (single) */ + void (*bs_w_1_s) (void *, bus_space_handle_t, + bus_size_t, u_int8_t); + void (*bs_w_2_s) (void *, bus_space_handle_t, + bus_size_t, u_int16_t); + void (*bs_w_4_s) (void *, bus_space_handle_t, + bus_size_t, u_int32_t); + void (*bs_w_8_s) (void *, bus_space_handle_t, + bus_size_t, u_int64_t); + + /* write multiple stream */ + void (*bs_wm_1_s) (void *, bus_space_handle_t, + bus_size_t, const u_int8_t *, bus_size_t); + void (*bs_wm_2_s) (void *, bus_space_handle_t, + bus_size_t, const u_int16_t *, bus_size_t); + void (*bs_wm_4_s) (void *, bus_space_handle_t, + bus_size_t, const u_int32_t *, bus_size_t); + void (*bs_wm_8_s) (void *, bus_space_handle_t, + bus_size_t, const u_int64_t *, bus_size_t); + + /* write region stream */ + void (*bs_wr_1_s) (void *, bus_space_handle_t, + bus_size_t, const u_int8_t *, bus_size_t); + void (*bs_wr_2_s) (void *, bus_space_handle_t, + bus_size_t, const u_int16_t *, bus_size_t); + void (*bs_wr_4_s) (void *, bus_space_handle_t, + bus_size_t, const u_int32_t *, bus_size_t); + void (*bs_wr_8_s) (void *, bus_space_handle_t, + bus_size_t, const u_int64_t *, bus_size_t); +}; + + +/* + * Utility macros; INTERNAL USE ONLY. + */ +#define __bs_c(a,b) __CONCAT(a,b) +#define __bs_opname(op,size) __bs_c(__bs_c(__bs_c(bs_,op),_),size) + +#define __bs_rs(sz, t, h, o) \ + (*(t)->__bs_opname(r,sz))((t)->bs_cookie, h, o) +#define __bs_ws(sz, t, h, o, v) \ + (*(t)->__bs_opname(w,sz))((t)->bs_cookie, h, o, v) +#define __bs_nonsingle(type, sz, t, h, o, a, c) \ + (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, a, c) +#define __bs_set(type, sz, t, h, o, v, c) \ + (*(t)->__bs_opname(type,sz))((t)->bs_cookie, h, o, v, c) +#define __bs_copy(sz, t, h1, o1, h2, o2, cnt) \ + (*(t)->__bs_opname(c,sz))((t)->bs_cookie, h1, o1, h2, o2, cnt) + +#define __bs_opname_s(op,size) __bs_c(__bs_c(__bs_c(__bs_c(bs_,op),_),size),_s) +#define __bs_rs_s(sz, t, h, o) \ + (*(t)->__bs_opname_s(r,sz))((t)->bs_cookie, h, o) +#define __bs_ws_s(sz, t, h, o, v) \ + (*(t)->__bs_opname_s(w,sz))((t)->bs_cookie, h, o, v) +#define __bs_nonsingle_s(type, sz, t, h, o, a, c) \ + (*(t)->__bs_opname_s(type,sz))((t)->bs_cookie, h, o, a, c) + + +/* + * Mapping and unmapping operations. + */ +#define bus_space_map(t, a, s, c, hp) \ + (*(t)->bs_map)((t)->bs_cookie, (a), (s), (c), (hp)) +#define bus_space_unmap(t, h, s) \ + (*(t)->bs_unmap)((t)->bs_cookie, (h), (s)) +#define bus_space_subregion(t, h, o, s, hp) \ + (*(t)->bs_subregion)((t)->bs_cookie, (h), (o), (s), (hp)) + + +/* + * Allocation and deallocation operations. + */ +#define bus_space_alloc(t, rs, re, s, a, b, c, ap, hp) \ + (*(t)->bs_alloc)((t)->bs_cookie, (rs), (re), (s), (a), (b), \ + (c), (ap), (hp)) +#define bus_space_free(t, h, s) \ + (*(t)->bs_free)((t)->bs_cookie, (h), (s)) + +/* + * Bus barrier operations. + */ +#define bus_space_barrier(t, h, o, l, f) \ + (*(t)->bs_barrier)((t)->bs_cookie, (h), (o), (l), (f)) + +#define BUS_SPACE_BARRIER_READ 0x01 +#define BUS_SPACE_BARRIER_WRITE 0x02 + +/* + * Bus read (single) operations. + */ +#define bus_space_read_1(t, h, o) __bs_rs(1,(t),(h),(o)) +#define bus_space_read_2(t, h, o) __bs_rs(2,(t),(h),(o)) +#define bus_space_read_4(t, h, o) __bs_rs(4,(t),(h),(o)) +#define bus_space_read_8(t, h, o) __bs_rs(8,(t),(h),(o)) + +#define bus_space_read_stream_1(t, h, o) __bs_rs_s(1,(t), (h), (o)) +#define bus_space_read_stream_2(t, h, o) __bs_rs_s(2,(t), (h), (o)) +#define bus_space_read_stream_4(t, h, o) __bs_rs_s(4,(t), (h), (o)) +#define bus_space_read_stream_8(t, h, o) __bs_rs_s(8,8,(t),(h),(o)) + +/* + * Bus read multiple operations. + */ +#define bus_space_read_multi_1(t, h, o, a, c) \ + __bs_nonsingle(rm,1,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_2(t, h, o, a, c) \ + __bs_nonsingle(rm,2,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_4(t, h, o, a, c) \ + __bs_nonsingle(rm,4,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_8(t, h, o, a, c) \ + __bs_nonsingle(rm,8,(t),(h),(o),(a),(c)) + +#define bus_space_read_multi_stream_1(t, h, o, a, c) \ + __bs_nonsingle_s(rm,1,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_stream_2(t, h, o, a, c) \ + __bs_nonsingle_s(rm,2,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_stream_4(t, h, o, a, c) \ + __bs_nonsingle_s(rm,4,(t),(h),(o),(a),(c)) +#define bus_space_read_multi_stream_8(t, h, o, a, c) \ + __bs_nonsingle_s(rm,8,(t),(h),(o),(a),(c)) + + +/* + * Bus read region operations. + */ +#define bus_space_read_region_1(t, h, o, a, c) \ + __bs_nonsingle(rr,1,(t),(h),(o),(a),(c)) +#define bus_space_read_region_2(t, h, o, a, c) \ + __bs_nonsingle(rr,2,(t),(h),(o),(a),(c)) +#define bus_space_read_region_4(t, h, o, a, c) \ + __bs_nonsingle(rr,4,(t),(h),(o),(a),(c)) +#define bus_space_read_region_8(t, h, o, a, c) \ + __bs_nonsingle(rr,8,(t),(h),(o),(a),(c)) + +#define bus_space_read_region_stream_1(t, h, o, a, c) \ + __bs_nonsingle_s(rr,1,(t),(h),(o),(a),(c)) +#define bus_space_read_region_stream_2(t, h, o, a, c) \ + __bs_nonsingle_s(rr,2,(t),(h),(o),(a),(c)) +#define bus_space_read_region_stream_4(t, h, o, a, c) \ + __bs_nonsingle_s(rr,4,(t),(h),(o),(a),(c)) +#define bus_space_read_region_stream_8(t, h, o, a, c) \ + __bs_nonsingle_s(rr,8,(t),(h),(o),(a),(c)) + + +/* + * Bus write (single) operations. + */ +#define bus_space_write_1(t, h, o, v) __bs_ws(1,(t),(h),(o),(v)) +#define bus_space_write_2(t, h, o, v) __bs_ws(2,(t),(h),(o),(v)) +#define bus_space_write_4(t, h, o, v) __bs_ws(4,(t),(h),(o),(v)) +#define bus_space_write_8(t, h, o, v) __bs_ws(8,(t),(h),(o),(v)) + +#define bus_space_write_stream_1(t, h, o, v) __bs_ws_s(1,(t),(h),(o),(v)) +#define bus_space_write_stream_2(t, h, o, v) __bs_ws_s(2,(t),(h),(o),(v)) +#define bus_space_write_stream_4(t, h, o, v) __bs_ws_s(4,(t),(h),(o),(v)) +#define bus_space_write_stream_8(t, h, o, v) __bs_ws_s(8,(t),(h),(o),(v)) + + +/* + * Bus write multiple operations. + */ +#define bus_space_write_multi_1(t, h, o, a, c) \ + __bs_nonsingle(wm,1,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_2(t, h, o, a, c) \ + __bs_nonsingle(wm,2,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_4(t, h, o, a, c) \ + __bs_nonsingle(wm,4,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_8(t, h, o, a, c) \ + __bs_nonsingle(wm,8,(t),(h),(o),(a),(c)) -static __inline void bus_space_write_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value); - -static __inline void bus_space_write_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value); - -static __inline void bus_space_write_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value); - -static __inline void -bus_space_write_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value) -{ - - if (tag == MIPS_BUS_SPACE_IO) - outb(bsh + offset, value); - else - writeb(bsh + offset, value); -} - -static __inline void -bus_space_write_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value) -{ - - if (tag == MIPS_BUS_SPACE_IO) - outw(bsh + offset, value); - else - writew(bsh + offset, value); -} - -static __inline void -bus_space_write_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value) -{ - - if (tag == MIPS_BUS_SPACE_IO) - outl(bsh + offset, value); - else - writel(bsh + offset, value); -} +#define bus_space_write_multi_stream_1(t, h, o, a, c) \ + __bs_nonsingle_s(wm,1,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_stream_2(t, h, o, a, c) \ + __bs_nonsingle_s(wm,2,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_stream_4(t, h, o, a, c) \ + __bs_nonsingle_s(wm,4,(t),(h),(o),(a),(c)) +#define bus_space_write_multi_stream_8(t, h, o, a, c) \ + __bs_nonsingle_s(wm,8,(t),(h),(o),(a),(c)) -#if 0 /* Cause a link error for bus_space_write_8 */ -#define bus_space_write_8 !!! bus_space_write_8 not implemented !!! -#endif /* - * Write `count' 1, 2, 4, or 8 byte quantities from the buffer - * provided to bus space described by tag/handle/offset. + * Bus write region operations. */ +#define bus_space_write_region_1(t, h, o, a, c) \ + __bs_nonsingle(wr,1,(t),(h),(o),(a),(c)) +#define bus_space_write_region_2(t, h, o, a, c) \ + __bs_nonsingle(wr,2,(t),(h),(o),(a),(c)) +#define bus_space_write_region_4(t, h, o, a, c) \ + __bs_nonsingle(wr,4,(t),(h),(o),(a),(c)) +#define bus_space_write_region_8(t, h, o, a, c) \ + __bs_nonsingle(wr,8,(t),(h),(o),(a),(c)) -static __inline void bus_space_write_multi_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int8_t *addr, - size_t count); -static __inline void bus_space_write_multi_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int16_t *addr, - size_t count); - -static __inline void bus_space_write_multi_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int32_t *addr, - size_t count); - -static __inline void -bus_space_write_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outb(baddr, *addr++); - else - while (count--) - writeb(baddr, *addr++); -} - -static __inline void -bus_space_write_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outw(baddr, *addr++); - else - while (count--) - writew(baddr, *addr++); -} - -static __inline void -bus_space_write_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outl(baddr, *addr++); - else - while (count--) - writel(baddr, *addr++); -} +#define bus_space_write_region_stream_1(t, h, o, a, c) \ + __bs_nonsingle_s(wr,1,(t),(h),(o),(a),(c)) +#define bus_space_write_region_stream_2(t, h, o, a, c) \ + __bs_nonsingle_s(wr,2,(t),(h),(o),(a),(c)) +#define bus_space_write_region_stream_4(t, h, o, a, c) \ + __bs_nonsingle_s(wr,4,(t),(h),(o),(a),(c)) +#define bus_space_write_region_stream_8(t, h, o, a, c) \ + __bs_nonsingle_s(wr,8,(t),(h),(o),(a),(c)) -#if 0 /* Cause a link error for bus_space_write_multi_8 */ -#define bus_space_write_multi_8(t, h, o, a, c) \ - !!! bus_space_write_multi_8 unimplemented !!! -#endif /* - * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided - * to bus space described by tag/handle starting at `offset'. + * Set multiple operations. */ +#define bus_space_set_multi_1(t, h, o, v, c) \ + __bs_set(sm,1,(t),(h),(o),(v),(c)) +#define bus_space_set_multi_2(t, h, o, v, c) \ + __bs_set(sm,2,(t),(h),(o),(v),(c)) +#define bus_space_set_multi_4(t, h, o, v, c) \ + __bs_set(sm,4,(t),(h),(o),(v),(c)) +#define bus_space_set_multi_8(t, h, o, v, c) \ + __bs_set(sm,8,(t),(h),(o),(v),(c)) -static __inline void bus_space_write_region_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int8_t *addr, - size_t count); -static __inline void bus_space_write_region_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int16_t *addr, - size_t count); -static __inline void bus_space_write_region_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - const u_int32_t *addr, - size_t count); - -static __inline void -bus_space_write_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - outb(baddr, *addr++); - baddr += 1; - } - else - while (count--) { - writeb(baddr, *addr++); - baddr += 1; - } -} - -static __inline void -bus_space_write_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - outw(baddr, *addr++); - baddr += 2; - } - else - while (count--) { - writew(baddr, *addr++); - baddr += 2; - } -} - -static __inline void -bus_space_write_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, const u_int32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) { - outl(baddr, *addr++); - baddr += 4; - } - else - while (count--) { - writel(baddr, *addr++); - baddr += 4; - } -} - -#if 0 /* Cause a link error for bus_space_write_region_8 */ -#define bus_space_write_region_8 \ - !!! bus_space_write_region_8 unimplemented !!! -#endif /* - * Write the 1, 2, 4, or 8 byte value `val' to bus space described - * by tag/handle/offset `count' times. + * Set region operations. */ +#define bus_space_set_region_1(t, h, o, v, c) \ + __bs_set(sr,1,(t),(h),(o),(v),(c)) +#define bus_space_set_region_2(t, h, o, v, c) \ + __bs_set(sr,2,(t),(h),(o),(v),(c)) +#define bus_space_set_region_4(t, h, o, v, c) \ + __bs_set(sr,4,(t),(h),(o),(v),(c)) +#define bus_space_set_region_8(t, h, o, v, c) \ + __bs_set(sr,8,(t),(h),(o),(v),(c)) -static __inline void bus_space_set_multi_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - u_int8_t value, size_t count); -static __inline void bus_space_set_multi_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - u_int16_t value, size_t count); -static __inline void bus_space_set_multi_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, - u_int32_t value, size_t count); - -static __inline void -bus_space_set_multi_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outb(addr, value); - else - while (count--) - writeb(addr, value); -} - -static __inline void -bus_space_set_multi_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outw(addr, value); - else - while (count--) - writew(addr, value); -} - -static __inline void -bus_space_set_multi_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - while (count--) - outl(addr, value); - else - while (count--) - writel(addr, value); -} - -#if 0 /* Cause a link error for bus_space_set_multi_8 */ -#define bus_space_set_multi_8 !!! bus_space_set_multi_8 unimplemented !!! -#endif /* - * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described - * by tag/handle starting at `offset'. + * Copy operations. */ - -static __inline void bus_space_set_region_1(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value, - size_t count); -static __inline void bus_space_set_region_2(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value, - size_t count); -static __inline void bus_space_set_region_4(bus_space_tag_t tag, - bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value, - size_t count); - -static __inline void -bus_space_set_region_1(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int8_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - for (; count != 0; count--, addr++) - outb(addr, value); - else - for (; count != 0; count--, addr++) - writeb(addr, value); -} - -static __inline void -bus_space_set_region_2(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int16_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - for (; count != 0; count--, addr += 2) - outw(addr, value); - else - for (; count != 0; count--, addr += 2) - writew(addr, value); -} - -static __inline void -bus_space_set_region_4(bus_space_tag_t tag, bus_space_handle_t bsh, - bus_size_t offset, u_int32_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - if (tag == MIPS_BUS_SPACE_IO) - for (; count != 0; count--, addr += 4) - outl(addr, value); - else - for (; count != 0; count--, addr += 4) - writel(addr, value); -} - -#if 0 /* Cause a link error for bus_space_set_region_8 */ -#define bus_space_set_region_8 !!! bus_space_set_region_8 unimplemented !!! -#endif +#define bus_space_copy_region_1(t, h1, o1, h2, o2, c) \ + __bs_copy(1, t, h1, o1, h2, o2, c) +#define bus_space_copy_region_2(t, h1, o1, h2, o2, c) \ + __bs_copy(2, t, h1, o1, h2, o2, c) +#define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ + __bs_copy(4, t, h1, o1, h2, o2, c) +#define bus_space_copy_region_8(t, h1, o1, h2, o2, c) \ + __bs_copy(8, t, h1, o1, h2, o2, c) /* - * Copy `count' 1, 2, 4, or 8 byte values from bus space starting - * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. + * Macros to provide prototypes for all the functions used in the + * bus_space structure */ -static __inline void bus_space_copy_region_1(bus_space_tag_t tag, - bus_space_handle_t bsh1, - bus_size_t off1, - bus_space_handle_t bsh2, - bus_size_t off2, size_t count); - -static __inline void bus_space_copy_region_2(bus_space_tag_t tag, - bus_space_handle_t bsh1, - bus_size_t off1, - bus_space_handle_t bsh2, - bus_size_t off2, size_t count); - -static __inline void bus_space_copy_region_4(bus_space_tag_t tag, - bus_space_handle_t bsh1, - bus_size_t off1, - bus_space_handle_t bsh2, - bus_size_t off2, size_t count); - -static __inline void -bus_space_copy_region_1(bus_space_tag_t tag, bus_space_handle_t bsh1, - bus_size_t off1, bus_space_handle_t bsh2, - bus_size_t off2, size_t count) -{ - bus_addr_t addr1 = bsh1 + off1; - bus_addr_t addr2 = bsh2 + off2; - - if (tag == MIPS_BUS_SPACE_IO) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:26:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E61106566C; Sun, 10 Jan 2010 20:26:03 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89248FC18; Sun, 10 Jan 2010 20:26: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 o0AKQ3WZ032020; Sun, 10 Jan 2010 20:26:03 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKQ34o032018; Sun, 10 Jan 2010 20:26:03 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201001102026.o0AKQ34o032018@svn.freebsd.org> From: Hartmut Brandt Date: Sun, 10 Jan 2010 20:26: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: r202045 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:26:03 -0000 Author: harti Date: Sun Jan 10 20:26:03 2010 New Revision: 202045 URL: http://svn.freebsd.org/changeset/base/202045 Log: Make make respect the TMPDIR environment variable. PR: bin/115447 Submitted by: Eugene Grosbein Modified: head/usr.bin/make/job.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Sun Jan 10 20:22:05 2010 (r202044) +++ head/usr.bin/make/job.c Sun Jan 10 20:26:03 2010 (r202045) @@ -114,6 +114,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -137,7 +138,8 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "var.h" -#define TMPPAT "/tmp/makeXXXXXXXXXX" +#define TMPPAT "makeXXXXXXXXXX" +#define TMPDIR "/tmp" #ifndef USE_KQUEUE /* @@ -236,7 +238,7 @@ typedef struct Job { */ struct { /* Name of file to which shell output was rerouted */ - char of_outFile[sizeof(TMPPAT)]; + char of_outFile[PATH_MAX]; /* * Stream open to the output file. Used to funnel all @@ -1566,7 +1568,8 @@ JobStart(GNode *gn, int flags, Job *prev Boolean noExec; /* Set true if we decide not to run the job */ int tfd; /* File descriptor for temp file */ LstNode *ln; - char tfile[sizeof(TMPPAT)]; + char tfile[PATH_MAX]; + const char *tdir; if (interrupted) { JobPassSig(interrupted); @@ -1607,6 +1610,9 @@ JobStart(GNode *gn, int flags, Job *prev cmdsOK = TRUE; } + if ((tdir = getenv("TMPDIR")) == NULL) + tdir = TMPDIR; + /* * If the -n flag wasn't given, we open up OUR (not the child's) * temporary file to stuff commands in it. The thing is rd/wr so we @@ -1622,7 +1628,7 @@ JobStart(GNode *gn, int flags, Job *prev DieHorribly(); } - strcpy(tfile, TMPPAT); + snprintf(tfile, sizeof(tfile), "%s/%s", tdir, TMPPAT); if ((tfd = mkstemp(tfile)) == -1) Punt("Cannot create temp file: %s", strerror(errno)); job->cmdFILE = fdopen(tfd, "w+"); @@ -1801,7 +1807,10 @@ JobStart(GNode *gn, int flags, Job *prev } else { fprintf(stdout, "Remaking `%s'\n", gn->name); fflush(stdout); - strcpy(job->outFile, TMPPAT); + if ((tdir = getenv("TMPDIR")) == NULL) + tdir = TMPDIR; + snprintf(job->outFile, sizeof(job->outFile), "%s/%s", + tdir, TMPPAT); if ((job->outFd = mkstemp(job->outFile)) == -1) Punt("cannot create temp file: %s", strerror(errno)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 20:29:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA691065672; Sun, 10 Jan 2010 20:29:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBE968FC18; Sun, 10 Jan 2010 20:29: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 o0AKTKX4032767; Sun, 10 Jan 2010 20:29:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AKTKGK032764; Sun, 10 Jan 2010 20:29:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102029.o0AKTKGK032764@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 20:29: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: r202046 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 20:29:21 -0000 Author: imp Date: Sun Jan 10 20:29:20 2010 New Revision: 202046 URL: http://svn.freebsd.org/changeset/base/202046 Log: Merge from projects/mips to head by hand: sorry for the huge firehose on this commit, it would be too tedious to do file by file r201881 | imp | 2010-01-08 20:08:22 -0700 (Fri, 08 Jan 2010) | 3 lines Rename mips_pcpu_init to mips_pcpu0_init since it applies only to the BSP. Provide a missing prototype. r201880 | neel | 2010-01-08 19:17:14 -0700 (Fri, 08 Jan 2010) | 7 lines Compute the target of the jump in the 'J' and 'JAL' instructions correctly. The 256MB segment is formed by taking the top 4 bits of the address of the instruction in the "branch delay" slot as opposed to the 'J' or 'JAL' instruction itself. r201845 | imp | 2010-01-08 15:48:21 -0700 (Fri, 08 Jan 2010) | 2 lines Centralize initialization of pcpu, and set curthread early... r201770 | neel | 2010-01-07 22:53:11 -0700 (Thu, 07 Jan 2010) | 4 lines Add a DDB command "show pcb" to dump out the contents of a thread's PCB. r201631 | neel | 2010-01-05 23:42:08 -0700 (Tue, 05 Jan 2010) | 5 lines Remove all CFE-specific code from locore.S. The CFE entrypoint initialization is now done in platform-specific code. r201563 | neel | 2010-01-04 23:58:54 -0700 (Mon, 04 Jan 2010) | 6 lines This change increases the size of the kernel stack for thread0 from PAGE_SIZE to (2 * PAGE_SIZE). It depends on the memory allocated by pmap_steal_memory() being aligned to a PAGE_SIZE boundary. r200656 | imp | 2009-12-17 16:55:49 -0700 (Thu, 17 Dec 2009) | 7 lines Place holder ptrace mips module. Not entirely sure what's required here yet, so I've not connected it to the build. I think that we'll need to move something into the processor specific part of the mips port by requiring mips_cpu_ptrace or platform_cpu_ptrace be provided by the ports to get/set processor specific registers, ala SSE registers on x86. r200342 | imp | 2009-12-09 18:42:44 -0700 (Wed, 09 Dec 2009) | 4 lines app_descriptor_addr is unused (I know it is referened still). And unnecessary since we pass in a3 unmodified to platform_start. Eliminate it from here and kill one more TARGET_OCTEON in the process. r199760 | imp | 2009-11-24 10:15:22 -0700 (Tue, 24 Nov 2009) | 2 lines Add in Cavium's CID. Report what the unknown CID is. r199755 | imp | 2009-11-24 09:53:58 -0700 (Tue, 24 Nov 2009) | 5 lines looks like there's more to this patch than just this one file. I'll leave it to neel@ to get all the relevant pieces into the tree. r199754 | imp | 2009-11-24 09:32:31 -0700 (Tue, 24 Nov 2009) | 6 lines Include opt_cputype.h for all .c and .S files referencing TARGET_OCTEON. Spell ld script name right. # for the most part, we need to enhance infrastructure to obviate the need # for such an intrusive option. r199753 | imp | 2009-11-24 09:30:29 -0700 (Tue, 24 Nov 2009) | 3 lines Remove a comment that's bogus. Include opt_cputype.h since TARGET_OCTEON moved there. r199752 | imp | 2009-11-24 09:29:23 -0700 (Tue, 24 Nov 2009) | 4 lines Make sure kstack0 is page aligned. # this may have been from neel@ for the sibyte stuff r199742 | imp | 2009-11-24 01:35:11 -0700 (Tue, 24 Nov 2009) | 8 lines Move the hard-wiring of the dcache on octeon outside of the if statement. When no caches support was added, it looks like TARGET_OCTEON was bogusly moved inside the if. Also, include opt_cputype.h to make TARGET_OCTEON actually active. # now we die in pmap init somewhere... Most likely because 32MB of RAM is # too tight given the load address we're using. r199741 | imp | 2009-11-24 01:21:48 -0700 (Tue, 24 Nov 2009) | 2 lines TARGET_OCTEON reqiures opt_cputype.h. r199736 | imp | 2009-11-24 00:40:38 -0700 (Tue, 24 Nov 2009) | 2 lines Prefer ANSI spellings of uintXX_t, etc. r199598 | imp | 2009-11-20 09:30:35 -0700 (Fri, 20 Nov 2009) | 3 lines Horrible kludge to make octeon32 work. I think a better way is to move the generic code into the config files.... r199597 | imp | 2009-11-20 09:27:50 -0700 (Fri, 20 Nov 2009) | 4 lines cast vaddr to uintptr_t before casting it to a bus_space_handle_t. # I'm sure this indicates a problem, but I'm not sure what... r199496 | gonzo | 2009-11-18 15:52:05 -0700 (Wed, 18 Nov 2009) | 5 lines - Add cpu_init_interrupts function that is supposed to prepeare stuff required for spinning out interrupts later - Add API for managing intrcnt/intrnames arrays - Some minor style(9) fixes r199246 | neel | 2009-11-13 02:24:09 -0700 (Fri, 13 Nov 2009) | 10 lines Make pmap_copy_page() L2-cache friendly by doing the copy through the cacheable window on physical memory (KSEG0). On the Sibyte processor going through the uncacheable window (KSEG1) bypasses both L1 and L2 caches so we may end up with stale contents in the L2 cache. This also makes it consistent with the rest of the function that uses cacheable mappings to copy pages. Approved by: imp (mentor) r198842 | gonzo | 2009-11-02 23:42:55 -0700 (Mon, 02 Nov 2009) | 3 lines - Handle errors when adding children to nexus. This sittuation might occure when there is dublicate of child's entry in hints r198669 | rrs | 2009-10-30 02:53:11 -0600 (Fri, 30 Oct 2009) | 5 lines With this commit our friend RMI will now compile. I have not tested it and the chances of it running yet are about ZERO.. but it will now compile. The hard part now begins, making it run ;-) r198569 | neel | 2009-10-28 23:18:02 -0600 (Wed, 28 Oct 2009) | 5 lines Deal with overflow of the COUNT register correctly. The 'cycles_per_hz' has nothing to do with the rollover. r198550 | imp | 2009-10-28 11:03:20 -0600 (Wed, 28 Oct 2009) | 3 lines Remove useless for statement. i isn't used after it. Remove needless braces. r198534 | gonzo | 2009-10-27 21:34:05 -0600 (Tue, 27 Oct 2009) | 8 lines - Fix busdma sync: dcache invalidation operates on cache line aligned addresses and could modify areas of memory that share the same cache line at the beginning and at the ending of the buffer. In order to prevent a data loss we save these chunks in temporary buffer before invalidation and restore them afer it. Idea suggested by: cognet r198531 | gonzo | 2009-10-27 18:01:20 -0600 (Tue, 27 Oct 2009) | 3 lines - Remove bunch of declared but not defined cach-related variables - Add mips_picache_linesize and mips_pdcache_linesize variables r198530 | gonzo | 2009-10-27 17:45:48 -0600 (Tue, 27 Oct 2009) | 3 lines - Replace stubs with actual cache info - minor style(9) fix r198355 | neel | 2009-10-21 22:35:32 -0600 (Wed, 21 Oct 2009) | 11 lines Remove redundant instructions from tlb.S The "_MTC0 v0, COP_0_TLB_HI" is actually incorrect because v0 has not been initialized at that point. It worked correctly because we subsequently did the right thing and initialized TLB_HI correctly. The "li v0, MIPS_KSEG0_START" is redundant because we do exactly the same thing 2 instructions down. r198354 | neel | 2009-10-21 20:51:31 -0600 (Wed, 21 Oct 2009) | 9 lines Get rid of the hardcoded constants to define cacheable memory: SDRAM_ADDR_START, SDRAM_ADDR_END and SDRAM_MEM_SIZE Instead we now keep a copy of the memory regions enumerated by platform-specific code and use that to determine whether an address is cacheable or not. r198310 | gonzo | 2009-10-20 17:13:08 -0600 (Tue, 20 Oct 2009) | 5 lines - Commit missing part of "bt" fix: store PC register in pcb_context struct in cpu_switch and use it in stack_trace function later. pcb_regs contains state of the process stored by exception handler and therefor is not valid for sleeping processes. r198264 | neel | 2009-10-19 22:36:08 -0600 (Mon, 19 Oct 2009) | 5 lines Fix a bug where we would think that the L1 instruction and data cache are present even though the line size field in the CP0 Config1 register is 0. r198208 | imp | 2009-10-18 09:21:48 -0600 (Sun, 18 Oct 2009) | 3 lines Get the PC from the trap frame, since it isn't saved as part of the pcb regs. r198205 | imp | 2009-10-18 08:55:55 -0600 (Sun, 18 Oct 2009) | 3 lines Use correct signature for MipsEmulateBranch. The other one doesn't work for 64-bit compiles. r198182 | gonzo | 2009-10-16 18:22:07 -0600 (Fri, 16 Oct 2009) | 11 lines - Use PC/RA/SP values as arguments for stacktrace_subr instead of trapframe. Context info could be obtained from other sources (see below) no only from td_pcb field - Do not show a0..a3 values unless they're obtained from the stack. These are only confirmed values. - Fix bt command in DDB. Previous implementation used thread's trapframe structure as a source info for trace unwinding, but this structure is filled only when exception occurs. Valid register values for sleeping processes are in pcb_context array. For curthread use pc/sp/ra for current frame r198181 | gonzo | 2009-10-16 16:52:18 -0600 (Fri, 16 Oct 2009) | 2 lines - Get rid of label_t. It came from NetBSD and was used only in one place r198066 | gonzo | 2009-10-13 19:43:53 -0600 (Tue, 13 Oct 2009) | 5 lines - Move stack tracing function to db_trace.c - Axe unused extern MipsXXX declarations - Move all declarations for functions in exceptions.S/swtch.S from trap.c to respective headers r197796 | gonzo | 2009-10-05 17:19:51 -0600 (Mon, 05 Oct 2009) | 2 lines - Revert part of r197685 because this change leads to wrong data in cache. r197685 | gonzo | 2009-10-01 14:05:36 -0600 (Thu, 01 Oct 2009) | 2 lines - Sync caches properly when dealing with sf_buf r197014 | imp | 2009-09-08 21:57:10 -0600 (Tue, 08 Sep 2009) | 2 lines Ugly hack to get this to compile. I'm sure there's a better way... r197013 | imp | 2009-09-08 21:54:55 -0600 (Tue, 08 Sep 2009) | 2 lines First half of making this 64-bit clean: fix prototypes. r196988 | gonzo | 2009-09-08 13:15:29 -0600 (Tue, 08 Sep 2009) | 2 lines - MFC from head@196987 r196313 | imp | 2009-08-17 06:14:40 -0600 (Mon, 17 Aug 2009) | 2 lines suword64 and csuword64. Needed by ELF64 stuff... r196266 | imp | 2009-08-15 16:51:11 -0600 (Sat, 15 Aug 2009) | 5 lines (1) Fix a few 32/64-bit bugs. (2) Also, always allocate 2 pages for the stack to optimize TLB usage. Submitted by: neel@ (2) r196265 | imp | 2009-08-15 16:48:09 -0600 (Sat, 15 Aug 2009) | 2 lines Various 32/64-bit confusion cleanups. r196264 | imp | 2009-08-15 16:45:46 -0600 (Sat, 15 Aug 2009) | 6 lines (1) Some CPUs have a range to map I/O cyces on the pci bus. So allow them to work by allowding the nexus to assign ports. (2) Remove some Octeon junk that shouldn't be necessary. Submitted by: neel@ (#1) for SB1 port. r196061 | gonzo | 2009-08-04 11:32:55 -0600 (Tue, 04 Aug 2009) | 2 lines - Use register_t for registers values r195984 | gonzo | 2009-07-30 17:48:29 -0600 (Thu, 30 Jul 2009) | 4 lines - Properly unwind stack for functions with __noreturn__ attribute Submitted by: Neelkanth Natu r195983 | gonzo | 2009-07-30 17:29:59 -0600 (Thu, 30 Jul 2009) | 4 lines - mark map as coherent if requested by flags - explicitly set memory allocation method in map flags instead of duplicating conditions for malloc/contigalloc r195584 | imp | 2009-07-10 13:09:34 -0600 (Fri, 10 Jul 2009) | 3 lines Use PTR_* macros for pointers, and not potentially mips64 unsafe operations. r195583 | imp | 2009-07-10 13:08:48 -0600 (Fri, 10 Jul 2009) | 2 lines Use PTR_* macros to deal with pointers. r195579 | imp | 2009-07-10 13:04:32 -0600 (Fri, 10 Jul 2009) | 2 lines use ta0-ta3 rather than t4-t7 for n32/n64 goodness. r195511 | gonzo | 2009-07-09 13:02:17 -0600 (Thu, 09 Jul 2009) | 3 lines - Ooops, this debug code wasn't supposed to get into final commit. My appologises. r195478 | gonzo | 2009-07-08 16:28:36 -0600 (Wed, 08 Jul 2009) | 5 lines - Port busdma code from FreeBSD/arm. This is more mature version that takes into account all limitation to DMA memory (boundaries, alignment) and implements bounce pages. - Add BUS_DMASYNC_POSTREAD case to bus_dmamap_sync_buf r195438 | imp | 2009-07-08 00:00:18 -0600 (Wed, 08 Jul 2009) | 2 lines Turns out this code was right, revert last change. r195429 | gonzo | 2009-07-07 13:55:09 -0600 (Tue, 07 Jul 2009) | 5 lines - Move dpcpu initialization to mips_proc0_init. It's more appropriate place for it. Besides dpcpu_init requires pmap module to be initialized and calling it int pmap.c hangs the system r195399 | imp | 2009-07-06 01:49:24 -0600 (Mon, 06 Jul 2009) | 2 lines Prefer uintptr_t to int cast here. r195398 | imp | 2009-07-06 01:48:31 -0600 (Mon, 06 Jul 2009) | 3 lines Better types for 64-bit compatibility. Use %p and cast to void * and prefer uintptr_t to other int-type casts. r195397 | imp | 2009-07-06 01:47:39 -0600 (Mon, 06 Jul 2009) | 2 lines No need to force mips32 here. r195396 | imp | 2009-07-06 01:46:13 -0600 (Mon, 06 Jul 2009) | 3 lines Pass in the uint64 value, rather than a pointer to it. that's what the function expects... r195395 | imp | 2009-07-06 01:45:02 -0600 (Mon, 06 Jul 2009) | 3 lines Use ta0 instead of t4 and ta1 instead of t5. These map to the same registers on O32 builds, but t4 and t5 don't exist on N32 or N64. r195394 | imp | 2009-07-06 01:43:50 -0600 (Mon, 06 Jul 2009) | 3 lines Use better casts for passing the small integer as a pointer here. Basically, replace int with uintptr_t. r195393 | imp | 2009-07-06 01:42:54 -0600 (Mon, 06 Jul 2009) | 5 lines (1) Improvements for SB1. only allow real memory to be accessed. (2) make compile n64 by using more-proper casts. Submitted by: Neelkanth Natu (1) r195373 | imp | 2009-07-05 09:23:54 -0600 (Sun, 05 Jul 2009) | 5 lines (1) Use PTR_LA rather than bare la for N64 goodness (it is dla there) (2) SB1 needs COHERENT policy, not cached for the config register Submitted by: (2) Neelkanth Natu r195372 | imp | 2009-07-05 09:22:22 -0600 (Sun, 05 Jul 2009) | 3 lines use "PTR_LA" in preference to a bare la so it translates to dla on 64-bit ABIs. r195371 | imp | 2009-07-05 09:21:35 -0600 (Sun, 05 Jul 2009) | 6 lines Now that we define atomic_{load,store}_64 inline in atomic.h, we don't need to define them here for the !N64 case. We now define atomic_readandclear_64 in atomic.h, so no need to repeat it here. r195364 | imp | 2009-07-05 09:10:07 -0600 (Sun, 05 Jul 2009) | 5 lines use %p in preference to 0x%08x for printing register_t values. Cast them to void * first. This neatly solves the "how do I print a register_t" problem because sizeof(void *) is always the same as sizeof(register_t), afaik. r195353 | imp | 2009-07-05 00:46:54 -0600 (Sun, 05 Jul 2009) | 6 lines Publish PAGE_SHIFT to assembler # we should likely phase out PGSHIFT Submitted by: Neelkanth Natu r195350 | imp | 2009-07-05 00:39:37 -0600 (Sun, 05 Jul 2009) | 7 lines Switch to ABI agnostic ta0-ta3. Provide defs for this in the right places. Provide n32/n64 register name defintions. This should have no effect for the O32 builds that everybody else uses, but should help make N64 builds possible (lots of other changes are needed for that). Obtained from: NetBSD (for the regdef.h changes) r195334 | imp | 2009-07-03 21:22:34 -0600 (Fri, 03 Jul 2009) | 6 lines Move from using the lame invalid address I chose when trying to get Octeon going... Turns out that you get tlb shutdowns with this... Use PGSHIFT instead of PAGE_SHIFT. Submitted by: Neelkanth Natu r195147 | gonzo | 2009-06-28 15:01:00 -0600 (Sun, 28 Jun 2009) | 2 lines - Replace casuword and casuword32 stubs with proper implementation r195128 | gonzo | 2009-06-27 17:27:41 -0600 (Sat, 27 Jun 2009) | 4 lines - Add support for handling TLS area address in kernel space. From the userland point of view get/set operations are performed using sysarch(2) call. r195127 | gonzo | 2009-06-27 17:01:35 -0600 (Sat, 27 Jun 2009) | 4 lines - Make cpu_set_upcall_kse conform MIPS ABI. T9 should be the same as PC in subroutine entry point - Preserve interrupt mask r194938 | gonzo | 2009-06-24 20:15:04 -0600 (Wed, 24 Jun 2009) | 3 lines - Invalidate cache in pmap_qenter. Fixes corruption of data that comes through pipe (may be other bugs) r194505 | gonzo | 2009-06-19 13:02:40 -0600 (Fri, 19 Jun 2009) | 5 lines - Keep interrupts mask intact by RESTORE_CPU in MipsKernGenException trap() function re-enables interrupts if exception happened with interrupts enabled and therefor status register might be modified by interrupt filters r194277 | gonzo | 2009-06-15 20:36:21 -0600 (Mon, 15 Jun 2009) | 2 lines - Remove debug printfs r194275 | gonzo | 2009-06-15 19:43:33 -0600 (Mon, 15 Jun 2009) | 2 lines - Handle KSEG0/KSEG1 addresses for /dev/mem as well. netstat requires it r193491 | gonzo | 2009-06-05 03:21:03 -0600 (Fri, 05 Jun 2009) | 6 lines - Status register should be set last in RESTORE_CPU in order to prevent race over k0, k1 registers. - Update interrupts mask in saved status register for MipsUserIntr and MipsUserGenException. It might be modified by intr filter or ithread. r192864 | gonzo | 2009-05-26 16:40:12 -0600 (Tue, 26 May 2009) | 4 lines - Replace CPU_NOFPU and SOFTFLOAT options with CPU_FPU. By default we assume that there is no FPU, because majority of SoC does not have it. r192794 | gonzo | 2009-05-26 00:20:50 -0600 (Tue, 26 May 2009) | 5 lines - Preserve INT_MASK fields in Status register across context switches. They should be modified only by interrupt setup/teardown and pre_ithread/post_ithread functions r192793 | gonzo | 2009-05-26 00:02:38 -0600 (Tue, 26 May 2009) | 2 lines - Remove erroneus "break" instruction, it was meant for debug r192792 | gonzo | 2009-05-26 00:01:17 -0600 (Tue, 26 May 2009) | 2 lines - Remove now unused NetBSDism intr.h r192791 | gonzo | 2009-05-25 23:59:05 -0600 (Mon, 25 May 2009) | 7 lines - Provide proper pre_ithread/post_ithread functions for both hard and soft interrupts - Do not handle masked interrupts - Do not write Cause register because most bytes are read-only and writing the same byte to RW fields are pointless. And in case of software interrupt utterly wrong r192664 | gonzo | 2009-05-23 13:42:23 -0600 (Sat, 23 May 2009) | 4 lines - cpu_establish_hardintr modifies INT_MASK of Status register, so we should use disableintr/restoreintr that modifies only IE bit. r192655 | gonzo | 2009-05-23 12:00:20 -0600 (Sat, 23 May 2009) | 6 lines - Remove stale comments - Replace a1 with k1 to while restoring context. a1 was there by mistake, interrupts are disabled at this point and it's safe to use k0, k1. This code never was reached beacasue current Status register handling prevented interrupta from user mode. r192496 | gonzo | 2009-05-20 17:07:10 -0600 (Wed, 20 May 2009) | 4 lines - Invalidate caches for respective areain KSEG0 in order to prevent further overwriting of KSEG1 data with writeback. r192364 | gonzo | 2009-05-18 20:43:21 -0600 (Mon, 18 May 2009) | 6 lines - Cleanup ticker initialization code. For some MIPS cpu Counter register increments only every second cycle. The only timing references for us is Count value. Therefore it's better to convert frequencies related to it and use them. Besides cleanup this commit fixes twice more then requested sleep interval problem. r192176 | gonzo | 2009-05-15 20:34:03 -0600 (Fri, 15 May 2009) | 3 lines - Add informational title for cache info lines to separate them from environment variables dump r192119 | gonzo | 2009-05-14 15:26:07 -0600 (Thu, 14 May 2009) | 3 lines - Off by one check fix. Check for last address in region to fit in KSEG1 r191841 | gonzo | 2009-05-05 20:55:43 -0600 (Tue, 05 May 2009) | 5 lines - Use index ops in order to avoid TLBMiss exceptions when flushing caches on mapping removal - Writeback all VA for page that is being copied in pmap_copy_page to guaranty up-to-date data in SDRAM r191613 | gonzo | 2009-04-27 20:59:18 -0600 (Mon, 27 Apr 2009) | 4 lines - When destroying va -> pa mapping writeback all caches or we may endup with partial page content in SDRAM - style(9) fix r191583 | gonzo | 2009-04-27 12:46:57 -0600 (Mon, 27 Apr 2009) | 5 lines - Use new spacebus - Be a bit more verbose on failures - style(9) fixes - Use default rid value of 0 instead of MIPS_MEM_RID (0x20) r191577 | gonzo | 2009-04-27 12:29:59 -0600 (Mon, 27 Apr 2009) | 4 lines - Use naming convention the same as MIPS spec does: eliminate _sel1 sufix and just use selector number. e.g. mips_rd_config_sel1 -> mips_rd_config1 - Add WatchHi/WatchLo accessors for selctors 1..3 (for debug purposes) r191453 | gonzo | 2009-04-23 23:28:44 -0600 (Thu, 23 Apr 2009) | 4 lines Fix cut'n'paste code. cfg3 should get the value of selector 3 Spotted by: thompa@ r191452 | gonzo | 2009-04-23 22:18:16 -0600 (Thu, 23 Apr 2009) | 2 lines - Print supported CPU capabilities during stratup r191448 | gonzo | 2009-04-23 21:38:51 -0600 (Thu, 23 Apr 2009) | 2 lines - Fix whitespace to conform style(9) r191282 | gonzo | 2009-04-19 16:02:14 -0600 (Sun, 19 Apr 2009) | 3 lines - Make mips_bus_space_generic be of type bus_space_tag_t instead of struct bus_space and update all relevant places. r191084 | gonzo | 2009-04-14 20:28:26 -0600 (Tue, 14 Apr 2009) | 6 lines Use FreeBSD/arm approach for handling bus space access: space tag is a pointer to bus_space structure that defines access methods and hence every bus can define own accessors. Default space is mips_bus_space_generic. It's a simple interface to physical memory, values are read with regard to host system byte order. r191083 | gonzo | 2009-04-14 19:47:52 -0600 (Tue, 14 Apr 2009) | 4 lines - Cleanout stale #ifdef'ed chunk of code - Fix whitespaces - Explicitly undefine NEXUS_DEBUG flag r191079 | gonzo | 2009-04-14 16:53:22 -0600 (Tue, 14 Apr 2009) | 2 lines - Revert changes accidentally killed by merge operation ------------------------------------------------------------------------ r187512 | gonzo | 2009-01-20 22:49:30 -0700 (Tue, 20 Jan 2009) | 4 lines - Check if maddr/msize hints are there before setting hinted resources to device - Check for irq hint too r187418 | gonzo | 2009-01-18 19:37:10 -0700 (Sun, 18 Jan 2009) | 4 lines - Add trampoline stuff for bootloaders that do not support ELF - Replace arm'ish KERNPHYSADDR/KERNVIRTADDR with KERNLOADADDR/TRAMPLOADADDR and clean configs Modified: head/sys/mips/mips/busdma_machdep.c head/sys/mips/mips/cache.c head/sys/mips/mips/cache_mipsNN.c head/sys/mips/mips/copystr.S head/sys/mips/mips/cpu.c head/sys/mips/mips/db_trace.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/exception.S head/sys/mips/mips/fp.S head/sys/mips/mips/gdb_machdep.c head/sys/mips/mips/genassym.c head/sys/mips/mips/in_cksum.c head/sys/mips/mips/intr_machdep.c head/sys/mips/mips/locore.S head/sys/mips/mips/machdep.c head/sys/mips/mips/mainbus.c head/sys/mips/mips/mem.c head/sys/mips/mips/nexus.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/psraccess.S head/sys/mips/mips/support.S head/sys/mips/mips/swtch.S head/sys/mips/mips/tick.c head/sys/mips/mips/tlb.S head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sun Jan 10 20:26:03 2010 (r202045) +++ head/sys/mips/mips/busdma_machdep.c Sun Jan 10 20:29:20 2010 (r202046) @@ -23,50 +23,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred */ -/*- - * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, - * NASA Ames Research Center. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ - -/* $NetBSD: bus_dma.c,v 1.17 2006/03/01 12:38:11 yamt Exp $ */ - #include __FBSDID("$FreeBSD$"); +/* + * MIPS bus dma support routines + */ + #include #include #include @@ -79,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,6 +55,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#define MAX_BPAGES 64 +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + +struct bounce_zone; struct bus_dma_tag { bus_dma_tag_t parent; @@ -105,19 +79,59 @@ struct bus_dma_tag { int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; - /* XXX: machine-dependent fields */ - vm_offset_t _physbase; - vm_offset_t _wbase; - vm_offset_t _wsize; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; }; +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; +}; + +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + #define DMAMAP_LINEAR 0x1 #define DMAMAP_MBUF 0x2 #define DMAMAP_UIO 0x4 -#define DMAMAP_ALLOCATED 0x10 #define DMAMAP_TYPE_MASK (DMAMAP_LINEAR|DMAMAP_MBUF|DMAMAP_UIO) #define DMAMAP_COHERENT 0x8 +#define DMAMAP_ALLOCATED 0x10 +#define DMAMAP_MALLOCUSED 0x20 + struct bus_dmamap { + struct bp_list bpages; + int pagesneeded; + int pagesreserved; bus_dma_tag_t dmat; int flags; void *buffer; @@ -125,8 +139,15 @@ struct bus_dmamap { void *allocbuffer; TAILQ_ENTRY(bus_dmamap) freelist; int len; + STAILQ_ENTRY(bus_dmamap) links; + bus_dmamap_callback_t *callback; + void *callback_arg; + }; +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; + static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = TAILQ_HEAD_INITIALIZER(dmamap_freelist); @@ -137,6 +158,45 @@ static struct mtx busdma_mtx; MTX_SYSINIT(busdma_mtx, &busdma_mtx, "busdma lock", MTX_DEF); +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); + +/* Default tag, as most drivers provide no parent tag. */ +bus_dma_tag_t mips_root_dma_tag; + +/* + * Return true if a match is made. + * + * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. + * + * If paddr is within the bounds of the dma tag then call the filter callback + * to check for a match, if there is no filter callback then assume a match. + */ +static int +run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) +{ + int retval; + + retval = 0; + + do { + if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) + || ((paddr & (dmat->alignment - 1)) != 0)) + && (dmat->filter == NULL + || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + retval = 1; + + dmat = dmat->parent; + } while (retval == 0 && dmat != NULL); + return (retval); +} + static void mips_dmamap_freelist_init(void *dummy) { @@ -157,6 +217,19 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma bus_dmamap_t map, void *buf, bus_size_t buflen, struct pmap *pmap, int flags, vm_offset_t *lastaddrp, int *segp); +static __inline int +_bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) +{ + int i; + for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { + if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) + || (lowaddr < phys_avail[i] && + highaddr > phys_avail[i])) + return (1); + } + return (0); +} + /* * Convenience function for manipulating driver locks from busdma (during * busdma_swi, for example). Drivers that don't provide their own locks @@ -213,6 +286,7 @@ _busdma_alloc_dmamap(void) map->flags = DMAMAP_ALLOCATED; } else map->flags = 0; + STAILQ_INIT(&map->bpages); return (map); } @@ -228,6 +302,11 @@ _busdma_free_dmamap(bus_dmamap_t map) } } +/* + * Allocate a device specific dma_tag. + */ +#define SEG_NB 1024 + int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, bus_size_t boundary, bus_addr_t lowaddr, @@ -238,16 +317,12 @@ bus_dma_tag_create(bus_dma_tag_t parent, { bus_dma_tag_t newtag; int error = 0; - - /* Basic sanity checking */ - if (boundary != 0 && boundary < maxsegsz) - maxsegsz = boundary; - /* Return a NULL tag on failure */ *dmat = NULL; + if (!parent) + parent = mips_root_dma_tag; - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, - M_ZERO | M_NOWAIT); + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT); if (newtag == NULL) { CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, 0, error); @@ -257,21 +332,16 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->parent = parent; newtag->alignment = alignment; newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + - (PAGE_SIZE - 1); + newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; - newtag->maxsize = maxsize; - newtag->nsegments = nsegments; + newtag->maxsize = maxsize; + newtag->nsegments = nsegments; newtag->maxsegsz = maxsegsz; newtag->flags = flags; newtag->ref_count = 1; /* Count ourself */ newtag->map_count = 0; - newtag->_wbase = 0; - newtag->_physbase = 0; - /* XXXMIPS: Should we limit window size to amount of physical memory */ - newtag->_wsize = MIPS_KSEG1_START - MIPS_KSEG0_START; if (lockfunc != NULL) { newtag->lockfunc = lockfunc; newtag->lockfuncarg = lockfuncarg; @@ -279,36 +349,68 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } - - /* Take into account any restrictions imposed by our parent tag */ - if (parent != NULL) { - newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); + /* + * Take into account any restrictions imposed by our parent tag + */ + if (parent != NULL) { + newtag->lowaddr = min(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = max(parent->highaddr, newtag->highaddr); if (newtag->boundary == 0) newtag->boundary = parent->boundary; else if (parent->boundary != 0) - newtag->boundary = MIN(parent->boundary, + newtag->boundary = min(parent->boundary, newtag->boundary); - if (newtag->filter == NULL) { - /* - * Short circuit looking at our parent directly - * since we have encapsulated all of its information - */ - newtag->filter = parent->filter; - newtag->filterarg = parent->filterarg; - newtag->parent = parent->parent; + if ((newtag->filter != NULL) || + ((parent->flags & BUS_DMA_COULD_BOUNCE) != 0)) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + if (newtag->filter == NULL) { + /* + * Short circuit looking at our parent directly + * since we have encapsulated all of its information + */ + newtag->filter = parent->filter; + newtag->filterarg = parent->filterarg; + newtag->parent = parent->parent; } if (newtag->parent != NULL) atomic_add_int(&parent->ref_count, 1); } + if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) + || newtag->alignment > 1) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; - if (error != 0) { + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else + newtag->bounce_zone = NULL; + if (error != 0) free(newtag, M_DEVBUF); - } else { + else *dmat = newtag; - } CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); + return (error); } @@ -346,6 +448,7 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) return (0); } +#include /* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. @@ -354,9 +457,7 @@ int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { bus_dmamap_t newmap; -#ifdef KTR int error = 0; -#endif newmap = _busdma_alloc_dmamap(); if (newmap == NULL) { @@ -365,13 +466,64 @@ bus_dmamap_create(bus_dma_tag_t dmat, in } *mapp = newmap; newmap->dmat = dmat; + newmap->allocbuffer = NULL; dmat->map_count++; + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { + + /* Must bounce */ + struct bounce_zone *bz; + int maxpages; + + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) { + _busdma_free_dmamap(newmap); + *mapp = NULL; + return (error); + } + } + bz = dmat->bounce_zone; + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + maxpages = MAX_BPAGES; + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { + int pages; + + pages = MAX(atop(dmat->maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { + if (error == 0) + dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else { + error = 0; + } + } + bz->map_count++; + } + + if (flags & BUS_DMA_COHERENT) + newmap->flags |= DMAMAP_COHERENT; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, error); return (0); - } /* @@ -381,7 +533,15 @@ bus_dmamap_create(bus_dma_tag_t dmat, in int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { + _busdma_free_dmamap(map); + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); @@ -416,9 +576,16 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi dmat->map_count++; *mapp = newmap; newmap->dmat = dmat; + + if (flags & BUS_DMA_COHERENT) + newmap->flags |= DMAMAP_COHERENT; - if (dmat->maxsize <= PAGE_SIZE) { + if (dmat->maxsize <= PAGE_SIZE && + (dmat->alignment < dmat->maxsize) && + !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr) && + !(flags & BUS_DMA_COHERENT)) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); + newmap->flags |= DMAMAP_MALLOCUSED; } else { /* * XXX Use Contigmalloc until it is merged into this facility @@ -440,7 +607,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi maxphys = dmat->lowaddr; } *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, - 0ul, maxphys, dmat->alignment? dmat->alignment : 1ul, + 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, dmat->boundary); } if (*vaddr == NULL) { @@ -451,6 +618,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi *mapp = NULL; return (ENOMEM); } + if (flags & BUS_DMA_COHERENT) { void *tmpaddr = (void *)*vaddr; @@ -463,10 +631,10 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi *vaddr = tmpaddr; } else newmap->origbuffer = newmap->allocbuffer = NULL; - } else + } else newmap->origbuffer = newmap->allocbuffer = NULL; - return (0); + return (0); } /* @@ -481,15 +649,69 @@ bus_dmamem_free(bus_dma_tag_t dmat, void ("Trying to freeing the wrong DMA buffer")); vaddr = map->origbuffer; } - if (dmat->maxsize <= PAGE_SIZE) + + if (map->flags & DMAMAP_MALLOCUSED) free(vaddr, M_DEVBUF); - else { + else contigfree(vaddr, dmat->maxsize, M_DEVBUF); - } + dmat->map_count--; _busdma_free_dmamap(map); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); +} +static int +_bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, + void *buf, bus_size_t buflen, int flags) +{ + vm_offset_t vaddr; + vm_offset_t vendaddr; + bus_addr_t paddr; + + if ((map->pagesneeded == 0)) { + CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", + dmat->lowaddr, dmat->boundary, dmat->alignment); + CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", + map, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = trunc_page((vm_offset_t)buf); + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + KASSERT(kernel_pmap == pmap, ("pmap is not kernel pmap")); + paddr = pmap_kextract(vaddr); + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + run_filter(dmat, paddr) != 0) + map->pagesneeded++; + vaddr += PAGE_SIZE; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } + + /* Reserve Necessary Bounce Pages */ + if (map->pagesneeded != 0) { + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, + map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + } + + return (0); } /* @@ -504,8 +726,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma int flags, vm_offset_t *lastaddrp, int *segp) { bus_size_t sgsize; - bus_size_t bmask; - vm_offset_t curaddr, lastaddr; + bus_addr_t curaddr, lastaddr, baddr, bmask; vm_offset_t vaddr = (vm_offset_t)buf; int seg; int error = 0; @@ -513,36 +734,48 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); + if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) { + error = _bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, + flags); + if (error) + return (error); + } + CTR3(KTR_BUSDMA, "lowaddr= %d boundary= %d, " + "alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); + for (seg = *segp; buflen > 0 ; ) { /* * Get the physical address for this segment. + * + * XXX Don't support checking for coherent mappings + * XXX in user address space. */ KASSERT(kernel_pmap == pmap, ("pmap is not kernel pmap")); curaddr = pmap_kextract(vaddr); /* - * If we're beyond the current DMA window, indicate - * that and try to fall back onto something else. - */ - if (curaddr < dmat->_physbase || - curaddr >= (dmat->_physbase + dmat->_wsize)) - return (EINVAL); - - /* - * In a valid DMA range. Translate the physical - * memory address to an address in the DMA window. - */ - curaddr = (curaddr - dmat->_physbase) + dmat->_wbase; - - - /* * Compute the segment size, and adjust counts. */ sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); + if (sgsize > dmat->maxsegsz) + sgsize = dmat->maxsegsz; if (buflen < sgsize) sgsize = buflen; /* + * Make sure we don't cross any boundaries. + */ + if (dmat->boundary > 0) { + baddr = (curaddr + dmat->boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) && + map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } + + /* * Insert chunk into a segment, coalescing with * the previous segment if possible. */ @@ -574,9 +807,8 @@ segdone: * Did we fit? */ if (buflen != 0) - error = EFBIG; - - return error; + error = EFBIG; /* XXX better return value here? */ + return (error); } /* @@ -597,14 +829,17 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ KASSERT(dmat != NULL, ("dmatag is NULL")); KASSERT(map != NULL, ("dmamap is NULL")); + map->callback = callback; + map->callback_arg = callback_arg; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_LINEAR|DMAMAP_COHERENT; + map->flags |= DMAMAP_LINEAR; map->buffer = buf; map->len = buflen; error = bus_dmamap_load_buffer(dmat, dm_segments, map, buf, buflen, kernel_pmap, flags, &lastaddr, &nsegs); - + if (error == EINPROGRESS) + return (error); if (error) (*callback)(callback_arg, NULL, 0, error); else @@ -613,8 +848,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, nsegs + 1, error); - return (0); - + return (error); } /* @@ -635,10 +869,9 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, M_ASSERTPKTHDR(m0); map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; + map->flags |= DMAMAP_MBUF; map->buffer = m0; map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { vm_offset_t lastaddr = 0; struct mbuf *m; @@ -676,16 +909,14 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm int flags) { int error = 0; - M_ASSERTPKTHDR(m0); flags |= BUS_DMA_NOWAIT; *nsegs = -1; map->flags &= ~DMAMAP_TYPE_MASK; - map->flags |= DMAMAP_MBUF | DMAMAP_COHERENT; - map->buffer = m0; + map->flags |= DMAMAP_MBUF; + map->buffer = m0; map->len = 0; - if (m0->m_pkthdr.len <= dmat->maxsize) { vm_offset_t lastaddr = 0; struct mbuf *m; @@ -693,8 +924,9 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = bus_dmamap_load_buffer(dmat, segs, map, - m->m_data, m->m_len, - kernel_pmap, flags, &lastaddr, nsegs); + m->m_data, m->m_len, + kernel_pmap, flags, &lastaddr, + nsegs); map->len += m->m_len; } } @@ -702,12 +934,11 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm error = EINVAL; } + /* XXX FIXME: Having to increment nsegs is really annoying */ ++*nsegs; CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", __func__, dmat, dmat->flags, error, *nsegs); - return (error); - } /* @@ -718,9 +949,65 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { + vm_offset_t lastaddr = 0; +#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT + bus_dma_segment_t dm_segments[dmat->nsegments]; +#else + bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; +#endif + int nsegs, i, error; + bus_size_t resid; + struct iovec *iov; + struct pmap *pmap; - panic("Unimplemented %s at %s:%d\n", __func__, __FILE__, __LINE__); - return (0); + resid = uio->uio_resid; + iov = uio->uio_iov; + map->flags &= ~DMAMAP_TYPE_MASK; + map->flags |= DMAMAP_UIO; + map->buffer = uio; + map->len = 0; + + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("bus_dmamap_load_uio: USERSPACE but no proc")); + /* XXX: pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); */ + panic("can't do it yet"); + } else + pmap = kernel_pmap; + + error = 0; + nsegs = -1; + for (i = 0; i < uio->uio_iovcnt && resid != 0 && !error; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + bus_size_t minlen = + resid < iov[i].iov_len ? resid : iov[i].iov_len; + caddr_t addr = (caddr_t) iov[i].iov_base; + + if (minlen > 0) { + error = bus_dmamap_load_buffer(dmat, dm_segments, map, + addr, minlen, pmap, flags, &lastaddr, &nsegs); + + map->len += minlen; + resid -= minlen; + } + } + + if (error) { + /* + * force "no valid mappings" on error in callback. + */ + (*callback)(callback_arg, dm_segments, 0, 0, error); + } else { + (*callback)(callback_arg, dm_segments, nsegs+1, + uio->uio_resid, error); + } + + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); + return (error); } /* @@ -729,25 +1016,78 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, void _bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map) { + struct bounce_page *bpage; + map->flags &= ~DMAMAP_TYPE_MASK; + while ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) { + STAILQ_REMOVE_HEAD(&map->bpages, links); + free_bounce_page(dmat, bpage); + } return; } -static __inline void +static void bus_dmamap_sync_buf(void *buf, int len, bus_dmasync_op_t op) { + char tmp_cl[mips_pdcache_linesize], tmp_clend[mips_pdcache_linesize]; + vm_offset_t buf_cl, buf_clend; + vm_size_t size_cl, size_clend; + int cache_linesize_mask = mips_pdcache_linesize - 1; + + /* + * dcache invalidation operates on cache line aligned addresses + * and could modify areas of memory that share the same cache line + * at the beginning and the ending of the buffer. In order to + * prevent a data loss we save these chunks in temporary buffer + * before invalidation and restore them afer it + */ + buf_cl = (vm_offset_t)buf & ~cache_linesize_mask; + size_cl = (vm_offset_t)buf & cache_linesize_mask; + buf_clend = (vm_offset_t)buf + len; + size_clend = (mips_pdcache_linesize - + (buf_clend & cache_linesize_mask)) & cache_linesize_mask; switch (op) { + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: + case BUS_DMASYNC_POSTREAD: + + /* + * Save buffers that might be modified by invalidation + */ + if (size_cl) + memcpy (tmp_cl, (void*)buf_cl, size_cl); + if (size_clend) + memcpy (tmp_clend, (void*)buf_clend, size_clend); + mips_dcache_inv_range((vm_offset_t)buf, len); + /* + * Restore them + */ + if (size_cl) + memcpy ((void*)buf_cl, tmp_cl, size_cl); + if (size_clend) + memcpy ((void*)buf_clend, tmp_clend, size_clend); + break; + case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE: mips_dcache_wbinv_range((vm_offset_t)buf, len); break; case BUS_DMASYNC_PREREAD: -#if 1 - mips_dcache_wbinv_range((vm_offset_t)buf, len); -#else + /* + * Save buffers that might be modified by invalidation + */ + if (size_cl) + memcpy (tmp_cl, (void *)buf_cl, size_cl); + if (size_clend) + memcpy (tmp_clend, (void *)buf_clend, size_clend); mips_dcache_inv_range((vm_offset_t)buf, len); -#endif + /* + * Restore them + */ + if (size_cl) + memcpy ((void *)buf_cl, tmp_cl, size_cl); + if (size_clend) + memcpy ((void *)buf_clend, tmp_clend, size_clend); break; case BUS_DMASYNC_PREWRITE: @@ -756,6 +1096,51 @@ bus_dmamap_sync_buf(void *buf, int len, } } +static void +_bus_dmamap_sync_bp(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) +{ + struct bounce_page *bpage; + + STAILQ_FOREACH(bpage, &map->bpages, links) { + if (op & BUS_DMASYNC_PREWRITE) { + bcopy((void *)bpage->datavaddr, + (void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + bpage->datacount); + if (bpage->vaddr_nocache == 0) { + mips_dcache_wb_range(bpage->vaddr, + bpage->datacount); + } + dmat->bounce_zone->total_bounced++; + } + if (op & BUS_DMASYNC_POSTREAD) { + if (bpage->vaddr_nocache == 0) { + mips_dcache_inv_range(bpage->vaddr, + bpage->datacount); + } + bcopy((void *)(bpage->vaddr_nocache != 0 ? + bpage->vaddr_nocache : bpage->vaddr), + (void *)bpage->datavaddr, bpage->datacount); + dmat->bounce_zone->total_bounced++; + } + } +} + +static __inline int +_bus_dma_buf_is_in_bp(bus_dmamap_t map, void *buf, int len) +{ + struct bounce_page *bpage; + + STAILQ_FOREACH(bpage, &map->bpages, links) { + if ((vm_offset_t)buf >= bpage->datavaddr && + (vm_offset_t)buf + len <= bpage->datavaddr + + bpage->datacount) + return (1); + } + return (0); + +} + void _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) { @@ -764,51 +1149,23 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus int resid; struct iovec *iov; - - /* - * Mixing PRE and POST operations is not allowed. - */ - if ((op & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 && - (op & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0) - panic("_bus_dmamap_sync: mix PRE and POST"); - - /* - * Since we're dealing with a virtually-indexed, write-back - * cache, we need to do the following things: - * - * PREREAD -- Invalidate D-cache. Note we might have - * to also write-back here if we have to use an Index - * op, or if the buffer start/end is not cache-line aligned. - * - * PREWRITE -- Write-back the D-cache. If we have to use - * an Index op, we also have to invalidate. Note that if - * we are doing PREREAD|PREWRITE, we can collapse everything *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 21:00:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 584A91065694; Sun, 10 Jan 2010 21:00:53 +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 494508FC28; Sun, 10 Jan 2010 21:00: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 o0AL0r8t039800; Sun, 10 Jan 2010 21:00:53 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AL0r3N039797; Sun, 10 Jan 2010 21:00:53 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001102100.o0AL0r3N039797@svn.freebsd.org> From: Alan Cox Date: Sun, 10 Jan 2010 21:00: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: r202047 - in head/sys: amd64/amd64 i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 21:00:53 -0000 Author: alc Date: Sun Jan 10 21:00:52 2010 New Revision: 202047 URL: http://svn.freebsd.org/changeset/base/202047 Log: Eliminate unused declarations. Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/i386/xen/xen_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Jan 10 20:29:20 2010 (r202046) +++ head/sys/amd64/amd64/mp_machdep.c Sun Jan 10 21:00:52 2010 (r202047) @@ -98,12 +98,6 @@ char *doublefault_stack; char *nmi_stack; void *dpcpu; -/* Hotwire a 0->4MB V==P mapping */ -extern pt_entry_t *KPTphys; - -/* SMP page table page */ -extern pt_entry_t *SMPpt; - struct pcb stoppcbs[MAXCPU]; struct xpcb **stopxpcbs = NULL; Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Sun Jan 10 20:29:20 2010 (r202046) +++ head/sys/i386/xen/xen_machdep.c Sun Jan 10 21:00:52 2010 (r202047) @@ -715,9 +715,6 @@ xen_destroy_contiguous_region(void *addr balloon_unlock(flags); } -extern unsigned long cpu0prvpage; -extern unsigned long *SMPpt; -extern struct user *proc0uarea; extern vm_offset_t proc0kstack; extern int vm86paddr, vm86phystk; char *bootmem_start, *bootmem_current, *bootmem_end; From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 21:25:51 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649B3106566B; Sun, 10 Jan 2010 21:25:51 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 96EB38FC17; Sun, 10 Jan 2010 21:25:50 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0ALPnPB047475; Mon, 11 Jan 2010 00:25:49 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263158749; bh=AMUw04gd551RrKYslYeylXGMNVf2rYs9i8bLHzoqd7k=; l=984; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=F4e8VIqUgug0cUbTpBV87k86owrjSfJzg5WlQjtfU2oiEJUcK/lDQ080AYmpjOcaY J1wyRnn/GfbnJvMjbXSHFNVkX1zcJ9pcLQKp19I8oAUdhfH47tWLQmWgc9rAyV47tu 4G5AmMoNVDmzBzSEhvsyIWfd4sS4fSyTXm9aXOO8= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0ALPmbB047474; Mon, 11 Jan 2010 00:25:49 +0300 (MSK) (envelope-from ache) Date: Mon, 11 Jan 2010 00:25:48 +0300 From: Andrey Chernov To: Colin Percival Message-ID: <20100110212548.GA47331@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Colin Percival , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201001101430.o0AEUURS051917@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001101430.o0AEUURS051917@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 21:25:51 -0000 On Sun, Jan 10, 2010 at 02:30:30PM +0000, Colin Percival wrote: > + * Check for integer overflow. As an optimization, first check that > + * at least one of {count, size} is at least 2^16, since if both > + * values are less than that, their product can't possible overflow > + * (size_t is always at least 32 bits on FreeBSD). > + */ > + if (((count | size) > 0xFFFF) && > + (count > SIZE_MAX / size)) { > + errno = EINVAL; > + fp->_flags |= __SERR; > + return (0); > + } 1) I don't think that this is good place of exact constants like 0xFFFF, usually we don't use such things in overflow checks (see all other ones). fread/fwrite are already slow as designed, so optimizing one time argument check looks strange. 2) fp->_flags |= __SERR; This flag is for errors in the file stream, not for errors in the arguments. Please back that line out. 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 21:41:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9821106566C; Sun, 10 Jan 2010 21:41:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99A478FC0C; Sun, 10 Jan 2010 21:41: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 o0ALfbdN048934; Sun, 10 Jan 2010 21:41:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ALfbhR048931; Sun, 10 Jan 2010 21:41:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001102141.o0ALfbhR048931@svn.freebsd.org> From: Ed Schouten Date: Sun, 10 Jan 2010 21:41: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: r202048 - in head: etc share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 21:41:37 -0000 Author: ed Date: Sun Jan 10 21:41:37 2010 New Revision: 202048 URL: http://svn.freebsd.org/changeset/base/202048 Log: Properly make the end key work again for TERM=xterm. I've been so busy hacking on utmpx the last couple of days, out of reflex, I committed it to the wrong source tree. Note to myself: don't hack on FreeBSD while watching TV at the same time. PR: conf/142578 Submitted by: Yuri Pankov Reminded by: stefanf Modified: head/etc/termcap.small head/share/termcap/termcap.src Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Sun Jan 10 21:00:52 2010 (r202047) +++ head/etc/termcap.small Sun Jan 10 21:41:37 2010 (r202048) @@ -294,9 +294,9 @@ pc3|ibmpc3|IBM PC 386BSD Console:\ # $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $ # xterm-new|modern xterm:\ - :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ + :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\ :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ :tc=xterm-basic: # Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sun Jan 10 21:00:52 2010 (r202047) +++ head/share/termcap/termcap.src Sun Jan 10 21:41:37 2010 (r202048) @@ -2807,9 +2807,9 @@ xterm-clear:\ :te=\E[?1049l:ti=\E[?1049h:\ :tc=xterm-new: xterm-new|modern xterm:\ - :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ + :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ - :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\ :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ :tc=xterm-basic: # From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 21:59:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C0B11065672; Sun, 10 Jan 2010 21:59:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9408FC12; Sun, 10 Jan 2010 21:59: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 o0ALx6PW052801; Sun, 10 Jan 2010 21:59:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ALx6EH052799; Sun, 10 Jan 2010 21:59:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001102159.o0ALx6EH052799@svn.freebsd.org> From: Ed Schouten Date: Sun, 10 Jan 2010 21:59: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: r202049 - head/usr.bin/lastcomm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 21:59:07 -0000 Author: ed Date: Sun Jan 10 21:59:06 2010 New Revision: 202049 URL: http://svn.freebsd.org/changeset/base/202049 Log: Let lastcomm(1) build without . Use MAXLOGNAME - 1 instead of UTNAMESIZE. There is no definition for TTY name sizes, at least not as low as 8, so hardcode it for now. Modified: head/usr.bin/lastcomm/lastcomm.c Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Sun Jan 10 21:41:37 2010 (r202048) +++ head/usr.bin/lastcomm/lastcomm.c Sun Jan 10 21:59:06 2010 (r202049) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "pathnames.h" /*XXX*/#include @@ -154,11 +153,11 @@ main(int argc, char *argv[]) if (*argv && !requested(argv, &ab)) continue; - (void)printf("%-*.*s %-7s %-*s %-*s", + (void)printf("%-*.*s %-7s %-*s %-8s", AC_COMM_LEN, AC_COMM_LEN, ab.ac_comm, flagbits(ab.ac_flagx), - UT_NAMESIZE, user_from_uid(ab.ac_uid, 0), - UT_LINESIZE, getdev(ab.ac_tty)); + MAXLOGNAME - 1, user_from_uid(ab.ac_uid, 0), + getdev(ab.ac_tty)); /* user + system time */ From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 22:19:17 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C37081065695 for ; Sun, 10 Jan 2010 22:19:17 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 4567214E3A9 for ; Sun, 10 Jan 2010 22:18:59 +0000 (UTC) Received: (qmail 19135 invoked from network); 10 Jan 2010 22:18:58 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2010 22:18:58 -0000 Message-ID: <4B4A5252.9070205@freebsd.org> Date: Sun, 10 Jan 2010 14:18:58 -0800 From: Colin Percival User-Agent: Thunderbird 2.0.0.23 (X11/20091215) MIME-Version: 1.0 To: Andrey Chernov , Colin Percival , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> In-Reply-To: <20100110212548.GA47331@nagual.pp.ru> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 22:19:17 -0000 Andrey Chernov wrote: > On Sun, Jan 10, 2010 at 02:30:30PM +0000, Colin Percival wrote: >> + if (((count | size) > 0xFFFF) && >> + (count > SIZE_MAX / size)) { >> + errno = EINVAL; >> + fp->_flags |= __SERR; >> + return (0); >> + } > > 1) I don't think that this is good place of exact constants like 0xFFFF, > usually we don't use such things in overflow checks (see all other ones). > fread/fwrite are already slow as designed, so optimizing one time argument > check looks strange. On my laptop, this optimization speeds up 1-byte fwrite calls by 27% compared to always doing the division. You can argue that people who care about code performance shouldn't be making millions of 1-byte fwrite calls, but I think it's a simple enough optimization and has enough of an impact to be worthwhile. > 2) fp->_flags |= __SERR; > This flag is for errors in the file stream, not for errors in > the arguments. Please back that line out. Quoting fread(3): The function fread() does not distinguish between end-of-file and error, and callers must use feof(3) and ferror(3) to determine which occurred. This would seem to imply that for any failed request, either feof or ferror should return a non-zero value. Removing this line would break the common while (fread(ptr, reclen, 1, f) == 1) { /* Do stuff here. */ } if (ferror(f)) { /* Die due to read error */ } /* No error? Ok, we must have hit EOF */ idiom. > 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. I picked EINVAL because this is the code used by read(2) and write(2) if they are passed nbytes > INT_MAX. It would seem odd to use one error code for a number of bytes between INT_MAX and SIZE_MAX and then switch to a different error code for > SIZE_MAX bytes. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 22:34:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 742731065670; Sun, 10 Jan 2010 22:34:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A5768FC1B; Sun, 10 Jan 2010 22:34: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 o0AMYJ41060573; Sun, 10 Jan 2010 22:34:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AMYJ8I060570; Sun, 10 Jan 2010 22:34:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001102234.o0AMYJ8I060570@svn.freebsd.org> From: Warner Losh Date: Sun, 10 Jan 2010 22:34: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: r202050 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 22:34:19 -0000 Author: imp Date: Sun Jan 10 22:34:18 2010 New Revision: 202050 URL: http://svn.freebsd.org/changeset/base/202050 Log: Merge change r198561 from projects/mips to head: r198561 | thompsa | 2009-10-28 15:25:22 -0600 (Wed, 28 Oct 2009) | 4 lines Allow a scratch buffer to be set in order to be able to use setenv() while booting, before dynamic kenv is running. A few platforms implement their own scratch+sprintf handling to save data from the boot environment. Modified: head/sys/kern/kern_environment.c head/sys/sys/systm.h Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Sun Jan 10 21:59:06 2010 (r202049) +++ head/sys/kern/kern_environment.c Sun Jan 10 22:34:18 2010 (r202050) @@ -60,6 +60,8 @@ static MALLOC_DEFINE(M_KENV, "kenv", "ke /* pointer to the static environment */ char *kern_envp; +static int env_len; +static int env_pos; static char *kernenv_next(char *); /* dynamic environment variables */ @@ -208,6 +210,14 @@ done: return (error); } +void +init_static_kenv(char *buf, size_t len) +{ + kern_envp = buf; + env_len = len; + env_pos = 0; +} + /* * Setup the dynamic kernel environment. */ @@ -336,6 +346,26 @@ testenv(const char *name) return (0); } +static int +setenv_static(const char *name, const char *value) +{ + int len; + + if (env_pos >= env_len) + return (-1); + + /* Check space for x=y and two nuls */ + len = strlen(name) + strlen(value); + if (len + 3 < env_len - env_pos) { + len = sprintf(&kern_envp[env_pos], "%s=%s", name, value); + env_pos += len+1; + kern_envp[env_pos] = '\0'; + return (0); + } else + return (-1); + +} + /* * Set an environment variable by name. */ @@ -345,6 +375,9 @@ setenv(const char *name, const char *val char *buf, *cp, *oldenv; int namelen, vallen, i; + if (dynamic_kenv == 0 && env_len > 0) + return (setenv_static(name, value)); + KENV_CHECK; namelen = strlen(name) + 1; Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Jan 10 21:59:06 2010 (r202049) +++ head/sys/sys/systm.h Sun Jan 10 22:34:18 2010 (r202050) @@ -164,6 +164,7 @@ void critical_exit(void); void init_param1(void); void init_param2(long physpages); void init_param3(long kmempages); +void init_static_kenv(char *, size_t); void tablefull(const char *); int kvprintf(char const *, void (*)(int, void*), void *, int, __va_list) __printflike(1, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 23:06:20 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 497F2106566B; Sun, 10 Jan 2010 23:06:20 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA848FC14; Sun, 10 Jan 2010 23:06:20 +0000 (UTC) Received: from toad.stack.nl (toad.stack.nl [IPv6:2001:610:1108:5010::135]) by mx1.stack.nl (Postfix) with ESMTP id EC08B359958; Mon, 11 Jan 2010 00:06:18 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id E150973F9D; Mon, 11 Jan 2010 00:06:18 +0100 (CET) Date: Mon, 11 Jan 2010 00:06:18 +0100 From: Jilles Tjoelker To: Colin Percival Message-ID: <20100110230618.GA6756@stack.nl> References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B4A5252.9070205@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@FreeBSD.ORG, Andrey Chernov , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 23:06:20 -0000 On Sun, Jan 10, 2010 at 02:18:58PM -0800, Colin Percival wrote: > Andrey Chernov wrote: > > On Sun, Jan 10, 2010 at 02:30:30PM +0000, Colin Percival wrote: > >> + if (((count | size) > 0xFFFF) && > >> + (count > SIZE_MAX / size)) { > >> + errno = EINVAL; > >> + fp->_flags |= __SERR; > >> + return (0); > >> + } > > 2) fp->_flags |= __SERR; > > This flag is for errors in the file stream, not for errors in > > the arguments. Please back that line out. > Quoting fread(3): > The function fread() does not distinguish between end-of-file and error, > and callers must use feof(3) and ferror(3) to determine which occurred. > This would seem to imply that for any failed request, either feof or ferror > should return a non-zero value. Removing this line would break the common > while (fread(ptr, reclen, 1, f) == 1) { > /* Do stuff here. */ > } > if (ferror(f)) { > /* Die due to read error */ > } > /* No error? Ok, we must have hit EOF */ > idiom. Agreed, this error should set the error indicator. > > 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. > I picked EINVAL because this is the code used by read(2) and write(2) if they > are passed nbytes > INT_MAX. It would seem odd to use one error code for a > number of bytes between INT_MAX and SIZE_MAX and then switch to a different > error code for > SIZE_MAX bytes. I think the fact that you can only read(2)/write(2) INT_MAX at a time is a bug, so basing additional code on it seems inappropriate. Even then, fread()/fwrite() will not generate such large read(2)/write(2) requests as they always go through the buffer which is filled using smaller requests. Also, EOVERFLOW will give a more understandable error message for users. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sun Jan 10 23:21:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A80F106566C; Sun, 10 Jan 2010 23:21:41 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 76A008FC12; Sun, 10 Jan 2010 23:21:40 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0ANLcKs048314; Mon, 11 Jan 2010 02:21:38 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263165698; bh=xwQWj0zqgZJ3YRlhbuxvZEFg58Cu+FeNGbNngIS5lXY=; l=844; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=I3N2BqolWHvKhTvH/3mvh+T648qZkeIclwsS7DvOesaPWnkCGJZ201rPa6a+yssZ+ T+vnvJscCkE3Xh+ODxFDb3e1kN/J2pFUzXDXwSZ0migFkgeGJe7UPJAf7Uzq94KTHd EHMQjNz3XTmDwFQI3bKRB7w3svcthYsnDS2MgyFU= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0ANLbDQ048313; Mon, 11 Jan 2010 02:21:38 +0300 (MSK) (envelope-from ache) Date: Mon, 11 Jan 2010 02:21:35 +0300 From: Andrey Chernov To: Jilles Tjoelker Message-ID: <20100110232134.GA48128@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Jilles Tjoelker , Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> <20100110230618.GA6756@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100110230618.GA6756@stack.nl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 23:21:41 -0000 On Mon, Jan 11, 2010 at 12:06:18AM +0100, Jilles Tjoelker wrote: > > I picked EINVAL because this is the code used by read(2) and write(2) if they > > are passed nbytes > INT_MAX. It would seem odd to use one error code for a > > number of bytes between INT_MAX and SIZE_MAX and then switch to a different > > error code for > SIZE_MAX bytes. > > I think the fact that you can only read(2)/write(2) INT_MAX at a time is > a bug, so basing additional code on it seems inappropriate. > > Even then, fread()/fwrite() will not generate such large > read(2)/write(2) requests as they always go through the buffer which is > filled using smaller requests. > > Also, EOVERFLOW will give a more understandable error message for users. Agreed. F.e. POSIX limit for write(2) is {SSIZE_MAX}, not INT_MAX. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 00:18:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C1C8106566B; Mon, 11 Jan 2010 00:18:41 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42B928FC0A; Mon, 11 Jan 2010 00:18: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 o0B0Ifam086274; Mon, 11 Jan 2010 00:18:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B0IfGr086271; Mon, 11 Jan 2010 00:18:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001110018.o0B0IfGr086271@svn.freebsd.org> From: Andrew Thompson Date: Mon, 11 Jan 2010 00:18: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: r202054 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 00:18:41 -0000 Author: thompsa Date: Mon Jan 11 00:18:40 2010 New Revision: 202054 URL: http://svn.freebsd.org/changeset/base/202054 Log: Add the Globetrotter GE40x. Submitted by: Mike Tancsa Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jan 11 00:11:16 2010 (r202053) +++ head/sys/dev/usb/serial/u3g.c Mon Jan 11 00:18:40 2010 (r202054) @@ -316,6 +316,7 @@ static const struct usb_device_id u3g_de U3G_DEV(OPTION, E7041, 0), U3G_DEV(OPTION, E7061, 0), U3G_DEV(OPTION, E7100, 0), + U3G_DEV(OPTION, GE40X, 0), U3G_DEV(OPTION, GT3G, 0), U3G_DEV(OPTION, GT3GPLUS, 0), U3G_DEV(OPTION, GT3GQUAD, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jan 11 00:11:16 2010 (r202053) +++ head/sys/dev/usb/usbdevs Mon Jan 11 00:18:40 2010 (r202054) @@ -2099,6 +2099,7 @@ product OPTION E7041 0x7041 3G modem product OPTION E7061 0x7061 3G modem product OPTION E7100 0x7100 3G modem product OPTION GTM380 0x7201 3G modem +product OPTION GE40X 0x7601 Globetrotter HSUPA /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 00:40:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 071101065672; Mon, 11 Jan 2010 00:40:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E99F68FC0C; Mon, 11 Jan 2010 00:40: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 o0B0eJwS091554; Mon, 11 Jan 2010 00:40:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B0eJ2c091552; Mon, 11 Jan 2010 00:40:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110040.o0B0eJ2c091552@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 00:40: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: r202056 - in head/sys/dev/siba: . siba X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 00:40:20 -0000 Author: imp Date: Mon Jan 11 00:40:19 2010 New Revision: 202056 URL: http://svn.freebsd.org/changeset/base/202056 Log: Move this to the right location. Grump. Added: - copied unchanged from r202055, head/sys/dev/siba/siba/siba_cc.c Directory Properties: head/sys/dev/siba/siba_cc.c (props changed) Deleted: head/sys/dev/siba/siba/siba_cc.c Copied: head/sys/dev/siba/siba_cc.c (from r202055, head/sys/dev/siba/siba/siba_cc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/siba/siba_cc.c Mon Jan 11 00:40:19 2010 (r202056, copy of r202055, head/sys/dev/siba/siba/siba_cc.c) @@ -0,0 +1,154 @@ +/*- + * Copyright (c) 2007 Bruce M. Simpson. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Child driver for ChipCommon core. + * This is not MI code at the moment. + * Two 16C550 compatible UARTs live here. On the WGT634U, uart1 is the + * system console, and uart0 is not pinned out. + * Because their presence is conditional, they should probably + * be attached from here. + * GPIO lives here. + * The hardware watchdog lives here. + * Clock control registers live here. + * You don't need to read them to determine the clock speed on the 5365, + * which is always 200MHz and thus may be hardcoded (for now). + * Flash config registers live here. There may or may not be system flash. + * The external interface bus lives here (conditionally). + * There is a JTAG interface here which may be used to attach probes to + * the SoC for debugging. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +static int siba_cc_attach(device_t); +static int siba_cc_probe(device_t); +static void siba_cc_intr(void *v); + +static int +siba_cc_probe(device_t dev) +{ + + if (siba_get_vendor(dev) == SIBA_VID_BROADCOM && + siba_get_device(dev) == SIBA_DEVID_CHIPCOMMON) { + device_set_desc(dev, "ChipCommon core"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +struct siba_cc_softc { + void *notused; +}; + +static int +siba_cc_attach(device_t dev) +{ + //struct siba_cc_softc *sc = device_get_softc(dev); + struct resource *mem; + struct resource *irq; + int rid; + + /* + * Allocate the resources which the parent bus has already + * determined for us. + * TODO: interrupt routing + */ +#define MIPS_MEM_RID 0x20 + rid = MIPS_MEM_RID; + mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (mem == NULL) { + device_printf(dev, "unable to allocate memory\n"); + return (ENXIO); + } + + rid = 0; + irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); + if (irq == NULL) { + device_printf(dev, "unable to allocate irq\n"); + return (ENXIO); + } + + /* now setup the interrupt */ + /* may be fast, exclusive or mpsafe at a later date */ + + /* + * XXX is this interrupt line in ChipCommon used for anything + * other than the uart? in that case we shouldn't hog it ourselves + * and let uart claim it to avoid polled mode. + */ + int err; + void *cookie; + err = bus_setup_intr(dev, irq, INTR_TYPE_TTY, NULL, siba_cc_intr, NULL, + &cookie); + if (err != 0) { + device_printf(dev, "unable to setup intr\n"); + return (ENXIO); + } + + /* TODO: attach uart child */ + + return (0); +} + +static void +siba_cc_intr(void *v) +{ + +} + +static device_method_t siba_cc_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, siba_cc_attach), + DEVMETHOD(device_probe, siba_cc_probe), + + {0, 0}, +}; + +static driver_t siba_cc_driver = { + "siba_cc", + siba_cc_methods, + sizeof(struct siba_softc), +}; +static devclass_t siba_cc_devclass; + +DRIVER_MODULE(siba_cc, siba, siba_cc_driver, siba_cc_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 00:41:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 017B5106566B; Mon, 11 Jan 2010 00:41:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC1498FC0C; Mon, 11 Jan 2010 00:41: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 o0B0fEA5091794; Mon, 11 Jan 2010 00:41:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B0fEUK091793; Mon, 11 Jan 2010 00:41:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110041.o0B0fEUK091793@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 00:41: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: r202057 - head/sys/dev/siba/siba X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 00:41:15 -0000 Author: imp Date: Mon Jan 11 00:41:14 2010 New Revision: 202057 URL: http://svn.freebsd.org/changeset/base/202057 Log: This was somehow copied to the wrong place :(. Remove the spare copy. Deleted: head/sys/dev/siba/siba/ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 02:16:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36EA910656F1 for ; Mon, 11 Jan 2010 02:16:34 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.freebsd.org (Postfix) with ESMTP id 68AF68FC22 for ; Mon, 11 Jan 2010 02:16:33 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-066-024-221.pools.arcor-ip.net [88.66.24.221]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M1CM0-1NjTip3xrU-00t34N; Mon, 11 Jan 2010 03:16:32 +0100 Received: (qmail 52355 invoked from network); 11 Jan 2010 02:16:31 -0000 Received: from f8x64.laiers.local (192.168.4.188) by laiers.local with SMTP; 11 Jan 2010 02:16:31 -0000 From: Max Laier Organization: FreeBSD To: David Schultz Date: Mon, 11 Jan 2010 03:16:29 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-RELEASE; KDE/4.3.4; amd64; ; ) References: <200910041943.n94JhaDg083487@svn.freebsd.org> In-Reply-To: <200910041943.n94JhaDg083487@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201001110316.29816.max@love2party.net> X-Provags-ID: V01U2FsdGVkX186MxosZZyoSsXkVkJ1iE45mC9+GblZdp90ouL XLBTNcmKWNuKfIoEifMtR89C/9tY6aLlizYUclY+qVx4iSsqP8 66ystB4qGc+yoQ/d1ILSQ== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197752 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 02:16:34 -0000 On Sunday 04 October 2009 21:43:36 David Schultz wrote: > Author: das > Date: Sun Oct 4 19:43:36 2009 > New Revision: 197752 > URL: http://svn.freebsd.org/changeset/base/197752 > > Log: > Better glibc compatibility for getline/getdelim: > > - Tolerate applications that pass a NULL pointer for the buffer and > claim that the capacity of the buffer is nonzero. > > - If an application passes in a non-NULL buffer pointer and claims the > buffer has zero capacity, we should free (well, realloc) it > anyway. It could have been obtained from malloc(0), so failing to > free it would be a small memory leak. > > MFC After: 2 weeks > Reported by: naddy > PR: ports/138320 > > Modified: > head/lib/libc/stdio/getdelim.c > > Modified: head/lib/libc/stdio/getdelim.c > =========================================================================== > === --- head/lib/libc/stdio/getdelim.c Sun Oct 4 19:03:32 2009 (r197751) > +++ head/lib/libc/stdio/getdelim.c Sun Oct 4 19:43:36 2009 (r197752) @@ > -120,8 +120,8 @@ getdelim(char ** __restrict linep, size_ > goto error; > } > > - if (*linecapp == 0) > - *linep = NULL; > + if (*linep == NULL) > + *linecapp = 0; > > if (fp->_r <= 0 && __srefill(fp)) { > /* If fp is at EOF already, we just need space for the NUL. */ I think we should have kept the original if case here, as well. Otherwise something like this might fail: char *line; /* note uninitialized */ size_t len = 0; getline(&line, &len, fd); and I think it is a reasonable thing to pass in an uninitialized pointer if you tell that there is no space associated with it, yet. I don't know if there are many (ab)uses of getline like this, but I was just bitten by it. -- Max From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 03:00:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BFB21065670; Mon, 11 Jan 2010 03:00:17 +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 7A8F48FC14; Mon, 11 Jan 2010 03:00: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 o0B30HC6026693; Mon, 11 Jan 2010 03:00:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B30Hrl026688; Mon, 11 Jan 2010 03:00:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001110300.o0B30Hrl026688@svn.freebsd.org> From: Xin LI Date: Mon, 11 Jan 2010 03:00:17 +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: r202060 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 03:00:18 -0000 Author: delphij Date: Mon Jan 11 03:00:17 2010 New Revision: 202060 URL: http://svn.freebsd.org/changeset/base/202060 Log: Add a new option, -q howmany, which when used in conjuction with -w, exits netstat after _howmany_ outputs. Requested by: thomasa Reviewed by: freebsd-net (bms, old version in early 2007) MFC after: 1 month Modified: head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Mon Jan 11 02:31:00 2010 (r202059) +++ head/usr.bin/netstat/if.c Mon Jan 11 03:00:17 2010 (r202060) @@ -679,6 +679,8 @@ loop: if (!first) putchar('\n'); fflush(stdout); + if ((noutputs != 0) && (--noutputs == 0)) + exit(0); oldmask = sigblock(sigmask(SIGALRM)); while (!signalled) sigpause(0); Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon Jan 11 02:31:00 2010 (r202059) +++ head/usr.bin/netstat/main.c Mon Jan 11 03:00:17 2010 (r202060) @@ -334,6 +334,7 @@ int hflag; /* show counters in human re int iflag; /* show interfaces */ int Lflag; /* show size of listen queues */ int mflag; /* show memory stats */ +int noutputs = 0; /* how much outputs before we exit */ int numeric_addr; /* show addresses numerically */ int numeric_port; /* show ports numerically */ static int pflag; /* show given protocol */ @@ -359,7 +360,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSsuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:q:rSsuWw:xz")) != -1) switch(ch) { case 'A': Aflag = 1; @@ -445,6 +446,11 @@ main(int argc, char *argv[]) } pflag = 1; break; + case 'q': + noutputs = atoi(optarg); + if (noutputs != 0) + noutputs++; + break; case 'r': rflag = 1; break; @@ -779,7 +785,7 @@ usage(void) " [-M core] [-N system]", " netstat -i | -I interface [-abdhnW] [-f address_family]\n" " [-M core] [-N system]", -" netstat -w wait [-I interface] [-d] [-M core] [-N system]", +" netstat -w wait [-I interface] [-d] [-M core] [-N system] [-q howmany]", " netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Mon Jan 11 02:31:00 2010 (r202059) +++ head/usr.bin/netstat/netstat.1 Mon Jan 11 03:00:17 2010 (r202060) @@ -32,7 +32,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd January 10, 2010 .Dt NETSTAT 1 .Os .Sh NAME @@ -133,6 +133,7 @@ is also present, print interface names u .Op Fl d .Op Fl M Ar core .Op Fl N Ar system +.Op Fl q Ar howmany .Ek .Xc At intervals of @@ -143,6 +144,11 @@ traffic on all configured network interf or a single .Ar interface . If +.Fl q +is also present, exit after +.Ar howmany +outputs. +If .Fl d is also present, show the number of dropped packets. .It Xo Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Mon Jan 11 02:31:00 2010 (r202059) +++ head/usr.bin/netstat/netstat.h Mon Jan 11 03:00:17 2010 (r202060) @@ -45,6 +45,7 @@ extern int hflag; /* show counters in hu extern int iflag; /* show interfaces */ extern int Lflag; /* show size of listen queues */ extern int mflag; /* show memory stats */ +extern int noutputs; /* how much outputs before we exit */ extern int numeric_addr; /* show addresses numerically */ extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 03:29:07 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34073106568B; Mon, 11 Jan 2010 03:29:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id C02FE8FC14; Mon, 11 Jan 2010 03:29:06 +0000 (UTC) Received: from besplex.bde.org (c211-30-173-23.carlnfd1.nsw.optusnet.com.au [211.30.173.23]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0B3T3TY014278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 11 Jan 2010 14:29:04 +1100 Date: Mon, 11 Jan 2010 14:29:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival In-Reply-To: <4B4A5252.9070205@freebsd.org> Message-ID: <20100111134429.F1302@besplex.bde.org> References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Andrey Chernov , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 03:29:07 -0000 On Sun, 10 Jan 2010, Colin Percival wrote: > Andrey Chernov wrote: >> On Sun, Jan 10, 2010 at 02:30:30PM +0000, Colin Percival wrote: > ... >> 2) fp->_flags |= __SERR; >> This flag is for errors in the file stream, not for errors in >> the arguments. Please back that line out. I agree. > Quoting fread(3): > The function fread() does not distinguish between end-of-file and error, > and callers must use feof(3) and ferror(3) to determine which occurred. > This would seem to imply that for any failed request, either feof or ferror > should return a non-zero value. Removing this line would break the common It would seem to mean a physical i/o error. > while (fread(ptr, reclen, 1, f) == 1) { > /* Do stuff here. */ > } > if (ferror(f)) { > /* Die due to read error */ > } > /* No error? Ok, we must have hit EOF */ > idiom. Hmm. This case doesn't overflow (reclen * 1 == reclen :-). fread() could be finessed by returning a short read (of 1 with no error) for the silly case. Then only buggy code that doesn't understand short reads would fail. fwrite() hopefully knows that any write of 0 records is an error. But how about the folling from C99 (old draft n869.txt): %%% [#3] The fwrite function returns the number of elements successfully written, which will be less than nmemb only if a write error is encountered. %%% This doesn't allow any error if there was no write error, and again a write error would seem to mean a physical one (if it meant any error it would have said "a fwrite error"). This is unimplementable (except by not returning when nmemb is more than possible). >> 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. There are none. I (we?) intentionally didn't set errno when the correct infinite-precision result would overflow in the printf family. C99 applications wouldn't know to check errno, and buggy ones might be surprised by unexpected (though permitted) clobbering of errno. POSIX didn't have EOVERFLOW when printf was fixed in FreeBSD, and no one has changed printf to set it, and this change risks breaking C99 applications. > I picked EINVAL because this is the code used by read(2) and write(2) if they > are passed nbytes > INT_MAX. It would seem odd to use one error code for a > number of bytes between INT_MAX and SIZE_MAX and then switch to a different > error code for > SIZE_MAX bytes. A bug in FreeBSD read and write (the result is implementation defined, but this misbehaviour isn't a result, so it probably isn't allowed when SSIZE_T == INT_MAX, and it certainly isn't defined when SSIZE_T > INT_MAX (64-bit arches). calloc() has the same overflow bug, if any. Standards seem to require fread and calloc to work even if the multiplication would occur, though they cannot work in most cases where the multiplication would occur, even if the overflow is avoided. Hmm, fread and fwrite can work, though calloc cannot: - fread: when the multiplication would overflow, reduce nmemb to the maximum that prevents overflow. Any more would give an invalid object size. Let the read proceed. If the file is smaller than the actual object size, then the fread will work, the same as if nmemb was reasonable to begin with. Otherwise, undefined behaviour occurs when the buffer overruns, the same as if nmemb is just 1 too large to begin with. There is no reason to guard against overrun for the silly case when it is impossible to guard against overrun for a common off-by-1 case. - fwrite: when the multiplication would overflow, the result of an infinitely precise multiplication is an invalid object size. Writing that many is sure to overrun the buffer. The behaviour is undefined. Reasonable behaviour is an i/o error with EFAULT, just like would happen for attempting to write beyond the end of the buffer, if you are lucky enough for the overrun to reach a page boundary and the next page is unmapped. You might also get SIGSEGV if the buffer is accessed in userland. - calloc: like fwrite. The object size is invalid so the behaviour is undefined. Could EFAULT/SIGSEGV or just return NULL. I sent private mail about parts of this and more. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 03:43:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D0BB106566C; Mon, 11 Jan 2010 03:43:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0237E8FC08; Mon, 11 Jan 2010 03:43: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 o0B3hIdc037557; Mon, 11 Jan 2010 03:43:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B3hIq7037555; Mon, 11 Jan 2010 03:43:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110343.o0B3hIq7037555@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 03:43: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: r202061 - head/sys/dev/cfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 03:43:19 -0000 Author: imp Date: Mon Jan 11 03:43:18 2010 New Revision: 202061 URL: http://svn.freebsd.org/changeset/base/202061 Log: Merge from projects/mips to head by hand: copy over cfe_env.c... Added: - copied unchanged from r202060, projects/mips/sys/dev/cfe/cfe_env.c Directory Properties: head/sys/dev/cfe/cfe_env.c (props changed) Copied: head/sys/dev/cfe/cfe_env.c (from r202060, projects/mips/sys/dev/cfe/cfe_env.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfe/cfe_env.c Mon Jan 11 03:43:18 2010 (r202061, copy of r202060, projects/mips/sys/dev/cfe/cfe_env.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2009 Neelkanth Natu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#include + +__FBSDID("$FreeBSD$"); + +#ifndef CFE_ENV_SIZE +#define CFE_ENV_SIZE PAGE_SIZE /* default is one page */ +#endif + +extern void cfe_env_init(void); + +static char cfe_env_buf[CFE_ENV_SIZE]; + +void +cfe_env_init(void) +{ + int idx, len; + char name[64], val[128], *cp, *cplim; + + cp = cfe_env_buf; + cplim = cp + CFE_ENV_SIZE; + + idx = 0; + while (1) { + if (cfe_enumenv(idx, name, sizeof(name), val, sizeof(val)) != 0) + break; + + if (bootverbose) + printf("Importing CFE env: \"%s=%s\"\n", name, val); + + /* + * name=val\0\0 + */ + len = strlen(name) + 1 + strlen(val) + 1 + 1; + if (cplim - cp < len) + printf("No space to store CFE env: \"%s=%s\"\n", + name, val); + else + cp += sprintf(cp, "%s=%s", name, val) + 1; + ++idx; + } + *cp++ = '\0'; + + kern_envp = cfe_env_buf; +} From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 03:49:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4E641065679 for ; Mon, 11 Jan 2010 03:49:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 5544D8FC1D for ; Mon, 11 Jan 2010 03:49:59 +0000 (UTC) Received: (qmail 25308 invoked by uid 399); 11 Jan 2010 03:49:58 -0000 Received: from localhost (HELO freefall.freebsd.org) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 11 Jan 2010 03:49:58 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Mon, 11 Jan 2010 03:49:57 +0000 (UTC) From: Doug Barton To: Warner Losh In-Reply-To: <201001101744.o0AHiM2d095302@svn.freebsd.org> Message-ID: References: <201001101744.o0AHiM2d095302@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.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: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 03:49:59 -0000 On Sun, 10 Jan 2010, Warner Losh wrote: > Author: imp > Date: Sun Jan 10 17:44:22 2010 > New Revision: 202019 > URL: http://svn.freebsd.org/changeset/base/202019 > > Log: > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. Thanks for doing this, however the comment about how to include the whole file (including the comments) were not included. Do I need to do this part of it myself? No problem if so, I just want to be sure to get it done in time to MFC it before the freeze for 7.3-release. Doug From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:07:53 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2919106566B; Mon, 11 Jan 2010 04:07:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 71DF18FC15; Mon, 11 Jan 2010 04:07:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0B41Cna047204; Sun, 10 Jan 2010 21:01:12 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 10 Jan 2010 21:02:04 -0700 (MST) Message-Id: <20100110.210204.787670930858346133.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <201001101744.o0AHiM2d095302@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r202019 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:07:53 -0000 In message: Doug Barton writes: : On Sun, 10 Jan 2010, Warner Losh wrote: : : > Author: imp : > Date: Sun Jan 10 17:44:22 2010 : > New Revision: 202019 : > URL: http://svn.freebsd.org/changeset/base/202019 : > : > Log: : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. : : Thanks for doing this, however the comment about how to include the : whole file (including the comments) were not included. Do I need to do : this part of it myself? No problem if so, I just want to be sure to : get it done in time to MFC it before the freeze for 7.3-release. In general, we don't put big comments like that in the config files, preferring to leave them to NOTES. I was just following that convention... Warner From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:13:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6F861065670; Mon, 11 Jan 2010 04:13:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5FCE8FC19; Mon, 11 Jan 2010 04:13: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 o0B4D6iG044795; Mon, 11 Jan 2010 04:13:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B4D6vW044793; Mon, 11 Jan 2010 04:13:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110413.o0B4D6vW044793@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 04:13: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: r202062 - head/sys/dev/ic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:13:06 -0000 Author: imp Date: Mon Jan 11 04:13:06 2010 New Revision: 202062 URL: http://svn.freebsd.org/changeset/base/202062 Log: Merge from projects/mips to head by hand: Defintions for cavium uart (do they belong here?) Modified: head/sys/dev/ic/ns16550.h Modified: head/sys/dev/ic/ns16550.h ============================================================================== --- head/sys/dev/ic/ns16550.h Mon Jan 11 03:43:18 2010 (r202061) +++ head/sys/dev/ic/ns16550.h Mon Jan 11 04:13:06 2010 (r202062) @@ -52,6 +52,7 @@ #define REG_IIR com_iir #define IIR_IMASK 0xf #define IIR_RXTOUT 0xc +#define IIR_BUSY 0x7 #define IIR_RLS 0x6 #define IIR_RXRDY 0x4 #define IIR_TXRDY 0x2 @@ -181,6 +182,10 @@ #define com_xoff1 6 /* XOFF 1 character (R/W) */ #define com_xoff2 7 /* XOFF 2 character (R/W) */ +#define com_usr 39 /* Octeon 16750/16550 Uart Status Reg */ +#define REG_USR com_usr +#define USR_TXFIFO_NOTFULL 2 /* Uart TX FIFO Not full */ + /* 16950 register #1. Access enabled by ACR[7]. Also requires !LCR[7]. */ #define com_asr 1 /* additional status register (R[0-7]/W[0-1]) */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:29:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05C8A106566C; Mon, 11 Jan 2010 04:29:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E669F8FC08; Mon, 11 Jan 2010 04:29: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 o0B4TQYD048938; Mon, 11 Jan 2010 04:29:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B4TQ6Z048924; Mon, 11 Jan 2010 04:29:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110429.o0B4TQ6Z048924@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 04:29: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: r202063 - in head/sys/mips/cavium: . dev/rgmii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:29:27 -0000 Author: imp Date: Mon Jan 11 04:29:26 2010 New Revision: 202063 URL: http://svn.freebsd.org/changeset/base/202063 Log: Cope with the move and if_timer going way. Modified: head/sys/mips/cavium/dev/rgmii/octeon_fau.c head/sys/mips/cavium/dev/rgmii/octeon_fpa.c head/sys/mips/cavium/dev/rgmii/octeon_ipd.c head/sys/mips/cavium/dev/rgmii/octeon_pko.c head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c head/sys/mips/cavium/files.octeon1 (contents, props changed) head/sys/mips/cavium/obio.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/std.octeon1 (contents, props changed) head/sys/mips/cavium/uart_bus_octeonusart.c head/sys/mips/cavium/uart_cpu_octeonusart.c head/sys/mips/cavium/uart_dev_oct16550.c Modified: head/sys/mips/cavium/dev/rgmii/octeon_fau.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_fau.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/dev/rgmii/octeon_fau.c Mon Jan 11 04:29:26 2010 (r202063) @@ -4,10 +4,13 @@ *------------------------------------------------------------------ */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include +#include #include "octeon_fau.h" /* Modified: head/sys/mips/cavium/dev/rgmii/octeon_fpa.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Mon Jan 11 04:29:26 2010 (r202063) @@ -4,6 +4,9 @@ *------------------------------------------------------------------ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -11,7 +14,7 @@ #include -#include +#include #include "octeon_fpa.h" Modified: head/sys/mips/cavium/dev/rgmii/octeon_ipd.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_ipd.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/dev/rgmii/octeon_ipd.c Mon Jan 11 04:29:26 2010 (r202063) @@ -4,10 +4,13 @@ *------------------------------------------------------------------ */ +#include +__FBSDID("$FreeBSD$"); + #include #include -#include +#include #include "octeon_ipd.h" /* Modified: head/sys/mips/cavium/dev/rgmii/octeon_pko.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_pko.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/dev/rgmii/octeon_pko.c Mon Jan 11 04:29:26 2010 (r202063) @@ -4,12 +4,15 @@ *------------------------------------------------------------------ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include #include -#include +#include #include "octeon_fau.h" #include "octeon_fpa.h" #include "octeon_pko.h" Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c Mon Jan 11 04:29:26 2010 (r202063) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "octeon_fau.h" #include "octeon_fpa.h" @@ -1058,7 +1058,6 @@ static void octeon_rgmx_xmit_mark_buffer * Reset output active flag and watchdog timer. */ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - sc->ifp->if_timer = 0; } @@ -1574,7 +1573,6 @@ static void octeon_rgmx_stop (struct rgm /* Reset transmitter variables and interface flags. */ sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); - sc->ifp->if_timer = 0; sc->txb_count = 0; sc->txb_sched = 0; } Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/files.octeon1 Mon Jan 11 04:29:26 2010 (r202063) @@ -2,16 +2,16 @@ # Octeon Support Files # mips/mips/mp_machdep.c optional smp -mips/octeon1/dev/rgmii/octeon_fau.c optional rgmii -mips/octeon1/dev/rgmii/octeon_fpa.c optional rgmii -mips/octeon1/dev/rgmii/octeon_ipd.c optional rgmii -mips/octeon1/dev/rgmii/octeon_pko.c optional rgmii -mips/octeon1/dev/rgmii/octeon_rgmx.c optional rgmii -mips/octeon1/obio.c optional uart -mips/octeon1/octeon_ebt3000_cf.c optional cf -mips/octeon1/octeon_machdep.c standard -mips/octeon1/uart_bus_octeonusart.c optional uart -mips/octeon1/uart_cpu_octeonusart.c optional uart -mips/octeon1/uart_dev_oct16550.c optional uart +mips/cavium/dev/rgmii/octeon_fau.c optional rgmii +mips/cavium/dev/rgmii/octeon_fpa.c optional rgmii +mips/cavium/dev/rgmii/octeon_ipd.c optional rgmii +mips/cavium/dev/rgmii/octeon_pko.c optional rgmii +mips/cavium/dev/rgmii/octeon_rgmx.c optional rgmii +mips/cavium/obio.c optional uart +mips/cavium/octeon_ebt3000_cf.c optional cf +mips/cavium/octeon_machdep.c standard +mips/cavium/uart_bus_octeonusart.c optional uart +mips/cavium/uart_cpu_octeonusart.c optional uart +mips/cavium/uart_dev_oct16550.c optional uart mips/mips/intr_machdep.c standard mips/mips/tick.c standard Modified: head/sys/mips/cavium/obio.c ============================================================================== --- head/sys/mips/cavium/obio.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/obio.c Mon Jan 11 04:29:26 2010 (r202063) @@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include int obio_probe(device_t); int obio_attach(device_t); Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Mon Jan 11 04:29:26 2010 (r202063) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include "octeon_ebt3000_cf.h" #include "driveid.h" -#include +#include /* ATA Commands */ #define CMD_READ_SECTOR 0x20 Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/octeon_machdep.c Mon Jan 11 04:29:26 2010 (r202063) @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include +#include +#include #include #include #include Modified: head/sys/mips/cavium/std.octeon1 ============================================================================== --- head/sys/mips/cavium/std.octeon1 Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/std.octeon1 Mon Jan 11 04:29:26 2010 (r202063) @@ -4,7 +4,7 @@ # */ # $FreeBSD$ # -files "../octeon1/files.octeon1" +files "../cavium/files.octeon1" # # Modified: head/sys/mips/cavium/uart_bus_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_bus_octeonusart.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/uart_bus_octeonusart.c Mon Jan 11 04:29:26 2010 (r202063) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); /* * XXXMIPS: */ -#include +#include #include "uart_if.h" Modified: head/sys/mips/cavium/uart_cpu_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_cpu_octeonusart.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/uart_cpu_octeonusart.c Mon Jan 11 04:29:26 2010 (r202063) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; Modified: head/sys/mips/cavium/uart_dev_oct16550.c ============================================================================== --- head/sys/mips/cavium/uart_dev_oct16550.c Mon Jan 11 04:13:06 2010 (r202062) +++ head/sys/mips/cavium/uart_dev_oct16550.c Mon Jan 11 04:29:26 2010 (r202063) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include "uart_if.h" From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:38:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C96106566B; Mon, 11 Jan 2010 04:38:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4AE8FC16; Mon, 11 Jan 2010 04:38: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 o0B4cbLF051176; Mon, 11 Jan 2010 04:38:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B4cbRE051174; Mon, 11 Jan 2010 04:38:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110438.o0B4cbRE051174@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 04:38: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: r202064 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:38:38 -0000 Author: imp Date: Mon Jan 11 04:38:37 2010 New Revision: 202064 URL: http://svn.freebsd.org/changeset/base/202064 Log: Cope with the octeon1->cavium move. Note: none of this junk belongs here. Modified: head/sys/mips/mips/bus_space_generic.c (contents, props changed) Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Mon Jan 11 04:29:26 2010 (r202063) +++ head/sys/mips/mips/bus_space_generic.c Mon Jan 11 04:38:37 2010 (r202064) @@ -199,7 +199,7 @@ static struct bus_space generic_space = /* Ultra-gross kludge */ #include "opt_cputype.h" #if defined(TARGET_OCTEON) && defined(ISA_MIPS32) -#include +#include #define rd8(a) oct_read8(a) #define rd16(a) oct_read16(a) #define rd32(a) oct_read32(a) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:40:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B172106568B; Mon, 11 Jan 2010 04:40:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1018FC14; Mon, 11 Jan 2010 04:40: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 o0B4ecjc051767; Mon, 11 Jan 2010 04:40:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B4ecAV051764; Mon, 11 Jan 2010 04:40:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110440.o0B4ecAV051764@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 04:40: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: r202065 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:40:38 -0000 Author: imp Date: Mon Jan 11 04:40:38 2010 New Revision: 202065 URL: http://svn.freebsd.org/changeset/base/202065 Log: Cope with the octeon1->cavium move. Modified: head/sys/mips/conf/OCTEON1 (contents, props changed) head/sys/mips/conf/OCTEON1-32 (contents, props changed) Directory Properties: head/sys/mips/conf/OCTEON1.hints (props changed) Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Mon Jan 11 04:38:37 2010 (r202064) +++ head/sys/mips/conf/OCTEON1 Mon Jan 11 04:40:38 2010 (r202065) @@ -31,7 +31,7 @@ makeoptions TARGET_64BIT=defined makeoptions KERNLOADADDR=0xffffffff80100000 options KERNVIRTADDR=0xffffffff80100000 -include "../octeon1/std.octeon1" +include "../cavium/std.octeon1" hints "OCTEON1.hints" #Default places to look for devices. Modified: head/sys/mips/conf/OCTEON1-32 ============================================================================== --- head/sys/mips/conf/OCTEON1-32 Mon Jan 11 04:38:37 2010 (r202064) +++ head/sys/mips/conf/OCTEON1-32 Mon Jan 11 04:40:38 2010 (r202065) @@ -32,7 +32,7 @@ makeoptions LDSCRIPT_NAME=ldscript.m options KERNVIRTADDR=0x80100000 makeoptions KERNLOADADDR=0x80100000 -include "../octeon1/std.octeon1" +include "../cavium/std.octeon1" hints "OCTEON1.hints" #Default places to look for devices. From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 04:49:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CC4106566C; Mon, 11 Jan 2010 04:49:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 058FB8FC13; Mon, 11 Jan 2010 04:49: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 o0B4niAZ054083; Mon, 11 Jan 2010 04:49:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B4nimU054076; Mon, 11 Jan 2010 04:49:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001110449.o0B4nimU054076@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 04:49: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: r202066 - in head/sys/mips/rmi: . dev/sec dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 04:49:45 -0000 Author: imp Date: Mon Jan 11 04:49:44 2010 New Revision: 202066 URL: http://svn.freebsd.org/changeset/base/202066 Log: Attempt to cope with the dev/rmi -> mips/rmi/dev move. Modified: head/sys/mips/rmi/dev/sec/rmilib.c (contents, props changed) head/sys/mips/rmi/dev/sec/rmilib.h (contents, props changed) head/sys/mips/rmi/dev/sec/rmisec.c (contents, props changed) head/sys/mips/rmi/dev/xlr/rge.c (contents, props changed) head/sys/mips/rmi/files.xlr (contents, props changed) head/sys/mips/rmi/iodi.c (contents, props changed) Directory Properties: head/sys/mips/rmi/Makefile.msgring (props changed) head/sys/mips/rmi/board.c (props changed) head/sys/mips/rmi/board.h (props changed) head/sys/mips/rmi/bus_space_rmi.c (props changed) head/sys/mips/rmi/clock.c (props changed) head/sys/mips/rmi/clock.h (props changed) head/sys/mips/rmi/debug.h (props changed) head/sys/mips/rmi/dev/sec/desc.h (props changed) head/sys/mips/rmi/dev/sec/stats.h (props changed) head/sys/mips/rmi/dev/xlr/atx_cpld.h (props changed) head/sys/mips/rmi/dev/xlr/rge.h (props changed) head/sys/mips/rmi/dev/xlr/xgmac_mdio.h (props changed) Modified: head/sys/mips/rmi/dev/sec/rmilib.c ============================================================================== --- head/sys/mips/rmi/dev/sec/rmilib.c Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/dev/sec/rmilib.c Mon Jan 11 04:49:44 2010 (r202066) @@ -26,9 +26,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + */ #include +__FBSDID("$FreeBSD$"); #include #include @@ -54,8 +56,8 @@ #include #include #include -#include -#include +#include +#include // static int msgrng_stnid_pk0 = MSGRNG_STNID_PK0; Modified: head/sys/mips/rmi/dev/sec/rmilib.h ============================================================================== --- head/sys/mips/rmi/dev/sec/rmilib.h Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/dev/sec/rmilib.h Mon Jan 11 04:49:44 2010 (r202066) @@ -26,12 +26,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + */ #ifndef _RMILIB_H_ #define _RMILIB_H_ -#include +#include +__FBSDID("$FreeBSD$"); + +#include #include /*#define XLR_SEC_CMD_DEBUG*/ Modified: head/sys/mips/rmi/dev/sec/rmisec.c ============================================================================== --- head/sys/mips/rmi/dev/sec/rmisec.c Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/dev/sec/rmisec.c Mon Jan 11 04:49:44 2010 (r202066) @@ -26,8 +26,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + */ +#include +__FBSDID("$FreeBSD$"); #include #include @@ -52,7 +55,7 @@ #include #include -#include +#include /*#define RMI_SEC_DEBUG */ Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 04:49:44 2010 (r202066) @@ -26,7 +26,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + */ + +#include +__FBSDID("$FreeBSD$"); #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_device_polling.h" @@ -90,10 +94,8 @@ #include #include -#include -#include - - +#include +#include #include #include Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/files.xlr Mon Jan 11 04:49:44 2010 (r202066) @@ -17,10 +17,10 @@ mips/rmi/perfmon_percpu.c optional xlr #mips/rmi/pcibus.c optional pci #mips/rmi/xlr_pci.c optional pci #mips/rmi/xls_ehci.c optional usb ehci -dev/rmi/xlr/rge.c optional rge mips/rmi/bus_space_rmi.c standard +mips/rmi/dev/sec/rmisec.c optional rmisec +mips/rmi/dev/sec/rmilib.c optional rmisec +mips/rmi/dev/xlr/rge.c optional rge dev/iicbus/xlr_rtc.c optional xlr_rtc dev/iicbus/xlr_temperature.c optional xlr_temperature dev/iicbus/xlr_eeprom.c optional xlr_eeprom -dev/rmi/sec/rmisec.c optional rmisec -dev/rmi/sec/rmilib.c optional rmisec Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Mon Jan 11 04:40:38 2010 (r202065) +++ head/sys/mips/rmi/iodi.c Mon Jan 11 04:49:44 2010 (r202066) @@ -26,7 +26,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * RMI_BSD */ + * RMI_BSD + */ + +#include +__FBSDID("$FreeBSD$"); #define __RMAN_RESOURCE_VISIBLE #include @@ -67,8 +71,8 @@ #include #include -#include -#include +#include +#include extern void iodi_activateirqs(void); From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 09:16:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EDB8106566B; Mon, 11 Jan 2010 09:16:43 +0000 (UTC) (envelope-from harti@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DEFA8FC0A; Mon, 11 Jan 2010 09:16: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 o0B9Gg65012735; Mon, 11 Jan 2010 09:16:42 GMT (envelope-from harti@svn.freebsd.org) Received: (from harti@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0B9Gg1A012733; Mon, 11 Jan 2010 09:16:42 GMT (envelope-from harti@svn.freebsd.org) Message-Id: <201001110916.o0B9Gg1A012733@svn.freebsd.org> From: Hartmut Brandt Date: Mon, 11 Jan 2010 09:16: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: r202070 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 09:16:43 -0000 Author: harti Date: Mon Jan 11 09:16:42 2010 New Revision: 202070 URL: http://svn.freebsd.org/changeset/base/202070 Log: Fix the previous commit (still not used to svn vs. cvs). Use the define from paths.h for the default temporary directory and remove and unneccessary getenv call. Modified: head/usr.bin/make/job.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Mon Jan 11 05:26:18 2010 (r202069) +++ head/usr.bin/make/job.c Mon Jan 11 09:16:42 2010 (r202070) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -139,7 +140,6 @@ __FBSDID("$FreeBSD$"); #include "var.h" #define TMPPAT "makeXXXXXXXXXX" -#define TMPDIR "/tmp" #ifndef USE_KQUEUE /* @@ -1611,7 +1611,7 @@ JobStart(GNode *gn, int flags, Job *prev } if ((tdir = getenv("TMPDIR")) == NULL) - tdir = TMPDIR; + tdir = _PATH_TMP; /* * If the -n flag wasn't given, we open up OUR (not the child's) @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev } else { fprintf(stdout, "Remaking `%s'\n", gn->name); fflush(stdout); - if ((tdir = getenv("TMPDIR")) == NULL) - tdir = TMPDIR; snprintf(job->outFile, sizeof(job->outFile), "%s/%s", tdir, TMPPAT); if ((job->outFd = mkstemp(job->outFile)) == -1) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 12:19:45 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA95F1065672; Mon, 11 Jan 2010 12:19:45 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E6D5B8FC17; Mon, 11 Jan 2010 12:19:44 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0BCJfCQ057583; Mon, 11 Jan 2010 15:19:41 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263212382; bh=ZlQLnLzJDeDKYx+eEuk2LIuA0SMakdBizeDeiir2S9Y=; l=1013; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=NCt6BIr/aJiYw+ytKji4U/sOBD6aFZVUsyfwR0fWjEDiiXMNERXVp6RDfouylAnUq NdMx9/WrbuWipU71KfjcGQtNXdbh9lYXwBcqmXVKrl7CTFEJLDxFT0T5vMVDfRH5pe ONhS+LTKEH5C57ck5E6+gEQPfNbyh4NLnbOmyZp0= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0BCJenO057582; Mon, 11 Jan 2010 15:19:40 +0300 (MSK) (envelope-from ache) Date: Mon, 11 Jan 2010 15:19:39 +0300 From: Andrey Chernov To: Bruce Evans Message-ID: <20100111121938.GA57442@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , Colin Percival , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> <20100111134429.F1302@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100111134429.F1302@besplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 12:19:46 -0000 On Mon, Jan 11, 2010 at 02:29:03PM +1100, Bruce Evans wrote: > >> 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. > > There are none. I (we?) intentionally didn't set errno when the correct F.e. see fseek()/fseeko() stdio checks, as POSIX says: [EOVERFLOW] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long. [EOVERFLOW] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t. Moreover, POSIX tends to introduce EOVERFLOW now in many places like old system calls too, see read()/pread(): [EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes. (IEEE P1003.1 Draft 5.1 Issue 7 quoted in both cases) -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 12:41:03 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E641065676; Mon, 11 Jan 2010 12:41:03 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 018048FC0A; Mon, 11 Jan 2010 12:41:02 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0BCf1sA057772; Mon, 11 Jan 2010 15:41:01 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1263213661; bh=iJwpkNQl2/zWy2Dg8zkXIsa8dJLRNOXuUVQtdU2r3ck=; l=609; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=mrjzAqv//Gos2FynXlKfvgh7ThxHhcwtem1xMrEC6grOn5JKtw7EhDBCgeZEUnWTD hntzagF3+pDbki2fPD4eiWe4D2nF7gTwM7lIyu/AwPrqPEHccKRDgPeXui7jUzTifD NCAqthnhkfaWhUjK/rPBgOZuM8eqgUcpinsr1mX8= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0BCf0i6057771; Mon, 11 Jan 2010 15:41:00 +0300 (MSK) (envelope-from ache) Date: Mon, 11 Jan 2010 15:40:59 +0300 From: Andrey Chernov To: Hartmut Brandt Message-ID: <20100111124059.GA57742@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Hartmut Brandt , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201001110916.o0B9Gg1A012733@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001110916.o0B9Gg1A012733@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r202070 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 12:41:03 -0000 On Mon, Jan 11, 2010 at 09:16:42AM +0000, Hartmut Brandt wrote: > @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev > } else { > fprintf(stdout, "Remaking `%s'\n", gn->name); > fflush(stdout); > - if ((tdir = getenv("TMPDIR")) == NULL) > - tdir = TMPDIR; > snprintf(job->outFile, sizeof(job->outFile), "%s/%s", > tdir, TMPPAT); > if ((job->outFd = mkstemp(job->outFile)) == -1) With the presence of .EXPORTVAR directive (setenv() called) TMPDIR environment can be changed on the fly, so perhaps this lines are for reason. -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 13:44:13 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBBF2106566B; Mon, 11 Jan 2010 13:44:13 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 552828FC0A; Mon, 11 Jan 2010 13:44:12 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id F19FE1FFC22; Mon, 11 Jan 2010 13:44:11 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C1E3A844CC; Mon, 11 Jan 2010 14:44:11 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Evans References: <201001081544.o08FinVh015359@svn.freebsd.org> <20100109073716.E57804@delplex.bde.org> Date: Mon, 11 Jan 2010 14:44:11 +0100 In-Reply-To: <20100109073716.E57804@delplex.bde.org> (Bruce Evans's message of "Sat, 9 Jan 2010 07:56:10 +1100 (EST)") Message-ID: <86aawkzrh0.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 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, Edward Tomasz Napierala Subject: Re: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 13:44:13 -0000 Bruce Evans writes: > All of these bugs should have been avoided by using normal style. KNF > doesn't even use the "!" operator for testing simple booleans! Older > KNF code in kern uses comparisions with 0 fairly consistently for testing > flags in a bitmap being 0. Even the not-so-old KNF code in kern that > tests the not-so-old flag TDF_SINTR does this (there is only one instance, > in kern_sig.c, where the above is spelled correctly as > ((td->td_flags & TDF_SINTR) =3D=3D 0). I like to use ! for testing even = sets > of flags so I prefer the above, but this is not KNF. > > Spelling for testing the opposite sense is more mixed. Omitting the > !=3D 0 seems to be most common. ISTR that 1) the rule is "don't use it as a predicate unless the name clearly marks it as such" and 2) it isn't actually written down anywhere... TD_IS_SLEEPING(td) is clearly a predicate, so it's OK not to compare it explicitly with 0; (td->td_flags & TDF_SINTR) may well be a predicate, but this is not obvious from a quick glance at the code, so there should be an explicit comparison. The canonical example is strcmp(), which is *not* a predicate, but is often used (and easily misused) as one. It almost makes me want to add the following to : #define streq(s1, s1) (strcmp((s1), (s2)) =3D=3D 0) #define strlt(s1, s1) (strcmp((s1), (s2)) < 0) #define strgt(s1, s1) (strcmp((s1), (s2)) > 0) (or the equivalent static inline functions to avoid double expansion issues) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 15:51:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ABE106566B; Mon, 11 Jan 2010 15:51:14 +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 2492E8FC14; Mon, 11 Jan 2010 15:51: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 o0BFpEF1004966; Mon, 11 Jan 2010 15:51:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BFpE9X004964; Mon, 11 Jan 2010 15:51:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001111551.o0BFpE9X004964@svn.freebsd.org> From: Alan Cox Date: Mon, 11 Jan 2010 15:51: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: r202084 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 15:51:14 -0000 Author: alc Date: Mon Jan 11 15:51:13 2010 New Revision: 202084 URL: http://svn.freebsd.org/changeset/base/202084 Log: Eliminate an unused declaration. Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Mon Jan 11 15:12:13 2010 (r202083) +++ head/sys/i386/xen/mp_machdep.c Mon Jan 11 15:51:13 2010 (r202084) @@ -105,9 +105,6 @@ static char callfunc_name[NR_CPUS][15]; /* Free these after use */ void *bootstacks[MAXCPU]; -/* Hotwire a 0->4MB V==P mapping */ -extern pt_entry_t *KPTphys; - struct pcb stoppcbs[MAXCPU]; /* Variables needed for SMP tlb shootdown. */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 16:01:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 265F61065679; Mon, 11 Jan 2010 16:01:21 +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 151768FC22; Mon, 11 Jan 2010 16:01: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 o0BG1Kal007253; Mon, 11 Jan 2010 16:01:20 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BG1KhU007249; Mon, 11 Jan 2010 16:01:20 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001111601.o0BG1KhU007249@svn.freebsd.org> From: Alan Cox Date: Mon, 11 Jan 2010 16:01: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: r202085 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 16:01:21 -0000 Author: alc Date: Mon Jan 11 16:01:20 2010 New Revision: 202085 URL: http://svn.freebsd.org/changeset/base/202085 Log: Simplify pmap_init(). Additionally, correct a harmless misbehavior on i386. Specifically, where locore had created large page mappings for the kernel, the wrong vm page array entries were being initialized. The vm page array entries for the pages containing the kernel were being initialized instead of the vm page array entries for page table pages. MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/locore.s head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Jan 11 15:51:13 2010 (r202084) +++ head/sys/amd64/amd64/pmap.c Mon Jan 11 16:01:20 2010 (r202085) @@ -664,7 +664,6 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - pd_entry_t *pd; vm_page_t mpte; vm_size_t s; int i, pv_npg; @@ -673,18 +672,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - pd = pmap_pde(kernel_pmap, KERNBASE); for (i = 0; i < NKPT; i++) { - if ((pd[i] & (PG_PS | PG_V)) == (PG_PS | PG_V)) - continue; - KASSERT((pd[i] & PG_V) != 0, - ("pmap_init: page table page is missing")); - mpte = PHYS_TO_VM_PAGE(pd[i] & PG_FRAME); + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; - mpte->phys_addr = pd[i] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Jan 11 15:51:13 2010 (r202084) +++ head/sys/i386/i386/locore.s Mon Jan 11 16:01:20 2010 (r202085) @@ -104,9 +104,7 @@ IdlePTD: .long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif -#ifdef SMP .globl KPTphys -#endif KPTphys: .long 0 /* phys addr of kernel page tables */ .globl proc0kstack Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Jan 11 15:51:13 2010 (r202084) +++ head/sys/i386/i386/pmap.c Mon Jan 11 16:01:20 2010 (r202085) @@ -206,6 +206,7 @@ int pseflag = 0; /* PG_PS or-in */ static int nkpt; vm_offset_t kernel_vm_end; extern u_int32_t KERNend; +extern u_int32_t KPTphys; #ifdef PAE pt_entry_t pg_nx; @@ -659,13 +660,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - for (i = 0; i < nkpt; i++) { - mpte = PHYS_TO_VM_PAGE(PTD[i + KPTDI] & PG_FRAME); + for (i = 0; i < NKPT; i++) { + mpte = PHYS_TO_VM_PAGE(KPTphys + (i << PAGE_SHIFT)); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_init: page table page is out of range")); mpte->pindex = i + KPTDI; - mpte->phys_addr = PTD[i + KPTDI] & PG_FRAME; + mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); } /* From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 16:27:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D81031065679; Mon, 11 Jan 2010 16:27:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD4368FC14; Mon, 11 Jan 2010 16:27: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 o0BGRuhk013183; Mon, 11 Jan 2010 16:27:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BGRuov013179; Mon, 11 Jan 2010 16:27:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001111627.o0BGRuov013179@svn.freebsd.org> From: Ed Schouten Date: Mon, 11 Jan 2010 16:27: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: r202086 - head/contrib/opie/libopie X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 16:27:56 -0000 Author: ed Date: Mon Jan 11 16:27:56 2010 New Revision: 202086 URL: http://svn.freebsd.org/changeset/base/202086 Log: Don't include when using . libopie includes both and in this case and uses some #defines to let the code use struct utmpx and its utility functions. We'd better not include here, because maybe it will not be present in the future. Modified: head/contrib/opie/libopie/getutmpentry.c head/contrib/opie/libopie/insecure.c head/contrib/opie/libopie/login.c Modified: head/contrib/opie/libopie/getutmpentry.c ============================================================================== --- head/contrib/opie/libopie/getutmpentry.c Mon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/getutmpentry.c Mon Jan 11 16:27:56 2010 (r202086) @@ -15,13 +15,14 @@ you didn't get a copy, you may request o #include "opie_cfg.h" #include #include -#include #if DOUTMPX #include #define setutent setutxent #define getutline(x) getutxline(x) #define utmp utmpx +#else +#include #endif /* DOUTMPX */ #if HAVE_STRING_H Modified: head/contrib/opie/libopie/insecure.c ============================================================================== --- head/contrib/opie/libopie/insecure.c Mon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/insecure.c Mon Jan 11 16:27:56 2010 (r202086) @@ -39,11 +39,12 @@ $FreeBSD$ #include #include -#include #if DOUTMPX #include #define utmp utmpx #define endutent endutxent +#else +#include #endif /* DOUTMPX */ #if HAVE_SYS_UTSNAME_H Modified: head/contrib/opie/libopie/login.c ============================================================================== --- head/contrib/opie/libopie/login.c Mon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/login.c Mon Jan 11 16:27:56 2010 (r202086) @@ -21,13 +21,14 @@ you didn't get a copy, you may request o #include "opie_cfg.h" #include #include -#include #if DOUTMPX #include #define pututline(x) pututxline(x) #define endutent endutxent #define utmp utmpx +#else +#include #endif /* DOUTMPX */ #if HAVE_STRING_H From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:14:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C928E1065672; Mon, 11 Jan 2010 17:14:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B80698FC14; Mon, 11 Jan 2010 17:14: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 o0BHEACP023477; Mon, 11 Jan 2010 17:14:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHEAoO023475; Mon, 11 Jan 2010 17:14:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111714.o0BHEAoO023475@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 17:14: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: r202089 - head/sys/mips/sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:14:10 -0000 Author: imp Date: Mon Jan 11 17:14:10 2010 New Revision: 202089 URL: http://svn.freebsd.org/changeset/base/202089 Log: Get sb_zbpci.c compiling again after the macros PCI_BUSMAX, PCI_SLOTMAX and PCI_FUNCMAX were moved to pcireg.h. Submitted by: neel@ Modified: head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Mon Jan 11 16:31:29 2010 (r202088) +++ head/sys/mips/sibyte/sb_zbpci.c Mon Jan 11 17:14:10 2010 (r202089) @@ -39,6 +39,7 @@ #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:14:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E6110656AC; Mon, 11 Jan 2010 17:14:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6460A8FC18; Mon, 11 Jan 2010 17:14: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 o0BHEkth023643; Mon, 11 Jan 2010 17:14:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHEkdb023641; Mon, 11 Jan 2010 17:14:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111714.o0BHEkdb023641@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 17:14: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: r202090 - head/sys/mips/sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:14:46 -0000 Author: imp Date: Mon Jan 11 17:14:46 2010 New Revision: 202090 URL: http://svn.freebsd.org/changeset/base/202090 Log: Remove redundant interrupt mapper code. We don't need to disable the interrupt sources feeding into a hardintr anymore. The mips_mask_hard_irq() function does that for us while an interrupt is being processed. Submitted by: neel@ Modified: head/sys/mips/sibyte/sb_zbbus.c Modified: head/sys/mips/sibyte/sb_zbbus.c ============================================================================== --- head/sys/mips/sibyte/sb_zbbus.c Mon Jan 11 17:14:10 2010 (r202089) +++ head/sys/mips/sibyte/sb_zbbus.c Mon Jan 11 17:14:46 2010 (r202090) @@ -45,7 +45,7 @@ static MALLOC_DEFINE(M_INTMAP, "sb1250 i struct sb_intmap { int intsrc; /* interrupt mapper register number (0 - 63) */ - int active; /* Does this source generate interrupts? */ + int hardint; /* cpu interrupt from 0 to NUM_HARD_IRQS - 1 */ /* * The device that the interrupt belongs to. Note that multiple @@ -60,36 +60,23 @@ struct sb_intmap { SLIST_ENTRY(sb_intmap) next; }; -/* - * We register 'sb_intsrc.isrc' using cpu_register_hard_intsrc() for each - * hard interrupt source [0-5]. - * - * The mask/unmask callbacks use the information in 'sb_intmap' to figure - * out the corresponding interrupt sources to mask/unmask. - */ -struct sb_intsrc { - struct intsrc isrc; - SLIST_HEAD(, sb_intmap) sb_intmap_head; -}; - -static struct sb_intsrc sb_intsrc[NUM_HARD_IRQS]; +static SLIST_HEAD(, sb_intmap) sb_intmap_head; static struct sb_intmap * sb_intmap_lookup(int intrnum, device_t dev, int rid) { - struct sb_intsrc *isrc; struct sb_intmap *map; - isrc = &sb_intsrc[intrnum]; - SLIST_FOREACH(map, &isrc->sb_intmap_head, next) { - if (dev == map->dev && rid == map->rid) + SLIST_FOREACH(map, &sb_intmap_head, next) { + if (dev == map->dev && rid == map->rid && + intrnum == map->hardint) break; } return (map); } /* - * Keep track of which (dev,rid) tuple is using the interrupt source. + * Keep track of which (dev,rid,hardint) tuple is using the interrupt source. * * We don't actually unmask the interrupt source until the device calls * a bus_setup_intr() on the resource. @@ -97,14 +84,11 @@ sb_intmap_lookup(int intrnum, device_t d static void sb_intmap_add(int intrnum, device_t dev, int rid, int intsrc) { - struct sb_intsrc *isrc; struct sb_intmap *map; - register_t sr; KASSERT(intrnum >= 0 && intrnum < NUM_HARD_IRQS, ("intrnum is out of range: %d", intrnum)); - isrc = &sb_intsrc[intrnum]; map = sb_intmap_lookup(intrnum, dev, rid); if (map) { KASSERT(intsrc == map->intsrc, @@ -117,32 +101,24 @@ sb_intmap_add(int intrnum, device_t dev, map = malloc(sizeof(*map), M_INTMAP, M_WAITOK | M_ZERO); map->intsrc = intsrc; + map->hardint = intrnum; map->dev = dev; map->rid = rid; - sr = intr_disable(); - SLIST_INSERT_HEAD(&isrc->sb_intmap_head, map, next); - intr_restore(sr); + SLIST_INSERT_HEAD(&sb_intmap_head, map, next); } static void sb_intmap_activate(int intrnum, device_t dev, int rid) { struct sb_intmap *map; - register_t sr; KASSERT(intrnum >= 0 && intrnum < NUM_HARD_IRQS, ("intrnum is out of range: %d", intrnum)); map = sb_intmap_lookup(intrnum, dev, rid); if (map) { - /* - * See comments in sb_unmask_func() about disabling cpu intr - */ - sr = intr_disable(); - map->active = 1; sb_enable_intsrc(map->intsrc); - intr_restore(sr); } else { /* * In zbbus_setup_intr() we blindly call sb_intmap_activate() @@ -157,75 +133,6 @@ sb_intmap_activate(int intrnum, device_t } } -static void -sb_mask_func(struct intsrc *arg) -{ - struct sb_intmap *map; - struct sb_intsrc *isrc; - uint64_t isrc_bitmap; - - isrc_bitmap = 0; - isrc = (struct sb_intsrc *)arg; - SLIST_FOREACH(map, &isrc->sb_intmap_head, next) { - if (map->active == 0) - continue; - /* - * If we have already disabled this interrupt source then don't - * do it again. This can happen when multiple devices share - * an interrupt source (e.g. PCI_INT_x). - */ - if (isrc_bitmap & (1ULL << map->intsrc)) - continue; - sb_disable_intsrc(map->intsrc); - isrc_bitmap |= 1ULL << map->intsrc; - } -} - -static void -sb_unmask_func(struct intsrc *arg) -{ - struct sb_intmap *map; - struct sb_intsrc *sb_isrc; - uint64_t isrc_bitmap; - register_t sr; - - isrc_bitmap = 0; - sb_isrc = (struct sb_intsrc *)arg; - - /* - * Make sure we disable the cpu interrupts when enabling the - * interrupt sources. - * - * This is to prevent a condition where some interrupt sources have - * been enabled (but not all) and one of those interrupt sources - * triggers an interrupt. - * - * If any of the interrupt handlers executes in an ithread then - * cpu_intr() will return with all interrupt sources feeding into - * that cpu irq masked. But when the loop below picks up where it - * left off it will enable the remaining interrupt sources!!! - * - * If the disable the cpu interrupts then this race does not happen. - */ - sr = intr_disable(); - - SLIST_FOREACH(map, &sb_isrc->sb_intmap_head, next) { - if (map->active == 0) - continue; - /* - * If we have already enabled this interrupt source then don't - * do it again. This can happen when multiple devices share - * an interrupt source (e.g. PCI_INT_x). - */ - if (isrc_bitmap & (1ULL << map->intsrc)) - continue; - sb_enable_intsrc(map->intsrc); - isrc_bitmap |= 1ULL << map->intsrc; - } - - intr_restore(sr); -} - struct zbbus_devinfo { struct resource_list resources; }; @@ -243,23 +150,11 @@ zbbus_probe(device_t dev) static int zbbus_attach(device_t dev) { - int i, error; - struct intsrc *isrc; if (bootverbose) { device_printf(dev, "attached.\n"); } - for (i = 0; i < NUM_HARD_IRQS; ++i) { - isrc = &sb_intsrc[i].isrc; - isrc->intrnum = i; - isrc->mask_func = sb_mask_func; - isrc->unmask_func = sb_unmask_func; - error = cpu_register_hard_intsrc(isrc); - if (error) - panic("Error %d registering intsrc %d", error, i); - } - bus_generic_probe(dev); bus_enumerate_hinted_children(dev); bus_generic_attach(dev); From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:16:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EDE910656A3; Mon, 11 Jan 2010 17:16:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9C28FC15; Mon, 11 Jan 2010 17:16: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 o0BHG6EO024000; Mon, 11 Jan 2010 17:16:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHG6dc023998; Mon, 11 Jan 2010 17:16:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111716.o0BHG6dc023998@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 17:16: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: r202091 - head/sys/dev/cfe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:16:06 -0000 Author: imp Date: Mon Jan 11 17:16:06 2010 New Revision: 202091 URL: http://svn.freebsd.org/changeset/base/202091 Log: Fix bug in cfe_enumenv(). The CFE API to invoke is CFE_CMD_ENV_ENUM and not CFE_CMD_ENV_SET. Submitted by: neel@ Modified: head/sys/dev/cfe/cfe_api.c Modified: head/sys/dev/cfe/cfe_api.c ============================================================================== --- head/sys/dev/cfe/cfe_api.c Mon Jan 11 17:14:46 2010 (r202090) +++ head/sys/dev/cfe/cfe_api.c Mon Jan 11 17:16:06 2010 (r202091) @@ -160,7 +160,7 @@ cfe_enumenv(int idx, char *name, int nam { cfe_xiocb_t xiocb; - xiocb.xiocb_fcode = CFE_CMD_ENV_SET; + xiocb.xiocb_fcode = CFE_CMD_ENV_ENUM; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:29:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 953471065670; Mon, 11 Jan 2010 17:29:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 840A08FC16; Mon, 11 Jan 2010 17:29: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 o0BHTKuf026945; Mon, 11 Jan 2010 17:29:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHTKKT026943; Mon, 11 Jan 2010 17:29:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111729.o0BHTKKT026943@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 17:29: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: r202092 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:29:20 -0000 Author: imp Date: Mon Jan 11 17:29:20 2010 New Revision: 202092 URL: http://svn.freebsd.org/changeset/base/202092 Log: Correct a path in an include I missed earlier Remove references to if_watchdog. The rge_watchdog routine was empty anyway. Modified: head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 17:16:06 2010 (r202091) +++ head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 17:29:20 2010 (r202092) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* #include "opt_rge.h" */ @@ -245,7 +245,6 @@ static void rge_start(struct ifnet *); static int rge_ioctl(struct ifnet *, u_long, caddr_t); static void rge_init(void *); static void rge_stop(struct rge_softc *); -static void rge_watchdog(struct ifnet *); static int rge_shutdown(device_t); static void rge_reset(struct rge_softc *); @@ -1936,7 +1935,6 @@ rge_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = rge_ioctl; ifp->if_start = rge_start; - ifp->if_watchdog = rge_watchdog; ifp->if_init = rge_init; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = RGE_TX_Q_SIZE; @@ -2404,11 +2402,6 @@ rge_stop(struct rge_softc *sc) rmi_xlr_mac_close(sc); } -static void -rge_watchdog(struct ifnet *sc) -{ -} - static int rge_shutdown(device_t dev) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:31:08 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6AD11065672; Mon, 11 Jan 2010 17:31:08 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp1.dlr.de (smtp1.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 67B978FC15; Mon, 11 Jan 2010 17:31:08 +0000 (UTC) Received: from beagle.kn.op.dlr.de ([129.247.178.136]) by smtp1.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 11 Jan 2010 18:19:03 +0100 Date: Mon, 11 Jan 2010 18:18:59 +0100 (CET) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Andrey Chernov In-Reply-To: <20100111124059.GA57742@nagual.pp.ru> Message-ID: <20100111181634.H12211@beagle.kn.op.dlr.de> References: <201001110916.o0B9Gg1A012733@svn.freebsd.org> <20100111124059.GA57742@nagual.pp.ru> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 11 Jan 2010 17:19:03.0236 (UTC) FILETIME=[2C066040:01CA92E2] Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r202070 - head/usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:31:08 -0000 Hi, On Mon, 11 Jan 2010, Andrey Chernov wrote: AC>On Mon, Jan 11, 2010 at 09:16:42AM +0000, Hartmut Brandt wrote: AC>> @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev AC>> } else { AC>> fprintf(stdout, "Remaking `%s'\n", gn->name); AC>> fflush(stdout); AC>> - if ((tdir = getenv("TMPDIR")) == NULL) AC>> - tdir = TMPDIR; AC>> snprintf(job->outFile, sizeof(job->outFile), "%s/%s", AC>> tdir, TMPPAT); AC>> if ((job->outFd = mkstemp(job->outFile)) == -1) AC> AC>With the presence of .EXPORTVAR directive (setenv() called) TMPDIR AC>environment can be changed on the fly, so perhaps this lines are for reason. There is the same getenv() just a couple of lines above of all the if()s so that it covers both uses of tdir. I just though that doing the getenv() in both places is slightly more performing that do it all the time. But decided that this gain would be clearly below noise level. The I forgot to remove the now unneeded second getenv. harti From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 17:58:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280201065672; Mon, 11 Jan 2010 17:58:16 +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 1713B8FC1C; Mon, 11 Jan 2010 17:58: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 o0BHwFgJ033426; Mon, 11 Jan 2010 17:58:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BHwFGb033424; Mon, 11 Jan 2010 17:58:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001111758.o0BHwFGb033424@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 11 Jan 2010 17:58: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: r202095 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 17:58:16 -0000 Author: bz Date: Mon Jan 11 17:58:15 2010 New Revision: 202095 URL: http://svn.freebsd.org/changeset/base/202095 Log: Rather than using an extra variable, only call uname if really needed and then directly assign the result. Submitted by: jmallett MFC after: 24 days X-MFC with: r201815 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Mon Jan 11 17:35:34 2010 (r202094) +++ head/Makefile Mon Jan 11 17:58:15 2010 (r202095) @@ -321,8 +321,9 @@ universe_${target}: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs -XMACHINE!= uname -m -TARGET?= ${XMACHINE} +.if !defined(TARGET) +TARGET!= uname -m +.endif KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 18:10:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582C91065676; Mon, 11 Jan 2010 18:10:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43F838FC18; Mon, 11 Jan 2010 18:10: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 o0BIAEsq036118; Mon, 11 Jan 2010 18:10:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BIAEmm036106; Mon, 11 Jan 2010 18:10:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001111810.o0BIAEmm036106@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 11 Jan 2010 18:10: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: r202097 - in head/sys: amd64/amd64 amd64/include conf dev/io i386/i386 i386/include ia64/conf ia64/ia64 ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 18:10:14 -0000 Author: marcel Date: Mon Jan 11 18:10:13 2010 New Revision: 202097 URL: http://svn.freebsd.org/changeset/base/202097 Log: Use io(4) for I/O port access on ia64, rather than through sysarch(2). I/O port access is implemented on Itanium by reading and writing to a special region in memory. To hide details and avoid misaligned memory accesses, a process did I/O port reads and writes by making a MD system call. There's one fatal problem with this approach: unprivileged access was not being prevented. /dev/io serves that purpose on amd64/i386, so employ it on ia64 as well. Use an ioctl for doing the actual I/O and remove the sysarch(2) interface. Backward compatibility is not being considered. The sysarch(2) approach was added to support X11, but support for FreeBSD/ia64 was never fully implemented in X11. Thus, nothing gets broken that didn't need more work to begin with. MFC after: 1 week Added: head/sys/ia64/ia64/iodev_machdep.c (contents, props changed) head/sys/ia64/include/iodev.h (contents, props changed) Modified: head/sys/amd64/amd64/io.c head/sys/amd64/include/iodev.h head/sys/conf/files.ia64 head/sys/dev/io/iodev.c head/sys/i386/i386/io.c head/sys/i386/include/iodev.h head/sys/ia64/conf/DEFAULTS head/sys/ia64/ia64/sys_machdep.c head/sys/ia64/include/sysarch.h Modified: head/sys/amd64/amd64/io.c ============================================================================== --- head/sys/amd64/amd64/io.c Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/amd64/amd64/io.c Mon Jan 11 18:10:13 2010 (r202097) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, + int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: head/sys/amd64/include/iodev.h ============================================================================== --- head/sys/amd64/include/iodev.h Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/amd64/include/iodev.h Mon Jan 11 18:10:13 2010 (r202097) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/conf/files.ia64 Mon Jan 11 18:10:13 2010 (r202097) @@ -54,6 +54,7 @@ dev/atkbdc/psm.c optional psm atkbdc dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc +dev/io/iodev.c optional io dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga @@ -86,6 +87,7 @@ ia64/ia64/gdb_machdep.c optional gdb ia64/ia64/highfp.c standard ia64/ia64/in_cksum.c optional inet ia64/ia64/interrupt.c standard +ia64/ia64/iodev_machdep.c optional io ia64/ia64/locore.S standard no-obj ia64/ia64/machdep.c standard ia64/ia64/mca.c standard Modified: head/sys/dev/io/iodev.c ============================================================================== --- head/sys/dev/io/iodev.c Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/dev/io/iodev.c Mon Jan 11 18:10:13 2010 (r202097) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include @@ -54,6 +52,7 @@ static struct cdevsw io_cdevsw = { .d_version = D_VERSION, .d_open = ioopen, .d_close = ioclose, + .d_ioctl = ioioctl, .d_name = "io", }; Modified: head/sys/i386/i386/io.c ============================================================================== --- head/sys/i386/i386/io.c Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/i386/i386/io.c Mon Jan 11 18:10:13 2010 (r202097) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, + int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: head/sys/i386/include/iodev.h ============================================================================== --- head/sys/i386/include/iodev.h Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/i386/include/iodev.h Mon Jan 11 18:10:13 2010 (r202097) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/ia64/conf/DEFAULTS Mon Jan 11 18:10:13 2010 (r202097) @@ -9,6 +9,7 @@ machine ia64 device acpi # ACPI support # Pseudo devices. +device io # I/O & EFI runtime device device mem # Memory and kernel memory devices # UART chips on this platform Added: head/sys/ia64/ia64/iodev_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/ia64/iodev_machdep.c Mon Jan 11 18:10:13 2010 (r202097) @@ -0,0 +1,160 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +static int iodev_pio_read(struct iodev_pio_req *req); +static int iodev_pio_write(struct iodev_pio_req *req); + +/* ARGSUSED */ +int +ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td) +{ + int error; + + error = priv_check(td, PRIV_IO); + if (error == 0) + error = securelevel_gt(td->td_ucred, 0); + + return (error); +} + +/* ARGSUSED */ +int +ioclose(struct cdev *dev __unused, int flags __unused, int fmt __unused, + struct thread *td __unused) +{ + + return (0); +} + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, + int fflag __unused, struct thread *td __unused) +{ + struct iodev_pio_req *pio_req; + int error; + + error = ENOIOCTL; + switch (cmd) { + case IODEV_PIO: + pio_req = (struct iodev_pio_req *)data; + switch (pio_req->access) { + case IODEV_PIO_READ: + error = iodev_pio_read(pio_req); + break; + case IODEV_PIO_WRITE: + error = iodev_pio_write(pio_req); + break; + default: + error = EINVAL; + break; + } + break; + } + + return (error); +} + +static int +iodev_pio_read(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + req->val = bus_space_read_io_1(req->port); + break; + case 2: + if (req->port & 1) { + req->val = bus_space_read_io_1(req->port); + req->val |= bus_space_read_io_1(req->port + 1) << 8; + } else + req->val = bus_space_read_io_2(req->port); + break; + case 4: + if (req->port & 1) { + req->val = bus_space_read_io_1(req->port); + req->val |= bus_space_read_io_2(req->port + 1) << 8; + req->val |= bus_space_read_io_1(req->port + 3) << 24; + } else if (req->port & 2) { + req->val = bus_space_read_io_2(req->port); + req->val |= bus_space_read_io_2(req->port + 2) << 16; + } else + req->val = bus_space_read_io_4(req->port); + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +iodev_pio_write(struct iodev_pio_req *req) +{ + + switch (req->width) { + case 1: + bus_space_write_io_1(req->port, req->val); + break; + case 2: + if (req->port & 1) { + bus_space_write_io_1(req->port, req->val); + bus_space_write_io_1(req->port + 1, req->val >> 8); + } else + bus_space_write_io_2(req->port, req->val); + break; + case 4: + if (req->port & 1) { + bus_space_write_io_1(req->port, req->val); + bus_space_write_io_2(req->port + 1, req->val >> 8); + bus_space_write_io_1(req->port + 3, req->val >> 24); + } else if (req->port & 2) { + bus_space_write_io_2(req->port, req->val); + bus_space_write_io_2(req->port + 2, req->val >> 16); + } else + bus_space_write_io_4(req->port, req->val); + break; + default: + return (EINVAL); + } + + return (0); +} Modified: head/sys/ia64/ia64/sys_machdep.c ============================================================================== --- head/sys/ia64/ia64/sys_machdep.c Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/ia64/ia64/sys_machdep.c Mon Jan 11 18:10:13 2010 (r202097) @@ -49,72 +49,9 @@ struct sysarch_args { int sysarch(struct thread *td, struct sysarch_args *uap) { - struct ia64_iodesc iod; int error; - error = 0; switch(uap->op) { - case IA64_IORD: - copyin(uap->parms, &iod, sizeof(iod)); - switch (iod.width) { - case 1: - iod.val = inb(iod.port); - break; - case 2: - if (iod.port & 1) { - iod.val = inb(iod.port); - iod.val |= inb(iod.port + 1) << 8; - } else - iod.val = inw(iod.port); - break; - case 4: - if (iod.port & 3) { - if (iod.port & 1) { - iod.val = inb(iod.port); - iod.val |= inw(iod.port + 1) << 8; - iod.val |= inb(iod.port + 3) << 24; - } else { - iod.val = inw(iod.port); - iod.val |= inw(iod.port + 2) << 16; - } - } else - iod.val = inl(iod.port); - break; - default: - error = EINVAL; - } - copyout(&iod, uap->parms, sizeof(iod)); - break; - case IA64_IOWR: - copyin(uap->parms, &iod, sizeof(iod)); - switch (iod.width) { - case 1: - outb(iod.port, iod.val); - break; - case 2: - if (iod.port & 1) { - outb(iod.port, iod.val); - outb(iod.port + 1, iod.val >> 8); - } else - outw(iod.port, iod.val); - break; - case 4: - if (iod.port & 3) { - if (iod.port & 1) { - outb(iod.port, iod.val); - outw(iod.port + 1, iod.val >> 8); - outb(iod.port + 3, iod.val >> 24); - } else { - outw(iod.port, iod.val); - outw(iod.port + 2, iod.val >> 16); - } - } else - outl(iod.port, iod.val); - break; - default: - error = EINVAL; - } - break; default: error = EINVAL; break; Added: head/sys/ia64/include/iodev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/include/iodev.h Mon Jan 11 18:10:13 2010 (r202097) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_IODEV_H_ +#define _MACHINE_IODEV_H_ + +struct iodev_pio_req { + u_int access; +#define IODEV_PIO_READ 0 +#define IODEV_PIO_WRITE 1 + u_int port; + u_int width; + u_int val; +}; + +#define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) + +#ifdef _KERNEL + +d_open_t ioopen; +d_close_t ioclose; +d_ioctl_t ioioctl; + +#endif + +#endif /* _MACHINE_IODEV_H_ */ Modified: head/sys/ia64/include/sysarch.h ============================================================================== --- head/sys/ia64/include/sysarch.h Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/ia64/include/sysarch.h Mon Jan 11 18:10:13 2010 (r202097) @@ -32,15 +32,6 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ -#define IA64_IORD 0 -#define IA64_IOWR 1 - -struct ia64_iodesc { - int port; - int width; - unsigned long val; -}; - #ifndef _KERNEL #include From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 19:04:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B69610656A3; Mon, 11 Jan 2010 19:04:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7E68FC0A; Mon, 11 Jan 2010 19:04: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 o0BJ4PYG048531; Mon, 11 Jan 2010 19:04:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BJ4P84048530; Mon, 11 Jan 2010 19:04:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111904.o0BJ4P84048530@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 19:04: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: r202103 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 19:04:25 -0000 Author: imp Date: Mon Jan 11 19:04:24 2010 New Revision: 202103 URL: http://svn.freebsd.org/changeset/base/202103 Log: Using svn cp rather than cp to copy these files over had the benefit of preserving their history. It had the problem that it also copied over mergeinfo data. Since we're retiring the projects/mips branch, I'm removing the svn:mergeinfo property from them all. Submitted by: jhb Modified: Directory Properties: head/sys/conf/ldscript.mips.mips64 (props changed) head/sys/conf/ldscript.mips.octeon1.32 (props changed) head/sys/conf/ldscript.mips.octeon1.64 (props changed) head/sys/conf/ldscript.mips.octeon1.n32 (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 19:21:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB021065692; Mon, 11 Jan 2010 19:21:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBF318FC14; Mon, 11 Jan 2010 19:21: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 o0BJLq7T052532; Mon, 11 Jan 2010 19:21:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BJLq8F052531; Mon, 11 Jan 2010 19:21:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001111921.o0BJLq8F052531@svn.freebsd.org> From: Warner Losh Date: Mon, 11 Jan 2010 19:21:52 +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: r202105 - in head/sys: dev/cfe dev/flash dev/siba mips/conf mips/include mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 19:21:53 -0000 Author: imp Date: Mon Jan 11 19:21:52 2010 New Revision: 202105 URL: http://svn.freebsd.org/changeset/base/202105 Log: Using svn cp rather than cp to copy these files over had the benefit of preserving their history. It had the problem that it also copied over mergeinfo data. Since we're retiring the projects/mips branch, I'm removing the svn:mergeinfo property from them all. Submitted by: jhb Modified: Directory Properties: head/sys/dev/cfe/cfe_env.c (props changed) head/sys/dev/flash/mx25l.c (props changed) head/sys/dev/flash/mx25lreg.h (props changed) head/sys/dev/siba/siba_cc.c (props changed) head/sys/mips/alchemy/ (props changed) head/sys/mips/atheros/ (props changed) head/sys/mips/cavium/ (props changed) head/sys/mips/conf/ALCHEMY (props changed) head/sys/mips/conf/AR71XX (props changed) head/sys/mips/conf/AR71XX.hints (props changed) head/sys/mips/conf/MALTA64 (props changed) head/sys/mips/conf/OCTEON1 (props changed) head/sys/mips/conf/OCTEON1-32 (props changed) head/sys/mips/conf/OCTEON1.hints (props changed) head/sys/mips/conf/SWARM (props changed) head/sys/mips/conf/SWARM.hints (props changed) head/sys/mips/conf/XLR (props changed) head/sys/mips/include/cdefs.h (props changed) head/sys/mips/include/fls64.h (props changed) head/sys/mips/mips/bus_space_generic.c (props changed) head/sys/mips/mips/elf_trampoline.c (props changed) head/sys/mips/mips/inckern.S (props changed) head/sys/mips/mips/ptrace_machdep.c (props changed) head/sys/mips/mips/sys_machdep.c (props changed) head/sys/mips/rmi/ (props changed) head/sys/mips/rmi/dev/ (props changed) head/sys/mips/sibyte/ (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 19:48:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9593C106566C; Mon, 11 Jan 2010 19:48:09 +0000 (UTC) (envelope-from bogorodskiy@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 90DA28FC08; Mon, 11 Jan 2010 19:48:08 +0000 (UTC) Received: by bwz5 with SMTP id 5so14048307bwz.3 for ; Mon, 11 Jan 2010 11:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=et6fr3MRLdyRMmjaK7fsO9Vz4Rq1NRRIuR0mQAJHXrQ=; b=oVO0PrfLnLpLdkTSYgy8MGCRjSi220YOCAJMVO6R9OHiURZQVwY5hvGYlbxzhW6QXe WE8J2vm3V4R0YCVkItmJxsx21xkGrCYvxq0iE9alYGQwl6tV/TSOh5W4G1kujElxjy8S 0j7A2y6w7QJhKE55hH03PCPzFrLTMV4TauhEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=YU4v7KEfyYqXgxwmUx/wxHa/0HF0MaKKKP9eMlQ6J2J8UUyAz3X0/HOwvHQlycH1MH 2Vzila4RjND1ZvOdyCStIGMeRTsopGMxJbGsXDtuRZrSoMK/xO6M1/YsM4mht0aXSmIQ 45VcSD+s7mPuS1mXpcFYuBm+cdDGo1OzK76SM= Received: by 10.204.33.147 with SMTP id h19mr3976091bkd.156.1263237604693; Mon, 11 Jan 2010 11:20:04 -0800 (PST) Received: from underworld.novel.ru (PPPoE-78-29-97-92.san.ru [78.29.97.92]) by mx.google.com with ESMTPS id 16sm9021529bwz.7.2010.01.11.11.20.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 11 Jan 2010 11:20:02 -0800 (PST) Sender: Roman Bogorodskiy Date: Mon, 11 Jan 2010 22:16:36 +0300 From: Roman Bogorodskiy To: Qing Li Message-ID: <20100111191631.GA1709@underworld.novel.ru> References: <201001081749.o08HnONs046798@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <201001081749.o08HnONs046798@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201811 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 19:48:09 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Qing Li wrote: > Author: qingli > Date: Fri Jan 8 17:49:24 2010 > New Revision: 201811 > URL: http://svn.freebsd.org/changeset/base/201811 >=20 > Log: > Ensure an address is removed from the interface address > list when the installation of that address fails. > =20 > PR: 139559 After this change it's indeed impossible to create a tunnel with the same peer address - file exists error raises and new tun device appears without any address assigned. However, after several attempts to do it I have almost the same behavior as described in the PR. However, I cannot provide an easy way to reproduce it after this commit. Roman Bogorodskiy --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iJwEAQECAAYFAktLeQ8ACgkQgHRbOB2qykaoQAP/dIvPKIQh+PPkd3oRipSEizP9 WhLM+OomfydNctG1zSxb+Ho+3O7ZInFrE+dYM1T6GXHgxXgaxNrIbGETA8RGl9zg TGX1b5jhsUh8okK+MGclH3vAagYI3ysYeASu7sLstx3pYcorGT2aVDf+Xlpv6jgp 0ZhPiNagNemWKnLR9pQ= =DXGG -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv-- From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 19:52:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A28106566B; Mon, 11 Jan 2010 19:52:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13F548FC17; Mon, 11 Jan 2010 19:52: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 o0BJqeDp059406; Mon, 11 Jan 2010 19:52:40 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BJqe5U059404; Mon, 11 Jan 2010 19:52:40 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001111952.o0BJqe5U059404@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jan 2010 19:52: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: r202107 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 19:52:41 -0000 Author: mckusick Date: Mon Jan 11 19:52:40 2010 New Revision: 202107 URL: http://svn.freebsd.org/changeset/base/202107 Log: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of ".." will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the "extraneous hard link"; when it finds that the names have been changed but the update to ".." has not happened, it offers to rewrite ".." to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. This update changes these errors to be expected so that in preen mode fsck will simply fix these transitional errors. For now, background fsck will note these errors, but will need additional kernel support to fix them, so will simply ignore them rather than fail. A future update will allow background fsck to fix these problems. Reported by: jeff Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:30:23 2010 (r202106) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:52:40 2010 (r202107) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #define MINDIRSIZE (sizeof (struct dirtemplate)) +static int fix_extraneous(struct inoinfo *, struct inodesc *); +static int deleteentry(struct inodesc *); static int blksort(const void *, const void *); static int pass2check(struct inodesc *); @@ -236,8 +238,6 @@ pass2check(struct inodesc *idesc) union dinode *dp; const char *errmsg; struct direct proto; - char namebuf[MAXPATHLEN + 1]; - char pathbuf[MAXPATHLEN + 1]; /* * check for "." @@ -416,27 +416,12 @@ again: case DFOUND: inp = getinoinfo(dirp->d_ino); - if (inp->i_parent != 0 && idesc->id_entryno > 2) { - getpathname(pathbuf, idesc->id_number, - idesc->id_number); - getpathname(namebuf, dirp->d_ino, dirp->d_ino); - pwarn("%s%s%s %s %s\n", pathbuf, - (strcmp(pathbuf, "/") == 0 ? "" : "/"), - dirp->d_name, - "IS AN EXTRANEOUS HARD LINK TO DIRECTORY", - namebuf); - if (cursnapshot != 0) - break; - if (preen) { - printf(" (REMOVED)\n"); - n = 1; - break; - } - if ((n = reply("REMOVE")) == 1) + if (idesc->id_entryno > 2) { + if (inp->i_parent == 0) + inp->i_parent = idesc->id_number; + else if ((n = fix_extraneous(inp, idesc)) == 1) break; } - if (idesc->id_entryno > 2) - inp->i_parent = idesc->id_number; /* FALLTHROUGH */ case FSTATE: @@ -462,6 +447,109 @@ again: return (ret|KEEPON|ALTERED); } +static int +fix_extraneous(struct inoinfo *inp, struct inodesc *idesc) +{ + struct inodesc dotdesc; + char oldname[MAXPATHLEN + 1]; + char newname[MAXPATHLEN + 1]; + + /* + * If we have not yet found "..", look it up now so we know + * which inode the directory itself believes is its parent. + */ + if (inp->i_dotdot == 0) { + memset(&dotdesc, 0, sizeof(struct inodesc)); + dotdesc.id_type = DATA; + dotdesc.id_number = idesc->id_dirp->d_ino; + dotdesc.id_func = findino; + dotdesc.id_name = strdup(".."); + if ((ckinode(ginode(dotdesc.id_number), &dotdesc) & FOUND)) + inp->i_dotdot = dotdesc.id_parent; + } + /* + * We have the previously found old name (inp->i_parent) and the + * just found new name (idesc->id_number). We have five cases: + * 1) ".." is missing - can remove either name, choose to delete + * new one and let fsck create ".." pointing to old name. + * 2) Both new and old are in same directory, choose to delete + * the new name and let fsck fix ".." if it is wrong. + * 3) ".." does not point to the new name, so delete it and let + * fsck fix ".." to point to the old one if it is wrong. + * 4) ".." points to the old name only, so delete the new one. + * 5) ".." points to the new name only, so delete the old one. + * + * For cases 1-4 we eliminate the new name; + * for case 5 we eliminate the old name. + */ + if (inp->i_dotdot == 0 || /* Case 1 */ + idesc->id_number == inp->i_parent || /* Case 2 */ + inp->i_dotdot != idesc->id_number || /* Case 3 */ + inp->i_dotdot == inp->i_parent) { /* Case 4 */ + getpathname(newname, idesc->id_number, idesc->id_number); + if (strcmp(newname, "/") != 0) + strcat (newname, "/"); + strcat(newname, idesc->id_dirp->d_name); + getpathname(oldname, inp->i_number, inp->i_number); + pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s\n", + newname, oldname); + if (cursnapshot != 0) { + /* + * We need to + * setcwd(idesc->id_number); + * unlink(idesc->id_dirp->d_name); + */ + printf(" (IGNORED)\n"); + return (0); + } + if (preen) { + printf(" (REMOVED)\n"); + return (1); + } + return (reply("REMOVE")); + } + /* + * None of the first four cases above, so must be case (5). + * Eliminate the old name and make the new the name the parent. + */ + getpathname(oldname, inp->i_parent, inp->i_number); + getpathname(newname, inp->i_number, inp->i_number); + pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s\n", oldname, + newname); + if (cursnapshot != 0) { + /* + * We need to + * setcwd(inp->i_parent); + * unlink(last component of oldname pathname); + */ + printf(" (IGNORED)\n"); + return (0); + } + if (!preen && !reply("REMOVE")) + return (0); + memset(&dotdesc, 0, sizeof(struct inodesc)); + dotdesc.id_type = DATA; + dotdesc.id_number = inp->i_parent; /* directory in which name appears */ + dotdesc.id_parent = inp->i_number; /* inode number in entry to delete */ + dotdesc.id_func = deleteentry; + if ((ckinode(ginode(dotdesc.id_number), &dotdesc) & FOUND) && preen) + printf(" (REMOVED)\n"); + inp->i_parent = idesc->id_number; /* reparent to correct directory */ + inoinfo(inp->i_number)->ino_linkcnt++; /* name gone, return reference */ + return (0); +} + +static int +deleteentry(struct inodesc *idesc) +{ + struct direct *dirp = idesc->id_dirp; + + if (idesc->id_entryno++ < 2 || dirp->d_ino != idesc->id_parent) + return (KEEPON); + dirp->d_ino = 0; + return (ALTERED|STOP|FOUND); +} + /* * Routine to sort disk blocks. */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 20:05:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4931B106566B; Mon, 11 Jan 2010 20:05:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379D18FC0C; Mon, 11 Jan 2010 20:05: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 o0BK5dKM062428; Mon, 11 Jan 2010 20:05:39 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BK5dCQ062426; Mon, 11 Jan 2010 20:05:39 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001112005.o0BK5dCQ062426@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jan 2010 20:05: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: r202109 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 20:05:39 -0000 Author: mckusick Date: Mon Jan 11 20:05:38 2010 New Revision: 202109 URL: http://svn.freebsd.org/changeset/base/202109 Log: This update utilizes new fsck sysctl commands that allow fsck running in background mode to correct expected inconsistencies that arise during directory rename (see immediately previous update to this file for details). If run on a kernel without the new functionality, background fsck will simply ignore these inconsistencies rather than fail. Reported by: jeff Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:59:12 2010 (r202108) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 20:05:38 2010 (r202109) @@ -36,12 +36,14 @@ static const char sccsid[] = "@(#)pass2. __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include +#include #include #include @@ -214,9 +216,48 @@ pass2(void) inoinfo(inp->i_parent)->ino_linkcnt--; continue; } - fileerror(inp->i_parent, inp->i_number, - "BAD INODE NUMBER FOR '..'"); - if (reply("FIX") == 0) + /* + * Here we have: + * inp->i_number is directory with bad ".." in it. + * inp->i_dotdot is current value of "..". + * inp->i_parent is directory to which ".." should point. + */ + getpathname(pathbuf, inp->i_parent, inp->i_number); + printf("BAD INODE NUMBER FOR '..' in DIR I=%d (%s)\n", + inp->i_number, pathbuf); + getpathname(pathbuf, inp->i_dotdot, inp->i_dotdot); + printf("CURRENTLY POINTS TO I=%d (%s), ", inp->i_dotdot, + pathbuf); + getpathname(pathbuf, inp->i_parent, inp->i_parent); + printf("SHOULD POINT TO I=%d (%s)", inp->i_parent, pathbuf); + if (cursnapshot != 0) { + /* + * We need to: + * setcwd(inp->i_number); + * setdotdot(inp->i_dotdot, inp->i_parent); + */ + cmd.value = inp->i_number; + if (sysctlbyname("vfs.ffs.setcwd", 0, 0, + &cmd, sizeof cmd) == -1) { + /* kernel lacks support for these functions */ + printf(" (IGNORED)\n"); + continue; + } + cmd.value = inp->i_dotdot; /* verify same value */ + cmd.size = inp->i_parent; /* new parent */ + if (sysctlbyname("vfs.ffs.setdotdot", 0, 0, + &cmd, sizeof cmd) == -1) { + printf(" (FIX FAILED: %s)\n", strerror(errno)); + continue; + } + printf(" (FIXED)\n"); + inoinfo(inp->i_parent)->ino_linkcnt--; + inp->i_dotdot = inp->i_parent; + continue; + } + if (preen) + printf(" (FIXED)\n"); + else if (reply("FIX") == 0) continue; inoinfo(inp->i_dotdot)->ino_linkcnt++; inoinfo(inp->i_parent)->ino_linkcnt--; @@ -450,6 +491,7 @@ again: static int fix_extraneous(struct inoinfo *inp, struct inodesc *idesc) { + char *cp; struct inodesc dotdesc; char oldname[MAXPATHLEN + 1]; char newname[MAXPATHLEN + 1]; @@ -491,7 +533,7 @@ fix_extraneous(struct inoinfo *inp, stru strcat (newname, "/"); strcat(newname, idesc->id_dirp->d_name); getpathname(oldname, inp->i_number, inp->i_number); - pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s\n", + pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s", newname, oldname); if (cursnapshot != 0) { /* @@ -499,7 +541,21 @@ fix_extraneous(struct inoinfo *inp, stru * setcwd(idesc->id_number); * unlink(idesc->id_dirp->d_name); */ - printf(" (IGNORED)\n"); + cmd.value = idesc->id_number; + if (sysctlbyname("vfs.ffs.setcwd", 0, 0, + &cmd, sizeof cmd) == -1) { + printf(" (IGNORED)\n"); + return (0); + } + cmd.value = (int)idesc->id_dirp->d_name; + cmd.size = inp->i_number; /* verify same name */ + if (sysctlbyname("vfs.ffs.unlink", 0, 0, + &cmd, sizeof cmd) == -1) { + printf(" (UNLINK FAILED: %s)\n", + strerror(errno)); + return (0); + } + printf(" (REMOVED)\n"); return (0); } if (preen) { @@ -514,7 +570,7 @@ fix_extraneous(struct inoinfo *inp, stru */ getpathname(oldname, inp->i_parent, inp->i_number); getpathname(newname, inp->i_number, inp->i_number); - pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s\n", oldname, + pwarn("%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s", oldname, newname); if (cursnapshot != 0) { /* @@ -522,7 +578,26 @@ fix_extraneous(struct inoinfo *inp, stru * setcwd(inp->i_parent); * unlink(last component of oldname pathname); */ - printf(" (IGNORED)\n"); + cmd.value = inp->i_parent; + if (sysctlbyname("vfs.ffs.setcwd", 0, 0, + &cmd, sizeof cmd) == -1) { + printf(" (IGNORED)\n"); + return (0); + } + if ((cp = rindex(oldname, '/')) == NULL) { + printf(" (IGNORED)\n"); + return (0); + } + cmd.value = (int)(cp + 1); + cmd.size = inp->i_number; /* verify same name */ + if (sysctlbyname("vfs.ffs.unlink", 0, 0, + &cmd, sizeof cmd) == -1) { + printf(" (UNLINK FAILED: %s)\n", + strerror(errno)); + return (0); + } + printf(" (REMOVED)\n"); + inp->i_parent = idesc->id_number; /* reparent to correct dir */ return (0); } if (!preen && !reply("REMOVE")) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 20:23:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54CC1106568F; Mon, 11 Jan 2010 20:23:37 +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 257A98FC14; Mon, 11 Jan 2010 20:23:37 +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 CA72446B35; Mon, 11 Jan 2010 15:23:36 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2D9988A01F; Mon, 11 Jan 2010 15:23:22 -0500 (EST) From: John Baldwin To: Warner Losh Date: Mon, 11 Jan 2010 14:51:14 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091231; KDE/4.3.1; amd64; ; ) References: <201001111921.o0BJLq8F052531@svn.freebsd.org> In-Reply-To: <201001111921.o0BJLq8F052531@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201001111451.14694.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 11 Jan 2010 15:23:36 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202105 - in head/sys: dev/cfe dev/flash dev/siba mips/conf mips/include mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 20:23:37 -0000 On Monday 11 January 2010 2:21:52 pm Warner Losh wrote: > Author: imp > Date: Mon Jan 11 19:21:52 2010 > New Revision: 202105 > URL: http://svn.freebsd.org/changeset/base/202105 > > Log: > Using svn cp rather than cp to copy these files over had the benefit > of preserving their history. It had the problem that it also copied > over mergeinfo data. Since we're retiring the projects/mips branch, > I'm removing the svn:mergeinfo property from them all. > > Submitted by: jhb Thanks. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 20:44:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D641E106566C; Mon, 11 Jan 2010 20:44:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38328FC08; Mon, 11 Jan 2010 20:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0BKi5iY071241; Mon, 11 Jan 2010 20:44:05 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BKi5s3071234; Mon, 11 Jan 2010 20:44:05 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001112044.o0BKi5s3071234@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jan 2010 20:44:05 +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: r202113 - in head/sys: compat/linux kern sys ufs/ffs ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 20:44:05 -0000 Author: mckusick Date: Mon Jan 11 20:44:05 2010 New Revision: 202113 URL: http://svn.freebsd.org/changeset/base/202113 Log: Background: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of ".." will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the "extraneous hard link"; when it finds that the names have been changed but the update to ".." has not happened, it offers to rewrite ".." to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. Fsck running in preen mode or background mode now corrects these expected inconsistencies that arise during directory rename. The functionality added with this update is used by fsck running in background mode to make these fixes. Solution: This update adds three new fsck sysctl commands to support background fsck in correcting expected inconsistencies that arise from incomplete directory rename operations. They are: setcwd(dirinode) - set the current directory to dirinode in the filesystem associated with the snapshot. setdotdot(oldvalue, newvalue) - Verify that the inode number for ".." in the current directory is oldvalue then change it to newvalue. unlink(nameptr, oldvalue) - Verify that the inode number associated with nameptr in the current directory is oldvalue then unlink it. As with all other fsck sysctls, these new ones may only be used by processes with appropriate priviledge. Reported by: jeff Security issues: rwatson Modified: head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/compat/linux/linux_file.c Mon Jan 11 20:44:05 2010 (r202113) @@ -652,7 +652,7 @@ linux_unlinkat(struct thread *td, struct if (args->flag & LINUX_AT_REMOVEDIR) error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE); else - error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE); + error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0); if (error == EPERM && !(args->flag & LINUX_AT_REMOVEDIR)) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, AT_SYMLINK_NOFOLLOW, dfd, path, Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/kern/vfs_syscalls.c Mon Jan 11 20:44:05 2010 (r202113) @@ -1815,23 +1815,25 @@ unlinkat(struct thread *td, struct unlin if (flag & AT_REMOVEDIR) return (kern_rmdirat(td, fd, path, UIO_USERSPACE)); else - return (kern_unlinkat(td, fd, path, UIO_USERSPACE)); + return (kern_unlinkat(td, fd, path, UIO_USERSPACE, 0)); } int kern_unlink(struct thread *td, char *path, enum uio_seg pathseg) { - return (kern_unlinkat(td, AT_FDCWD, path, pathseg)); + return (kern_unlinkat(td, AT_FDCWD, path, pathseg, 0)); } int -kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg) +kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, + ino_t oldinum) { struct mount *mp; struct vnode *vp; int error; struct nameidata nd; + struct stat sb; int vfslocked; restart: @@ -1842,9 +1844,13 @@ restart: return (error == EINVAL ? EPERM : error); vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; - if (vp->v_type == VDIR) + if (vp->v_type == VDIR && oldinum == 0) { error = EPERM; /* POSIX */ - else { + } else if (oldinum != 0 && + ((error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && + sb.st_ino != oldinum) { + error = EIDRM; /* Identifier removed */ + } else { /* * The root of a mounted filesystem cannot be deleted. * Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/sys/syscallsubr.h Mon Jan 11 20:44:05 2010 (r202113) @@ -212,7 +212,7 @@ int kern_truncate(struct thread *td, cha off_t length); int kern_unlink(struct thread *td, char *path, enum uio_seg pathseg); int kern_unlinkat(struct thread *td, int fd, char *path, - enum uio_seg pathseg); + enum uio_seg pathseg, ino_t oldinum); int kern_utimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_utimesat(struct thread *td, int fd, char *path, Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jan 11 20:44:05 2010 (r202113) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -76,9 +77,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include + +#include #include #include #include @@ -2328,7 +2333,7 @@ ffs_fserr(fs, inum, cp) /* * This function provides the capability for the fsck program to - * update an active filesystem. Eleven operations are provided: + * update an active filesystem. Fourteen operations are provided: * * adjrefcnt(inode, amt) - adjusts the reference count on the * specified inode by the specified amount. Under normal @@ -2349,6 +2354,12 @@ ffs_fserr(fs, inum, cp) * as in use. * setflags(flags, set/clear) - the fs_flags field has the specified * flags set (second parameter +1) or cleared (second parameter -1). + * setcwd(dirinode) - set the current directory to dirinode in the + * filesystem associated with the snapshot. + * setdotdot(oldvalue, newvalue) - Verify that the inode number for ".." + * in the current directory is oldvalue then change it to newvalue. + * unlink(nameptr, oldvalue) - Verify that the inode number associated + * with nameptr in the current directory is oldvalue then unlink it. */ static int sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS); @@ -2386,6 +2397,15 @@ static SYSCTL_NODE(_vfs_ffs, FFS_BLK_FRE static SYSCTL_NODE(_vfs_ffs, FFS_SET_FLAGS, setflags, CTLFLAG_WR, sysctl_ffs_fsck, "Change Filesystem Flags"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_CWD, setcwd, CTLFLAG_WR, + sysctl_ffs_fsck, "Set Current Working Directory"); + +static SYSCTL_NODE(_vfs_ffs, FFS_SET_DOTDOT, setdotdot, CTLFLAG_WR, + sysctl_ffs_fsck, "Change Value of .. Entry"); + +static SYSCTL_NODE(_vfs_ffs, FFS_UNLINK, unlink, CTLFLAG_WR, + sysctl_ffs_fsck, "Unlink a Duplicate Name"); + #ifdef DEBUG static int fsckcmds = 0; SYSCTL_INT(_debug, OID_AUTO, fsckcmds, CTLFLAG_RW, &fsckcmds, 0, ""); @@ -2394,16 +2414,18 @@ SYSCTL_INT(_debug, OID_AUTO, fsckcmds, C static int sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) { + struct thread *td = curthread; struct fsck_cmd cmd; struct ufsmount *ump; - struct vnode *vp; - struct inode *ip; + struct vnode *vp, *vpold, *dvp, *fdvp; + struct inode *ip, *dp; struct mount *mp; struct fs *fs; ufs2_daddr_t blkno; long blkcnt, blksize; + struct filedesc *fdp; struct file *fp; - int filetype, error; + int vfslocked, filetype, error; if (req->newlen > sizeof cmd) return (EBADRPC); @@ -2413,15 +2435,20 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) return (ERPCMISMATCH); if ((error = getvnode(curproc->p_fd, cmd.handle, &fp)) != 0) return (error); - vn_start_write(fp->f_data, &mp, V_WAIT); + vp = fp->f_data; + if (vp->v_type != VREG && vp->v_type != VDIR) { + fdrop(fp, td); + return (EINVAL); + } + vn_start_write(vp, &mp, V_WAIT); if (mp == 0 || strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN)) { vn_finished_write(mp); - fdrop(fp, curthread); + fdrop(fp, td); return (EINVAL); } if (mp->mnt_flag & MNT_RDONLY) { vn_finished_write(mp); - fdrop(fp, curthread); + fdrop(fp, td); return (EROFS); } ump = VFSTOUFS(mp); @@ -2553,6 +2580,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DEBUG */ fs->fs_cstotal.cs_ndir += cmd.value; break; + case FFS_ADJ_NBFREE: #ifdef DEBUG if (fsckcmds) { @@ -2562,6 +2590,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DEBUG */ fs->fs_cstotal.cs_nbfree += cmd.value; break; + case FFS_ADJ_NIFREE: #ifdef DEBUG if (fsckcmds) { @@ -2571,6 +2600,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DEBUG */ fs->fs_cstotal.cs_nifree += cmd.value; break; + case FFS_ADJ_NFFREE: #ifdef DEBUG if (fsckcmds) { @@ -2580,6 +2610,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #endif /* DEBUG */ fs->fs_cstotal.cs_nffree += cmd.value; break; + case FFS_ADJ_NUMCLUSTERS: #ifdef DEBUG if (fsckcmds) { @@ -2590,6 +2621,91 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) fs->fs_cstotal.cs_numclusters += cmd.value; break; + case FFS_SET_CWD: +#ifdef DEBUG + if (fsckcmds) { + printf("%s: set current directory to inode %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); + } +#endif /* DEBUG */ + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_SHARED, &vp))) + break; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + AUDIT_ARG_VNODE1(vp); + if ((error = change_dir(vp, td)) != 0) { + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + break; + } + VOP_UNLOCK(vp, 0); + VFS_UNLOCK_GIANT(vfslocked); + fdp = td->td_proc->p_fd; + FILEDESC_XLOCK(fdp); + vpold = fdp->fd_cdir; + fdp->fd_cdir = vp; + FILEDESC_XUNLOCK(fdp); + vfslocked = VFS_LOCK_GIANT(vpold->v_mount); + vrele(vpold); + VFS_UNLOCK_GIANT(vfslocked); + break; + + case FFS_SET_DOTDOT: +#ifdef DEBUG + if (fsckcmds) { + printf("%s: change .. in cwd from %jd to %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + (intmax_t)cmd.size); + } +#endif /* DEBUG */ + /* + * First we have to get and lock the parent directory + * to which ".." points. + */ + error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &fdvp); + if (error) + break; + /* + * Now we get and lock the child directory containing "..". + */ + FILEDESC_SLOCK(td->td_proc->p_fd); + dvp = td->td_proc->p_fd->fd_cdir; + FILEDESC_SUNLOCK(td->td_proc->p_fd); + if ((error = vget(dvp, LK_EXCLUSIVE, td)) != 0) { + vput(fdvp); + break; + } + dp = VTOI(dvp); + dp->i_offset = 12; /* XXX mastertemplate.dot_reclen */ + error = ufs_dirrewrite(dp, VTOI(fdvp), (ino_t)cmd.size, + DT_DIR, 0); + cache_purge(fdvp); + cache_purge(dvp); + vput(dvp); + vput(fdvp); + break; + + case FFS_UNLINK: +#ifdef DEBUG + if (fsckcmds) { + char buf[32]; + + if (copyinstr((char *)(int)cmd.value, buf, 32, NULL)) + strncpy(buf, "Name_too_long", 32); + printf("%s: unlink %s (inode %jd)\n", + mp->mnt_stat.f_mntonname, buf, (intmax_t)cmd.size); + } +#endif /* DEBUG */ + /* + * kern_unlinkat will do its own start/finish writes and + * they do not nest, so drop ours here. Setting mp == NULL + * indicates that vn_finished_write is not needed down below. + */ + vn_finished_write(mp); + mp = NULL; + error = kern_unlinkat(td, AT_FDCWD, (char *)(int)cmd.value, + UIO_USERSPACE, (ino_t)cmd.size); + break; + default: #ifdef DEBUG if (fsckcmds) { @@ -2601,7 +2717,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; } - fdrop(fp, curthread); + fdrop(fp, td); vn_finished_write(mp); return (error); } Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/ufs/ffs/fs.h Mon Jan 11 20:44:05 2010 (r202113) @@ -211,7 +211,10 @@ #define FFS_ADJ_NIFREE 9 /* adjust number of free inodes */ #define FFS_ADJ_NFFREE 10 /* adjust number of free frags */ #define FFS_ADJ_NUMCLUSTERS 11 /* adjust number of free clusters */ -#define FFS_MAXID 12 /* number of valid ffs ids */ +#define FFS_SET_CWD 12 /* set current directory */ +#define FFS_SET_DOTDOT 13 /* set inode number for ".." */ +#define FFS_UNLINK 14 /* remove a name in the filesystem */ +#define FFS_MAXID 15 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/ufs/ufs/ufs_lookup.c Mon Jan 11 20:44:05 2010 (r202113) @@ -1224,6 +1224,11 @@ ufs_dirrewrite(dp, oip, newinum, newtype error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); if (error) return (error); + if (ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && + ep->d_ino != oip->i_number) { + brelse(bp); + return (EIDRM); + } ep->d_ino = newinum; if (!OFSFMT(vdp)) ep->d_type = newtype; From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 21:17:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 721221065692; Mon, 11 Jan 2010 21:17:49 +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 61E528FC19; Mon, 11 Jan 2010 21:17: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 o0BLHnbn078867; Mon, 11 Jan 2010 21:17:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLHnFn078865; Mon, 11 Jan 2010 21:17:49 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001112117.o0BLHnFn078865@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 11 Jan 2010 21:17: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: r202115 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:17:49 -0000 Author: gavin Date: Mon Jan 11 21:17:49 2010 New Revision: 202115 URL: http://svn.freebsd.org/changeset/base/202115 Log: Our standard "xterm" termcap entry supports colour, so this tip is redundant. As it happens, "xterm-color" has just been an alias for "xterm" since src/share/termcap/termcap.src 1.131 in September 2002. PR: docs/132959 Approved by: ed (mentor) Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips ============================================================================== --- head/games/fortune/datfiles/freebsd-tips Mon Jan 11 21:01:35 2010 (r202114) +++ head/games/fortune/datfiles/freebsd-tips Mon Jan 11 21:17:49 2010 (r202115) @@ -50,18 +50,6 @@ If you are in the C shell and have just be able to run it unless you first type "rehash". -- Dru % -If you are running xterm, the default TERM variable will be 'xterm'. If you -set this environment variable to 'xterm-color' instead, a lot of programs will -use colors. You can do this by - - TERM=xterm-color; export TERM - -in Bourne-derived shells, and - - setenv TERM xterm-color - -in csh-derived shells. -% If you do not want to get beeps in X11 (X Windows), you can turn them off with xset b off From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 21:21:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B22C106566B; Mon, 11 Jan 2010 21:21:30 +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 4B0038FC59; Mon, 11 Jan 2010 21:21: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 o0BLLU7D079723; Mon, 11 Jan 2010 21:21:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BLLUx0079721; Mon, 11 Jan 2010 21:21:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001112121.o0BLLUx0079721@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 11 Jan 2010 21:21: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: r202116 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:21:30 -0000 Author: bz Date: Mon Jan 11 21:21:30 2010 New Revision: 202116 URL: http://svn.freebsd.org/changeset/base/202116 Log: Adjust a comment to reflect reality, as we have proper source address selection, even for IPv4, since r183571. Pointed out by: Jase Thew (bazerka beardz.net) MFC after: 3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Jan 11 21:17:49 2010 (r202115) +++ head/sys/kern/kern_jail.c Mon Jan 11 21:21:30 2010 (r202116) @@ -753,7 +753,9 @@ kern_jail_set(struct thread *td, struct * IP addresses are all sorted but ip[0] to preserve * the primary IP address as given from userland. * This special IP is used for unbound outgoing - * connections as well for "loopback" traffic. + * connections as well for "loopback" traffic in case + * source address selection cannot find any more fitting + * address to connect from. */ if (ip4s > 1) qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), qcmp_v4); From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 21:35:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72851065670; Mon, 11 Jan 2010 21:35:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 48FA58FC0C; Mon, 11 Jan 2010 21:35:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 21E1441C750; Mon, 11 Jan 2010 22:35:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id lyzbZYtEftxa; Mon, 11 Jan 2010 22:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 8A29941C75D; Mon, 11 Jan 2010 22:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 4EDF94448EC; Mon, 11 Jan 2010 21:31:28 +0000 (UTC) Date: Mon, 11 Jan 2010 21:31:28 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Kirk McKusick In-Reply-To: <201001112044.o0BKi5s3071234@svn.freebsd.org> Message-ID: <20100111213038.I50938@maildrop.int.zabbadoz.net> References: <201001112044.o0BKi5s3071234@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: r202113 - in head/sys: compat/linux kern sys ufs/ffs ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 21:35:07 -0000 On Mon, 11 Jan 2010, Kirk McKusick wrote: > Author: mckusick > Date: Mon Jan 11 20:44:05 2010 > New Revision: 202113 > URL: http://svn.freebsd.org/changeset/base/202113 > > Log: > Background: > > When renaming a directory it passes through several intermediate > states. First its new name will be created causing it to have two > names (from possibly different parents). Next, if it has different ... > Modified: > head/sys/compat/linux/linux_file.c > head/sys/kern/vfs_syscalls.c > head/sys/sys/syscallsubr.h > head/sys/ufs/ffs/ffs_alloc.c > head/sys/ufs/ffs/fs.h > head/sys/ufs/ufs/ufs_lookup.c it seesm this broke the build on amd64: 34 /scratch/tmp/bz/HEAD.commit/sys/ufs/ffs/ffs_alloc.c: In function 'sysctl_ffs_fsck': 35 /scratch/tmp/bz/HEAD.commit/sys/ufs/ffs/ffs_alloc.c:2705: warning: cast to pointer from integer of different size -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:08:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ACCE106566C; Mon, 11 Jan 2010 22:08:59 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8B88FC18; Mon, 11 Jan 2010 22:08: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 o0BM8xfw090454; Mon, 11 Jan 2010 22:08:59 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BM8xJs090452; Mon, 11 Jan 2010 22:08:59 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112208.o0BM8xJs090452@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 22:08: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: r202119 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:08:59 -0000 Author: gallatin Date: Mon Jan 11 22:08:59 2010 New Revision: 202119 URL: http://svn.freebsd.org/changeset/base/202119 Log: Fix reporting of 10G Twinax media Reported by: mjacob MFC after: 3 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jan 11 21:32:39 2010 (r202118) +++ head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:08:59 2010 (r202119) @@ -2774,6 +2774,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { + {IFM_10G_TWINAX, 0, "10GBASE-Twinax"}, {0, (1 << 7), "Reserved"}, {IFM_10G_LRM, (1 << 6), "10GBASE-LRM"}, {IFM_10G_LR, (1 << 5), "10GBASE-LR"}, @@ -2908,7 +2909,7 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc->dev, "%s:%s\n", cage_type, mxge_media_types[0].name); - mxge_set_media(sc, IFM_10G_CX4); + mxge_set_media(sc, mxge_media_types[0].flag); return; } for (i = 1; i < mxge_media_type_entries; i++) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:25:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F415B106566B; Mon, 11 Jan 2010 22:25:09 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE3F88FC12; Mon, 11 Jan 2010 22:25: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 o0BMP92T094011; Mon, 11 Jan 2010 22:25:09 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BMP90X094008; Mon, 11 Jan 2010 22:25:09 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112225.o0BMP90X094008@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 22:25: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: r202120 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:25:10 -0000 Author: gallatin Date: Mon Jan 11 22:25:09 2010 New Revision: 202120 URL: http://svn.freebsd.org/changeset/base/202120 Log: Update mxge(4) firmware to 1.4.48b (latest available) from Myricom. Pertinant highlights from Myricom CHANGES file include: - Make sure invalid external smbus activity cannot affect performance - Fix to avoid a bug where the link could sometimes stay reported as up on after unplugging the cable. - For 8B NIC, make smbus connection passive at init to avoid possible address conflicts - Increase number of slices to 17 for multi-slice fw - Fix a bug where packets dropped because of link_overflow could be occasionally reported as bad_crc32 - Add selectable failover strategy for dual-port chip: symmetric or primary/backup - On failover, send RARP broadcast to make the change immediately known to the network - Change endianess for PCI Device Serial Number - For dual-port NICs, time to failover is now a few microsecs instead of a few millisecs. MFC after: 3 days Modified: head/sys/dev/mxge/eth_z8e.h head/sys/dev/mxge/ethp_z8e.h head/sys/dev/mxge/rss_eth_z8e.h head/sys/dev/mxge/rss_ethp_z8e.h Modified: head/sys/dev/mxge/eth_z8e.h ============================================================================== --- head/sys/dev/mxge/eth_z8e.h Mon Jan 11 22:08:59 2010 (r202119) +++ head/sys/dev/mxge/eth_z8e.h Mon Jan 11 22:25:09 2010 (r202120) @@ -28,7033 +28,7255 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 359956 ; -static unsigned int eth_z8e_length = 112403 ; -static unsigned char eth_z8e[112403 + 1] = - "\x78\x9c\xec\xbd\x7f\x7c\x54\xd5\xb5\x37\xbc\x72\x32\xc0\x24\x8d" - "\x4c\xc4\x48\x47\x44\x1d\x14\xda\xa8\x41\xa2\x62\x8b\x16\x24\x4a" - "\xb4\xd0\xcb\x8f\xa8\x60\xd3\x8a\x26\x68\x82\x41\x23\x44\x88\x10" - "\x30\x64\xc2\x80\x36\xa1\x40\x52\x49\x21\x40\x48\x62\x8b\x82\x2d" - "\x48\x04\xda\xe6\xf6\xa2\x8e\x25\xbe\x1f\x7a\x9b\x64\x62\x5f\xfa" - "\x1a\x7d\xb0\x1d\xb8\x91\xa6\x3c\x01\x46\x32\x90\x31\x99\x99\xfd" - "\x7c\xd7\xde\xe7\x24\x33\xc3\x04\xe5\xf6\x7e\xde\xe7\x9f\xe6\xf3" - "\x99\x9c\x73\xf6\xd9\x7b\xed\xb5\xd7\x5e\x7b\xed\xb5\xf6\x5e\x7b" - "\x1d\xa2\x7f\xe2\x4f\xdb\xd7\xf8\xcf\x14\xff\xd7\xdf\xbf\xfe\xfe" - "\xf5\xf7\xaf\xbf\x7f\xfd\xfd\xeb\xef\x5f\x7f\xff\x77\xfe\xce\x6b" - "\x26\xfa\x43\x25\x51\x8f\xc3\x6c\x75\xd3\xb9\xe2\xad\x9b\x85\x1f" - "\xc9\x31\x6e\x32\x5b\xf9\xaa\xff\xe8\x35\xa4\x6b\x95\x64\xbe\x39" - "\x91\x12\xa6\xed\x24\xaa\x1a\x29\xba\x36\x6f\x11\x9e\xb5\x5b\x44" - "\x57\xfa\x1b\x44\x4d\x63\x89\x36\x8f\x14\x5e\xc0\x99\xef\xa6\x1f" - "\x75\x30\x9c\xb5\x78\xe6\xf7\xeb\x46\x0a\x0f\xd2\x0b\xdd\xf4\xe3" - "\xf9\x9c\xbe\x66\x24\x60\x25\x11\x39\xb6\x08\x5f\x08\x5c\x33\x97" - "\x67\x98\xe9\x63\x24\x3e\xbb\x22\xe0\x30\x8c\x46\xc0\x38\x76\x19" - "\x18\x09\x06\x5e\x5e\x8d\x62\x18\x5e\xb7\x83\xac\x5e\x87\xf3\x5a" - "\x94\xf5\xa2\x4d\xc9\x5c\xb6\x02\x79\x84\x83\x62\x9b\x8a\xfc\x64" - "\xbb\x99\x62\x4e\x51\xdc\x3f\x70\xd5\x70\xfd\x8c\xdb\xbb\x56\x95" - "\x1b\xcb\x30\x50\x36\xa6\xc7\x11\x97\xda\x5f\x16\xb0\x6d\x25\x64" - "\x42\xde\x77\xbc\x9a\x53\x53\x79\x13\xe3\xf4\xbc\x1a\xf2\xce\x37" - "\xf2\xaa\x77\xda\x0c\xfd\xdd\x37\xf0\xae\x28\xfc\x9d\xe9\x35\xfd" - "\x5d\x02\xde\x55\x45\xe0\x67\x72\xf5\xfa\x09\xf5\x30\x2e\x36\x37" - "\xae\x47\xd0\x33\x3a\x6e\x8c\x53\x13\xf2\x97\x72\xfe\x74\x9b\xf0" - "\xcf\xb5\x91\xc4\x85\x69\x87\xbc\xd3\x8f\xd4\xab\xbc\xb8\x1f\xcd" - "\xe5\xf5\x7b\x1b\xee\x65\xba\x5e\xef\xd5\x3d\x8e\xf8\x84\x70\x9c" - "\x88\xf4\x77\x23\xf0\x2e\x39\xfc\xdd\x7b\xa9\xfa\xbb\x6f\xe2\x5d" - "\x7a\xf8\xbb\x18\xa3\x9c\x15\xef\xb2\x8d\x77\xa1\xfd\xa4\x38\xce" - "\x84\xdf\x10\x33\xd1\x50\xfc\x86\x99\x8d\xbe\x5b\x66\x15\x41\xfb" - "\x75\x64\x12\xeb\xb7\x94\x05\x1d\x82\x5c\x45\x3e\xb2\x8d\x22\xfb" - "\x49\x8a\x6f\x03\x5c\xda\xb4\x8a\xcc\xf6\x02\xe1\x73\x15\x75\x51" - "\xab\xa7\x8b\xec\x1e\xd1\xe9\xf2\x5f\xa0\x92\x0b\x64\x76\xf9\xcf" - "\x50\xc9\x8b\x64\x6d\x2a\xfe\x9c\xa2\xf1\x45\x50\x13\x64\x1f\xcd" - "\x65\x3b\xa8\xb5\xa6\x83\xec\x35\xe1\x65\xed\x37\x90\xb5\x05\xcf" - "\xa0\xb9\x85\xf1\x68\xb2\xf9\xc9\x1f\xbf\xa5\xac\x78\x1b\x99\xec" - "\x63\x48\x6b\xc9\x71\xea\xb8\x7c\xa3\x9a\x71\x59\x77\x9a\xcc\xbf" - "\x5c\x88\xbe\x3f\xcd\xf8\xd6\x96\xed\x5f\xe5\xd3\x8e\x58\x67\xd2" - "\x11\xeb\x71\x6a\xb2\x4e\xa1\xa6\xa2\x74\xda\x74\x9a\x12\x8e\xf8" - "\x26\x53\x93\xe9\x61\x8c\x8d\x74\x72\x75\xe1\xde\x16\x40\x1e\x2f" - "\xd9\x96\x13\xfa\xf5\x1b\x65\x55\xcf\x91\xd9\xad\x60\xa2\x3f\xbf" - "\x51\xf5\x41\x21\x11\xd3\x8c\x9f\xa3\xb5\x63\xd9\x75\x64\x05\x7e" - "\x9d\xc0\xe5\x5e\xe0\xd2\x32\xd6\x4a\xa9\xc0\x79\x98\xab\xda\x4f" - "\xa6\x62\x8a\x1b\x64\x4c\x24\x05\x1d\x72\x6c\x76\xd5\x6e\x11\x9d" - "\xcc\x5b\xdd\x2f\x67\x62\x7c\x25\x98\x50\xf7\x2e\xae\x6f\x13\xc6" - "\xa8\xfd\x75\x32\x75\xaf\xc8\x8c\xa9\xdb\x22\x3a\xf0\xce\x66\xbc" - "\x03\xbf\x77\xe0\x7d\xe7\x84\x24\x4a\x74\xf9\xd3\xe8\xfd\xde\x4e" - "\x13\xc3\x18\xee\xa5\x18\x86\x67\x29\xa2\x58\xb4\x67\x08\xf0\xf9" - "\xa2\x0e\xe9\xb7\x20\x1f\xca\xa3\xff\xd7\xef\xe1\xf2\xe2\x9b\x4f" - "\x78\x83\xdf\x7c\xe2\x42\x70\xeb\x13\xdd\x62\xeb\x13\xe7\x03\x5b" - "\x9f\xf8\xc2\xbe\x92\xcc\x81\x6f\x3e\xe1\x69\x2d\x90\x7d\x90\xd8" - "\x5a\x80\x3e\x08\x90\x79\xf5\x19\x4a\x7c\xea\x45\xf4\xbd\xff\x33" - "\x5a\xbd\x88\xac\xc1\xb8\x9d\x69\x2e\xff\x5f\xe8\xa9\x62\x12\xb8" - "\xcf\x88\xd6\xbe\xee\xf8\xda\xa3\x8a\x67\xcd\xdc\xa6\x76\xb7\xf6" - "\x73\x39\x26\x3c\x71\x6f\x1e\xc5\xaf\x19\xbf\x36\xfc\x8e\x89\xf8" - "\xda\x63\xa0\x95\x7d\xf8\x9a\x18\xaa\xed\x25\x9a\x10\xa4\x18\x74" - "\x91\x17\xf8\x27\x0e\x42\xb7\xd1\xc1\xf5\xef\x54\x7e\xbb\x94\x4a" - "\x7a\x7a\xf2\x88\x65\x0a\xcb\x13\x96\x2f\x3d\x8e\xab\xd2\x50\x8f" - "\x53\xf2\xfe\x16\xe1\x15\xf1\xef\x54\x22\xbd\xd3\xfb\x72\x5e\x8c" - "\xe7\xe5\x3c\xad\x3b\xfe\x9d\xcd\xc8\x93\x83\x3c\x3e\x9d\x86\x9d" - "\x0c\x0b\xe3\xc4\x73\x95\x9f\x62\x01\xb3\xe0\x77\x17\xdb\x4d\x3b" - "\xb7\x88\xe3\xc8\xb7\xa1\x1f\x16\x60\x03\x0e\xe8\x7f\x55\xbd\x91" - "\x06\x5a\x77\x6c\x44\x3e\x2e\xef\xf2\xa5\xb1\xdc\x75\xbb\xf2\x3b" - "\xc9\xe2\xa7\x78\xd1\xa7\xea\x43\x9e\x4e\x96\x8f\x57\xf9\x68\x68" - "\x8f\x83\x32\x18\x36\x97\x73\x75\x75\x12\xca\x6d\x16\xf6\x3c\xc8" - "\x25\x9a\xdd\x23\xf2\x62\x20\x8b\x3b\x8e\xa0\xbc\xaa\x7b\xb8\xd9" - "\xc0\x91\xeb\xe0\xbe\x96\x78\x82\x1f\x8e\xe4\xfb\xe8\xaa\x6a\x8a" - "\x45\xb9\xc7\x18\x1e\xc3\x02\x1f\xb8\xd1\xd6\xcd\x47\xf2\x3d\x14" - "\x14\x61\x30\xdd\x3a\xbc\xcc\x30\x78\x48\x17\x80\xc7\xfc\xd7\x84" - "\x32\x57\xd5\x4b\x78\x8f\xfe\x2e\xc8\xf0\x7c\x64\xb2\x49\x7c\x1f" - "\x67\x18\x3d\x2c\xd3\x00\xd3\xb9\xfc\x41\xea\xa2\xe1\x4e\x8f\x3d" - "\x2f\xb6\xb5\x98\x88\xcb\xef\x2f\xe9\x1c\x22\xba\x33\x63\x99\xe7" - "\xf8\xbd\xcb\x7f\x9e\xf3\xbc\x2e\xba\xf3\x62\xaf\xea\x22\x13\xe3" - "\x8c\xf2\x45\x8c\x67\x68\x5f\x3e\xfa\xd0\xe3\x53\xe8\xf1\xf4\x19" - "\xe9\x53\x68\xd6\x03\xd3\xa6\x50\xea\xbd\xe3\x53\xef\xfe\xee\xa4" - "\xbb\x29\xe3\x87\x8f\x4e\xa1\x8c\xd9\x53\xe8\x31\xfc\x32\x1f\x9e" - "\x81\x87\x69\x53\xee\x4c\xfd\xfe\xf8\x8c\x69\x33\x1e\xa2\x47\xe6" - "\xde\x95\x7a\xd7\x5d\xf4\xc0\x43\x33\xef\x4c\x4d\xd5\xaf\x77\xa6" - "\x72\x96\x1f\x4f\x7a\xe8\xb1\xf1\x19\x4b\x97\x14\x2e\x19\x3f\x7b" - "\xc6\xb4\xd0\x39\x31\x39\x70\x31\xc8\x34\xf5\x8a\x73\xd3\x29\x08" - "\x19\x51\x8b\xbe\xc6\xaf\xcb\x59\x72\x12\x63\x3d\x71\x75\x2d\xf7" - "\x91\x94\x93\xc3\x8f\x63\x7c\x9b\x7a\x1c\x96\x75\x6e\x6d\xcb\x24" - "\xa6\x15\xe6\x1e\xe4\xb9\x76\x01\xde\x9d\xd0\x65\xf3\x10\xbc\xdf" - "\x15\xfe\xfe\xea\x22\xbc\xff\x7b\xab\x8d\xc8\x85\x1f\xe8\xeb\x85" - "\xcc\x03\x1d\x3d\xd4\x6d\xcf\x1c\x02\x3e\x8e\x41\x1d\x1d\x18\x83" - "\x6d\x28\xeb\x0e\x19\xdb\x1d\xe8\x87\x36\xdb\x2a\x8a\x3d\x4b\x96" - "\x7f\x6f\x2d\x4c\x23\xee\x0f\x57\xa1\x0e\xe3\x42\x3f\x8c\x78\x09" - "\x03\x7d\x0c\x38\xc7\x14\x9c\xc4\xe4\x10\x39\xe0\x66\x38\x9b\xf0" - "\x4e\x87\x15\x68\x85\x3c\x80\xbc\x7e\x2d\x68\x4f\x26\x11\xbf\xa5" - "\x32\xd8\x97\x2c\xe7\x16\x94\xcb\x36\xf8\x17\xf9\xbd\x4d\x05\xc8" - "\xf7\xcb\xe9\x31\xe8\xef\x18\xcc\x9d\x68\x8b\x25\x1f\x7c\xec\x0d" - "\xae\x7f\xb3\x5d\xf4\x64\x92\x4a\x4b\xdc\x2b\xe2\xf1\xbc\xfe\xcd" - "\x4f\x84\x1d\x69\xab\x64\xda\x3e\x4e\x43\xdf\xc6\xf2\x18\x14\x2f" - "\xcb\xf4\x58\xd0\x62\x0c\xf0\x6b\x0f\x70\xf9\x73\xb2\xfc\x30\xa4" - "\xc5\x20\xef\x27\xc1\xf8\x37\x3f\x05\xaf\x70\x1a\xe6\xf3\x6b\x4b" - "\x01\xef\x7f\x05\x45\x26\x09\xf3\xf9\x46\xdc\x1f\x77\xae\xea\xa2" - "\x53\x05\xa4\xb9\xf1\x2e\x68\x07\xcc\xbe\xfe\xfa\xdb\xb8\x2c\xea" - "\x32\xf5\xf4\xe5\x61\x0e\x4d\x3c\xc6\xba\x40\x80\xf1\x39\xd7\x9f" - "\xc7\xc9\x75\xf2\x38\x46\x5f\x74\xa1\x9f\xe2\x7a\x1c\x57\xcf\x8c" - "\xe8\xa7\x1c\xc0\xf9\x04\x74\x6f\x07\x8c\xc3\xc1\x6e\xd4\x81\x67" - "\xc0\xd5\x74\xb8\x06\x0c\xaf\xe2\x83\xab\x37\x44\xf0\xc1\x43\x80" - "\x7d\x21\xe4\xfd\xde\x88\xf7\xb7\xe2\x7d\xaf\xfe\x1e\xe3\xe9\xea" - "\xe6\x88\xfa\x3b\xf1\x3e\x88\xfa\xbd\x18\x2f\xb1\xa8\x2f\xa3\x96" - "\xf5\xb4\x81\xfc\xfe\xf0\xfc\x23\xac\xdd\x0e\x0b\xcb\x10\x96\x85" - "\x32\x7f\x9d\xce\xab\xaa\xfe\x11\x29\x11\xf9\xc1\xc3\x96\x61\xe0" - "\x07\xbe\x5e\x83\x3c\xc3\x20\x8b\x4c\x98\x37\x8e\x1f\x29\x66\xbd" - "\x6d\xc4\xfc\x88\xfc\xc5\xc8\x37\x8a\xe9\x28\x69\x70\x4e\xd2\x20" - "\x43\xd7\xb3\x78\x2c\x98\x51\xa6\x32\xa2\x4c\x03\xca\xdc\x1c\x54" - "\x74\x8b\xed\xe9\x8e\x5a\xa6\x29\xa2\x4c\x87\xec\x7f\x55\x8f\x89" - "\xf9\xc5\x28\x23\x65\x4b\x5f\x18\x0c\x6e\x1b\xf4\xb1\x6b\xcc\xe1" - "\x30\x92\x3a\x50\xef\x6d\x1b\xd5\x38\xfe\x06\xfa\xfc\x2e\xa4\xfd" - "\x05\x70\x3f\x63\x3e\x61\x5e\x76\x79\x7c\x90\x7d\xd3\x13\xd4\x1c" - "\x7e\xcd\x22\x4b\x31\xf1\xfd\x78\xbe\x67\xd8\xa2\x6f\xa6\xce\xe3" - "\xd7\x2c\xc2\x95\xd3\x65\x9d\x3c\xb6\x44\xdf\xbf\x05\x15\xcc\x6b" - "\x36\x62\x0c\x6a\x78\x0e\xe8\x75\xb4\xe0\x39\x06\xfc\xf9\x29\xe4" - "\x2a\x78\x72\x3a\xf3\xdb\x44\xa4\x7f\xa8\xbf\x7f\x97\xf3\xe3\xfe" - "\x4e\xfd\x9e\xf9\xf2\x53\x9d\x2f\xc1\xe7\x49\xbf\x91\x75\x4b\x5e" - "\x57\xe5\x83\x8a\xaf\xa7\xe1\xdd\xeb\xb8\xce\xc0\x75\x23\xae\x8f" - "\xe0\xba\xc8\x7e\x81\xac\xf6\x00\xf4\x08\xf5\x3c\x0f\xd7\x47\x71" - "\x7d\x00\xd7\xc7\x70\x1d\xcf\xe3\xd2\xb3\x22\x8f\x22\x78\xa2\x2b" - "\xa8\xc6\xe2\x30\xd5\x1f\x49\xa3\xf5\xf1\xa1\xc6\xe7\xb9\x81\x34" - "\xa1\xd2\x34\xc8\xf3\x81\xb4\xbe\xe9\x4c\x97\x0c\xb4\xdd\xc7\xf5" - "\xeb\xe3\x7a\x88\xea\x17\x95\x27\xa8\xca\xe9\x7d\xa7\xa7\xa9\x7c" - "\x31\xa1\x75\xba\xe9\x9a\xe6\x12\xaf\x10\xb8\x36\x32\x5d\x91\x7e" - "\x18\x34\x81\x3e\x73\xcd\x06\xa6\xd3\x40\x7f\x5f\x93\x1c\xd2\xdf" - "\xd0\x67\x93\x7c\xe1\xfd\x9d\x98\xc1\x34\xe3\xfe\x36\xf0\x65\xdc" - "\x31\xa7\xf0\x3c\x35\x54\xe1\x9f\x98\x01\xb9\xde\xc5\x7d\x1f\x5b" - "\xc0\xe3\xe1\xda\xc9\x6e\xda\x25\x65\x22\xbf\xf3\xc6\x1d\x48\xe4" - "\xf2\xb1\xf9\xf2\x5d\x26\xe4\x65\xbb\xf1\x8e\xeb\xe6\x71\x18\x5b" - "\x28\xdf\x15\x1a\xe5\x20\x33\x1b\x64\x59\xcc\x71\x3c\xe7\xf3\xdc" - "\x8d\x39\xb4\x13\x79\xaa\xdd\x74\x55\xe2\x60\xf6\x8d\x28\xdb\x52" - "\x3f\xbe\x94\xb4\x5b\x4a\x69\x88\xcb\x7f\x9c\xe6\xf8\x45\x60\x3c" - "\x51\x9c\xcb\x3f\x99\x6e\x25\xba\xda\xe5\x3f\x46\x68\xf0\x18\x97" - "\xbf\x0a\x73\xe4\x3a\x7e\xff\xfe\x6d\x14\x13\x83\xab\xfd\x76\xd2" - "\x62\x5c\xfe\x5d\x48\x3f\x44\xb7\x90\x29\xe6\xfb\x43\x44\x8f\xcb" - "\x3f\x11\xcf\x85\xf4\xf0\x10\xf1\xb7\xac\x00\x25\xce\x7c\x45\xd8" - "\x5d\xfe\x1c\x7a\xf8\x95\xa0\x70\xf9\x9b\xf1\x2e\x9f\xe6\x04\xbe" - "\x14\x73\x02\x3d\x42\x98\xb7\x34\xcc\x09\x9c\xc3\xfd\xdf\x04\x68" - "\x89\xeb\xfb\xf8\xd9\x85\x0b\xba\xae\x28\xdf\x52\x9f\xb5\x52\xa3" - "\x3e\xcc\x2b\x22\x6e\x4b\x03\xda\xe7\xec\x13\x79\xb1\x98\x13\xde" - "\xef\xeb\xc3\x75\xfd\x96\xf7\xe4\x73\xd9\x96\x36\xc0\x71\xde\x01" - "\xc5\x9f\xf1\x77\xf9\x3b\x28\x0b\xb2\x63\xce\x4a\x8f\x60\xdc\x87" - "\xaf\x11\x34\x67\xe5\xfb\x02\x72\xcb\x32\x67\xa5\x5d\xe0\x9d\x19" - "\xf0\x9c\x2e\x7f\x17\xd7\xd1\x06\x78\x2d\x12\x5e\xd9\x16\x0f\xf2" - "\x7a\x38\x5f\x28\x1c\x86\xc1\x79\xe7\x04\xc8\x82\xfc\x9e\xbe\xf2" - "\x2d\xee\xbe\xf2\xad\x84\x5f\xaa\x88\xdf\xfa\x60\xd0\x91\xf4\x01" - "\xcf\x51\xa2\x6c\x6b\x06\x9e\xb3\xbf\x04\x9f\x48\x3a\x06\x68\x98" - "\x28\xdf\x9a\x81\x3e\x4f\xef\x91\xf8\x6e\x2d\x95\xf8\xae\xdf\x6a" - "\xff\x52\xb6\x63\x6b\x89\x6a\xc7\xd6\xd5\x9c\xee\x05\xdf\xe2\xbe" - "\xde\xab\xde\xd5\xa1\xdc\x5c\x59\xae\x6c\x6b\xbd\x30\x6f\x6d\x00" - "\x0f\xc6\xce\x09\x88\x52\xa6\x21\xe8\x5a\xca\x74\x64\xbb\x05\x75" - "\xd4\x8b\xb8\xad\x0d\xc0\xc7\x89\xf2\x7f\xee\x13\x3c\x6f\x6e\x75" - "\x7f\xa9\x60\xff\x0d\x70\xe6\xf7\x30\x4c\xf3\x56\x37\x60\x79\xfc" - "\x9a\x0d\xf4\x10\xbe\x39\xfe\x35\xfe\xac\x95\x14\xeb\xf2\x7f\x48" - "\xc9\xa5\xa5\x31\xae\xa2\x42\xb4\x73\x03\x60\xe6\xe0\x3d\x5d\x83" - "\xba\xde\x07\x5c\x37\xd7\x87\x3a\x3c\x80\x79\x06\xb0\x72\x18\xa7" - "\x5e\x07\x25\x8a\xf8\x6a\xea\x95\xf8\x55\xdb\x82\x65\xd5\x69\x41" - "\x73\x75\xaa\xc1\x3f\xcc\x3b\x8a\x6e\xcc\x33\xfb\x38\x2d\xd1\xe0" - "\x93\x40\x59\x75\xe2\xed\x44\x89\xb3\xbd\xc2\xcf\xbc\x32\x81\x0a" - "\x62\x5a\xbd\xc7\x40\x6b\x33\xb5\x16\x1c\xa2\xdb\x88\xed\x27\x2f" - "\xb5\x7a\xab\xf0\xbc\x93\x18\xbf\x56\xef\x3a\x6a\xe9\xda\x45\xb3" - "\x0b\xbc\x6b\x02\xe6\xea\xca\x96\xae\x59\x84\xf2\xef\x03\xc7\xe0" - "\x53\x05\xa6\xd2\xd6\x02\x2f\x3f\xdb\x5b\xba\xc0\x9f\x01\x11\xf0" - "\x97\x55\x93\xdf\x5c\x5d\x3f\xfb\x82\xf0\xcc\xea\x2a\x1d\x82\xb4" - "\x3e\x4b\x8c\xf0\x5b\x8a\xec\xa2\xa5\x6b\x03\x3d\x75\x81\x62\x5a" - "\xf2\x0e\x49\x3e\x7d\xaa\xa0\x80\x64\xf9\x0b\x7e\xcb\x93\x5d\xa5" - "\xf4\x64\x1e\x0d\x47\xfe\x73\xcc\xb3\x62\x78\x29\x35\x77\xe4\xd3" - "\xac\x33\xfe\xd8\xd9\x17\xfa\x44\x73\x76\x15\xb5\xe4\x55\x81\x1e" - "\xd5\x36\xb6\x33\x66\x9d\xe9\x16\xb3\x2f\xf4\x88\x96\xbc\x7d\xd4" - "\x9c\x7d\x88\x66\x7e\xee\xb4\x04\xca\xab\x13\x83\x71\xd5\xa9\xc1" - "\xf2\xea\xb4\x40\x5c\x75\xa5\xbf\x1c\xb8\xc4\x55\xd7\x8b\xf5\xdb" - "\x60\xc3\x60\x6e\x97\xfd\xbb\x6d\x38\xee\x6d\xb2\x7f\xcd\xdb\x6c" - "\xa2\x6c\x5b\x5a\x5f\xf9\xb6\x54\xc9\xf7\x71\xdb\x6c\x2e\x3f\xf3" - "\xff\xb6\x34\xe4\x4b\x53\x3c\xb2\x2d\x43\xf1\xfe\xb6\x39\xdc\xaf" - "\xc8\x9b\x8d\x5f\x01\x7e\xd0\x45\xb6\x41\xa7\xa2\xab\x19\x6e\xb0" - "\x6c\x9b\x3b\x68\xde\x86\xf1\xb0\xcd\x03\xbb\x44\x6b\xf5\xee\xa2" - "\x00\x64\x6b\xab\x37\x40\xb3\x5f\xf4\xa1\x6f\xd1\x07\x45\x01\xd0" - "\xf3\x38\x3d\xf5\x22\xd9\x5d\x45\xc7\x49\xbc\x57\xc9\xf4\xb0\xcc" - "\x7e\xf1\x7d\x11\x2c\xdf\xe6\xe6\xf7\xb3\x5f\xb4\xc3\x36\x02\x9c" - "\xb8\x6d\x9e\xe0\xfa\xed\x89\xba\xae\x04\x3c\xb6\x5b\x18\x8f\xbe" - "\x1e\xf0\x18\xe6\x71\x11\xb7\xdd\x86\xb4\xd7\x78\xee\x08\x32\xdf" - "\x95\x6d\xaf\x14\xe6\xed\x9e\x59\x43\x84\x27\xf0\x2a\x49\x1e\x08" - "\xde\x2f\x04\xdb\x5e\x59\x45\x54\x2f\xc7\x54\x60\x54\x29\xca\x79" - "\x44\xf9\xf6\xca\xe0\xfa\x9d\x77\x01\x4e\xac\x58\xc1\x65\x77\xa6" - "\x2a\x9e\xf9\x4c\x8e\x3d\x51\xbe\x33\xf5\xeb\xda\xf9\x3d\x8e\x51" - "\xc5\x6e\x7a\x3b\x93\x65\x1c\xee\xcb\xdc\xb4\x3f\x45\xbf\xaf\x72" - "\x53\xd5\x71\x29\x1f\x21\xe7\x0a\x4a\xe8\xda\xd3\x74\xfd\x74\xd0" - "\x84\x70\x9f\x80\xfb\x99\x73\x6e\x45\xbb\xcb\x3e\xeb\x44\x9f\xf7" - "\xb0\xcc\x11\x8e\x89\xd0\x37\x28\x0d\xed\x35\x8b\x9e\xe4\x04\x11" - "\xbf\x7b\xa1\xe8\xb3\xb2\x2d\x69\xc1\xf3\x70\xd0\x75\x2c\xae\x23" - "\x76\x5e\xa4\x24\xfc\xac\x3b\x1d\xc1\x52\x96\xc9\xb8\x4f\x15\x2b" - "\xac\xf1\x9b\x96\x53\x8a\xc5\x4b\xe6\x3a\x47\x30\xd3\xb2\x26\x91" - "\x6d\xaa\x24\xbe\x17\x8e\x6d\x54\x77\x91\x4c\x3c\xb7\x04\xe3\x50" - "\x5f\x91\x45\x88\x65\xc9\x54\xb7\x14\xf2\xc8\x41\xd6\x3a\x87\x68" - "\x08\xf4\x24\x6b\x8c\xa7\x81\x0b\xe3\x06\x3c\x6f\x00\x9e\xf3\xe7" - "\xad\x4c\xa3\x0f\x8b\x28\xea\x5a\x44\x8f\xe3\xfa\xfe\xf6\x0f\xf2" - "\xbe\xc6\xa0\xc9\x20\xef\x0f\x1b\x74\x1a\xcc\xde\xe7\x71\x1e\xb8" - "\x28\x3c\x15\x8b\x89\x69\x61\xb5\xfb\xc5\x7f\xc1\x26\x29\x2d\x09" - "\xd0\x0d\x73\x56\xde\x24\x5c\x1e\xe1\x74\x15\x9d\x91\xeb\x75\x75" - "\xc8\x53\xe2\x17\x41\xb6\x6f\xd9\xb6\xad\x62\x5b\xb5\x7c\xf7\x74" - "\x51\xbe\x3b\xbd\x7b\xb9\xf0\xd7\x4a\x7b\x74\x74\xaa\x9b\xee\x29" - "\x50\x7d\x53\x6d\xc3\x5c\xd8\xd1\x6d\xde\x9d\x0e\xd8\x57\x33\xec" - "\xd6\x02\xe1\x0c\xc6\xed\x9e\x89\x7c\x98\xff\x7e\x5f\x19\xba\x66" - "\x87\x79\xad\x6b\xdd\x16\x9e\xdb\x46\x63\xfe\xbb\x69\xee\x25\x6b" - "\x42\x72\x75\x91\xd0\x2f\xb6\x81\x45\xc9\x18\x9d\x7d\x8c\xbf\x44" - "\xfc\xd2\xa2\xbf\x1e\x98\x1b\xab\xeb\xbb\x61\x77\xd9\x57\xd3\x68" - "\xf4\xc3\xf5\xa7\x69\xf4\x3f\xec\x45\xe2\x94\x70\x8c\x2e\xfd\xe5" - "\x2a\x1f\x74\x82\xd1\x5e\x37\xad\xc9\x1b\x7c\x6e\x85\x5c\xbc\x28" - "\x3a\x2b\x96\xf7\xd3\xec\xc4\x9c\x95\x41\xc1\xf7\x3c\xce\xea\x90" - "\xce\xf4\xe8\x71\xdc\x30\xd9\xa0\xc5\x20\xf4\x37\x89\xb2\xdd\x99" - "\x4a\x07\xbc\xa1\x46\x38\x04\x39\x6f\xe4\x75\xbc\x1b\x76\x4a\x3d" - "\xa8\x6c\x5b\x6a\x37\xe4\x08\xaf\x77\x40\x67\xf6\x2e\xb3\x0a\x1f" - "\x60\x56\xba\x69\x9c\x5b\xb7\xb3\xbc\x2e\xff\x43\x2c\x53\x52\x07" - "\x5b\x27\x1d\x80\x7f\xe3\xe1\x56\x68\x44\x2c\x93\x84\xf9\xc0\xdc" - "\x12\x85\xb7\x8f\xe1\x3a\x4b\xce\x53\x07\xde\x2f\xf3\x8a\x4e\x51" - "\x76\x60\x3a\xeb\x21\xce\xe5\xbd\x9c\xf6\x2e\x78\x58\x38\x97\x32" - "\x4e\x37\xbe\xeb\xbc\xb1\x97\x4e\x41\xc7\x83\x7e\xe7\x51\x36\xd7" - "\x8d\x7b\x8e\x14\x92\x6e\xc7\xdd\x08\xfb\xef\xdb\x7b\x0c\xbc\x20" - "\x3b\x04\xe8\x8b\xfa\x59\xee\x75\x11\xaf\xa1\x2d\x2b\x16\x3e\xe0" - "\x6a\x43\xde\xb9\x46\x1b\xb8\x7d\xaa\x5d\x37\xe6\x85\xb6\x0b\x38" - "\x78\xa0\x2f\x4b\x1a\x2c\x5b\x49\x66\x9b\xa2\xb5\x99\xdb\xcb\x6d" - "\xe1\x36\xcb\xb6\x40\xbf\xe0\x79\xc5\xe5\xbf\x07\xfa\x97\x4c\x4f" - "\x03\xac\x43\x6e\xfa\x56\xba\xd2\xad\x6e\x94\x7a\x5d\xd4\x7e\x34" - "\x6f\xf5\xd8\xbf\xa4\x1b\xed\x41\x71\xf2\x14\xdd\xc4\x3a\x6d\x2c" - "\x5f\xe5\x9c\xec\x03\xff\x9a\xf7\x8d\xe5\xb9\xd8\x55\x7c\x01\xf2" - "\x5b\xe6\xbd\x06\x79\x3b\x90\xe7\x4e\x3d\xef\x9d\x6a\x7d\x57\x5e" - "\x87\xf1\x15\x73\xf3\x19\xf0\xee\x74\x5e\x93\x00\x9d\x13\x8d\x67" - "\x81\x67\x5c\xd1\x57\xfb\xc6\x46\xc7\x65\xbb\x27\xa8\xc6\x62\x17" - "\xea\xf9\x26\xf3\x94\x7d\x25\x5d\x07\xbe\x3c\x51\xb2\x9a\xae\x61" - "\x7e\x12\x71\xbb\x73\x14\xdd\x6f\xaa\x12\x8e\x52\x72\x41\x7a\x16" - "\x2c\xa7\xeb\x31\xfe\xe6\x9f\xa6\x9b\xde\xca\x2a\xb6\x01\x57\xa2" - "\x8a\xb3\x44\x52\xd6\xc4\xed\xce\x76\xf9\x3f\xa7\xba\xb3\x6c\x6b" - "\xdd\x74\xd4\xe0\x45\xdc\x1f\xbb\x9c\x5c\x00\x5d\x0b\x94\xad\x60" - "\x7b\x80\xd7\xcb\x4e\x92\x2d\x85\xdb\x8b\x5f\x0c\xd2\x6e\x10\x17" - "\xc5\x7c\xc1\xfa\x1b\xe6\x2b\x37\xd9\x32\x71\x2d\x90\x3f\x07\x19" - "\xcf\xd9\xc8\x97\x20\x2e\x06\x39\x4f\x01\xd2\xc6\x0a\x47\x0c\x8f" - "\x89\xc3\x3d\x0e\x5b\x86\x9b\x26\x95\xa9\xbe\xb1\x8d\x66\x58\x83" - "\xe0\x90\x8d\xbe\x25\xe6\x4d\xc0\xfa\x77\x5b\x49\x0c\xe3\xb1\x51" - "\x8e\x0b\xc0\xaa\xd3\x94\x7c\xc6\xdc\x58\x50\xeb\x08\xe6\x41\x16" - "\xe7\x05\xd7\xef\x2f\x95\xf7\xfa\x3b\xc6\x03\x73\x5f\x41\x74\xf8" - "\x07\xe6\x3a\x47\x31\x8f\x8f\x49\x52\x70\x0e\x4c\x77\x8e\x3a\xcd" - "\xcf\xd7\xf2\xb3\xd7\xdc\x50\xea\xaa\x4e\x43\xfd\xa7\x51\xef\x98" - "\x24\x65\x03\x8c\xb9\xb6\x1b\x75\xf4\x38\xc6\x24\xb9\x29\xf9\x90" - "\x5a\x3b\x6c\x28\x1d\x64\xec\x25\xf2\xd8\x69\xa9\x21\x7d\x4c\xdf" - "\xfc\xef\xbc\x8e\x81\x76\x65\x04\xcc\xdb\x0a\x74\xb9\xc1\x76\xd5" - "\x37\x4e\xd2\xcd\x8d\xad\x79\x92\xbf\x35\xa1\x8d\x29\x7c\x3b\xe8" - "\xd1\x78\x7d\x57\x89\xaf\x9b\x1b\x2f\xfd\x8d\xd9\x85\xdf\x21\xfc" - "\x9c\xfa\x73\x33\x7e\x6e\xdc\xa7\x4a\xba\x75\xe7\xc0\xce\xb9\xb9" - "\x11\x73\x7d\x01\x3f\xbb\x69\xcc\x5e\xd1\x3d\x56\x0b\xea\xf7\xb5" - "\x5f\xb0\x8d\x31\xa6\x1d\xf4\xcf\x51\xfd\xc0\x30\x28\x06\x63\x91" - "\x69\x2e\xec\xd5\xc2\xd7\x54\xe2\x65\x9c\xcd\x4d\xd5\x5e\xb2\x7d" - "\x8b\xdb\x7e\x73\xc2\xb2\x6a\xe1\xf1\x82\xf6\x7c\xe5\xb6\x1d\xa9" - "\xf1\x13\xaf\x31\xf7\x38\x6e\x1e\xeb\xa6\xa7\xab\xa4\xcc\x8f\x3f" - "\x50\xc0\xf0\x44\x9c\xe4\x07\x61\xb4\x5d\xc9\xb3\x86\x52\xee\x47" - "\x3c\xff\x08\xed\xb6\x9c\xa5\x9b\x65\x7f\x1e\x41\xdb\x77\x42\xa6" - "\xb0\xed\x54\x27\xe5\xff\xcd\x90\xff\xb6\x26\x63\x3d\x74\x23\xde" - "\xc1\x6e\xea\x6a\xc9\xf3\x11\xc3\x08\x00\x76\x85\x5c\x13\xda\x5f" - "\xba\xba\x4b\xf8\xde\x2f\xe9\x34\x61\x3e\x46\x7f\x37\x94\x72\x9d" - "\x76\xe8\xc1\xce\xc5\xb2\xde\x34\xc8\x2a\x6f\xd4\xfe\xef\xc7\xed" - "\x96\x77\x8f\x8c\x95\x72\x31\x03\x3a\x56\x76\x78\xbf\xdc\x72\x58" - "\xf5\xc9\x2d\xe6\xf0\x3e\xb9\xe5\x30\x7e\x33\xf1\xcb\xc1\xaf\x50" - "\x7f\x0e\xfd\x4d\x0a\xb9\x5f\xd7\xe3\xb8\x25\x1d\x63\xdf\xad\x68" - "\xcd\x69\xc0\x95\x79\xe0\x0b\x32\xb3\xed\xcd\xfb\x0a\x9c\xce\xfc" - "\xca\xe9\x41\xe8\x25\x78\xce\xc4\xfb\x44\x1e\x8b\x15\x41\x0a\x7b" - "\xef\x5a\x07\x9e\x5a\xd5\xcb\xb8\xbf\x25\xd7\x0b\xd6\x94\x95\x31" - "\x1f\x22\xcf\x7c\x8b\xbf\xac\x0c\xf5\x1d\x32\xe8\x87\xb4\x1a\x7e" - "\x1f\x5d\x3f\xb8\xe5\x78\xbf\x1e\x05\xfd\x92\x65\x4b\x17\x8d\xed" - "\x84\xfc\x41\x5f\xed\x2f\x52\xf3\xc6\xd8\x7f\xf0\x33\xe4\xde\x09" - "\xdc\x77\xb4\x40\xbe\xf4\xae\x7f\xf3\x68\x9f\x46\xc3\x7a\x35\x4a" - "\xf3\xaf\xff\x6b\x82\x3f\xbe\xf6\x98\xab\xf3\x10\xb5\xfa\x0f\x90" - "\xed\x39\x09\xe3\x33\x17\xf3\xf3\x4a\x11\xd8\xdf\xbb\x07\xb6\xd6" - "\x39\x27\xe6\xd9\x9b\x4e\xd3\x58\xd9\xf6\x9f\x9e\xc4\x0c\xfe\x94" - "\x84\xad\xd3\xe2\xb3\xce\x4d\x0b\x85\x7f\xd3\x29\x8c\x8f\x3e\x6b" - "\xfc\xc6\x5e\x4a\xd9\xbe\x8a\x52\x6b\x7a\x69\x6c\x6d\x2f\x25\x8b" - "\xbf\x27\x6b\x35\xd0\xb5\x9e\xba\x90\x48\x18\xdf\x99\xc3\x0b\xc8" - "\x5c\xbb\x8a\x64\x9f\x07\xca\xa1\x73\xf9\xa1\x73\x9d\x4b\x66\x39" - "\xd7\xaf\x73\xf5\xf5\xb1\xce\xb5\xfb\xa8\xe2\x8b\xdd\x47\xaf\xca" - "\xa3\x98\x84\x6c\x4a\x04\x7e\xf6\xb3\x34\xf6\x86\x84\x0e\xe8\x7b" - "\x68\xb3\x5b\x6f\x2f\xae\xa9\x96\x3c\x1a\x26\xdb\x0a\xd9\x2b\xca" - "\xf7\x17\x0d\x3a\xa7\x6a\xcc\x3b\x5e\xde\x03\x42\x1b\xc6\xdd\xc3" - "\xfb\x18\x87\x46\xf9\x4c\xcb\x6a\xc0\x77\x48\x2f\x1c\x23\x7c\x48" - "\x1f\xcd\x75\x37\x20\xbd\xc7\x31\x2e\xdd\xad\xbd\xb6\x6b\x30\x79" - "\x6b\x59\x63\xcc\xfb\xe3\x3e\x14\x5a\x29\xeb\xdb\x89\xab\xfd\xc2" - "\xe3\x3a\xcb\x63\x70\x5c\xd3\x9c\x7c\xe1\xb7\x2d\xe6\x3d\xa5\x71" - "\x87\x78\xbf\x8b\xd7\xb9\xdf\x86\x9e\xf2\x55\x7b\x5c\x2c\xfb\xa1" - "\x8f\xdb\x2c\xf9\x80\x09\x7d\x5f\xd8\x93\x29\x5c\xf7\x8e\xae\x77" - "\xf3\xde\xe8\x66\xb9\x0f\x3b\x0e\xfc\xf3\xb0\xd4\xc3\x58\xdf\x63" - "\x19\x08\xbd\xe9\x9a\x53\xf4\xad\x49\x6c\xd7\xf7\x38\xbe\x35\xda" - "\x4d\xd3\x8c\x7d\x3d\xb9\xbf\x8b\x34\xe8\x7f\xe9\xf9\x9c\x56\x38" - "\x86\xac\x85\x36\xd1\x39\x98\xee\x23\xf7\x5c\x35\xfa\x26\xca\xe4" - "\x18\x70\x30\xdf\xfc\xaa\x5b\x9b\x37\x0f\x69\x45\x06\x1c\xe4\xb9" - "\x16\xcf\x65\xfd\x79\x54\x99\xea\x90\x32\xf3\xba\xb5\xdb\x7e\x85" - "\xb4\xbd\x11\x65\x0e\x47\x94\x69\x0e\x29\x53\xaa\xd7\xe3\x8e\x28" - "\xe3\x09\x2f\xf3\x6d\xba\x14\xb7\x6f\x27\x85\x97\xf9\xf6\xd8\x88" - "\x32\x13\x2f\xc5\xed\xdb\xd3\x23\xca\x64\x46\x94\xc9\x0b\xa1\x25" - "\xef\xad\xa6\x22\xad\x38\xa2\xcc\x86\x88\x32\x35\xc6\xf3\x60\x7b" - "\xdc\xcb\x76\x92\x15\x7c\xd9\xc9\xfd\x09\xbd\xbd\xab\x7b\xeb\xf3" - "\x3d\x7a\xd9\xf6\x28\xed\xea\x8a\xa8\xcf\x1f\x5e\x5f\x72\xc2\xa5" - "\xed\x4a\xb6\x85\x97\x49\x4e\x8d\x28\x93\x16\x52\xa6\x5e\xd5\x93" - "\x3c\x37\xa2\x4c\x4e\x44\x99\xc2\x4b\xf9\x2a\xb9\x2c\xa2\x4c\x75" - "\x44\x99\x3d\x5f\x41\x0b\x9e\x8f\x95\x2f\xc2\x48\xd6\x79\x1f\xc4" - "\x5c\x7f\xeb\xd5\x6c\xcb\x60\x2e\xf1\xfc\xb2\xd7\x37\x84\xe7\x14" - "\x9e\x7f\x8e\x14\xf9\xa0\x2f\x25\xfb\xdc\x74\x47\x81\x31\x07\xf1" - "\x3e\x26\x8f\x67\xa5\x2b\x27\xb7\x0f\xa6\x53\x72\x3d\x86\x6f\x02" - "\xd7\x75\x64\x34\xeb\x5e\xb7\xa6\xf7\xeb\xb6\x6a\xbf\x9e\x14\x9c" - "\x5b\xb7\x31\x1c\xae\xbf\x4e\xed\x8f\xc6\xb0\x6e\x7d\xa4\x48\x96" - "\x29\x0a\xd1\x87\xb9\x7e\xef\xa1\x55\x3e\x53\x38\x1e\xb7\x66\x5e" - "\x06\x8f\x04\xe8\x38\x93\x5a\xa1\x7f\xf0\x3e\x50\x4b\x0d\x74\x19" - "\xe8\xef\x8c\xdb\x49\xba\xd5\x2d\x75\xab\xc5\xbd\xc4\xf7\xae\xe2" - "\xfb\xe4\x3e\x91\xd2\x2d\x6f\xb3\x36\xa1\x7e\xd6\xc1\x9b\x0a\xce" - "\x53\xb7\xd4\xff\x59\x07\xbb\xed\xa1\x23\xc5\x1e\xe0\x75\x5b\xa2" - "\xb1\x6f\xea\xa6\xdb\xd2\xa5\xde\x50\x76\x20\x95\xf7\xb0\x78\xdd" - "\xf7\x88\x77\x12\xe7\x01\xff\xdf\x3a\xda\x68\x2f\x6c\x40\x8c\xa9" - "\x5b\xbb\x2e\x47\x33\xd5\x87\xb7\xe5\x87\xf3\xe4\x10\xf0\xca\x6d" - "\xa5\xe1\xfd\x7e\x5b\x65\x78\xbf\xdf\x56\x1f\xce\x93\x1a\x78\xf2" - "\xb6\x43\x11\x65\x9a\x22\xca\x1c\x0b\x29\x53\xa9\xd7\xd3\x19\x51" - "\xc6\x17\x5e\xe6\x76\x73\xc8\x33\xda\x78\xbb\xb5\xdf\x86\x91\x7b" - "\xf2\xb7\x27\x87\x3c\x6b\x55\x52\x7e\xde\x3e\xd9\x48\xe3\x7d\xb4" - "\xda\x2d\x6a\x4f\x58\x87\x97\x19\x31\xde\x39\x7f\x7e\x38\x0e\xb7" - "\x17\x47\xe0\xd0\x3f\xfe\x2b\x94\x0d\xf6\x87\x53\x94\x92\x23\x79" - "\x08\x63\x04\xf3\xf5\x1c\x7e\x06\xac\x6a\xe4\x07\x1d\x6e\x3f\x1c" - "\x01\xaf\x39\x02\xde\xf1\x90\xe7\x44\x3c\x77\x85\xb4\x21\x31\xd6" - "\x2a\xfd\x62\xa0\x8f\xa5\x98\x8c\x74\xb6\x0d\x81\x6f\xa7\x5d\xce" - "\x33\x69\xec\xeb\x30\xe2\x24\xdd\xfe\x05\xdb\x91\x0a\x66\x4a\xe8" - "\xf8\x27\xd5\xae\x94\xf4\x70\x3c\x52\xe6\x86\xe3\x91\x92\x13\xd2" - "\x2e\xaf\x65\x0d\x3d\x62\xf1\x3f\xfa\x23\xd6\x71\xd8\x87\x46\xfa" - "\x1c\xac\x86\x5e\x76\x81\x12\xd9\xd7\xe3\x54\x21\xc5\xba\x8a\x3a" - "\x61\x93\xed\x6e\x1a\x94\x9f\xe2\x0f\xa4\xe9\xfe\x29\xb0\x37\x53" - "\x9a\x0c\x7e\x0c\xae\x3f\x90\x16\x2c\x7f\x3b\x1f\x69\x90\x7f\xb7" - "\x65\xa8\x35\xf6\x7d\x8d\xc2\x9e\x59\x0d\x7a\xc2\xbe\x19\xff\xa1" - "\x6e\x0f\xcc\x65\x9f\x05\xc8\x9e\x4e\xcc\xef\x09\x6a\x7f\x6b\x7c" - "\x42\x08\x5f\x7b\x6d\xab\xa6\x8a\x93\x34\xfe\x23\x9e\xff\x79\x8c" - "\xb2\xef\xc3\x11\xbf\x87\xd8\x86\x76\xf9\x4f\x4b\x1d\x0d\xef\xdb" - "\xf4\xb2\xd3\x43\xca\x7a\x74\x1b\xb7\x93\xdf\x4d\xf0\x93\xe9\x88" - "\xd7\x43\x80\x93\xa4\xf4\xba\xf1\x1f\x1d\xc1\x78\x45\x99\x62\xa3" - "\x0c\xdb\xc3\x5c\xc6\x52\x48\xa6\x3b\x8a\xc9\xe4\x5c\x75\x52\xc2" - "\xd6\xfb\xbe\x93\xf5\x63\x57\x71\x27\xb9\xbc\xed\xbc\x36\x65\x52" - "\x7b\xc9\xe3\xdb\x62\x7d\x64\xee\x2e\x3f\x80\x3e\x19\xdf\x16\x28" - "\x3f\x30\x09\xb8\xc1\xfe\x4a\x91\x72\x2e\x94\x76\x0f\x3d\x94\xf1" - "\xe8\x9c\x59\xe3\x7f\xf8\xe8\x8c\xb9\x0f\xdd\x67\x9b\xbb\xe8\x85" - "\xdc\x9c\xf1\x4b\x5e\x2a\xb4\xad\x58\xba\xa8\x70\xd1\xe2\x67\x6d" - "\xa9\x45\xe3\x8a\x6c\x0b\x0a\xd5\x35\x39\x7f\xc1\xb2\xc2\x29\x7c" - "\x9b\x62\x2b\x58\x9a\xbb\x5c\xde\xde\x1a\x4f\xe1\x40\x16\x15\xe6" - "\x2e\xb5\x8d\xcb\x49\xb1\x3d\xbc\x60\x51\xfe\x4b\x4b\x73\xa3\xc2" - "\xba\xcf\xb6\x34\x77\x69\xee\x82\x1c\xdb\x14\x5b\x2a\x43\x0e\x05" - "\x17\xd2\x9f\xa9\xc6\x3c\xc6\xf3\x57\x85\x43\xb4\xe9\xf3\x99\x5b" - "\xf1\xcf\x1d\xbb\x2e\x9d\xcb\xee\x68\x0c\xe7\xb9\x3b\x8e\x86\xf3" - "\xdc\x1d\xed\x97\xce\x65\x77\x44\xcc\x7f\x77\x44\xcc\x7f\x13\x12" - "\x2e\x9d\xcb\x26\x44\xcc\x7f\x13\x22\xe6\xbf\x09\xfd\xf3\x1f\x78" - "\xc9\xbd\x56\xca\x85\x09\x11\xf3\xdf\x84\x88\xf9\x6f\x42\x61\xc4" - "\xf3\xba\x90\xe7\x6b\xf0\x5c\x15\x3a\x3f\xe2\x79\x97\x31\x3e\x07" - "\xe4\xcb\x84\x46\x23\x0f\xcb\x7a\xc8\xe6\x0e\x3d\x6f\x5b\x48\xde" - "\x4e\x3d\x6f\x47\xff\xf8\x03\x1f\xb1\x8f\x88\xb2\xbb\x53\x67\xb0" - "\x4c\x67\xff\x10\x9e\x9b\x30\x3e\x6e\x3a\x4b\x13\x3e\x60\x58\xcc" - "\xc3\x72\xfd\x70\xeb\x13\x3d\x75\x23\xc8\xcc\x65\xea\x5e\x23\x93" - "\x70\x8c\x3f\x8e\x2b\x21\x2d\x01\x3f\xc8\x94\xd4\x34\xb7\xb6\xb9" - "\x50\xcd\x17\xa9\x95\x52\xdf\x47\x19\x1d\xfe\xcf\xf8\x19\x70\xac" - "\x28\x63\xae\x50\x73\x71\x07\xee\x13\x98\xa7\x51\xde\x24\xb4\x3b" - "\xc6\xe0\x4a\x48\x4b\xc4\x2f\x09\xf0\x2a\x0d\x78\xbc\x0f\x16\x6d" - "\xfc\x47\xae\x2f\xf7\xdb\x7c\x1a\x59\x2a\x1c\xc1\x76\x57\x90\xf5" - "\xea\xd4\x26\xb5\x46\xf0\x66\xa7\x70\xbc\x9f\x59\x87\xf4\xe8\x36" - "\xd2\x9d\xd0\xff\x52\x1b\xd5\xba\xc9\x9d\xe8\xff\x87\x3b\xd4\xda" - "\xe6\x9b\x6c\x23\xf6\x9e\xa2\x3b\xdf\xc0\xb5\x0f\xd7\x72\x03\xbe" - "\x53\xda\xce\x77\xf2\x9a\xc7\x63\x0c\x37\x22\x7d\x32\xe4\x5b\xaf" - "\xc5\x5f\x9a\x19\xe5\x5d\xa6\x70\xc4\x3e\x1a\x25\x9d\x6d\xe9\x5e" - "\x37\xdd\xb9\x8b\xf1\x0d\x49\x2f\x13\x8e\xe1\x73\x39\xbf\x9b\xeb" - "\x43\x99\xc1\x74\x6d\xc3\x1f\x4c\xf9\x5d\xde\x79\x2c\xa2\x1d\x5f" - "\x9e\xa2\xbb\x1e\x51\xed\xb8\x6b\x5f\x44\xdd\x5d\xd1\xdb\x71\x97" - "\x09\xed\xf8\x32\x7a\x3b\xee\xb2\x49\xda\x6a\x68\x8b\x76\xc9\xbb" - "\xc9\x68\xcb\x97\x92\xee\xe1\xe9\x73\x75\x5d\xc8\x0b\x1b\x2c\x11" - "\xef\x64\xd9\xc7\x8a\x07\xfa\x4d\xcf\x57\x6c\xa9\xa6\x8c\x28\x75" - "\x56\x09\xc7\xb0\xc7\xdc\x74\x57\xb3\x84\x33\x90\xbe\x57\xe1\x02" - "\x3a\x69\x92\x4e\x5d\x5c\x6e\xb0\xfe\x36\xec\x12\xb5\xae\x71\x17" - "\x78\xf6\xce\x06\x63\x4d\x72\x59\xb1\xf0\x18\x74\xec\x71\xdc\x6d" - "\x8d\x78\xe7\x0b\x79\x37\x31\xec\xdd\xea\xfe\xf4\x99\x46\xfa\xd7" - "\xeb\xa7\xbb\x8b\x23\xfa\x09\xfd\x33\xf1\xaa\xf0\x76\xdf\xbd\x41" - "\xb5\x0f\x7d\x74\x09\xad\xef\xde\x83\x3e\xea\x8b\xde\x47\x77\x37" - "\x45\xe7\xb5\xbb\x8f\x4b\x78\x23\x28\x1a\x3c\x1f\xfa\xae\x4f\xf2" - "\xa0\xde\x4f\x97\xf6\xcf\xc4\xd1\x46\xff\x7c\xbd\x36\x4e\xcc\x8e" - "\x68\x63\x00\x30\x3e\x53\x6d\xbd\x67\x7c\x04\xec\xa2\xe8\xbc\x38" - "\xb1\x12\xed\x0c\x44\x6f\xe7\xc4\xbd\x83\xf3\xe2\xc4\xa3\x68\x4f" - "\xe0\x52\x5e\x44\xf7\xc9\x32\x14\xad\x8c\x5f\x38\xa2\xd5\x73\x4f" - "\x92\xdd\xcf\x7a\xee\x3d\x33\x79\x0d\x29\x24\x3d\x25\x9c\xff\xd0" - "\x06\x2e\xc7\xf4\xf3\x2b\x39\xcb\xfd\x70\xca\x46\xda\x57\xf1\x64" - "\x8f\xe3\x9e\x0d\x11\xb4\x3a\x77\x8a\xbe\x73\x55\xb7\x16\xb3\x4b" - "\xd1\xeb\x3b\x1f\x45\xe0\xb4\x27\x3a\xbd\xee\x71\x82\x5e\xe7\xa2" - "\xd3\xeb\x9e\xe3\x83\xd3\xeb\x1e\xee\xff\x73\x97\xd2\xeb\x3b\x89" - "\xa1\xf4\x82\xae\x2b\xdb\x77\x8b\x15\xbc\xd1\x97\x25\x78\x0d\x0e" - "\x34\x49\xb4\x80\x57\x54\x99\x2e\x2e\x93\x6e\xf1\x29\x3e\x81\x0e" - "\x69\x3e\x4b\xdf\x49\x31\xc6\xff\xf0\x6a\x1a\x26\xfa\x9e\x10\x80" - "\x17\xc3\xe5\x5c\x45\xe7\x9c\x2e\x7f\x2a\xb1\xfd\x11\x51\x6f\x59" - "\x74\x59\xf0\x9d\x7a\xd0\xf4\xb5\x28\xe9\x8d\xca\x27\xe4\x3b\x9e" - "\x70\x19\xf1\x9d\xb6\xf0\x3e\x02\xdd\x50\x8e\x06\x7c\xda\x2f\xfb" - "\xbb\x7c\x9f\x7d\x37\xed\xd2\x3e\xfb\xee\x09\xd5\x5f\xdf\xfd\x20" - "\x1c\xbf\xef\x66\x46\xef\xaf\xef\x16\x0c\xde\x5f\xdf\xdd\x30\x78" - "\x7f\x7d\x77\x0f\xf7\x97\x9b\xbe\xeb\x0e\x9f\x37\xbe\xeb\x0c\x6f" - "\x2f\xea\x45\x39\xa1\x0d\xbd\x86\x9f\xbf\x6e\xbb\x8d\x1f\xcb\x38" - "\xee\xab\xba\x12\x02\x2f\xc7\x8c\x61\x1c\xaf\x14\xc6\xa0\xb0\x41" - "\xc3\xca\x55\xd1\xf7\x47\xd9\xc6\x6d\xad\x26\xde\x0b\x27\xdb\x8d" - "\xac\xbb\x4f\xfa\x4d\x50\xa3\x76\xdc\x6b\xa7\xe8\xbe\x35\x41\x4d" - "\x2b\x66\x3f\x4b\xe9\x5f\x29\xd7\x10\x26\x35\x87\xf6\x05\xfb\xe2" - "\xb0\x6d\xba\x49\xd9\x4e\x7f\x3b\x45\xf7\xce\x53\xfd\x72\xdf\x82" - "\x70\x3a\x4e\xf2\x44\xef\x97\x7b\xcd\xe8\x97\xbf\x45\xef\x97\x7b" - "\xc7\x0e\xde\x2f\xf7\xa6\xa1\x5f\xfe\x76\xe9\x38\xba\x37\x53\x1f" - "\x47\x6b\xb9\x8c\x6d\x31\xdb\xe3\xf7\xfe\x91\xf3\xe0\x1e\x63\xe4" - "\xde\x77\xf8\xfd\xf8\x2e\x63\x1c\xc9\x32\x1b\x00\x4b\xd6\xaf\xe7" - "\x29\xd3\x61\x84\xc2\x6d\xb0\x74\x45\x1b\x27\xf7\x1e\xe5\xbc\x77" - "\x14\x90\x19\x34\xcc\xdc\xc9\x30\x96\x12\x9d\xa5\xfb\x6e\xe0\x7c" - "\x9c\x7e\x87\x37\x74\x9c\xdc\xeb\x33\xf2\xb1\xac\x53\x79\xef\xf5" - "\x88\x9e\x3c\xe2\x7c\xe1\xb0\xef\xd3\xdb\x3f\x4c\xce\x23\x9c\x9f" - "\xf3\x45\xe4\x99\xae\xc6\xe3\x7d\x1b\xc2\xc7\xe3\x7d\xd9\xe1\xfc" - "\x09\xfa\xa3\x5c\x10\x72\x0e\xf7\x87\x80\xc3\xd7\xe6\xaf\xcb\x8f" - "\xcd\xfb\x8e\x47\x8c\x4d\xf0\xc0\xf7\x56\x2b\x1e\xf8\xde\x93\x11" - "\xb8\x7a\xa3\xf3\xc0\xf7\x12\x06\xe7\x81\xef\x25\x0f\xce\x03\xdf" - "\x4b\x67\x1e\x70\xd3\xf7\x8a\xc3\xc7\xe6\xf7\xe6\x87\xb7\xfd\x3e" - "\xaf\x1a\x9b\x74\xf5\x95\x8c\x4d\xe8\x42\xd7\x0c\x36\x0e\x79\x4c" - "\xa1\xee\x98\xba\x5e\x63\x3f\xe3\x6b\xd1\xcc\x8c\x71\x05\xfc\x26" - "\x27\xf2\x9a\x12\x64\xfc\x24\xa6\x61\xad\x3c\x6b\x33\x79\x6c\x28" - "\x1d\x37\xa9\x73\x2f\x76\xe4\x7d\x8b\xf7\x87\x15\x3d\xa7\xbc\x18" - "\xde\xfe\xc9\xe9\xd1\xe9\x39\x79\x3e\xe8\x69\x8f\x4e\xcf\xc9\x45" - "\x83\xd3\x73\x72\x15\xfb\xec\x5f\x3a\xa6\x26\xef\xb5\x2d\x97\x3a" - "\x8a\x2c\x73\x96\xa6\x0c\xf9\x7a\xf3\xd3\xe4\x8e\xf0\xf9\x69\x72" - "\xf3\x95\xcf\x4f\x53\x92\xa3\xcf\x4f\x53\xd2\xa2\xcf\x4f\x53\x32" - "\xd5\x78\x98\x52\x19\x3e\x1e\xa6\x14\x84\xf3\x04\x68\xf7\x3f\x36" - "\x3f\x4d\x71\x47\x8c\x81\x8a\x53\x74\xff\x02\xe8\x14\xa5\xaa\xdf" - "\xa6\x8e\x8b\xc0\xd1\x1f\xbd\xdf\xee\x4f\x42\xbf\x55\x44\xef\xb7" - "\xfb\x53\x07\xef\xb7\xfb\x67\xa2\xdf\x2a\x2e\xed\xb7\xfb\x73\xae" - "\x5c\xa7\xb8\xbf\x3a\xbc\xcf\xee\x2f\xbd\xf2\x3e\xbb\xff\x78\xf4" - "\x3e\xbb\xdf\x1b\xbd\xcf\xa6\x26\xa8\x3e\x9b\x9a\x1e\xde\x67\x53" - "\xc7\x86\xf7\xd9\x14\xff\x3f\xdb\x67\xe8\x9f\x2e\xe5\x67\x30\xf5" - "\x0d\xd8\xed\xc3\x7a\x1c\x53\x6b\xdc\x94\xa6\xef\xe1\xa6\xa9\xb9" - "\x43\xf5\xe1\x7e\xe4\xa9\xbc\x74\x1e\x98\xda\xa8\xa7\xfd\xf0\xd2" - "\x7e\x98\x7a\x0c\x32\xba\xab\xa9\x58\xee\x6b\xa9\x3e\x64\x9a\x23" - "\x9f\x73\x15\xef\x4d\x4d\xf5\x72\x59\xf4\xb1\x70\xf9\xfc\xc4\x72" - "\x1d\xf9\xbd\x0c\x87\xcf\x2a\x85\xc3\x4a\xb3\x5d\xc9\x1c\x3f\xb8" - "\x6f\xcc\x9b\x5d\xce\x92\xbb\x00\xef\x81\x7b\x14\xaf\xa6\x45\xea" - "\xbf\x75\x78\x17\xa7\xf8\xf4\xc1\xbf\x44\xe0\xb0\x2b\x3a\x9f\xa6" - "\x1d\x46\x1b\xea\xa2\xf3\x69\x5a\xfb\xe0\x7c\x9a\xc6\x32\xb3\x2e" - "\xc4\xf6\x19\xf1\x94\xdf\x1d\x61\xfb\x3c\x60\xb5\x78\x15\xef\x48" - "\x9d\xa8\xfc\x4d\xe8\x1c\x0f\x44\xea\x7f\xe8\x9b\x07\xde\xd5\x71" - "\xfe\x4d\x44\xf9\x41\xf4\xbf\x07\x58\xff\xdb\x1f\x1d\xe7\x07\x2e" - "\xa3\xff\x3d\xc0\xfa\xdf\xfe\x4b\xc7\xd6\x03\xba\xfe\x17\xcd\xc6" - "\x7b\xe0\x78\xf4\xfe\x7f\x20\xa2\xff\x29\xb3\x10\xf6\xb0\x2c\x1f" - "\x96\xef\xc1\xd1\xa1\xf9\xd8\xc7\x88\xf3\x32\x8f\x44\xc9\x3b\x3d" - "\x12\xe6\x20\xf9\x0a\x2e\xe1\x3d\xf6\x89\x8a\xca\x7b\x0f\xd6\xa8" - "\xf1\xf8\xa0\x37\x7c\x3c\x3e\x78\x28\x7c\x3c\x3e\x90\x19\x51\xee" - "\x58\xf8\x7b\xf0\xcf\xff\x98\x8c\x9d\x96\x1e\xc1\x03\xef\x9f\xa2" - "\x69\x1f\x28\x1e\x48\xbf\x2e\x1c\x8f\x69\xf3\xa3\xf3\xc0\xb4\x42" - "\xb4\xff\xfd\xe8\x3c\x30\xad\x72\x70\x1e\x98\xb6\x17\xb4\x7c\x3f" - "\x94\x6f\x1f\x2b\x4e\x1b\x16\x91\xa7\x2d\xba\xcc\x9b\xd6\x19\x7d" - "\x8d\x20\x9d\x14\x8d\xd3\x27\x85\xd3\x38\xdd\x1a\x4e\x43\xb4\xe5" - "\x9f\xa7\x61\xff\x59\xdf\x1e\x47\x7a\xe4\xf8\x77\x9d\xa2\x87\xf4" - "\xf1\xff\x70\x84\xac\x4b\xdf\xa5\x70\x89\xb6\x2e\x92\xce\xf6\xaf" - "\x2b\x3a\x2d\xd3\x8f\x0f\xd2\x66\xf6\x69\x73\x05\x2f\x19\x4b\x0f" - "\x25\x20\xfd\x31\x5e\x0f\xe5\xf5\x90\x5a\xa4\x3f\xe6\x27\xb3\x9c" - "\xaf\xfa\xe7\xa5\x87\xf8\xec\xa5\x60\xfa\x33\xff\x5a\x46\x53\x06" - "\xcf\x41\x8c\x57\x56\xb1\xf4\x59\xb0\xac\x63\x5e\xbf\x99\x79\xfd" - "\x21\xa9\xff\xf1\x3e\x0b\xfb\x03\x5a\x8a\x28\xc3\xe5\xf5\x93\xc1" - "\xef\x9c\x3f\x02\xf6\x06\x1e\x17\x9c\xdf\xc8\xab\xd6\xcd\x4a\x23" - "\x64\xd3\x43\x87\xa2\xf7\xf1\x43\xcd\x83\xf3\xce\x43\x9d\xaa\x9f" - "\x1f\x1e\x1d\xde\xcf\x0f\x43\xff\x1b\x3e\x97\xdb\x0a\x1e\xb8\xa2" - "\x71\x52\x68\x13\x9e\x41\xe5\xfd\xda\x27\xda\x0b\x4a\xe8\xc6\xd3" - "\xf4\xf0\x3a\x59\x9f\x26\x7c\x96\x35\x31\xd4\x24\x65\xc0\xc3\x9f" - "\x48\x3c\x91\x27\xcb\x4f\x9a\x58\xfb\x7c\x3b\xbf\xab\x73\x08\x1f" - "\xf2\xb5\xf1\x9e\x00\x9f\xf5\x03\x2f\x5c\x73\x92\x1e\xde\x19\x56" - "\xde\x44\xe4\x52\x30\xda\xeb\xe4\x78\x7c\xf8\x98\xb1\xa6\xbb\x6e" - "\x10\xff\x20\xe4\xf1\x19\xbe\x0f\xca\xf7\xeb\xe1\x41\xf7\x2f\x19" - "\x27\xf6\x8f\x67\x9c\x2e\x2f\x07\xbe\x3f\xd3\xe0\x5f\xe5\x33\xf9" - "\xfd\xf9\x03\x3e\x79\xdf\xcf\x73\xd3\xf7\x07\x3d\xcf\x11\x3e\x0e" - "\xbe\x5f\x15\x0a\x47\x9d\x77\xff\xfe\x1e\xc3\xaf\x0e\xf7\x87\xbe" - "\x02\x96\x81\xcf\xf1\x08\x7c\xba\xa0\xa7\x34\xe9\x30\x7c\x97\x83" - "\xc1\x7d\xae\x78\x96\xf9\x61\x7a\xe2\xe5\xd6\xfc\x62\xad\x94\xb1" - "\xf9\x12\xde\x9a\x2e\xf5\x25\x86\x71\x79\x1c\xa7\x97\x86\xd9\x16" - "\x72\xef\x9e\xf7\xb6\x66\xcc\x52\xe3\x7e\x46\xc4\x1a\xe1\xf4\x1a" - "\xe9\x37\xa5\x8f\xfb\xa7\xfc\x91\xe3\x60\xfa\x61\x63\x8e\x8e\x48" - "\x3f\x66\x8c\x7b\xd8\xb5\x0c\x37\x62\x9d\x75\xba\x57\x8d\x85\x19" - "\x33\x83\x71\xa1\xf6\xda\x0c\xa9\xff\x19\xeb\xa5\x6e\xe4\x0b\x2f" - "\x37\x23\x62\xfd\x6f\x7a\x8d\x18\x7c\x9d\x3e\x01\xfd\xeb\xe5\xbd" - "\x2d\x75\x76\x78\x46\x71\xc4\x7a\x85\x67\x93\x3c\x27\xfa\x29\xe0" - "\xfe\x40\x97\x7b\x3f\xf8\x22\xa2\xbe\x1a\xfb\x99\xcb\xb5\x7f\xc6" - "\x20\xed\x9f\x31\xd0\xfe\xc5\x12\x6e\xc4\x5a\xe2\x0c\xd9\xfe\xc0" - "\x25\xf2\xef\x07\x09\x90\x5f\x06\xdd\xa0\x73\xff\x20\xd7\xd0\xd5" - "\x79\xfd\x60\x70\x5d\xfd\x07\x03\xeb\x7f\xaa\xdc\xc0\xfa\x9f\x27" - "\x9a\xae\xee\x26\xb9\xb7\x1a\x5e\x77\x99\xa5\x26\x5a\x5b\x7e\x30" - "\xc8\xfa\xdf\x0f\xf4\xf5\xbf\x7f\x4b\x0c\x97\x67\x3f\x68\x0b\xef" - "\xc3\x19\x11\x7d\xf8\x03\x4f\x78\x1f\xce\xa8\xf9\xef\xce\x6b\x3c" - "\x71\xc6\xc6\xc6\x6a\xb1\x31\x5a\x4c\x2c\x5e\xa3\x89\x34\x2c\xd6" - "\x14\x3b\x04\xbf\xa1\xfa\x75\x98\x16\xab\x99\xf0\x1b\xa2\x5f\x87" - "\x46\x3c\x0f\xe3\xb2\xf8\x99\xf4\xeb\x90\x88\xe7\xa1\x5f\xf1\x7e" - "\x98\x5e\xaf\x51\xbf\x29\xe2\x79\xc8\x57\xbc\x1f\xfa\x4f\x96\xa7" - "\x4b\x9e\xc3\xfd\xd0\x66\x2c\x5e\xbe\x20\x7f\x51\x8e\xdc\x2f\xce" - "\xb5\x2d\x78\xe6\x99\xdc\x65\xcb\x6c\x85\x4b\x6c\x0f\x3e\xf0\xe8" - "\x5d\xf7\xd9\xd4\xb6\x73\xfe\x94\x71\x39\xf1\x34\x6b\xc5\x52\x7e" - "\x31\xeb\xb1\x19\x99\xb6\x8c\x07\x1f\x08\x7f\x69\x80\x91\xdb\xcb" - "\x97\x83\x12\x32\xfe\xd2\xca\x47\x12\x6d\x18\x29\x65\x4f\x47\x4b" - "\x3d\x91\x5a\xf3\x78\x64\x41\x33\xb4\x09\xd1\x6b\x17\xce\x9b\x79" - "\x4f\x7f\x96\xf4\x11\x1e\x5f\x5f\x4a\x05\x0b\xf9\xbc\xc9\xac\x3b" - "\xc5\x7b\x1e\xb2\xfd\x80\xb4\x93\xf4\xf8\x8b\x4d\xd0\x6a\xf9\xd9" - "\xd5\xe1\x27\x9b\x9d\xcc\x28\x7f\x35\xde\xc5\x88\xfb\x83\x48\xf3" - "\xea\x3e\xcd\x19\x63\x64\xda\x7b\xa5\x46\x3e\xcb\x29\x9a\xf5\x17" - "\xf1\x9e\x90\xcf\xe2\xfe\x4a\x3d\xdf\xac\xb7\x82\x8e\x99\x79\x2c" - "\x1b\x6a\x5e\x23\x53\xed\x6b\x44\xdb\x46\x90\x79\xdb\x48\x3e\x43" - "\x3f\xab\xc6\xd8\x0b\x2d\xc7\xb3\x9b\x1e\x2f\xe0\xba\x39\x6f\x50" - "\x9b\xf9\x9a\xcc\x3f\x22\x2c\x7f\xf3\xc0\x5e\xec\xac\x1a\x0d\xf9" - "\xe6\x7c\x4e\x16\x5f\x7c\xed\x51\x57\x71\x29\x59\x02\xe2\x8b\x3b" - "\xa6\x53\x4c\x2b\x66\xdf\x95\x7e\xe1\x77\x2e\x3d\x8d\xfa\x67\x5f" - "\x67\x59\x29\xbe\x70\x61\xf4\xcf\xea\xb2\x8b\x4d\x67\xc8\x84\x71" - "\x1d\xe3\x5c\xca\x7e\x0a\xb3\xa9\xf6\x4b\x32\x81\x06\xa3\x4f\xd3" - "\x9c\xd4\xe2\x59\x22\x60\x9f\x45\xa6\xff\x2c\x62\x7f\xc3\xdd\x0b" - "\x37\xfd\x99\x4c\xbf\xee\x2d\xd5\x7a\x85\x95\x8a\x0b\x05\xe4\x86" - "\x20\xbb\x57\xf8\xd8\x5f\xbf\x39\x3b\xc0\x79\x1e\xef\xb1\x5b\xa9" - "\xb5\xd0\x4b\xab\x8f\x0b\x5f\xd9\x9f\x95\x9f\x7f\x4b\x97\x97\xfd" - "\x17\xcd\xab\x67\x51\xec\xa9\x4c\xd2\x5a\xf2\xaa\xc9\x35\xdf\x4b" - "\xc5\xc7\x45\x67\x73\xf6\xe7\xd4\x9a\xd7\x40\x59\xed\xa4\x35\x77" - "\x7c\x46\x32\x3e\xc4\xfa\xbf\xb2\xdf\xa3\x75\xf5\x22\x4e\xbb\x40" - "\xab\x56\xd3\x55\xab\xfe\x42\x16\x57\x67\x3b\xea\x39\x43\x3f\x3e" - "\x46\x31\x80\xa7\xbd\xfc\x19\x59\x5f\xfe\x11\xfb\xf3\xa6\x51\x4d" - "\x09\x59\x85\x3d\x39\xa1\xd7\x9e\x9c\xd8\x2b\x92\x47\xf4\xd8\x93" - "\x93\x5a\x0b\x90\xbf\xe3\x5d\x1a\xde\x4e\x49\xef\x9d\x6e\xd7\xaa" - "\xcf\xd3\x68\xdb\x6c\xee\xff\x39\x29\x35\xe7\x91\x7f\xfd\xc1\xd2" - "\x20\xca\x86\x96\xf1\xc7\x1d\xac\x76\x65\xfa\x28\x08\x58\xd5\xbd" - "\x34\xba\xa6\x97\xac\xc1\xf2\x83\xa5\x4c\x8b\xbe\xf5\x6f\x1e\x85" - "\x2c\x1c\xb6\xff\xe9\x46\x93\xab\xb9\x8b\x5a\xbc\xbd\xd4\x4a\x9f" - "\x92\xab\xe8\xef\xce\x5f\x3f\xdd\x38\x24\x08\xe6\x77\xae\xea\x00" - "\x7c\xc5\x33\xf6\x16\x3e\x97\x58\x4a\x15\x25\x94\x50\xb0\x8a\x86" - "\x9d\x46\xba\xb2\xe9\xb7\x41\xb7\xf9\xbb\x73\x95\xf4\xc1\x7d\xbc" - "\xa0\xa4\x85\x62\x5b\xbd\xd5\xdc\x66\x2d\x10\xff\x57\x72\x79\xdb" - "\xc8\x55\xf0\x37\x67\xd0\xfc\x59\xe7\x86\x20\x99\xf7\x5d\x6c\xd3" - "\x5c\xa6\x8b\xe4\xca\xf4\xd2\xfb\xa8\x5b\xac\xff\x6b\x02\xe4\x55" - "\x5a\xab\xd7\xc7\xe7\x92\x52\x45\xb7\x35\xbe\x62\x29\xa5\xd4\x9e" - "\xa7\xb1\x3b\xcf\x53\xb2\xe8\x49\xd6\xd8\xaf\xf6\xc9\x33\x89\xb4" - "\x13\xd7\x84\x0e\x32\xa3\xbd\xca\xa7\x3a\x4e\xf7\xaf\xed\x4b\xa6" - "\xba\xde\x01\xff\xda\xde\xee\x01\xff\x5a\xf0\x52\x3d\xfb\xd8\x62" - "\x5c\x64\x32\x3f\x57\x9c\x25\xd3\xda\xb3\x44\x77\x94\x6a\x64\x7b" - "\x9a\xcf\x47\x3c\x32\xc4\x95\x73\x46\xde\x9f\xa4\x8c\xc3\xb8\x26" - "\xe0\x17\x83\x31\x20\xd7\xb3\x3b\x74\xbe\x45\x9a\x86\xb4\x37\x70" - "\x8d\xc5\x75\xa7\xbd\x46\x78\x44\xd9\x9e\xd1\xdd\x1a\xc5\x33\xff" - "\x2a\x5f\xde\x3d\xa3\x7b\x1c\x19\xd0\x7f\x72\x93\x0c\x3e\x56\x32" - "\x7d\x56\xfd\xfb\xa7\xce\x70\xbc\x16\x8f\xc4\xa7\x2f\x2f\x86\x63" - "\xb7\xe8\xe9\xc0\x21\x23\xc0\xf5\xa2\x7e\x37\xae\x16\xfc\x30\x2e" - "\x33\x0a\x8d\xb2\xdd\x7d\x79\x5c\xe7\x05\xa4\x0b\x23\x1d\xed\x35" - "\xf1\xbb\x83\xa7\xce\x68\x2a\x4f\xb2\x06\x98\x3e\x1d\x3e\xc6\xfa" - "\xac\x74\x1e\xd3\xdd\x9a\x45\x1c\xc9\x99\x48\x35\x23\x45\xdb\xce" - "\x2d\xa2\x49\x8d\xb5\x47\x26\xb9\x69\xa1\x8d\x71\xc4\xbc\xdd\xb4" - "\x01\xef\x8e\xd8\x88\x98\x2e\x4d\xd9\xec\x3f\xf6\x48\xa6\x9b\xe2" - "\x8f\x87\xb6\x41\x38\xfe\x6d\x3a\xcf\x9d\x6f\x97\x38\x87\x08\x6d" - "\xe6\xf4\x56\x77\x17\xfd\xba\xb7\x73\x88\xfd\x8f\xa4\xb9\xfc\x27" - "\x69\x42\x12\x59\x59\xff\xab\xdb\x22\xdc\xb8\x76\xb2\x3f\x27\xf8" - "\xe4\x86\xd3\xf4\xc8\x1b\xb7\x27\x51\xd2\x9f\x8a\x48\x97\x47\x8f" - "\xbc\x1b\x22\x8f\x1e\x6a\xe9\x68\x0c\x91\x45\xf3\x2e\x5c\x2a\x8b" - "\xe6\x7e\xa1\x64\x91\xf0\x2b\xd9\x13\x70\xeb\xe9\x9f\x45\xa4\xeb" - "\x7e\x21\x73\x3f\x88\x48\xf7\xe9\xe9\xfb\x22\xd2\x3d\x2a\xfd\xb1" - "\x33\x86\xac\x6b\x65\x3c\x56\xb0\xac\x7b\xec\x23\x96\x75\xad\x39" - "\xba\xac\x93\x3e\x86\x8f\xfd\x46\xfc\xa2\x94\xf8\xec\x11\xee\x37" - "\x32\xfe\xe2\x3d\x32\x70\x8f\x43\xda\x2c\x4e\xab\xfc\x94\x4c\xf8" - "\x49\x39\x27\x1c\x33\xf7\xb3\x9c\x63\x19\xc7\x7e\x27\x3b\x46\x8a" - "\xf6\x1d\x5b\xc4\xb1\x9a\x2d\xa2\xb9\xc7\xf1\xe8\x61\x43\xde\xfd" - "\x14\x69\x1b\x90\xf6\x53\xbc\x67\xb9\xc7\x34\x69\xc9\x6c\xe4\x73" - "\xfa\x1d\xe0\xe3\x1c\x4b\x0c\x15\x6c\x02\xcf\xf3\x79\xc0\x75\xa0" - "\xaf\x0b\x32\x89\xcf\x72\xc9\x38\x27\x5a\x2a\x64\x54\x07\x8f\xb7" - "\x91\x6b\x31\xbe\x5c\x45\x9f\x53\x89\x57\x9c\xe6\x73\x71\x8c\x43" - "\xd6\xca\x1f\x70\x1c\x8f\x98\xa6\x3c\x22\xf6\x01\x67\x7f\x15\xc8" - "\x5d\x53\x25\x70\x3a\x92\xcf\x7d\xfd\x18\xec\xff\x6d\xfa\x79\xa4" - "\xc7\x0b\x38\x2e\xd0\x49\x7a\xb4\x0c\xf6\x9d\x8f\xdb\x66\x09\x94" - "\x12\x9f\x5f\xc1\x18\x65\x1b\x2f\x6f\x07\x7e\x95\xc6\x19\x16\x8e" - "\xed\x84\x3c\xae\x76\x1f\x31\xce\x6e\x7a\xf4\x58\x4b\x71\x23\x97" - "\x2f\x62\xda\x08\x87\xdd\x80\x11\x23\xcf\xc0\x38\xc8\xcc\x67\x60" - "\xdc\xf4\x58\x9e\x2c\x1f\xff\xe6\xd1\x96\xf9\x1e\x62\x39\xef\xea" - "\x04\x8c\xe2\x93\x0a\x06\x60\x09\xc8\xfd\xb0\x77\x3a\xfc\xab\x56" - "\x8b\x2f\x00\x3f\x9d\xfb\x8b\xcf\x2d\xf2\xfe\x1a\xe8\x92\xc0\x7e" - "\xf1\x4a\xf7\x7c\xb4\xa5\xee\x53\x22\xfd\xec\x25\xf8\xed\xd1\x66" - "\x3e\x6f\xc4\xe7\x2d\xe5\x59\x4b\x6d\x22\x89\x15\xc9\x09\xfd\xe7" - "\x2d\xff\x7f\x38\x6b\x09\xfa\x5b\x6b\x35\xd1\x00\xfc\x9b\xf9\xbc" - "\x25\xf0\x4f\x61\x3e\xd4\xdb\xd4\xf6\xf3\x1f\x4b\x9a\x27\x71\x1a" - "\x6c\xc5\xa3\x46\xff\x73\x7b\xb9\x2d\x27\xe9\x11\x9f\xd2\x09\x45" - "\x9b\x9b\xe6\xb6\xf1\x7b\xa4\x75\x70\xfe\x09\x90\x63\xae\x9c\x00" - "\xed\x3f\x15\xd0\x2a\x56\x91\x49\xc9\xb4\x79\xff\xe0\xf2\x4a\xa6" - "\xcd\xab\x1f\x90\x69\xf3\x7e\xae\x64\x9a\xa2\xb1\x92\x69\xf3\xca" - "\x95\x4c\x9b\xb7\x46\xee\x83\x41\xa6\xf1\x3b\x96\x6b\x86\x4c\xdb" - "\x39\x52\x1c\x65\xd9\xd1\xe3\x98\x57\x60\xc8\xb6\x8d\x48\x63\xd9" - "\xc1\x38\x2a\x39\xf5\xd8\x51\xf1\xbf\x92\x49\xf9\x19\xf0\x7d\x1e" - "\x9f\x55\xe8\xd4\xef\xd1\x2f\xf3\x4e\x28\x19\x37\xaf\x69\x40\xc6" - "\xcd\x9b\x3e\x50\x96\x65\xdc\xbc\x4f\x94\x8c\x53\xe9\x75\x3f\x66" - "\x19\xf7\xd8\x51\xa6\x81\x0e\x5f\xe3\x35\x3b\x3d\x3f\xe8\xf8\x48" - "\x5b\xa8\x8c\x0b\x1f\x5f\x8f\x8f\x36\x64\x1c\xcb\x36\x3c\xa7\x40" - "\xa6\x49\xdf\x60\x1e\x67\x55\xa0\xb9\x31\xee\xb8\x0f\xb8\xcd\x1c" - "\xff\x87\xe9\x36\xed\x0c\x0d\xd3\xcf\xfd\xe8\xed\x7e\x3c\xcf\xf0" - "\x75\x74\xd3\xbc\x82\x68\x7a\xb3\xa1\xa7\x81\x1f\x6f\x0a\x60\xbc" - "\xb9\x4a\x31\x97\x56\x8b\xd2\x56\xff\x31\x7a\xaa\x90\xb4\x60\xec" - "\xf3\x27\xb8\x6f\x61\x67\x0c\xe5\x2b\xcb\x1e\xcc\xa1\xfb\xb2\xbc" - "\x34\x14\xb6\xf9\x89\x0a\x0d\xef\x8a\xe8\x7b\x21\xef\xfe\xc8\xf5" - "\x84\x94\x1b\x1f\xf2\xee\x73\xa9\xe3\x9d\xe5\xd8\x4f\x8f\x57\x0e" - "\x66\xfb\x5f\x19\x2e\x3f\xbc\x77\x70\x5c\x7e\x38\x6f\x70\x5c\x7e" - "\x28\xf5\x80\xf1\x5d\x14\x03\xdb\xec\xea\xb3\xf4\x43\xb9\x1e\x23" - "\x63\x57\xac\x8d\x5a\xcf\xeb\xfa\xfb\x21\x21\xef\x43\xeb\xfa\x20" - "\x4a\xf9\xd0\xfa\x4e\x5c\x1e\x7e\x66\xcc\xe5\xe1\x67\x8e\xb9\x3c" - "\xfc\xcc\x07\x58\x06\x82\x76\x96\xa0\x16\x9e\xef\x0e\xbf\x1c\x83" - "\x47\xf9\xdc\x1d\xf2\x2d\xd2\xd7\x7c\x4e\xd8\xc7\x48\x5b\x50\x9e" - "\xcd\xda\x84\xf7\x7c\x96\x9c\xe5\x73\xfa\x4a\x22\xb5\x47\xdd\x5f" - "\x66\x67\x24\x6e\xc3\xfd\x06\x6e\xf2\xfd\xbb\x91\xb8\xe1\xfd\xf8" - "\x90\xf7\x9f\x0d\xf4\x7b\xe6\x65\xfd\xeb\x5d\xd5\x44\x1c\x43\xef" - "\x08\xcc\x17\xcc\xc9\x1c\x8f\x4b\x5f\x9f\xf9\xd1\x44\xc8\xf9\xd2" - "\x10\xbf\x5d\xf6\x39\xbb\xa9\xd5\xcb\xe7\x54\xbd\x32\x56\x0a\xda" - "\xf2\x4d\xcc\x27\x23\xf8\xac\x0e\x9f\xdb\xc9\x0a\x64\x68\x2a\x26" - "\xce\x8f\x0a\x8c\xb2\x83\xad\x03\x71\xbd\x7a\x9d\xec\x03\xeb\x45" - "\x99\x5d\x46\x19\x86\xcd\x7e\x94\x98\x07\x6e\x92\x67\x57\xfd\x5d" - "\x2c\x77\xbf\x09\x3d\x79\x84\xaa\x27\x9b\xf4\x7a\x60\xc7\xfe\x30" - "\xe1\x72\x67\x47\x06\x6f\xdf\x8f\x93\xae\xbc\x7d\xa4\xb7\xef\xc7" - "\x19\x5f\xd1\xbe\xcb\xd5\xbb\xe1\xca\xeb\x4d\x34\xea\x3d\x7a\xe5" - "\x74\xfd\xb1\xff\xeb\xd3\x35\x55\xa7\xeb\x13\xa9\x5f\x41\xd7\x28" - "\xf5\x3c\x91\xf3\xf5\xeb\xb1\x19\xf5\x54\x47\xab\x87\xe4\xdf\xa0" - "\xe7\xba\xcc\x46\x6c\x3a\x8e\x0b\xa9\x62\x52\x3d\xe1\x0e\x8d\x9d" - "\xa9\xe2\x45\x3e\xe1\x35\x62\x67\xea\x31\x2c\x31\xb7\xcc\xbf\x3a" - "\xab\x9e\xf5\x11\x11\x74\xd3\xfc\x24\x8e\x7b\x98\xbe\x3a\x34\xc6" - "\xe4\xfc\xe4\xcb\xc5\xec\xe4\x58\x39\x42\x64\xd2\x91\x6a\xe9\x0f" - "\x80\x79\x68\xfe\x02\x3e\x1f\xa0\xf6\x33\xe7\xe7\xab\x31\x39\x3f" - "\xdf\x4d\x4f\x34\x0e\x0e\xe3\x40\xc1\xae\x92\xd4\x21\x83\xf9\xfc" - "\xa3\xfc\x5e\x37\x3d\x2b\xd7\x2f\x03\xeb\x1b\x2a\xc5\x39\xab\x1e" - "\x8b\x2b\x2b\x2e\x24\x56\x18\xe6\xee\xa7\xee\xd5\xcf\x26\x80\x06" - "\xa5\xa0\xe5\xfc\x0e\x83\x06\x46\x3a\xd2\x7c\x06\x0d\xa0\xaf\x24" - "\xb8\xea\xfd\x7c\x76\xc8\xab\xce\x7b\x3f\x79\x83\x28\x3f\x90\xad" - "\x60\x3f\xa9\xf6\x19\xe2\x1b\x2a\xbd\x2f\x5b\x35\xa3\xfc\x58\x9b" - "\xfd\x4b\xe6\x61\x4f\xdc\x81\xec\x1e\xc7\x93\xe9\x06\x7c\xc1\x78" - "\x89\x81\x7c\x75\xd2\x2f\xe9\x49\xf4\xff\x13\x93\x25\x5f\xa3\x0e" - "\x89\xbb\x46\xb1\x41\xe0\x8f\x36\x68\xae\x02\x2f\xeb\xa9\x5d\x01" - "\xb4\x9f\x65\xdd\xa1\xc5\x6e\x13\xe7\x91\xba\xc3\xb9\x64\x4d\xc5" - "\x39\x7b\xf2\xdd\xe0\x39\x8e\xb7\x21\xf1\x4a\x40\x9b\xcd\x8c\x93" - "\x1b\x57\xcf\xcb\xc9\x34\xe7\x02\xe9\xb4\x78\xf2\x8d\x20\xd2\x83" - "\xcb\x06\x70\xa8\x95\x67\x3c\x9e\xec\x34\x70\x08\x72\xfd\x3d\x56" - "\x0d\xba\x18\xd7\xdb\x29\xcf\x59\xa2\xee\x09\x1c\x97\x8a\x63\x59" - "\xac\x48\x26\xc6\xa1\xc7\xf1\xd4\x68\x83\xde\x7a\x19\xa3\x8e\xe6" - "\xa0\xac\x5b\xd1\x46\xd1\xf9\x08\xf4\xc1\xa7\x66\x5e\x4a\xe7\xa7" - "\xb2\x43\xe8\x1c\xcb\x7c\xc5\x6b\x2c\xe8\xa3\x00\xd3\x9b\xf7\x35" - "\x6c\xcb\x59\xaf\x7a\xea\x67\x47\xbc\xd2\xef\x24\x81\xe1\x06\x41" - "\x7f\x86\x01\xb8\xdf\x50\x34\x7e\x6a\x4f\x3f\x8d\x51\xb7\x40\x5f" - "\xac\x55\x67\x52\xd8\xf7\x1d\xb2\xe3\xa9\xa3\xfd\xf5\x30\xae\x76" - "\xab\x16\x14\x56\x8e\x6b\xe7\x61\x5c\x0b\x6d\xc2\xc7\x7a\xa5\xf4" - "\x63\x42\x5b\x0f\x95\xb4\x9b\xa0\x5b\x6a\xb2\xae\xee\x64\xd6\xef" - "\xcd\xf2\x1e\x75\x0d\xc2\xdf\x9f\x70\xec\x38\xa3\x5d\x68\x8b\x99" - "\x79\x0b\xb8\x43\xff\xcb\xbe\x4a\xf2\xcb\x72\xee\xa7\xac\x2f\x38" - "\xcd\xc8\x87\xe7\x0f\x39\x9f\xf1\x8c\x77\xe0\xaf\xac\x57\xd0\xae" - "\x78\xc6\xd3\xc3\xf1\xf2\x64\x9b\xb3\x93\x19\x46\x8f\x23\xab\x32" - "\xac\x9d\x7d\x99\x26\x83\xef\x78\x8f\xa8\xc9\xe6\x93\xb2\x53\xd1" - "\x36\xeb\xb0\x31\x26\xb9\xbc\x1a\x63\x59\x6d\xa1\xbc\xe8\xb5\x0f" - "\xf0\x41\xe1\x18\x32\x9b\x6c\x1c\xef\x2e\xab\x41\xc5\xd5\xcd\xf2" - "\x47\xf6\x17\xbf\xe3\xd8\x70\x3a\x0d\x79\x3c\x25\x9e\xa4\x2c\x0f" - "\xb7\x0d\xef\xd2\x2f\x37\x5f\x72\x8c\x36\x8e\xb7\xb7\x59\x8d\x23" - "\xd0\x65\xc1\xa2\xcd\xea\x7c\x8f\x57\xc5\x48\xcb\x7e\x41\x68\xaf" - "\xcb\xfe\x62\xbf\x3c\x19\x0f\x43\xc6\x9e\xc8\x66\x1f\x37\x31\xbc" - "\xe0\x75\x19\x2b\x51\xf7\xd9\xf3\x34\x15\xf8\x65\x9c\x35\x7b\x21" - "\x9f\x83\xf5\xb3\x4d\x26\x7d\xd2\x8e\x14\xfa\xe9\x31\x1f\xd3\x36" - "\xfb\x30\x9f\x57\xf7\x4a\x5a\x64\x1f\x35\xce\xa8\x73\xdc\x37\x8e" - "\x25\x38\xc1\x4f\xb1\xac\x53\xd8\xec\x1c\x5b\x60\x41\x3d\xeb\x24" - "\x8a\xa6\xe0\x7b\x4d\xb4\x29\x5e\x5e\x70\x35\xc7\x66\x54\xfb\x4b" - "\x27\xc1\xdf\xb1\x7f\x47\xde\x5b\xd5\xba\x8c\x31\xd6\x16\xbc\xce" - "\x7b\x4c\x6e\x1d\x46\x8f\x63\x01\xe6\xff\xf9\x55\x97\x8e\x8b\x05" - "\x57\x1b\x36\x06\x9f\x8b\x53\xfb\x55\x03\xf0\x50\x5e\xae\x4b\x0f" - "\xc8\xa6\x3f\x30\xac\xd2\x4b\xc7\xcc\x82\x2a\x83\x97\x0b\x6e\xe6" - "\x73\xd5\xd9\x99\x5c\xff\x60\x32\x53\xd8\x7f\xc4\xfd\x64\x3e\x65" - "\xa3\xd8\xaf\x3a\x2f\x31\xb0\xff\xb5\xc0\x67\xb4\xc1\xa0\x89\x6a" - "\xc3\xd3\x8f\x74\xc7\xbf\xe9\x19\x68\xfb\xd3\x8f\x48\x5a\x0c\xbc" - "\x2f\x0f\xa1\x0d\x3f\x97\x29\xbe\x7b\x7a\x3a\xf8\x43\x5f\xb3\x51" - "\x69\x22\xfe\xc0\x33\x1c\xa7\x51\xe1\xb8\x88\x0c\x7e\x47\xde\x42" - "\x37\x9d\x4a\x56\xfb\x50\x4f\xa3\xfd\x0b\xda\xf4\x72\xa3\x19\x97" - "\xa8\xed\x0c\xc3\xf1\x19\xe2\x39\x56\xc5\x2d\x78\x26\x86\xf1\xb5" - "\x7d\x8b\xfb\xf8\xe9\x16\xae\x97\x79\x42\xf4\xe5\x0d\xf1\xf6\x25" - "\x53\x77\x5f\x1e\xc6\x4f\xb2\x86\x7a\x20\xff\x3e\x37\xe9\x75\x7a" - "\x0d\x5c\x19\x37\xe8\x8a\xe6\x1e\xb1\x28\x3a\x7d\xb9\x5e\x1e\xef" - "\x7d\x79\xc3\xf0\x33\xe3\x37\xf4\xeb\xce\xc7\xd0\x6b\x3b\x3d\xe5" - "\xfb\xe6\x07\x97\x8b\xa3\x73\xfc\x22\x08\xbb\xa0\xb3\x02\xfc\x3b" - "\x7c\x8d\x93\x86\x7b\x9f\xd4\xb2\x56\x52\x1a\x6c\x5b\x12\x17\xc5" - "\xa4\xda\x20\xae\xcb\xc5\x44\x8e\x47\x8b\xe7\x54\xfd\x39\x85\x9f" - "\xbb\x97\x8b\xf9\x3d\x8e\x67\xf6\x18\x7b\x77\x2a\xf6\xcc\x33\x8d" - "\xfd\x71\x78\x62\x9f\xe0\x73\x3e\x34\xa7\x08\x75\xc4\x3e\xdf\xc9" - "\xf5\x66\xf1\xdc\x81\xfa\x90\x0f\xf3\xff\xfc\x89\x9c\xcf\x13\x7b" - "\xdb\x08\xfc\x92\x07\xd9\xe3\xec\x64\xbc\xba\xe3\xf6\xcd\x37\x70" - "\x1d\xee\x4d\xd3\xbe\x1e\x6e\x39\xe9\x06\x6e\x48\x3f\x5a\xa1\xd2" - "\xfd\x1c\x8b\x8c\x7d\x10\xf1\x3e\xc7\xc0\xd5\xc0\x81\xeb\xe3\x73" - "\x95\x22\x7e\xb7\x8c\xed\xc2\xf5\x79\x5e\xce\xe3\xbc\x95\x06\xbe" - "\x5f\x7d\xf6\x27\x3a\xdd\xdd\x94\x73\x5c\xf1\x64\xce\x71\x63\xfe" - "\xc2\x7d\x67\xf8\x7e\x6f\x4e\x5b\xa4\x2c\x7b\x7a\xc9\x92\xc2\xac" - "\xa5\xb9\x7c\x49\x1e\xf7\xd2\xad\xf1\xa1\x36\x29\xcb\x37\x15\x1b" - "\x20\x97\xcf\x3e\xd1\xe6\x11\xc6\xfe\x65\x6e\xff\xf9\x27\xdd\x4f" - "\x7a\x2a\xeb\xaa\xac\xd3\xe1\xdd\xfc\x0f\x8a\x57\x33\x98\x98\x13" - "\x66\xd2\x06\x93\x9d\x2c\x2f\xba\xe3\x3e\x49\x95\xf4\x28\xf7\xd4" - "\xa3\x5c\xff\xfa\x67\x74\x3f\xb1\xdd\x69\x81\xf5\x07\x9d\xb6\x51" - "\x32\xc6\x91\x76\x70\x55\xbb\xc6\x73\x78\x09\xee\xd9\x76\x92\x7a" - "\x83\x1e\x37\xe7\xbd\xf3\xed\x90\xc3\xb9\x9d\xa2\x7c\x77\x1a\x60" - "\xba\x07\xc5\x21\x64\x8f\x9d\x7d\xb2\x3a\x68\x21\x0d\xba\x1f\x5e" - "\xd6\x50\xaf\xc6\xe1\xc2\x79\x4d\x56\xe2\x33\xa2\x3f\x39\x49\x0b" - "\x1f\x31\x59\x21\x6b\x47\xd1\x6e\xdc\x4b\x5b\x97\xdf\x85\xf5\xd7" - "\x0d\x67\xea\x4d\xb1\x42\x13\x42\xc4\x08\xf5\x47\x26\xfd\x26\x16" - "\x3f\x4d\xc4\xc8\xdd\xa2\x58\x50\x6a\xd8\x50\x13\x59\x86\x27\x98" - "\x6f\xba\x71\xb4\x75\xea\xfd\x93\x27\xd9\x4b\x8a\xc1\xdd\x7e\x9f" - "\x45\x84\xc6\x79\x6a\x6f\x9b\x77\x6b\x29\x49\x7f\x81\xf2\xf6\xb6" - "\x68\xb8\x6e\x74\x88\x02\x3e\x9b\x1b\x8c\xf7\x24\xda\x5f\x22\x6d" - "\x7f\xaf\x5b\xe3\xd8\xc1\x3c\x47\x73\xcc\x32\xe0\x7a\xe2\x7d\xa4" - "\xa1\xfd\x45\xa2\xcc\x93\xa8\xf6\x03\x9f\x1d\x13\x5c\xef\x49\x1c" - "\x80\x6f\x22\x86\x6f\xdf\x46\xda\xae\x92\x4e\xcd\x65\xba\x9f\x5c" - "\x36\x2f\xbd\x8f\xfb\x41\xfa\xb3\x00\xf4\x27\x86\x51\xe7\x08\x96" - "\xd9\xbf\x24\x4d\x3f\x5f\xa7\x9d\xa5\x67\x7f\xd4\x30\x48\x39\x3e" - "\xcf\xda\x1d\xbf\xef\xe6\x1e\xc7\xb3\xe8\xff\xef\x79\xf5\x39\x01" - "\xb2\xeb\x59\xd8\x7f\xb9\xea\x39\x7e\xdf\x98\x6e\x19\xd7\xf2\xd9" - "\x46\x23\x4f\xf4\x79\x81\xd7\x1c\x85\x93\xfb\x55\x5c\xfc\x47\x27" - "\xfb\xee\x0f\xb2\xcf\x3f\xcc\x55\x74\x17\xef\xb3\x0c\x19\xee\xa3" - "\x04\xfb\x05\xd1\x07\xbb\x3d\x09\x6c\xab\x05\x60\x7b\xf9\x2f\x8a" - "\xcc\x96\xae\xf3\xc4\xb1\xfe\x78\xbf\xf6\xed\x85\x7f\xd0\x5c\xbe" - "\x73\x4e\xd7\xba\x20\xb5\x62\x7e\x76\xd5\x9c\x73\xb6\x74\x1d\xc3" - "\x7d\x80\x5a\xe8\x53\x6a\x29\xfa\xb8\x54\xae\x95\xd4\x88\x52\xa6" - "\x73\xdf\x45\x31\xd7\x65\xfa\xff\x88\xe3\xd5\xb3\xac\x00\xdd\x6d" - "\x67\x29\x6f\xcd\x7b\x80\xb3\xff\xaf\x80\x25\x63\x3b\x4d\xa1\xf7" - "\x71\xdf\xe3\xc8\xdb\x60\xc8\x91\xa8\x71\x34\x62\x9c\x1b\x2d\x45" - "\x4f\x6a\x41\xc8\x24\x8e\xc1\x05\x59\x34\x91\xdb\x85\xe7\x54\x7e" - "\xc6\x35\x85\xaf\x96\x35\xce\x9d\x16\xff\x93\x2c\xa3\x32\x59\xfe" - "\x20\x7d\x6e\xdd\x45\x29\xb3\x32\xf4\xe7\x99\xfa\xf3\x74\xfd\x39" - "\x5d\x7f\x4e\xd3\x9f\x27\xf3\xb3\x92\x6d\x8b\x6c\xfd\x72\x57\x1b" - "\xd6\x86\xe7\x54\xa3\x2f\x80\xcf\x55\x96\xa2\xd5\x52\x46\xea\x78" - "\x4c\xd4\xf1\x4a\xd5\x9f\x0d\x7c\x6e\xb0\xf8\x57\xff\x4f\xe1\xd3" - "\x10\x81\x8f\x33\x04\x1f\xb2\x14\xa5\x7d\x1d\x7c\x12\x2d\x1c\xaf" - "\xf9\x9f\xc0\x87\x71\xe1\xb4\x1e\xc7\x73\x69\xe1\xf8\x3c\x97\x61" - "\xe0\x13\x95\xdf\x96\x8b\x4e\x9e\x1f\x96\x5d\x27\x63\x55\x0e\x63" - "\xd9\x5f\xd7\x6b\xc4\x53\x7b\x6e\xc3\xe5\xe2\xa9\x61\x2c\x58\x91" - "\x07\xed\x7f\x6e\xbe\x3e\x0f\x1e\x56\xfa\xd2\x73\x4d\x86\x6f\x0c" - "\xda\xba\xa7\x42\xb5\x75\xef\x3a\x8e\x29\xb6\x92\xae\xb7\x17\x89" - "\x4e\xe8\xff\xff\xd5\x64\xf3\x84\x8d\x81\xfc\xc2\x65\xcb\x5e\xb8" - "\xcf\x96\xbf\x60\x71\xae\x6d\x5c\x8e\x6d\x59\xde\xa2\x85\x85\xb9" - "\xe1\xfb\xc5\x89\x7a\xbc\x7c\xe9\x07\xcf\x3a\x29\x8f\x01\xe6\x7f" - "\xb6\xe3\x95\xef\xe2\xf3\xaf\x08\xc7\x73\x7c\x56\xd6\x5c\xfb\x1a" - "\x99\x78\x8f\xa2\xc7\xf1\xfc\x5c\x63\x4e\x50\xf1\xa1\x29\x46\x4b" - "\x64\x9d\xeb\x79\xd8\xbf\xcf\x76\x85\xa4\x73\xde\x52\x23\x8d\xe1" - "\xeb\xb2\x69\xd8\x49\x7a\x7e\x0c\xd7\x19\x95\x86\x17\x45\x3d\x6c" - "\xdd\x18\xd8\x23\x6c\x1b\x0a\x8e\x1f\xc4\xe7\xcb\x50\x4e\x00\x9f" - "\x8f\x58\xf6\xf2\x37\x20\x94\xee\x2b\x18\xc7\xcf\x51\x66\x17\xd2" - "\x4c\x9b\x90\x17\xfa\x74\x27\x97\x43\x7a\x80\xcf\xf9\x23\xdd\xac" - "\xc7\x44\x42\x5a\xfe\xd5\x7c\x0e\x1f\x69\x89\x21\x69\xe3\x38\x4e" - "\x2f\xd2\x6c\x0a\x5e\xfe\x3d\x4c\x67\x3c\xa7\xe9\x36\x37\xe7\x99" - "\xa1\xd7\x1b\x16\x2f\x8b\xa3\xa8\xdf\x75\x47\xaa\x6d\xee\x63\xdf" - "\x99\x72\xff\x33\x4b\x16\x2f\x8c\x27\x49\xf6\xe4\xd4\xa2\x71\xa9" - "\x77\x15\xdd\x7a\x9f\xad\x20\x37\x77\xa9\x6d\x45\xee\xe2\x42\xdb" - "\x82\x15\x0b\x56\xc6\xd3\xc2\x25\x4b\x9f\xe1\x53\xe4\xdc\x2d\xcb" - "\xb2\x9e\x59\xf8\x2c\x6f\xea\xab\xdc\xf1\x61\xf3\xf1\x5c\x96\x6d" - "\x7a\xdc\x85\xa3\x90\xb9\x3e\x11\xf7\x4e\x36\xee\x39\x16\x91\x15" - "\xd7\x26\xfc\x0e\xe3\xd7\x88\xdf\x31\xfc\xda\x4e\xd3\xd2\x24\x5c" - "\x0f\xf5\x38\xf2\xbd\x86\x5e\x30\xc0\x43\x2f\x98\x0d\x1e\xc2\x3c" - "\x7e\x48\xcd\x6f\x2f\x4c\x6a\xf5\xcb\xf1\xd3\xcf\x53\x15\x17\x07" - "\x78\x4a\xc6\x3b\x64\x9f\x95\xe5\x78\x0f\x1e\x66\x3b\x16\x34\x8f" - "\x63\xba\x9d\xa2\x82\xf1\xb0\xfd\x9b\x39\x16\x08\xae\x4d\xe0\x97" - "\x66\x15\x7f\xe3\x85\x43\xc8\x37\x06\x75\x1c\xd6\xeb\x50\xcf\x23" - "\xc5\x51\xb6\xf3\x4f\xea\xcf\xca\x26\x5e\xf2\x21\xdf\xf3\x55\xdf" - "\x2b\xb2\xb0\xff\x9f\xb2\xad\x8c\x77\x8b\x9f\xd4\xeb\x70\x82\x16" - "\xa5\xb5\x0e\xd1\xbf\xcf\xc1\x6b\x4c\x96\x98\xa9\x02\xf8\x9c\x0b" - "\xc6\x3e\xd1\x2e\xe3\xf4\x95\xf6\x42\x46\xdc\x7d\xb7\xab\x48\xe6" - "\x8f\xe1\x35\xa8\xd9\x05\x22\xc8\x71\x51\x83\xb1\xcf\xb7\x73\x39" - "\x61\x7e\x27\x3b\xb8\xe9\xaa\x34\xa5\x0b\x70\x7c\xb4\xc5\xba\x1f" - "\xa8\xf0\x31\x6d\x4f\x53\xfe\x3f\x94\x3d\xb3\x34\x49\xe9\x59\x8b" - "\xd3\x0d\x5f\x32\x8c\xd1\x64\x3c\xcf\x35\x64\x80\x9b\x16\xdb\x74" - "\xbf\x1f\xa7\x6a\xff\xe2\x0d\xfa\x73\xa3\x8e\x63\x0c\xc7\x7a\x00" - "\xfe\x6d\xdc\x77\xb0\x0d\x1b\x71\x7f\x0c\xf4\x69\x56\xf4\x59\x2c" - "\xd7\x18\xa0\xd7\xf0\xfb\x63\x1c\x77\x1e\xef\x8e\xa9\x38\x0a\x2f" - "\x34\x71\x9b\x07\x7c\x03\x6b\xd2\x40\xbf\x0f\x79\x4f\x0d\x63\xa9" - "\xd1\x75\x91\xc7\xe7\x0b\x4e\xc0\x6b\x30\xe4\x0e\xcb\x99\xac\x00" - "\xc6\xa9\xd4\x4b\x17\xfb\x0d\x79\x33\xc0\x07\x4b\x12\xa3\xc9\x92" - "\x68\xfd\xae\xf7\xcd\x4a\xe1\xc8\x9f\x0b\x9c\x1a\x64\x1f\x70\xdc" - "\xc8\x8b\xfd\xfa\x6f\x9f\x92\x91\x4b\xfa\xf5\x5f\x03\x0f\x8e\x77" - "\xeb\x66\xdc\x7a\xe5\x3e\xa7\x2e\x37\x96\x6c\x30\xe4\x86\x01\xc7" - "\x12\x23\x82\x96\x22\xfc\x2b\xdb\x7d\x9c\xd7\x58\x79\xbe\x94\xfa" - "\x08\xe0\x0c\xbf\xa0\xce\xf8\x04\xcb\x77\x43\xcf\x5d\x92\x0e\x19" - "\x63\x92\x3a\xaa\x23\xff\xd9\x01\x59\xb4\xc4\x1d\x0a\x53\x98\x77" - "\x1f\x67\xb8\x2c\x8f\x58\x27\xc9\x0a\x98\x38\xce\xc6\x71\x7d\x7e" - "\x81\x0c\x2e\x48\x34\x70\x05\x0d\x8f\x1a\xf8\xea\xdf\xf8\x80\x8d" - "\xbd\xa4\x60\x4e\xa0\x8f\x7d\x5d\x9b\x54\x7f\xbe\x28\xe5\x0d\xde" - "\xed\x45\xd9\x99\x6e\x7a\xbe\x5e\x1f\x43\xcd\x28\xbf\xf7\x48\x49" - "\x3a\xf2\x14\xe4\xe9\xfe\x9a\x6d\xe8\xdf\x63\x21\xbc\xff\x64\x88" - "\xbd\x7c\x4c\xf5\xe1\xfd\xa5\x27\xa9\x60\x4f\x48\xba\xde\xb7\x47" - "\x32\x4e\xd2\x8b\x4f\x2a\xdb\x73\x77\x8d\x2a\x5f\x20\x7d\x36\x0d" - "\x1c\x59\x16\xf0\x79\x24\x1e\xe3\x92\xf6\xb2\x8f\x0b\xdc\xc6\x7c" - "\x01\x58\x87\x24\xcd\x47\x8a\xc3\x4c\x27\x15\xcf\x20\xff\x55\x45" - "\xa7\x17\xcd\x61\xb4\xe7\x79\x13\xf5\x30\x9d\x86\xaf\x11\xc1\xe1" - "\xde\x18\x91\xb5\xd2\x24\x63\x37\xf3\x18\xe7\xbd\x09\xf0\x87\xd4" - "\xab\x14\xdd\x5e\x9c\x6e\xd0\xcd\xe8\x3b\xa6\x93\x9b\x0a\x1a\x99" - "\xb6\xe1\x6d\x1c\xd6\x76\xd2\x68\x3b\x68\xca\xeb\xa5\x78\x9e\xaf" - "\x8f\x8b\x66\xe7\x28\xde\x2b\x7f\x61\xc1\x11\xd3\x77\xe8\x48\xd1" - "\x44\x52\xb4\x7d\x11\xf6\xdf\xf3\x66\xd9\x0e\x05\xeb\x28\xd3\x97" - "\xc7\x0a\xf0\x6c\xd7\x63\x0b\xe9\xfe\x1a\x2f\xcc\x87\xbe\xaf\xc6" - "\xf2\x72\x19\x03\x82\xe3\x8b\xb6\x31\x8d\x58\x2e\xf2\x58\xe2\x31" - "\xc0\xe3\x49\xd1\x68\xa9\x29\x84\x46\x4d\x4c\x1f\x9d\x4e\x87\x22" - "\x64\x79\xae\x2d\x7f\x8a\x92\xc5\xb6\xe4\x71\x39\x13\x64\x20\x0f" - "\xdb\xc3\xd3\xee\xb3\x65\x4c\x19\x57\x94\x97\x32\x5b\x5d\xa6\x65" - "\xcc\xe4\x6b\x7c\xb8\xfd\x64\x43\x3d\xf9\xe1\x36\xd8\x8a\x2e\x25" - "\x3f\x96\xae\x73\x93\x5f\xf2\x0d\x6c\xe5\xae\x8a\xf3\x44\x01\xa6" - "\xe1\x62\xf4\x69\xd9\xee\xa2\x39\x90\xc1\x73\x56\x8a\x2f\xeb\x90" - "\xce\x31\x6a\x99\x17\xc1\xf3\x45\x6c\xf3\x7a\xe2\xda\xdb\xf0\xab" - "\xf4\xc4\xed\x9b\xf8\xd0\xad\x76\x01\x58\x6d\x46\x5b\xd8\x2e\x16" - "\x5c\xbe\x48\x04\x98\x2e\x59\x45\xe8\x6f\x94\x63\x1b\x19\xf9\x7c" - "\x98\x03\xd2\x94\x6d\xb8\x0c\xed\xcf\xdf\xa5\xcb\xaf\x0c\x3c\x27" - "\xb9\x29\x55\xe1\xe3\xb0\xf2\xfa\x9c\x29\xb8\xf6\xb6\x47\x61\x03" - "\x54\x1a\x30\x01\x6b\xa8\x1e\x7b\x4e\xc2\xfb\xba\xbe\x82\xc1\xf5" - "\x7b\x0a\x2c\x31\x2a\xce\x1d\xc6\x75\x69\x9d\x16\xcc\xec\xf7\x05" - "\xc0\xbb\xe1\x6b\x12\xd9\x57\x20\x13\xfc\xc6\xb1\x2e\xfb\xdf\x55" - "\x38\x82\xee\x0a\x2d\xe8\x43\xdf\x25\x2a\x9d\xb9\x8b\x65\x26\xec" - "\xcf\x65\x4e\x63\x2e\x93\x73\xa0\x46\xa5\xca\x86\x59\x26\xf7\xf8" - "\xce\x3b\x4c\x04\x39\x3d\xff\xe6\x24\x69\x97\xf8\x82\x8e\x18\x52" - "\xfe\x99\xcb\x7e\x63\xc8\x55\xde\x63\xb1\xac\x11\x1e\x5e\x5f\xb3" - "\xf8\x85\x87\xf7\x5b\xe4\x7c\x41\xa7\xc9\x55\xdc\x53\xca\x71\x48" - "\xa5\xde\x83\x7a\xd5\x5c\x11\x50\x73\x05\xea\x87\x2d\x9f\x8d\x39" - "\x21\xe6\x34\x2d\x5b\xc7\xf8\x33\x6d\x78\x0d\x37\x08\x5a\xb9\x78" - "\x6e\x64\xfa\xc4\xbf\xe5\xe1\x7d\x7e\x6e\xab\xc5\x8f\x36\x87\xb6" - "\x4b\x0b\xba\x37\x39\xd0\x2e\x0d\xed\x2a\x3a\xc3\xe3\xc4\xc7\xfe" - "\x17\x18\x63\x23\x65\xac\x5d\x69\x63\x17\xee\x0a\x6d\x23\xcb\x7c" - "\xd5\x86\xc2\x0f\xa3\xb5\x51\x68\xdc\x46\xa6\x41\xe1\x36\x7d\x8c" - "\x49\x3c\x59\x66\x74\x51\x61\xe6\xf0\x35\xec\xf7\xb0\xbb\x08\x7c" - "\x34\x8d\xfb\x10\x73\x66\x25\xe3\x19\xad\xbf\x18\x9e\x82\xf5\x52" - "\x8e\x65\x4d\x69\x76\x8f\xe3\xa5\xd4\xe8\xf4\x7e\xe9\x91\xcb\xd3" - "\xfb\xa5\x71\x5c\x9e\xf1\x60\x3f\x10\x8b\x1f\x06\x3a\xf8\x16\x36" - "\x5a\x59\xb4\x7a\x87\xaf\xa9\x67\xbc\xa2\xbe\x83\xdc\xe9\xaa\xd0" - "\xe5\x0e\xf8\x50\xcc\xc1\x8f\xe5\x10\x70\x6b\x36\x64\x90\x25\xc6" - "\x16\x2b\x65\x82\x26\x2a\xa3\xc1\xb0\xac\xa9\x64\xbf\x8b\x69\xa8" - "\x3f\xea\x7b\xd0\xd8\x06\x1a\xe5\x05\xd7\xde\x7e\xb3\x25\x86\xa6" - "\x7a\x62\x6f\x8f\xb7\x14\xf9\xc7\x32\x0d\x01\xb3\x08\x63\xf7\x13" - "\xb6\x4d\x55\x6c\xac\xe5\x98\xff\x5f\x95\xeb\x79\x9e\xb8\xdd\x79" - "\x2a\x7e\xd6\xf2\x4c\x37\x6d\x38\x6e\xac\x6b\xe2\x39\xcf\x4d\x9f" - "\xea\xeb\x55\xd7\x6f\x17\xeb\xf7\x41\x5e\x5b\x84\x6d\x95\x05\xba" - "\xe3\x0a\x8e\x43\xae\x89\xf8\x7d\x34\xc0\x27\xca\x27\xc4\xe0\x13" - "\x94\xdf\x13\x9d\x07\x96\xff\xf1\xf2\x3c\xb0\x5c\xee\x17\x33\xdd" - "\x95\x7d\xb2\xdc\x63\xe8\x26\x62\xed\xf5\xdb\x6d\x25\x5c\xff\xf2" - "\x75\xaa\x6e\xa6\x49\x1a\xaf\xd5\xcf\x04\x5d\x4a\x7b\x1c\x2b\x46" - "\x1b\x72\x80\xf9\xc5\x12\xa0\x18\x96\x45\xcc\x2b\x78\x37\x09\x72" - "\xa6\x5a\xad\x21\xee\x6b\x94\xdf\x88\x72\x2c\xb5\x79\xec\x79\x3b" - "\xd8\x87\xd3\x1b\xb7\xdb\x8d\x3c\xf3\xdd\xf4\xdb\xb1\x32\x8f\x79" - "\x77\x3b\x60\x1c\xaf\x1a\x81\x79\x59\xf9\x32\x25\xf0\x98\xe6\xb8" - "\x37\x3c\xae\x91\x96\x04\xbc\x39\x06\x0e\x6c\x9c\x15\x55\xfd\x73" - "\x91\x23\x0d\xb2\x42\xc8\xf9\x10\x73\xd1\xe8\x6e\xd0\xee\xe7\x5a" - "\x70\xcf\xc5\x09\x56\xe2\x36\x5f\x5c\x3b\x6a\xcf\x4f\xee\x20\xd3" - "\xff\x63\x7d\x9a\x0a\xee\xa2\xa4\x35\xdf\x31\xd1\xff\x9e\x44\x1a" - "\xd3\xc1\x4d\x2b\x76\x29\xda\xad\xe8\x30\xfa\xc7\x4d\xcb\x67\x72" - "\x7f\xf0\xfa\xdb\x1c\xbf\xf8\x52\xad\x11\x16\x41\xfe\xe5\x38\xd5" - "\xfb\xa5\x45\x91\xeb\x3e\xac\xc3\xdb\x16\x2d\xb3\xe5\x2c\x59\xb1" - "\x78\xcc\x98\x30\xfb\xc8\x24\xcf\x75\x38\x8a\xac\x6a\x0e\x2d\x9a" - "\x69\xe0\xcd\xba\x08\x9e\xd1\xfe\xa5\x97\xc4\xf9\x9e\x99\xa5\xbb" - "\xee\x66\xa5\xd2\xc0\xfd\x9d\x34\xf3\xce\x90\xc7\xbb\x69\xe6\x5d" - "\x77\x67\x3d\x9a\xbb\x20\x67\x65\x48\xea\x3d\xa1\x6b\x72\x15\xdb" - "\x51\x77\xec\xa8\x07\x21\x2b\x62\x66\xbf\xcc\xf3\xc9\xca\x07\x4a" - "\xfc\xe2\xef\x90\xd7\x93\x30\xc6\xb2\x5a\x0a\xfd\xd4\x02\x59\x26" - "\xae\x67\x19\x3e\x4c\x9d\x57\x83\x0e\x05\xde\xb2\xa0\xed\x1e\xe8" - "\x72\x17\x78\x4d\x06\xe5\x72\x5b\xab\x39\xf6\xec\xbe\xc9\x4a\xaf" - "\x58\x69\x43\xfa\xd5\xb8\xce\xc0\x75\x28\xae\xb3\x6c\x8b\x61\xeb" - "\xb0\x7f\xf0\x72\xf6\x0f\x5e\xc9\x78\xc4\xdc\xe1\x2d\xa5\x3b\x96" - "\xb2\x9e\x5e\xd4\xce\x7a\x87\x9b\x56\x96\xf1\xfe\x00\xe7\x45\x99" - "\x31\xb6\xe7\x28\x95\xaf\x42\xee\xab\xac\xb4\x89\xf2\x7d\x93\xc5" - "\x8e\x4c\xfe\x76\xcb\x58\xa4\xbf\x12\x1b\x73\x82\x62\xad\xc3\xbe" - "\xdf\xe3\x58\x89\xf9\x2f\x57\x8e\x8d\xc1\xbe\xf7\xc6\xba\x06\x8f" - "\xf9\x01\x5d\x04\xba\x20\x74\x91\xac\xa2\xf5\x84\x7b\xd3\x80\x1e" - "\xb2\xb2\xad\x5f\xa7\xd5\x28\x1e\xcf\x6e\x83\xdf\x71\xdf\x65\xf0" - "\x63\x58\x6c\xb0\xc5\x85\xb9\x4b\x73\x73\x6c\xe3\x96\xc5\x53\x48" - "\x64\xb0\xbc\xdc\xc5\xb6\xa5\xb9\x2f\xbe\x94\xbb\x4c\x46\xf5\xe2" - "\xb7\x61\xf3\x79\x92\x88\xff\x75\x81\x71\x66\xc5\x36\x8a\xe9\xb8" - "\xea\x11\x8e\x27\x25\xd6\xff\x9a\x7d\x18\xbb\x94\x2d\xe1\x49\x0e" - "\xb7\x25\x5e\xee\x50\x3a\xdc\xbe\x14\x65\xc7\xbc\xbc\x92\x9f\x4f" - "\xd2\x2a\xff\x40\x0c\xea\x55\xfb\xf8\x3b\x08\x3a\x7d\xda\x7b\x1c" - "\xab\x76\x19\xf4\x71\x53\xb1\x71\x8e\xa0\x4b\xca\x09\xcc\xa5\x90" - "\x73\x61\xf3\xa8\xfa\x9e\xdb\xaa\xbd\xbc\xc7\x2a\xd7\x64\xe3\xf6" - "\xa5\x72\x5d\x0c\xf3\x14\xca\xa3\x1f\x52\x20\x1f\x59\x8e\x95\x19" - "\xf0\x50\x67\x15\xd7\xa7\xdb\x38\xdf\x3c\x4d\x2f\xcb\x3d\xeb\x60" - "\xd9\xbe\x54\x96\x1d\x77\x48\x9d\x03\x70\xe4\x3e\x56\x71\x0a\xeb" - "\x8f\x32\x0e\x3a\x60\xf1\x1a\x2c\x64\x40\x1a\x7f\xfb\x8f\xd3\x54" - "\x5c\xab\x95\xd2\x4f\x10\x75\xc1\x1e\x7a\x39\x67\xc0\x2f\xbb\x38" - "\x85\x75\x4a\x86\xeb\xa6\x97\x93\x19\x9e\x8a\xdb\xf5\x32\x70\x29" - "\xda\x33\xa0\x1b\xbd\xdc\x1c\x62\x73\x01\x1f\x85\xa7\x17\xb8\xc8" - "\x18\x91\xca\x6f\x4e\xb6\x9b\xe5\x64\x95\xde\x76\xa3\x3d\x80\xd7" - "\x0e\x9e\xab\x32\xf6\x5d\xdd\x7a\xbb\x19\x3f\xc6\x3d\x14\x67\x85" - "\xef\x2a\x96\x4b\x18\xc3\xc5\x89\x21\x63\x98\xd7\x5c\x86\x20\x6d" - "\xec\x80\x3f\xee\xaa\xfc\x48\xf9\xf0\xe0\x82\x67\x9e\x67\x23\x7d" - "\x66\x6a\x8a\x8d\x65\x45\xd6\xa3\x0f\x4d\x7b\x3c\x6b\xda\x9c\x79" - "\xb3\xe7\x4a\xff\xfb\xfe\xf7\xe9\x8b\xa3\x67\x08\xe7\xab\x44\xf0" - "\x46\x32\xfa\x6b\xc8\x49\x2a\x71\xab\xf8\xcc\xc5\x7b\xc2\xe3\x33" - "\x17\x3b\xf1\x3b\x8e\x1f\x34\x93\xd5\x6e\xfc\xa0\x47\x96\x1c\xd3" - "\xf9\xa5\x0b\xf8\x1e\x1b\xe0\x97\x12\xb9\xe6\xcd\x7e\x09\x6a\x2d" - "\xb5\x18\xf2\x7f\xd5\xd8\xd0\x77\x03\xb6\xdf\xea\x84\x7e\xdb\xaf" - "\x5f\x16\xac\x9e\x64\xd8\x81\x48\x9b\x08\x1b\x30\x8e\x6d\x40\xb5" - "\xf6\x53\x22\x75\xac\x48\x5b\x6d\xc0\x4e\x33\x93\x61\x03\x72\x6c" - "\x48\xde\xf7\x54\x63\x74\x75\x61\x88\x8d\xe5\x95\xf1\x02\x2f\x2a" - "\x9b\x90\xcb\xc9\xb5\x36\xb3\x27\x89\xd7\x9f\xa1\xd7\x26\x63\x8e" - "\xc7\xbc\xd3\x23\x44\x9c\x27\x49\xc7\xe9\x10\xaf\x47\xb3\xbe\xab" - "\xec\xbd\xe2\x49\x2c\x7f\xc5\xda\x51\x0f\xce\x09\xc8\x58\x6a\x90" - "\xbd\xab\xdb\x07\x78\xae\xc4\xcd\x7d\xc9\x34\x00\x1f\x74\x80\x0e" - "\xa6\x81\x36\x97\x50\x7f\x9b\xf5\x75\x0c\x63\x0d\x43\xd5\x55\x72" - "\x62\xb0\xf6\x45\x6f\x5b\x49\xc6\x57\xb6\x8d\xbf\x99\x83\x71\x61" - "\xb4\xf1\xd2\xf6\x95\x54\x45\xb4\x2f\xf3\xd2\xf6\x95\x34\xf6\xef" - "\xbb\xf4\xaf\x4b\x94\x9c\xe0\x76\x32\x1f\xa0\x9d\x47\x63\xad\xe6" - "\x6f\x85\xdc\xa7\x44\x93\xab\xc3\xd7\x68\xfa\x19\x10\xfb\x3d\x4d" - "\xa3\xa5\x9d\xe6\xdb\xac\x05\xf3\x36\x3b\xf0\xc3\x95\xf5\xec\x01" - "\x5d\x55\xf8\x14\x7e\xf6\x89\x4d\x90\xbd\xbc\xd6\x32\xd8\xd9\x36" - "\xd0\xec\xb8\xb1\x0e\x80\xfb\x76\xb6\x27\xe7\x04\xa6\x0a\x4e\x67" - "\x1a\xc0\x26\xf1\x80\xaf\xda\x95\xde\x66\x5f\xd7\x2f\xb3\xbf\x35" - "\x35\x3b\x76\x0d\xd9\x8e\xd4\xdc\xc5\xe9\x35\xe8\x3b\xb9\x36\x28" - "\xbf\x91\x37\x08\xcc\xac\x40\x1a\x0d\x02\xf7\xb8\x01\x77\xb0\x73" - "\x90\xa1\x69\x4b\x16\xdb\xf2\x16\x2c\xce\x59\xb2\x70\x61\x8a\xed" - "\xa5\xc5\x4f\xe7\x2f\x79\xe6\x79\x16\xfc\xcb\x0a\x5f\xc2\xf8\x95" - "\xe3\x36\x7d\xe6\xcc\xac\x07\xe7\x3d\xf6\xa3\x30\x1d\xc0\x5c\xe9" - "\x08\x96\xc9\x6f\x64\xad\x7d\x6e\x55\x8f\xa3\x14\xfd\xff\x6c\x91" - "\x9a\x6f\x4a\x31\xff\x3f\x93\xa0\x74\xad\x27\x3a\xd5\xd9\xcf\xd2" - "\xc6\x10\xb9\x36\x1c\xcf\x4d\xfc\xad\x83\x81\x35\x90\xd2\xca\x50" - "\x1d\xa2\x5b\x7e\xa7\xae\x74\x97\x11\x07\xa1\x70\x0c\x69\xa6\x31" - "\x95\x54\xa5\x89\x52\x37\x95\x1e\x85\xbd\x78\x1c\xef\x9b\xdc\x94" - "\x57\xad\xdb\x8f\xc7\x79\x8f\x95\xed\xc7\x00\x6c\xc9\x39\x2b\x9d" - "\x53\xb3\x56\xc6\xb0\x0f\xb1\xfc\x6e\x82\xff\xa2\xe8\xe0\x7d\x4e" - "\xde\x33\xe2\xef\x26\x54\x3c\x27\xed\xc9\x58\x99\x07\xf7\x15\xa7" - "\x48\xda\x56\x78\x6f\xab\x3b\x25\xbf\xdd\x08\xfb\x63\xcd\x58\x43" - "\xf7\xb4\xac\xb1\xc9\x33\xa9\x9b\x54\x7f\xb4\x73\x5f\x70\x7d\x59" - "\x2b\x9d\xaa\x0e\xf4\x01\xca\x5a\xd4\xba\xcf\x9a\xf9\x97\x5d\xcf" - "\x8e\x6b\x6f\x1c\x34\x06\xb9\xa3\x74\xd8\x66\x15\xaf\x98\xfd\xe0" - "\x3c\x86\x1f\x16\xfb\x64\x01\xee\xa1\x48\x9f\x2e\xe5\x97\xb0\xa6" - "\xd9\xf0\x07\xc1\x7d\x7b\xbf\xbe\xcc\xdf\xda\x80\x9d\x63\x2b\x59" - "\x33\xf4\x2c\xad\xd9\x56\x37\xc8\xba\xb2\x71\x06\x55\xf7\x9b\x1a" - "\xd6\xe3\x70\x8c\xee\xf7\x25\xc1\x33\x8f\xf1\x01\x7f\x30\xc7\x24" - "\xc3\x9f\x48\xfa\x90\x61\xce\xe2\xef\x79\x9c\x22\xc7\x8f\xe4\xf7" - "\x43\x6e\xe6\x35\x61\x47\x51\x93\xf4\x65\x73\xe4\x84\xe2\xa2\xf0" - "\x70\x8c\xe3\x75\x4b\x7e\x1f\x8a\x4b\xd1\x82\x97\x16\x4d\x28\x5a" - "\xb8\xc8\xf6\x4c\xde\xa2\x82\xac\x45\x32\x6e\xa8\x0c\x49\x5a\xb8" - "\xb2\x80\x57\xe9\x6f\x8d\x8f\x98\x2b\x74\xbf\xb3\x7e\xff\x1a\xe9" - "\x7b\xe6\xf8\x0c\xf4\xd0\x94\xef\xd9\xda\x36\x35\x1f\x3a\x3a\x2f" - "\xf5\xb3\x70\xf8\x0d\x3f\x0b\xf0\x55\x62\x95\x8a\x57\xae\xfb\x66" - "\x30\xdf\xad\x1d\x7d\x69\x99\xb5\xa9\xfd\x7e\x46\xec\xef\xd2\x97" - "\x29\xcf\x08\xc8\xd8\xd2\xaf\x71\xbf\x39\xd6\xb9\x8a\x1e\xe2\x3d" - "\x62\x9d\x9f\xd7\x66\x1b\xfc\x6c\xf8\xa8\x31\x2c\x3e\xa3\x30\xc1" - "\x17\xea\x9f\xb2\xf6\x43\xcc\x2d\xd6\xfe\x76\xbc\xac\x11\xe3\xee" - "\xd5\x9c\x8c\xc7\xae\x48\x3c\x80\xdf\x18\xa4\x87\xf8\xff\x18\xed" - "\x5c\x0b\xfd\x6f\xdd\x25\x3a\xde\x03\x0f\xcd\x84\x32\xb7\x2c\xb7" - "\x30\x9e\xa6\x2d\xc8\xcf\xe7\x71\xbd\x20\x37\xff\xa5\xa5\x4b\x96" - "\x65\x2d\x5a\xbc\x08\xa9\x0f\x2c\xe4\x70\xae\x32\xcb\x7d\xfa\x1b" - "\xdb\xe2\xdc\xdc\x1c\x95\xa4\x77\x43\xf8\xde\x88\xda\xff\x5e\x97" - "\xe6\xa6\x35\xbe\x01\xbd\x65\x5d\xb5\xd0\xd6\x1e\xc7\xef\xef\x72" - "\x4c\x4b\x9d\x62\x5d\x4e\xb8\x5d\xb0\xae\xd0\xe0\x07\xd9\x7f\x76" - "\xf6\x11\x79\xf3\x93\x6e\x21\xf7\x12\xd0\x67\xaf\xfc\x91\xbf\x7b" - "\xea\xa6\x57\x8e\xb2\x3e\x1c\x02\x67\x6f\x3f\x2d\xd7\x3e\x21\xbf" - "\x9b\xc9\xf0\xf8\x7b\x6f\x7c\x36\x1b\xef\xc1\xff\x6b\x4a\x15\xff" - "\xaf\xeb\xe7\xff\x6e\x2d\x16\x36\xce\xba\x4e\x43\x0f\x0e\x1f\x33" - "\xaf\xd0\xa5\x63\x89\x7d\x06\x5f\xb1\x1a\xb4\x35\xfa\x59\xf1\xd6" - "\x2b\xbf\x31\xd6\x26\xeb\xf4\xd8\xe2\x7c\xcf\x65\x59\xc7\x15\xc3" - "\xaf\x9a\xca\x3e\xd0\x27\xe9\x95\x75\x8a\x5f\x5e\xc9\x0e\xf1\xe5" - "\x49\x3c\x4d\xaf\xe8\xf6\xec\x2b\x45\x06\x7e\x68\xe7\x44\x4e\x63" - "\x18\x6a\xec\xaf\x0d\x28\xde\x79\xa5\xc6\xa0\x2d\xdb\x8d\x78\xde" - "\x3b\x30\xa7\xaf\x9b\xc9\x73\x9d\x7e\x36\xbd\x8f\xdb\x0f\x38\x29" - "\x06\x1c\xe4\xc5\xb3\xb9\xc9\xa0\x95\x91\x27\x94\x27\xa6\x2d\x28" - "\x80\x51\xb7\x68\xe1\xc2\xdc\xa5\xcb\x8c\x78\xbd\xc9\x4b\xf2\x73" - "\x54\x7c\xde\xfb\xd0\xfd\x2b\x30\x02\xa7\x70\x88\x5f\xa4\xaa\xdb" - "\x08\x1b\x20\x85\xed\x70\xe9\xef\x25\xf5\xff\xf5\xf7\xd4\xea\xb6" - "\xc0\x49\xfa\xc9\x44\x5c\x21\x0f\x5e\xbd\xa0\xf4\xb2\xb8\x73\x3d" - "\x8e\x57\xf3\x0d\xbd\xac\x7b\xe8\x24\xd8\xd7\xaf\x16\x1b\xdf\x61" - "\x32\x74\x05\x3e\x8b\xe2\x5c\xcc\xb1\xcf\xd7\x6f\x0b\x96\xef\xce" - "\x14\xf1\x5b\xca\xa0\x93\x24\x30\xdf\x5f\xd5\xc5\x71\xd1\x39\x5e" - "\xcc\xab\x47\x59\x97\x61\x59\xc2\x31\xce\x3b\xe8\xd5\x6a\xfe\x76" - "\xb3\x9b\xd6\xd7\x78\xe2\x76\x67\xae\x5b\x45\xe6\x9d\x5b\xe4\xf7" - "\x6f\xdd\x4d\xf5\x4c\xc7\x57\x3b\x3e\x28\x56\xdf\xd3\xe6\xef\x10" - "\x6f\xc4\x3b\xd8\xc3\x0d\xfa\x5a\x72\xbe\xbe\x8e\x97\xdf\xe3\xf8" - "\x09\xf4\xbf\x84\x46\xc5\x97\x5b\xc5\xb7\x4b\xa9\x88\xbf\xcf\xa6" - "\x62\xbd\x34\xd4\x8b\xb2\x6a\xd6\x63\x3c\xd0\x7f\xa0\x67\xbf\x9a" - "\x2f\xca\xab\x49\xc5\x89\x66\xbe\x78\x75\x3e\xb7\x13\xf0\x0a\x79" - "\x7d\x87\xd7\x76\x74\xb8\x85\x6c\xff\x41\x8f\x1b\xcb\xba\x1c\x9e" - "\x33\x82\x17\xcf\xd4\x63\xee\x36\x63\xae\xf2\xe8\xdf\xfd\x99\xcb" - "\x6b\x9e\xc3\xd7\xb8\x31\x17\xdd\x24\xb2\xfc\x89\xbc\xd7\x70\x95" - "\xf1\x5d\x25\x5e\xf7\x04\x6e\x7b\x06\xf6\x10\x50\x1e\x34\x01\x3f" - "\x96\x76\xd0\x4f\xa4\xaf\x3f\xf3\x22\xd3\xae\x17\xf4\xe2\xef\xef" - "\x8a\x8b\x67\x1a\x60\x87\x5e\x75\x8a\x7e\xf2\x39\xd3\x8d\xf7\xfd" - "\xd8\x5f\x07\x69\x16\x8e\x1f\x8d\xfe\xf9\x88\x69\xc6\xb8\x88\xb2" - "\xad\xd9\xfe\x9e\xcc\xef\xf3\x19\x42\x96\x47\xab\x8b\xa1\xfb\x2d" - "\xe4\xb1\x5c\x3e\x8f\xed\x39\xfe\xe6\x07\xdf\xdb\x73\x44\x50\xd2" - "\x7c\x15\xd3\xbc\x7c\xde\xea\x4e\x11\xfc\xd2\x41\xe2\xa8\x97\xe8" - "\x4b\x8d\xfc\x3e\x2d\x86\xf1\xd6\xec\x67\xf8\x9c\x63\x3d\xb9\x8a" - "\xca\x08\xf5\x9a\x37\xad\xa2\x44\x3e\x17\xca\xdf\xb3\x68\xf5\xd6" - "\x50\x6b\x41\x0d\xfd\xa7\xbf\x8a\x9c\xcb\xf9\x9c\x7f\xb9\xff\x4f" - "\x45\x55\xbc\x97\x12\x87\xfb\x77\x6d\x8f\x73\x5d\x65\x55\x7f\x3a" - "\xf6\x67\xfa\x93\xf3\xcf\x64\xfb\xb1\x7c\xde\xd5\x9c\xf9\x9f\xd4" - "\x9c\xf6\x9f\x64\xef\x10\x41\xb6\x09\x4a\x5e\xe0\x3a\xca\x00\xab" - "\x9e\xcf\x53\x26\x06\xbb\xad\xf1\x68\xbf\x69\x4e\x11\x51\xab\xd7" - "\x03\x1e\xfa\x3d\xe3\x38\xae\xf6\x3c\x99\x9d\x8b\xff\x20\xef\x95" - "\xae\x7e\xa6\xde\x95\xd3\xce\x7a\x92\x9f\xcf\x8f\xf2\xde\x13\x74" - "\xdd\x60\x05\xe3\x18\x50\x78\xf3\x77\xa4\x8d\xf2\xd0\xa3\xf4\xf2" - "\x65\x72\x8d\x77\x27\xd3\x03\x38\xb5\xcc\x55\x34\x69\x6e\x07\x4d" - "\x1f\xd7\xe9\x93\x19\x4a\x9f\xb2\x74\xa6\x0f\xc7\x1e\x0c\xa2\xbf" - "\x80\x5b\x1a\x68\x10\x34\xea\x00\xce\x66\x7d\xdd\xce\xbc\xe9\x3c" - "\x25\x38\x17\xf3\xb7\x89\xca\xdf\xb2\x64\x98\xcc\xc1\x8b\x67\x1b" - "\x2a\x2e\x90\x89\xfb\x8d\xd7\xe7\x2b\xe4\x7b\x49\xf3\x0d\xdc\x67" - "\xa1\xdf\x33\x67\x3e\xe4\x6f\x9a\xa3\xbf\xca\x80\xc3\x58\xf4\x55" - "\x3d\x5f\x15\x6f\x57\xb3\x2e\x6f\xec\xe3\x0e\xa4\x83\xb7\xfd\xfc" - "\xdd\x41\xb9\x2e\x51\x3e\x36\x08\xde\x66\x7b\xbe\xf6\x35\x4a\x08" - "\x3a\x5e\xf1\xec\x84\xac\xa9\xc1\x5c\x56\x3b\x82\x12\x79\x2d\x6b" - "\xbb\xf4\x1f\x5e\x9f\x6c\xc8\x9e\xf5\x23\xf9\x4c\x52\xf9\x5c\x4d" - "\x7e\x5f\x6e\x77\x81\xce\xe7\x05\xc8\x33\xd3\x4d\xd7\xee\x52\xf2" - "\x77\x7d\xa6\x31\x96\xa0\x27\x79\x0c\xfe\xc7\xf8\xcc\xf0\x30\xbf" - "\x4b\x3f\x04\x37\x6c\x58\x8b\x60\xdf\xce\x81\x6f\xaa\xad\xaf\x34" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:28:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38310106566B; Mon, 11 Jan 2010 22:28:41 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 280A38FC08; Mon, 11 Jan 2010 22:28: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 o0BMSfiw094823; Mon, 11 Jan 2010 22:28:41 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BMSf7x094821; Mon, 11 Jan 2010 22:28:41 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001112228.o0BMSf7x094821@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 11 Jan 2010 22:28: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: r202121 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:28:41 -0000 Author: gallatin Date: Mon Jan 11 22:28:40 2010 New Revision: 202121 URL: http://svn.freebsd.org/changeset/base/202121 Log: Use better default RSS hash (src + dst, rather than just src port) MFC after:3 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:25:09 2010 (r202120) +++ head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:28:40 2010 (r202121) @@ -104,7 +104,7 @@ static int mxge_verbose = 0; static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; -static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; +static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; static int mxge_throttle = 0; @@ -4174,7 +4174,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) sc->pause = mxge_flow_control; if (mxge_rss_hash_type < MXGEFW_RSS_HASH_TYPE_IPV4 || mxge_rss_hash_type > MXGEFW_RSS_HASH_TYPE_MAX) { - mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; + mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; } if (mxge_initial_mtu > ETHERMTU_JUMBO || mxge_initial_mtu < ETHER_MIN_LEN) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:34:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E808106568D; Mon, 11 Jan 2010 22:34:25 +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 659628FC16; Mon, 11 Jan 2010 22:34: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 o0BMYPxA096162; Mon, 11 Jan 2010 22:34:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BMYPTn096160; Mon, 11 Jan 2010 22:34:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001112234.o0BMYPTn096160@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 11 Jan 2010 22:34: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: r202123 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:34:25 -0000 Author: bz Date: Mon Jan 11 22:34:25 2010 New Revision: 202123 URL: http://svn.freebsd.org/changeset/base/202123 Log: Change DDB show prison: - name some columns more closely to the user space variables, as we do for host.* or allow.* (in the listing) already. - print pr_childmax (children.max). - prefix hex values with 0x. MFC after: 3 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Jan 11 22:31:47 2010 (r202122) +++ head/sys/kern/kern_jail.c Mon Jan 11 22:34:25 2010 (r202123) @@ -4169,10 +4169,11 @@ db_show_prison(struct prison *pr) #endif db_printf(" root = %p\n", pr->pr_root); db_printf(" securelevel = %d\n", pr->pr_securelevel); - db_printf(" childcount = %d\n", pr->pr_childcount); + db_printf(" children.max = %d\n", pr->pr_childmax); + db_printf(" children.cur = %d\n", pr->pr_childcount); db_printf(" child = %p\n", LIST_FIRST(&pr->pr_children)); db_printf(" sibling = %p\n", LIST_NEXT(pr, pr_sibling)); - db_printf(" flags = %x", pr->pr_flags); + db_printf(" flags = 0x%x", pr->pr_flags); for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) if (pr_flag_names[fi] != NULL && (pr->pr_flags & (1 << fi))) @@ -4187,7 +4188,7 @@ db_show_prison(struct prison *pr) : (jsf == pr_flag_jailsys[fi].new) ? "new" : "inherit"); } - db_printf(" allow = %x", pr->pr_allow); + db_printf(" allow = 0x%x", pr->pr_allow); for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); fi++) if (pr_allow_names[fi] != NULL && (pr->pr_allow & (1 << fi))) @@ -4202,14 +4203,14 @@ db_show_prison(struct prison *pr) db_printf(" ip4s = %d\n", pr->pr_ip4s); for (ii = 0; ii < pr->pr_ip4s; ii++) db_printf(" %s %s\n", - ii == 0 ? "ip4 =" : " ", + ii == 0 ? "ip4.addr =" : " ", inet_ntoa(pr->pr_ip4[ii])); #endif #ifdef INET6 db_printf(" ip6s = %d\n", pr->pr_ip6s); for (ii = 0; ii < pr->pr_ip6s; ii++) db_printf(" %s %s\n", - ii == 0 ? "ip6 =" : " ", + ii == 0 ? "ip6.addr =" : " ", ip6_sprintf(ip6buf, &pr->pr_ip6[ii])); #endif } From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:42:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41DAF106568B; Mon, 11 Jan 2010 22:42:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 314488FC12; Mon, 11 Jan 2010 22:42: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 o0BMg73j097918; Mon, 11 Jan 2010 22:42:07 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BMg7ob097916; Mon, 11 Jan 2010 22:42:07 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001112242.o0BMg7ob097916@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jan 2010 22:42: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: r202125 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:42:07 -0000 Author: mckusick Date: Mon Jan 11 22:42:06 2010 New Revision: 202125 URL: http://svn.freebsd.org/changeset/base/202125 Log: Cast 64-bit quantity to intptr_t rather than int so as to work properly with 64-bit architectures (such as amd64). Reported by: bz Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Mon Jan 11 22:35:19 2010 (r202124) +++ head/sys/ufs/ffs/ffs_alloc.c Mon Jan 11 22:42:06 2010 (r202125) @@ -2689,7 +2689,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) if (fsckcmds) { char buf[32]; - if (copyinstr((char *)(int)cmd.value, buf, 32, NULL)) + if (copyinstr((char *)(intptr_t)cmd.value, buf,32,NULL)) strncpy(buf, "Name_too_long", 32); printf("%s: unlink %s (inode %jd)\n", mp->mnt_stat.f_mntonname, buf, (intmax_t)cmd.size); @@ -2702,7 +2702,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) */ vn_finished_write(mp); mp = NULL; - error = kern_unlinkat(td, AT_FDCWD, (char *)(int)cmd.value, + error = kern_unlinkat(td, AT_FDCWD, (char *)(intptr_t)cmd.value, UIO_USERSPACE, (ino_t)cmd.size); break; From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 22:57:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91195106566B; Mon, 11 Jan 2010 22:57:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 801798FC0A; Mon, 11 Jan 2010 22:57: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 o0BMvqD2001619; Mon, 11 Jan 2010 22:57:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BMvq4n001616; Mon, 11 Jan 2010 22:57:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001112257.o0BMvq4n001616@svn.freebsd.org> From: Alexander Motin Date: Mon, 11 Jan 2010 22:57:52 +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: r202127 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 22:57:52 -0000 Author: mav Date: Mon Jan 11 22:57:52 2010 New Revision: 202127 URL: http://svn.freebsd.org/changeset/base/202127 Log: Add multichannel (4.0 and 7.1) playback support. 5.1 mode support blocked now due to unidentified synchonization problem. For 7.1 soundcards 5.1 support handled correctly via software upmix done by sound(4). Stereo stream is no more duplicated to all ports. If you loose sound, check you are using right connectors. Front speakers connector is usually green, center/LFE - orange, rear - black, side - gray. Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac_private.h Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jan 11 22:46:24 2010 (r202126) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jan 11 22:57:52 2010 (r202127) @@ -86,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20091113_0138" +#define HDA_DRV_TEST_REV "20100111_0139" SND_DECLARE_FILE("$FreeBSD$"); @@ -3455,7 +3455,11 @@ hdac_stream_setup(struct hdac_chan *ch) int i, chn, totalchn, c; nid_t cad = ch->devinfo->codec->cad; uint16_t fmt, dfmt; + uint16_t chmap[2][5] = {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ + { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ + int map = -1; + totalchn = AFMT_CHANNEL(ch->fmt); HDA_BOOTHVERBOSE( device_printf(ch->pdevinfo->dev, "PCMDIR_%s: Stream setup fmt=%08x speed=%d\n", @@ -3469,7 +3473,6 @@ hdac_stream_setup(struct hdac_chan *ch) fmt |= ch->bit32 << 4; else fmt |= 1 << 4; - for (i = 0; i < HDA_RATE_TAB_LEN; i++) { if (hda_rate_tab[i].valid && ch->spd == hda_rate_tab[i].rate) { fmt |= hda_rate_tab[i].base; @@ -3478,10 +3481,13 @@ hdac_stream_setup(struct hdac_chan *ch) break; } } + fmt |= (totalchn - 1); - totalchn = AFMT_CHANNEL(ch->fmt); - if (totalchn > 1) - fmt |= 1; + /* Set channel mapping for known speaker setups. */ + if (as->pinset == 0x0007 || as->pinset == 0x0013) /* Standard 5.1 */ + map = 0; + else if (as->pinset == 0x0017) /* Standard 7.1 */ + map = 1; HDAC_WRITE_2(&sc->mem, ch->off + HDAC_SDFMT, fmt); @@ -3495,14 +3501,26 @@ hdac_stream_setup(struct hdac_chan *ch) if (w == NULL) continue; - if (as->hpredir >= 0 && i == as->pincnt) - chn = 0; + /* If HP redirection is enabled, but failed to use same + DAC, make last DAC to duplicate first one. */ + if (as->hpredir >= 0 && i == as->pincnt) { + c = (ch->sid << 4); + } else { + if (map >= 0) /* Map known speaker setups. */ + chn = (((chmap[map][totalchn / 2] >> i * 4) & + 0xf) - 1) * 2; + if (chn < 0 || chn >= totalchn) { + c = 0; + } else { + c = (ch->sid << 4) | chn; + } + } HDA_BOOTHVERBOSE( device_printf(ch->pdevinfo->dev, "PCMDIR_%s: Stream setup nid=%d: " - "fmt=0x%04x, dfmt=0x%04x\n", + "fmt=0x%04x, dfmt=0x%04x, chan=0x%04x\n", (ch->dir == PCMDIR_PLAY) ? "PLAY" : "REC", - ch->io[i], fmt, dfmt); + ch->io[i], fmt, dfmt, c); ); hdac_command(sc, HDA_CMD_SET_CONV_FMT(cad, ch->io[i], fmt), cad); @@ -3511,17 +3529,6 @@ hdac_stream_setup(struct hdac_chan *ch) HDA_CMD_SET_DIGITAL_CONV_FMT1(cad, ch->io[i], dfmt), cad); } - /* If HP redirection is enabled, but failed to use same - DAC make last DAC one to duplicate first one. */ - if (as->hpredir >= 0 && i == as->pincnt) { - c = (ch->sid << 4); - } else if (chn >= totalchn) { - /* This is until OSS will support multichannel. - Should be: c = 0; to disable unused DAC */ - c = (ch->sid << 4); - }else { - c = (ch->sid << 4) | chn; - } hdac_command(sc, HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i], c), cad); #if 0 @@ -3532,9 +3539,7 @@ hdac_stream_setup(struct hdac_chan *ch) hdac_command(sc, HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x11), cad); #endif - chn += - HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap) ? - 2 : 1; + chn += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; } } @@ -6436,7 +6441,8 @@ hdac_pcmchannel_setup(struct hdac_chan * struct hdac_audio_as *as = devinfo->function.audio.as; struct hdac_widget *w; uint32_t cap, fmtcap, pcmcap; - int i, j, ret, max; + int i, j, ret, channels, onlystereo; + uint16_t pinset; ch->caps = hdac_caps; ch->caps.fmtlist = ch->fmtlist; @@ -6446,11 +6452,13 @@ hdac_pcmchannel_setup(struct hdac_chan * ch->pcmrates[1] = 0; ret = 0; + channels = 0; + onlystereo = 1; + pinset = 0; fmtcap = devinfo->function.audio.supp_stream_formats; pcmcap = devinfo->function.audio.supp_pcm_size_rate; - max = (sizeof(ch->io) / sizeof(ch->io[0])) - 1; - for (i = 0; i < 16 && ret < max; i++) { + for (i = 0; i < 16; i++) { /* Check as is correct */ if (ch->as < 0) break; @@ -6468,15 +6476,11 @@ hdac_pcmchannel_setup(struct hdac_chan * w = hdac_widget_get(devinfo, as[ch->as].dacs[i]); if (w == NULL || w->enable == 0) continue; - if (!HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap)) - continue; cap = w->param.supp_stream_formats; - /*if (HDA_PARAM_SUPP_STREAM_FORMATS_FLOAT32(cap)) { - }*/ if (!HDA_PARAM_SUPP_STREAM_FORMATS_PCM(cap) && !HDA_PARAM_SUPP_STREAM_FORMATS_AC3(cap)) continue; - /* Many codec does not declare AC3 support on SPDIF. + /* Many CODECs does not declare AC3 support on SPDIF. I don't beleave that they doesn't support it! */ if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) cap |= HDA_PARAM_SUPP_STREAM_FORMATS_AC3_MASK; @@ -6488,9 +6492,24 @@ hdac_pcmchannel_setup(struct hdac_chan * pcmcap &= w->param.supp_pcm_size_rate; } ch->io[ret++] = as[ch->as].dacs[i]; + /* Do not count redirection pin/dac channels. */ + if (i == 15 && as[ch->as].hpredir >= 0) + continue; + channels += HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) + 1; + if (HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap) != 1) + onlystereo = 0; + pinset |= (1 << i); } ch->io[ret] = -1; + if (as[ch->as].fakeredir) + ret--; + /* Standard speaks only about stereo pins and playback, ... */ + if ((!onlystereo) || as[ch->as].dir != HDA_CTL_OUT) + pinset = 0; + /* ..., but there it gives us info about speakers layout. */ + as[ch->as].pinset = pinset; + ch->supp_stream_formats = fmtcap; ch->supp_pcm_size_rate = pcmcap; @@ -6514,17 +6533,36 @@ hdac_pcmchannel_setup(struct hdac_chan * ch->bit32 = 3; else if (HDA_PARAM_SUPP_PCM_SIZE_RATE_20BIT(pcmcap)) ch->bit32 = 2; - if (!(devinfo->function.audio.quirks & HDA_QUIRK_FORCESTEREO)) - ch->fmtlist[i++] = - SND_FORMAT(AFMT_S16_LE, 1, 0); - ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 2, 0); - if (ch->bit32 > 0) { - if (!(devinfo->function.audio.quirks & - HDA_QUIRK_FORCESTEREO)) - ch->fmtlist[i++] = - SND_FORMAT(AFMT_S32_LE, 1, 0); - ch->fmtlist[i++] = - SND_FORMAT(AFMT_S32_LE, 2, 0); + if (!(devinfo->function.audio.quirks & HDA_QUIRK_FORCESTEREO)) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 1, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 1, 0); + } + if (channels >= 2) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 2, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 2, 0); + } + if (channels == 4 || /* Any 4-channel */ + pinset == 0x0007 || /* 5.1 */ + pinset == 0x0013 || /* 5.1 */ + pinset == 0x0017) { /* 7.1 */ + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 4, 0); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 0); + } +#ifdef notyet + if (channels == 6 || /* Any 6-channel */ + pinset == 0x0017) { /* 7.1 */ + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 1); + } +#endif + if (channels == 8) { /* Any 8-channel */ + ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 8, 1); + if (ch->bit32) + ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 8, 1); } } if (HDA_PARAM_SUPP_STREAM_FORMATS_AC3(fmtcap)) { Modified: head/sys/dev/sound/pci/hda/hdac_private.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac_private.h Mon Jan 11 22:46:24 2010 (r202126) +++ head/sys/dev/sound/pci/hda/hdac_private.h Mon Jan 11 22:57:52 2010 (r202127) @@ -221,6 +221,7 @@ struct hdac_audio_as { u_char pincnt; u_char fakeredir; u_char digital; + uint16_t pinset; nid_t hpredir; nid_t pins[16]; nid_t dacs[16]; @@ -281,7 +282,7 @@ struct hdac_chan { struct hdac_devinfo *devinfo; struct hdac_pcm_devinfo *pdevinfo; struct hdac_dma bdl_dma; - uint32_t spd, fmt, fmtlist[8], pcmrates[16]; + uint32_t spd, fmt, fmtlist[16], pcmrates[16]; uint32_t supp_stream_formats, supp_pcm_size_rate; uint32_t ptr, prevptr, blkcnt, blksz; uint32_t *dmapos; From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 23:15:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C35810656A8; Mon, 11 Jan 2010 23:15:12 +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 2BC5D8FC0C; Mon, 11 Jan 2010 23:15: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 o0BNFCFi005643; Mon, 11 Jan 2010 23:15:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BNFCpY005641; Mon, 11 Jan 2010 23:15:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001112315.o0BNFCpY005641@svn.freebsd.org> From: Xin LI Date: Mon, 11 Jan 2010 23:15: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: r202129 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 23:15:12 -0000 Author: delphij Date: Mon Jan 11 23:15:11 2010 New Revision: 202129 URL: http://svn.freebsd.org/changeset/base/202129 Log: Report ZFS filesystem version instead of the zpool version when we say it. Reported by: Yuri Pankov (on -fs@) Submitted by: delphij Approved by: pjd MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 11 23:00:17 2010 (r202128) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jan 11 23:15:11 2010 (r202129) @@ -1388,7 +1388,7 @@ void zfs_init(void) { - printf("ZFS filesystem version " SPA_VERSION_STRING "\n"); + printf("ZFS filesystem version " ZPL_VERSION_STRING "\n"); /* * Initialize znode cache, vnode ops, etc... From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 23:32:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BC0106566C; Mon, 11 Jan 2010 23:32:36 +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 590308FC0A; Mon, 11 Jan 2010 23:32: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 o0BNWago009513; Mon, 11 Jan 2010 23:32:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BNWaLF009497; Mon, 11 Jan 2010 23:32:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001112332.o0BNWaLF009497@svn.freebsd.org> From: Xin LI Date: Mon, 11 Jan 2010 23:32: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: r202130 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 23:32:36 -0000 Author: delphij Date: Mon Jan 11 23:32:36 2010 New Revision: 202130 URL: http://svn.freebsd.org/changeset/base/202130 Log: Set svn:executable to *. MFC after: 1 month Modified: Directory Properties: head/etc/rc.d/static_arp (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Jan 11 23:33:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4149106568D; Mon, 11 Jan 2010 23:33:30 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 942418FC16; Mon, 11 Jan 2010 23:33: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 o0BNXUjR009763; Mon, 11 Jan 2010 23:33:30 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0BNXUGn009761; Mon, 11 Jan 2010 23:33:30 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001112333.o0BNXUGn009761@svn.freebsd.org> From: Kirk McKusick Date: Mon, 11 Jan 2010 23:33: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: r202131 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2010 23:33:30 -0000 Author: mckusick Date: Mon Jan 11 23:33:30 2010 New Revision: 202131 URL: http://svn.freebsd.org/changeset/base/202131 Log: Cast 64-bit quantity to intptr_t rather than int so as to work properly with 64-bit architectures (such as amd64). Reported by: Xin LI and Josh Paetzel Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c ============================================================================== --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 23:32:36 2010 (r202130) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 23:33:30 2010 (r202131) @@ -547,7 +547,7 @@ fix_extraneous(struct inoinfo *inp, stru printf(" (IGNORED)\n"); return (0); } - cmd.value = (int)idesc->id_dirp->d_name; + cmd.value = (intptr_t)idesc->id_dirp->d_name; cmd.size = inp->i_number; /* verify same name */ if (sysctlbyname("vfs.ffs.unlink", 0, 0, &cmd, sizeof cmd) == -1) { @@ -588,7 +588,7 @@ fix_extraneous(struct inoinfo *inp, stru printf(" (IGNORED)\n"); return (0); } - cmd.value = (int)(cp + 1); + cmd.value = (intptr_t)(cp + 1); cmd.size = inp->i_number; /* verify same name */ if (sysctlbyname("vfs.ffs.unlink", 0, 0, &cmd, sizeof cmd) == -1) { From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 00:40:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0821F1065672; Tue, 12 Jan 2010 00:40:09 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A46558FC20; Tue, 12 Jan 2010 00:40:08 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o0C0e7eG087774; Mon, 11 Jan 2010 19:40:07 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o0C0e71S087773; Mon, 11 Jan 2010 19:40:07 -0500 (EST) (envelope-from das@freebsd.org) Date: Mon, 11 Jan 2010 19:40:07 -0500 From: David Schultz To: Max Laier Message-ID: <20100112004007.GA87632@zim.MIT.EDU> Mail-Followup-To: Max Laier , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200910041943.n94JhaDg083487@svn.freebsd.org> <201001110316.29816.max@love2party.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001110316.29816.max@love2party.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197752 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 00:40:09 -0000 On Mon, Jan 11, 2010, Max Laier wrote: > On Sunday 04 October 2009 21:43:36 David Schultz wrote: > > Author: das > > Date: Sun Oct 4 19:43:36 2009 > > New Revision: 197752 > > URL: http://svn.freebsd.org/changeset/base/197752 > > > > Log: > > Better glibc compatibility for getline/getdelim: > > > > - Tolerate applications that pass a NULL pointer for the buffer and > > claim that the capacity of the buffer is nonzero. > > > > - If an application passes in a non-NULL buffer pointer and claims the > > buffer has zero capacity, we should free (well, realloc) it > > anyway. It could have been obtained from malloc(0), so failing to > > free it would be a small memory leak. > > > > MFC After: 2 weeks > > Reported by: naddy > > PR: ports/138320 > > > > Modified: > > head/lib/libc/stdio/getdelim.c > > > > Modified: head/lib/libc/stdio/getdelim.c > > =========================================================================== > > === --- head/lib/libc/stdio/getdelim.c Sun Oct 4 19:03:32 2009 (r197751) > > +++ head/lib/libc/stdio/getdelim.c Sun Oct 4 19:43:36 2009 (r197752) @@ > > -120,8 +120,8 @@ getdelim(char ** __restrict linep, size_ > > goto error; > > } > > > > - if (*linecapp == 0) > > - *linep = NULL; > > + if (*linep == NULL) > > + *linecapp = 0; > > > > if (fp->_r <= 0 && __srefill(fp)) { > > /* If fp is at EOF already, we just need space for the NUL. */ > > I think we should have kept the original if case here, as well. Otherwise > something like this might fail: > > char *line; /* note uninitialized */ > size_t len = 0; > getline(&line, &len, fd); > > and I think it is a reasonable thing to pass in an uninitialized pointer if > you tell that there is no space associated with it, yet. > > I don't know if there are many (ab)uses of getline like this, but I was just > bitten by it. The trouble is that in many malloc() implementations, including ours, malloc(0) actually makes a small allocation instead of returning NULL. Hence, with your proposed change, code such as the following would result in a memory leak: size_t len = 0; char *line = malloc(len); getline(&line, &len, fd); POSIX says that *linep has to be a valid argument to the free(), but it's allowed to point to a buffer that's larger than advertised (e.g., a 128-byte buffer when *linecapp is 0.) It's a bad API; what's missing is a "line buffer" ADT that hides the details of its implementation. But it's still a bit better than fgetln() and way better than something hand-rolled. From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 01:30:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CFBD1065670; Tue, 12 Jan 2010 01:30:06 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6638FC18; Tue, 12 Jan 2010 01:30: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 o0C1U67r035667; Tue, 12 Jan 2010 01:30:06 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C1U66t035665; Tue, 12 Jan 2010 01:30:06 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001120130.o0C1U66t035665@svn.freebsd.org> From: David Xu Date: Tue, 12 Jan 2010 01:30: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: r202133 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 01:30:06 -0000 Author: davidxu Date: Tue Jan 12 01:30:05 2010 New Revision: 202133 URL: http://svn.freebsd.org/changeset/base/202133 Log: Update manuals of sem_open and sem_init. Submitted by: ru Modified: head/lib/libc/gen/sem_init.3 head/lib/libc/gen/sem_open.3 Modified: head/lib/libc/gen/sem_init.3 ============================================================================== --- head/lib/libc/gen/sem_init.3 Tue Jan 12 00:04:13 2010 (r202132) +++ head/lib/libc/gen/sem_init.3 Tue Jan 12 01:30:05 2010 (r202133) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2010 +.Dd January 9, 2010 .Dt SEM_INIT 3 .Os .Sh NAME @@ -52,7 +52,7 @@ A non-zero value for specifies a shared semaphore that can be used by multiple processes, the semaphore should be located in shared memory region (see .Xr mmap 2 , -.Xr shm_open 2 , +.Xr shm_open 2 , and .Xr shmget 2 ) , any process having read and write access to address Modified: head/lib/libc/gen/sem_open.3 ============================================================================== --- head/lib/libc/gen/sem_open.3 Tue Jan 12 00:04:13 2010 (r202132) +++ head/lib/libc/gen/sem_open.3 Tue Jan 12 01:30:05 2010 (r202133) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2003 +.Dd January 9, 2010 .Dt SEM_OPEN 3 .Os .Sh NAME @@ -61,8 +61,8 @@ and This implementation places strict requirements on the value of .Fa name : it must begin with a slash -.Pq Ql / , -contain no other slash characters. +.Pq Ql / +and contain no other slash characters. .Pp The following bits may be set in the .Fa oflag From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 07:49:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E85810656B6; Tue, 12 Jan 2010 07:49:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B55E8FC12; Tue, 12 Jan 2010 07:49: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 o0C7nZZx019666; Tue, 12 Jan 2010 07:49:35 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0C7nZ7j019654; Tue, 12 Jan 2010 07:49:35 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001120749.o0C7nZ7j019654@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 07:49: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: r202143 - in head/sys: boot/forth compat/linux compat/svr4 i386/ibcs2 kern rpc security/audit sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 07:49:35 -0000 Author: brooks Date: Tue Jan 12 07:49:34 2010 New Revision: 202143 URL: http://svn.freebsd.org/changeset/base/202143 Log: Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to INT_MAX-1. Given that the Windows group limit is 1024, this range should be sufficient for most applications. MFC after: 1 month Modified: head/sys/boot/forth/loader.conf head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_uid16.c head/sys/compat/svr4/svr4_misc.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/kern_mib.c head/sys/kern/kern_prot.c head/sys/kern/subr_param.c head/sys/rpc/authunix_prot.c head/sys/security/audit/audit_arg.c head/sys/sys/systm.h Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/boot/forth/loader.conf Tue Jan 12 07:49:34 2010 (r202143) @@ -101,6 +101,7 @@ module_path="/boot/modules" # Set the mo #kern.maxusers="32" # Set size of various static tables #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events +#kern.ngroups="1023" # Set the maximum # of supplemental groups #kern.sgrowsiz="" # Set the amount to grow stack #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI #kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/linux/linux_misc.c Tue Jan 12 07:49:34 2010 (r202143) @@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struc struct proc *p; ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp >= NGROUPS) + if (ngrp < 0 || ngrp > ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); Modified: head/sys/compat/linux/linux_uid16.c ============================================================================== --- head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:49:34 2010 (r202143) @@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, str #endif ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp >= NGROUPS) + if (ngrp < 0 || ngrp > ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); Modified: head/sys/compat/svr4/svr4_misc.c ============================================================================== --- head/sys/compat/svr4/svr4_misc.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/svr4/svr4_misc.c Tue Jan 12 07:49:34 2010 (r202143) @@ -708,7 +708,7 @@ svr4_sys_sysconfig(td, uap) switch (uap->name) { case SVR4_CONFIG_NGROUPS: - *retval = NGROUPS_MAX; + *retval = ngroups_max; break; case SVR4_CONFIG_CHILD_MAX: *retval = maxproc; Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/i386/ibcs2/ibcs2_misc.c Tue Jan 12 07:49:34 2010 (r202143) @@ -665,7 +665,7 @@ ibcs2_getgroups(td, uap) if (uap->gidsetsize < 0) return (EINVAL); - ngrp = MIN(uap->gidsetsize, NGROUPS); + ngrp = MIN(uap->gidsetsize, ngroups_max + 1); gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK); error = kern_getgroups(td, &ngrp, gp); if (error) @@ -693,7 +693,7 @@ ibcs2_setgroups(td, uap) gid_t *gp; int error, i; - if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS) + if (uap->gidsetsize < 0 || uap->gidsetsize > ngroups_max + 1) return (EINVAL); if (uap->gidsetsize && uap->gidset == NULL) return (EINVAL); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/kern/kern_mib.c Tue Jan 12 07:49:34 2010 (r202143) @@ -125,7 +125,7 @@ SYSCTL_INT(_kern, KERN_POSIX1, posix1ver 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, - 0, NGROUPS_MAX, + &ngroups_max, 0, "Maximum number of supplemental groups a user can belong to"); SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD, Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/kern/kern_prot.c Tue Jan 12 07:49:34 2010 (r202143) @@ -283,7 +283,7 @@ getgroups(struct thread *td, register st u_int ngrp; int error; - ngrp = MIN(uap->gidsetsize, NGROUPS); + ngrp = MIN(uap->gidsetsize, ngroups_max + 1); groups = malloc(ngrp * sizeof(*groups), M_TEMP, M_WAITOK); error = kern_getgroups(td, &ngrp, groups); if (error) @@ -796,7 +796,7 @@ setgroups(struct thread *td, struct setg gid_t *groups = NULL; int error; - if (uap->gidsetsize > NGROUPS) + if (uap->gidsetsize > ngroups_max + 1) return (EINVAL); groups = malloc(uap->gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK); error = copyin(uap->gidset, groups, uap->gidsetsize * sizeof(gid_t)); @@ -815,7 +815,7 @@ kern_setgroups(struct thread *td, u_int struct ucred *newcred, *oldcred; int error; - if (ngrp > NGROUPS) + if (ngrp > ngroups_max + 1) return (EINVAL); AUDIT_ARG_GROUPSET(groups, ngrp); newcred = crget(); @@ -2022,14 +2022,14 @@ crsetgroups_locked(struct ucred *cr, int /* * Copy groups in to a credential after expanding it if required. - * Truncate the list to NGROUPS if it is too large. + * Truncate the list to (ngroups_max + 1) if it is too large. */ void crsetgroups(struct ucred *cr, int ngrp, gid_t *groups) { - if (ngrp > NGROUPS) - ngrp = NGROUPS; + if (ngrp > ngroups_max + 1) + ngrp = ngroups_max + 1; crextend(cr, ngrp); crsetgroups_locked(cr, ngrp, groups); Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/kern/subr_param.c Tue Jan 12 07:49:34 2010 (r202143) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_param.h" #include "opt_maxusers.h" +#include #include #include #include @@ -88,6 +89,7 @@ int maxfiles; /* sys. wide open files int maxfilesperproc; /* per-proc open files limit */ int ncallout; /* maximum # of timer events */ int nbuf; +int ngroups_max; /* max # groups per process */ int nswbuf; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ @@ -228,6 +230,18 @@ init_param1(void) TUNABLE_ULONG_FETCH("kern.maxssiz", &maxssiz); sgrowsiz = SGROWSIZ; TUNABLE_ULONG_FETCH("kern.sgrowsiz", &sgrowsiz); + + /* + * Let the administrator set {NGROUPS_MAX}, but disallow values + * less than NGROUPS_MAX which would violate POSIX.1-2008 or + * greater than INT_MAX-1 which would result in overflow. + */ + ngroups_max = NGROUPS_MAX; + TUNABLE_INT_FETCH("kern.ngroups", &ngroups_max); + if (ngroups_max < NGROUPS_MAX) + ngroups_max = NGROUPS_MAX; + if (ngroups_max > INT_MAX - 1) + ngroups_max = INT_MAX - 1; } /* Modified: head/sys/rpc/authunix_prot.c ============================================================================== --- head/sys/rpc/authunix_prot.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/rpc/authunix_prot.c Tue Jan 12 07:49:34 2010 (r202143) @@ -110,7 +110,7 @@ xdr_authunix_parms(XDR *xdrs, uint32_t * if (!xdr_uint32_t(xdrs, &ngroups)) return (FALSE); for (i = 0; i < ngroups; i++) { - if (i + 1 < NGROUPS) { + if (i + 1 < ngroups_max + 1) { if (!xdr_uint32_t(xdrs, &cred->cr_groups[i + 1])) return (FALSE); } else { @@ -120,8 +120,8 @@ xdr_authunix_parms(XDR *xdrs, uint32_t * } if (xdrs->x_op == XDR_DECODE) { - if (ngroups + 1 > NGROUPS) - cred->cr_ngroups = NGROUPS; + if (ngroups + 1 > ngroups_max + 1) + cred->cr_ngroups = ngroups_max + 1; else cred->cr_ngroups = ngroups + 1; } Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/security/audit/audit_arg.c Tue Jan 12 07:49:34 2010 (r202143) @@ -262,8 +262,8 @@ audit_arg_groupset(gid_t *gidset, u_int u_int i; struct kaudit_record *ar; - KASSERT(gidset_size <= NGROUPS, - ("audit_arg_groupset: gidset_size > NGROUPS")); + KASSERT(gidset_size <= ngroups_max + 1, + ("audit_arg_groupset: gidset_size > (kern.ngroups + 1)")); ar = currecord(); if (ar == NULL) Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/sys/systm.h Tue Jan 12 07:49:34 2010 (r202143) @@ -64,6 +64,7 @@ extern int boothowto; /* reboot flags, extern int bootverbose; /* nonzero to print verbose messages */ extern int maxusers; /* system tune hint */ +extern int ngroups_max; /* max # of supplemental groups */ #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { \ From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 08:05:07 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53581065676; Tue, 12 Jan 2010 08:05:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1CE8FC1B; Tue, 12 Jan 2010 08:05:07 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o0C83oit003242; Tue, 12 Jan 2010 02:03:50 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o0C83oph003241; Tue, 12 Jan 2010 02:03:50 -0600 (CST) (envelope-from brooks) Date: Tue, 12 Jan 2010 02:03:50 -0600 From: Brooks Davis To: Brooks Davis Message-ID: <20100112080350.GA3193@lor.one-eyed-alien.net> References: <201001120749.o0C7nZ7j019654@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <201001120749.o0C7nZ7j019654@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 12 Jan 2010 02:03:50 -0600 (CST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r202143 - in head/sys: boot/forth compat/linux compat/svr4 i386/ibcs2 kern rpc security/audit sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 08:05:07 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 12, 2010 at 07:49:35AM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Jan 12 07:49:34 2010 > New Revision: 202143 > URL: http://svn.freebsd.org/changeset/base/202143 >=20 > Log: > Replace the static NGROUPS=3DNGROUPS_MAX+1=3D1024 with a dynamic > kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=3D1023 to > INT_MAX-1. Given that the Windows group limit is 1024, this range > should be sufficient for most applications. With the commit, the only remaining delta to my projects/ngroups branch is: --- ../../head/sys/sys/param.h 2010-01-12 01:39:50.000000000 -0600 +++ ./sys/sys/param.h 2010-01-08 16:31:03.000000000 -0600 @@ -78,7 +78,6 @@ #define MAXLOGNAME 17 /* max login name length (i= ncl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous process= es */ #define NCARGS ARG_MAX /* max bytes for an exec fu= nction */ -#define NGROUPS (NGROUPS_MAX+1) /* max number groups */ #define NOFILE OPEN_MAX /* max open files per proce= ss */ #define NOGROUP 65535 /* marker for empty group s= et member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ which would remove the NGROUPS definition entirely. Overall I think this would be a good thing as applications should not be written with NGROUPS or NGROUPS_MAX hard coded in, but I have not yet asked portmgr@ for a run to see how many ports this would break. I do not believe that NGROUPS is defined in any standard so removing it should only break non-portable code. -- Brooks --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLTCzlXY6L6fI4GtQRAi5LAJ9cPeF18egS/iY129BK6lGpqptevwCgrQXm svo4yujw5cuUi4iOG3dxMdI= =OIEM -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 09:33:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBE5D106566B; Tue, 12 Jan 2010 09:33:02 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 70E758FC14; Tue, 12 Jan 2010 09:33:01 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA25407; Tue, 12 Jan 2010 11:32:58 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1NUd7S-0009Vq-Lj; Tue, 12 Jan 2010 11:32:58 +0200 Message-ID: <4B4C4181.3070408@freebsd.org> Date: Tue, 12 Jan 2010 11:31:45 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Alexander Motin References: <201001112257.o0BMvq4n001616@svn.freebsd.org> In-Reply-To: <201001112257.o0BMvq4n001616@svn.freebsd.org> X-Enigmail-Version: 0.96.0 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: r202127 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 09:33:02 -0000 on 12/01/2010 00:57 Alexander Motin said the following: > Author: mav > Date: Mon Jan 11 22:57:52 2010 > New Revision: 202127 > URL: http://svn.freebsd.org/changeset/base/202127 > > Log: > Add multichannel (4.0 and 7.1) playback support. 5.1 mode support blocked > now due to unidentified synchonization problem. For 7.1 soundcards 5.1 > support handled correctly via software upmix done by sound(4). > > Stereo stream is no more duplicated to all ports. If you loose sound, check > you are using right connectors. Front speakers connector is usually green, > center/LFE - orange, rear - black, side - gray. Yay! -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 11:11:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A7A5106566B; Tue, 12 Jan 2010 11:11:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0956C8FC08; Tue, 12 Jan 2010 11:11: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 o0CBBPh4068488; Tue, 12 Jan 2010 11:11:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CBBPTw068485; Tue, 12 Jan 2010 11:11:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001121111.o0CBBPTw068485@svn.freebsd.org> From: Alexander Motin Date: Tue, 12 Jan 2010 11:11: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: r202150 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 11:11:26 -0000 Author: mav Date: Tue Jan 12 11:11:25 2010 New Revision: 202150 URL: http://svn.freebsd.org/changeset/base/202150 Log: Make OSS_GETVERSION ioctl really work. It has 'M' group, not 'P', as different nearby ones, and was grabbed by MIXER_xxx() handler. While there, replace '(cmd & MIXER_xxx(0)) == MIXER_xxx(0)' expressions with more correct '(cmd & ~0xff) == MIXER_READ(0)'. Use of bit operations to compare numeric fields doesn't looks sane. MFC after: 1 month Modified: head/sys/dev/sound/pcm/dsp.c head/sys/dev/sound/pcm/mixer.c Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Tue Jan 12 10:13:09 2010 (r202149) +++ head/sys/dev/sound/pcm/dsp.c Tue Jan 12 11:11:25 2010 (r202150) @@ -1003,7 +1003,7 @@ dsp_ioctl_channel(struct cdev *dev, stru if (volch != NULL && ((j == SOUND_MIXER_PCM && volch->direction == PCMDIR_PLAY) || (j == SOUND_MIXER_RECLEV && volch->direction == PCMDIR_REC))) { - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + if ((cmd & ~0xff) == MIXER_WRITE(0)) { int left, right, center; left = *(int *)arg & 0x7f; @@ -1011,7 +1011,7 @@ dsp_ioctl_channel(struct cdev *dev, stru center = (left + right) >> 1; chn_setvolume_multi(volch, SND_VOL_C_PCM, left, right, center); - } else if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + } else if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = CHN_GETVOLUME(volch, SND_VOL_C_PCM, SND_CHN_T_FL); *(int *)arg |= CHN_GETVOLUME(volch, @@ -1023,7 +1023,7 @@ dsp_ioctl_channel(struct cdev *dev, stru case SOUND_MIXER_DEVMASK: case SOUND_MIXER_CAPS: case SOUND_MIXER_STEREODEVS: - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = 0; if (rdch != NULL) *(int *)arg |= SOUND_MASK_RECLEV; @@ -1034,7 +1034,7 @@ dsp_ioctl_channel(struct cdev *dev, stru break; case SOUND_MIXER_RECMASK: case SOUND_MIXER_RECSRC: - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) + if ((cmd & ~0xff) == MIXER_READ(0)) *(int *)arg = 0; ret = 0; break; Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Tue Jan 12 10:13:09 2010 (r202149) +++ head/sys/dev/sound/pcm/mixer.c Tue Jan 12 11:11:25 2010 (r202150) @@ -1130,7 +1130,7 @@ mixer_ioctl_channel(struct cdev *dev, u_ if ((j == SOUND_MIXER_DEVMASK || j == SOUND_MIXER_CAPS || j == SOUND_MIXER_STEREODEVS) && - (cmd & MIXER_READ(0)) == MIXER_READ(0)) { + (cmd & ~0xff) == MIXER_READ(0)) { snd_mtxlock(m->lock); *(int *)arg = mix_getdevs(m); snd_mtxunlock(m->lock); @@ -1148,14 +1148,14 @@ mixer_ioctl_channel_proc: KASSERT(c != NULL, ("%s(): NULL channel", __func__)); CHN_LOCKASSERT(c); - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + if ((cmd & ~0xff) == MIXER_WRITE(0)) { int left, right, center; left = *(int *)arg & 0x7f; right = (*(int *)arg >> 8) & 0x7f; center = (left + right) >> 1; chn_setvolume_multi(c, SND_VOL_C_PCM, left, right, center); - } else if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + } else if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = CHN_GETVOLUME(c, SND_VOL_C_PCM, SND_CHN_T_FL); *(int *)arg |= CHN_GETVOLUME(c, SND_VOL_C_PCM, SND_CHN_T_FR) << 8; @@ -1208,7 +1208,7 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo struct thread *td, int from) { struct snd_mixer *m; - int ret, *arg_i = (int *)arg; + int ret = EINVAL, *arg_i = (int *)arg; int v = -1, j = cmd & 0xff; /* @@ -1242,8 +1242,23 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return (EBADF); } - - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + switch (cmd) { + case SNDCTL_DSP_GET_RECSRC_NAMES: + bcopy((void *)&m->enuminfo, arg, sizeof(oss_mixer_enuminfo)); + ret = 0; + goto done; + case SNDCTL_DSP_GET_RECSRC: + ret = mixer_get_recroute(m, arg_i); + goto done; + case SNDCTL_DSP_SET_RECSRC: + ret = mixer_set_recroute(m, *arg_i); + goto done; + case OSS_GETVERSION: + *arg_i = SOUND_VERSION; + ret = 0; + goto done; + } + if ((cmd & ~0xff) == MIXER_WRITE(0)) { if (j == SOUND_MIXER_RECSRC) ret = mixer_setrecsrc(m, *arg_i); else @@ -1251,23 +1266,19 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return ((ret == 0) ? 0 : ENXIO); } - - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + if ((cmd & ~0xff) == MIXER_READ(0)) { switch (j) { - case SOUND_MIXER_DEVMASK: - case SOUND_MIXER_CAPS: - case SOUND_MIXER_STEREODEVS: + case SOUND_MIXER_DEVMASK: + case SOUND_MIXER_CAPS: + case SOUND_MIXER_STEREODEVS: v = mix_getdevs(m); break; - - case SOUND_MIXER_RECMASK: + case SOUND_MIXER_RECMASK: v = mix_getrecdevs(m); break; - - case SOUND_MIXER_RECSRC: + case SOUND_MIXER_RECSRC: v = mixer_getrecsrc(m); break; - default: v = mixer_get(m, j); } @@ -1275,29 +1286,8 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return ((v != -1) ? 0 : ENXIO); } - - ret = 0; - - switch (cmd) { - case SNDCTL_DSP_GET_RECSRC_NAMES: - bcopy((void *)&m->enuminfo, arg, sizeof(oss_mixer_enuminfo)); - break; - case SNDCTL_DSP_GET_RECSRC: - ret = mixer_get_recroute(m, arg_i); - break; - case SNDCTL_DSP_SET_RECSRC: - ret = mixer_set_recroute(m, *arg_i); - break; - case OSS_GETVERSION: - *arg_i = SOUND_VERSION; - break; - default: - ret = EINVAL; - break; - } - +done: snd_mtxunlock(m->lock); - return (ret); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 16:40:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B681065698; Tue, 12 Jan 2010 16:40:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 154508FC20; Tue, 12 Jan 2010 16:40: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 o0CGeDVJ040977; Tue, 12 Jan 2010 16:40:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CGeDGg040975; Tue, 12 Jan 2010 16:40:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001121640.o0CGeDGg040975@svn.freebsd.org> From: Alexander Motin Date: Tue, 12 Jan 2010 16:40: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: r202156 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 16:40:14 -0000 Author: mav Date: Tue Jan 12 16:40:13 2010 New Revision: 202156 URL: http://svn.freebsd.org/changeset/base/202156 Log: Align buffer size to LCM of 128bytes, required by hardware, and alignment of current format. This fixes problems with non-power-of-2 number of channels. Enable 5.1 formats support, as they are working fine now. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Jan 12 16:33:55 2010 (r202155) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Jan 12 16:40:13 2010 (r202156) @@ -86,7 +86,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20100111_0139" +#define HDA_DRV_TEST_REV "20100112_0140" SND_DECLARE_FILE("$FreeBSD$"); @@ -3543,6 +3543,32 @@ hdac_stream_setup(struct hdac_chan *ch) } } +/* + * Greatest Common Divisor. + */ +static unsigned +gcd(unsigned a, unsigned b) +{ + u_int c; + + while (b != 0) { + c = a; + a = b; + b = (c % b); + } + return (a); +} + +/* + * Least Common Multiple. + */ +static unsigned +lcm(unsigned a, unsigned b) +{ + + return ((a * b) / gcd(a, b)); +} + static int hdac_channel_setfragments(kobj_t obj, void *data, uint32_t blksz, uint32_t blkcnt) @@ -3550,7 +3576,7 @@ hdac_channel_setfragments(kobj_t obj, vo struct hdac_chan *ch = data; struct hdac_softc *sc = ch->devinfo->codec->sc; - blksz &= HDA_BLK_ALIGN; + blksz -= blksz % lcm(HDAC_DMA_ALIGNMENT, sndbuf_getalign(ch->b)); if (blksz > (sndbuf_getmaxsize(ch->b) / HDA_BDL_MIN)) blksz = sndbuf_getmaxsize(ch->b) / HDA_BDL_MIN; @@ -6551,14 +6577,12 @@ hdac_pcmchannel_setup(struct hdac_chan * if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 4, 0); } -#ifdef notyet if (channels == 6 || /* Any 6-channel */ pinset == 0x0017) { /* 7.1 */ ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 6, 1); if (ch->bit32) ch->fmtlist[i++] = SND_FORMAT(AFMT_S32_LE, 6, 1); } -#endif if (channels == 8) { /* Any 8-channel */ ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 8, 1); if (ch->bit32) From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 17:03:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE2691065670; Tue, 12 Jan 2010 17:03:55 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5FE8FC0C; Tue, 12 Jan 2010 17:03: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 o0CH3tue046322; Tue, 12 Jan 2010 17:03:55 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CH3tDV046320; Tue, 12 Jan 2010 17:03:55 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <201001121703.o0CH3tDV046320@svn.freebsd.org> From: Joseph Koshy Date: Tue, 12 Jan 2010 17:03: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: r202157 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 17:03:55 -0000 Author: jkoshy Date: Tue Jan 12 17:03:55 2010 New Revision: 202157 URL: http://svn.freebsd.org/changeset/base/202157 Log: Bug fix: add a missing initializer. Submitted by: Luca Pizzamiglio PR: i386/142742 Modified: head/lib/libpmc/libpmc.c Modified: head/lib/libpmc/libpmc.c ============================================================================== --- head/lib/libpmc/libpmc.c Tue Jan 12 16:40:13 2010 (r202156) +++ head/lib/libpmc/libpmc.c Tue Jan 12 17:03:55 2010 (r202157) @@ -2543,6 +2543,7 @@ pmc_init(void) break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); + pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 17:38:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343291065693; Tue, 12 Jan 2010 17:38:24 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2272B8FC18; Tue, 12 Jan 2010 17:38: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 o0CHcOGl054009; Tue, 12 Jan 2010 17:38:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CHcOE3054007; Tue, 12 Jan 2010 17:38:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001121738.o0CHcOE3054007@svn.freebsd.org> From: Christian Brueffer Date: Tue, 12 Jan 2010 17:38: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: r202159 - head/lib/libelf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 17:38:24 -0000 Author: brueffer Date: Tue Jan 12 17:38:23 2010 New Revision: 202159 URL: http://svn.freebsd.org/changeset/base/202159 Log: Remove useless .TE groff macro. Submitted by: Joerg Sonnenberger MFC after: 3 days Modified: head/lib/libelf/elf.3 Modified: head/lib/libelf/elf.3 ============================================================================== --- head/lib/libelf/elf.3 Tue Jan 12 17:34:10 2010 (r202158) +++ head/lib/libelf/elf.3 Tue Jan 12 17:38:23 2010 (r202159) @@ -379,7 +379,6 @@ See .It Dv SHT_SUNW_move Ta Dv ELF_T_MOVE Ta ELF move records. .It Dv SHT_SUNW_syminfo Ta Dv ELF_T_SYMINFO Ta Additional symbol flags. .El -.TE .Ss Functional Grouping This section contains a brief overview of the available functionality in the ELF library. From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 17:50:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2596106566B; Tue, 12 Jan 2010 17:50:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 908FF8FC14; Tue, 12 Jan 2010 17:50: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 o0CHoQ0I056678; Tue, 12 Jan 2010 17:50:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CHoQUV056676; Tue, 12 Jan 2010 17:50:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001121750.o0CHoQUV056676@svn.freebsd.org> From: Alexander Motin Date: Tue, 12 Jan 2010 17:50: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: r202160 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 17:50:26 -0000 Author: mav Date: Tue Jan 12 17:50:26 2010 New Revision: 202160 URL: http://svn.freebsd.org/changeset/base/202160 Log: Update, reflecting added multichannel playback support. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Tue Jan 12 17:38:23 2010 (r202159) +++ head/share/man/man4/snd_hda.4 Tue Jan 12 17:50:26 2010 (r202160) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2009 +.Dd January 12, 2010 .Dt SND_HDA 4 .Os .Sh NAME @@ -125,12 +125,14 @@ such as .Dq Li nofixedrate , will do the opposite and takes precedence. Options can be separated by whitespace and commas. +.Pp .Dq Li GPIO Ns s are a codec's General Purpose I/O pins which system integrators sometimes use to control external muters, amplifiers and so on. If you have no sound, or sound volume is not adequate, you may have to experiment a bit with the GPIO setup to find the optimal setup for your system. +.Pp The .Dq Li ivref Ns Ar X and @@ -178,6 +180,11 @@ A unique, per-association number used to particular association. Sequence numbers can be specified as numeric values from 0 to 15. .Pp +For output assotiations sequence numbers encode speaker pairs positions: +0 - Front, 1 - Center/LFE, 2 - Back, 3 - Front Wide Center, 4 - Side. +Standard combinations are: (0) - Stereo; (0, 2), (0, 4) - Quadro; +(0, 1, 2), (0, 1, 4) - 5.1; (0, 1, 2, 4) - 7.1. +.Pp The sequence number 15 has a special meaning for output associations. Output pins with this number and device type .Dq Ar Headphones @@ -639,6 +646,3 @@ to control external amplifiers. In some GPIO bits may be needed to make sound work on specific device. .Pp HDMI and DisplayPort audio may also require support from video driver. -.Pp -Due to OSS limitation multichannel (not multidevice) playback is not -supported. From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 17:59:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9227C106566B; Tue, 12 Jan 2010 17:59:59 +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 7D0F38FC15; Tue, 12 Jan 2010 17:59: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 o0CHxxv2058800; Tue, 12 Jan 2010 17:59:59 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CHxxja058787; Tue, 12 Jan 2010 17:59:59 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001121759.o0CHxxja058787@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 12 Jan 2010 17:59: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: r202161 - in head: sbin/ifconfig share/man/man4 sys/amd64/amd64 sys/dev/aic7xxx sys/dev/ath sys/dev/ath/ath_hal/ar5210 sys/dev/ct sys/dev/mly sys/i386/i386 tools/tools/ath/athdecode X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 17:59:59 -0000 Author: gavin Date: Tue Jan 12 17:59:58 2010 New Revision: 202161 URL: http://svn.freebsd.org/changeset/base/202161 Log: Spell "Hz" correctly wherever it is user-visible. PR: bin/142566 Submitted by: N.J. Mann njm njm.me.uk Approved by: ed (mentor) MFC after: 2 weeks Modified: head/sbin/ifconfig/ifieee80211.c head/share/man/man4/ath.4 head/share/man/man4/cpufreq.4 head/share/man/man4/vge.4 head/sys/amd64/amd64/local_apic.c head/sys/dev/aic7xxx/aic79xx_pci.c head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c head/sys/dev/ath/if_ath.c head/sys/dev/ct/ct_isa.c head/sys/dev/mly/mly.c head/sys/i386/i386/local_apic.c head/tools/tools/ath/athdecode/main.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sbin/ifconfig/ifieee80211.c Tue Jan 12 17:59:58 2010 (r202161) @@ -3429,9 +3429,9 @@ get_chaninfo(const struct ieee80211_chan else if (IEEE80211_IS_CHAN_B(c)) strlcat(buf, " 11b", bsize); if (IEEE80211_IS_CHAN_HALF(c)) - strlcat(buf, "/10Mhz", bsize); + strlcat(buf, "/10MHz", bsize); if (IEEE80211_IS_CHAN_QUARTER(c)) - strlcat(buf, "/5Mhz", bsize); + strlcat(buf, "/5MHz", bsize); if (IEEE80211_IS_CHAN_TURBO(c)) strlcat(buf, " Turbo", bsize); if (precise) { @@ -3453,7 +3453,7 @@ print_chaninfo(const struct ieee80211_ch { char buf[14]; - printf("Channel %3u : %u%c Mhz%-14.14s", + printf("Channel %3u : %u%c MHz%-14.14s", ieee80211_mhz2ieee(c->ic_freq, c->ic_flags), c->ic_freq, IEEE80211_IS_CHAN_PASSIVE(c) ? '*' : ' ', get_chaninfo(c, verb, buf, sizeof(buf))); @@ -3562,7 +3562,7 @@ list_channels(int s, int allchans) static void print_txpow(const struct ieee80211_channel *c) { - printf("Channel %3u : %u Mhz %3.1f reg %2d ", + printf("Channel %3u : %u MHz %3.1f reg %2d ", c->ic_ieee, c->ic_freq, c->ic_maxpower/2., c->ic_maxregpower); } @@ -4244,7 +4244,7 @@ ieee80211_status(int s) c = getcurchan(s); if (c->ic_freq != IEEE80211_CHAN_ANY) { char buf[14]; - printf(" channel %d (%u Mhz%s)", c->ic_ieee, c->ic_freq, + printf(" channel %d (%u MHz%s)", c->ic_ieee, c->ic_freq, get_chaninfo(c, 1, buf, sizeof(buf))); } else if (verbose) printf(" channel UNDEF"); Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Tue Jan 12 17:50:26 2010 (r202160) +++ head/share/man/man4/ath.4 Tue Jan 12 17:59:58 2010 (r202161) @@ -249,7 +249,7 @@ This should not happen. An invalid transmit rate was specified for an outgoing frame. The frame is discarded. This should not happen. -.It "ath%d: ath_chan_set: unable to reset channel %u (%u Mhz)" +.It "ath%d: ath_chan_set: unable to reset channel %u (%u MHz)" The Atheros Hardware Access Layer was unable to reset the hardware when switching channels during scanning. This should not happen. Modified: head/share/man/man4/cpufreq.4 ============================================================================== --- head/share/man/man4/cpufreq.4 Tue Jan 12 17:50:26 2010 (r202160) +++ head/share/man/man4/cpufreq.4 Tue Jan 12 17:59:58 2010 (r202161) @@ -234,7 +234,7 @@ The driver should set unknown or irrelev All the following elements for each setting should be returned: .Bd -literal struct cf_setting { - int freq; /* CPU clock in Mhz or 100ths of a percent. */ + int freq; /* CPU clock in MHz or 100ths of a percent. */ int volts; /* Voltage in mV. */ int power; /* Power consumed in mW. */ int lat; /* Transition latency in us. */ Modified: head/share/man/man4/vge.4 ============================================================================== --- head/share/man/man4/vge.4 Tue Jan 12 17:50:26 2010 (r202160) +++ head/share/man/man4/vge.4 Tue Jan 12 17:59:58 2010 (r202161) @@ -58,7 +58,7 @@ driver provides support for various NICs based on the VIA Technologies VT6120, VT6122, VT6130 and VT6132 Velocity Family Gigabit Ethernet controller chips. .Pp -The VT6120/VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed +The VT6120/VT6122 is a 33/66MHz 64-bit PCI device which combines a tri-speed MAC with an integrated 10/100/1000 copper PHY. (Some older cards use an external PHY.) The VT6130/VT6132 is the PCI express version of Velocity family. Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/amd64/amd64/local_apic.c Tue Jan 12 17:59:58 2010 (r202161) @@ -448,7 +448,7 @@ lapic_setup_clock(void) panic("lapic: Divisor too big"); value /= 2; if (bootverbose) - printf("lapic: Divisor %lu, Frequency %lu hz\n", + printf("lapic: Divisor %lu, Frequency %lu Hz\n", lapic_timer_divisor, value); /* Modified: head/sys/dev/aic7xxx/aic79xx_pci.c ============================================================================== --- head/sys/dev/aic7xxx/aic79xx_pci.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/dev/aic7xxx/aic79xx_pci.c Tue Jan 12 17:59:58 2010 (r202161) @@ -248,10 +248,10 @@ static const char *pci_bus_modes[] = "PCI bus mode unknown", "PCI bus mode unknown", "PCI bus mode unknown", - "PCI-X 101-133Mhz", - "PCI-X 67-100Mhz", - "PCI-X 50-66Mhz", - "PCI 33 or 66Mhz" + "PCI-X 101-133MHz", + "PCI-X 67-100MHz", + "PCI-X 50-66MHz", + "PCI 33 or 66MHz" }; #define TESTMODE 0x00000800ul Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c Tue Jan 12 17:59:58 2010 (r202161) @@ -87,7 +87,7 @@ ar5210Reset(struct ath_hal *ah, HAL_OPMO if (!IEEE80211_IS_CHAN_5GHZ(chan)) { /* Only 11a mode */ - HALDEBUG(ah, HAL_DEBUG_ANY, "%s: channel not 5Ghz\n", __func__); + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: channel not 5GHz\n", __func__); FAIL(HAL_EINVAL); } /* Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/dev/ath/if_ath.c Tue Jan 12 17:59:58 2010 (r202161) @@ -5351,7 +5351,7 @@ ath_chan_set(struct ath_softc *sc, struc ath_stoprecv(sc); /* turn off frame recv */ if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { if_printf(ifp, "%s: unable to reset " - "channel %u (%u Mhz, flags 0x%x), hal status %u\n", + "channel %u (%u MHz, flags 0x%x), hal status %u\n", __func__, ieee80211_chan2ieee(ic, chan), chan->ic_freq, chan->ic_flags, status); return EIO; Modified: head/sys/dev/ct/ct_isa.c ============================================================================== --- head/sys/dev/ct/ct_isa.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/dev/ct/ct_isa.c Tue Jan 12 17:59:58 2010 (r202161) @@ -316,7 +316,7 @@ ct_isa_attach(device_t dev) break; } #if 0 - printf("%s: chiprev %s chipclk %d Mhz\n", + printf("%s: chiprev %s chipclk %d MHz\n", slp->sl_dev.dv_xname, s, ct->sc_chipclk); #endif Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/dev/mly/mly.c Tue Jan 12 17:59:58 2010 (r202161) @@ -2528,7 +2528,7 @@ mly_describe_controller(struct mly_softc mly_describe_code(mly_table_memorytype, mi->memory_type), mi->memory_parity ? "+parity": "",mi->memory_ecc ? "+ECC": "", mi->cache_size); - mly_printf(sc, "CPU: %s @ %dMHZ\n", + mly_printf(sc, "CPU: %s @ %dMHz\n", mly_describe_code(mly_table_cputype, mi->cpu[0].type), mi->cpu[0].speed); if (mi->l2cache_size != 0) mly_printf(sc, "%dKB L2 cache\n", mi->l2cache_size); Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/sys/i386/i386/local_apic.c Tue Jan 12 17:59:58 2010 (r202161) @@ -450,7 +450,7 @@ lapic_setup_clock(void) panic("lapic: Divisor too big"); value /= 2; if (bootverbose) - printf("lapic: Divisor %lu, Frequency %lu hz\n", + printf("lapic: Divisor %lu, Frequency %lu Hz\n", lapic_timer_divisor, value); /* Modified: head/tools/tools/ath/athdecode/main.c ============================================================================== --- head/tools/tools/ath/athdecode/main.c Tue Jan 12 17:50:26 2010 (r202160) +++ head/tools/tools/ath/athdecode/main.c Tue Jan 12 17:59:58 2010 (r202161) @@ -125,13 +125,13 @@ opmark(FILE *fd, int i, const struct ath fprintf(fd, "ar%uReset (done), OK", state.chipnum); break; case AH_MARK_CHIPRESET: - fprintf(fd, "ar%uChipReset, channel %u Mhz", state.chipnum, r->val); + fprintf(fd, "ar%uChipReset, channel %u MHz", state.chipnum, r->val); break; case AH_MARK_PERCAL: - fprintf(fd, "ar%uPerCalibration, channel %u Mhz", state.chipnum, r->val); + fprintf(fd, "ar%uPerCalibration, channel %u MHz", state.chipnum, r->val); break; case AH_MARK_SETCHANNEL: - fprintf(fd, "ar%uSetChannel, channel %u Mhz", state.chipnum, r->val); + fprintf(fd, "ar%uSetChannel, channel %u MHz", state.chipnum, r->val); break; case AH_MARK_ANI_RESET: switch (r->val) { From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 18:07:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A4961065672; Tue, 12 Jan 2010 18:07:13 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6498FC12; Tue, 12 Jan 2010 18:07: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 o0CI7CMN060432; Tue, 12 Jan 2010 18:07:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CI7CQ5060429; Tue, 12 Jan 2010 18:07:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001121807.o0CI7CQ5060429@svn.freebsd.org> From: Christian Brueffer Date: Tue, 12 Jan 2010 18:07: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: r202162 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:07:13 -0000 Author: brueffer Date: Tue Jan 12 18:07:12 2010 New Revision: 202162 URL: http://svn.freebsd.org/changeset/base/202162 Log: Various fixes. Modified: head/share/man/man3/pthread_affinity_np.3 head/share/man/man3/pthread_attr_affinity_np.3 Modified: head/share/man/man3/pthread_affinity_np.3 ============================================================================== --- head/share/man/man3/pthread_affinity_np.3 Tue Jan 12 17:59:58 2010 (r202161) +++ head/share/man/man3/pthread_affinity_np.3 Tue Jan 12 18:07:12 2010 (r202162) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2010 +.Dd January 12, 2010 .Dt PTHREAD_AFFINITY_NP 3 .Os .Sh NAME @@ -44,17 +44,17 @@ .Fn pthread_getaffinity_np and .Fn pthread_setaffinity_np -allow the manipulation of sets of CPUs available to specified thread. +allow the manipulation of sets of CPUs available to the specified thread. .Pp Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 2 +.Xr CPU_SET 3 macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to -.Fn pthread_getaffinity_np +.Fn pthread_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_setaffinity_np @@ -75,14 +75,13 @@ retrieves the mask from the thread specified by .Fa td , and stores it in the space provided by -.Fa cpumaskp . +.Fa cpusetp . .Pp .Fn pthread_setaffinity_np attempts to set the mask for the thread specified by .Fa td to the value in -.Fa cpumaskp . -.Pp +.Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_getaffinity_np @@ -105,7 +104,7 @@ call would leave a thread without a vali does not overlap with the thread's anonymous mask. .It Bq Er EFAULT The -.Fa cpumaskp +.Fa cpusetp pointer passed was invalid. .It Bq Er ESRCH The thread specified by the @@ -127,7 +126,7 @@ operation. .Xr CPU_SET 3 , .Xr pthread 3 , .Xr pthread_attr_get_affinity_np 3 , -.Xr pthread_attr_set_affinity_np 3 . +.Xr pthread_attr_set_affinity_np 3 .Sh STANDARDS The .Nm pthread_getaffinity_np Modified: head/share/man/man3/pthread_attr_affinity_np.3 ============================================================================== --- head/share/man/man3/pthread_attr_affinity_np.3 Tue Jan 12 17:59:58 2010 (r202161) +++ head/share/man/man3/pthread_attr_affinity_np.3 Tue Jan 12 18:07:12 2010 (r202162) @@ -31,7 +31,7 @@ .Sh NAME .Nm pthread_attr_getaffinity_np , .Nm pthread_attr_setaffinity_np -.Nd manage CPU affinity in thread attribute object +.Nd manage CPU affinity in thread attribute objects .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS @@ -41,20 +41,21 @@ .Ft int .Fn pthread_attr_setaffinity_np "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" .Sh DESCRIPTION +The .Fn pthread_attr_getaffinity_np and .Fn pthread_attr_setaffinity_np -allow the manipulation of sets of CPUs available to specified thread attribute object. +functions allow the manipulation of sets of CPUs available to the specified thread attribute object. .Pp Masks of type .Ft cpuset_t are composed using the -.Xr CPU_SET 2 +.Xr CPU_SET 3 macros. The kernel tolerates large sets as long as all CPUs specified in the set exist. Sets smaller than the kernel uses generate an error on calls to -.Fn pthread_attr_getaffinity_np +.Fn pthread_attr_getaffinity_np even if the result set would fit within the user supplied set. Calls to .Fn pthread_attr_setaffinity_np @@ -75,14 +76,13 @@ retrieves the mask from the thread attribute object specified by .Fa pattr , and stores it in the space provided by -.Fa cpumaskp . +.Fa cpusetp . .Pp .Fn pthread_attr_setaffinity_np -set the mask for the thread attribute object specified by +sets the mask for the thread attribute object specified by .Fa pattr to the value in -.Fa cpumaskp . -.Pp +.Fa cpusetp . .Sh RETURN VALUES If successful, the .Fn pthread_attr_getaffinity_np @@ -101,7 +101,8 @@ functions will fail if: .It Bq Er EINVAL The .Fa pattr -or the attribute specified by it is NULL. +or the attribute specified by it is +.Dv NULL . .El .Pp The @@ -111,7 +112,8 @@ function will fail if: .It Bq Er EINVAL The .Fa pattr -or the attribute specified by it is NULL. +or the attribute specified by it is +.Dv NULL . .It Bq Er ENOMEM Insufficient memory exists to store the cpuset mask. .El @@ -122,7 +124,7 @@ Insufficient memory exists to store the .Xr cpuset_setid 2 , .Xr CPU_SET 3 , .Xr pthread_get_affinity_np 3 , -.Xr pthread_set_affinity_np 3 . +.Xr pthread_set_affinity_np 3 .Sh STANDARDS The .Nm pthread_attr_getaffinity_np From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 18:20:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7721065692; Tue, 12 Jan 2010 18:20:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBCB78FC19; Tue, 12 Jan 2010 18:20: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 o0CIKKqA063408; Tue, 12 Jan 2010 18:20:20 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CIKKlL063406; Tue, 12 Jan 2010 18:20:20 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001121820.o0CIKKlL063406@svn.freebsd.org> From: Brooks Davis Date: Tue, 12 Jan 2010 18:20: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: r202163 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 18:20:21 -0000 Author: brooks Date: Tue Jan 12 18:20:20 2010 New Revision: 202163 URL: http://svn.freebsd.org/changeset/base/202163 Log: Declare the kern.ngroups sysctl to be read-only, but tunable at boot for better error reporting. Submitted by: Matthew Fleming MFC After: 1 month Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Tue Jan 12 18:07:12 2010 (r202162) +++ head/sys/kern/kern_mib.c Tue Jan 12 18:20:20 2010 (r202163) @@ -124,7 +124,7 @@ SYSCTL_INT(_kern, KERN_ARGMAX, argmax, C SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD, 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); -SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RDTUN, &ngroups_max, 0, "Maximum number of supplemental groups a user can belong to"); From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 19:41:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66F9810656A3; Tue, 12 Jan 2010 19:41:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5645D8FC17; Tue, 12 Jan 2010 19:41: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 o0CJf7Tb081418; Tue, 12 Jan 2010 19:41:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CJf7qm081416; Tue, 12 Jan 2010 19:41:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001121941.o0CJf7qm081416@svn.freebsd.org> From: Alexander Motin Date: Tue, 12 Jan 2010 19:41: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: r202166 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 19:41:09 -0000 Author: mav Date: Tue Jan 12 19:41:07 2010 New Revision: 202166 URL: http://svn.freebsd.org/changeset/base/202166 Log: Make default recording source choosing more intelligent. Change default recording level from 0 to 75. It should increase chances for things to work just out of the box. Modified: head/sys/dev/sound/pcm/mixer.c Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Tue Jan 12 18:47:52 2010 (r202165) +++ head/sys/dev/sound/pcm/mixer.c Tue Jan 12 19:41:07 2010 (r202166) @@ -87,7 +87,7 @@ static u_int16_t snd_mixerdefaults[SOUND [SOUND_MIXER_IGAIN] = 0, [SOUND_MIXER_LINE1] = 75, [SOUND_MIXER_VIDEO] = 75, - [SOUND_MIXER_RECLEV] = 0, + [SOUND_MIXER_RECLEV] = 75, [SOUND_MIXER_OGAIN] = 50, [SOUND_MIXER_MONITOR] = 75, }; @@ -352,7 +352,13 @@ mixer_setrecsrc(struct snd_mixer *mixer, dropmtx = 0; src &= mixer->recdevs; if (src == 0) - src = SOUND_MASK_MIC; + src = mixer->recdevs & SOUND_MASK_MIC; + if (src == 0) + src = mixer->recdevs & SOUND_MASK_MONITOR; + if (src == 0) + src = mixer->recdevs & SOUND_MASK_LINE; + if (src == 0 && mixer->recdevs != 0) + src = (1 << (ffs(mixer->recdevs) - 1)); /* It is safe to drop this mutex due to Giant. */ MIXER_SET_UNLOCK(mixer, dropmtx); recsrc = MIXER_SETRECSRC(mixer, src); @@ -716,7 +722,7 @@ mixer_init(device_t dev, kobj_class_t cl mixer_set(m, i, v | (v << 8)); } - mixer_setrecsrc(m, SOUND_MASK_MIC); + mixer_setrecsrc(m, 0); /* Set default input. */ unit = device_get_unit(dev); devunit = snd_mkunit(unit, SND_DEV_CTL, 0); From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 20:10:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6C9B106566C; Tue, 12 Jan 2010 20:10:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9609A8FC13; Tue, 12 Jan 2010 20:10: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 o0CKAeif088102; Tue, 12 Jan 2010 20:10:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CKAedA088100; Tue, 12 Jan 2010 20:10:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001122010.o0CKAedA088100@svn.freebsd.org> From: Alexander Motin Date: Tue, 12 Jan 2010 20:10: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: r202170 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 20:10:40 -0000 Author: mav Date: Tue Jan 12 20:10:40 2010 New Revision: 202170 URL: http://svn.freebsd.org/changeset/base/202170 Log: Make OSS_GETVERSION ioctl supported also for DSP devices, same as 4Front and Linux do. MFC after: 1 month Modified: head/sys/dev/sound/pcm/dsp.c Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Tue Jan 12 20:06:04 2010 (r202169) +++ head/sys/dev/sound/pcm/dsp.c Tue Jan 12 20:10:40 2010 (r202170) @@ -1069,6 +1069,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd chn = NULL; if (IOCGROUP(cmd) == 'M') { + if (cmd == OSS_GETVERSION) { + *arg_i = SOUND_VERSION; + return (0); + } ret = dsp_ioctl_channel(i_dev, PCM_VOLCH(i_dev), cmd, arg); if (ret != -1) { PCM_GIANT_EXIT(d); From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 20:52:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3400E1065670; Tue, 12 Jan 2010 20:52:42 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22CCE8FC31; Tue, 12 Jan 2010 20:52: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 o0CKqgdA097385; Tue, 12 Jan 2010 20:52:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CKqgUJ097383; Tue, 12 Jan 2010 20:52:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001122052.o0CKqgUJ097383@svn.freebsd.org> From: Rui Paulo Date: Tue, 12 Jan 2010 20:52: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: r202171 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 20:52:42 -0000 Author: rpaulo Date: Tue Jan 12 20:52:41 2010 New Revision: 202171 URL: http://svn.freebsd.org/changeset/base/202171 Log: Fix svn properties and remove a P4 keyword. Modified: head/sys/mips/conf/SWARM (contents, props changed) Directory Properties: head/sys/mips/conf/ALCHEMY (props changed) head/sys/mips/conf/AR71XX (props changed) head/sys/mips/conf/AR71XX.hints (props changed) head/sys/mips/conf/SWARM.hints (props changed) head/sys/mips/conf/XLR (props changed) Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Tue Jan 12 20:10:40 2010 (r202170) +++ head/sys/mips/conf/SWARM Tue Jan 12 20:52:41 2010 (r202171) @@ -1,5 +1,5 @@ # -# $Id: //depot/user/neelnatu/freebsd_sibyte/src/sys/mips/conf/SWARM#7 $ +# $FreeBSD$ # ident SWARM From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 20:55:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAEBC1065672; Tue, 12 Jan 2010 20:55:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90D758FC19; Tue, 12 Jan 2010 20:55: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 o0CKtCaZ097983; Tue, 12 Jan 2010 20:55:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CKtCPp097981; Tue, 12 Jan 2010 20:55:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001122055.o0CKtCPp097981@svn.freebsd.org> From: Rui Paulo Date: Tue, 12 Jan 2010 20:55: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: r202172 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 20:55:12 -0000 Author: rpaulo Date: Tue Jan 12 20:55:12 2010 New Revision: 202172 URL: http://svn.freebsd.org/changeset/base/202172 Log: Add a regular comment explaining what this file is. Modified: head/sys/mips/conf/AR71XX Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Tue Jan 12 20:52:41 2010 (r202171) +++ head/sys/mips/conf/AR71XX Tue Jan 12 20:55:12 2010 (r202172) @@ -1,4 +1,6 @@ # +# AR71XX -- Kernel configuration file for FreeBSD/mips for Atheros 71xx systems +# # $FreeBSD$ # From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 21:17:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF9C41065676; Tue, 12 Jan 2010 21:17:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD9D8FC22; Tue, 12 Jan 2010 21:17: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 o0CLHaKe003073; Tue, 12 Jan 2010 21:17:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CLHaLn003064; Tue, 12 Jan 2010 21:17:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001122117.o0CLHaLn003064@svn.freebsd.org> From: Warner Losh Date: Tue, 12 Jan 2010 21:17: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: r202173 - in head/sys/mips: alchemy atheros conf include mips rmi sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 21:17:36 -0000 Author: imp Date: Tue Jan 12 21:17:36 2010 New Revision: 202173 URL: http://svn.freebsd.org/changeset/base/202173 Log: Place proper svn:keywords tag on all these files. They were created somehow without them on projects/mips, and that mistake was propigated over to head. Submitted by: rpaulo@ Modified: head/sys/mips/conf/MALTA64 (contents, props changed) head/sys/mips/rmi/ehcireg.h (contents, props changed) head/sys/mips/rmi/ehcivar.h (contents, props changed) head/sys/mips/rmi/pcibus.c (contents, props changed) head/sys/mips/rmi/pcibus.h (contents, props changed) head/sys/mips/rmi/uart_bus_xlr_iodi.c (contents, props changed) head/sys/mips/rmi/xlr_i2c.c (contents, props changed) head/sys/mips/rmi/xls_ehci.c (contents, props changed) Directory Properties: head/sys/mips/alchemy/files.alchemy (props changed) head/sys/mips/alchemy/std.alchemy (props changed) head/sys/mips/atheros/apb.c (props changed) head/sys/mips/atheros/apbvar.h (props changed) head/sys/mips/atheros/ar71xx_bus_space_reversed.c (props changed) head/sys/mips/atheros/ar71xx_bus_space_reversed.h (props changed) head/sys/mips/atheros/ar71xx_ehci.c (props changed) head/sys/mips/atheros/ar71xx_machdep.c (props changed) head/sys/mips/atheros/ar71xx_ohci.c (props changed) head/sys/mips/atheros/ar71xx_pci.c (props changed) head/sys/mips/atheros/ar71xx_pci_bus_space.c (props changed) head/sys/mips/atheros/ar71xx_pci_bus_space.h (props changed) head/sys/mips/atheros/ar71xx_spi.c (props changed) head/sys/mips/atheros/ar71xx_wdog.c (props changed) head/sys/mips/atheros/ar71xxreg.h (props changed) head/sys/mips/atheros/files.ar71xx (props changed) head/sys/mips/atheros/if_arge.c (props changed) head/sys/mips/atheros/if_argevar.h (props changed) head/sys/mips/atheros/uart_bus_ar71xx.c (props changed) head/sys/mips/atheros/uart_cpu_ar71xx.c (props changed) head/sys/mips/conf/.cvsignore (props changed) head/sys/mips/include/fls64.h (props changed) head/sys/mips/mips/elf_trampoline.c (props changed) head/sys/mips/mips/inckern.S (props changed) head/sys/mips/mips/sys_machdep.c (props changed) head/sys/mips/rmi/interrupt.h (props changed) head/sys/mips/rmi/intr_machdep.c (props changed) head/sys/mips/rmi/iomap.h (props changed) head/sys/mips/rmi/msgring.c (props changed) head/sys/mips/rmi/msgring.cfg (props changed) head/sys/mips/rmi/msgring.h (props changed) head/sys/mips/rmi/msgring_xls.c (props changed) head/sys/mips/rmi/msgring_xls.cfg (props changed) head/sys/mips/rmi/on_chip.c (props changed) head/sys/mips/rmi/perfmon.h (props changed) head/sys/mips/rmi/perfmon_kern.c (props changed) head/sys/mips/rmi/perfmon_percpu.c (props changed) head/sys/mips/rmi/perfmon_utils.h (props changed) head/sys/mips/rmi/perfmon_xlrconfig.h (props changed) head/sys/mips/rmi/pic.h (props changed) head/sys/mips/rmi/rmi_mips_exts.h (props changed) head/sys/mips/rmi/rootfs_list.txt (props changed) head/sys/mips/rmi/shared_structs.h (props changed) head/sys/mips/rmi/shared_structs_func.h (props changed) head/sys/mips/rmi/shared_structs_offsets.h (props changed) head/sys/mips/rmi/std.xlr (props changed) head/sys/mips/rmi/tick.c (props changed) head/sys/mips/rmi/uart_cpu_mips_xlr.c (props changed) head/sys/mips/rmi/xlr_boot1_console.c (props changed) head/sys/mips/rmi/xlr_csum_nocopy.S (props changed) head/sys/mips/rmi/xlr_machdep.c (props changed) head/sys/mips/rmi/xlr_pci.c (props changed) head/sys/mips/rmi/xlrconfig.h (props changed) head/sys/mips/sibyte/files.sibyte (props changed) Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/conf/MALTA64 Tue Jan 12 21:17:36 2010 (r202173) @@ -15,7 +15,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: projects/mips/sys/mips/conf/MALTA 192819 2009-05-26 17:01:12Z gonzo $ +# $FreeBSD$ ident MALTA Modified: head/sys/mips/rmi/ehcireg.h ============================================================================== --- head/sys/mips/rmi/ehcireg.h Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/ehcireg.h Tue Jan 12 21:17:36 2010 (r202173) @@ -1,5 +1,5 @@ /* $NetBSD: ehcireg.h,v 1.18 2004/10/22 10:38:17 augustss Exp $ */ -/* $FreeBSD: src/sys/dev/usb/ehcireg.h,v 1.7.2.2.2.1 2008/10/02 02:57:24 kensmith Exp $ */ +/* $FreeBSD$ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. Modified: head/sys/mips/rmi/ehcivar.h ============================================================================== --- head/sys/mips/rmi/ehcivar.h Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/ehcivar.h Tue Jan 12 21:17:36 2010 (r202173) @@ -1,5 +1,5 @@ /* $NetBSD: ehcivar.h,v 1.19 2005/04/29 15:04:29 augustss Exp $ */ -/* $FreeBSD: src/sys/dev/usb/ehcivar.h,v 1.9.2.1.8.1 2008/10/02 02:57:24 kensmith Exp $ */ +/* $FreeBSD$ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. Modified: head/sys/mips/rmi/pcibus.c ============================================================================== --- head/sys/mips/rmi/pcibus.c Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/pcibus.c Tue Jan 12 21:17:36 2010 (r202173) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.36 2005/01/05 20:05:52 imp Exp $"); +__FBSDID("$FreeBSD$"); #include "opt_isa.h" Modified: head/sys/mips/rmi/pcibus.h ============================================================================== --- head/sys/mips/rmi/pcibus.h Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/pcibus.h Tue Jan 12 21:17:36 2010 (r202173) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/pci/pcibus.h,v 1.5 2002/02/28 18:18:41 gallatin Exp $ + * $FreeBSD$ */ #define DEFAULT_PCI_CONFIG_BASE 0x18000000 Modified: head/sys/mips/rmi/uart_bus_xlr_iodi.c ============================================================================== --- head/sys/mips/rmi/uart_bus_xlr_iodi.c Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/uart_bus_xlr_iodi.c Tue Jan 12 21:17:36 2010 (r202173) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_bus_iodi.c,v 1.6.2.5 2006/02/15 09:16:01 marius Exp $"); +__FBSDID("$FreeBSD$"); #include #include Modified: head/sys/mips/rmi/xlr_i2c.c ============================================================================== --- head/sys/mips/rmi/xlr_i2c.c Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/xlr_i2c.c Tue Jan 12 21:17:36 2010 (r202173) @@ -29,7 +29,7 @@ * RMI_BSD */ #include -__FBSDID("$FreeBSD: src/sys/mips/xlr/xlr_i2c.c,v 1.20.8.1 2008/08/25 23:17:51 cognet Exp $"); +__FBSDID("$FreeBSD$"); /* * I2C driver for the Palm-BK3220 I2C Host adapter on the RMI XLR. Modified: head/sys/mips/rmi/xls_ehci.c ============================================================================== --- head/sys/mips/rmi/xls_ehci.c Tue Jan 12 20:55:12 2010 (r202172) +++ head/sys/mips/rmi/xls_ehci.c Tue Jan 12 21:17:36 2010 (r202173) @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.18.2.4 2008/04/23 18:54:51 jhb Exp $"); +__FBSDID("$FreeBSD$"); /* * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 21:36:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B74F31065695; Tue, 12 Jan 2010 21:36:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31F78FC0C; Tue, 12 Jan 2010 21:36: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 o0CLa89Y007215; Tue, 12 Jan 2010 21:36:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CLa8C6007214; Tue, 12 Jan 2010 21:36:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001122136.o0CLa8C6007214@svn.freebsd.org> From: Warner Losh Date: Tue, 12 Jan 2010 21:36: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: r202175 - in head/sys/mips: adm5120 alchemy atheros cavium conf idt include malta mips rmi rmi/dev/sec rmi/dev/xlr sentry5 sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 21:36:08 -0000 Author: imp Date: Tue Jan 12 21:36:08 2010 New Revision: 202175 URL: http://svn.freebsd.org/changeset/base/202175 Log: Set the svn:eol-style = native and svn:mime-type = text/plain properties on all files in this tree. Submitted by: rpaulo@ Modified: Directory Properties: head/sys/mips/adm5120/adm5120_machdep.c (props changed) head/sys/mips/adm5120/adm5120reg.h (props changed) head/sys/mips/adm5120/admpci.c (props changed) head/sys/mips/adm5120/console.c (props changed) head/sys/mips/adm5120/files.adm5120 (props changed) head/sys/mips/adm5120/if_admsw.c (props changed) head/sys/mips/adm5120/if_admswreg.h (props changed) head/sys/mips/adm5120/if_admswvar.h (props changed) head/sys/mips/adm5120/obio.c (props changed) head/sys/mips/adm5120/obiovar.h (props changed) head/sys/mips/adm5120/std.adm5120 (props changed) head/sys/mips/adm5120/uart_bus_adm5120.c (props changed) head/sys/mips/adm5120/uart_cpu_adm5120.c (props changed) head/sys/mips/adm5120/uart_dev_adm5120.c (props changed) head/sys/mips/adm5120/uart_dev_adm5120.h (props changed) head/sys/mips/alchemy/files.alchemy (props changed) head/sys/mips/alchemy/std.alchemy (props changed) head/sys/mips/atheros/apb.c (props changed) head/sys/mips/atheros/apbvar.h (props changed) head/sys/mips/atheros/ar71xx_bus_space_reversed.c (props changed) head/sys/mips/atheros/ar71xx_bus_space_reversed.h (props changed) head/sys/mips/atheros/ar71xx_ehci.c (props changed) head/sys/mips/atheros/ar71xx_machdep.c (props changed) head/sys/mips/atheros/ar71xx_ohci.c (props changed) head/sys/mips/atheros/ar71xx_pci.c (props changed) head/sys/mips/atheros/ar71xx_pci_bus_space.c (props changed) head/sys/mips/atheros/ar71xx_pci_bus_space.h (props changed) head/sys/mips/atheros/ar71xx_spi.c (props changed) head/sys/mips/atheros/ar71xx_wdog.c (props changed) head/sys/mips/atheros/ar71xxreg.h (props changed) head/sys/mips/atheros/files.ar71xx (props changed) head/sys/mips/atheros/if_arge.c (props changed) head/sys/mips/atheros/if_argevar.h (props changed) head/sys/mips/atheros/uart_bus_ar71xx.c (props changed) head/sys/mips/atheros/uart_cpu_ar71xx.c (props changed) head/sys/mips/cavium/files.octeon1 (props changed) head/sys/mips/cavium/std.octeon1 (props changed) head/sys/mips/conf/.cvsignore (props changed) head/sys/mips/conf/ADM5120 (props changed) head/sys/mips/conf/ADM5120.hints (props changed) head/sys/mips/conf/DEFAULTS (props changed) head/sys/mips/conf/IDT (props changed) head/sys/mips/conf/IDT.hints (props changed) head/sys/mips/conf/MALTA (props changed) head/sys/mips/conf/MALTA.hints (props changed) head/sys/mips/conf/MALTA64 (props changed) head/sys/mips/conf/OCTEON1 (props changed) head/sys/mips/conf/OCTEON1-32 (props changed) head/sys/mips/conf/OCTEON1.hints (props changed) head/sys/mips/conf/QEMU (props changed) head/sys/mips/conf/SENTRY5 (props changed) head/sys/mips/conf/SENTRY5.hints (props changed) head/sys/mips/idt/files.idt (props changed) head/sys/mips/idt/idt_machdep.c (props changed) head/sys/mips/idt/idtpci.c (props changed) head/sys/mips/idt/idtreg.h (props changed) head/sys/mips/idt/if_kr.c (props changed) head/sys/mips/idt/if_krreg.h (props changed) head/sys/mips/idt/obio.c (props changed) head/sys/mips/idt/obiovar.h (props changed) head/sys/mips/idt/std.idt (props changed) head/sys/mips/idt/uart_bus_rc32434.c (props changed) head/sys/mips/idt/uart_cpu_rc32434.c (props changed) head/sys/mips/include/_align.h (props changed) head/sys/mips/include/_bus.h (props changed) head/sys/mips/include/_bus_octeon.h (props changed) head/sys/mips/include/_inttypes.h (props changed) head/sys/mips/include/_limits.h (props changed) head/sys/mips/include/_stdint.h (props changed) head/sys/mips/include/_types.h (props changed) head/sys/mips/include/archtype.h (props changed) head/sys/mips/include/asm.h (props changed) head/sys/mips/include/asmacros.h (props changed) head/sys/mips/include/atomic.h (props changed) head/sys/mips/include/bootinfo.h (props changed) head/sys/mips/include/bswap.h (props changed) head/sys/mips/include/bus.h (props changed) head/sys/mips/include/bus_dma.h (props changed) head/sys/mips/include/cache.h (props changed) head/sys/mips/include/cache_mipsNN.h (props changed) head/sys/mips/include/cache_r4k.h (props changed) head/sys/mips/include/clock.h (props changed) head/sys/mips/include/clockvar.h (props changed) head/sys/mips/include/cpu.h (props changed) head/sys/mips/include/cpufunc.h (props changed) head/sys/mips/include/cpuinfo.h (props changed) head/sys/mips/include/cpuregs.h (props changed) head/sys/mips/include/cputypes.h (props changed) head/sys/mips/include/db_machdep.h (props changed) head/sys/mips/include/defs.h (props changed) head/sys/mips/include/elf.h (props changed) head/sys/mips/include/endian.h (props changed) head/sys/mips/include/exec.h (props changed) head/sys/mips/include/float.h (props changed) head/sys/mips/include/floatingpoint.h (props changed) head/sys/mips/include/fls64.h (props changed) head/sys/mips/include/fpu.h (props changed) head/sys/mips/include/frame.h (props changed) head/sys/mips/include/gdb_machdep.h (props changed) head/sys/mips/include/hwfunc.h (props changed) head/sys/mips/include/ieee.h (props changed) head/sys/mips/include/ieeefp.h (props changed) head/sys/mips/include/in_cksum.h (props changed) head/sys/mips/include/intr_machdep.h (props changed) head/sys/mips/include/iodev.h (props changed) head/sys/mips/include/kdb.h (props changed) head/sys/mips/include/limits.h (props changed) head/sys/mips/include/locore.h (props changed) head/sys/mips/include/md_var.h (props changed) head/sys/mips/include/memdev.h (props changed) head/sys/mips/include/metadata.h (props changed) head/sys/mips/include/minidump.h (props changed) head/sys/mips/include/mips_opcode.h (props changed) head/sys/mips/include/mp_watchdog.h (props changed) head/sys/mips/include/mutex.h (props changed) head/sys/mips/include/param.h (props changed) head/sys/mips/include/pcb.h (props changed) head/sys/mips/include/pci_cfgreg.h (props changed) head/sys/mips/include/pcpu.h (props changed) head/sys/mips/include/pmap.h (props changed) head/sys/mips/include/pmc_mdep.h (props changed) head/sys/mips/include/ppireg.h (props changed) head/sys/mips/include/proc.h (props changed) head/sys/mips/include/profile.h (props changed) head/sys/mips/include/psl.h (props changed) head/sys/mips/include/pte.h (props changed) head/sys/mips/include/ptrace.h (props changed) head/sys/mips/include/queue.h (props changed) head/sys/mips/include/reg.h (props changed) head/sys/mips/include/regdef.h (props changed) head/sys/mips/include/regnum.h (props changed) head/sys/mips/include/reloc.h (props changed) head/sys/mips/include/resource.h (props changed) head/sys/mips/include/rm7000.h (props changed) head/sys/mips/include/runq.h (props changed) head/sys/mips/include/segments.h (props changed) head/sys/mips/include/setjmp.h (props changed) head/sys/mips/include/sf_buf.h (props changed) head/sys/mips/include/sigframe.h (props changed) head/sys/mips/include/signal.h (props changed) head/sys/mips/include/smp.h (props changed) head/sys/mips/include/stdarg.h (props changed) head/sys/mips/include/sysarch.h (props changed) head/sys/mips/include/timerreg.h (props changed) head/sys/mips/include/trap.h (props changed) head/sys/mips/include/ucontext.h (props changed) head/sys/mips/include/varargs.h (props changed) head/sys/mips/include/vmparam.h (props changed) head/sys/mips/malta/files.malta (props changed) head/sys/mips/malta/gt.c (props changed) head/sys/mips/malta/gt_pci.c (props changed) head/sys/mips/malta/gtreg.h (props changed) head/sys/mips/malta/gtvar.h (props changed) head/sys/mips/malta/malta_machdep.c (props changed) head/sys/mips/malta/maltareg.h (props changed) head/sys/mips/malta/obio.c (props changed) head/sys/mips/malta/obiovar.h (props changed) head/sys/mips/malta/std.malta (props changed) head/sys/mips/malta/uart_bus_maltausart.c (props changed) head/sys/mips/malta/uart_cpu_maltausart.c (props changed) head/sys/mips/malta/yamon.c (props changed) head/sys/mips/malta/yamon.h (props changed) head/sys/mips/mips/autoconf.c (props changed) head/sys/mips/mips/bus_space_generic.c (props changed) head/sys/mips/mips/busdma_machdep.c (props changed) head/sys/mips/mips/cache.c (props changed) head/sys/mips/mips/cache_mipsNN.c (props changed) head/sys/mips/mips/copystr.S (props changed) head/sys/mips/mips/cpu.c (props changed) head/sys/mips/mips/db_disasm.c (props changed) head/sys/mips/mips/db_interface.c (props changed) head/sys/mips/mips/db_trace.c (props changed) head/sys/mips/mips/dump_machdep.c (props changed) head/sys/mips/mips/elf64_machdep.c (props changed) head/sys/mips/mips/elf_machdep.c (props changed) head/sys/mips/mips/elf_trampoline.c (props changed) head/sys/mips/mips/exception.S (props changed) head/sys/mips/mips/fp.S (props changed) head/sys/mips/mips/gdb_machdep.c (props changed) head/sys/mips/mips/genassym.c (props changed) head/sys/mips/mips/in_cksum.c (props changed) head/sys/mips/mips/inckern.S (props changed) head/sys/mips/mips/intr_machdep.c (props changed) head/sys/mips/mips/locore.S (props changed) head/sys/mips/mips/machdep.c (props changed) head/sys/mips/mips/mainbus.c (props changed) head/sys/mips/mips/mem.c (props changed) head/sys/mips/mips/mp_machdep.c (props changed) head/sys/mips/mips/nexus.c (props changed) head/sys/mips/mips/pm_machdep.c (props changed) head/sys/mips/mips/pmap.c (props changed) head/sys/mips/mips/psraccess.S (props changed) head/sys/mips/mips/stack_machdep.c (props changed) head/sys/mips/mips/support.S (props changed) head/sys/mips/mips/swtch.S (props changed) head/sys/mips/mips/sys_machdep.c (props changed) head/sys/mips/mips/tick.c (props changed) head/sys/mips/mips/tlb.S (props changed) head/sys/mips/mips/trap.c (props changed) head/sys/mips/mips/uio_machdep.c (props changed) head/sys/mips/mips/vm_machdep.c (props changed) head/sys/mips/rmi/Makefile.msgring (props changed) head/sys/mips/rmi/board.c (props changed) head/sys/mips/rmi/board.h (props changed) head/sys/mips/rmi/bus_space_rmi.c (props changed) head/sys/mips/rmi/clock.c (props changed) head/sys/mips/rmi/clock.h (props changed) head/sys/mips/rmi/debug.h (props changed) head/sys/mips/rmi/dev/sec/desc.h (props changed) head/sys/mips/rmi/dev/sec/rmilib.c (props changed) head/sys/mips/rmi/dev/sec/rmilib.h (props changed) head/sys/mips/rmi/dev/sec/rmisec.c (props changed) head/sys/mips/rmi/dev/sec/stats.h (props changed) head/sys/mips/rmi/dev/xlr/atx_cpld.h (props changed) head/sys/mips/rmi/dev/xlr/rge.c (props changed) head/sys/mips/rmi/dev/xlr/rge.h (props changed) head/sys/mips/rmi/dev/xlr/xgmac_mdio.h (props changed) head/sys/mips/rmi/ehcireg.h (props changed) head/sys/mips/rmi/ehcivar.h (props changed) head/sys/mips/rmi/files.xlr (props changed) head/sys/mips/rmi/interrupt.h (props changed) head/sys/mips/rmi/intr_machdep.c (props changed) head/sys/mips/rmi/iodi.c (props changed) head/sys/mips/rmi/iomap.h (props changed) head/sys/mips/rmi/msgring.c (props changed) head/sys/mips/rmi/msgring.cfg (props changed) head/sys/mips/rmi/msgring.h (props changed) head/sys/mips/rmi/msgring_xls.c (props changed) head/sys/mips/rmi/msgring_xls.cfg (props changed) head/sys/mips/rmi/on_chip.c (props changed) head/sys/mips/rmi/pcibus.c (props changed) head/sys/mips/rmi/pcibus.h (props changed) head/sys/mips/rmi/perfmon.h (props changed) head/sys/mips/rmi/perfmon_kern.c (props changed) head/sys/mips/rmi/perfmon_percpu.c (props changed) head/sys/mips/rmi/perfmon_utils.h (props changed) head/sys/mips/rmi/perfmon_xlrconfig.h (props changed) head/sys/mips/rmi/pic.h (props changed) head/sys/mips/rmi/rmi_mips_exts.h (props changed) head/sys/mips/rmi/rootfs_list.txt (props changed) head/sys/mips/rmi/shared_structs.h (props changed) head/sys/mips/rmi/shared_structs_func.h (props changed) head/sys/mips/rmi/shared_structs_offsets.h (props changed) head/sys/mips/rmi/std.xlr (props changed) head/sys/mips/rmi/tick.c (props changed) head/sys/mips/rmi/uart_bus_xlr_iodi.c (props changed) head/sys/mips/rmi/uart_cpu_mips_xlr.c (props changed) head/sys/mips/rmi/xlr_boot1_console.c (props changed) head/sys/mips/rmi/xlr_csum_nocopy.S (props changed) head/sys/mips/rmi/xlr_i2c.c (props changed) head/sys/mips/rmi/xlr_machdep.c (props changed) head/sys/mips/rmi/xlr_pci.c (props changed) head/sys/mips/rmi/xlrconfig.h (props changed) head/sys/mips/rmi/xls_ehci.c (props changed) head/sys/mips/sentry5/files.sentry5 (props changed) head/sys/mips/sentry5/obio.c (props changed) head/sys/mips/sentry5/obiovar.h (props changed) head/sys/mips/sentry5/s5_machdep.c (props changed) head/sys/mips/sentry5/s5reg.h (props changed) head/sys/mips/sentry5/uart_bus_sbusart.c (props changed) head/sys/mips/sentry5/uart_cpu_sbusart.c (props changed) head/sys/mips/sibyte/files.sibyte (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 21:45:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 426C7106566B; Tue, 12 Jan 2010 21:45:04 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 300138FC1B; Tue, 12 Jan 2010 21:45: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 o0CLj4Wa009227; Tue, 12 Jan 2010 21:45:04 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CLj3EX009214; Tue, 12 Jan 2010 21:45:03 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001122145.o0CLj3EX009214@svn.freebsd.org> From: Christian Brueffer Date: Tue, 12 Jan 2010 21:45: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: r202176 - in head/lib/libc: net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 21:45:04 -0000 Author: brueffer Date: Tue Jan 12 21:45:03 2010 New Revision: 202176 URL: http://svn.freebsd.org/changeset/base/202176 Log: Miscellaneous mdoc, spelling and inconsistency fixes. PR: 142573, 142576 (mostly) Submitted by: brucec MFC after: 1 week Modified: head/lib/libc/net/sctp_bindx.3 head/lib/libc/net/sctp_connectx.3 head/lib/libc/net/sctp_getaddrlen.3 head/lib/libc/net/sctp_getassocid.3 head/lib/libc/net/sctp_getpaddrs.3 head/lib/libc/net/sctp_opt_info.3 head/lib/libc/net/sctp_recvmsg.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 head/lib/libc/sys/sctp_generic_recvmsg.2 head/lib/libc/sys/sctp_generic_sendmsg.2 head/lib/libc/sys/sctp_peeloff.2 Modified: head/lib/libc/net/sctp_bindx.3 ============================================================================== --- head/lib/libc/net/sctp_bindx.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_bindx.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -90,7 +90,7 @@ The call returns 0 on success and -1 upo .Sh ERRORS The .Fn sctp_bindx -can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL This value is returned if the Modified: head/lib/libc/net/sctp_connectx.3 ============================================================================== --- head/lib/libc/net/sctp_connectx.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_connectx.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -44,7 +44,7 @@ .In sys/socket.h .In netinet/sctp.h .Ft int -.Fn sctp_connectx "int s" "struct sockaddr *" "int addrcnt" "sctp_assoc_t *" +.Fn sctp_connectx "int sd" "struct sockaddr *addrs" "int addrcnt" "sctp_assoc_t *id" .Sh DESCRIPTION The .Fn sctp_connectx @@ -75,7 +75,7 @@ the extra addresses sent in the call will be silently discarded from the association. On successful completion the provided -.Fa "sctp_assoc_t *" +.Fa id will be filled in with the association identification of the newly forming association. @@ -84,7 +84,7 @@ The call returns 0 on success and -1 upo .Sh ERRORS The .Fn sctp_connectx -can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL An address listed has an invalid family or no Modified: head/lib/libc/net/sctp_getaddrlen.3 ============================================================================== --- head/lib/libc/net/sctp_getaddrlen.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_getaddrlen.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -76,7 +76,7 @@ system expects for the specific address .Sh ERRORS The .Fn sctp_getaddrlen -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL The address family specified does NOT exist. Modified: head/lib/libc/net/sctp_getassocid.3 ============================================================================== --- head/lib/libc/net/sctp_getassocid.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_getassocid.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -58,7 +58,7 @@ The call returns the association id upon .Sh ERRORS The .Fn sctp_getassocid -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er ENOENT The address does not have an association setup to it. Modified: head/lib/libc/net/sctp_getpaddrs.3 ============================================================================== --- head/lib/libc/net/sctp_getpaddrs.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_getpaddrs.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" .Dd December 15, 2006 -.Dt SCTP_GETPADDR 3 +.Dt SCTP_GETPADDRS 3 .Os .Sh NAME .Nm sctp_getpaddrs , @@ -64,7 +64,7 @@ array of socket addresses returned in th .Fa addrs upon success. .Pp -After the caller is through the function +After the caller is finished, the function .Fn sctp_freepaddrs or .Fn sctp_freeladdrs @@ -76,7 +76,7 @@ the number of addresses returned in .Fa addrs upon success. .Sh ERRORS -The functions can return the following errors. +The functions can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL An address listed has an invalid family or no Modified: head/lib/libc/net/sctp_opt_info.3 ============================================================================== --- head/lib/libc/net/sctp_opt_info.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_opt_info.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -45,7 +45,7 @@ .In sys/socket.h .In netinet/sctp.h .Ft int -.Fn sctp_opt_info "int s" "sctp_assoc_t" "int opt" "void *arg" "socklen_t *size" +.Fn sctp_opt_info "int sd" "sctp_assoc_t id" "int opt" "void *arg" "socklen_t *size" .Sh DESCRIPTION The .Fn sctp_opt_info @@ -90,7 +90,7 @@ socket options. .Sh ERRORS The .Fn sctp_opt_info -function can return the following errors. +function can return the following errors: .Bl -tag -width Er .It Bq Er EINVAL The argument Modified: head/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- head/lib/libc/net/sctp_recvmsg.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_recvmsg.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -160,7 +160,7 @@ struct sctp_sndrcvinfo { .Pp The .Fa sinfo->sinfo_ppid -is an opaque 32 bit value that is passed transparently +field is an opaque 32 bit value that is passed transparently through the stack from the peer endpoint. Note that the stack passes this value without regard to byte order. @@ -180,12 +180,13 @@ as soon as possible. When this flag is absent the message was delivered in order within the stream it was received. .Pp +The .Fa sinfo->sinfo_stream -is the SCTP stream that the message was received on. +field is the SCTP stream that the message was received on. Streams in SCTP are reliable (or partially reliable) flows of ordered messages. .Pp -The +The .Fa sinfo->sinfo_context field is used only if the local application set an association level context with the @@ -197,7 +198,7 @@ association. .Pp The .Fa sinfo->sinfo_ssn -will hold the stream sequence number assigned +field will hold the stream sequence number assigned by the peer endpoint if the message is .Em not unordered. @@ -205,7 +206,7 @@ For unordered messages this field holds .Pp The .Fa sinfo->sinfo_tsn -holds a transport sequence number (TSN) that was assigned +field holds a transport sequence number (TSN) that was assigned to this message by the peer endpoint. For messages that fit in or less than the path MTU this will be the only TSN assigned. @@ -215,12 +216,12 @@ message. .Pp The .Fa sinfo->sinfo_cumtsn -holds the current cumulative acknowledgment point of +field holds the current cumulative acknowledgment point of the transport association. Note that this may be larger or smaller than the TSN assigned to the message itself. .Pp -The +The .Fa sinfo->sinfo_assoc_id is the unique association identification that was assigned to the association. @@ -232,10 +233,10 @@ setting various socket options on the sp (see .Xr sctp 4 ) . .Pp -The +The .Fa sinfo->info_timetolive field is not used by -.Fa sctp_recvmsg . +.Fn sctp_recvmsg . .Sh RETURN VALUES The call returns the number of characters sent, or -1 if an error occurred. Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_send.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -294,7 +294,7 @@ if an error occurred. The .Fn sctp_send system call -fail if: +fails if: .Bl -tag -width Er .It Bq Er EBADF An invalid descriptor was specified. Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/net/sctp_sendmsg.3 Tue Jan 12 21:45:03 2010 (r202176) @@ -271,7 +271,7 @@ if an error occurred. The .Fn sctp_sendmsg system call -fail if: +fails if: .Bl -tag -width Er .It Bq Er EBADF An invalid descriptor was specified. @@ -324,7 +324,7 @@ is not connected and is a one-to-one sty .Xr sendmsg 3 , .Xr sctp 4 .Sh BUGS -Because in the one-to-many style socket the +Because in the one-to-many style socket .Fn sctp_sendmsg or .Fn sctp_sendmsgx Modified: head/lib/libc/sys/sctp_generic_recvmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_recvmsg.2 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/sys/sctp_generic_recvmsg.2 Tue Jan 12 21:45:03 2010 (r202176) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm sctp_generic_recvmsg -.Nd receive data from a peer. +.Nd receive data from a peer .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -46,16 +46,20 @@ .Ft int .Fn sctp_generic_recvmsg "int s" "struct iovec *iov" "int iovlen" "struct sockaddr *from" "socklen_t *fromlen" "struct sctp_sndrcvinfo *sinfo" "int *msgflags" .Sh DESCRIPTION -The .Fn sctp_generic_recvmsg -is the true system calls used by the -.Fn sctp_recvmsg -function call. This call is more efficient since it is a -true system calls but it is specific to FreeBSD and -can be expected NOT to be present on any other Operating -System. For detailed useage please see either the -.Fn sctp_recvmsg -function call. +is the true system call used by the +.Xr sctp_recvmsg 3 +function call. +This call is more efficient since it is a +true system call but it is specific to +.Fx +and can be expected +.Em not +to be present on any other operating +system. +For detailed usage please see the +.Xr sctp_recvmsg 3 +function call. .Sh RETURN VALUES The call returns the number of bytes read on success and -1 upon failure. .Sh ERRORS Modified: head/lib/libc/sys/sctp_generic_sendmsg.2 ============================================================================== --- head/lib/libc/sys/sctp_generic_sendmsg.2 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/sys/sctp_generic_sendmsg.2 Tue Jan 12 21:45:03 2010 (r202176) @@ -37,7 +37,7 @@ .Sh NAME .Nm sctp_generic_sendmsg .Nm sctp_generic_sendmsg_iov -.Nd send data to a peer. +.Nd send data to a peer .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -49,21 +49,25 @@ .Ft int .Fn sctp_generic_sendmsg_iov "int s" "struct iovec *iov" "int iovlen" "struct sockaddr *to" "struct sctp_sndrcvinfo *sinfo" "int flags" .Sh DESCRIPTION -The .Fn sctp_generic_sendmsg and .Fn sctp_generic_sendmsg_iov are the true system calls used by the -.Fn sctp_sendmsg +.Xr sctp_sendmsg 3 and -.Fn sctp_send -function calls. These are more efficient since they are -true system calls but they are specific to FreeBSD and -can be expected NOT to be present on any other Operating -System. For detailed useage please see either the -.Fn sctp_send +.Xr sctp_send 3 +function calls. +These are more efficient since they are +true system calls but they are specific to +.Fx +and can be expected +.Em not +to be present on any other operating +system. +For detailed usage please see either the +.Xr sctp_send 3 or -.Fn sctp_sendmsg +.Xr sctp_sendmsg 3 function calls. .Sh RETURN VALUES The call returns the number of bytes written on success and -1 upon failure. Modified: head/lib/libc/sys/sctp_peeloff.2 ============================================================================== --- head/lib/libc/sys/sctp_peeloff.2 Tue Jan 12 21:36:08 2010 (r202175) +++ head/lib/libc/sys/sctp_peeloff.2 Tue Jan 12 21:45:03 2010 (r202176) @@ -36,7 +36,7 @@ .Os .Sh NAME .Nm sctp_peeloff -.Nd detach an association from a one-to-many socket to its on fd +.Nd detach an association from a one-to-many socket to its own fd .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -58,7 +58,7 @@ upon success. .Sh ERRORS The .Fn sctp_peeloff -can return the following errors. +system call can return the following errors: .Bl -tag -width Er .It Bq Er ENOTCONN The From owner-svn-src-head@FreeBSD.ORG Tue Jan 12 22:22:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 948401065696; Tue, 12 Jan 2010 22:22:27 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 663E08FC1D; Tue, 12 Jan 2010 22:22: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 o0CMMRAO017535; Tue, 12 Jan 2010 22:22:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0CMMRZ6017532; Tue, 12 Jan 2010 22:22:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001122222.o0CMMRZ6017532@svn.freebsd.org> From: Rui Paulo Date: Tue, 12 Jan 2010 22:22: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: r202178 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 22:22:27 -0000 Author: rpaulo Date: Tue Jan 12 22:22:27 2010 New Revision: 202178 URL: http://svn.freebsd.org/changeset/base/202178 Log: Update mesh code to to D4.0. Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue Jan 12 22:06:53 2010 (r202177) +++ head/sys/net80211/ieee80211_mesh.c Tue Jan 12 22:22:27 2010 (r202178) @@ -2381,6 +2381,7 @@ uint8_t * ieee80211_add_meshconf(uint8_t *frm, struct ieee80211vap *vap) { const struct ieee80211_mesh_state *ms = vap->iv_mesh; + uint16_t caps; KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap")); @@ -2396,11 +2397,12 @@ ieee80211_add_meshconf(uint8_t *frm, str if (ms->ms_flags & IEEE80211_MESHFLAGS_PORTAL) *frm |= IEEE80211_MESHCONF_FORM_MP; frm += 1; - *frm = 0; + caps = 0; if (ms->ms_flags & IEEE80211_MESHFLAGS_AP) - *frm |= IEEE80211_MESHCONF_CAP_AP; + caps |= IEEE80211_MESHCONF_CAP_AP; if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD) - *frm |= IEEE80211_MESHCONF_CAP_FWRD; + caps |= IEEE80211_MESHCONF_CAP_FWRD; + ADDSHORT(frm, caps); frm += 1; return frm; } Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Tue Jan 12 22:06:53 2010 (r202177) +++ head/sys/net80211/ieee80211_mesh.h Tue Jan 12 22:22:27 2010 (r202178) @@ -49,7 +49,7 @@ struct ieee80211_meshconf_ie { uint8_t conf_syncid; /* Sync. Protocol ID */ uint8_t conf_authid; /* Auth. Protocol ID */ uint8_t conf_form; /* Formation Information */ - uint8_t conf_cap; + uint16_t conf_cap; } __packed; /* Hybrid Wireless Mesh Protocol */ @@ -72,7 +72,8 @@ struct ieee80211_meshconf_ie { #define IEEE80211_MESHCONF_CAP_FWRD 0x08 /* forwarding enabled */ #define IEEE80211_MESHCONF_CAP_BTR 0x10 /* Beacon Timing Report Enab */ #define IEEE80211_MESHCONF_CAP_TBTTA 0x20 /* TBTT Adj. Enabled */ -#define IEEE80211_MESHCONF_CAP_PSL 0x40 /* Power Save Level */ +#define IEEE80211_MESHCONF_CAP_TBTT 0x40 /* TBTT Adjusting */ +#define IEEE80211_MESHCONF_CAP_PSL 0x80 /* Power Save Level */ /* Mesh Identifier */ struct ieee80211_meshid_ie { From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 00:15:21 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DE4106566B for ; Wed, 13 Jan 2010 00:15:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 04CE18FC13 for ; Wed, 13 Jan 2010 00:15:20 +0000 (UTC) Received: (qmail 24428 invoked by uid 399); 13 Jan 2010 00:15:20 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 13 Jan 2010 00:15:20 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B4D109A.5060500@FreeBSD.org> Date: Tue, 12 Jan 2010 16:15:22 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "M. Warner Losh" References: <201001101744.o0AHiM2d095302@svn.freebsd.org> <20100110.210204.787670930858346133.imp@bsdimp.com> In-Reply-To: <20100110.210204.787670930858346133.imp@bsdimp.com> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 00:15:21 -0000 On 1/10/2010 8:02 PM, M. Warner Losh wrote: > In message: > Doug Barton writes: > : On Sun, 10 Jan 2010, Warner Losh wrote: > : > : > Author: imp > : > Date: Sun Jan 10 17:44:22 2010 > : > New Revision: 202019 > : > URL: http://svn.freebsd.org/changeset/base/202019 > : > > : > Log: > : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. > : > : Thanks for doing this, however the comment about how to include the > : whole file (including the comments) were not included. Do I need to do > : this part of it myself? No problem if so, I just want to be sure to > : get it done in time to MFC it before the freeze for 7.3-release. > > In general, we don't put big comments like that in the config files, > preferring to leave them to NOTES. I was just following that > convention... Understood, however given that there is plenty of room for confusion on this point because the default is NOT to include the comments I think that some explanation is justified. My original text was: # Store the plain version of the configuration file in the kernel itself. # To store the entire file, including comments, put this in /etc/src.conf: # CONFIGARGS= -C # See config(8) for more details. I'm open to suggestions on shrinking it, but I do think some sort of explanation is warranted. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 00:49:58 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B6F106566C; Wed, 13 Jan 2010 00:49:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F343A8FC0A; Wed, 13 Jan 2010 00:49:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0D0gVUc081359; Tue, 12 Jan 2010 17:42:31 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 12 Jan 2010 17:43:26 -0700 (MST) Message-Id: <20100112.174326.337739863389869251.imp@bsdimp.com> To: dougb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4B4D109A.5060500@FreeBSD.org> References: <20100110.210204.787670930858346133.imp@bsdimp.com> <4B4D109A.5060500@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 00:49:58 -0000 In message: <4B4D109A.5060500@FreeBSD.org> Doug Barton writes: : On 1/10/2010 8:02 PM, M. Warner Losh wrote: : > In message: : > Doug Barton writes: : > : On Sun, 10 Jan 2010, Warner Losh wrote: : > : : > : > Author: imp : > : > Date: Sun Jan 10 17:44:22 2010 : > : > New Revision: 202019 : > : > URL: http://svn.freebsd.org/changeset/base/202019 : > : > : > : > Log: : > : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. : > : : > : Thanks for doing this, however the comment about how to include the : > : whole file (including the comments) were not included. Do I need to do : > : this part of it myself? No problem if so, I just want to be sure to : > : get it done in time to MFC it before the freeze for 7.3-release. : > : > In general, we don't put big comments like that in the config files, : > preferring to leave them to NOTES. I was just following that : > convention... : : Understood, however given that there is plenty of room for confusion on : this point because the default is NOT to include the comments I think : that some explanation is justified. My original text was: : : # Store the plain version of the configuration file in the kernel itself. : # To store the entire file, including comments, put this in /etc/src.conf: : # CONFIGARGS= -C : # See config(8) for more details. : : I'm open to suggestions on shrinking it, but I do think some sort of : explanation is warranted. I'm not sure I see where there's confusion possible here, let alone plenty of room for it. Do you think you can describe what confusion is possible here? Warner From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 03:16:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1D8106568F; Wed, 13 Jan 2010 03:16:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69F928FC1A; Wed, 13 Jan 2010 03:16: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 o0D3GVvu082303; Wed, 13 Jan 2010 03:16:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0D3GVkA082296; Wed, 13 Jan 2010 03:16:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001130316.o0D3GVkA082296@svn.freebsd.org> From: Andrew Thompson Date: Wed, 13 Jan 2010 03:16: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: r202181 - in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/uhso usr.sbin usr.sbin/uhsoctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 03:16:31 -0000 Author: thompsa Date: Wed Jan 13 03:16:31 2010 New Revision: 202181 URL: http://svn.freebsd.org/changeset/base/202181 Log: Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than using PPP over serial. uhsoctl(1) is used to initiate and close the WAN connection. Obtained from: Fredrik Lindberg Added: head/share/man/man4/uhso.4 (contents, props changed) head/sys/dev/usb/net/uhso.c (contents, props changed) head/sys/modules/usb/uhso/ head/sys/modules/usb/uhso/Makefile (contents, props changed) head/usr.sbin/uhsoctl/ head/usr.sbin/uhsoctl/Makefile (contents, props changed) head/usr.sbin/uhsoctl/uhsoctl.1 (contents, props changed) head/usr.sbin/uhsoctl/uhsoctl.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/usbdevs head/sys/modules/usb/Makefile head/usr.sbin/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Tue Jan 12 23:33:14 2010 (r202180) +++ head/share/man/man4/Makefile Wed Jan 13 03:16:31 2010 (r202181) @@ -424,6 +424,7 @@ MAN= aac.4 \ ugen.4 \ uhci.4 \ uhid.4 \ + uhso.4 \ uipaq.4 \ ukbd.4 \ ulpt.4 \ Added: head/share/man/man4/uhso.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/uhso.4 Wed Jan 13 03:16:31 2010 (r202181) @@ -0,0 +1,115 @@ +.\" Copyright (c) 2009 Fredrik Lindberg +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Aug 12, 2009 +.Os +.Dt UHSO 4 +.Sh NAME +.Nm hso +.Nd support for several HSxPA devices from Option N.V. +.Sh SYNOPSIS +The module can be loaded at boot time by placing the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +uhso_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for several HSxPA devices from Option N.V. that are +based on their packet interface. +Each device has a set of serial ports and a raw IP packet interface. +The serial ports of the device are accessed through the +.Xr ucom 4 +driver which makes them behave like a +.Xr tty 4 . +The packet interface is exposed as a network interface. +.Pp +To establish a connection on the packet interface the use of the proprietary +AT commands +.Dq Li AT_OWANCALL +and +.Dq Li AT_OWANDATA +are required on any of the serial ports. +.Pp +The network interface must be configured manually using the data obtain from +these calls. +.Pp +Each device usually have at least two or more serial ports, their individual purpose +can be identified through +.Xr sysctl 8 . +.Sh HARDWARE +The +.Nm +driver supports at least the following cards +.Pp +.Bl -bullet -compact +.It +Option GlobeSurfer iCON 7.2 (new firmware) +.It +Option iCON 225 +.El +.Pp +The device features a mass storage device referred to as +.Dq Zero-CD +which contains drivers for Microsoft Windows. +The driver automatically switches the device to modem mode. +.Sh EXAMPLES +Establishing a packet interface connection +.Bd -literal -offset indent +AT+CGDCONT=1,,"apn.provider" +AT_OWANCALL=1,1,1 +OK +_OWANCALL=1,1 + +AT_OWANDATA=1 +_OWANDATA: 1, 10.11.12.13, 0.0.0.0, 10.2.3.4, 10.2.3.5, \e + 0.0.0.0, 0.0.0.0, 72000 +.Ed +.Pp +Configuring the interface +.Bd -literal -offset indent +ifconfig uhso0 10.11.12.13 up +route add default -interface uhso0 +echo "nameserver 10.2.3.4" > /etc/resolv.conf +echo "nameserver 10.2.3.5" >> /etc/resolv.conf +.Ed +.Pp +The connection can be terminated with +.Bd -literal -offset indent +AT_OWANCALL=1,0,1 +.Ed +.Sh FILES +.Bl -tag -width "XXXXXX" +.It Pa /dev/cuaU?.? +.El +.Sh SEE ALSO +.Xr ucom 4 , +.Xr usb 4 +.Sh AUTHORS +The +.Nm +driver was written by +.An Fredrik Lindberg Aq fli@shapeshifter.se . Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Jan 12 23:33:14 2010 (r202180) +++ head/sys/conf/NOTES Wed Jan 13 03:16:31 2010 (r202181) @@ -2652,6 +2652,9 @@ device rue # # Davicom DM9601E USB to fast ethernet. Supports the Corega FEther USB-TXC. device udav +# +# HSxPA devices from Option N.V +device uhso # # Ralink Technology RT2501USB/RT2601USB wireless driver Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 12 23:33:14 2010 (r202180) +++ head/sys/conf/files Wed Jan 13 03:16:31 2010 (r202181) @@ -1676,7 +1676,7 @@ dev/usb/usb_request.c optional usb dev/usb/usb_transfer.c optional usb dev/usb/usb_util.c optional usb # -# USB ethernet drivers +# USB network drivers # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe @@ -1687,6 +1687,7 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | rue | \ udav +dev/usb/net/uhso.c optional uhso # # USB WLAN drivers # Added: head/sys/dev/usb/net/uhso.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/uhso.c Wed Jan 13 03:16:31 2010 (r202181) @@ -0,0 +1,1754 @@ +/*- + * Copyright (c) 2009 Fredrik Lindberg + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#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 "usbdevs.h" +#define USB_DEBUG_VAR uhso_debug +#include +#include +#include +#include +#include +#include + +struct uhso_tty { + struct uhso_softc *ht_sc; + struct usb_xfer *ht_xfer[3]; + int ht_muxport; + int ht_open; + char ht_name[32]; +}; + +struct uhso_softc { + device_t sc_dev; + struct usb_device *sc_udev; + struct mtx sc_mtx; + uint32_t sc_type; + + struct usb_xfer *sc_xfer[3]; + uint8_t sc_iface_no; + uint8_t sc_iface_index; + + /* Control pipe */ + struct usb_xfer * sc_ctrl_xfer[2]; + uint8_t sc_ctrl_iface_no; + + /* Network */ + struct usb_xfer *sc_if_xfer[2]; + struct ifnet *sc_ifp; + struct mbuf *sc_mwait; /* partial packet */ + size_t sc_waitlen; /* no. of outstanding bytes */ + struct ifqueue sc_rxq; + struct callout sc_c; + + /* TTY related structures */ + struct ucom_super_softc sc_super_ucom; + int sc_ttys; + struct uhso_tty *sc_tty; + struct ucom_softc *sc_ucom; + int sc_msr; + int sc_lsr; + int sc_line; +}; + + +#define UHSO_MAX_MTU 2048 + +/* + * There are mainly two type of cards floating around. + * The first one has 2,3 or 4 interfaces with a multiplexed serial port + * and packet interface on the first interface and bulk serial ports + * on the others. + * The second type of card has several other interfaces, their purpose + * can be detected during run-time. + */ +#define UHSO_IFACE_SPEC(usb_type, port, port_type) \ + (((usb_type) << 24) | ((port) << 16) | (port_type)) + +#define UHSO_IFACE_USB_TYPE(x) ((x >> 24) & 0xff) +#define UHSO_IFACE_PORT(x) ((x >> 16) & 0xff) +#define UHSO_IFACE_PORT_TYPE(x) (x & 0xff) + +/* + * USB interface types + */ +#define UHSO_IF_NET 0x01 /* Network packet interface */ +#define UHSO_IF_MUX 0x02 /* Multiplexed serial port */ +#define UHSO_IF_BULK 0x04 /* Bulk interface */ + +/* + * Port types + */ +#define UHSO_PORT_UNKNOWN 0x00 +#define UHSO_PORT_SERIAL 0x01 /* Serial port */ +#define UHSO_PORT_NETWORK 0x02 /* Network packet interface */ + +/* + * Multiplexed serial port destination sub-port names + */ +#define UHSO_MPORT_TYPE_CTL 0x00 /* Control port */ +#define UHSO_MPORT_TYPE_APP 0x01 /* Application */ +#define UHSO_MPORT_TYPE_PCSC 0x02 +#define UHSO_MPORT_TYPE_GPS 0x03 +#define UHSO_MPORT_TYPE_APP2 0x04 +#define UHSO_MPORT_TYPE_MAX UHSO_MPORT_TYPE_APP2 +#define UHSO_MPORT_TYPE_NOMAX 8 /* Max number of mux ports */ + +/* + * Port definitions + */ +#define UHSO_PORT_TYPE_CTL 0x01 +#define UHSO_PORT_TYPE_APP 0x02 +#define UHSO_PORT_TYPE_APP2 0x03 +#define UHSO_PORT_TYPE_MODEM 0x04 +#define UHSO_PORT_TYPE_NETWORK 0x05 +#define UHSO_PORT_TYPE_DIAG 0x06 +#define UHSO_PORT_TYPE_DIAG2 0x07 +#define UHSO_PORT_TYPE_GPS 0x08 +#define UHSO_PORT_TYPE_GPSCTL 0x09 +#define UHSO_PORT_TYPE_PCSC 0x0a +#define UHSO_PORT_TYPE_MSD 0x0b +#define UHSO_PORT_TYPE_VOICE 0x0c +#define UHSO_PORT_TYPE_MAX 0x0c + +static eventhandler_tag uhso_etag; + +/* Overall port type */ +static char *uhso_port[] = { + "Unknown", + "Serial", + "Network", + "Network/Serial" +}; + +/* Map between interface port type read from device and description type */ +static char uhso_port_map[] = { + 0, + UHSO_PORT_TYPE_DIAG, + UHSO_PORT_TYPE_GPS, + UHSO_PORT_TYPE_GPSCTL, + UHSO_PORT_TYPE_APP, + UHSO_PORT_TYPE_APP2, + UHSO_PORT_TYPE_CTL, + UHSO_PORT_TYPE_NETWORK, + UHSO_PORT_TYPE_MODEM, + UHSO_PORT_TYPE_MSD, + UHSO_PORT_TYPE_PCSC, + UHSO_PORT_TYPE_VOICE +}; +static char uhso_port_map_max = sizeof(uhso_port_map) / sizeof(char); + +static char uhso_mux_port_map[] = { + UHSO_PORT_TYPE_CTL, + UHSO_PORT_TYPE_APP, + UHSO_PORT_TYPE_PCSC, + UHSO_PORT_TYPE_GPS, + UHSO_PORT_TYPE_APP2 +}; + +static char *uhso_port_type[] = { + "Unknown", + "Control", + "Application", + "Application (Secondary)", + "Modem", + "Network", + "Diagnostic", + "Diagnostic (Secondary)", + "GPS", + "GPS Control", + "PC Smartcard", + "MSD", + "Voice", +}; + +static char *uhso_port_type_sysctl[] = { + "unknown", + "control", + "application", + "application", + "modem", + "network", + "diagnostic", + "diagnostic", + "gps", + "gps_control", + "pcsc", + "msd", + "voice", +}; + + +#define UHSO_STATIC_IFACE 0x01 +#define UHSO_AUTO_IFACE 0x02 + +static const struct usb_device_id uhso_devs[] = { +#define UHSO_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + /* Option GlobeSurfer iCON 7.2 */ + UHSO_DEV(OPTION, GSICON72, UHSO_STATIC_IFACE), + /* Option iCON 225 */ + UHSO_DEV(OPTION, GTHSDPA, UHSO_STATIC_IFACE), + /* Option GlobeSurfer iCON HSUPA */ + UHSO_DEV(OPTION, GSICONHSUPA, UHSO_STATIC_IFACE), + /* Option GlobeTrotter HSUPA */ + UHSO_DEV(OPTION, GTHSUPA, UHSO_STATIC_IFACE), + /* GE40x */ + UHSO_DEV(OPTION, GE40X, UHSO_AUTO_IFACE), + UHSO_DEV(OPTION, GE40X_1, UHSO_AUTO_IFACE), + UHSO_DEV(OPTION, GE40X_2, UHSO_AUTO_IFACE), + UHSO_DEV(OPTION, GE40X_3, UHSO_AUTO_IFACE), + /* Option GlobeSurfer iCON 401 */ + UHSO_DEV(OPTION, ICON401, UHSO_AUTO_IFACE), + /* Option GlobeTrotter Module 382 */ + UHSO_DEV(OPTION, GMT382, UHSO_AUTO_IFACE), + /* Option iCON EDGE */ + UHSO_DEV(OPTION, ICONEDGE, UHSO_STATIC_IFACE), + /* Option Module HSxPA */ + UHSO_DEV(OPTION, MODHSXPA, UHSO_STATIC_IFACE), + /* Option iCON 321 */ + UHSO_DEV(OPTION, ICON321, UHSO_STATIC_IFACE), + /* Option iCON 322 */ + UHSO_DEV(OPTION, GTICON322, UHSO_STATIC_IFACE) +#undef UHSO_DEV +}; + +SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); + +#ifdef USB_DEBUG +#ifdef UHSO_DEBUG +static int uhso_debug = UHSO_DEBUG; +#else +static int uhso_debug = -1; +#endif + +SYSCTL_INT(_hw_usb_uhso, OID_AUTO, debug, CTLFLAG_RW, + &uhso_debug, 0, "Debug level"); + +#define UHSO_DPRINTF(n, x, ...) {\ + if (uhso_debug >= n) {\ + printf("%s: " x, __func__, ##__VA_ARGS__);\ + }\ +} +#else +#define UHSO_DPRINTF(n, x, ...) +#endif + +#ifdef UHSO_DEBUG_HEXDUMP +# define UHSO_HEXDUMP(_buf, _len) do { \ + { \ + size_t __tmp; \ + const char *__buf = (const char *)_buf; \ + for (__tmp = 0; __tmp < _len; __tmp++) \ + printf("%02hhx ", *__buf++); \ + printf("\n"); \ + } \ +} while(0) +#else +# define UHSO_HEXDUMP(_buf, _len) +#endif + +enum { + UHSO_MUX_ENDPT_INTR = 0, + UHSO_MUX_ENDPT_MAX +}; + +enum { + UHSO_CTRL_READ = 0, + UHSO_CTRL_WRITE, + UHSO_CTRL_MAX +}; + +enum { + UHSO_IFNET_READ = 0, + UHSO_IFNET_WRITE, + UHSO_IFNET_MAX +}; + +enum { + UHSO_BULK_ENDPT_READ = 0, + UHSO_BULK_ENDPT_WRITE, + UHSO_BULK_ENDPT_INTR, + UHSO_BULK_ENDPT_MAX +}; + +static usb_callback_t uhso_mux_intr_callback; +static usb_callback_t uhso_mux_read_callback; +static usb_callback_t uhso_mux_write_callback; +static usb_callback_t uhso_bs_read_callback; +static usb_callback_t uhso_bs_write_callback; +static usb_callback_t uhso_bs_intr_callback; +static usb_callback_t uhso_ifnet_read_callback; +static usb_callback_t uhso_ifnet_write_callback; + +static const struct usb_config uhso_ctrl_config[UHSO_CTRL_MAX] = { + [UHSO_CTRL_READ] = { + .type = UE_CONTROL, + .endpoint = 0x00, + .direction = UE_DIR_ANY, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .bufsize = sizeof(struct usb_device_request) + 1024, + .callback = &uhso_mux_read_callback + }, + + [UHSO_CTRL_WRITE] = { + .type = UE_CONTROL, + .endpoint = 0x00, + .direction = UE_DIR_ANY, + .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .bufsize = sizeof(struct usb_device_request) + 1024, + .timeout = 1000, + .callback = &uhso_mux_write_callback + } +}; + +static const struct usb_config uhso_mux_config[UHSO_MUX_ENDPT_MAX] = { + [UHSO_MUX_ENDPT_INTR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .short_xfer_ok = 1 }, + .bufsize = 0, + .callback = &uhso_mux_intr_callback, + } +}; + +static const struct usb_config uhso_ifnet_config[UHSO_IFNET_MAX] = { + [UHSO_IFNET_READ] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .bufsize = MCLBYTES, + .callback = &uhso_ifnet_read_callback + }, + [UHSO_IFNET_WRITE] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .bufsize = MCLBYTES, + .timeout = 5 * USB_MS_HZ, + .callback = &uhso_ifnet_write_callback + } +}; + +static const struct usb_config uhso_bs_config[UHSO_BULK_ENDPT_MAX] = { + [UHSO_BULK_ENDPT_READ] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .pipe_bof = 1, .short_xfer_ok = 1 }, + .bufsize = 4096, + .callback = &uhso_bs_read_callback + }, + + [UHSO_BULK_ENDPT_WRITE] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = { .pipe_bof = 1, .force_short_xfer = 1 }, + .bufsize = 8192, + .callback = &uhso_bs_write_callback + }, + + [UHSO_BULK_ENDPT_INTR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .flags = { .short_xfer_ok = 1 }, + .bufsize = 0, + .callback = &uhso_bs_intr_callback, + } +}; + +static int uhso_probe_iface(struct uhso_softc *, int, + int (*probe)(struct uhso_softc *, int)); +static int uhso_probe_iface_auto(struct uhso_softc *, int); +static int uhso_probe_iface_static(struct uhso_softc *, int); + +static int uhso_attach_muxserial(struct uhso_softc *, struct usb_interface *, + int type); +static int uhso_attach_bulkserial(struct uhso_softc *, struct usb_interface *, + int type); +static int uhso_attach_ifnet(struct uhso_softc *, struct usb_interface *, + int type); +static void uhso_test_autoinst(void *, struct usb_device *, + struct usb_attach_arg *); +static int uhso_driver_loaded(struct module *, int, void *); + +static void uhso_ucom_start_read(struct ucom_softc *); +static void uhso_ucom_stop_read(struct ucom_softc *); +static void uhso_ucom_start_write(struct ucom_softc *); +static void uhso_ucom_stop_write(struct ucom_softc *); +static void uhso_ucom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); +static void uhso_ucom_cfg_set_dtr(struct ucom_softc *, uint8_t); +static void uhso_ucom_cfg_set_rts(struct ucom_softc *, uint8_t); + +static void uhso_if_init(void *); +static void uhso_if_start(struct ifnet *); +static void uhso_if_stop(struct uhso_softc *); +static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t); +static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, + struct route *); +static void uhso_if_rxflush(void *); + +static device_probe_t uhso_probe; +static device_attach_t uhso_attach; +static device_detach_t uhso_detach; + +static device_method_t uhso_methods[] = { + DEVMETHOD(device_probe, uhso_probe), + DEVMETHOD(device_attach, uhso_attach), + DEVMETHOD(device_detach, uhso_detach), + { 0, 0 } +}; + +static driver_t uhso_driver = { + "uhso", + uhso_methods, + sizeof(struct uhso_softc) +}; + +static devclass_t uhso_devclass; +DRIVER_MODULE(uhso, uhub, uhso_driver, uhso_devclass, uhso_driver_loaded, 0); +MODULE_DEPEND(uhso, ucom, 1, 1, 1); +MODULE_DEPEND(uhso, usb, 1, 1, 1); +MODULE_VERSION(uhso, 1); + +static struct ucom_callback uhso_ucom_callback = { + .ucom_cfg_get_status = &uhso_ucom_cfg_get_status, + .ucom_cfg_set_dtr = &uhso_ucom_cfg_set_dtr, + .ucom_cfg_set_rts = &uhso_ucom_cfg_set_rts, + .ucom_start_read = uhso_ucom_start_read, + .ucom_stop_read = uhso_ucom_stop_read, + .ucom_start_write = uhso_ucom_start_write, + .ucom_stop_write = uhso_ucom_stop_write +}; + +static int +uhso_probe(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != 0) + return (ENXIO); + if (uaa->device->ddesc.bDeviceClass != 0xff) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(uhso_devs, sizeof(uhso_devs), uaa)); +} + +static int +uhso_attach(device_t self) +{ + struct uhso_softc *sc = device_get_softc(self); + struct usb_attach_arg *uaa = device_get_ivars(self); + struct usb_config_descriptor *cd; + struct usb_interface_descriptor *id; + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; + struct sysctl_oid *tree, *tty_node; + struct ucom_softc *ucom; + struct uhso_tty *ht; + int i, error, port; + void *probe_f; + usb_error_t uerr; + char *desc; + + device_set_usb_desc(self); + + UHSO_DPRINTF(0, "Device is in modem mode, devClass=%x\n", + uaa->device->ddesc.bDeviceClass); + + sc->sc_dev = self; + sc->sc_udev = uaa->device; + mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF); + + sc->sc_ucom = NULL; + sc->sc_ttys = 0; + + cd = usbd_get_config_descriptor(uaa->device); + id = usbd_get_interface_descriptor(uaa->iface); + sc->sc_ctrl_iface_no = id->bInterfaceNumber; + + sc->sc_iface_no = uaa->info.bIfaceNum; + sc->sc_iface_index = uaa->info.bIfaceIndex; + + /* Setup control pipe */ + uerr = usbd_transfer_setup(uaa->device, + &sc->sc_iface_index, sc->sc_ctrl_xfer, + uhso_ctrl_config, UHSO_CTRL_MAX, sc, &sc->sc_mtx); + if (uerr) { + device_printf(self, "Failed to setup control pipe: %s\n", + usbd_errstr(uerr)); + goto out; + } + + if (USB_GET_DRIVER_INFO(uaa) == UHSO_STATIC_IFACE) + probe_f = uhso_probe_iface_static; + else if (USB_GET_DRIVER_INFO(uaa) == UHSO_AUTO_IFACE) + probe_f = uhso_probe_iface_auto; + else + goto out; + + error = uhso_probe_iface(sc, uaa->info.bIfaceNum, probe_f); + if (error != 0) + goto out; + + + sctx = device_get_sysctl_ctx(sc->sc_dev); + soid = device_get_sysctl_tree(sc->sc_dev); + + SYSCTL_ADD_STRING(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "type", + CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0, + "Port available at this interface"); + + if (sc->sc_ttys > 0) { + SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "ports", + CTLFLAG_RD, &sc->sc_ttys, 0, "Number of attached serial ports"); + + tree = SYSCTL_ADD_NODE(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, + "port", CTLFLAG_RD, NULL, "Serial ports"); + } + + for (i = 0; i < sc->sc_ttys; i++) { + ht = &sc->sc_tty[i]; + ucom = &sc->sc_ucom[i]; + + + if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) + port = uhso_mux_port_map[ht->ht_muxport]; + else + port = UHSO_IFACE_PORT_TYPE(sc->sc_type); + + desc = uhso_port_type_sysctl[port]; + + tty_node = SYSCTL_ADD_NODE(sctx, SYSCTL_CHILDREN(tree), OID_AUTO, + desc, CTLFLAG_RD, NULL, ""); + + ht->ht_name[0] = 0; + if (sc->sc_ttys == 1) + snprintf(ht->ht_name, 32, "cuaU%d", ucom->sc_unit); + else { + snprintf(ht->ht_name, 32, "cuaU%d.%d", + ucom->sc_unit - ucom->sc_local_unit, + ucom->sc_local_unit); + } + + desc = uhso_port_type[port]; + SYSCTL_ADD_STRING(sctx, SYSCTL_CHILDREN(tty_node), OID_AUTO, + "tty", CTLFLAG_RD, ht->ht_name, 0, ""); + SYSCTL_ADD_STRING(sctx, SYSCTL_CHILDREN(tty_node), OID_AUTO, + "desc", CTLFLAG_RD, desc, 0, ""); + + if (bootverbose) + device_printf(sc->sc_dev, + "\"%s\" port at %s\n", desc, ht->ht_name); + } + + return (0); +out: + uhso_detach(sc->sc_dev); + return (ENXIO); + +} + +static int +uhso_detach(device_t self) +{ + struct uhso_softc *sc = device_get_softc(self); + int i; + + usbd_transfer_unsetup(sc->sc_xfer, 3); + usbd_transfer_unsetup(sc->sc_ctrl_xfer, UHSO_CTRL_MAX); + if (sc->sc_ttys > 0) { + ucom_detach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_ttys); + + for (i = 0; i < sc->sc_ttys; i++) { + if (sc->sc_tty[i].ht_muxport != -1) { + usbd_transfer_unsetup(sc->sc_tty[i].ht_xfer, + UHSO_CTRL_MAX); + } + } + + free(sc->sc_tty, M_USBDEV); + free(sc->sc_ucom, M_USBDEV); + } + + if (sc->sc_ifp != NULL) { + + callout_drain(&sc->sc_c); + + mtx_lock(&sc->sc_mtx); + uhso_if_stop(sc); + bpfdetach(sc->sc_ifp); + if_detach(sc->sc_ifp); + if_free(sc->sc_ifp); + mtx_unlock(&sc->sc_mtx); + + usbd_transfer_unsetup(sc->sc_if_xfer, UHSO_IFNET_MAX); + } + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +uhso_test_autoinst(void *arg, struct usb_device *udev, + struct usb_attach_arg *uaa) +{ + struct usb_interface *iface; + struct usb_interface_descriptor *id; + + if (uaa->dev_state != UAA_DEV_READY) + return; + + iface = usbd_get_iface(udev, 0); + if (iface == NULL) + return; + id = iface->idesc; + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return; + if (usbd_lookup_id_by_uaa(uhso_devs, sizeof(uhso_devs), uaa)) + return; /* no device match */ + + if (usb_msc_eject(udev, 0, MSC_EJECT_REZERO) == 0) { + /* success, mark the udev as disappearing */ + uaa->dev_state = UAA_DEV_EJECTING; + } +} + +static int +uhso_driver_loaded(struct module *mod, int what, void *arg) +{ + switch (what) { + case MOD_LOAD: + /* register our autoinstall handler */ + uhso_etag = EVENTHANDLER_REGISTER(usb_dev_configured, + uhso_test_autoinst, NULL, EVENTHANDLER_PRI_ANY); + break; + case MOD_UNLOAD: + EVENTHANDLER_DEREGISTER(usb_dev_configured, uhso_etag); + break; + default: + return (EOPNOTSUPP); + } + return (0); +} + +static int uhso_probe_iface_auto(struct uhso_softc *sc, int index) +{ + struct usb_device_request req; + usb_error_t uerr; + uint16_t actlen = 0; + char port; + char buf[17] = {0}; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = 0x86; + USETW(req.wValue, 0); + USETW(req.wIndex, 0); + USETW(req.wLength, 17); + + uerr = usbd_do_request_flags(sc->sc_udev, NULL, &req, buf, + 0, &actlen, USB_MS_HZ); + if (uerr != 0) { + device_printf(sc->sc_dev, "usbd_do_request_flags failed: %s\n", + usbd_errstr(uerr)); + return (0); + } + + UHSO_DPRINTF(3, "actlen=%d\n", actlen); + UHSO_HEXDUMP(buf, 17); + + if (index < 0 || index > 16) { + UHSO_DPRINTF(0, "Index %d out of range\n", index); + return (0); + } + + UHSO_DPRINTF(3, "index=%d, type=%x\n", index, buf[index]); + + if (buf[index] >= uhso_port_map_max) + port = 0; + else + port = uhso_port_map[(int)buf[index]]; + + if (port == UHSO_PORT_TYPE_NETWORK) + return (UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_NETWORK, port)); + else if (port == UHSO_PORT_TYPE_VOICE) + return (0); + else + return (UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, port)); + + return (0); +} + +static int +uhso_probe_iface_static(struct uhso_softc *sc, int index) +{ + struct usb_config_descriptor *cd; + + cd = usbd_get_config_descriptor(sc->sc_udev); + if (cd->bNumInterface <= 3) { + switch (index) { + case 0: + return UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, + UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, 0); + case 1: + return UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, UHSO_PORT_TYPE_DIAG); + case 2: + return UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, UHSO_PORT_TYPE_MODEM); + } + } + else { + switch (index) { + case 0: + return UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, + UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, 0); + case 1: + return UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, UHSO_PORT_TYPE_DIAG2); + case 2: + return UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, UHSO_PORT_TYPE_MODEM); + case 3: + return UHSO_IFACE_SPEC(UHSO_IF_BULK, + UHSO_PORT_SERIAL, UHSO_PORT_TYPE_DIAG); + } + } + return (0); +} + +static int +uhso_probe_iface(struct uhso_softc *sc, int index, + int (*probe)(struct uhso_softc *, int)) +{ + struct usb_interface *iface; + int type, error, error0; + + UHSO_DPRINTF(1, "Probing for interface %d, cb=%p\n", index, probe); + + type = probe(sc, index); + UHSO_DPRINTF(1, "Probe result %x\n", type); + if (type <= 0) + return (ENXIO); + + sc->sc_type = type; + iface = usbd_get_iface(sc->sc_udev, index); + + if (UHSO_IFACE_USB_TYPE(type) & (UHSO_IF_MUX | UHSO_IF_NET)) { + error0 = uhso_attach_muxserial(sc, iface, type); + error = uhso_attach_ifnet(sc, iface, type); + + if (error0 && error) + return (ENXIO); + + if (sc->sc_ttys > 0) { + error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, + sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); + if (error) { + device_printf(sc->sc_dev, "ucom_attach failed\n"); + return (ENXIO); + } + } + + mtx_lock(&sc->sc_mtx); + usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); + mtx_unlock(&sc->sc_mtx); + } + else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && + UHSO_IFACE_PORT(type) & UHSO_PORT_SERIAL) { + + error = uhso_attach_bulkserial(sc, iface, type); + if (error) + return (ENXIO); + + error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, + sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); + if (error) { + device_printf(sc->sc_dev, "ucom_attach failed\n"); + return (ENXIO); + } + } + else { + return (ENXIO); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 04:20:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9399A1065695; Wed, 13 Jan 2010 04:20:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 26BA68FC23; Wed, 13 Jan 2010 04:20:32 +0000 (UTC) Received: from c122-106-161-214.carlnfd1.nsw.optusnet.com.au (c122-106-161-214.carlnfd1.nsw.optusnet.com.au [122.106.161.214]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0D4KTiV020895 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jan 2010 15:20:30 +1100 Date: Wed, 13 Jan 2010 15:20:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Brooks Davis In-Reply-To: <201001120749.o0C7nZ7j019654@svn.freebsd.org> Message-ID: <20100113140806.O61578@delplex.bde.org> References: <201001120749.o0C7nZ7j019654@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: r202143 - in head/sys: boot/forth compat/linux compat/svr4 i386/ibcs2 kern rpc security/audit sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 04:20:33 -0000 On Tue, 12 Jan 2010, Brooks Davis wrote: > Log: > Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic > kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to > INT_MAX-1. Given that the Windows group limit is 1024, this range > should be sufficient for most applications. INT_MAX-1 is a bogus limit, since many overflows still occur long before that limit is reached. > Modified: head/sys/compat/linux/linux_misc.c > ============================================================================== > --- head/sys/compat/linux/linux_misc.c Tue Jan 12 07:40:58 2010 (r202142) > +++ head/sys/compat/linux/linux_misc.c Tue Jan 12 07:49:34 2010 (r202143) > @@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struc > struct proc *p; > > ngrp = args->gidsetsize; > - if (ngrp < 0 || ngrp >= NGROUPS) > + if (ngrp < 0 || ngrp > ngroups_max) > return (EINVAL); This seems to have an off-by-1 error, since elsewhere ngrps can be ngroups_max + 1. > linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); > error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); > > Modified: head/sys/compat/linux/linux_uid16.c > ============================================================================== > --- head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:40:58 2010 (r202142) > +++ head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:49:34 2010 (r202143) > @@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, str > #endif > > ngrp = args->gidsetsize; > - if (ngrp < 0 || ngrp >= NGROUPS) > + if (ngrp < 0 || ngrp > ngroups_max) > return (EINVAL); > linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); > error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); Here the multiplication overflows on 32-bit machines when ngroups_max is only about INT_MAX/2. The overflow when ngroups_max equals its bogus limit (INT_MAX - 1) can occur even if no more than 16 groups are ever allocated, since the user can pass in a proposterously large ngrp in places like here. The behaviour is then undefined. In most cases the overflow gives a value so large that the malloc() should fail, but it's an M_WAITOK malloc so it must hang or panic. The overflow can also be to a small value (e.g., 0x40000001 * (size_t)4 = 4. Then the malloc() should succeed, and it is possible for the user buffer to have 1 element although not 0x40000001, so the copyin() and the syscall will succeed too, but the syscall should fail. Even a not so large value of ngroups_max like INT_MAX/2 gives an effectively-unbounded malloc() service. Similarly for other setgroups(), except overflow occurs at INT_MAX/4 with 32-bit gid_t. > Modified: head/sys/kern/kern_prot.c > ============================================================================== > --- head/sys/kern/kern_prot.c Tue Jan 12 07:40:58 2010 (r202142) > +++ head/sys/kern/kern_prot.c Tue Jan 12 07:49:34 2010 (r202143) > @@ -283,7 +283,7 @@ getgroups(struct thread *td, register st > u_int ngrp; > int error; > > - ngrp = MIN(uap->gidsetsize, NGROUPS); > + ngrp = MIN(uap->gidsetsize, ngroups_max + 1); > groups = malloc(ngrp * sizeof(*groups), M_TEMP, M_WAITOK); > error = kern_getgroups(td, &ngrp, groups); > if (error) Use of the MIN() and MAX() macros in the kernel are style bugs. They were removed in 4.4BSD and brought back by FreeBSD. It is a shame to see them used even in kern. Large ngroups_max gives an unbounded malloc() service via getgroups() too. Here the user can pass in an enormous uap->gidsetsize and have it all malloced, subject only to the ngroups_max limit, despite kern_ngroups() only using an array of size precisely cred->cr_ngroups elements. The malloc() is also wasteful (unused) when uap->gidsetsize < cred->cr_ngroups. kern_getgroups() API gets in the way of cleaning this up. > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Tue Jan 12 07:40:58 2010 (r202142) > +++ head/sys/kern/subr_param.c Tue Jan 12 07:49:34 2010 (r202143) > @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); > #include "opt_param.h" > #include "opt_maxusers.h" > > +#include > #include > #include > #include Style bug (unsorting). > @@ -228,6 +230,18 @@ init_param1(void) > TUNABLE_ULONG_FETCH("kern.maxssiz", &maxssiz); > sgrowsiz = SGROWSIZ; > TUNABLE_ULONG_FETCH("kern.sgrowsiz", &sgrowsiz); > + > + /* > + * Let the administrator set {NGROUPS_MAX}, but disallow values > + * less than NGROUPS_MAX which would violate POSIX.1-2008 or > + * greater than INT_MAX-1 which would result in overflow. > + */ > + ngroups_max = NGROUPS_MAX; > + TUNABLE_INT_FETCH("kern.ngroups", &ngroups_max); > + if (ngroups_max < NGROUPS_MAX) > + ngroups_max = NGROUPS_MAX; > + if (ngroups_max > INT_MAX - 1) > + ngroups_max = INT_MAX - 1; > } Limiting parameters is a waste of time and space, especially when it doesn't work. Anyone wanting an unusuable system can easily get it by misconfiguring one of the many unlimited parameters, or by selecting a combination of parameters that requires too man resources to work. It is very difficult to limit all combinations of parameters without excessively limiting individual parameters. Here we could impose some arbitrary reasonable limit like 64K, but that wouldn't do anything except annoy users wanting to test or even use > 64K. A much larger arbitrary limit like 1M wouldn't provide much protection against the unbounded malloc() service, at least when it is unprivileged. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 08:53:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C951A1065672; Wed, 13 Jan 2010 08:53:23 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B648FC17; Wed, 13 Jan 2010 08:53: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 o0D8rNvT056532; Wed, 13 Jan 2010 08:53:23 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0D8rN5R056530; Wed, 13 Jan 2010 08:53:23 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001130853.o0D8rN5R056530@svn.freebsd.org> From: David Xu Date: Wed, 13 Jan 2010 08:53: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: r202185 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 08:53:23 -0000 Author: davidxu Date: Wed Jan 13 08:53:23 2010 New Revision: 202185 URL: http://svn.freebsd.org/changeset/base/202185 Log: Return SEM_FAILED instead of NULL, though there are same, but the SEM_FAILED is more suitable name. In function, sem_close(), always set errno on error. Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Wed Jan 13 08:21:19 2010 (r202184) +++ head/lib/libc/gen/sem_new.c Wed Jan 13 08:53:23 2010 (r202185) @@ -147,13 +147,13 @@ _sem_open(const char *name, int flags, . if (name[0] != '/') { errno = EINVAL; - return (NULL); + return (SEM_FAILED); } name++; if (flags & ~(O_CREAT|O_EXCL)) { errno = EINVAL; - return (NULL); + return (SEM_FAILED); } _pthread_once(&once, sem_module_init); @@ -275,6 +275,7 @@ _sem_close(sem_t *sem) return (0); } _pthread_mutex_unlock(&sem_llock); + errno = EINVAL; return (-1); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 14:17:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A1811065670; Wed, 13 Jan 2010 14:17:22 +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 28D128FC18; Wed, 13 Jan 2010 14:17: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 o0DEHM08030885; Wed, 13 Jan 2010 14:17:22 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DEHMUc030882; Wed, 13 Jan 2010 14:17:22 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201001131417.o0DEHMUc030882@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 13 Jan 2010 14:17: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: r202187 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 14:17:22 -0000 Author: jh Date: Wed Jan 13 14:17:21 2010 New Revision: 202187 URL: http://svn.freebsd.org/changeset/base/202187 Log: - Fix some style bugs in tmpfs_mount(). [1] - Remove a stale comment about tmpfs_mem_info() 'total' argument. Reported by: bde [1] Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Wed Jan 13 12:21:58 2010 (r202186) +++ head/sys/fs/tmpfs/tmpfs.h Wed Jan 13 14:17:21 2010 (r202187) @@ -493,10 +493,6 @@ int tmpfs_truncate(struct vnode *, off_t * Returns information about the number of available memory pages, * including physical and virtual ones. * - * If 'total' is TRUE, the value returned is the total amount of memory - * pages configured for the system (either in use or free). - * If it is FALSE, the value returned is the amount of free memory pages. - * * Remember to remove TMPFS_PAGES_RESERVED from the returned value to avoid * excessive memory usage. * Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Jan 13 12:21:58 2010 (r202186) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Jan 13 14:17:21 2010 (r202187) @@ -185,15 +185,15 @@ tmpfs_mount(struct mount *mp) ino_t nodes; int error; /* Size counters. */ - ino_t nodes_max; - u_quad_t size_max; + ino_t nodes_max; + u_quad_t size_max; /* Root node attributes. */ - uid_t root_uid; - gid_t root_gid; - mode_t root_mode; + uid_t root_uid; + gid_t root_gid; + mode_t root_mode; - struct vattr va; + struct vattr va; if (vfs_filteropt(mp->mnt_optnew, tmpfs_opts)) return (EINVAL); @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) + if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE) pages = SIZE_MAX; else pages = howmany(size_max, PAGE_SIZE); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 14:22:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F3B41065676; Wed, 13 Jan 2010 14:22:04 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 3E01F8FC18; Wed, 13 Jan 2010 14:22:04 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id F05E013994B; Wed, 13 Jan 2010 16:21:59 +0200 (EET) Date: Wed, 13 Jan 2010 16:21:59 +0200 From: Jaakko Heinonen To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100113142159.GA3044@a91-153-117-195.elisa-laajakaista.fi> References: <201001131417.o0DEHMUc030882@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001131417.o0DEHMUc030882@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r202187 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 14:22:04 -0000 On 2010-01-13, Jaakko Heinonen wrote: > Author: jh > Date: Wed Jan 13 14:17:21 2010 > New Revision: 202187 > URL: http://svn.freebsd.org/changeset/base/202187 > > Log: > - Fix some style bugs in tmpfs_mount(). [1] > - Remove a stale comment about tmpfs_mem_info() 'total' argument. > > Reported by: bde [1] Approved by: trasz (mentor) -- Jaakko From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 16:05:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D7AC106568B; Wed, 13 Jan 2010 16:05:35 +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 59B958FC1C; Wed, 13 Jan 2010 16:05:35 +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 DAD3746B39; Wed, 13 Jan 2010 11:05:34 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2E9A98A01F; Wed, 13 Jan 2010 11:05:22 -0500 (EST) From: John Baldwin To: Doug Barton Date: Wed, 13 Jan 2010 08:44:21 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091231; KDE/4.3.1; amd64; ; ) References: <201001101744.o0AHiM2d095302@svn.freebsd.org> <20100110.210204.787670930858346133.imp@bsdimp.com> <4B4D109A.5060500@FreeBSD.org> In-Reply-To: <4B4D109A.5060500@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001130844.21241.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 13 Jan 2010 11:05:22 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 16:05:35 -0000 On Tuesday 12 January 2010 7:15:22 pm Doug Barton wrote: > On 1/10/2010 8:02 PM, M. Warner Losh wrote: > > In message: > > Doug Barton writes: > > : On Sun, 10 Jan 2010, Warner Losh wrote: > > : > > : > Author: imp > > : > Date: Sun Jan 10 17:44:22 2010 > > : > New Revision: 202019 > > : > URL: http://svn.freebsd.org/changeset/base/202019 > > : > > > : > Log: > > : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. > > : > > : Thanks for doing this, however the comment about how to include the > > : whole file (including the comments) were not included. Do I need to do > > : this part of it myself? No problem if so, I just want to be sure to > > : get it done in time to MFC it before the freeze for 7.3-release. > > > > In general, we don't put big comments like that in the config files, > > preferring to leave them to NOTES. I was just following that > > convention... > > Understood, however given that there is plenty of room for confusion on > this point because the default is NOT to include the comments I think > that some explanation is justified. My original text was: > > # Store the plain version of the configuration file in the kernel itself. > # To store the entire file, including comments, put this in /etc/src.conf: > # CONFIGARGS= -C > # See config(8) for more details. Just put this in sys/conf/NOTES. Users already know to look in NOTES for further details about kernel options. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 16:24:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732561065692; Wed, 13 Jan 2010 16:24:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 21D868FC1E; Wed, 13 Jan 2010 16:24:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0DGIHht092123; Wed, 13 Jan 2010 09:18:17 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 13 Jan 2010 09:19:13 -0700 (MST) Message-Id: <20100113.091913.1023414010414027273.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <201001130844.21241.jhb@freebsd.org> References: <20100110.210204.787670930858346133.imp@bsdimp.com> <4B4D109A.5060500@FreeBSD.org> <201001130844.21241.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 16:24:06 -0000 In message: <201001130844.21241.jhb@freebsd.org> John Baldwin writes: : On Tuesday 12 January 2010 7:15:22 pm Doug Barton wrote: : > On 1/10/2010 8:02 PM, M. Warner Losh wrote: : > > In message: : > > Doug Barton writes: : > > : On Sun, 10 Jan 2010, Warner Losh wrote: : > > : : > > : > Author: imp : > > : > Date: Sun Jan 10 17:44:22 2010 : > > : > New Revision: 202019 : > > : > URL: http://svn.freebsd.org/changeset/base/202019 : > > : > : > > : > Log: : > > : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. : > > : : > > : Thanks for doing this, however the comment about how to include the : > > : whole file (including the comments) were not included. Do I need to do : > > : this part of it myself? No problem if so, I just want to be sure to : > > : get it done in time to MFC it before the freeze for 7.3-release. : > > : > > In general, we don't put big comments like that in the config files, : > > preferring to leave them to NOTES. I was just following that : > > convention... : > : > Understood, however given that there is plenty of room for confusion on : > this point because the default is NOT to include the comments I think : > that some explanation is justified. My original text was: : > : > # Store the plain version of the configuration file in the kernel itself. : > # To store the entire file, including comments, put this in /etc/src.conf: : > # CONFIGARGS= -C : > # See config(8) for more details. : : Just put this in sys/conf/NOTES. Users already know to look in NOTES for : further details about kernel options. This exact comment already is in NOTES. Warner From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:29:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E156106566C; Wed, 13 Jan 2010 17:29:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF5D58FC14; Wed, 13 Jan 2010 17: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 o0DHTt6j073333; Wed, 13 Jan 2010 17:29:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHTt0M073326; Wed, 13 Jan 2010 17:29:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131729.o0DHTt0M073326@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17: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: r202188 - in head: include lib/libc/gen lib/libulog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:29:56 -0000 Author: ed Date: Wed Jan 13 17:29:55 2010 New Revision: 202188 URL: http://svn.freebsd.org/changeset/base/202188 Log: Implement . The utmpx interface is the standardized interface of the user accounting database. The standard only defines a subset of the functions that were present in System V-like systems. I'd like to highlight some of the traits my implementation has: - The standard allows the on-disk format to be different than the in-memory representation (struct utmpx). Most operating systems don't do this, but we do. This allows us to keep our ABI more stable, while giving us the opportunity to modify the on-disk format. It also allows us to use a common file format across different architectures (i.e. byte ordering). - Our implementation of pututxline() also updates wtmp and lastlog (now called utx.log and utx.lastlogin). This means the databases are more likely to be in sync. - Care must be taken that our implementation discard any fields that are not applicable. For example, our DEAD_PROCESS records do not hold a TTY name. Just a time stamp, a record identifier and a process identifier. It also guarantees that strings (ut_host, ut_line and ut_user) are null terminated. ut_id is obviously not null terminated, because it's not a string. - The API and its behaviour should be conformant to POSIX, but there may be things that slightly deviate from the standard. This implementation uses separate file descriptors when writing to the log files. It also doesn't use getutxid() to search for a field to overwrite. It uses an allocation strategy similar to getutxid(), but prevents DEAD_PROCESS records from accumulating. Make sure libulog doesn't overwrite the manpages shipped with our C library. Also keep the symbol list in Symbol.map sorted. I'll bump __FreeBSD_version later this evening. I first want to convert everything to and get rid of . Added: head/include/utmpx.h (contents, props changed) head/lib/libc/gen/getutxent.3 (contents, props changed) head/lib/libc/gen/getutxent.c (contents, props changed) head/lib/libc/gen/pututxline.c (contents, props changed) head/lib/libc/gen/utxdb.c (contents, props changed) head/lib/libc/gen/utxdb.h (contents, props changed) Modified: head/include/Makefile head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libulog/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Wed Jan 13 14:17:21 2010 (r202187) +++ head/include/Makefile Wed Jan 13 17:29:55 2010 (r202188) @@ -23,8 +23,8 @@ INCS= a.out.h ar.h assert.h bitstring.h stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ - ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ - wctype.h wordexp.h + ulimit.h unistd.h utime.h utmp.h utmpx.h uuid.h varargs.h vis.h \ + wchar.h wctype.h wordexp.h MHDRS= float.h floatingpoint.h stdarg.h Added: head/include/utmpx.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/utmpx.h Wed Jan 13 17:29:55 2010 (r202188) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2010 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _UTMPX_H_ +#define _UTMPX_H_ + +#include +#include +#include + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +struct utmpx { + short ut_type; /* Type of entry. */ + struct timeval ut_tv; /* Time entry was made. */ + char ut_id[8]; /* Record identifier. */ + pid_t ut_pid; /* Process ID. */ + char ut_user[32]; /* User login name. */ + char ut_line[16]; /* Device name. */ +#if __BSD_VISIBLE + char ut_host[128]; /* Remote hostname. */ +#else + char __ut_host[128]; +#endif + char __ut_spare[64]; +}; + +#define EMPTY 0 /* No valid user accounting information. */ +#define BOOT_TIME 1 /* Time of system boot. */ +#define OLD_TIME 2 /* Time when system clock changed. */ +#define NEW_TIME 3 /* Time after system clock changed. */ +#define USER_PROCESS 4 /* A process. */ +#define INIT_PROCESS 5 /* A process spawned by the init process. */ +#define LOGIN_PROCESS 6 /* The session leader of a logged-in user. */ +#define DEAD_PROCESS 7 /* A session leader who has exited. */ +#if __BSD_VISIBLE +#define SHUTDOWN_TIME 8 /* Time of system shutdown. */ +#endif + +#if __BSD_VISIBLE +#define UTXDB_ACTIVE 0 /* Active login sessions. */ +#define UTXDB_LASTLOGIN 1 /* Last login sessions. */ +#define UTXDB_LOG 2 /* Log indexed by time. */ +#endif + +__BEGIN_DECLS +void endutxent(void); +struct utmpx *getutxent(void); +struct utmpx *getutxid(const struct utmpx *); +struct utmpx *getutxline(const struct utmpx *); +struct utmpx *pututxline(const struct utmpx *); +void setutxent(void); + +#if __BSD_VISIBLE +struct utmpx *getutxuser(const char *); +int setutxdb(int, const char *); +#endif +__END_DECLS + +#endif /* !_UTMPX_H_ */ Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Wed Jan 13 14:17:21 2010 (r202187) +++ head/lib/libc/gen/Makefile.inc Wed Jan 13 17:29:55 2010 (r202188) @@ -18,12 +18,12 @@ SRCS+= __getosreldate.c __xuname.c \ gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \ getosreldate.c getpagesize.c getpagesizes.c \ getpeereid.c getprogname.c getpwent.c getttyent.c \ - getusershell.c getvfsbyname.c glob.c \ + getusershell.c getutxent.c getvfsbyname.c glob.c \ initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c nftw.c nice.c \ nlist.c nrand48.c opendir.c \ pause.c pmadvise.c popen.c posix_spawn.c \ - psignal.c pw_scan.c pwcache.c \ + psignal.c pututxline.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ scandir.c seed48.c seekdir.c sem.c sem_new.c semctl.c \ setdomainname.c sethostname.c setjmperr.c setmode.c \ @@ -32,7 +32,7 @@ SRCS+= __getosreldate.c __xuname.c \ sysconf.c sysctl.c sysctlbyname.c sysctlnametomib.c \ syslog.c telldir.c termios.c time.c times.c timezone.c tls.c \ ttyname.c ttyslot.c ualarm.c ulimit.c uname.c unvis.c \ - usleep.c utime.c valloc.c vis.c wait.c wait3.c waitpid.c \ + usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \ wordexp.c SYM_MAPS+=${.CURDIR}/gen/Symbol.map @@ -54,7 +54,7 @@ MAN+= alarm.3 arc4random.3 \ getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \ getmntinfo.3 getnetgrent.3 getosreldate.3 getpagesize.3 \ getpagesizes.3 getpass.3 getpeereid.3 getprogname.3 getpwent.3 \ - getttyent.3 getusershell.3 getvfsbyname.3 \ + getttyent.3 getusershell.3 getutxent.3 getvfsbyname.3 \ glob.3 initgroups.3 isgreater.3 ldexp.3 lockf.3 makecontext.3 \ modf.3 \ nice.3 nlist.3 pause.3 popen.3 \ @@ -126,6 +126,10 @@ MLINKS+=getttyent.3 endttyent.3 getttyen getttyent.3 isdialuptty.3 getttyent.3 isnettty.3 \ getttyent.3 setttyent.3 MLINKS+=getusershell.3 endusershell.3 getusershell.3 setusershell.3 +MLINKS+=getutxent.3 endutxent.3 getutxent.3 getutxid.3 \ + getutxent.3 getutxline.3 getutxent.3 getutxuser.3 \ + getutxent.3 pututxline.3 getutxent.3 setutxdb.3 \ + getutxent.3 setutxent.3 MLINKS+=glob.3 globfree.3 MLINKS+=isgreater.3 isgreaterequal.3 isgreater.3 isless.3 \ isgreater.3 islessequal.3 isgreater.3 islessgreater.3 \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Jan 13 14:17:21 2010 (r202187) +++ head/lib/libc/gen/Symbol.map Wed Jan 13 17:29:55 2010 (r202188) @@ -359,17 +359,25 @@ FBSD_1.1 { FBSD_1.2 { basename_r; + endutxent; getpagesizes; + getutxent; + getutxid; + getutxline; + getutxuser; + pututxline; sem_close; sem_destroy; sem_getvalue; sem_init; sem_open; + sem_post; sem_timedwait; sem_trywait; - sem_post; - sem_wait; sem_unlink; + sem_wait; + setutxdb; + setutxent; }; FBSDprivate_1.0 { Added: head/lib/libc/gen/getutxent.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/getutxent.3 Wed Jan 13 17:29:55 2010 (r202188) @@ -0,0 +1,440 @@ +.\" Copyright (c) 2010 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 8, 2010 +.Os +.Dt GETUTXENT 3 +.Sh NAME +.Nm endutxent , +.Nm getutxent , +.Nm getutxid , +.Nm getutxline , +.Nm getutxuser , +.Nm pututxline , +.Nm setutxdb , +.Nm setutxent +.Nd user accounting database functions +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In utmpx.h +.Ft void +.Fn endutxent "void" +.Ft struct utmpx * +.Fn getutxent "void" +.Ft struct utmpx * +.Fn getutxid "const struct utmpx *id" +.Ft struct utmpx * +.Fn getutxline "const struct utmpx *line" +.Ft struct utmpx * +.Fn getutxuser "const char *user" +.Ft struct utmpx * +.Fn pututxline "const struct utmpx *utmpx" +.Ft int +.Fn setutxdb "int type" "const char *file" +.Ft void +.Fn setutxent "void" +.Sh DESCRIPTION +These functions operate on the user accounting database which stores +records of various system activities, such as user login and logouts, +but also system startups and shutdowns and modifications to the system's +clock. +The system stores these records in three databases, each having a +different purpose: +.Bl -tag -width indent +.It Pa /var/run/utx.active +Log of currently active user login sessions. +This file is similar to the traditional +.Pa utmp +file. +This file only contains process related entries, such as user login and +logout records. +.It Pa /var/log/utx.lastlogin +Log of last user login entries per user. +This file is similar to the traditional +.Pa lastlog +file. +This file only contains user login records for users who have at least +logged in once. +.It Pa /var/log/utx.log +Log of all entries, sorted by date of addition. +This file is similar to the traditional +.Pa wtmp +file. +This file may contain any type of record described below. +.El +.Pp +Each entry in these databases is defined by the structure +.Vt utmpx +found in the include file +.In utmpx.h : +.Bd -literal -offset indent +struct utmpx { + short ut_type; /* Type of entry. */ + struct timeval ut_tv; /* Time entry was made. */ + char ut_id[]; /* Record identifier. */ + pid_t ut_pid; /* Process ID. */ + char ut_user[]; /* User login name. */ + char ut_line[]; /* Device name. */ + char ut_host[]; /* Remote hostname. */ +}; +.Ed +.Pp +The +.Fa ut_type +field indicates the type of the log entry, which can have one of the +following values: +.Bl -tag -width LOGIN_PROCESS +.It Dv EMPTY +No valid user accounting information. +.It Dv BOOT_TIME +Identifies time of system boot. +.It Dv SHUTDOWN_TIME +Identifies time of system shutdown. +.It Dv OLD_TIME +Identifies time when system clock changed. +.It Dv NEW_TIME +Identifies time after system clock changed. +.It Dv USER_PROCESS +Identifies a process. +.It Dv INIT_PROCESS +Identifies a process spawned by the init process. +.It Dv LOGIN_PROCESS +Identifies the session leader of a logged-in user. +.It Dv DEAD_PROCESS +Identifies a session leader who has exited. +.El +.Pp +Entries of type +.Dv INIT_PROCESS +and +.Dv LOGIN_PROCESS +are not processed by this implementation. +.Pp +Other fields inside the structure are: +.Bl -tag -width ut_user +.It Fa ut_tv +The time the event occured. +This field is used for all types of entries. +.It Fa ut_id +An identifier that is used to refer to the entry. +This identifier can be used to remove or replace a login entry by +writing a new entry to the database containing the same value for +.Fa ut_id . +This field is only applicable to entries of type +.Dv USER_PROCESS , +.Dv INIT_PROCESS , +.Dv LOGIN_PROCESS +and +.Dv DEAD_PROCESS . +.It Fa ut_pid +The process identifier of the session leader of the login session. +This field is only applicable to entries of type +.Dv USER_PROCESS , +.Dv INIT_PROCESS , +.Dv LOGIN_PROCESS +and +.Dv DEAD_PROCESS . +.It Fa ut_user +The user login name corresponding with the login session. +This field is only applicable to entries of type +.Dv USER_PROCESS +and +.Dv INIT_PROCESS . +For +.Dv INIT_PROCESS +entries this entry typically contains the name of the login process. +.It Fa ut_line +The name of the TTY character device, without the leading +.Pa /dev/ +prefix, corresponding with the device used to facilitate the user login +session. +If no TTY character device is used, this field is left blank. +This field is only applicable to entries of type +.Dv USER_PROCESS . +.It Fa ut_host +The network hostname of the remote system, connecting to perform a user +login. +If the user login session is not performed across a network, this field +is left blank. +This field is only applicable to entries of type +.Dv USER_PROCESS . +.El +.Pp +This implementation guarantees all inapplicable fields are discarded. +The +.Fa ut_user , +.Fa ut_line +and +.Fa ut_host +fields of the structure returned by the library functions are also +guaranteed to be null-terminated in this implementation. +.Pp +The +.Fn getutxent +function can be used to read the next entry from the user accounting +database. +.Pp +The +.Fn getutxid +function searches for the next entry in the database of which the +behaviour is based on the +.Fa ut_type +field of +.Fa id . +If +.Fa ut_type +has a value of +.Dv BOOT_TIME , +.Dv SHUTDOWN_TIME , +.Dv OLD_TIME +or +.Dv NEW_TIME , +it will return the next entry whose +.Fa ut_type +has an equal value. +If +.Fa ut_type +has a value of +.Dv USER_PROCESS , +.Dv INIT_PROCESS , +.Dv LOGIN_PROCESS +or +.Dv DEAD_PROCESS , +it will return the next entry whose +.Fa ut_type +has one of the previously mentioned values and whose +.Fa ut_id +is equal. +.Pp +The +.Fn getutxline +function searches for the next entry in the database whose +.Fa ut_type +has a value of +.Dv USER_PROCESS +or +.Dv LOGIN_PROCESS +and whose +.Fa ut_line +is equal to the the same field in +.Fa line . +.Pp +The +.Fn getutxuser +function searches for the next entry in the database whose +.Fa ut_type +has a value of +.Dv USER_PROCESS +and whose +.Fa ut_user +is equal to +.Fa user . +.Pp +The previously mentioned functions will automatically try to open the +user accounting database if not already done so. +The +.Fn setutxdb +and +.Fn setutxent +functions allow the database to be opened manually, causing the offset +within the user accounting database to be rewound. +The +.Fn endutxent +function closes the database. +.Pp +The +.Fn setutxent +database always opens the active sessions database. +The +.Fn setutxdb +function opens the database identified by +.Fa type , +whose value is either +.Dv UTXDB_ACTIVE , +.Dv UTXDB_LASTLOGIN +or +.Dv UTXDB_LOG . +It will open a custom file with filename +.Fa file +instead of the system-default if +.Fa file +is not null. +Care must be taken that when using a custom filename, +.Fa type +still has to match with the actual format, since each database may use +its own file format. +.Pp +The +.Fn pututxline +function writes record +.Fa utmpx +to the system-default user accounting databases. +The value of +.Fa ut_type +determines which databases are modified. +.Pp +Entries of type +.Dv BOOT_TIME , +.Dv SHUTDOWN_TIME , +.Dv OLD_TIME +and +.Dv NEW_TIME +will only be written to +.Pa /var/log/utx.log . +.Pp +Entries of type +.Dv USER_PROCESS +will also be written to +.Pa /var/run/utx.active . +It will only be written to +.Pa /var/log/utx.lastlogin +if +.Fa ut_tv +for that user has a greater value than the existing entry or when no +entry for the user has been found. +.Pp +Entries of type +.Dv DEAD_PROCESS +will only be written to +.Pa /var/log/utx.log +and +.Pa /var/run/utx.active +if a corresponding +.Dv USER_PROCESS , +.Dv INIT_PROCESS +or +.Dv LOGIN_PROCESS +entry whose +.Fa ut_id +is equal has been found in the latter. +.Pp +In addition, entries of type +.Dv BOOT_TIME +and +.Dv SHUTDOWN_TIME +will cause all entries in +.Pa /var/run/utx.active +to be discarded. +.Pp +All entries whose type has not been mentioned previously, are discarded +by this implementation of +.Fn pututxline . +.Sh RETURN VALUES +The +.Fn getutxent , +.Fn getutxid , +.Fn getutxline , +and +.Fn getutxuser +functions return a pointer to an +.Vt utmpx +structure that matches the mentioned constraints on success or +.Dv NULL +when reaching the end-of-file or when an error occurs. +.Pp +The +.Fn pututxline +function returns a pointer to an +.Vt utmpx +structure containing a copy of the structure written to disk upon +success. +It returns +.Dv NULL +when the provided +.Vt utmpx +is invalid. +This may be because +.Fa ut_type +is invalid or +.Fa ut_type +has a value of +.Dv DEAD_PROCESS +and an entry with an identifier with a value equal to the field +.Fa ut_id +was not found. +.Pp +The +.Fn setutxdb +function returns 0 if the user accounting database was opened +successfully. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +In addition to the error conditions described in +.Xr fopen 3 , +the +.Fn setutxdb +function can generate the following errors: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa type +argument contains a value not supported by this implementation. +.It Bq Er EFTYPE +The file format is invalid. +.El +.Sh SEE ALSO +.Xr last 1 , +.Xr write 1 , +.Xr getpid 2 , +.Xr gettimeofday 2 , +.Xr tty 4 , +.Xr ac 8 , +.Xr newsyslog 8 +.Sh STANDARDS +The +.Fn endutxent , +.Fn getutxent , +.Fn getutxid , +.Fn getutxline , +.Fn pututxline +and +.Fn setutxent +functions are expected to conform to +.St -p1003.1-2008 . +.Pp +The +.Fn getutxuser +and +.Fn setutxdb +functions, +the +.Fa ut_host +field of the +.Vt utmpx +structure and +.Dv SHUTDOWN_TIME +are extensions. +.Sh HISTORY +These functions appeared in +.Fx 9.0 . +They replaced the +.In utmp.h +interface. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/lib/libc/gen/getutxent.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/getutxent.c Wed Jan 13 17:29:55 2010 (r202188) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2010 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include "utxdb.h" +#include "un-namespace.h" + +static FILE *uf = NULL; +static int udb; +static struct utmpx utx; + +int +setutxdb(int db, const char *file) +{ + struct stat sb; + + switch (db) { + case UTXDB_ACTIVE: + if (file == NULL) + file = _PATH_UTX_ACTIVE; + break; + case UTXDB_LASTLOGIN: + if (file == NULL) + file = _PATH_UTX_LASTLOGIN; + break; + case UTXDB_LOG: + if (file == NULL) + file = _PATH_UTX_LOG; + break; + default: + errno = EINVAL; + return (-1); + } + + if (uf != NULL) + fclose(uf); + uf = fopen(file, "r"); + if (uf == NULL) + return (-1); + + /* Safety check: never use broken files. */ + if (db != UTXDB_LOG && _fstat(fileno(uf), &sb) != -1 && + sb.st_size % sizeof(struct futx) != 0) { + fclose(uf); + uf = NULL; + errno = EFTYPE; + return (-1); + } + + udb = db; + return (0); +} + +void +setutxent(void) +{ + + setutxdb(UTXDB_ACTIVE, NULL); +} + +void +endutxent(void) +{ + + if (uf != NULL) { + fclose(uf); + uf = NULL; + } +} + +static struct futx * +getfutxent(void) +{ + static struct futx fu; + + if (uf == NULL) + setutxent(); + if (uf == NULL) + return (NULL); + + if (udb == UTXDB_LOG) { + uint16_t len; + + if (fread(&len, sizeof len, 1, uf) != 1) + return (NULL); + len = be16toh(len); + if (len > sizeof fu) { + /* Forward compatibility. */ + if (fread(&fu, sizeof fu, 1, uf) != 1) + return (NULL); + fseek(uf, len - sizeof fu, SEEK_CUR); + } else { + /* Partial record. */ + memset(&fu, 0, sizeof fu); + if (fread(&fu, len, 1, uf) != 1) + return (NULL); + } + } else { + if (fread(&fu, sizeof fu, 1, uf) != 1) + return (NULL); + } + return (&fu); +} + +struct utmpx * +getutxent(void) +{ + struct futx *fu; + + fu = getfutxent(); + if (fu == NULL) + return (NULL); + futx_to_utx(fu, &utx); + return (&utx); +} + +struct utmpx * +getutxid(const struct utmpx *id) +{ + struct futx *fu; + + for (;;) { + fu = getfutxent(); + if (fu == NULL) + return (NULL); + + switch (fu->fu_type) { + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + case SHUTDOWN_TIME: + if (fu->fu_type == id->ut_type) + goto found; + case USER_PROCESS: + case INIT_PROCESS: + case LOGIN_PROCESS: + case DEAD_PROCESS: + switch (id->ut_type) { + case USER_PROCESS: + case INIT_PROCESS: + case LOGIN_PROCESS: + case DEAD_PROCESS: + if (memcmp(fu->fu_id, id->ut_id, + MIN(sizeof fu->fu_id, sizeof id->ut_id)) == 0) + goto found; + } + } + } + +found: + futx_to_utx(fu, &utx); + return (&utx); +} + +struct utmpx * +getutxline(const struct utmpx *line) +{ + struct futx *fu; + + for (;;) { + fu = getfutxent(); + if (fu == NULL) + return (NULL); + + switch (fu->fu_type) { + case USER_PROCESS: + case LOGIN_PROCESS: + if (strncmp(fu->fu_line, line->ut_line, + MIN(sizeof fu->fu_line, sizeof line->ut_line)) == 0) + goto found; + } + } + +found: + futx_to_utx(fu, &utx); + return (&utx); +} + +struct utmpx * +getutxuser(const char *user) +{ + struct futx *fu; + + for (;;) { + fu = getfutxent(); + if (fu == NULL) + return (NULL); + + switch (fu->fu_type) { + case USER_PROCESS: + if (strncmp(fu->fu_user, user, sizeof fu->fu_user) == 0) + goto found; + } + } + +found: + futx_to_utx(fu, &utx); + return (&utx); +} Added: head/lib/libc/gen/pututxline.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/pututxline.c Wed Jan 13 17:29:55 2010 (r202188) @@ -0,0 +1,277 @@ +/*- + * Copyright (c) 2010 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include "utxdb.h" +#include "un-namespace.h" + +static FILE * +futx_open(const char *file) +{ + int fd; + FILE *fp; + struct stat sb; + + fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK, 0644); + if (fd < 0) + return (NULL); + + /* Safety check: never use broken files. */ + if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) { + _close(fd); + return (NULL); + } + + fp = fdopen(fd, "r+"); + if (fp == NULL) { + _close(fd); + return (NULL); + } + + return (fp); +} + +static void +utx_active_add(const struct futx *fu) +{ + FILE *fp; + struct futx fe; + off_t partial = -1; + + /* + * Register user login sessions. Overwrite entries of sessions + * that have already been terminated. + */ + fp = futx_open(_PATH_UTX_ACTIVE); + if (fp == NULL) + return; + while (fread(&fe, sizeof fe, 1, fp) == 1) { + switch (fe.fu_type) { + case USER_PROCESS: + case INIT_PROCESS: + case LOGIN_PROCESS: + case DEAD_PROCESS: + /* Overwrite when ut_id matches. */ + if (memcmp(fu->fu_id, fe.fu_id, sizeof fe.fu_id) == 0) { + fseeko(fp, -sizeof fe, SEEK_CUR); + goto exact; + } + if (fe.fu_type != DEAD_PROCESS) + break; + /* FALLTHROUGH */ + default: + /* Allow us to overwrite unused records. */ + if (partial == -1) + partial = fseeko(fp, 0, SEEK_CUR) - sizeof fe; + break; + } + } + + /* + * No exact match found. Use the partial match. If no partial + * match was found, just append a new record. + */ + if (partial != -1) + fseeko(fp, partial, SEEK_SET); +exact: + fwrite(fu, sizeof *fu, 1, fp); + fclose(fp); +} + +static int +utx_active_remove(struct futx *fu) +{ + FILE *fp; + struct futx fe; + + /* + * Remove user login sessions, having the same ut_id. + */ + fp = futx_open(_PATH_UTX_ACTIVE); + if (fp == NULL) + return (0); + while (fread(&fe, sizeof fe, 1, fp) == 1) { + switch (fe.fu_type) { + case USER_PROCESS: + case INIT_PROCESS: + case LOGIN_PROCESS: + if (memcmp(fu->fu_id, fe.fu_id, sizeof fe.fu_id) != 0) + continue; + + /* + * Prevent login sessions from having a negative + * timespan. + */ + if (be64toh(fu->fu_tv) < be64toh(fe.fu_tv)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:49:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E2A1065670; Wed, 13 Jan 2010 17:49:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 746F78FC19; Wed, 13 Jan 2010 17:49: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 o0DHnZ8N077829; Wed, 13 Jan 2010 17:49:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHnZ6O077826; Wed, 13 Jan 2010 17:49:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131749.o0DHnZ6O077826@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:49: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: r202190 - head/bin/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:49:36 -0000 Author: ed Date: Wed Jan 13 17:49:35 2010 New Revision: 202190 URL: http://svn.freebsd.org/changeset/base/202190 Log: Let csh(1) use utmpx instead of utmp. csh allows you to monitor the utmp(x) file to monitor certain user logins. Unfortunately it needs to directly stat() this file. I don't want to break this module , but eventually it shouldn't do that. The idea of the getutxent(3) API is to hide file access. Approved by: mp Modified: head/bin/csh/config.h head/bin/csh/config_p.h Modified: head/bin/csh/config.h ============================================================================== --- head/bin/csh/config.h Wed Jan 13 17:45:39 2010 (r202189) +++ head/bin/csh/config.h Wed Jan 13 17:49:35 2010 (r202190) @@ -54,7 +54,7 @@ #define HAVE_GETPWENT 1 /* Define to 1 if you have the `getutent' function. */ -/* #undef HAVE_GETUTENT */ +#define HAVE_GETUTENT 1 /* Define if you have the iconv() function. */ /* #undef HAVE_ICONV */ @@ -130,10 +130,10 @@ #define HAVE_STRUCT_UTMP_UT_HOST 1 /* Define to 1 if `ut_tv' is member of `struct utmp'. */ -/* #undef HAVE_STRUCT_UTMP_UT_TV */ +#define HAVE_STRUCT_UTMP_UT_TV 1 /* Define to 1 if `ut_user' is member of `struct utmp'. */ -/* #undef HAVE_STRUCT_UTMP_UT_USER */ +#define HAVE_STRUCT_UTMP_UT_USER 1 /* Define to 1 if `ut_xtime' is member of `struct utmp'. */ /* #undef HAVE_STRUCT_UTMP_UT_XTIME */ @@ -159,10 +159,10 @@ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the header file. */ -/* #undef HAVE_UTMPX_H */ +#define HAVE_UTMPX_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_UTMP_H 1 +/* #undef HAVE_UTMP_H */ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 Modified: head/bin/csh/config_p.h ============================================================================== --- head/bin/csh/config_p.h Wed Jan 13 17:45:39 2010 (r202189) +++ head/bin/csh/config_p.h Wed Jan 13 17:49:35 2010 (r202190) @@ -85,6 +85,7 @@ /* Use LC_MESSAGES locale category to open the message catalog */ #define MCLoadBySet NL_CAT_LOCALE #define BUFSIZE 8192 +#define UTMPX_FILE "/var/run/utx.active" #endif #if defined(__bsdi__) From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:50:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F6C106568D; Wed, 13 Jan 2010 17:50:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 595428FC13; Wed, 13 Jan 2010 17:50: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 o0DHowil078172; Wed, 13 Jan 2010 17:50:58 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHowEf078165; Wed, 13 Jan 2010 17:50:58 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131750.o0DHowEf078165@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:50: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: r202191 - head/usr.bin/finger X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:50:58 -0000 Author: ed Date: Wed Jan 13 17:50:58 2010 New Revision: 202191 URL: http://svn.freebsd.org/changeset/base/202191 Log: Migrate finger(1) towards utmpx. It was already ported to use libulog, which makes it simpler now. Be sure to catch the error returned by setutxdb(). Otherwise it may perform a lookup on the utx.active database. Modified: head/usr.bin/finger/Makefile head/usr.bin/finger/finger.c head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/sprint.c head/usr.bin/finger/util.c Modified: head/usr.bin/finger/Makefile ============================================================================== --- head/usr.bin/finger/Makefile Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/Makefile Wed Jan 13 17:50:58 2010 (r202191) @@ -7,7 +7,4 @@ MAN= finger.1 finger.conf.5 WARNS?= 2 -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.bin/finger/finger.c ============================================================================== --- head/usr.bin/finger/finger.c Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/finger.c Wed Jan 13 17:50:58 2010 (r202191) @@ -82,9 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include #include "finger.h" Modified: head/usr.bin/finger/lprint.c ============================================================================== --- head/usr.bin/finger/lprint.c Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/lprint.c Wed Jan 13 17:50:58 2010 (r202191) @@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" #include "pathnames.h" Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/net.c Wed Jan 13 17:50:58 2010 (r202191) @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" static void cleanup(int sig); Modified: head/usr.bin/finger/sprint.c ============================================================================== --- head/usr.bin/finger/sprint.c Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/sprint.c Wed Jan 13 17:50:58 2010 (r202191) @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include +#include #include "finger.h" static void stimeprint(WHERE *); Modified: head/usr.bin/finger/util.c ============================================================================== --- head/usr.bin/finger/util.c Wed Jan 13 17:49:35 2010 (r202190) +++ head/usr.bin/finger/util.c Wed Jan 13 17:50:58 2010 (r202191) @@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" #include "pathnames.h" @@ -110,11 +109,11 @@ void enter_lastlog(PERSON *pn) { WHERE *w; - struct ulog_utmpx *ut; + struct utmpx *ut = NULL; char doit = 0; - ulog_setutxfile(UTXI_USER, NULL); - ut = ulog_getutxuser(pn->name); + if (setutxdb(UTXDB_LASTLOGIN, NULL) == 0) + ut = getutxuser(pn->name); if ((w = pn->whead) == NULL) doit = 1; else if (ut != NULL && ut->ut_type == USER_PROCESS) { @@ -140,7 +139,7 @@ enter_lastlog(PERSON *pn) strcpy(w->host, ut->ut_host); w->loginat = ut->ut_tv.tv_sec; } - ulog_endutxent(); + endutxent(); } void From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:54:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A06DB1065672; Wed, 13 Jan 2010 17:54:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2178FC15; Wed, 13 Jan 2010 17:54: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 o0DHsWGw079006; Wed, 13 Jan 2010 17:54:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHsWId079001; Wed, 13 Jan 2010 17:54:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131754.o0DHsWId079001@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:54:32 +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: r202192 - head/usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:54:32 -0000 Author: ed Date: Wed Jan 13 17:54:32 2010 New Revision: 202192 URL: http://svn.freebsd.org/changeset/base/202192 Log: Port ppp(8) to utmpx. A nice thing about utmpx is that it makes it very easy to log sessions that don't use TTYs. This is because the file is not indexed by TTY slots anymore. Silence from: brian Modified: head/usr.sbin/ppp/id.c head/usr.sbin/ppp/id.h head/usr.sbin/ppp/physical.c head/usr.sbin/ppp/physical.h Modified: head/usr.sbin/ppp/id.c ============================================================================== --- head/usr.sbin/ppp/id.c Wed Jan 13 17:50:58 2010 (r202191) +++ head/usr.sbin/ppp/id.c Wed Jan 13 17:54:32 2010 (r202192) @@ -49,7 +49,7 @@ #else #include #endif -#include +#include #include "log.h" #include "main.h" @@ -202,36 +202,25 @@ ID0uu_unlock(const char *basettyname) } void -ID0login(struct utmp *ut) +ID0login(const struct utmpx *ut) { ID0set0(); - if (logout(ut->ut_line)) { - log_Printf(LogID0, "logout(\"%s\")\n", ut->ut_line); - logwtmp(ut->ut_line, "", ""); - log_Printf(LogID0, "logwtmp(\"%s\", \"\", \"\")\n", ut->ut_line); - } - login(ut); - log_Printf(LogID0, "login(\"%s\", \"%.*s\")\n", - ut->ut_line, (int)(sizeof ut->ut_name), ut->ut_name); + pututxline(ut); + log_Printf(LogID0, "pututxline(\"%.*s\", \"%.*s\", \"%.*s\", \"%.*s\")\n", + (int)sizeof ut->ut_id, ut->ut_id, + (int)sizeof ut->ut_user, ut->ut_user, + (int)sizeof ut->ut_line, ut->ut_line, + (int)sizeof ut->ut_host, ut->ut_host); ID0setuser(); } void -ID0logout(const char *device, int nologout) +ID0logout(const struct utmpx *ut) { - struct utmp ut; - char ut_line[sizeof ut.ut_line + 1]; - - strncpy(ut_line, device, sizeof ut_line - 1); - ut_line[sizeof ut_line - 1] = '\0'; - ID0set0(); - if (nologout || logout(ut_line)) { - log_Printf(LogID0, "logout(\"%s\")\n", ut_line); - logwtmp(ut_line, "", ""); - log_Printf(LogID0, "logwtmp(\"%s\", \"\", \"\")\n", ut_line); - } else - log_Printf(LogERROR, "ID0logout: No longer logged in on %s\n", ut_line); + pututxline(ut); + log_Printf(LogID0, "pututxline(\"%.*s\")\n", + (int)sizeof ut->ut_id, ut->ut_id); ID0setuser(); } Modified: head/usr.sbin/ppp/id.h ============================================================================== --- head/usr.sbin/ppp/id.h Wed Jan 13 17:50:58 2010 (r202191) +++ head/usr.sbin/ppp/id.h Wed Jan 13 17:54:32 2010 (r202192) @@ -27,7 +27,7 @@ */ #ifndef NOSUID -struct utmp; +struct utmpx; struct sockaddr_un; extern void ID0init(void); @@ -41,8 +41,8 @@ extern int ID0write(int, const void *, s extern int ID0uu_lock(const char *); extern int ID0uu_lock_txfr(const char *, pid_t); extern int ID0uu_unlock(const char *); -extern void ID0login(struct utmp *); -extern void ID0logout(const char *, int); +extern void ID0login(const struct utmpx *); +extern void ID0logout(const struct utmpx *); extern int ID0bind_un(int, const struct sockaddr_un *); extern int ID0connect_un(int, const struct sockaddr_un *); extern int ID0kill(pid_t, int); @@ -64,20 +64,8 @@ extern int ID0NgMkSockNode(const char *, #define ID0uu_lock uu_lock #define ID0uu_lock_txfr uu_lock_txfr #define ID0uu_unlock uu_unlock -#define ID0login(u) \ - do { \ - if (logout((u)->ut_line)) \ - logwtmp((u)->ut_line, "", ""); \ - login(u); \ - } while (0) -#define ID0logout(dev, no) \ - do { \ - struct utmp ut; \ - strncpy(ut.ut_line, dev, sizeof ut.ut_line - 1); \ - ut.ut_line[sizeof ut.ut_line - 1] = '\0'; \ - if (no || logout(ut.ut_line)) \ - logwtmp(ut.ut_line, "", ""); \ - } while (0) +#define ID0login pututxline +#define ID0logout pututxline #define ID0bind_un(s, n) bind(s, (const struct sockaddr *)(n), sizeof *(n)) #define ID0connect_un(s, n) \ connect(s, (const struct sockaddr *)(n), sizeof *(n)) Modified: head/usr.sbin/ppp/physical.c ============================================================================== --- head/usr.sbin/ppp/physical.c Wed Jan 13 17:50:58 2010 (r202191) +++ head/usr.sbin/ppp/physical.c Wed Jan 13 17:54:32 2010 (r202192) @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,7 @@ #include #include #include -#include +#include #if defined(__OpenBSD__) || defined(__NetBSD__) #include #include @@ -106,8 +107,6 @@ #endif #include "tcpmss.h" -#define PPPOTCPLINE "ppp" - static int physical_DescriptorWrite(struct fdescriptor *, struct bundle *, const fd_set *); @@ -333,6 +332,7 @@ physical_Close(struct physical *p) { int newsid; char fn[PATH_MAX]; + struct utmpx ut; if (p->fd < 0) return; @@ -344,12 +344,11 @@ physical_Close(struct physical *p) physical_StopDeviceTimer(p); if (p->Utmp) { - if (p->handler && (p->handler->type == TCP_DEVICE || - p->handler->type == UDP_DEVICE)) - /* Careful - we logged in on line ``ppp'' with IP as our host */ - ID0logout(PPPOTCPLINE, 1); - else - ID0logout(p->name.base, 0); + memset(&ut, 0, sizeof ut); + ut.ut_type = DEAD_PROCESS; + gettimeofday(&ut.ut_tv, NULL); + snprintf(ut.ut_id, sizeof ut.ut_id, "%xppp", (int)getpid()); + ID0logout(&ut); p->Utmp = 0; } newsid = tcgetpgrp(p->fd) == getpgrp(); @@ -911,16 +910,17 @@ void physical_Login(struct physical *p, const char *name) { if (p->type == PHYS_DIRECT && *p->name.base && !p->Utmp) { - struct utmp ut; + struct utmpx ut; const char *connstr; char *colon; memset(&ut, 0, sizeof ut); - ut.ut_time = time(NULL); - strncpy(ut.ut_name, name, sizeof ut.ut_name); + ut.ut_type = USER_PROCESS; + gettimeofday(&ut.ut_tv, NULL); + snprintf(ut.ut_id, sizeof ut.ut_id, "%xppp", (int)getpid()); + strncpy(ut.ut_user, name, sizeof ut.ut_user); if (p->handler && (p->handler->type == TCP_DEVICE || p->handler->type == UDP_DEVICE)) { - strncpy(ut.ut_line, PPPOTCPLINE, sizeof ut.ut_line); strncpy(ut.ut_host, p->name.base, sizeof ut.ut_host); colon = memchr(ut.ut_host, ':', sizeof ut.ut_host); if (colon) @@ -931,7 +931,7 @@ physical_Login(struct physical *p, const /* mgetty sets this to the connection speed */ strncpy(ut.ut_host, connstr, sizeof ut.ut_host); ID0login(&ut); - p->Utmp = ut.ut_time; + p->Utmp = 1; } } Modified: head/usr.sbin/ppp/physical.h ============================================================================== --- head/usr.sbin/ppp/physical.h Wed Jan 13 17:50:58 2010 (r202191) +++ head/usr.sbin/ppp/physical.h Wed Jan 13 17:54:32 2010 (r202192) @@ -97,7 +97,7 @@ struct physical { char *base; } name; - time_t Utmp; /* Are we in utmp ? */ + int Utmp; /* Are we in utmp ? */ pid_t session_owner; /* HUP this when closing the link */ struct device *handler; /* device specific handler */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:56:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F0310656B3; Wed, 13 Jan 2010 17:56:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B2AA8FC1D; Wed, 13 Jan 2010 17:56: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 o0DHusAS079555; Wed, 13 Jan 2010 17:56:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHusvb079551; Wed, 13 Jan 2010 17:56:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131756.o0DHusvb079551@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:56: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: r202193 - in head/bin: date pax X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:56:54 -0000 Author: ed Date: Wed Jan 13 17:56:54 2010 New Revision: 202193 URL: http://svn.freebsd.org/changeset/base/202193 Log: Port everything in bin/ from utmp to utmpx. date: use libc utmpx routines instead of the ones provided by libulog. pax: don't depend on Modified: head/bin/date/Makefile head/bin/date/date.c head/bin/pax/gen_subs.c Modified: head/bin/date/Makefile ============================================================================== --- head/bin/date/Makefile Wed Jan 13 17:54:32 2010 (r202192) +++ head/bin/date/Makefile Wed Jan 13 17:56:54 2010 (r202193) @@ -3,7 +3,5 @@ PROG= date SRCS= date.c netdate.c vary.c -DPADD= ${LIBULOG} -LDADD= -lulog .include Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Wed Jan 13 17:54:32 2010 (r202192) +++ head/bin/date/date.c Wed Jan 13 17:56:54 2010 (r202193) @@ -52,9 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "extern.h" #include "vary.h" Modified: head/bin/pax/gen_subs.c ============================================================================== --- head/bin/pax/gen_subs.c Wed Jan 13 17:54:32 2010 (r202192) +++ head/bin/pax/gen_subs.c Wed Jan 13 17:56:54 2010 (r202193) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -66,10 +65,6 @@ __FBSDID("$FreeBSD$"); #define OLDFRMTM "%b %e %Y" #define CURFRMTD "%e %b %H:%M" #define OLDFRMTD "%e %b %Y" -#ifndef UT_NAMESIZE -#define UT_NAMESIZE 8 -#endif -#define UT_GRPSIZE 6 static int d_first = -1; @@ -116,9 +111,8 @@ ls_list(ARCHD *arcn, time_t now, FILE *f */ if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0) f_date[0] = '\0'; - (void)fprintf(fp, "%s%2u %-*s %-*s ", f_mode, sbp->st_nlink, - UT_NAMESIZE, name_uid(sbp->st_uid, 1), UT_GRPSIZE, - name_gid(sbp->st_gid, 1)); + (void)fprintf(fp, "%s%2u %-12s %-12s ", f_mode, sbp->st_nlink, + name_uid(sbp->st_uid, 1), name_gid(sbp->st_gid, 1)); /* * print device id's for devices, or sizes for other nodes From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:58:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E25F5106566C; Wed, 13 Jan 2010 17:58:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D21468FC19; Wed, 13 Jan 2010 17:58: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 o0DHwnEP080017; Wed, 13 Jan 2010 17:58:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHwnkK080014; Wed, 13 Jan 2010 17:58:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131758.o0DHwnkK080014@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:58: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: r202194 - head/sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:58:50 -0000 Author: ed Date: Wed Jan 13 17:58:49 2010 New Revision: 202194 URL: http://svn.freebsd.org/changeset/base/202194 Log: Migrate init(8) towards utmpx. According to a comment, we cannot safely remove utmpx entries here anymore. This is because the libc routines may block on file locking. In an ideal world login(1) should just remove the entries, which is why I'm disabling this code for now. If it turns out we get lots of stale entries here, we should figure out a way to deal with that. Modified: head/sbin/init/Makefile head/sbin/init/init.c Modified: head/sbin/init/Makefile ============================================================================== --- head/sbin/init/Makefile Wed Jan 13 17:56:54 2010 (r202193) +++ head/sbin/init/Makefile Wed Jan 13 17:58:49 2010 (r202194) @@ -6,8 +6,8 @@ MAN= init.8 PRECIOUSPROG= INSTALLFLAGS=-b -B.bak CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT -DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT} -LDADD= -lutil -lulog -lcrypt +DPADD= ${LIBUTIL} ${LIBCRYPT} +LDADD= -lutil -lcrypt NO_SHARED?= YES Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Wed Jan 13 17:56:54 2010 (r202193) +++ head/sbin/init/init.c Wed Jan 13 17:58:49 2010 (r202194) @@ -65,9 +65,9 @@ static const char rcsid[] = #include #include #include -#define _ULOG_POSIX_NAMES #include #include +#include #include #include @@ -569,10 +569,13 @@ transition(state_t s) * NB: should send a message to the session logger to avoid blocking. */ static void -clear_session_logs(session_t *sp) +clear_session_logs(session_t *sp __unused) { - ulog_logout(sp->se_device); + /* + * XXX: Use getutxline() and call pututxline() for each entry. + * Is this safe to do this here? Is it really required anyway? + */ } /* From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 17:59:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1326C1065676; Wed, 13 Jan 2010 17:59:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02EC98FC18; Wed, 13 Jan 2010 17:59: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 o0DHxNVv080185; Wed, 13 Jan 2010 17:59:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DHxNlg080182; Wed, 13 Jan 2010 17:59:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131759.o0DHxNlg080182@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 17:59: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: r202195 - head/sbin/reboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 17:59:24 -0000 Author: ed Date: Wed Jan 13 17:59:23 2010 New Revision: 202195 URL: http://svn.freebsd.org/changeset/base/202195 Log: Port the remaining apps in sbin/ to utmpx; only reboot(8). Modified: head/sbin/reboot/Makefile head/sbin/reboot/reboot.c Modified: head/sbin/reboot/Makefile ============================================================================== --- head/sbin/reboot/Makefile Wed Jan 13 17:58:49 2010 (r202194) +++ head/sbin/reboot/Makefile Wed Jan 13 17:59:23 2010 (r202195) @@ -2,8 +2,6 @@ # $FreeBSD$ PROG= reboot -DPADD= ${LIBULOG} -LDADD= -lulog MAN= reboot.8 nextboot.8 MLINKS= reboot.8 halt.8 reboot.8 fastboot.8 reboot.8 fasthalt.8 Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Wed Jan 13 17:58:49 2010 (r202194) +++ head/sbin/reboot/reboot.c Wed Jan 13 17:59:23 2010 (r202195) @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include static void usage(void); static u_int get_pageins(void); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:02:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D0111065672; Wed, 13 Jan 2010 18:02:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8488FC22; Wed, 13 Jan 2010 18:02: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 o0DI2UCc080955; Wed, 13 Jan 2010 18:02:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DI2Ue5080952; Wed, 13 Jan 2010 18:02:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131802.o0DI2Ue5080952@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:02: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: r202196 - head/lib/libopie X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:02:30 -0000 Author: ed Date: Wed Jan 13 18:02:30 2010 New Revision: 202196 URL: http://svn.freebsd.org/changeset/base/202196 Log: Let libopie use utmpx instead of utmp. Modified: head/lib/libopie/Makefile head/lib/libopie/config.h Modified: head/lib/libopie/Makefile ============================================================================== --- head/lib/libopie/Makefile Wed Jan 13 17:59:23 2010 (r202195) +++ head/lib/libopie/Makefile Wed Jan 13 18:02:30 2010 (r202196) @@ -8,15 +8,14 @@ SHLIB_MAJOR= 6 KEYFILE?= \"/etc/opiekeys\" -.PATH: ${DIST_DIR} ${OPIE_DIST}/libmissing +.PATH: ${DIST_DIR} LIB= opie SRCS= atob8.c btoa8.c btoh.c challenge.c getsequence.c hash.c hashlen.c \ keycrunch.c lock.c lookup.c newseed.c parsechallenge.c passcheck.c \ passwd.c randomchallenge.c readpass.c unlock.c verify.c version.c \ btoe.c accessfile.c generator.c insecure.c getutmpentry.c \ - readrec.c writerec.c open.c \ - getutline.c pututline.c endutent.c setutent.c # from libmissing + readrec.c writerec.c open.c SRCS+= opieextra.c INCS= ${OPIE_DIST}/opie.h Modified: head/lib/libopie/config.h ============================================================================== --- head/lib/libopie/config.h Wed Jan 13 17:59:23 2010 (r202195) +++ head/lib/libopie/config.h Wed Jan 13 18:02:30 2010 (r202196) @@ -216,7 +216,7 @@ #define HAVE_GETUSERSHELL 1 /* Define if you have the getutxline function. */ -/* #undef HAVE_GETUTXLINE */ +#define HAVE_GETUTXLINE 1 /* Define if you have the getwd function. */ /* #undef HAVE_GETWD */ @@ -231,7 +231,7 @@ /* #undef HAVE_ON_EXIT */ /* Define if you have the pututxline function. */ -/* #undef HAVE_PUTUTXLINE */ +#define HAVE_PUTUTXLINE 1 /* Define if you have the rindex function. */ /* #undef HAVE_RINDEX */ @@ -366,7 +366,7 @@ #define HAVE_UNISTD_H 1 /* Define if you have the header file. */ -/* #undef HAVE_UTMPX_H */ +#define HAVE_UTMPX_H 1 /* Define if you have the crypt library (-lcrypt). */ #define HAVE_LIBCRYPT 1 From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:06:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94CCC10656A4; Wed, 13 Jan 2010 18:06:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 832E78FC0C; Wed, 13 Jan 2010 18:06: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 o0DI6VdM081854; Wed, 13 Jan 2010 18:06:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DI6Vce081852; Wed, 13 Jan 2010 18:06:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131806.o0DI6Vce081852@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:06: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: r202197 - head/usr.bin/last X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:06:31 -0000 Author: ed Date: Wed Jan 13 18:06:31 2010 New Revision: 202197 URL: http://svn.freebsd.org/changeset/base/202197 Log: Port last(1) to use utmpx. Basically there are three major things I changed about last(1): - It should use ut_type instead of determining by hand what type of record was given. - It should now keep track of ut_id's instead of TTYs. This means the ttylist has been renamed to the idlist, storing all the ut_id's it has processed until the next reboot. - I've removed the signal handler. Because our wtmp is rotated so often, it makes little sense. Even on a simple piece of hardware it should be capable of grinding through megabytes of logs in a second. Modified: head/usr.bin/last/last.c Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Wed Jan 13 18:02:30 2010 (r202196) +++ head/usr.bin/last/last.c Wed Jan 13 18:06:31 2010 (r202197) @@ -59,15 +59,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define NO 0 /* false/no */ #define YES 1 /* true/yes */ #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; -static struct utmp buf[1024]; /* utmp read buffer */ - typedef struct arg { char *name; /* argument */ #define HOST_TYPE -2 @@ -78,18 +76,18 @@ typedef struct arg { } ARG; ARG *arglist; /* head of linked list */ -LIST_HEAD(ttylisthead, ttytab) ttylist; +LIST_HEAD(idlisthead, idtab) idlist; -struct ttytab { +struct idtab { time_t logout; /* log out time */ - char tty[UT_LINESIZE + 1]; /* terminal name */ - LIST_ENTRY(ttytab) list; + char id[sizeof ((struct utmpx *)0)->ut_id]; /* identifier */ + LIST_ENTRY(idtab) list; }; static const char *crmsg; /* cause of last reboot */ -static long currentout, /* current logout value */ - maxrec; /* records to display */ -static const char *file = _PATH_WTMP; /* wtmp file */ +static time_t currentout; /* current logout value */ +static long maxrec; /* records to display */ +static const char *file = NULL; /* wtmp file */ static int sflag = 0; /* show delta in seconds */ static int width = 5; /* show seconds in delta */ static int yflag; /* show year */ @@ -102,12 +100,11 @@ static time_t snaptime; /* if != 0, we void addarg(int, char *); time_t dateconv(char *); -void doentry(struct utmp *); +void doentry(struct utmpx *); void hostconv(char *); -void onintr(int); -void printentry(struct utmp *, struct ttytab *); +void printentry(struct utmpx *, struct idtab *); char *ttyconv(char *); -int want(struct utmp *); +int want(struct utmpx *); void usage(void); void wtmp(void); @@ -199,6 +196,8 @@ main(int argc, char *argv[]) exit(0); } +#define MAXUTXENTRIES 1024 + /* * wtmp -- * read through the wtmp file @@ -206,33 +205,34 @@ main(int argc, char *argv[]) void wtmp(void) { - struct utmp *bp; /* current structure */ - struct stat stb; /* stat of file for size */ - long bl; - int bytes, wfd; + struct utmpx buf[MAXUTXENTRIES]; + struct utmpx *ut; + static unsigned int first = 0, amount = 0; + time_t t; char ct[80]; struct tm *tm; - time_t t; - LIST_INIT(&ttylist); + LIST_INIT(&idlist); + (void)time(&t); - if ((wfd = open(file, O_RDONLY, 0)) < 0 || fstat(wfd, &stb) == -1) + /* Load the last entries from the file. */ + if (setutxdb(UTXDB_LOG, file) != 0) err(1, "%s", file); - bl = (stb.st_size + sizeof(buf) - 1) / sizeof(buf); + while ((ut = getutxent()) != NULL) { + memcpy(&buf[(first + amount) % MAXUTXENTRIES], ut, sizeof *ut); + if (amount == MAXUTXENTRIES) + first++; + else + amount++; + if (t > ut->ut_tv.tv_sec) + t = ut->ut_tv.tv_sec; + } + endutxent(); + + /* Display them in reverse order. */ + while (amount > 0) + doentry(&buf[(first + amount--) % MAXUTXENTRIES]); - (void)time(&t); - buf[0].ut_time = _time_to_int(t); - (void)signal(SIGINT, onintr); - (void)signal(SIGQUIT, onintr); - - while (--bl >= 0) { - if (lseek(wfd, (off_t)(bl * sizeof(buf)), L_SET) == -1 || - (bytes = read(wfd, buf, sizeof(buf))) == -1) - err(1, "%s", file); - for (bp = &buf[bytes / sizeof(buf[0]) - 1]; bp >= buf; --bp) - doentry(bp); - } - t = _int_to_time(buf[0].ut_time); tm = localtime(&t); (void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm); printf("%s", ct); @@ -243,24 +243,21 @@ wtmp(void) * process a single wtmp entry */ void -doentry(struct utmp *bp) +doentry(struct utmpx *bp) { - struct ttytab *tt, *ttx; /* ttylist entry */ + struct idtab *tt, *ttx; /* idlist entry */ - /* - * if the terminal line is '~', the machine stopped. - * see utmp(5) for more info. - */ - if (bp->ut_line[0] == '~' && !bp->ut_line[1]) { + /* the machine stopped */ + if (bp->ut_type == BOOT_TIME || bp->ut_type == SHUTDOWN_TIME) { /* everybody just logged out */ - for (tt = LIST_FIRST(&ttylist); tt;) { + for (tt = LIST_FIRST(&idlist); tt;) { LIST_REMOVE(tt, list); ttx = tt; tt = LIST_NEXT(tt, list); free(ttx); } - currentout = -bp->ut_time; - crmsg = strncmp(bp->ut_name, "shutdown", UT_NAMESIZE) ? + currentout = -bp->ut_tv.tv_sec; + crmsg = bp->ut_type != SHUTDOWN_TIME ? "crash" : "shutdown"; /* * if we're in snapshot mode, we want to exit if this @@ -276,50 +273,42 @@ doentry(struct utmp *bp) printentry(bp, NULL); return; } - /* - * if the line is '{' or '|', date got set; see - * utmp(5) for more info. - */ - if ((bp->ut_line[0] == '{' || bp->ut_line[0] == '|') && - !bp->ut_line[1]) { + /* date got set */ + if (bp->ut_type == OLD_TIME || bp->ut_type == NEW_TIME) { if (want(bp) && !snaptime) printentry(bp, NULL); return; } - /* find associated tty */ - LIST_FOREACH(tt, &ttylist, list) - if (!strncmp(tt->tty, bp->ut_line, UT_LINESIZE)) + + if (bp->ut_type != USER_PROCESS && bp->ut_type != DEAD_PROCESS) + return; + + /* find associated identifier */ + LIST_FOREACH(tt, &idlist, list) + if (!memcmp(tt->id, bp->ut_id, sizeof bp->ut_id)) break; if (tt == NULL) { /* add new one */ - tt = malloc(sizeof(struct ttytab)); + tt = malloc(sizeof(struct idtab)); if (tt == NULL) errx(1, "malloc failure"); tt->logout = currentout; - strncpy(tt->tty, bp->ut_line, UT_LINESIZE); - LIST_INSERT_HEAD(&ttylist, tt, list); + memcpy(tt->id, bp->ut_id, sizeof bp->ut_id); + LIST_INSERT_HEAD(&idlist, tt, list); } /* * print record if not in snapshot mode and wanted * or in snapshot mode and in snapshot range */ - if (bp->ut_name[0] && (want(bp) || (bp->ut_time < snaptime && + if (bp->ut_type == USER_PROCESS && (want(bp) || + (bp->ut_tv.tv_sec < snaptime && (tt->logout > snaptime || tt->logout < 1)))) { snapfound = 1; - /* - * when uucp and ftp log in over a network, the entry in - * the utmp file is the name plus their process id. See - * etc/ftpd.c and usr.bin/uucp/uucpd.c for more information. - */ - if (!strncmp(bp->ut_line, "ftp", sizeof("ftp") - 1)) - bp->ut_line[3] = '\0'; - else if (!strncmp(bp->ut_line, "uucp", sizeof("uucp") - 1)) - bp->ut_line[4] = '\0'; printentry(bp, tt); } - tt->logout = bp->ut_time; + tt->logout = bp->ut_tv.tv_sec; } /* @@ -330,7 +319,7 @@ doentry(struct utmp *bp) * logout type (crash/shutdown) as appropriate. */ void -printentry(struct utmp *bp, struct ttytab *tt) +printentry(struct utmpx *bp, struct idtab *tt) { char ct[80]; struct tm *tm; @@ -339,16 +328,30 @@ printentry(struct utmp *bp, struct ttyta if (maxrec != -1 && !maxrec--) exit(0); - t = _int_to_time(bp->ut_time); + t = bp->ut_tv.tv_sec; tm = localtime(&t); (void) strftime(ct, sizeof(ct), d_first ? (yflag ? "%a %e %b %Y %R" : "%a %e %b %R") : (yflag ? "%a %b %e %Y %R" : "%a %b %e %R"), tm); - printf("%-*.*s %-*.*s %-*.*s %s%c", - UT_NAMESIZE, UT_NAMESIZE, bp->ut_name, - UT_LINESIZE, UT_LINESIZE, bp->ut_line, - UT_HOSTSIZE, UT_HOSTSIZE, bp->ut_host, - ct, tt == NULL ? '\n' : ' '); + switch (bp->ut_type) { + case BOOT_TIME: + printf("%-42s", "boot time"); + break; + case SHUTDOWN_TIME: + printf("%-42s", "shutdown time"); + break; + case OLD_TIME: + printf("%-42s", "old time"); + break; + case NEW_TIME: + printf("%-42s", "new time"); + break; + case USER_PROCESS: + printf("%-10s %-8s %-22.22s", + bp->ut_user, bp->ut_line, bp->ut_host); + break; + } + printf(" %s%c", ct, tt == NULL ? '\n' : ' '); if (tt == NULL) return; if (!tt->logout) { @@ -363,7 +366,7 @@ printentry(struct utmp *bp, struct ttyta (void) strftime(ct, sizeof(ct), "%R", tm); printf("- %s", ct); } - delta = tt->logout - bp->ut_time; + delta = tt->logout - bp->ut_tv.tv_sec; if (sflag) { printf(" (%8ld)\n", (long)delta); } else { @@ -381,7 +384,7 @@ printentry(struct utmp *bp, struct ttyta * see if want this entry */ int -want(struct utmp *bp) +want(struct utmpx *bp) { ARG *step; @@ -394,15 +397,15 @@ want(struct utmp *bp) for (step = arglist; step; step = step->next) switch(step->type) { case HOST_TYPE: - if (!strncasecmp(step->name, bp->ut_host, UT_HOSTSIZE)) + if (!strcasecmp(step->name, bp->ut_host)) return (YES); break; case TTY_TYPE: - if (!strncmp(step->name, bp->ut_line, UT_LINESIZE)) + if (!strcmp(step->name, bp->ut_line)) return (YES); break; case USER_TYPE: - if (!strncmp(step->name, bp->ut_name, UT_NAMESIZE)) + if (!strcmp(step->name, bp->ut_user)) return (YES); break; } @@ -552,25 +555,3 @@ terr: errx(1, "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]"); return timet; } - - -/* - * onintr -- - * on interrupt, we inform the user how far we've gotten - */ -void -onintr(int signo) -{ - char ct[80]; - struct tm *tm; - time_t t = _int_to_time(buf[0].ut_time); - - tm = localtime(&t); - (void) strftime(ct, sizeof(ct), - d_first ? "%a %e %b %R" : "%a %b %e %R", - tm); - printf("\ninterrupted %s\n", ct); - if (signo == SIGINT) - exit(1); - (void)fflush(stdout); /* fix required for rsh */ -} From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:08:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED05106566C; Wed, 13 Jan 2010 18:08:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F224D8FC1C; Wed, 13 Jan 2010 18:08: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 o0DI802U082219; Wed, 13 Jan 2010 18:08:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DI80xq082216; Wed, 13 Jan 2010 18:08:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131808.o0DI80xq082216@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:08: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: r202198 - head/usr.bin/getent X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:08:01 -0000 Author: ed Date: Wed Jan 13 18:08:00 2010 New Revision: 202198 URL: http://svn.freebsd.org/changeset/base/202198 Log: Allow getent(1) to display utmpx entries as well. Because getutxent also matches the typical get*ent format of library routines, I thought it would be a good idea to teach it how to read utmpx databases. getent(1) just gives a raw dump, which is very useful when debugging problems related to parsing/logging. Modified: head/usr.bin/getent/getent.1 head/usr.bin/getent/getent.c Modified: head/usr.bin/getent/getent.1 ============================================================================== --- head/usr.bin/getent/getent.1 Wed Jan 13 18:06:31 2010 (r202197) +++ head/usr.bin/getent/getent.1 Wed Jan 13 18:08:00 2010 (r202198) @@ -75,6 +75,7 @@ argument may be one of: .It Li rpc Ta name number [alias ...] .It Li services Ta name port/protocol [alias ...] .It Li shells Ta /path/to/shell +.It Li utmpx Ta [time] type: properties .El .Pp If one or more @@ -109,6 +110,7 @@ utility exits 0 on success, or 3 if there is no support for enumeration on .Ar database . .Sh SEE ALSO +.Xr getutxent 3 , .Xr ethers 5 , .Xr group 5 , .Xr hosts 5 , Modified: head/usr.bin/getent/getent.c ============================================================================== --- head/usr.bin/getent/getent.c Wed Jan 13 18:06:31 2010 (r202197) +++ head/usr.bin/getent/getent.c Wed Jan 13 18:08:00 2010 (r202198) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static int usage(void); static int parsenum(const char *, unsigned long *); @@ -72,6 +73,7 @@ static int protocols(int, char *[]); static int rpc(int, char *[]); static int services(int, char *[]); static int shells(int, char *[]); +static int utmpx(int, char *[]); enum { RV_OK = 0, @@ -93,6 +95,7 @@ static struct getentdb { { "rpc", rpc, }, { "services", services, }, { "shells", shells, }, + { "utmpx", utmpx, }, { NULL, NULL, }, }; @@ -562,3 +565,89 @@ shells(int argc, char *argv[]) endusershell(); return rv; } + +/* + * utmpx + */ + +#define UTMPXPRINTID do { \ + size_t i; \ + for (i = 0; i < sizeof ut->ut_id; i++) \ + printf("%02hhx", ut->ut_id[i]); \ +} while (0) + +static void +utmpxprint(const struct utmpx *ut) +{ + + if (ut->ut_type == EMPTY) + return; + + printf("[%.24s] ", ctime(&ut->ut_tv.tv_sec)); + + switch (ut->ut_type) { + case BOOT_TIME: + printf("system boot\n"); + return; + case SHUTDOWN_TIME: + printf("system shutdown\n"); + return; + case OLD_TIME: + printf("old system time\n"); + return; + case NEW_TIME: + printf("new system time\n"); + return; + case USER_PROCESS: + printf("user process: id=\""); + UTMPXPRINTID; + printf("\" user=\"%s\" line=\"%s\" host=\"%s\"\n", + ut->ut_user, ut->ut_line, ut->ut_host); + break; + case DEAD_PROCESS: + printf("dead process: id=\""); + UTMPXPRINTID; + printf("\"\n"); + break; + default: + printf("unknown record type\n"); + break; + } +} + +static int +utmpx(int argc, char *argv[]) +{ + const struct utmpx *ut; + int rv = RV_OK, db; + + assert(argc > 1); + assert(argv != NULL); + + if (argc == 2) { + db = UTXDB_ACTIVE; + } else if (argc == 3) { + if (strcmp(argv[2], "active") == 0) + db = UTXDB_ACTIVE; + else if (strcmp(argv[2], "lastlogin") == 0) + db = UTXDB_LASTLOGIN; + else if (strcmp(argv[2], "log") == 0) + db = UTXDB_LOG; + else + rv = RV_USAGE; + } else { + rv = RV_USAGE; + } + + if (rv == RV_USAGE) { + fprintf(stderr, "Usage: %s utmpx [active | lastlogin | log]\n", + getprogname()); + } else if (rv == RV_OK) { + if (setutxdb(db, NULL) != 0) + return (RV_NOTFOUND); + while ((ut = getutxent()) != NULL) + utmpxprint(ut); + endutxent(); + } + return (rv); +} From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:09:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4CDD106566B; Wed, 13 Jan 2010 18:09:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C45978FC1C; Wed, 13 Jan 2010 18:09: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 o0DI9Lbe082559; Wed, 13 Jan 2010 18:09:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DI9LhZ082556; Wed, 13 Jan 2010 18:09:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131809.o0DI9LhZ082556@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:09: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: r202199 - head/usr.bin/w X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:09:21 -0000 Author: ed Date: Wed Jan 13 18:09:21 2010 New Revision: 202199 URL: http://svn.freebsd.org/changeset/base/202199 Log: Port w(1) to utmpx. Let it print "-" when the TTY string is empty. In this case, it must also make sure it doesn't match processes who also have no controlling TTY. Otherwise it will print random kernel processes when trying to pick the best matching process. Eventually it should look at the value of ut_pid as well. Modified: head/usr.bin/w/Makefile head/usr.bin/w/w.c Modified: head/usr.bin/w/Makefile ============================================================================== --- head/usr.bin/w/Makefile Wed Jan 13 18:08:00 2010 (r202198) +++ head/usr.bin/w/Makefile Wed Jan 13 18:09:21 2010 (r202199) @@ -4,8 +4,8 @@ PROG= w SRCS= fmt.c pr_time.c proc_compare.c w.c MAN= w.1 uptime.1 -DPADD= ${LIBKVM} ${LIBULOG} ${LIBUTIL} -LDADD= -lkvm -lulog -lutil +DPADD= ${LIBKVM} ${LIBUTIL} +LDADD= -lkvm -lutil #BINGRP= kmem #BINMODE=2555 LINKS= ${BINDIR}/w ${BINDIR}/uptime Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Wed Jan 13 18:08:00 2010 (r202198) +++ head/usr.bin/w/w.c Wed Jan 13 18:09:21 2010 (r202199) @@ -83,9 +83,8 @@ static const char sccsid[] = "@(#)w.c 8. #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include #include "extern.h" @@ -283,7 +282,8 @@ main(int argc, char *argv[]) if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL) err(1, "%s", kvm_geterr(kd)); for (i = 0; i < nentries; i++, kp++) { - if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB) + if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB || + kp->ki_tdev == NODEV) continue; for (ep = ehead; ep != NULL; ep = ep->next) { if (ep->tdev == kp->ki_tdev) { @@ -418,9 +418,10 @@ main(int argc, char *argv[]) (void)printf("%-*.*s %-*.*s %-*.*s ", W_DISPUSERSIZE, W_DISPUSERSIZE, ep->utmp.ut_user, W_DISPLINESIZE, W_DISPLINESIZE, - strncmp(ep->utmp.ut_line, "tty", 3) && + *ep->utmp.ut_line ? + (strncmp(ep->utmp.ut_line, "tty", 3) && strncmp(ep->utmp.ut_line, "cua", 3) ? - ep->utmp.ut_line : ep->utmp.ut_line + 3, + ep->utmp.ut_line : ep->utmp.ut_line + 3) : "-", W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); t = ep->utmp.ut_tv.tv_sec; longattime = pr_attime(&t, &now); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:09:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93F731065692; Wed, 13 Jan 2010 18:09:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB1A8FC21; Wed, 13 Jan 2010 18:09: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 o0DI9tFw082738; Wed, 13 Jan 2010 18:09:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DI9sCS082727; Wed, 13 Jan 2010 18:09:54 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131809.o0DI9sCS082727@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:09: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: r202200 - in head/usr.bin: systat users wall who write X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:09:55 -0000 Author: ed Date: Wed Jan 13 18:09:54 2010 New Revision: 202200 URL: http://svn.freebsd.org/changeset/base/202200 Log: Perform all trivial ports to utmpx for usr.bin/. They were already converted to use libulog, so it's easy to convert them to utmpx. Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/vmstat.c head/usr.bin/users/Makefile head/usr.bin/users/users.c head/usr.bin/wall/Makefile head/usr.bin/wall/wall.c head/usr.bin/who/Makefile head/usr.bin/who/who.c head/usr.bin/write/Makefile head/usr.bin/write/write.c Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/systat/Makefile Wed Jan 13 18:09:54 2010 (r202200) @@ -16,7 +16,7 @@ CFLAGS+= -DINET6 WARNS?= 0 -DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} ${LIBULOG} -LDADD= -lcursesw -lm -ldevstat -lkvm -lulog +DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} +LDADD= -lcursesw -lm -ldevstat -lkvm .include Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/systat/vmstat.c Wed Jan 13 18:09:54 2010 (r202200) @@ -65,9 +65,8 @@ static const char sccsid[] = "@(#)vmstat #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include #include "systat.h" #include "extern.h" Modified: head/usr.bin/users/Makefile ============================================================================== --- head/usr.bin/users/Makefile Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/users/Makefile Wed Jan 13 18:09:54 2010 (r202200) @@ -3,7 +3,4 @@ PROG= users -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/users/users.c Wed Jan 13 18:09:54 2010 (r202200) @@ -51,9 +51,8 @@ static const char rcsid[] = #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include typedef char namebuf[MAXLOGNAME]; Modified: head/usr.bin/wall/Makefile ============================================================================== --- head/usr.bin/wall/Makefile Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/wall/Makefile Wed Jan 13 18:09:54 2010 (r202200) @@ -6,7 +6,4 @@ SRCS= ttymsg.c wall.c BINGRP= tty BINMODE=2555 -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/wall/wall.c Wed Jan 13 18:09:54 2010 (r202200) @@ -64,9 +64,8 @@ static const char sccsid[] = "@(#)wall.c #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "ttymsg.h" Modified: head/usr.bin/who/Makefile ============================================================================== --- head/usr.bin/who/Makefile Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/who/Makefile Wed Jan 13 18:09:54 2010 (r202200) @@ -3,7 +3,4 @@ PROG= who -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/who/who.c Wed Jan 13 18:09:54 2010 (r202200) @@ -44,9 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include static void heading(void); static void process_utmp(void); @@ -109,7 +108,7 @@ main(int argc, char *argv[]) usage(); if (*argv != NULL) { - if (ulog_setutxfile(UTXI_TTY, *argv) != 0) + if (setutxdb(UTXDB_ACTIVE, *argv) != 0) err(1, "%s", *argv); } Modified: head/usr.bin/write/Makefile ============================================================================== --- head/usr.bin/write/Makefile Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/write/Makefile Wed Jan 13 18:09:54 2010 (r202200) @@ -5,7 +5,4 @@ PROG= write BINMODE=2555 BINGRP= tty -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Wed Jan 13 18:09:21 2010 (r202199) +++ head/usr.bin/write/write.c Wed Jan 13 18:09:54 2010 (r202200) @@ -62,9 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include void done(int); void do_write(char *, char *, uid_t); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:14:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA05710656B5; Wed, 13 Jan 2010 18:14:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837298FC14; Wed, 13 Jan 2010 18:14: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 o0DIExBO084046; Wed, 13 Jan 2010 18:14:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIExWh084044; Wed, 13 Jan 2010 18:14:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131814.o0DIExWh084044@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:14: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: r202203 - head/usr.sbin/ac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:14:59 -0000 Author: ed Date: Wed Jan 13 18:14:59 2010 New Revision: 202203 URL: http://svn.freebsd.org/changeset/base/202203 Log: Port ac(8) to utmpx. Similar to last(1), it must compare ut_id's instead of TTYs to determine whether a session has been terminated. It must also use ut_type to determine the type of the login record instead figuring it out by itself. Modified: head/usr.sbin/ac/ac.c Modified: head/usr.sbin/ac/ac.c ============================================================================== --- head/usr.sbin/ac/ac.c Wed Jan 13 18:12:37 2010 (r202202) +++ head/usr.sbin/ac/ac.c Wed Jan 13 18:14:59 2010 (r202203) @@ -27,14 +27,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include /* * this is for our list of currently logged in sessions */ struct utmp_list { struct utmp_list *next; - struct utmp usr; + struct utmpx usr; }; /* @@ -42,7 +42,7 @@ struct utmp_list { */ struct user_list { struct user_list *next; - char name[UT_NAMESIZE+1]; + char name[sizeof(((struct utmpx *)0)->ut_user)]; time_t secs; }; @@ -51,7 +51,7 @@ struct user_list { */ struct tty_list { struct tty_list *next; - char name[UT_LINESIZE+3]; + char name[sizeof(((struct utmpx *)0)->ut_host) + 2]; size_t len; int ret; }; @@ -81,15 +81,14 @@ static int Debug = 0; #endif int main(int, char **); -int ac(FILE *); +int ac(const char *); struct tty_list *add_tty(char *); #ifdef DEBUG -const char *debug_pfx(const struct utmp *, const struct utmp *); +const char *debug_pfx(const struct utmpx *, const struct utmpx *); #endif int do_tty(char *); -FILE *file(const char *); -struct utmp_list *log_in(struct utmp_list *, struct utmp *); -struct utmp_list *log_out(struct utmp_list *, struct utmp *); +struct utmp_list *log_in(struct utmp_list *, struct utmpx *); +struct utmp_list *log_out(struct utmp_list *, struct utmpx *); int on_console(struct utmp_list *); void show(const char *, time_t); void show_today(struct user_list *, struct utmp_list *, @@ -98,22 +97,6 @@ void show_users(struct user_list *); struct user_list *update_user(struct user_list *, char *, time_t); void usage(void); -/* - * open wtmp or die - */ -FILE * -file(const char *name) -{ - FILE *fp; - - if ((fp = fopen(name, "r")) == NULL) - err(1, "%s", name); - /* in case we want to discriminate */ - if (strcmp(_PATH_WTMP, name)) - Flags |= AC_W; - return fp; -} - struct tty_list * add_tty(char *name) { @@ -173,8 +156,7 @@ on_console(struct utmp_list *head) struct utmp_list *up; for (up = head; up; up = up->next) { - if (strncmp(up->usr.ut_line, Console, - sizeof (up->usr.ut_line)) == 0) + if (strcmp(up->usr.ut_line, Console) == 0) return 1; } return 0; @@ -190,7 +172,7 @@ update_user(struct user_list *head, char struct user_list *up; for (up = head; up != NULL; up = up->next) { - if (strncmp(up->name, name, UT_NAMESIZE) == 0) { + if (strcmp(up->name, name) == 0) { up->secs += secs; Total += secs; return head; @@ -217,9 +199,10 @@ update_user(struct user_list *head, char * includes a timestamp (perhaps with year), device-name, and user-name. */ const char * -debug_pfx(const struct utmp *event_up, const struct utmp *userinf_up) +debug_pfx(const struct utmpx *event_up, const struct utmpx *userinf_up) { - static char str_result[40+UT_LINESIZE+UT_NAMESIZE]; + static char str_result[40 + sizeof(userinf_up->ut_line) + + sizeof(userinf_up->ut_user)]; static char thisyear[5]; size_t maxcopy; time_t ut_timecopy; @@ -231,15 +214,10 @@ debug_pfx(const struct utmp *event_up, c strlcpy(thisyear, &str_result[20], sizeof(thisyear)); } - if (event_up->ut_time == 0) + if (event_up->ut_tv.tv_sec == 0) strlcpy(str_result, "*ZeroTime* --:--:-- ", sizeof(str_result)); else { - /* - * The type of utmp.ut_time is not necessary type time_t, as - * it is explicitly defined as type int32_t. Copy the value - * for platforms where sizeof(time_t) != sizeof(int32_t). - */ - ut_timecopy = _time32_to_time(event_up->ut_time); + ut_timecopy = event_up->ut_tv.tv_sec; strlcpy(str_result, ctime(&ut_timecopy), sizeof(str_result)); /* * Include the year, if it is not the same year as "now". @@ -255,22 +233,20 @@ debug_pfx(const struct utmp *event_up, c if (userinf_up->ut_line[0] == '\0') strlcat(str_result, "NoDev", sizeof(str_result)); else { - /* ut_line is not necessarily null-terminated. */ - maxcopy = strlen(str_result) + UT_LINESIZE + 1; + maxcopy = strlen(str_result) + sizeof(userinf_up->ut_line); if (maxcopy > sizeof(str_result)) maxcopy = sizeof(str_result); strlcat(str_result, userinf_up->ut_line, maxcopy); } strlcat(str_result, ": ", sizeof(str_result)); - if (userinf_up->ut_name[0] == '\0') + if (userinf_up->ut_user[0] == '\0') strlcat(str_result, "LogOff", sizeof(str_result)); else { - /* ut_name is not necessarily null-terminated. */ - maxcopy = strlen(str_result) + UT_NAMESIZE + 1; + maxcopy = strlen(str_result) + sizeof(userinf_up->ut_user); if (maxcopy > sizeof(str_result)) maxcopy = sizeof(str_result); - strlcat(str_result, userinf_up->ut_name, maxcopy); + strlcat(str_result, userinf_up->ut_user, maxcopy); } return (str_result); @@ -280,12 +256,11 @@ debug_pfx(const struct utmp *event_up, c int main(int argc, char *argv[]) { - FILE *fp; + const char *wtmpf = NULL; int c; (void) setlocale(LC_TIME, ""); - fp = NULL; while ((c = getopt(argc, argv, "Dc:dpt:w:")) != -1) { switch (c) { #ifdef DEBUG @@ -310,7 +285,8 @@ main(int argc, char *argv[]) add_tty(optarg); break; case 'w': - fp = file(optarg); + Flags |= AC_W; + wtmpf = optarg; break; case '?': default: @@ -329,16 +305,7 @@ main(int argc, char *argv[]) } if (Flags & AC_D) Flags &= ~AC_P; - if (fp == NULL) { - /* - * if _PATH_WTMP does not exist, exit quietly - */ - if (access(_PATH_WTMP, 0) != 0 && errno == ENOENT) - return 0; - - fp = file(_PATH_WTMP); - } - ac(fp); + ac(wtmpf); return 0; } @@ -349,7 +316,8 @@ main(int argc, char *argv[]) void show(const char *name, time_t secs) { - (void)printf("\t%-*s %8.2f\n", UT_NAMESIZE, name, + (void)printf("\t%-*s %8.2f\n", + (int)sizeof(((struct utmpx *)0)->ut_user), name, ((double)secs / 3600)); } @@ -384,9 +352,9 @@ show_today(struct user_list *users, stru yesterday++; for (lp = logins; lp != NULL; lp = lp->next) { - secs = yesterday - lp->usr.ut_time; - Users = update_user(Users, lp->usr.ut_name, secs); - lp->usr.ut_time = yesterday; /* as if they just logged in */ + secs = yesterday - lp->usr.ut_tv.tv_sec; + Users = update_user(Users, lp->usr.ut_user, secs); + lp->usr.ut_tv.tv_sec = yesterday; /* as if they just logged in */ } secs = 0; for (up = users; up != NULL; up = up->next) { @@ -403,16 +371,17 @@ show_today(struct user_list *users, stru * been shut down. */ struct utmp_list * -log_out(struct utmp_list *head, struct utmp *up) +log_out(struct utmp_list *head, struct utmpx *up) { struct utmp_list *lp, *lp2, *tlp; time_t secs; for (lp = head, lp2 = NULL; lp != NULL; ) - if (*up->ut_line == '~' || strncmp(lp->usr.ut_line, up->ut_line, - sizeof (up->ut_line)) == 0) { - secs = up->ut_time - lp->usr.ut_time; - Users = update_user(Users, lp->usr.ut_name, secs); + if (up->ut_type == BOOT_TIME || up->ut_type == SHUTDOWN_TIME || + (up->ut_type == DEAD_PROCESS && + memcmp(lp->usr.ut_id, up->ut_id, sizeof up->ut_id) == 0)) { + secs = up->ut_tv.tv_sec - lp->usr.ut_tv.tv_sec; + Users = update_user(Users, lp->usr.ut_user, secs); #ifdef DEBUG if (Debug) printf("%s logged out (%2d:%02d:%02d)\n", @@ -442,7 +411,7 @@ log_out(struct utmp_list *head, struct u * if do_tty says ok, login a user */ struct utmp_list * -log_in(struct utmp_list *head, struct utmp *up) +log_in(struct utmp_list *head, struct utmpx *up) { struct utmp_list *lp; @@ -491,7 +460,7 @@ log_in(struct utmp_list *head, struct ut errx(1, "malloc failed"); lp->next = head; head = lp; - memmove((char *)&lp->usr, (char *)up, sizeof (struct utmp)); + memmove(&lp->usr, up, sizeof *up); #ifdef DEBUG if (Debug) { printf("%s logged in", debug_pfx(&lp->usr, up)); @@ -505,10 +474,10 @@ log_in(struct utmp_list *head, struct ut } int -ac(FILE *fp) +ac(const char *file) { struct utmp_list *lp, *head = NULL; - struct utmp usr; + struct utmpx *usr, usht; struct tm *ltm; time_t prev_secs, secs, ut_timecopy; int day, rfound, tchanged, tskipped; @@ -517,14 +486,11 @@ ac(FILE *fp) prev_secs = 1; /* Minimum acceptable date == 1970 */ rfound = tchanged = tskipped = 0; secs = 0; - while (fread((char *)&usr, sizeof(usr), 1, fp) == 1) { + if (setutxdb(UTXDB_LOG, file) != 0) + err(1, "%s", file); + while ((usr = getutxent()) != NULL) { rfound++; - /* - * The type of utmp.ut_time is not necessary type time_t, as - * it is explicitly defined as type int32_t. Copy the value - * for platforms where sizeof(time_t) != size(int32_t). - */ - ut_timecopy = _time32_to_time(usr.ut_time); + ut_timecopy = usr->ut_tv.tv_sec; /* * With sparc64 using 64-bit time_t's, there is some system * routine which sets ut_time==0 (the high-order word of a @@ -540,10 +506,10 @@ ac(FILE *fp) #ifdef DEBUG if (Debug) printf("%s - date changed to: %s", - debug_pfx(&usr, &usr), ctime(&prev_secs)); + debug_pfx(usr, usr), ctime(&prev_secs)); #endif tchanged++; - usr.ut_time = ut_timecopy = prev_secs; + usr->ut_tv.tv_sec = ut_timecopy = prev_secs; } /* * Skip records where the time goes backwards. @@ -552,7 +518,7 @@ ac(FILE *fp) #ifdef DEBUG if (Debug) printf("%s - bad date, record skipped\n", - debug_pfx(&usr, &usr)); + debug_pfx(usr, usr)); #endif tskipped++; continue; /* Skip this invalid record. */ @@ -576,50 +542,51 @@ ac(FILE *fp) } else day = ltm->tm_yday; } - switch(*usr.ut_line) { - case '|': + switch(usr->ut_type) { + case OLD_TIME: secs = ut_timecopy; break; - case '{': + case NEW_TIME: secs -= ut_timecopy; /* * adjust time for those logged in */ for (lp = head; lp != NULL; lp = lp->next) - lp->usr.ut_time -= secs; + lp->usr.ut_tv.tv_sec -= secs; break; - case '~': /* reboot or shutdown */ - head = log_out(head, &usr); + case BOOT_TIME: + case SHUTDOWN_TIME: + head = log_out(head, usr); FirstTime = ut_timecopy; /* shouldn't be needed */ break; - default: + case USER_PROCESS: /* * if they came in on tty[p-sP-S]*, then it is only * a login session if the ut_host field is non-empty */ - if (*usr.ut_name) { - if (strncmp(usr.ut_line, "tty", 3) == 0 || - strchr("pqrsPQRS", usr.ut_line[3]) != 0 || - *usr.ut_host != '\0') - head = log_in(head, &usr); + if (strncmp(usr->ut_line, "tty", 3) != 0 || + strchr("pqrsPQRS", usr->ut_line[3]) == NULL || + *usr->ut_host != '\0') + head = log_in(head, usr); #ifdef DEBUG - else if (Debug > 1) - /* Things such as 'screen' sessions. */ - printf("%s - record ignored\n", - debug_pfx(&usr, &usr)); + else if (Debug > 1) + /* Things such as 'screen' sessions. */ + printf("%s - record ignored\n", + debug_pfx(usr, usr)); #endif - } else - head = log_out(head, &usr); + break; + case DEAD_PROCESS: + head = log_out(head, usr); break; } } - (void)fclose(fp); + endutxent(); if (!(Flags & AC_W)) - usr.ut_time = time((time_t *)0); - (void)strcpy(usr.ut_line, "~"); + usht.ut_tv.tv_sec = time(NULL); + usht.ut_type = SHUTDOWN_TIME; if (Flags & AC_D) { - ut_timecopy = _time32_to_time(usr.ut_time); + ut_timecopy = usht.ut_tv.tv_sec; ltm = localtime(&ut_timecopy); if (day >= 0 && day != ltm->tm_yday) { /* @@ -635,7 +602,7 @@ ac(FILE *fp) /* * anyone still logged in gets time up to now */ - head = log_out(head, &usr); + head = log_out(head, &usht); if (Flags & AC_D) show_today(Users, head, time((time_t *)0)); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:15:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD34310656A6; Wed, 13 Jan 2010 18:15:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C958FC25; Wed, 13 Jan 2010 18: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 o0DIFkfd084271; Wed, 13 Jan 2010 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIFkng084268; Wed, 13 Jan 2010 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131815.o0DIFkng084268@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:15: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: r202204 - head/usr.sbin/timed/timed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:15:46 -0000 Author: ed Date: Wed Jan 13 18:15:46 2010 New Revision: 202204 URL: http://svn.freebsd.org/changeset/base/202204 Log: Port timed away from logwtmp(3). Let it use utmpx. Modified: head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/slave.c Modified: head/usr.sbin/timed/timed/master.c ============================================================================== --- head/usr.sbin/timed/timed/master.c Wed Jan 13 18:14:59 2010 (r202203) +++ head/usr.sbin/timed/timed/master.c Wed Jan 13 18:15:46 2010 (r202204) @@ -44,6 +44,7 @@ static const char rcsid[] = #include #include #include +#include #include "pathnames.h" extern int measure_delta; @@ -56,8 +57,6 @@ static int slvcount; /* slaves listeni static void mchgdate(struct tsp *); -extern void logwtmp(char *, char *, char *); - /* * The main function of `master' is to periodically compute the differences * (deltas) between its clock and the clocks of the slaves, to compute the @@ -350,6 +349,7 @@ mchgdate(msg) char tname[MAXHOSTNAMELEN]; char olddate[32]; struct timeval otime, ntime, tmptv; + struct utmpx utx; (void)strcpy(tname, msg->tsp_name); @@ -371,9 +371,13 @@ mchgdate(msg) dictate = 3; synch(tvtomsround(ntime)); } else { - logwtmp("|", "date", ""); + utx.ut_type = OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); (void)settimeofday(&tmptv, 0); - logwtmp("{", "date", ""); + utx.ut_type = NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); spreadtime(); } Modified: head/usr.sbin/timed/timed/slave.c ============================================================================== --- head/usr.sbin/timed/timed/slave.c Wed Jan 13 18:14:59 2010 (r202203) +++ head/usr.sbin/timed/timed/slave.c Wed Jan 13 18:15:46 2010 (r202204) @@ -41,6 +41,7 @@ static const char rcsid[] = #include "globals.h" #include +#include #include "pathnames.h" extern jmp_buf jmpenv; @@ -57,8 +58,6 @@ static void schgdate(struct tsp *, char static void setmaster(struct tsp *); static void answerdelay(void); -extern void logwtmp(char *, char *, char *); - int slave() { @@ -80,6 +79,7 @@ slave() char newdate[32]; struct netinfo *ntp; struct hosttbl *htp; + struct utmpx utx; old_slavenet = 0; @@ -280,9 +280,13 @@ loop: */ synch(tvtomsround(ntime)); } else { - logwtmp("|", "date", ""); - (void)settimeofday(&tmptv, 0); - logwtmp("{", "date", ""); + utx.ut_type = OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); + (void)settimeofday(&tmptv, 0); + utx.ut_type = NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); syslog(LOG_NOTICE, "date changed by %s from %s", msg->tsp_name, olddate); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:17:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A9F10656A7; Wed, 13 Jan 2010 18:17:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7AFF8FC15; Wed, 13 Jan 2010 18:17: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 o0DIHC4s084607; Wed, 13 Jan 2010 18:17:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIHC44084604; Wed, 13 Jan 2010 18:17:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131817.o0DIHC44084604@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:17: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: r202205 - head/usr.sbin/lastlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:17:13 -0000 Author: ed Date: Wed Jan 13 18:17:12 2010 New Revision: 202205 URL: http://svn.freebsd.org/changeset/base/202205 Log: Port lastlogin(8) to utmpx. While there, fix a bug I introduced previously. We must reopen the database for each username passed on the command line. We must rewind the database and search from the beginning. Modified: head/usr.sbin/lastlogin/Makefile head/usr.sbin/lastlogin/lastlogin.c Modified: head/usr.sbin/lastlogin/Makefile ============================================================================== --- head/usr.sbin/lastlogin/Makefile Wed Jan 13 18:15:46 2010 (r202204) +++ head/usr.sbin/lastlogin/Makefile Wed Jan 13 18:17:12 2010 (r202205) @@ -3,7 +3,4 @@ PROG= lastlogin MAN= lastlogin.8 -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Wed Jan 13 18:15:46 2010 (r202204) +++ head/usr.sbin/lastlogin/lastlogin.c Wed Jan 13 18:17:12 2010 (r202205) @@ -41,62 +41,62 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998 #include #include #include -#include #include +#include int main(int, char **); -static void output(struct ulog_utmpx *); +static void output(struct utmpx *); static void usage(void); int main(int argc, char *argv[]) { int ch, i; - struct ulog_utmpx *u; + struct utmpx *u; while ((ch = getopt(argc, argv, "")) != -1) { usage(); } - if (ulog_setutxfile(UTXI_USER, NULL) != 0) - errx(1, "failed to open lastlog database"); - setpassent(1); /* Keep passwd file pointers open */ /* Process usernames given on the command line. */ if (argc > 1) { for (i = 1; i < argc; ++i) { - if ((u = ulog_getutxuser(argv[i])) == NULL) { + if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) + errx(1, "failed to open lastlog database"); + if ((u = getutxuser(argv[i])) == NULL) { warnx("user '%s' not found", argv[i]); continue; } output(u); + endutxent(); } } /* Read all lastlog entries, looking for active ones */ else { - while ((u = ulog_getutxent()) != NULL) { + if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) + errx(1, "failed to open lastlog database"); + while ((u = getutxent()) != NULL) { if (u->ut_type != USER_PROCESS) continue; output(u); } + endutxent(); } setpassent(0); /* Close passwd file pointers */ - - ulog_endutxent(); exit(0); } /* Duplicate the output of last(1) */ static void -output(struct ulog_utmpx *u) +output(struct utmpx *u) { time_t t = u->ut_tv.tv_sec; - printf("%-16s %-8s %-16s %s", - u->ut_user, u->ut_line, u->ut_host, - (u->ut_type == USER_PROCESS) ? ctime(&t) : "Never logged in\n"); + printf("%-10s %-8s %-22s %s", + u->ut_user, u->ut_line, u->ut_host, ctime(&t)); } static void From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:17:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4F441065672; Wed, 13 Jan 2010 18:17:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3C918FC08; Wed, 13 Jan 2010 18:17: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 o0DIHr7e084806; Wed, 13 Jan 2010 18:17:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIHrkQ084799; Wed, 13 Jan 2010 18:17:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131817.o0DIHrkQ084799@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:17: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: r202206 - in head/usr.sbin: bsnmpd/modules/snmp_hostres rwhod syslogd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:17:54 -0000 Author: ed Date: Wed Jan 13 18:17:53 2010 New Revision: 202206 URL: http://svn.freebsd.org/changeset/base/202206 Log: Port all applications in usr.sbin/ from libulog to utmpx. Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c head/usr.sbin/rwhod/Makefile head/usr.sbin/rwhod/rwhod.c head/usr.sbin/syslogd/Makefile head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Wed Jan 13 18:17:53 2010 (r202206) @@ -69,8 +69,8 @@ MAN= snmp_hostres.3 DEFS= ${MOD}_tree.def BMIBS= BEGEMOT-HOSTRES-MIB.txt -DPADD= ${LIBKVM} ${LIBDEVINFO} ${LIBM} ${LIBGEOM} ${LIBMEMSTAT} ${LIBULOG} -LDADD= -lkvm -ldevinfo -lm -lgeom -lmemstat -lulog +DPADD= ${LIBKVM} ${LIBDEVINFO} ${LIBM} ${LIBGEOM} ${LIBMEMSTAT} +LDADD= -lkvm -ldevinfo -lm -lgeom -lmemstat .include Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c Wed Jan 13 18:17:53 2010 (r202206) @@ -41,8 +41,7 @@ #include #include #include -#define _ULOG_POSIX_NAMES -#include +#include #include "hostres_snmp.h" #include "hostres_oid.h" Modified: head/usr.sbin/rwhod/Makefile ============================================================================== --- head/usr.sbin/rwhod/Makefile Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/rwhod/Makefile Wed Jan 13 18:17:53 2010 (r202206) @@ -6,7 +6,4 @@ MAN= rwhod.8 WARNS?= 3 -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/rwhod/rwhod.c Wed Jan 13 18:17:53 2010 (r202206) @@ -67,9 +67,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include #include Modified: head/usr.sbin/syslogd/Makefile ============================================================================== --- head/usr.sbin/syslogd/Makefile Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/syslogd/Makefile Wed Jan 13 18:17:53 2010 (r202206) @@ -9,8 +9,8 @@ PROG= syslogd MAN= syslog.conf.5 syslogd.8 SRCS= syslogd.c ttymsg.c -DPADD= ${LIBULOG} ${LIBUTIL} -LDADD= -lulog -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil WARNS?= 3 Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Jan 13 18:17:12 2010 (r202205) +++ head/usr.sbin/syslogd/syslogd.c Wed Jan 13 18:17:53 2010 (r202206) @@ -105,9 +105,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "pathnames.h" #include "ttymsg.h" From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:24:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92F71065692; Wed, 13 Jan 2010 18:24:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8C5D8FC17; Wed, 13 Jan 2010 18:24: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 o0DIO4Sd086221; Wed, 13 Jan 2010 18:24:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIO46j086219; Wed, 13 Jan 2010 18:24:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131824.o0DIO46j086219@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:24: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: r202207 - head/libexec/rlogind X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:24:04 -0000 Author: ed Date: Wed Jan 13 18:24:04 2010 New Revision: 202207 URL: http://svn.freebsd.org/changeset/base/202207 Log: Remove `dead code' from rlogind. - It shouldn't call logwtmp(). Applications like login(1) already make sure both login and logout entries are written to the storage. - There's no need to restore permissions on the pseudo-terminal, since it should be garbage collected by the kernel. Modified: head/libexec/rlogind/rlogind.c Modified: head/libexec/rlogind/rlogind.c ============================================================================== --- head/libexec/rlogind/rlogind.c Wed Jan 13 18:17:53 2010 (r202206) +++ head/libexec/rlogind/rlogind.c Wed Jan 13 18:24:04 2010 (r202207) @@ -479,18 +479,7 @@ protocol(int f, int p) void cleanup(int signo) { - char *p; - p = line + sizeof(_PATH_DEV) - 1; - if (logout(p)) - logwtmp(p, "", ""); - (void)chflags(line, 0); - (void)chmod(line, 0666); - (void)chown(line, 0, 0); - *p = 'p'; - (void)chflags(line, 0); - (void)chmod(line, 0666); - (void)chown(line, 0, 0); shutdown(netf, SHUT_RDWR); exit(1); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:25:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 478701065670; Wed, 13 Jan 2010 18:25:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 363BA8FC1D; Wed, 13 Jan 2010 18:25: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 o0DIPifI086617; Wed, 13 Jan 2010 18:25:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIPiwJ086615; Wed, 13 Jan 2010 18:25:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131825.o0DIPiwJ086615@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:25: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: r202208 - head/libexec/comsat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:25:44 -0000 Author: ed Date: Wed Jan 13 18:25:43 2010 New Revision: 202208 URL: http://svn.freebsd.org/changeset/base/202208 Log: Port comsat to utmpx. It seems comsat stats the utmpx database each 15 seconds to see whether it has been changed. I am changing this behaviour to look at the utmpx database upon processing. I don't want to allow direct interference with the database files. I also wonder whether this optimization has any measurable performance benefit nowadays. Modified: head/libexec/comsat/comsat.c Modified: head/libexec/comsat/comsat.c ============================================================================== --- head/libexec/comsat/comsat.c Wed Jan 13 18:24:04 2010 (r202207) +++ head/libexec/comsat/comsat.c Wed Jan 13 18:25:43 2010 (r202208) @@ -66,7 +66,7 @@ static const char rcsid[] = #include #include #include -#include +#include int debug = 0; #define dsyslog if (debug) syslog @@ -74,14 +74,10 @@ int debug = 0; #define MAXIDLE 120 char hostname[MAXHOSTNAMELEN]; -struct utmp *utmp = NULL; -time_t lastmsgtime; -int nutmp, uf; void jkfprintf(FILE *, char[], char[], off_t); void mailfor(char *); -void notify(struct utmp *, char[], off_t, int); -void onalrm(int); +void notify(struct utmpx *, char[], off_t, int); void reapchildren(int); int @@ -102,15 +98,7 @@ main(int argc __unused, char *argv[] __u (void) recv(0, msgbuf, sizeof(msgbuf) - 1, 0); exit(1); } - if ((uf = open(_PATH_UTMP, O_RDONLY, 0)) < 0) { - syslog(LOG_ERR, "open: %s: %m", _PATH_UTMP); - (void) recv(0, msgbuf, sizeof(msgbuf) - 1, 0); - exit(1); - } - (void)time(&lastmsgtime); (void)gethostname(hostname, sizeof(hostname)); - onalrm(0); - (void)signal(SIGALRM, onalrm); (void)signal(SIGTTOU, SIG_IGN); (void)signal(SIGCHLD, reapchildren); for (;;) { @@ -121,11 +109,7 @@ main(int argc __unused, char *argv[] __u errno = 0; continue; } - if (!nutmp) /* no one has logged in yet */ - continue; - sigblock(sigmask(SIGALRM)); msgbuf[cc] = '\0'; - (void)time(&lastmsgtime); mailfor(msgbuf); sigsetmask(0L); } @@ -138,40 +122,15 @@ reapchildren(int signo __unused) } void -onalrm(int signo __unused) -{ - static off_t utmpsize; /* last malloced size for utmp */ - static time_t utmpmtime; /* last modification time for utmp */ - struct stat statbf; - - if (time(NULL) - lastmsgtime >= MAXIDLE) - exit(0); - (void)alarm((u_int)15); - (void)fstat(uf, &statbf); - if (statbf.st_mtime > utmpmtime) { - utmpmtime = statbf.st_mtime; - if (statbf.st_size > utmpsize) { - utmpsize = statbf.st_size + 10 * sizeof(struct utmp); - if ((utmp = realloc(utmp, utmpsize)) == NULL) { - syslog(LOG_ERR, "%s", strerror(errno)); - exit(1); - } - } - (void)lseek(uf, (off_t)0, SEEK_SET); - nutmp = read(uf, utmp, (size_t)statbf.st_size)/sizeof(struct utmp); - } -} - -void mailfor(char *name) { - struct utmp *utp = &utmp[nutmp]; + struct utmpx *utp; char *cp; char *file; off_t offset; int folder; - char buf[sizeof(_PATH_MAILDIR) + sizeof(utmp[0].ut_name) + 1]; - char buf2[sizeof(_PATH_MAILDIR) + sizeof(utmp[0].ut_name) + 1]; + char buf[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; + char buf2[sizeof(_PATH_MAILDIR) + sizeof(utp->ut_user) + 1]; if (!(cp = strchr(name, '@'))) return; @@ -181,33 +140,35 @@ mailfor(char *name) file = name; else file = cp + 1; - sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utmp[0].ut_name), + sprintf(buf, "%s/%.*s", _PATH_MAILDIR, (int)sizeof(utp->ut_user), name); if (*file != '/') { sprintf(buf2, "%s/%.*s", _PATH_MAILDIR, - (int)sizeof(utmp[0].ut_name), file); + (int)sizeof(utp->ut_user), file); file = buf2; } folder = strcmp(buf, file); - while (--utp >= utmp) - if (!strncmp(utp->ut_name, name, sizeof(utmp[0].ut_name))) + setutxent(); + while ((utp = getutxent()) != NULL) + if (utp->ut_type == USER_PROCESS && !strcmp(utp->ut_user, name)) notify(utp, file, offset, folder); + endutxent(); } static const char *cr; void -notify(struct utmp *utp, char file[], off_t offset, int folder) +notify(struct utmpx *utp, char file[], off_t offset, int folder) { FILE *tp; struct stat stb; struct termios tio; - char tty[20], name[sizeof(utmp[0].ut_name) + 1]; - const char *line = utp->ut_line; + char tty[20]; + const char *s = utp->ut_line; - if (strncmp(line, "pts/", 4) == 0) - line += 4; - if (strchr(line, '/')) { + if (strncmp(s, "pts/", 4) == 0) + s += 4; + if (strchr(s, '/')) { /* A slash is an attempt to break security... */ syslog(LOG_AUTH | LOG_NOTICE, "Unexpected `/' in `%s'", utp->ut_line); @@ -216,10 +177,10 @@ notify(struct utmp *utp, char file[], of (void)snprintf(tty, sizeof(tty), "%s%.*s", _PATH_DEV, (int)sizeof(utp->ut_line), utp->ut_line); if (stat(tty, &stb) == -1 || !(stb.st_mode & (S_IXUSR | S_IXGRP))) { - dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_name, tty); + dsyslog(LOG_DEBUG, "%s: wrong mode on %s", utp->ut_user, tty); return; } - dsyslog(LOG_DEBUG, "notify %s on %s\n", utp->ut_name, tty); + dsyslog(LOG_DEBUG, "notify %s on %s\n", utp->ut_user, tty); switch (fork()) { case -1: syslog(LOG_NOTICE, "fork failed (%m)"); @@ -229,25 +190,21 @@ notify(struct utmp *utp, char file[], of default: return; } - (void)signal(SIGALRM, SIG_DFL); - (void)alarm((u_int)30); if ((tp = fopen(tty, "w")) == NULL) { dsyslog(LOG_ERR, "%s: %s", tty, strerror(errno)); _exit(1); } (void)tcgetattr(fileno(tp), &tio); cr = ((tio.c_oflag & (OPOST|ONLCR)) == (OPOST|ONLCR)) ? "\n" : "\n\r"; - (void)strncpy(name, utp->ut_name, sizeof(utp->ut_name)); - name[sizeof(name) - 1] = '\0'; switch (stb.st_mode & (S_IXUSR | S_IXGRP)) { case S_IXUSR: case (S_IXUSR | S_IXGRP): (void)fprintf(tp, "%s\007New mail for %s@%.*s\007 has arrived%s%s%s:%s----%s", - cr, name, (int)sizeof(hostname), hostname, + cr, utp->ut_user, (int)sizeof(hostname), hostname, folder ? cr : "", folder ? "to " : "", folder ? file : "", cr, cr); - jkfprintf(tp, name, file, offset); + jkfprintf(tp, utp->ut_user, file, offset); break; case S_IXGRP: (void)fprintf(tp, "\007"); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:28:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 863F91065679; Wed, 13 Jan 2010 18:28:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9248FC1F; Wed, 13 Jan 2010 18:28: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 o0DISf18087307; Wed, 13 Jan 2010 18:28:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DISfZw087304; Wed, 13 Jan 2010 18:28:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131828.o0DISfZw087304@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:28: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: r202209 - head/libexec/ftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:28:41 -0000 Author: ed Date: Wed Jan 13 18:28:41 2010 New Revision: 202209 URL: http://svn.freebsd.org/changeset/base/202209 Log: Port ftpd to utmpx. Unfortunately I have to partially wreck its functionality, though. ftpd used to keep a file descriptor to the wtmp, which allowed it to work from within a chroot. The current utmpx implementation doesn't offer a way to do this. Maybe we can address this in the future, if it turns out to be a real issue. Modified: head/libexec/ftpd/ftpd.c head/libexec/ftpd/logwtmp.c Modified: head/libexec/ftpd/ftpd.c ============================================================================== --- head/libexec/ftpd/ftpd.c Wed Jan 13 18:25:43 2010 (r202208) +++ head/libexec/ftpd/ftpd.c Wed Jan 13 18:28:41 2010 (r202209) @@ -173,8 +173,7 @@ static struct ftphost { char remotehost[NI_MAXHOST]; char *ident = NULL; -static char ttyline[20]; -char *tty = ttyline; /* for klogin */ +static char wtmpid[20]; #ifdef USE_PAM static int auth_pam(struct passwd**, const char*); @@ -584,8 +583,7 @@ gotchild: data_source.su_port = htons(ntohs(ctrl_addr.su_port) - 1); - /* set this here so klogin can use it... */ - (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid()); + (void)snprintf(wtmpid, sizeof(wtmpid), "%xftpd", getpid()); /* Try to handle urgent data inline */ #ifdef SO_OOBINLINE @@ -1180,8 +1178,8 @@ end_login(void) #endif (void) seteuid(0); - if (logged_in && dowtmp) - ftpd_logwtmp(ttyline, "", NULL); + if (logged_in && dowtmp && !dochroot) + ftpd_logwtmp(wtmpid, "", NULL); pw = NULL; #ifdef LOGIN_CAP setusercontext(NULL, getpwuid(0), 0, @@ -1476,9 +1474,16 @@ skip: } #endif - /* open wtmp before chroot */ - if (dowtmp) - ftpd_logwtmp(ttyline, pw->pw_name, + dochroot = + checkuser(_PATH_FTPCHROOT, pw->pw_name, 1, &residue) +#ifdef LOGIN_CAP /* Allow login.conf configuration as well */ + || login_getcapbool(lc, "ftp-chroot", 0) +#endif + ; + chrootdir = NULL; + + if (dowtmp && !dochroot) + ftpd_logwtmp(wtmpid, pw->pw_name, (struct sockaddr *)&his_addr); logged_in = 1; @@ -1491,13 +1496,6 @@ skip: if (statfd < 0) stats = 0; - dochroot = - checkuser(_PATH_FTPCHROOT, pw->pw_name, 1, &residue) -#ifdef LOGIN_CAP /* Allow login.conf configuration as well */ - || login_getcapbool(lc, "ftp-chroot", 0) -#endif - ; - chrootdir = NULL; /* * For a chrooted local user, * a) see whether ftpchroot(5) specifies a chroot directory, @@ -2732,9 +2730,9 @@ void dologout(int status) { - if (logged_in && dowtmp) { + if (logged_in && dowtmp && !dochroot) { (void) seteuid(0); - ftpd_logwtmp(ttyline, "", NULL); + ftpd_logwtmp(wtmpid, "", NULL); } /* beware of flushing buffers after a SIGPIPE */ _exit(status); Modified: head/libexec/ftpd/logwtmp.c ============================================================================== --- head/libexec/ftpd/logwtmp.c Wed Jan 13 18:25:43 2010 (r202208) +++ head/libexec/ftpd/logwtmp.c Wed Jan 13 18:28:41 2010 (r202209) @@ -46,47 +46,35 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include -#include +#include #include #include -#include +#include +#include #include "extern.h" -static int fd = -1; - -/* - * Modified version of logwtmp that holds wtmp file open - * after first call, for use with ftp (which may chroot - * after login, but before logout). - */ void -ftpd_logwtmp(line, name, addr) - char *line, *name; - struct sockaddr *addr; +ftpd_logwtmp(char *id, char *user, struct sockaddr *addr) { - struct utmp ut; - struct stat buf; - char host[UT_HOSTSIZE]; - - if (addr == NULL) - host[0] = '\0'; - else - realhostname_sa(host, sizeof(host), addr, addr->sa_len); - - if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) - return; - if (fstat(fd, &buf) == 0) { - (void)strncpy(ut.ut_line, line, sizeof(ut.ut_line)); - (void)strncpy(ut.ut_name, name, sizeof(ut.ut_name)); - (void)strncpy(ut.ut_host, host, sizeof(ut.ut_host)); - ut.ut_time = _time_to_time32(time(NULL)); - if (write(fd, &ut, sizeof(struct utmp)) != - sizeof(struct utmp)) - (void)ftruncate(fd, buf.st_size); + struct utmpx ut; + + memset(&ut, 0, sizeof(ut)); + + if (*user != '\0') { + /* Log in. */ + ut.ut_type = USER_PROCESS; + (void)strncpy(ut.ut_user, user, sizeof(ut.ut_user)); + if (addr != NULL) + realhostname_sa(ut.ut_host, sizeof(ut.ut_host), + addr, addr->sa_len); + } else { + /* Log out. */ + ut.ut_type = DEAD_PROCESS; } + + ut.ut_pid = getpid(); + gettimeofday(&ut.ut_tv, NULL); + (void)strncpy(ut.ut_id, id, sizeof(ut.ut_id)); + + pututxline(&ut); } From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:28:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537B11065692; Wed, 13 Jan 2010 18:28:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 298B78FC0A; Wed, 13 Jan 2010 18:28: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 o0DISxhM087410; Wed, 13 Jan 2010 18:28:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DISxPx087405; Wed, 13 Jan 2010 18:28:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131828.o0DISxPx087405@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:28: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: r202210 - in head/libexec: rpc.rusersd talkd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:28:59 -0000 Author: ed Date: Wed Jan 13 18:28:58 2010 New Revision: 202210 URL: http://svn.freebsd.org/changeset/base/202210 Log: Port all apps in libexec/ from libulog to utmpx. Modified: head/libexec/rpc.rusersd/Makefile head/libexec/rpc.rusersd/rusers_proc.c head/libexec/talkd/Makefile head/libexec/talkd/process.c Modified: head/libexec/rpc.rusersd/Makefile ============================================================================== --- head/libexec/rpc.rusersd/Makefile Wed Jan 13 18:28:41 2010 (r202209) +++ head/libexec/rpc.rusersd/Makefile Wed Jan 13 18:28:58 2010 (r202210) @@ -4,8 +4,8 @@ PROG = rpc.rusersd SRCS = rusersd.c rusers_proc.c MAN = rpc.rusersd.8 -DPADD= ${LIBRPCSVC} ${LIBULOG} ${LIBUTIL} -LDADD= -lrpcsvc -lulog -lutil +DPADD= ${LIBRPCSVC} ${LIBUTIL} +LDADD= -lrpcsvc -lutil #.if exists(/usr/X11R6/include/X11/extensions/xidle.h) #CFLAGS+= -DXIDLE Modified: head/libexec/rpc.rusersd/rusers_proc.c ============================================================================== --- head/libexec/rpc.rusersd/rusers_proc.c Wed Jan 13 18:28:41 2010 (r202209) +++ head/libexec/rpc.rusersd/rusers_proc.c Wed Jan 13 18:28:58 2010 (r202210) @@ -45,8 +45,7 @@ static const char rcsid[] = #include #include #include -#define _ULOG_POSIX_NAMES -#include +#include #ifdef XIDLE #include #include Modified: head/libexec/talkd/Makefile ============================================================================== --- head/libexec/talkd/Makefile Wed Jan 13 18:28:41 2010 (r202209) +++ head/libexec/talkd/Makefile Wed Jan 13 18:28:58 2010 (r202210) @@ -7,8 +7,4 @@ SRCS= talkd.c announce.c process.c table MAN= talkd.8 CFLAGS+=-I${.CURDIR}/../../usr.bin/wall - -DPADD= ${LIBULOG} -LDADD= -lulog - .include Modified: head/libexec/talkd/process.c ============================================================================== --- head/libexec/talkd/process.c Wed Jan 13 18:28:41 2010 (r202209) +++ head/libexec/talkd/process.c Wed Jan 13 18:28:58 2010 (r202210) @@ -59,8 +59,7 @@ static const char rcsid[] = #include #include #include -#define _ULOG_POSIX_NAMES -#include +#include #include "extern.h" From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:32:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFE5106566C; Wed, 13 Jan 2010 18:32:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4548FC1B; Wed, 13 Jan 2010 18:32: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 o0DIWVdE088210; Wed, 13 Jan 2010 18:32:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIWVtl088208; Wed, 13 Jan 2010 18:32:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131832.o0DIWVtl088208@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:32: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: r202211 - head/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:32:31 -0000 Author: ed Date: Wed Jan 13 18:32:31 2010 New Revision: 202211 URL: http://svn.freebsd.org/changeset/base/202211 Log: Let pam_lastlog use utmpx instead of libulog's utmpx interface. It will still use ulog_login(3) and ulog_logout(3), which will remain present. Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 13 18:28:58 2010 (r202210) +++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 13 18:32:31 2010 (r202211) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define PAM_SM_SESSION @@ -61,7 +62,7 @@ pam_sm_open_session(pam_handle_t *pamh, int argc __unused, const char *argv[] __unused) { struct passwd *pwd; - struct ulog_utmpx *utx; + struct utmpx *utx; time_t t; const char *user; const void *rhost, *tty; @@ -91,10 +92,10 @@ pam_sm_open_session(pam_handle_t *pamh, } if ((flags & PAM_SILENT) == 0) { - if (ulog_setutxfile(UTXI_USER, NULL) != 0) { - PAM_LOG("Failed to open lastlog database"); + if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) { + PAM_LOG("Failed to open lastlogin database"); } else { - utx = ulog_getutxuser(user); + utx = getutxuser(user); if (utx != NULL && utx->ut_type == USER_PROCESS) { t = utx->ut_tv.tv_sec; if (*utx->ut_host != '\0') @@ -104,7 +105,7 @@ pam_sm_open_session(pam_handle_t *pamh, pam_info(pamh, "Last login: %.*s on %s", 24 - 5, ctime(&t), utx->ut_line); } - ulog_endutxent(); + endutxent(); } } From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:37:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0797E1065672; Wed, 13 Jan 2010 18:37:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB11D8FC17; Wed, 13 Jan 2010 18:37: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 o0DIbgDA089410; Wed, 13 Jan 2010 18:37:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIbgen089407; Wed, 13 Jan 2010 18:37:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131837.o0DIbgen089407@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:37: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: r202212 - head/contrib/telnet/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:37:43 -0000 Author: ed Date: Wed Jan 13 18:37:42 2010 New Revision: 202212 URL: http://svn.freebsd.org/changeset/base/202212 Log: Let telnetd build without utmp and logwtmp(3). Just like rlogind, there is no need to change the ownership of the terminal during shutdown anymore. Also don't call logwtmp, because the login(1)/PAM is responsible for doing this. Also use SHUT_RDWR instead of 2. Modified: head/contrib/telnet/telnetd/sys_term.c head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/sys_term.c ============================================================================== --- head/contrib/telnet/telnetd/sys_term.c Wed Jan 13 18:32:31 2010 (r202211) +++ head/contrib/telnet/telnetd/sys_term.c Wed Jan 13 18:37:42 2010 (r202212) @@ -1303,24 +1303,7 @@ scrub_env(void) void cleanup(int sig __unused) { - char *p; - sigset_t mask; - p = line + sizeof(_PATH_DEV) - 1; - /* - * Block all signals before clearing the utmp entry. We don't want to - * be called again after calling logout() and then not add the wtmp - * entry because of not finding the corresponding entry in utmp. - */ - sigfillset(&mask); - sigprocmask(SIG_SETMASK, &mask, NULL); - if (logout(p)) - logwtmp(p, "", ""); - (void)chmod(line, 0666); - (void)chown(line, 0, 0); - *p = 'p'; - (void)chmod(line, 0666); - (void)chown(line, 0, 0); - (void) shutdown(net, 2); + (void) shutdown(net, SHUT_RDWR); _exit(1); } Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:32:31 2010 (r202211) +++ head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:37:42 2010 (r202212) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:43:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E10F1065672; Wed, 13 Jan 2010 18:43:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CC468FC17; Wed, 13 Jan 2010 18:43: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 o0DIhWr9090700; Wed, 13 Jan 2010 18:43:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIhWuL090695; Wed, 13 Jan 2010 18:43:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131843.o0DIhWuL090695@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:43:32 +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: r202213 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:43:32 -0000 Author: ed Date: Wed Jan 13 18:43:32 2010 New Revision: 202213 URL: http://svn.freebsd.org/changeset/base/202213 Log: Make OpenSSH work with utmpx. - Partially revert r184122 (sshd.c). Our ut_host is now big enough to fit proper hostnames. - Change config.h to match reality. - defines.h requires UTMPX_FILE to be set by before it allows the utmpx code to work. This makes no sense to me. I've already mentioned this upstream. - Add our own platform-specific handling of lastlog. The version I will send to the OpenSSH folks will use proper autoconf generated definitions instead of `#if 1'. Modified: head/crypto/openssh/config.h head/crypto/openssh/defines.h head/crypto/openssh/loginrec.c head/crypto/openssh/sshd.c Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Wed Jan 13 18:37:42 2010 (r202212) +++ head/crypto/openssh/config.h Wed Jan 13 18:43:32 2010 (r202213) @@ -85,13 +85,13 @@ /* #undef CONF_UTMPX_FILE */ /* Define if you want to specify the path to your utmp file */ -#define CONF_UTMP_FILE "/var/run/utmp" +/* #undef CONF_UTMP_FILE */ /* Define if you want to specify the path to your wtmpx file */ /* #undef CONF_WTMPX_FILE */ /* Define if you want to specify the path to your wtmp file */ -#define CONF_WTMP_FILE "/var/log/wtmp" +/* #undef CONF_WTMP_FILE */ /* Define if your platform needs to skip post auth file descriptor passing */ /* #undef DISABLE_FD_PASSING */ @@ -112,13 +112,13 @@ /* #undef DISABLE_SHADOW */ /* Define if you don't want to use utmp */ -/* #undef DISABLE_UTMP */ +#define DISABLE_UTMP 1 /* Define if you don't want to use utmpx */ -#define DISABLE_UTMPX 1 +/* #undef DISABLE_UTMPX */ /* Define if you don't want to use wtmp */ -/* #undef DISABLE_WTMP */ +#define DISABLE_WTMP 1 /* Define if you don't want to use wtmpx */ #define DISABLE_WTMPX 1 @@ -319,7 +319,7 @@ /* #undef HAVE_ENDUTENT */ /* Define to 1 if you have the `endutxent' function. */ -/* #undef HAVE_ENDUTXENT */ +#define HAVE_ENDUTXENT 1 /* Define if your system has /etc/default/login */ /* #undef HAVE_ETC_DEFAULT_LOGIN */ @@ -445,13 +445,13 @@ /* #undef HAVE_GETUTLINE */ /* Define to 1 if you have the `getutxent' function. */ -/* #undef HAVE_GETUTXENT */ +#define HAVE_GETUTXENT 1 /* Define to 1 if you have the `getutxid' function. */ -/* #undef HAVE_GETUTXID */ +#define HAVE_GETUTXID 1 /* Define to 1 if you have the `getutxline' function. */ -/* #undef HAVE_GETUTXLINE */ +#define HAVE_GETUTXLINE 1 /* Define to 1 if you have the `get_default_context_with_level' function. */ /* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */ @@ -484,10 +484,10 @@ #define HAVE_HEADER_AD 1 /* Define if you have ut_host in utmp.h */ -#define HAVE_HOST_IN_UTMP 1 +/* #undef HAVE_HOST_IN_UTMP */ /* Define if you have ut_host in utmpx.h */ -/* #undef HAVE_HOST_IN_UTMPX */ +#define HAVE_HOST_IN_UTMPX 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_IAF_H */ @@ -499,7 +499,7 @@ /* #undef HAVE_ID_IN_UTMP */ /* Define if you have ut_id in utmpx.h */ -/* #undef HAVE_ID_IN_UTMPX */ +#define HAVE_ID_IN_UTMPX 1 /* Define to 1 if you have the `inet_aton' function. */ #define HAVE_INET_ATON 1 @@ -574,7 +574,7 @@ /* #undef HAVE_LINUX_IF_TUN_H */ /* Define if your libraries define login() */ -#define HAVE_LOGIN 1 +/* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ #define HAVE_LOGIN_CAP_H 1 @@ -586,10 +586,10 @@ /* #undef HAVE_LOGIN_H */ /* Define to 1 if you have the `logout' function. */ -#define HAVE_LOGOUT 1 +/* #undef HAVE_LOGOUT */ /* Define to 1 if you have the `logwtmp' function. */ -#define HAVE_LOGWTMP 1 +/* #undef HAVE_LOGWTMP */ /* Define to 1 if the system has the type `long double'. */ #define HAVE_LONG_DOUBLE 1 @@ -704,7 +704,7 @@ /* #undef HAVE_PUTUTLINE */ /* Define to 1 if you have the `pututxline' function. */ -/* #undef HAVE_PUTUTXLINE */ +#define HAVE_PUTUTXLINE 1 /* Define if your password has a pw_change field */ #define HAVE_PW_CHANGE_IN_PASSWD 1 @@ -800,7 +800,7 @@ /* #undef HAVE_SETUTENT */ /* Define to 1 if you have the `setutxent' function. */ -/* #undef HAVE_SETUTXENT */ +#define HAVE_SETUTXENT 1 /* Define to 1 if you have the `setvbuf' function. */ #define HAVE_SETVBUF 1 @@ -1025,7 +1025,7 @@ #define HAVE_TIME_H 1 /* Define if you have ut_time in utmp.h */ -#define HAVE_TIME_IN_UTMP 1 +/* #undef HAVE_TIME_IN_UTMP */ /* Define if you have ut_time in utmpx.h */ /* #undef HAVE_TIME_IN_UTMPX */ @@ -1043,13 +1043,13 @@ /* #undef HAVE_TV_IN_UTMP */ /* Define if you have ut_tv in utmpx.h */ -/* #undef HAVE_TV_IN_UTMPX */ +#define HAVE_TV_IN_UTMPX 1 /* Define if you have ut_type in utmp.h */ /* #undef HAVE_TYPE_IN_UTMP */ /* Define if you have ut_type in utmpx.h */ -/* #undef HAVE_TYPE_IN_UTMPX */ +#define HAVE_TYPE_IN_UTMPX 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_UCRED_H */ @@ -1091,10 +1091,10 @@ /* #undef HAVE_UTMPXNAME */ /* Define to 1 if you have the header file. */ -/* #undef HAVE_UTMPX_H */ +#define HAVE_UTMPX_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_UTMP_H 1 +/* #undef HAVE_UTMP_H */ /* define if you have u_char data type */ #define HAVE_U_CHAR 1 Modified: head/crypto/openssh/defines.h ============================================================================== --- head/crypto/openssh/defines.h Wed Jan 13 18:37:42 2010 (r202212) +++ head/crypto/openssh/defines.h Wed Jan 13 18:43:32 2010 (r202213) @@ -674,7 +674,7 @@ struct winsize { #else /* Simply select your favourite login types. */ /* Can't do if-else because some systems use several... */ -# if defined(UTMPX_FILE) && !defined(DISABLE_UTMPX) +# if !defined(DISABLE_UTMPX) # define USE_UTMPX # endif # if defined(UTMP_FILE) && !defined(DISABLE_UTMP) Modified: head/crypto/openssh/loginrec.c ============================================================================== --- head/crypto/openssh/loginrec.c Wed Jan 13 18:37:42 2010 (r202212) +++ head/crypto/openssh/loginrec.c Wed Jan 13 18:43:32 2010 (r202213) @@ -207,6 +207,7 @@ int syslogin_write_entry(struct logininf int getlast_entry(struct logininfo *li); int lastlog_get_entry(struct logininfo *li); +int utmpx_get_entry(struct logininfo *li); int wtmp_get_entry(struct logininfo *li); int wtmpx_get_entry(struct logininfo *li); @@ -509,6 +510,10 @@ getlast_entry(struct logininfo *li) return(lastlog_get_entry(li)); #else /* !USE_LASTLOG */ +#if 1 + return (utmpx_get_entry(li)); +#endif + #if defined(DISABLE_LASTLOG) /* On some systems we shouldn't even try to obtain last login * time, e.g. AIX */ @@ -758,8 +763,8 @@ construct_utmpx(struct logininfo *li, st utx->ut_pid = li->pid; /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, - MIN_SIZEOF(utx->ut_name, li->username)); + strncpy(utx->ut_user, li->username, + MIN_SIZEOF(utx->ut_user, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -1608,6 +1613,31 @@ lastlog_get_entry(struct logininfo *li) #endif /* HAVE_GETLASTLOGXBYNAME */ #endif /* USE_LASTLOG */ +#if 1 +int +utmpx_get_entry(struct logininfo *li) +{ + struct utmpx *utx; + + if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) + return (0); + utx = getutxuser(li->username); + if (utx == NULL) { + endutxent(); + return (0); + } + + line_fullname(li->line, utx->ut_line, + MIN_SIZEOF(li->line, utx->ut_line)); + strlcpy(li->hostname, utx->ut_host, + MIN_SIZEOF(li->hostname, utx->ut_host)); + li->tv_sec = utx->ut_tv.tv_sec; + li->tv_usec = utx->ut_tv.tv_usec; + endutxent(); + return (1); +} +#endif + #ifdef USE_BTMP /* * Logs failed login attempts in _PATH_BTMP if that exists. Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Wed Jan 13 18:37:42 2010 (r202212) +++ head/crypto/openssh/sshd.c Wed Jan 13 18:43:32 2010 (r202213) @@ -73,7 +73,6 @@ __RCSID("$FreeBSD$"); #include #include #include -#include #include #include @@ -240,7 +239,7 @@ u_char *session_id2 = NULL; u_int session_id2_len = 0; /* record remote hostname or ip */ -u_int utmp_len = UT_HOSTSIZE; +u_int utmp_len = MAXHOSTNAMELEN; /* options.max_startup sized array of fd ints */ int *startup_pipes = NULL; From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:46:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C501065672; Wed, 13 Jan 2010 18:46:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C59418FC13; Wed, 13 Jan 2010 18:46: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 o0DIkohS091474; Wed, 13 Jan 2010 18:46:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIkoGG091472; Wed, 13 Jan 2010 18:46:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131846.o0DIkoGG091472@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:46: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: r202214 - head/contrib/telnet/telnetd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:46:50 -0000 Author: ed Date: Wed Jan 13 18:46:50 2010 New Revision: 202214 URL: http://svn.freebsd.org/changeset/base/202214 Log: Forgot a part that was missing in the previous commit. There is no need to call trimdomain() anymore now that ut_host is big enough to fit decent hostnames. Modified: head/contrib/telnet/telnetd/telnetd.c Modified: head/contrib/telnet/telnetd/telnetd.c ============================================================================== --- head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:43:32 2010 (r202213) +++ head/contrib/telnet/telnetd/telnetd.c Wed Jan 13 18:46:50 2010 (r202214) @@ -692,7 +692,6 @@ doit(struct sockaddr *who) Please contact your net administrator"); remote_hostname[sizeof(remote_hostname) - 1] = '\0'; - trimdomain(remote_hostname, UT_HOSTSIZE); if (!isdigit(remote_hostname[0]) && strlen(remote_hostname) > utmp_len) err_ = getnameinfo(who, who->sa_len, remote_hostname, sizeof(remote_hostname), NULL, 0, From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:49:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19975106568B for ; Wed, 13 Jan 2010 18:49:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id B65A98FC1C for ; Wed, 13 Jan 2010 18:49:04 +0000 (UTC) Received: (qmail 14521 invoked by uid 399); 13 Jan 2010 18:49:03 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 13 Jan 2010 18:49:03 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B4E1586.7090102@FreeBSD.org> Date: Wed, 13 Jan 2010 10:48:38 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.5) Gecko/20100112 Thunderbird/3.0 MIME-Version: 1.0 To: "M. Warner Losh" References: <20100110.210204.787670930858346133.imp@bsdimp.com> <4B4D109A.5060500@FreeBSD.org> <20100112.174326.337739863389869251.imp@bsdimp.com> In-Reply-To: <20100112.174326.337739863389869251.imp@bsdimp.com> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:49:05 -0000 On 01/12/10 16:43, M. Warner Losh wrote: > In message: <4B4D109A.5060500@FreeBSD.org> > Doug Barton writes: > : On 1/10/2010 8:02 PM, M. Warner Losh wrote: > : > In message: > : > Doug Barton writes: > : > : On Sun, 10 Jan 2010, Warner Losh wrote: > : > : > : > : > Author: imp > : > : > Date: Sun Jan 10 17:44:22 2010 > : > : > New Revision: 202019 > : > : > URL: http://svn.freebsd.org/changeset/base/202019 > : > : > > : > : > Log: > : > : > Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms. > : > : > : > : Thanks for doing this, however the comment about how to include the > : > : whole file (including the comments) were not included. Do I need to do > : > : this part of it myself? No problem if so, I just want to be sure to > : > : get it done in time to MFC it before the freeze for 7.3-release. > : > > : > In general, we don't put big comments like that in the config files, > : > preferring to leave them to NOTES. I was just following that > : > convention... > : > : Understood, however given that there is plenty of room for confusion on > : this point because the default is NOT to include the comments I think > : that some explanation is justified. My original text was: > : > : # Store the plain version of the configuration file in the kernel itself. > : # To store the entire file, including comments, put this in /etc/src.conf: > : # CONFIGARGS= -C > : # See config(8) for more details. > : > : I'm open to suggestions on shrinking it, but I do think some sort of > : explanation is warranted. > > I'm not sure I see where there's confusion possible here, let alone > plenty of room for it. Do you think you can describe what confusion > is possible here? I think that most users would expect that the actual config file is included, with the comments; as opposed to the stripped down version with just the actual lines of configuration information that is actually stored by default. Not only do I think it's obvious that this is what users would think, this exact issue came up in the discussion on -current in December. To address the other responses, Tom, sorry, your suggested text doesn't address my concern. John, I don't think that users would somehow magically know to look in NOTES for more information about an option that is already in GENERIC. In the interests of bringing this to a close: # Store the plain version of the configuration file in the kernel itself. # For information on extraction, and storing the comments also, see config(8). There are plenty of comments in GENERIC that are longer/more substantial than that, and let's be serious for a minute, IT DOESN'T MATTER ANYWAY. I'm sorry if adding a comment that is slightly larger than usual to a kernel config file defiles someone's view of the purity of all things kernel, but let's try to take a step back and realize that NOT making things so cryptic might actually benefit the users. And yes, if you can't already tell, my patience is at an end for this. I "get" why it needs to move to GENERIC instead of DEFAULTS, especially since that's where I wanted to put it in the first place. But specifically to Warner, if you had in mind to do something other than to just move what I did to GENERIC you should have said that, and we could have avoided this whole stupid discussion. And generally, let's forget for a second that y'all are annoying the crap out of me, how many other people are you discouraging from participation because an issue as simple as this one is generating such an overwhelmingly out of proportion response? Unless someone objects to the TEXT of the comment I proposed in the next 24 hours I'll be committing it after that. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:53:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CCFD1065670; Wed, 13 Jan 2010 18:53:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABCE8FC19; Wed, 13 Jan 2010 18:53: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 o0DIr6Ad092895; Wed, 13 Jan 2010 18:53:06 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIr67j092885; Wed, 13 Jan 2010 18:53:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131853.o0DIr67j092885@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 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: r202215 - in head: . lib/libulog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:53:07 -0000 Author: ed Date: Wed Jan 13 18:53:06 2010 New Revision: 202215 URL: http://svn.freebsd.org/changeset/base/202215 Log: Remove utmpx stub from libulog. I'm not increasing the shlib major version for this, because not a single application outside the base system should have used these functions in such a short timespan. Rewrite ulog_login(3) and ulog_logout(3) to build on top of the utmpx implementation in libc. Deleted: head/lib/libulog/ulog_getutxent.3 head/lib/libulog/ulog_getutxent.c head/lib/libulog/ulog_internal.h head/lib/libulog/ulog_pututxline.c head/lib/libulog/ulog_setutxfile.3 head/lib/libulog/ulog_util.c Modified: head/ObsoleteFiles.inc head/lib/libulog/Makefile head/lib/libulog/Symbol.map head/lib/libulog/ulog.h head/lib/libulog/ulog_login.3 head/lib/libulog/ulog_login.c head/lib/libulog/ulog_login_pseudo.c head/lib/libulog/utempter.c head/lib/libulog/utempter_add_record.3 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 13 18:46:50 2010 (r202214) +++ head/ObsoleteFiles.inc Wed Jan 13 18:53:06 2010 (r202215) @@ -14,6 +14,14 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100113: remove utmp.h, replace it by utmpx.h +OLD_FILES+=usr/share/man/man3/ulog_endutxent.3.gz +OLD_FILES+=usr/share/man/man3/ulog_getutxent.3.gz +OLD_FILES+=usr/share/man/man3/ulog_getutxline.3.gz +OLD_FILES+=usr/share/man/man3/ulog_getutxuser.3.gz +OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz +OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz +OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/Makefile Wed Jan 13 18:53:06 2010 (r202215) @@ -7,25 +7,21 @@ SHLIBDIR?=/lib LIB= ulog SHLIB_MAJOR= 0 INCS= ulog.h utempter.h -SRCS= ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \ - ulog_login_pseudo.c ulog_pututxline.c ulog_util.c utempter.c +SRCS= ulog.h ulog_login.c ulog_login_pseudo.c utempter.c -MAN= ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 \ - utempter_add_record.3 -MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \ - ulog_getutxent.3 ulog_getutxline.3 \ - ulog_getutxent.3 ulog_pututxline.3 \ - ulog_getutxent.3 ulog_setutxent.3 \ - ulog_login.3 ulog_login_pseudo.3 \ +MAN= ulog_login.3 utempter_add_record.3 +MLINKS+=ulog_login.3 ulog_login_pseudo.3 \ ulog_login.3 ulog_logout.3 \ ulog_login.3 ulog_logout_pseudo.3 \ - ulog_setutxfile.3 ulog_getutxuser.3 \ utempter_add_record.3 utempter_remove_added_record.3 \ utempter_add_record.3 utempter_remove_record.3 \ utempter_add_record.3 addToUtmp.3 \ utempter_remove_added_record.3 removeFromUtmp.3 \ utempter_remove_record.3 removeLineFromUtmp.3 +DPADD= ${LIBMD} +LDADD= -lmd + VERSION_DEF= ${.CURDIR}/../libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map Modified: head/lib/libulog/Symbol.map ============================================================================== --- head/lib/libulog/Symbol.map Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/Symbol.map Wed Jan 13 18:53:06 2010 (r202215) @@ -3,17 +3,10 @@ */ FBSD_1.2 { - ulog_endutxent; - ulog_getutxent; - ulog_getutxline; - ulog_getutxuser; ulog_login; ulog_login_pseudo; ulog_logout; ulog_logout_pseudo; - ulog_pututxline; - ulog_setutxent; - ulog_setutxfile; addToUtmp; removeFromUtmp; Modified: head/lib/libulog/ulog.h ============================================================================== --- head/lib/libulog/ulog.h Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/ulog.h Wed Jan 13 18:53:06 2010 (r202215) @@ -30,79 +30,12 @@ #define _ULOG_H_ #include -#include -#include - -#ifndef _PID_T_DECLARED -typedef __pid_t pid_t; -#define _PID_T_DECLARED -#endif - -/* - * libulog. - * - * This library is provided as a migratory tool towards . We - * cannot yet implement , because our on-disk file format lacks - * various fields. also has some shortcomings. Ideally we - * want to allow logging of user login records generated by unprivileged - * processes as well, provided that they hold a file descriptor to a - * pseudo-terminal master device. - * - * This library (or at least parts of it) will hopefully deprecate over - * time, when we provide the API. - */ - -struct ulog_utmpx { - char ut_user[32]; - char ut_id[8]; /* XXX: unsupported. */ - char ut_line[32]; - char ut_host[256]; - pid_t ut_pid; /* XXX: unsupported. */ - short ut_type; -#define EMPTY 0 -#define BOOT_TIME 1 -#define OLD_TIME 2 -#define NEW_TIME 3 -#define USER_PROCESS 4 -#define INIT_PROCESS 5 /* XXX: unsupported. */ -#define LOGIN_PROCESS 6 /* XXX: unsupported. */ -#define DEAD_PROCESS 7 -#define SHUTDOWN_TIME 8 - struct timeval ut_tv; -}; __BEGIN_DECLS -/* POSIX routines. */ -void ulog_endutxent(void); -struct ulog_utmpx *ulog_getutxent(void); -#if 0 -struct ulog_utmpx *ulog_getutxid(const struct ulog_utmpx *); -#endif -struct ulog_utmpx *ulog_getutxline(const struct ulog_utmpx *); -struct ulog_utmpx *ulog_pututxline(const struct ulog_utmpx *); -void ulog_setutxent(void); - -/* Extensions. */ -struct ulog_utmpx *ulog_getutxuser(const char *); -int ulog_setutxfile(int, const char *); -#define UTXI_TTY 0 -#define UTXI_TIME 1 -#define UTXI_USER 2 - -/* Login/logout utility functions. */ void ulog_login(const char *, const char *, const char *); void ulog_login_pseudo(int, const char *); void ulog_logout(const char *); void ulog_logout_pseudo(int); __END_DECLS -#ifdef _ULOG_POSIX_NAMES -#define utmpx ulog_utmpx -#define endutxent ulog_endutxent -#define getutxent ulog_getutxent -#define getutxline ulog_getutxline -#define pututxline ulog_pututxline -#define setutxent ulog_setutxent -#endif /* _ULOG_POSIX_NAMES */ - #endif /* !_ULOG_H_ */ Modified: head/lib/libulog/ulog_login.3 ============================================================================== --- head/lib/libulog/ulog_login.3 Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/ulog_login.3 Wed Jan 13 18:53:06 2010 (r202215) @@ -90,13 +90,10 @@ and .Fn ulog_logout_pseudo functions spawn a privileged process to perform the actual logging. .Sh SEE ALSO -.Xr getuid 3 , -.Xr login 3 , -.Xr logout 3 , .Xr posix_openpt 2 , +.Xr getuid 3 , .Xr ptsname 3 , -.Xr ulog_getutxent 3 , -.Xr utmp 5 +.Xr pututxline 3 .Sh HISTORY These functions appeared in .Fx 9.0 . Modified: head/lib/libulog/ulog_login.c ============================================================================== --- head/lib/libulog/ulog_login.c Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/ulog_login.c Wed Jan 13 18:53:06 2010 (r202215) @@ -27,49 +27,58 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include +#include +#include +#include "ulog.h" -#include "ulog_internal.h" - -void -ulog_login(const char *line, const char *user, const char *host) +static void +ulog_fill(struct utmpx *utx, const char *line) { - struct ulog_utmpx utx; + SHA_CTX c; + char id[SHA_DIGEST_LENGTH]; /* Remove /dev/ component. */ if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) line += sizeof _PATH_DEV - 1; - memset(&utx, 0, sizeof utx); + memset(utx, 0, sizeof *utx); - /* XXX: ut_id, ut_pid missing. */ + utx->ut_pid = getpid(); + gettimeofday(&utx->ut_tv, NULL); + strncpy(utx->ut_line, line, sizeof utx->ut_line); + + SHA1_Init(&c); + SHA1_Update(&c, "libulog", 7); + SHA1_Update(&c, utx->ut_line, sizeof utx->ut_line); + SHA_Final(id, &c); + + memcpy(utx->ut_id, id, MIN(sizeof utx->ut_id, sizeof id)); +} + +void +ulog_login(const char *line, const char *user, const char *host) +{ + struct utmpx utx; + + ulog_fill(&utx, line); utx.ut_type = USER_PROCESS; - strncpy(utx.ut_line, line, sizeof utx.ut_line); strncpy(utx.ut_user, user, sizeof utx.ut_user); if (host != NULL) strncpy(utx.ut_host, host, sizeof utx.ut_host); - gettimeofday(&utx.ut_tv, NULL); - - ulog_pututxline(&utx); + pututxline(&utx); } void ulog_logout(const char *line) { - struct ulog_utmpx utx; - - /* Remove /dev/ component. */ - if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) - line += sizeof _PATH_DEV - 1; + struct utmpx utx; - memset(&utx, 0, sizeof utx); - - /* XXX: ut_id, ut_pid missing. ut_line not needed */ + ulog_fill(&utx, line); utx.ut_type = DEAD_PROCESS; - strncpy(utx.ut_line, line, sizeof utx.ut_line); - gettimeofday(&utx.ut_tv, NULL); - - ulog_pututxline(&utx); + pututxline(&utx); } Modified: head/lib/libulog/ulog_login_pseudo.c ============================================================================== --- head/lib/libulog/ulog_login_pseudo.c Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/ulog_login_pseudo.c Wed Jan 13 18:53:06 2010 (r202215) @@ -34,8 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include "ulog_internal.h" +#include "ulog.h" #define _PATH_ULOG_HELPER "/usr/libexec/ulog-helper" Modified: head/lib/libulog/utempter.c ============================================================================== --- head/lib/libulog/utempter.c Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/utempter.c Wed Jan 13 18:53:06 2010 (r202215) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#include "ulog_internal.h" +#include "ulog.h" #include "utempter.h" static int last_fd = -1; Modified: head/lib/libulog/utempter_add_record.3 ============================================================================== --- head/lib/libulog/utempter_add_record.3 Wed Jan 13 18:46:50 2010 (r202214) +++ head/lib/libulog/utempter_add_record.3 Wed Jan 13 18:53:06 2010 (r202215) @@ -98,9 +98,8 @@ and .Fn utempter_remove_record always return a value of 0. .Sh SEE ALSO -.Xr ulog_login_pseudo 3 , -.Xr ulog_setutxfile 3 , -.Xr utmp 5 +.Xr pututxline 3 , +.Xr ulog_login_pseudo 3 .Sh HISTORY These functions appeared in .Fx 9.0 . From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 18:59:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885EA1065672; Wed, 13 Jan 2010 18:59:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774AF8FC17; Wed, 13 Jan 2010 18:59: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 o0DIxpjT094408; Wed, 13 Jan 2010 18:59:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIxp4u094404; Wed, 13 Jan 2010 18:59:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131859.o0DIxp4u094404@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:59: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: r202216 - in head: . lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:59:51 -0000 Author: ed Date: Wed Jan 13 18:59:51 2010 New Revision: 202216 URL: http://svn.freebsd.org/changeset/base/202216 Log: Remove login(3), logout(3) and logwtmp(3) from libutil. These functions only apply to utmp(5). They cannot be kept intact when moving towards utmpx. The login(3) function would break, because its argument is an utmp structure. The logout(3) and logwtmp(3) functions cannot be used, since they provide a functionality which partially overlaps. Increment SHLIB_MAJOR to 9 to indicate the removal. Deleted: head/lib/libutil/login.3 head/lib/libutil/login.c head/lib/libutil/logout.3 head/lib/libutil/logout.c head/lib/libutil/logwtmp.3 head/lib/libutil/logwtmp.c Modified: head/ObsoleteFiles.inc head/lib/libutil/Makefile head/lib/libutil/libutil.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 13 18:53:06 2010 (r202215) +++ head/ObsoleteFiles.inc Wed Jan 13 18:59:51 2010 (r202216) @@ -15,6 +15,9 @@ # # 20100113: remove utmp.h, replace it by utmpx.h +OLD_FILES+=usr/share/man/man3/login.3.gz +OLD_FILES+=usr/share/man/man3/logout.3.gz +OLD_FILES+=usr/share/man/man3/logwtmp.3.gz OLD_FILES+=usr/share/man/man3/ulog_endutxent.3.gz OLD_FILES+=usr/share/man/man3/ulog_getutxent.3.gz OLD_FILES+=usr/share/man/man3/ulog_getutxline.3.gz @@ -22,6 +25,7 @@ OLD_FILES+=usr/share/man/man3/ulog_getut OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz +OLD_LIBS+=lib/libutil.so.8 # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Jan 13 18:53:06 2010 (r202215) +++ head/lib/libutil/Makefile Wed Jan 13 18:59:51 2010 (r202216) @@ -6,13 +6,13 @@ SHLIBDIR?= /lib .include LIB= util -SHLIB_MAJOR= 8 +SHLIB_MAJOR= 9 SRCS= _secure_path.c auth.c expand_number.c flopen.c fparseln.c gr_util.c \ hexdump.c humanize_number.c kinfo_getfile.c kinfo_getvmmap.c kld.c \ - login.c login_auth.c login_cap.c \ + login_auth.c login_cap.c \ login_class.c login_crypt.c login_ok.c login_times.c login_tty.c \ - logout.c logwtmp.c pidfile.c property.c pty.c pw_util.c realhostname.c \ + pidfile.c property.c pty.c pw_util.c realhostname.c \ stub.c trimdomain.c uucplock.c INCS= libutil.h login_cap.h @@ -24,7 +24,7 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/ -MAN+= kld.3 login.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 pty.3 \ +MAN+= kld.3 login_auth.3 login_tty.3 pty.3 \ login_cap.3 login_class.3 login_times.3 login_ok.3 \ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \ Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jan 13 18:53:06 2010 (r202215) +++ head/lib/libutil/libutil.h Wed Jan 13 18:59:51 2010 (r202216) @@ -90,7 +90,6 @@ struct pidfh { /* Avoid pulling in all the include files for no need */ struct termios; struct winsize; -struct utmp; struct in_addr; struct kinfo_file; struct kinfo_vmentry; @@ -102,10 +101,7 @@ int extattr_namespace_to_string(int _att int extattr_string_to_namespace(const char *_string, int *_attrnamespace); int flopen(const char *_path, int _flags, ...); void hexdump(const void *ptr, int length, const char *hdr, int flags); -void login(struct utmp *_ut); int login_tty(int _fd); -int logout(const char *_line); -void logwtmp(const char *_line, const char *_name, const char *_host); void trimdomain(char *_fullhost, int _hostsize); int openpty(int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 19:03:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AF11106568B; Wed, 13 Jan 2010 19:03:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89CD58FC13; Wed, 13 Jan 2010 19:03: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 o0DJ3mp0095321; Wed, 13 Jan 2010 19:03:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJ3mJi095317; Wed, 13 Jan 2010 19:03:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131903.o0DJ3mJi095317@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 19: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: r202217 - in head: . include share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:03:48 -0000 Author: ed Date: Wed Jan 13 19:03:48 2010 New Revision: 202217 URL: http://svn.freebsd.org/changeset/base/202217 Log: Remove and its corresponding manual page. Deleted: head/share/man/man5/utmp.5 Modified: head/ObsoleteFiles.inc head/include/utmp.h head/share/man/man5/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 13 18:59:51 2010 (r202216) +++ head/ObsoleteFiles.inc Wed Jan 13 19:03:48 2010 (r202217) @@ -25,6 +25,9 @@ OLD_FILES+=usr/share/man/man3/ulog_getut OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz +OLD_FILES+=usr/share/man/man5/lastlog.5.gz +OLD_FILES+=usr/share/man/man5/utmp.5.gz +OLD_FILES+=usr/share/man/man5/wtmp.5.gz OLD_LIBS+=lib/libutil.so.8 # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h Modified: head/include/utmp.h ============================================================================== --- head/include/utmp.h Wed Jan 13 18:59:51 2010 (r202216) +++ head/include/utmp.h Wed Jan 13 19:03:48 2010 (r202217) @@ -1,73 +1,2 @@ -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)utmp.h 8.2 (Berkeley) 1/21/94 - * $FreeBSD$ - */ - -#ifndef _UTMP_H_ -#define _UTMP_H_ - -#define _PATH_UTMP "/var/run/utmp" -#define _PATH_WTMP "/var/log/wtmp" -#define _PATH_LASTLOG "/var/log/lastlog" - -/* - * XXX: These values are too low, but cannot be changed without breaking - * the file format. Right now pts(4) is limited to 1000 instances, - * because /dev/pts/1000 would require UT_LINESIZE to be bigger. - * UT_HOSTSIZE is also too small to hold most common hostnames or IPv6 - * addresses. - */ -#define UT_NAMESIZE 16 /* see MAXLOGNAME in */ -#define UT_LINESIZE 8 -#define UT_HOSTSIZE 16 - -struct lastlog { - int32_t ll_time; - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; -}; - -struct utmp { - char ut_line[UT_LINESIZE]; - char ut_name[UT_NAMESIZE]; - char ut_host[UT_HOSTSIZE]; - int32_t ut_time; -}; - -#endif /* !_UTMP_H_ */ +/* $FreeBSD$ */ +#error " has been replaced by " Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Wed Jan 13 18:59:51 2010 (r202216) +++ head/share/man/man5/Makefile Wed Jan 13 19:03:48 2010 (r202217) @@ -68,7 +68,6 @@ MAN= acct.5 \ style.Makefile.5 \ sysctl.conf.5 \ tmpfs.5 \ - utmp.5 \ xfs.5 MLINKS= dir.5 dirent.5 @@ -79,7 +78,6 @@ MLINKS+=passwd.5 master.passwd.5 MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 -MLINKS+=utmp.5 lastlog.5 utmp.5 wtmp.5 .if ${MK_HESIOD} != "no" MAN+= hesiod.conf.5 From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 19:07:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75CF91065676; Wed, 13 Jan 2010 19:07:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDCF8FC08; Wed, 13 Jan 2010 19:07: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 o0DJ7nAl096244; Wed, 13 Jan 2010 19:07:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJ7nfb096239; Wed, 13 Jan 2010 19:07:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131907.o0DJ7nfb096239@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 19:07: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: r202218 - in head/etc: . periodic/monthly rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:07:49 -0000 Author: ed Date: Wed Jan 13 19:07:48 2010 New Revision: 202218 URL: http://svn.freebsd.org/changeset/base/202218 Log: Let rc and periodic infrastructure and newsyslog use the utmpx files. Modified: head/etc/newsyslog.conf head/etc/periodic/monthly/200.accounting head/etc/rc.d/cleanvar head/etc/rc.d/var Modified: head/etc/newsyslog.conf ============================================================================== --- head/etc/newsyslog.conf Wed Jan 13 19:03:48 2010 (r202217) +++ head/etc/newsyslog.conf Wed Jan 13 19:07:48 2010 (r202218) @@ -33,6 +33,6 @@ /var/log/ppp.log root:network 640 3 100 * JC /var/log/security 600 10 100 * JC /var/log/sendmail.st 640 10 * 168 B +/var/log/utx.log 644 3 * @01T05 B /var/log/weekly.log 640 5 1 $W6D0 JN -/var/log/wtmp 644 3 * @01T05 B /var/log/xferlog 600 7 100 * JC Modified: head/etc/periodic/monthly/200.accounting ============================================================================== --- head/etc/periodic/monthly/200.accounting Wed Jan 13 19:03:48 2010 (r202217) +++ head/etc/periodic/monthly/200.accounting Wed Jan 13 19:07:48 2010 (r202218) @@ -15,7 +15,7 @@ oldmask=$(umask) umask 066 case "$monthly_accounting_enable" in [Yy][Ee][Ss]) - W=/var/log/wtmp + W=/var/log/utx.log rc=0 remove=NO if [ ! -f $W.0 ] Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Wed Jan 13 19:03:48 2010 (r202217) +++ head/etc/rc.d/cleanvar Wed Jan 13 19:07:48 2010 (r202218) @@ -58,8 +58,8 @@ cleanvar_start () { if [ -d /var/run -a ! -f /var/run/clean_var ]; then purgedir /var/run - # And an initial utmp file - (cd /var/run && cp /dev/null utmp && chmod 644 utmp) + # And an initial utmpx active session file + (cd /var/run && cp /dev/null utx.active && chmod 644 utx.active) >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Wed Jan 13 19:03:48 2010 (r202217) +++ head/etc/rc.d/var Wed Jan 13 19:07:48 2010 (r202218) @@ -98,12 +98,12 @@ case "${populate_var}" in ;; esac -# Make sure we have /var/log/lastlog and /var/log/wtmp files -if [ ! -f /var/log/lastlog ]; then - cp /dev/null /var/log/lastlog - chmod 644 /var/log/lastlog +# Make sure we have /var/log/utx.lastlogin and /var/log/utx.log files +if [ ! -f /var/log/utx.lastlogin ]; then + cp /dev/null /var/log/utx.lastlogin + chmod 644 /var/log/utx.lastlogin fi -if [ ! -f /var/log/wtmp ]; then - cp /dev/null /var/log/wtmp - chmod 644 /var/log/wtmp +if [ ! -f /var/log/utx.log ]; then + cp /dev/null /var/log/utx.log + chmod 644 /var/log/utx.log fi From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 19:25:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9067106566B; Wed, 13 Jan 2010 19:25:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0668FC17; Wed, 13 Jan 2010 19:25: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 o0DJP3qE000159; Wed, 13 Jan 2010 19:25:03 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DJP3L1000156; Wed, 13 Jan 2010 19:25:03 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131925.o0DJP3L1000156@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 19:25: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: r202219 - in head: . sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 19:25:03 -0000 Author: ed Date: Wed Jan 13 19:25:03 2010 New Revision: 202219 URL: http://svn.freebsd.org/changeset/base/202219 Log: Complete the migration towards utmpx. - Add a notice to UPDATING, explaining users may need to recompile applications that use the old database. - Bump __FreeBSD_version. Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jan 13 19:07:48 2010 (r202218) +++ head/UPDATING Wed Jan 13 19:25:03 2010 (r202219) @@ -22,6 +22,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20100113: + The utmp user accounting database has been replaced with utmpx, + the user accounting interface standardized by POSIX. + Unfortunately the semantics of utmp and utmpx don't match, + making it practically impossible to support both interfaces. + The user accounting database is used by tools like finger(1), + last(1), talk(1), w(1) and ac(8). + + All applications in the base system use utmpx. This means only + local binaries (e.g. from the ports tree) may still use these + utmp database files. These applications must be rebuilt to make + use of utmpx. + + After the system has been upgraded, it is safe to remove the old + log files (/var/run/utmp, /var/log/lastlog and /var/log/wtmp*), + assuming their contents is of no importance anymore. + 20100108: Introduce the kernel thread "deadlock resolver" (which can be enabled via the DEADLKRES option, see NOTES for more details) and the Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jan 13 19:07:48 2010 (r202218) +++ head/sys/sys/param.h Wed Jan 13 19:25:03 2010 (r202219) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900006 /* Master, propagated to newvers */ +#define __FreeBSD_version 900007 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 20:21:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F644106566B; Wed, 13 Jan 2010 20:21:29 +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 1E7468FC16; Wed, 13 Jan 2010 20:21:29 +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 C21D246B17; Wed, 13 Jan 2010 15:21:28 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id A2A4D8A01F; Wed, 13 Jan 2010 15:21:25 -0500 (EST) From: John Baldwin To: Doug Barton Date: Wed, 13 Jan 2010 15:15:08 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091231; KDE/4.3.1; amd64; ; ) References: <20100112.174326.337739863389869251.imp@bsdimp.com> <4B4E1586.7090102@FreeBSD.org> In-Reply-To: <4B4E1586.7090102@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001131515.08602.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 13 Jan 2010 15:21:25 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:21:29 -0000 On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: > To address the other responses, Tom, sorry, your suggested text doesn't > address my concern. John, I don't think that users would somehow > magically know to look in NOTES for more information about an option > that is already in GENERIC. You really think users do not already know to look in manpages or NOTES to find out more details about kernel options? Why bother having those documents if our users aren't going to look at them? Seriously, have you actually looked at GENERIC and NOTES and compared their contents. There are _many_ options and devices in GENERIC that have expanded descriptions in NOTES. This is the norm for documenting kernel options and has been for well over a decade. > In the interests of bringing this to a close: > # Store the plain version of the configuration file in the kernel itself. > # For information on extraction, and storing the comments also, see > config(8). > > There are plenty of comments in GENERIC that are longer/more substantial > than that, and let's be serious for a minute, IT DOESN'T MATTER ANYWAY. > I'm sorry if adding a comment that is slightly larger than usual to a > kernel config file defiles someone's view of the purity of all things > kernel, but let's try to take a step back and realize that NOT making > things so cryptic might actually benefit the users. So why not add a 3-line comment to GENERIC for every other kernel option? Put another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it deserves special treatment relative to other kernel options? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 20:30:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDCC1065697; Wed, 13 Jan 2010 20:30:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAFF28FC08; Wed, 13 Jan 2010 20:30: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 o0DKUGIV015343; Wed, 13 Jan 2010 20:30:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKUGIU015341; Wed, 13 Jan 2010 20:30:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001132030.o0DKUGIU015341@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 20:30: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: r202231 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:30:16 -0000 Author: ed Date: Wed Jan 13 20:30:16 2010 New Revision: 202231 URL: http://svn.freebsd.org/changeset/base/202231 Log: Add a missing $FreeBSD$ string. I was requested to add this string to any file that was modified by my commit, which I forgot to do so. Requested by: des Modified: head/crypto/openssh/loginrec.c Modified: head/crypto/openssh/loginrec.c ============================================================================== --- head/crypto/openssh/loginrec.c Wed Jan 13 20:25:45 2010 (r202230) +++ head/crypto/openssh/loginrec.c Wed Jan 13 20:30:16 2010 (r202231) @@ -146,6 +146,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 20:36:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A7041065697 for ; Wed, 13 Jan 2010 20:36:26 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id B570E8FC25 for ; Wed, 13 Jan 2010 20:36:25 +0000 (UTC) Received: (qmail 15519 invoked by uid 399); 13 Jan 2010 20:36:24 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 13 Jan 2010 20:36:24 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B4E2ECA.90905@FreeBSD.org> Date: Wed, 13 Jan 2010 12:36:26 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: John Baldwin References: <20100112.174326.337739863389869251.imp@bsdimp.com> <4B4E1586.7090102@FreeBSD.org> <201001131515.08602.jhb@freebsd.org> In-Reply-To: <201001131515.08602.jhb@freebsd.org> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:36:26 -0000 On 1/13/2010 12:15 PM, John Baldwin wrote: > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: >> To address the other responses, Tom, sorry, your suggested text doesn't >> address my concern. John, I don't think that users would somehow >> magically know to look in NOTES for more information about an option >> that is already in GENERIC. > > You really think users do not already know to look in manpages or NOTES to > find out more details about kernel options? That's not what I said. > Put > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it > deserves special treatment relative to other kernel options? Because the default behavior (not including the actual file) for the option is contrary to user' reasonable expectation of how the option should work .... and now I'm repeating myself. Seriously, don't you have anything better to do than argue against including a comment in a config file? I know I do. What is the overwhelming horror that will arise here if there are more comments GENERIC than you deem to be absolutely necessary? And yes, I read the part of your message that I snipped about "why do we have these documents if users don't read them?" The answer is, that's why I'm suggesting a comment that tells users what man page to read. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 20:54:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E62B1065745; Wed, 13 Jan 2010 20:54:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1218FC17; Wed, 13 Jan 2010 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 o0DKsINd021328; Wed, 13 Jan 2010 20:54:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DKsI9e021324; Wed, 13 Jan 2010 20:54:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001132054.o0DKsI9e021324@svn.freebsd.org> From: Andrew Thompson Date: Wed, 13 Jan 2010 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: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 20:54:18 -0000 Author: thompsa Date: Wed Jan 13 20:54:18 2010 New Revision: 202243 URL: http://svn.freebsd.org/changeset/base/202243 Log: Update to Fredrik's latest uhso driver. This changes port detection, adds comments and other code nits. Submitted by: Fredrik Lindberg Modified: head/share/man/man4/uhso.4 head/sys/dev/usb/net/uhso.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/uhso.4 ============================================================================== --- head/share/man/man4/uhso.4 Wed Jan 13 20:51:23 2010 (r202242) +++ head/share/man/man4/uhso.4 Wed Jan 13 20:54:18 2010 (r202243) @@ -23,11 +23,11 @@ .\" .\" $FreeBSD$ .\" -.Dd Aug 12, 2009 +.Dd January 14, 2010 .Os .Dt UHSO 4 .Sh NAME -.Nm hso +.Nm uhso .Nd support for several HSxPA devices from Option N.V. .Sh SYNOPSIS The module can be loaded at boot time by placing the following line in @@ -47,12 +47,12 @@ driver which makes them behave like a .Xr tty 4 . The packet interface is exposed as a network interface. .Pp -To establish a connection on the packet interface the use of the proprietary +Connection of the packet interface is achieved by using the proprietary AT commands .Dq Li AT_OWANCALL and .Dq Li AT_OWANDATA -are required on any of the serial ports. +on any of the available serial ports. .Pp The network interface must be configured manually using the data obtain from these calls. @@ -70,12 +70,23 @@ driver supports at least the following c Option GlobeSurfer iCON 7.2 (new firmware) .It Option iCON 225 +.It +Option iCON 505 .El .Pp The device features a mass storage device referred to as .Dq Zero-CD -which contains drivers for Microsoft Windows. -The driver automatically switches the device to modem mode. +which contains drivers for Microsoft Windows, this is the default +mode for the device. +The +.Nm +driver automatically switches the device from +.Dq Zero-CD +mode to modem mode. +This behavior can be disabled by setting +.Va hw.usb.uhso.auto_switch +to 0 using +.Xr sysctl 8 .Sh EXAMPLES Establishing a packet interface connection .Bd -literal -offset indent Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Wed Jan 13 20:51:23 2010 (r202242) +++ head/sys/dev/usb/net/uhso.c Wed Jan 13 20:54:18 2010 (r202243) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Fredrik Lindberg + * Copyright (c) 2009 Fredrik Lindberg * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,13 +63,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include struct uhso_tty { struct uhso_softc *ht_sc; struct usb_xfer *ht_xfer[3]; - int ht_muxport; + int ht_muxport; /* Mux. port no */ int ht_open; char ht_name[32]; }; @@ -78,7 +80,7 @@ struct uhso_softc { device_t sc_dev; struct usb_device *sc_udev; struct mtx sc_mtx; - uint32_t sc_type; + uint32_t sc_type; /* Interface definition */ struct usb_xfer *sc_xfer[3]; uint8_t sc_iface_no; @@ -91,14 +93,14 @@ struct uhso_softc { /* Network */ struct usb_xfer *sc_if_xfer[2]; struct ifnet *sc_ifp; - struct mbuf *sc_mwait; /* partial packet */ - size_t sc_waitlen; /* no. of outstanding bytes */ + struct mbuf *sc_mwait; /* Partial packet */ + size_t sc_waitlen; /* No. of outstanding bytes */ struct ifqueue sc_rxq; struct callout sc_c; /* TTY related structures */ struct ucom_super_softc sc_super_ucom; - int sc_ttys; + int sc_ttys; struct uhso_tty *sc_tty; struct ucom_softc *sc_ucom; int sc_msr; @@ -106,7 +108,6 @@ struct uhso_softc { int sc_line; }; - #define UHSO_MAX_MTU 2048 /* @@ -135,7 +136,7 @@ struct uhso_softc { * Port types */ #define UHSO_PORT_UNKNOWN 0x00 -#define UHSO_PORT_SERIAL 0x01 /* Serial port */ +#define UHSO_PORT_SERIAL 0x01 /* Serial port */ #define UHSO_PORT_NETWORK 0x02 /* Network packet interface */ /* @@ -145,12 +146,14 @@ struct uhso_softc { #define UHSO_MPORT_TYPE_APP 0x01 /* Application */ #define UHSO_MPORT_TYPE_PCSC 0x02 #define UHSO_MPORT_TYPE_GPS 0x03 -#define UHSO_MPORT_TYPE_APP2 0x04 +#define UHSO_MPORT_TYPE_APP2 0x04 /* Secondary application */ #define UHSO_MPORT_TYPE_MAX UHSO_MPORT_TYPE_APP2 #define UHSO_MPORT_TYPE_NOMAX 8 /* Max number of mux ports */ /* * Port definitions + * Note that these definitions are arbitray and doesn't match + * values returned by the auto config descriptor. */ #define UHSO_PORT_TYPE_CTL 0x01 #define UHSO_PORT_TYPE_APP 0x02 @@ -176,8 +179,12 @@ static char *uhso_port[] = { "Network/Serial" }; -/* Map between interface port type read from device and description type */ -static char uhso_port_map[] = { +/* + * Map between interface port type read from device and description type. + * The position in this array is a direct map to the auto config + * descriptor values. + */ +static unsigned char uhso_port_map[] = { 0, UHSO_PORT_TYPE_DIAG, UHSO_PORT_TYPE_GPS, @@ -193,7 +200,7 @@ static char uhso_port_map[] = { }; static char uhso_port_map_max = sizeof(uhso_port_map) / sizeof(char); -static char uhso_mux_port_map[] = { +static unsigned char uhso_mux_port_map[] = { UHSO_PORT_TYPE_CTL, UHSO_PORT_TYPE_APP, UHSO_PORT_TYPE_PCSC, @@ -202,7 +209,7 @@ static char uhso_mux_port_map[] = { }; static char *uhso_port_type[] = { - "Unknown", + "Unknown", /* Not a valid port */ "Control", "Application", "Application (Secondary)", @@ -233,7 +240,6 @@ static char *uhso_port_type_sysctl[] = { "voice", }; - #define UHSO_STATIC_IFACE 0x01 #define UHSO_AUTO_IFACE 0x02 @@ -263,11 +269,16 @@ static const struct usb_device_id uhso_d /* Option iCON 321 */ UHSO_DEV(OPTION, ICON321, UHSO_STATIC_IFACE), /* Option iCON 322 */ - UHSO_DEV(OPTION, GTICON322, UHSO_STATIC_IFACE) + UHSO_DEV(OPTION, GTICON322, UHSO_STATIC_IFACE), + /* Option iCON 505 */ + UHSO_DEV(OPTION, ICON505, UHSO_AUTO_IFACE), #undef UHSO_DEV }; SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso"); +static int uhso_autoswitch = 1; +SYSCTL_INT(_hw_usb_uhso, OID_AUTO, auto_switch, CTLFLAG_RW, + &uhso_autoswitch, 0, "Automatically switch to modem mode"); #ifdef USB_DEBUG #ifdef UHSO_DEBUG @@ -335,6 +346,7 @@ static usb_callback_t uhso_bs_intr_callb static usb_callback_t uhso_ifnet_read_callback; static usb_callback_t uhso_ifnet_write_callback; +/* Config used for the default control pipes */ static const struct usb_config uhso_ctrl_config[UHSO_CTRL_MAX] = { [UHSO_CTRL_READ] = { .type = UE_CONTROL, @@ -356,6 +368,7 @@ static const struct usb_config uhso_ctrl } }; +/* Config for the multiplexed serial ports */ static const struct usb_config uhso_mux_config[UHSO_MUX_ENDPT_MAX] = { [UHSO_MUX_ENDPT_INTR] = { .type = UE_INTERRUPT, @@ -367,6 +380,7 @@ static const struct usb_config uhso_mux_ } }; +/* Config for the raw IP-packet interface */ static const struct usb_config uhso_ifnet_config[UHSO_IFNET_MAX] = { [UHSO_IFNET_READ] = { .type = UE_BULK, @@ -387,6 +401,7 @@ static const struct usb_config uhso_ifne } }; +/* Config for interfaces with normal bulk serial ports */ static const struct usb_config uhso_bs_config[UHSO_BULK_ENDPT_MAX] = { [UHSO_BULK_ENDPT_READ] = { .type = UE_BULK, @@ -416,20 +431,19 @@ static const struct usb_config uhso_bs_c } }; -static int uhso_probe_iface(struct uhso_softc *, int, +static int uhso_probe_iface(struct uhso_softc *, int, int (*probe)(struct uhso_softc *, int)); -static int uhso_probe_iface_auto(struct uhso_softc *, int); -static int uhso_probe_iface_static(struct uhso_softc *, int); - -static int uhso_attach_muxserial(struct uhso_softc *, struct usb_interface *, +static int uhso_probe_iface_auto(struct uhso_softc *, int); +static int uhso_probe_iface_static(struct uhso_softc *, int); +static int uhso_attach_muxserial(struct uhso_softc *, struct usb_interface *, int type); -static int uhso_attach_bulkserial(struct uhso_softc *, struct usb_interface *, +static int uhso_attach_bulkserial(struct uhso_softc *, struct usb_interface *, int type); -static int uhso_attach_ifnet(struct uhso_softc *, struct usb_interface *, +static int uhso_attach_ifnet(struct uhso_softc *, struct usb_interface *, int type); static void uhso_test_autoinst(void *, struct usb_device *, struct usb_attach_arg *); -static int uhso_driver_loaded(struct module *, int, void *); +static int uhso_driver_loaded(struct module *, int, void *); static void uhso_ucom_start_read(struct ucom_softc *); static void uhso_ucom_stop_read(struct ucom_softc *); @@ -438,12 +452,11 @@ static void uhso_ucom_stop_write(struct static void uhso_ucom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); static void uhso_ucom_cfg_set_dtr(struct ucom_softc *, uint8_t); static void uhso_ucom_cfg_set_rts(struct ucom_softc *, uint8_t); - static void uhso_if_init(void *); static void uhso_if_start(struct ifnet *); static void uhso_if_stop(struct uhso_softc *); -static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t); -static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, +static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t); +static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); static void uhso_if_rxflush(void *); @@ -512,11 +525,6 @@ uhso_attach(device_t self) usb_error_t uerr; char *desc; - device_set_usb_desc(self); - - UHSO_DPRINTF(0, "Device is in modem mode, devClass=%x\n", - uaa->device->ddesc.bDeviceClass); - sc->sc_dev = self; sc->sc_udev = uaa->device; mtx_init(&sc->sc_mtx, "uhso", NULL, MTX_DEF); @@ -552,7 +560,6 @@ uhso_attach(device_t self) if (error != 0) goto out; - sctx = device_get_sysctl_ctx(sc->sc_dev); soid = device_get_sysctl_tree(sc->sc_dev); @@ -560,6 +567,18 @@ uhso_attach(device_t self) CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0, "Port available at this interface"); + /* + * The default interface description on most Option devices aren't + * very helpful. So we skip device_set_usb_desc and set the + * device description manually. + */ + device_set_desc_copy(self, uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)]); + /* Announce device */ + device_printf(self, "<%s port> at <%s %s> on %s\n", + uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)], + uaa->device->manufacturer, uaa->device->product, + device_get_nameunit(uaa->device->bus->bdev)); + if (sc->sc_ttys > 0) { SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "ports", CTLFLAG_RD, &sc->sc_ttys, 0, "Number of attached serial ports"); @@ -568,11 +587,14 @@ uhso_attach(device_t self) "port", CTLFLAG_RD, NULL, "Serial ports"); } + /* + * Loop through the number of found TTYs and create sysctl + * nodes for them. + */ for (i = 0; i < sc->sc_ttys; i++) { ht = &sc->sc_tty[i]; ucom = &sc->sc_ucom[i]; - if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_MUX) port = uhso_mux_port_map[ht->ht_muxport]; else @@ -607,7 +629,6 @@ uhso_attach(device_t self) out: uhso_detach(sc->sc_dev); return (ENXIO); - } static int @@ -633,21 +654,17 @@ uhso_detach(device_t self) } if (sc->sc_ifp != NULL) { - callout_drain(&sc->sc_c); - mtx_lock(&sc->sc_mtx); uhso_if_stop(sc); bpfdetach(sc->sc_ifp); if_detach(sc->sc_ifp); if_free(sc->sc_ifp); mtx_unlock(&sc->sc_mtx); - usbd_transfer_unsetup(sc->sc_if_xfer, UHSO_IFNET_MAX); } mtx_destroy(&sc->sc_mtx); - return (0); } @@ -658,7 +675,7 @@ uhso_test_autoinst(void *arg, struct usb struct usb_interface *iface; struct usb_interface_descriptor *id; - if (uaa->dev_state != UAA_DEV_READY) + if (uaa->dev_state != UAA_DEV_READY || !uhso_autoswitch) return; iface = usbd_get_iface(udev, 0); @@ -694,7 +711,13 @@ uhso_driver_loaded(struct module *mod, i return (0); } -static int uhso_probe_iface_auto(struct uhso_softc *sc, int index) +/* + * Probe the interface type by querying the device. The elements + * of an array indicates the capabilities of a particular interface. + * Returns a bit mask with the interface capabilities. + */ +static int +uhso_probe_iface_auto(struct uhso_softc *sc, int index) { struct usb_device_request req; usb_error_t uerr; @@ -716,7 +739,7 @@ static int uhso_probe_iface_auto(struct return (0); } - UHSO_DPRINTF(3, "actlen=%d\n", actlen); + UHSO_DPRINTF(1, "actlen=%d\n", actlen); UHSO_HEXDUMP(buf, 17); if (index < 0 || index > 16) { @@ -724,21 +747,25 @@ static int uhso_probe_iface_auto(struct return (0); } - UHSO_DPRINTF(3, "index=%d, type=%x\n", index, buf[index]); + UHSO_DPRINTF(1, "index=%d, type=%x[%s]\n", index, buf[index], + uhso_port_type[(int)uhso_port_map[(int)buf[index]]]); if (buf[index] >= uhso_port_map_max) port = 0; else port = uhso_port_map[(int)buf[index]]; - if (port == UHSO_PORT_TYPE_NETWORK) - return (UHSO_IFACE_SPEC(UHSO_IF_BULK, - UHSO_PORT_NETWORK, port)); - else if (port == UHSO_PORT_TYPE_VOICE) + switch (port) { + case UHSO_PORT_TYPE_NETWORK: + return (UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, + UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, port)); + case UHSO_PORT_TYPE_VOICE: + /* Don't claim 'voice' ports */ return (0); - else + default: return (UHSO_IFACE_SPEC(UHSO_IF_BULK, UHSO_PORT_SERIAL, port)); + } return (0); } @@ -750,10 +777,12 @@ uhso_probe_iface_static(struct uhso_soft cd = usbd_get_config_descriptor(sc->sc_udev); if (cd->bNumInterface <= 3) { + /* Cards with 3 or less interfaces */ switch (index) { case 0: return UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, - UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, 0); + UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, + UHSO_PORT_TYPE_NETWORK); case 1: return UHSO_IFACE_SPEC(UHSO_IF_BULK, UHSO_PORT_SERIAL, UHSO_PORT_TYPE_DIAG); @@ -761,12 +790,13 @@ uhso_probe_iface_static(struct uhso_soft return UHSO_IFACE_SPEC(UHSO_IF_BULK, UHSO_PORT_SERIAL, UHSO_PORT_TYPE_MODEM); } - } - else { + } else { + /* Cards with 4 interfaces */ switch (index) { case 0: return UHSO_IFACE_SPEC(UHSO_IF_NET | UHSO_IF_MUX, - UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, 0); + UHSO_PORT_SERIAL | UHSO_PORT_NETWORK, + UHSO_PORT_TYPE_NETWORK); case 1: return UHSO_IFACE_SPEC(UHSO_IF_BULK, UHSO_PORT_SERIAL, UHSO_PORT_TYPE_DIAG2); @@ -781,14 +811,18 @@ uhso_probe_iface_static(struct uhso_soft return (0); } +/* + * Probes an interface for its particular capabilities and attaches if + * it's a supported interface. + */ static int uhso_probe_iface(struct uhso_softc *sc, int index, int (*probe)(struct uhso_softc *, int)) { struct usb_interface *iface; - int type, error, error0; + int type, error; - UHSO_DPRINTF(1, "Probing for interface %d, cb=%p\n", index, probe); + UHSO_DPRINTF(1, "Probing for interface %d, probe_func=%p\n", index, probe); type = probe(sc, index); UHSO_DPRINTF(1, "Probe result %x\n", type); @@ -798,27 +832,41 @@ uhso_probe_iface(struct uhso_softc *sc, sc->sc_type = type; iface = usbd_get_iface(sc->sc_udev, index); - if (UHSO_IFACE_USB_TYPE(type) & (UHSO_IF_MUX | UHSO_IF_NET)) { - error0 = uhso_attach_muxserial(sc, iface, type); + if (UHSO_IFACE_PORT_TYPE(type) == UHSO_PORT_TYPE_NETWORK) { error = uhso_attach_ifnet(sc, iface, type); - - if (error0 && error) + if (error) { + UHSO_DPRINTF(1, "uhso_attach_ifnet failed"); return (ENXIO); + } - if (sc->sc_ttys > 0) { + /* + * If there is an additional interrupt endpoint on this + * interface we most likley have a multiplexed serial port + * available. + */ + if (iface->idesc->bNumEndpoints < 3) { + sc->sc_type = UHSO_IFACE_SPEC( + UHSO_IFACE_USB_TYPE(type) & ~UHSO_IF_MUX, + UHSO_IFACE_PORT(type) & ~UHSO_PORT_SERIAL, + UHSO_IFACE_PORT_TYPE(type)); + return (0); + } + + UHSO_DPRINTF(1, "Trying to attach mux. serial\n"); + error = uhso_attach_muxserial(sc, iface, type); + if (error == 0 && sc->sc_ttys > 0) { error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); if (error) { device_printf(sc->sc_dev, "ucom_attach failed\n"); return (ENXIO); } - } - mtx_lock(&sc->sc_mtx); - usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); - mtx_unlock(&sc->sc_mtx); - } - else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && + mtx_lock(&sc->sc_mtx); + usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); + mtx_unlock(&sc->sc_mtx); + } + } else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && UHSO_IFACE_PORT(type) & UHSO_PORT_SERIAL) { error = uhso_attach_bulkserial(sc, iface, type); @@ -833,12 +881,18 @@ uhso_probe_iface(struct uhso_softc *sc, } } else { + UHSO_DPRINTF(0, "Unknown type %x\n", type); return (ENXIO); } return (0); } +/* + * Expands allocated memory to fit an additional TTY. + * Two arrays are kept with matching indexes, one for ucom and one + * for our private data. + */ static int uhso_alloc_tty(struct uhso_softc *sc) { @@ -856,11 +910,15 @@ uhso_alloc_tty(struct uhso_softc *sc) sc->sc_tty[sc->sc_ttys - 1].ht_sc = sc; - UHSO_DPRINTF(2, "Allocated TTY %d\n", sc->sc_ttys - 1); + UHSO_DPRINTF(1, "Allocated TTY %d\n", sc->sc_ttys - 1); return (sc->sc_ttys - 1); } - +/* + * Attach a multiplexed serial port + * Data is read/written with requests on the default control pipe. An interrupt + * endpoint returns when there is new data to be read. + */ static int uhso_attach_muxserial(struct uhso_softc *sc, struct usb_interface *iface, int type) @@ -885,6 +943,10 @@ uhso_attach_muxserial(struct uhso_softc if (desc->bDescriptorSubtype == 0) return (ENXIO); + /* + * The bitmask is one octet, loop through the number of + * bits that are set and create a TTY for each. + */ for (i = 0; i < 8; i++) { port = (1 << i); if ((port & desc->bDescriptorSubtype) == port) { @@ -905,6 +967,7 @@ uhso_attach_muxserial(struct uhso_softc } } + /* Setup the intr. endpoint */ uerr = usbd_transfer_setup(sc->sc_udev, &iface->idesc->bInterfaceNumber, sc->sc_xfer, uhso_mux_config, 1, sc, &sc->sc_mtx); @@ -914,6 +977,10 @@ uhso_attach_muxserial(struct uhso_softc return (0); } +/* + * Interrupt callback for the multiplexed serial port. Indicates + * which serial port that has data waiting. + */ static void uhso_mux_intr_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -943,6 +1010,7 @@ uhso_mux_intr_callback(struct usb_xfer * if (mux > UHSO_MPORT_TYPE_NOMAX) break; + /* Issue a read for this serial port */ usbd_xfer_set_priv( sc->sc_tty[mux].ht_xfer[UHSO_CTRL_READ], &sc->sc_tty[mux]); @@ -962,7 +1030,6 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - } static void @@ -1079,7 +1146,6 @@ uhso_mux_write_callback(struct usb_xfer break; break; } - } static int @@ -1089,9 +1155,7 @@ uhso_attach_bulkserial(struct uhso_softc usb_error_t uerr; int tty; - /* - * Try attaching RD/WR/INTR first - */ + /* Try attaching RD/WR/INTR first */ uerr = usbd_transfer_setup(sc->sc_udev, &iface->idesc->bInterfaceNumber, sc->sc_xfer, uhso_bs_config, UHSO_BULK_ENDPT_MAX, sc, &sc->sc_mtx); @@ -1146,7 +1210,6 @@ tr_setup: } } - static void uhso_bs_write_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -1208,9 +1271,7 @@ uhso_bs_intr_callback(struct usb_xfer *x int actlen; struct usb_cdc_notification cdc; - usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); - UHSO_DPRINTF(3, "status %d, actlen=%d\n", USB_GET_STATE(xfer), actlen); switch (USB_GET_STATE(xfer)) { @@ -1228,14 +1289,14 @@ uhso_bs_intr_callback(struct usb_xfer *x usbd_copy_out(pc, 0, &cdc, actlen); if (UGETW(cdc.wIndex) != sc->sc_iface_no) { - UHSO_DPRINTF(0, "Interface missmatch, got %d expected %d\n", + UHSO_DPRINTF(0, "Interface mismatch, got %d expected %d\n", UGETW(cdc.wIndex), sc->sc_iface_no); goto tr_setup; } if (cdc.bmRequestType == UCDC_NOTIFICATION && cdc.bNotification == UCDC_N_SERIAL_STATE) { - UHSO_DPRINTF(1, "notify = 0x%02x\n", cdc.data[0]); + UHSO_DPRINTF(2, "notify = 0x%02x\n", cdc.data[0]); sc->sc_msr = 0; sc->sc_lsr = 0; @@ -1299,7 +1360,6 @@ uhso_ucom_cfg_set_rts(struct ucom_softc uhso_bs_cfg(sc); } - static void uhso_ucom_start_read(struct ucom_softc *ucom) { @@ -1373,7 +1433,6 @@ uhso_ucom_stop_write(struct ucom_softc * else if (UHSO_IFACE_USB_TYPE(sc->sc_type) & UHSO_IF_BULK) { usbd_transfer_stop(sc->sc_xfer[UHSO_BULK_ENDPT_WRITE]); } - } static int uhso_attach_ifnet(struct uhso_softc *sc, struct usb_interface *iface, @@ -1393,7 +1452,7 @@ static int uhso_attach_ifnet(struct uhso return (-1); } - sc->sc_ifp = ifp = if_alloc(IFT_PPP); + sc->sc_ifp = ifp = if_alloc(IFT_OTHER); if (sc->sc_ifp == NULL) { device_printf(sc->sc_dev, "if_alloc() failed\n"); return (-1); @@ -1406,7 +1465,6 @@ static int uhso_attach_ifnet(struct uhso if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); ifp->if_mtu = UHSO_MAX_MTU; - ifp->if_ioctl = uhso_if_ioctl; ifp->if_init = uhso_if_init; ifp->if_start = uhso_if_start; @@ -1448,6 +1506,7 @@ uhso_ifnet_read_callback(struct usb_xfer m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); usbd_copy_out(pc, 0, mtod(m, uint8_t *), actlen); m->m_pkthdr.len = m->m_len = actlen; + /* Enqueue frame for further processing */ _IF_ENQUEUE(&sc->sc_rxq, m); if (!callout_pending(&sc->sc_c) || !callout_active(&sc->sc_c)) { @@ -1470,7 +1529,11 @@ tr_setup: } /* - * Defered RX processing, called with mutex locked. + * Deferred RX processing, called with mutex locked. + * + * Each frame we receive might contain several small ip-packets aswell + * as partial ip-packets. We need to separate/assemble them into individual + * packets before sending them to the ip-layer. */ static void uhso_if_rxflush(void *arg) @@ -1493,7 +1556,7 @@ uhso_if_rxflush(void *arg) _IF_DEQUEUE(&sc->sc_rxq, m); if (m == NULL) break; - UHSO_DPRINTF(2, "dequeue m=%p, len=%d\n", m, m->m_len); + UHSO_DPRINTF(3, "dequeue m=%p, len=%d\n", m, m->m_len); } mtx_unlock(&sc->sc_mtx); @@ -1502,7 +1565,7 @@ uhso_if_rxflush(void *arg) m0 = mwait; mwait = NULL; - UHSO_DPRINTF(1, "partial m0=%p(%d), concat w/ m=%p(%d)\n", + UHSO_DPRINTF(3, "partial m0=%p(%d), concat w/ m=%p(%d)\n", m0, m0->m_len, m, m->m_len); len = m->m_len + m0->m_len; @@ -1518,7 +1581,7 @@ uhso_if_rxflush(void *arg) mtx_lock(&sc->sc_mtx); continue; } - UHSO_DPRINTF(2, "Constructed mbuf=%p, len=%d\n", + UHSO_DPRINTF(3, "Constructed mbuf=%p, len=%d\n", m, m->m_pkthdr.len); } @@ -1560,7 +1623,7 @@ uhso_if_rxflush(void *arg) continue; } - UHSO_DPRINTF(1, "m=%p, len=%d, cp=%p, iplen=%d\n", + UHSO_DPRINTF(3, "m=%p, len=%d, cp=%p, iplen=%d\n", m, m->m_pkthdr.len, cp, iplen); m0 = NULL; @@ -1581,12 +1644,12 @@ uhso_if_rxflush(void *arg) m_adj(m0, iplen); m0 = m_defrag(m0, M_WAIT); - UHSO_DPRINTF(1, "New mbuf=%p, len=%d/%d, m0=%p, " + UHSO_DPRINTF(3, "New mbuf=%p, len=%d/%d, m0=%p, " "m0_len=%d/%d\n", m, m->m_pkthdr.len, m->m_len, m0, m0->m_pkthdr.len, m0->m_len); } else if (iplen > m->m_pkthdr.len) { - UHSO_DPRINTF(1, "Defered mbuf=%p, len=%d\n", + UHSO_DPRINTF(3, "Deferred mbuf=%p, len=%d\n", m, m->m_pkthdr.len); mwait = m; m = NULL; @@ -1649,7 +1712,6 @@ tr_setup: usbd_xfer_set_stall(xfer); goto tr_setup; } - } static int @@ -1698,7 +1760,7 @@ uhso_if_init(void *priv) ifp->if_drv_flags |= IFF_DRV_RUNNING; mtx_unlock(&sc->sc_mtx); - UHSO_DPRINTF(3, "ifnet initialized\n"); + UHSO_DPRINTF(2, "ifnet initialized\n"); } static int @@ -1722,7 +1784,6 @@ uhso_if_output(struct ifnet *ifp, struct return (ENOBUFS); } ifp->if_opackets++; - return (0); } @@ -1749,6 +1810,5 @@ uhso_if_stop(struct uhso_softc *sc) usbd_transfer_stop(sc->sc_if_xfer[UHSO_IFNET_READ]); usbd_transfer_stop(sc->sc_if_xfer[UHSO_IFNET_WRITE]); - sc->sc_ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 13 20:51:23 2010 (r202242) +++ head/sys/dev/usb/usbdevs Wed Jan 13 20:54:18 2010 (r202243) @@ -2111,6 +2111,7 @@ product OPTION GE40X_3 0x7381 Globetrot product OPTION ICONEDGE 0xc031 GlobeSurfer iCON EDGE product OPTION MODHSXPA 0xd013 Globetrotter HSUPA product OPTION ICON321 0xd031 Globetrotter HSUPA +product OPTION ICON505 0xd055 Globetrotter iCON 505 /* OQO */ product OQO WIFI01 0x0002 model 01 WiFi interface From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 21:22:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03CB81065672; Wed, 13 Jan 2010 21:22:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDDAF8FC14; Wed, 13 Jan 2010 21:22: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 o0DLMNqH028685; Wed, 13 Jan 2010 21:22:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DLMNmP028682; Wed, 13 Jan 2010 21:22:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001132122.o0DLMNmP028682@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 21:22: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: r202264 - in head: share/man/man4 sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:22:24 -0000 Author: ed Date: Wed Jan 13 21:22:23 2010 New Revision: 202264 URL: http://svn.freebsd.org/changeset/base/202264 Log: Remove the 1000 pseudo terminal limit from pts(4). Even with the old utmp format, we could in fact go to pts/9999, because ut_line wasn't guaranteed to be null terminated there. Modified: head/share/man/man4/pts.4 head/sys/kern/tty_pts.c Modified: head/share/man/man4/pts.4 ============================================================================== --- head/share/man/man4/pts.4 Wed Jan 13 21:21:32 2010 (r202263) +++ head/share/man/man4/pts.4 Wed Jan 13 21:22:23 2010 (r202264) @@ -136,12 +136,6 @@ This should not be used directly. It is used to implement routines like .Xr grantpt 3 . .El -.Pp -The maximum number of pseudo-terminals is limited to 1000. -It is not possible to use more than 1000 pseudo-terminals, as all software -which use -.Xr utmp 5 -will not be able to handle pseudo-terminals with number superior to 999. .Sh FILES The files used by this pseudo-terminals implementation are: @@ -150,26 +144,6 @@ pseudo-terminals implementation are: .It Pa /dev/pts/[num] Pseudo-terminal slave devices. .El -.Sh SYSCTL VARIABLES -The following -.Xr sysctl 8 -variables can be used to modify or monitor -.Nm -behavior. -.Bl -tag -width indent -.It Va kern.pts_maxdev -Highest pseudo-terminal unit number to be allocated. -Because -.Xr utmp 5 -is restricted to an 8-byte line name size, -.Nm -will not create any pseudo-terminals with a unit number above 999 by -default. -After increasing -.Dv UT_LINESIZE , -this variable can be changed to allow more than 1000 pseudo-terminals to -be allocated simultaneously. -.El .Sh DIAGNOSTICS None. .Sh SEE ALSO Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Wed Jan 13 21:21:32 2010 (r202263) +++ head/sys/kern/tty_pts.c Wed Jan 13 21:22:23 2010 (r202264) @@ -71,9 +71,6 @@ __FBSDID("$FreeBSD$"); * UT_LINESIZE. */ static struct unrhdr *pts_pool; -static unsigned int pts_maxdev = 999; -SYSCTL_UINT(_kern, OID_AUTO, pts_maxdev, CTLFLAG_RW, &pts_maxdev, 0, - "Maximum amount of pts(4) pseudo-terminals"); static MALLOC_DEFINE(M_PTS, "pts", "pseudo tty device"); @@ -725,11 +722,6 @@ pts_alloc(int fflags, struct thread *td, chgptscnt(uid, -1, 0); return (EAGAIN); } - if (unit > pts_maxdev) { - free_unr(pts_pool, unit); - chgptscnt(uid, -1, 0); - return (EAGAIN); - } /* Allocate TTY and softc. */ psc = malloc(sizeof(struct pts_softc), M_PTS, M_WAITOK|M_ZERO); From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 21:27:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36427106566B; Wed, 13 Jan 2010 21:27:30 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA038FC12; Wed, 13 Jan 2010 21:27:28 +0000 (UTC) Received: by ewy3 with SMTP id 3so104940ewy.13 for ; Wed, 13 Jan 2010 13:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=a/NEstGZn9uhrtNdFQQrKJ7xBGbGN6lpe1ygePVNYos=; b=sWAaQbVYt7ZlFYCssMl9jGb3FisyKRrRcF/2HbyLHQfLu+65xwVW7b9xmPfOlE3vir pfo4YXC/pGE///Wh+VaLjBUdap/uSPHVnyYePAfJFIpwJPoA5b4m2ykg6Mq70RWaxEwF fmBr3s/Dq5NRvl2gdMs5QP2bto4/AJsxE6cGQ= 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=vevSmgz7KQvbe6Rl7h9XwsggNw9AsphDZKWUQ1tfJqw8gy6PC8iWZdAnlTp+0G6Z1e 3/T6WYGqNboUl7iwA6Exx69NoH1i1PB1tK60yiaYiKcgeLMnjRDN0awmjG7z47gb/shE K6DHK6VWvobyFUvz7hIhWqKZmU2ID2Ix/sggA= MIME-Version: 1.0 Received: by 10.213.23.201 with SMTP id s9mr1923554ebb.5.1263418044099; Wed, 13 Jan 2010 13:27:24 -0800 (PST) In-Reply-To: <201001132054.o0DKsI9e021324@svn.freebsd.org> References: <201001132054.o0DKsI9e021324@svn.freebsd.org> Date: Wed, 13 Jan 2010 16:27:24 -0500 Message-ID: <47d0403c1001131327w61c9ccb9gc8693dc88f7fff13@mail.gmail.com> From: Ben Kaduk To: Andrew Thompson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:27:30 -0000 Lots of grammar nits. See below. On Wed, Jan 13, 2010 at 3:54 PM, Andrew Thompson wrote: > Author: thompsa > Date: Wed Jan 13 20:54:18 2010 > New Revision: 202243 > URL: http://svn.freebsd.org/changeset/base/202243 > > Log: > Update to Fredrik's latest uhso driver. This changes port detection, adds > comments and other code nits. > > Submitted by: Fredrik Lindberg > > Modified: > head/share/man/man4/uhso.4 > head/sys/dev/usb/net/uhso.c > head/sys/dev/usb/usbdevs > > Modified: head/share/man/man4/uhso.4 > ============================================================================== > --- head/share/man/man4/uhso.4 Wed Jan 13 20:51:23 2010 (r202242) > +++ head/share/man/man4/uhso.4 Wed Jan 13 20:54:18 2010 (r202243) > @@ -23,11 +23,11 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd Aug 12, 2009 > +.Dd January 14, 2010 > .Os > .Dt UHSO 4 > .Sh NAME > -.Nm hso > +.Nm uhso > .Nd support for several HSxPA devices from Option N.V. > .Sh SYNOPSIS > The module can be loaded at boot time by placing the following line in > @@ -47,12 +47,12 @@ driver which makes them behave like a > .Xr tty 4 . > The packet interface is exposed as a network interface. > .Pp > -To establish a connection on the packet interface the use of the proprietary > +Connection of the packet interface is achieved by using the proprietary This sentence sounds subtly wrong to me. I think that just saying "connection to" instead of "of" will make it grammatically correct, but I worry that it may no longer be factually correct, then. Perhaps "A connection on [...]", instead? > AT commands > .Dq Li AT_OWANCALL > and > .Dq Li AT_OWANDATA > -are required on any of the serial ports. > +on any of the available serial ports. > .Pp > The network interface must be configured manually using the data obtain from > these calls. > @@ -70,12 +70,23 @@ driver supports at least the following c > Option GlobeSurfer iCON 7.2 (new firmware) > .It > Option iCON 225 > +.It > +Option iCON 505 > .El > .Pp > The device features a mass storage device referred to as > .Dq Zero-CD > -which contains drivers for Microsoft Windows. > -The driver automatically switches the device to modem mode. > +which contains drivers for Microsoft Windows, this is the default Comma splice. I would put a semicolon, but a full stop is acceptable, too. > +mode for the device. > +The > +.Nm > +driver automatically switches the device from > +.Dq Zero-CD > +mode to modem mode. > +This behavior can be disabled by setting > +.Va hw.usb.uhso.auto_switch > +to 0 using > +.Xr sysctl 8 > .Sh EXAMPLES > Establishing a packet interface connection > .Bd -literal -offset indent > > Modified: head/sys/dev/usb/net/uhso.c > ============================================================================== > --- head/sys/dev/usb/net/uhso.c Wed Jan 13 20:51:23 2010 (r202242) > +++ head/sys/dev/usb/net/uhso.c Wed Jan 13 20:54:18 2010 (r202243) > @@ -145,12 +146,14 @@ struct uhso_softc { > #define UHSO_MPORT_TYPE_APP 0x01 /* Application */ > #define UHSO_MPORT_TYPE_PCSC 0x02 > #define UHSO_MPORT_TYPE_GPS 0x03 > -#define UHSO_MPORT_TYPE_APP2 0x04 > +#define UHSO_MPORT_TYPE_APP2 0x04 /* Secondary application */ > #define UHSO_MPORT_TYPE_MAX UHSO_MPORT_TYPE_APP2 > #define UHSO_MPORT_TYPE_NOMAX 8 /* Max number of mux ports */ > > /* > * Port definitions > + * Note that these definitions are arbitray and doesn't match > + * values returned by the auto config descriptor. "arbitrary"; "don't"; "the values" > */ > #define UHSO_PORT_TYPE_CTL 0x01 > #define UHSO_PORT_TYPE_APP 0x02 > @@ -560,6 +567,18 @@ uhso_attach(device_t self) > CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0, > "Port available at this interface"); > > + /* > + * The default interface description on most Option devices aren't "isn't" > + * very helpful. So we skip device_set_usb_desc and set the > + * device description manually. > + */ > + device_set_desc_copy(self, uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)]); > + /* Announce device */ > + device_printf(self, "<%s port> at <%s %s> on %s\n", > + uhso_port_type[UHSO_IFACE_PORT_TYPE(sc->sc_type)], > + uaa->device->manufacturer, uaa->device->product, > + device_get_nameunit(uaa->device->bus->bdev)); > + > if (sc->sc_ttys > 0) { > SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "ports", > CTLFLAG_RD, &sc->sc_ttys, 0, "Number of attached serial ports"); > @@ -798,27 +832,41 @@ uhso_probe_iface(struct uhso_softc *sc, > sc->sc_type = type; > iface = usbd_get_iface(sc->sc_udev, index); > > - if (UHSO_IFACE_USB_TYPE(type) & (UHSO_IF_MUX | UHSO_IF_NET)) { > - error0 = uhso_attach_muxserial(sc, iface, type); > + if (UHSO_IFACE_PORT_TYPE(type) == UHSO_PORT_TYPE_NETWORK) { > error = uhso_attach_ifnet(sc, iface, type); > - > - if (error0 && error) > + if (error) { > + UHSO_DPRINTF(1, "uhso_attach_ifnet failed"); > return (ENXIO); > + } > > - if (sc->sc_ttys > 0) { > + /* > + * If there is an additional interrupt endpoint on this > + * interface we most likley have a multiplexed serial port "likely". I might put a comma before "we", while you're here. > + * available. > + */ > + if (iface->idesc->bNumEndpoints < 3) { > + sc->sc_type = UHSO_IFACE_SPEC( > + UHSO_IFACE_USB_TYPE(type) & ~UHSO_IF_MUX, > + UHSO_IFACE_PORT(type) & ~UHSO_PORT_SERIAL, > + UHSO_IFACE_PORT_TYPE(type)); > + return (0); > + } > + > + UHSO_DPRINTF(1, "Trying to attach mux. serial\n"); > + error = uhso_attach_muxserial(sc, iface, type); > + if (error == 0 && sc->sc_ttys > 0) { > error = ucom_attach(&sc->sc_super_ucom, sc->sc_ucom, > sc->sc_ttys, sc, &uhso_ucom_callback, &sc->sc_mtx); > if (error) { > device_printf(sc->sc_dev, "ucom_attach failed\n"); > return (ENXIO); > } > - } > > - mtx_lock(&sc->sc_mtx); > - usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); > - mtx_unlock(&sc->sc_mtx); > - } > - else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && > + mtx_lock(&sc->sc_mtx); > + usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]); > + mtx_unlock(&sc->sc_mtx); > + } > + } else if ((UHSO_IFACE_USB_TYPE(type) & UHSO_IF_BULK) && > UHSO_IFACE_PORT(type) & UHSO_PORT_SERIAL) { > > error = uhso_attach_bulkserial(sc, iface, type); > @@ -914,6 +977,10 @@ uhso_attach_muxserial(struct uhso_softc > return (0); > } > > +/* > + * Interrupt callback for the multiplexed serial port. Indicates > + * which serial port that has data waiting. "that" is unnecessary, here. > + */ > static void > uhso_mux_intr_callback(struct usb_xfer *xfer, usb_error_t error) > { > @@ -1470,7 +1529,11 @@ tr_setup: > } > > /* > - * Defered RX processing, called with mutex locked. > + * Deferred RX processing, called with mutex locked. > + * > + * Each frame we receive might contain several small ip-packets aswell "as well" -Ben Kaduk From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 21:35:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D341065676; Wed, 13 Jan 2010 21:35:51 +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 D905D8FC08; Wed, 13 Jan 2010 21:35:50 +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 6FD5746B2C; Wed, 13 Jan 2010 16:35:50 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B92A08A01D; Wed, 13 Jan 2010 16:35:49 -0500 (EST) From: John Baldwin To: Doug Barton Date: Wed, 13 Jan 2010 16:33:09 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091231; KDE/4.3.1; amd64; ; ) References: <201001131515.08602.jhb@freebsd.org> <4B4E2ECA.90905@FreeBSD.org> In-Reply-To: <4B4E2ECA.90905@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001131633.09669.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 13 Jan 2010 16:35:49 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:35:51 -0000 On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote: > On 1/13/2010 12:15 PM, John Baldwin wrote: > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: > >> To address the other responses, Tom, sorry, your suggested text doesn't > >> address my concern. John, I don't think that users would somehow > >> magically know to look in NOTES for more information about an option > >> that is already in GENERIC. > > > > You really think users do not already know to look in manpages or NOTES to > > find out more details about kernel options? > > That's not what I said. I don't think that users would [..] know to look in NOTES for more information about an option that is [...] in GENERIC. That seems really straight forward to me, or my English isn't good. I do think users "would know to look in NOTES for more information about an option that is in GENERIC". > > Put > > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it > > deserves special treatment relative to other kernel options? > > Because the default behavior (not including the actual file) for the > option is contrary to user' reasonable expectation of how the option > should work .... and now I'm repeating myself. I think a better change would be to just change the default behavior of config(8) to do the reasonable thing. > Seriously, don't you have anything better to do than argue against > including a comment in a config file? I know I do. What is the > overwhelming horror that will arise here if there are more comments > GENERIC than you deem to be absolutely necessary? What is the overwhelming horror about keeping a file readable and allowing users to find extended documentation for INCLUDE_CONFIG_FILE in the same place that they find extended documentation about every other kernel option? > And yes, I read the part of your message that I snipped about "why do we > have these documents if users don't read them?" The answer is, that's > why I'm suggesting a comment that tells users what man page to read. I think adding comments that merely redirect the users to further documentation only serves to obfuscate. Left unchecked this approach will render files such as GENERIC with a very low signal-to-noise ratio making it harder to parse in a "big picture" way. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 21:37:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A922A1065670; Wed, 13 Jan 2010 21:37:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from utility-0.aerioconnect.net (utility-0.aerioconnect.net [216.240.32.11]) by mx1.freebsd.org (Postfix) with ESMTP id 6AAF98FC13; Wed, 13 Jan 2010 21:37:24 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by utility-0.aerioconnect.net (8.13.1/8.13.1) with ESMTP id o0DKSXBV011267; Wed, 13 Jan 2010 12:28:33 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 64EF72D6018; Wed, 13 Jan 2010 12:28:32 -0800 (PST) Message-ID: <4B4E2CEF.5030709@elischer.org> Date: Wed, 13 Jan 2010 12:28:31 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: John Baldwin References: <20100112.174326.337739863389869251.imp@bsdimp.com> <4B4E1586.7090102@FreeBSD.org> <201001131515.08602.jhb@freebsd.org> In-Reply-To: <201001131515.08602.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Doug Barton , svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:37:24 -0000 John Baldwin wrote: > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: >> To address the other responses, Tom, sorry, your suggested text doesn't >> address my concern. John, I don't think that users would somehow >> magically know to look in NOTES for more information about an option >> that is already in GENERIC. > > You really think users do not already know to look in manpages or NOTES to > find out more details about kernel options? how about a one line comment in GENERIC suggesting that people look at NOTES for more info. From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 21:55:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9913A106568D; Wed, 13 Jan 2010 21:55:10 +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 6781C8FC0C; Wed, 13 Jan 2010 21:55:10 +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 10B5A46B51; Wed, 13 Jan 2010 16:55:10 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 525DD8A01D; Wed, 13 Jan 2010 16:55:09 -0500 (EST) From: John Baldwin To: Julian Elischer Date: Wed, 13 Jan 2010 16:55:08 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091231; KDE/4.3.1; amd64; ; ) References: <201001131515.08602.jhb@freebsd.org> <4B4E2CEF.5030709@elischer.org> In-Reply-To: <4B4E2CEF.5030709@elischer.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001131655.08465.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 13 Jan 2010 16:55:09 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Doug Barton , svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 21:55:10 -0000 On Wednesday 13 January 2010 3:28:31 pm Julian Elischer wrote: > John Baldwin wrote: > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: > >> To address the other responses, Tom, sorry, your suggested text doesn't > >> address my concern. John, I don't think that users would somehow > >> magically know to look in NOTES for more information about an option > >> that is already in GENERIC. > > > > You really think users do not already know to look in manpages or NOTES to > > find out more details about kernel options? > > how about a one line comment in GENERIC suggesting that people look at > NOTES for more info. There is already a large block comment at the top of GENERIC that gives people several other places to look for more detailed info on kernel options as a general rule: # # GENERIC -- Generic kernel configuration file for FreeBSD/amd64 # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ../../conf/NOTES and NOTES files. # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # # $FreeBSD: head/sys/amd64/conf/GENERIC 202019 2010-01-10 17:44:22Z imp $ I think the existing paragraph about NOTES in particular is sufficient without requiring additional detailed documentation for each option. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 22:10:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82C4B1065676; Wed, 13 Jan 2010 22:10:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 34A088FC14; Wed, 13 Jan 2010 22:10:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0DM3dAA096341; Wed, 13 Jan 2010 15:03:39 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 13 Jan 2010 15:04:35 -0700 (MST) Message-Id: <20100113.150435.650865766805848595.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <201001131633.09669.jhb@freebsd.org> References: <201001131515.08602.jhb@freebsd.org> <4B4E2ECA.90905@FreeBSD.org> <201001131633.09669.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 22:10:29 -0000 In message: <201001131633.09669.jhb@freebsd.org> John Baldwin writes: : On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote: : > On 1/13/2010 12:15 PM, John Baldwin wrote: : > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: : > >> To address the other responses, Tom, sorry, your suggested text doesn't : > >> address my concern. John, I don't think that users would somehow : > >> magically know to look in NOTES for more information about an option : > >> that is already in GENERIC. : > > : > > You really think users do not already know to look in manpages or NOTES to : > > find out more details about kernel options? : > : > That's not what I said. : : : I don't think that users would [..] know to look in NOTES for more information : about an option that is [...] in GENERIC. : : : That seems really straight forward to me, or my English isn't good. I do : think users "would know to look in NOTES for more information about an option : that is in GENERIC". Agreed. That's why I did what I did: I conformed to the usual practice. : > > Put : > > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently special that it : > > deserves special treatment relative to other kernel options? : > : > Because the default behavior (not including the actual file) for the : > option is contrary to user' reasonable expectation of how the option : > should work .... and now I'm repeating myself. : : I think a better change would be to just change the default behavior of : config(8) to do the reasonable thing. -C should be the default, and we should invent a new '--smaller-saved-config' option. : > Seriously, don't you have anything better to do than argue against : > including a comment in a config file? I know I do. What is the : > overwhelming horror that will arise here if there are more comments : > GENERIC than you deem to be absolutely necessary? : : What is the overwhelming horror about keeping a file readable and allowing : users to find extended documentation for INCLUDE_CONFIG_FILE in the same place : that they find extended documentation about every other kernel option? Yes. That's why I did what I did: to keep things readable. : > And yes, I read the part of your message that I snipped about "why do we : > have these documents if users don't read them?" The answer is, that's : > why I'm suggesting a comment that tells users what man page to read. : : I think adding comments that merely redirect the users to further : documentation only serves to obfuscate. Left unchecked this approach will : render files such as GENERIC with a very low signal-to-noise ratio making it : harder to parse in a "big picture" way. Yes. Basically, I'm annoyed too: Our users aren't idiots, and we shouldn't be treating them as such at every turn. If there are surprises with how INCLUDE_CONFIG_FILE behaves, we should work to make it better, not paper over it with a comment. Warner From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 22:22:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBFBE106566C; Wed, 13 Jan 2010 22:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1B218FC18; Wed, 13 Jan 2010 22:22: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 o0DMMGc8042106; Wed, 13 Jan 2010 22:22:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DMMGE0042103; Wed, 13 Jan 2010 22:22:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001132222.o0DMMGE0042103@svn.freebsd.org> From: Alexander Motin Date: Wed, 13 Jan 2010 22:22: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: r202267 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 22:22:17 -0000 Author: mav Date: Wed Jan 13 22:22:16 2010 New Revision: 202267 URL: http://svn.freebsd.org/changeset/base/202267 Log: Hide from default sndstat some information not used on daily basis, to make it readable by average user with average screen size. Modified: head/sys/dev/sound/pcm/sndstat.c head/sys/dev/sound/pcm/sndstat.h Modified: head/sys/dev/sound/pcm/sndstat.c ============================================================================== --- head/sys/dev/sound/pcm/sndstat.c Wed Jan 13 21:23:29 2010 (r202266) +++ head/sys/dev/sound/pcm/sndstat.c Wed Jan 13 22:22:16 2010 (r202267) @@ -81,7 +81,7 @@ static int sndstat_files = 0; static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(sndstat_devlist); -int snd_verbose = 1; +int snd_verbose = 0; TUNABLE_INT("hw.snd.verbose", &snd_verbose); #ifdef SND_DEBUG @@ -372,12 +372,10 @@ sndstat_prepare(struct sbuf *s) PCM_ACQUIRE_QUICK(d); sbuf_printf(s, "%s:", device_get_nameunit(ent->dev)); sbuf_printf(s, " <%s>", device_get_desc(ent->dev)); - sbuf_printf(s, " %s [%s]", ent->str, - (d->flags & SD_F_MPSAFE) ? "MPSAFE" : "GIANT"); + if (snd_verbose > 0) + sbuf_printf(s, " %s", ent->str); if (ent->handler) ent->handler(s, ent->dev, snd_verbose); - else - sbuf_printf(s, " [no handler]"); sbuf_printf(s, "\n"); PCM_RELEASE_QUICK(d); } Modified: head/sys/dev/sound/pcm/sndstat.h ============================================================================== --- head/sys/dev/sound/pcm/sndstat.h Wed Jan 13 21:23:29 2010 (r202266) +++ head/sys/dev/sound/pcm/sndstat.h Wed Jan 13 22:22:16 2010 (r202267) @@ -37,9 +37,6 @@ struct pcm_channel *c; \ struct pcm_feeder *f; \ \ - if (verbose < 1) \ - return (0); \ - \ d = device_get_softc(dev); \ PCM_BUSYASSERT(d); \ \ @@ -48,9 +45,19 @@ return (0); \ } \ \ - sbuf_printf(s, " (%dp:%dv/%dr:%dv channels %splex%s)", \ - d->playcount, d->pvchancount, d->reccount, d->rvchancount, \ - (d->flags & SD_F_SIMPLEX) ? "sim" : "du", \ + if (verbose < 1) { \ + sbuf_printf(s, " (%s%s%s", \ + d->playcount ? "play" : "", \ + (d->playcount && d->reccount) ? "/" : "", \ + d->reccount ? "rec" : ""); \ + } else { \ + sbuf_printf(s, " (%dp:%dv/%dr:%dv", \ + d->playcount, d->pvchancount, \ + d->reccount, d->rvchancount); \ + } \ + sbuf_printf(s, "%s)%s", \ + ((d->playcount != 0 && d->reccount != 0) && \ + (d->flags & SD_F_SIMPLEX)) ? " simplex" : "", \ (device_get_unit(dev) == snd_unit) ? " default" : "") From owner-svn-src-head@FreeBSD.ORG Wed Jan 13 22:39:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAB871065679; Wed, 13 Jan 2010 22:39:39 +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 BCEE38FC17; Wed, 13 Jan 2010 22:39: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 o0DMddgF045976; Wed, 13 Jan 2010 22:39:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DMddYZ045973; Wed, 13 Jan 2010 22:39:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001132239.o0DMddYZ045973@svn.freebsd.org> From: Xin LI Date: Wed, 13 Jan 2010 22:39: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: r202268 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 22:39:40 -0000 Author: delphij Date: Wed Jan 13 22:39:39 2010 New Revision: 202268 URL: http://svn.freebsd.org/changeset/base/202268 Log: o Add PCI ID for BCM 5756. o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based on their PCI IDs rather than their chip IDs. Reported by: several PC-BSD users via kmoore Reviewed by: yongari, imp, jhb, davidch Sponsored by: iXsystems, Inc. MFC after: 2 weeks Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Jan 13 22:22:16 2010 (r202267) +++ head/sys/dev/bge/if_bge.c Wed Jan 13 22:39:39 2010 (r202268) @@ -187,6 +187,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5756 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, @@ -2604,7 +2605,8 @@ bge_attach(device_t dev) sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { - if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5722 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5756) sc->bge_flags |= BGE_FLAG_JITTER_BUG; } else if (sc->bge_asicrev != BGE_ASICREV_BCM5906) sc->bge_flags |= BGE_FLAG_BER_BUG; Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Wed Jan 13 22:22:16 2010 (r202267) +++ head/sys/dev/bge/if_bgereg.h Wed Jan 13 22:39:39 2010 (r202268) @@ -2138,6 +2138,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5756 0x1674 #define BCOM_DEVICEID_BCM5761 0x1681 #define BCOM_DEVICEID_BCM5761E 0x1680 #define BCOM_DEVICEID_BCM5761S 0x1688 From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 00:36:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A60D1065670; Thu, 14 Jan 2010 00:36: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 192258FC0C; Thu, 14 Jan 2010 00:36: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 o0E0annY072037; Thu, 14 Jan 2010 00:36:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E0anlU072034; Thu, 14 Jan 2010 00:36:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001140036.o0E0anlU072034@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 00:36: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: r202269 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 00:36:50 -0000 Author: yongari Date: Thu Jan 14 00:36:49 2010 New Revision: 202269 URL: http://svn.freebsd.org/changeset/base/202269 Log: Add BCM5754 PHY id that is found on Dell Studio XPS 16. Tested by: scf MFC after: 1 week Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Wed Jan 13 22:39:39 2010 (r202268) +++ head/sys/dev/mii/brgphy.c Thu Jan 14 00:36:49 2010 (r202269) @@ -133,6 +133,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5708S), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5784), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5906), Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Wed Jan 13 22:39:39 2010 (r202268) +++ head/sys/dev/mii/miidevs Thu Jan 14 00:36:49 2010 (r202269) @@ -153,6 +153,7 @@ model xxBROADCOM_ALT1 BCM5787 0x000e BCM model xxBROADCOM_ALT1 BCM5708S 0x0015 BCM5708S 1000/2500BaseSX PHY model xxBROADCOM_ALT1 BCM5709CAX 0x002c BCM5709C(AX) 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5722 0x002d BCM5722 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5784 0x003a BCM5784 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 01:16:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E441065676; Thu, 14 Jan 2010 01:16:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE8618FC08; Thu, 14 Jan 2010 01:16: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 o0E1GK5H080925; Thu, 14 Jan 2010 01:16:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E1GKsr080922; Thu, 14 Jan 2010 01:16:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001140116.o0E1GKsr080922@svn.freebsd.org> From: Andrew Thompson Date: Thu, 14 Jan 2010 01:16: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: r202270 - in head: share/man/man4 sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 01:16:21 -0000 Author: thompsa Date: Thu Jan 14 01:16:20 2010 New Revision: 202270 URL: http://svn.freebsd.org/changeset/base/202270 Log: Grammar nits. Submitted by: Ben Kaduk Modified: head/share/man/man4/uhso.4 head/sys/dev/usb/net/uhso.c Modified: head/share/man/man4/uhso.4 ============================================================================== --- head/share/man/man4/uhso.4 Thu Jan 14 00:36:49 2010 (r202269) +++ head/share/man/man4/uhso.4 Thu Jan 14 01:16:20 2010 (r202270) @@ -47,8 +47,8 @@ driver which makes them behave like a .Xr tty 4 . The packet interface is exposed as a network interface. .Pp -Connection of the packet interface is achieved by using the proprietary -AT commands +Establishing a connection on the packet interface is achieved by using the +proprietary AT commands .Dq Li AT_OWANCALL and .Dq Li AT_OWANDATA @@ -76,7 +76,7 @@ Option iCON 505 .Pp The device features a mass storage device referred to as .Dq Zero-CD -which contains drivers for Microsoft Windows, this is the default +which contains drivers for Microsoft Windows; this is the default mode for the device. The .Nm Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Thu Jan 14 00:36:49 2010 (r202269) +++ head/sys/dev/usb/net/uhso.c Thu Jan 14 01:16:20 2010 (r202270) @@ -152,8 +152,8 @@ struct uhso_softc { /* * Port definitions - * Note that these definitions are arbitray and doesn't match - * values returned by the auto config descriptor. + * Note that these definitions are arbitrary and do not match the values + * returned by the auto config descriptor. */ #define UHSO_PORT_TYPE_CTL 0x01 #define UHSO_PORT_TYPE_APP 0x02 @@ -568,7 +568,7 @@ uhso_attach(device_t self) "Port available at this interface"); /* - * The default interface description on most Option devices aren't + * The default interface description on most Option devices isn't * very helpful. So we skip device_set_usb_desc and set the * device description manually. */ @@ -841,7 +841,7 @@ uhso_probe_iface(struct uhso_softc *sc, /* * If there is an additional interrupt endpoint on this - * interface we most likley have a multiplexed serial port + * interface then we most likely have a multiplexed serial port * available. */ if (iface->idesc->bNumEndpoints < 3) { @@ -979,7 +979,7 @@ uhso_attach_muxserial(struct uhso_softc /* * Interrupt callback for the multiplexed serial port. Indicates - * which serial port that has data waiting. + * which serial port has data waiting. */ static void uhso_mux_intr_callback(struct usb_xfer *xfer, usb_error_t error) @@ -1531,7 +1531,7 @@ tr_setup: /* * Deferred RX processing, called with mutex locked. * - * Each frame we receive might contain several small ip-packets aswell + * Each frame we receive might contain several small ip-packets as well * as partial ip-packets. We need to separate/assemble them into individual * packets before sending them to the ip-layer. */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 01:16:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77499106568B; Thu, 14 Jan 2010 01:16:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 2F9538FC08; Thu, 14 Jan 2010 01:16:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id E072B7B6F2; Thu, 14 Jan 2010 14:16:48 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 90KAky25Z++Q; Thu, 14 Jan 2010 14:16:44 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 14 Jan 2010 14:16:44 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 15B1511434; Thu, 14 Jan 2010 14:16:44 +1300 (NZDT) Date: Thu, 14 Jan 2010 14:16:43 +1300 From: Andrew Thompson To: Ben Kaduk Message-ID: <20100114011643.GG63408@citylink.fud.org.nz> References: <201001132054.o0DKsI9e021324@svn.freebsd.org> <47d0403c1001131327w61c9ccb9gc8693dc88f7fff13@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47d0403c1001131327w61c9ccb9gc8693dc88f7fff13@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202243 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 01:16:50 -0000 On Wed, Jan 13, 2010 at 04:27:24PM -0500, Ben Kaduk wrote: > Lots of grammar nits. See below. > ... Thanks, commmitted. From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 02:14:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D251065670; Thu, 14 Jan 2010 02:14:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 149C18FC12; Thu, 14 Jan 2010 02:14: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 o0E2ELqi093642; Thu, 14 Jan 2010 02:14:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E2ELDr093639; Thu, 14 Jan 2010 02:14:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001140214.o0E2ELDr093639@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 14 Jan 2010 02:14: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: r202271 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 02:14:22 -0000 Author: marcel Date: Thu Jan 14 02:14:21 2010 New Revision: 202271 URL: http://svn.freebsd.org/changeset/base/202271 Log: Add wrappers for the RT Variable Services. While here, translate the EFI status into a standard errno value and change efi_set_time() to return a standard error. MFC after: 1 week Modified: head/sys/ia64/ia64/efi.c head/sys/ia64/include/efi.h Modified: head/sys/ia64/ia64/efi.c ============================================================================== --- head/sys/ia64/ia64/efi.c Thu Jan 14 01:16:20 2010 (r202270) +++ head/sys/ia64/ia64/efi.c Thu Jan 14 02:14:21 2010 (r202271) @@ -41,6 +41,45 @@ static struct efi_systbl *efi_systbl; static struct efi_cfgtbl *efi_cfgtbl; static struct efi_rt *efi_runtime; +static int efi_status2err[25] = { + 0, /* EFI_SUCCESS */ + ENOEXEC, /* EFI_LOAD_ERROR */ + EINVAL, /* EFI_INVALID_PARAMETER */ + ENOSYS, /* EFI_UNSUPPORTED */ + EMSGSIZE, /* EFI_BAD_BUFFER_SIZE */ + EOVERFLOW, /* EFI_BUFFER_TOO_SMALL */ + EBUSY, /* EFI_NOT_READY */ + EIO, /* EFI_DEVICE_ERROR */ + EROFS, /* EFI_WRITE_PROTECTED */ + EAGAIN, /* EFI_OUT_OF_RESOURCES */ + EIO, /* EFI_VOLUME_CORRUPTED */ + ENOSPC, /* EFI_VOLUME_FULL */ + ENXIO, /* EFI_NO_MEDIA */ + ESTALE, /* EFI_MEDIA_CHANGED */ + ENOENT, /* EFI_NOT_FOUND */ + EACCES, /* EFI_ACCESS_DENIED */ + ETIMEDOUT, /* EFI_NO_RESPONSE */ + EADDRNOTAVAIL, /* EFI_NO_MAPPING */ + ETIMEDOUT, /* EFI_TIMEOUT */ + EDOOFUS, /* EFI_NOT_STARTED */ + EALREADY, /* EFI_ALREADY_STARTED */ + ECANCELED, /* EFI_ABORTED */ + EPROTO, /* EFI_ICMP_ERROR */ + EPROTO, /* EFI_TFTP_ERROR */ + EPROTO /* EFI_PROTOCOL_ERROR */ +}; + +static int +efi_status_to_errno(efi_status status) +{ + u_long code; + int error; + + code = status & 0x3ffffffffffffffful; + error = (code < 25) ? efi_status2err[code] : EDOOFUS; + return (error); +} + void efi_boot_finish(void) { @@ -148,9 +187,38 @@ efi_reset_system(void) panic("%s: unable to reset the machine", __func__); } -efi_status +int efi_set_time(struct efi_tm *tm) { - return (efi_runtime->rt_settime(tm)); + return (efi_status_to_errno(efi_runtime->rt_settime(tm))); +} + +int +efi_var_get(efi_char *name, struct uuid *vendor, uint32_t *attrib, + size_t *datasize, void *data) +{ + efi_status status; + + status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data); + return (efi_status_to_errno(status)); +} + +int +efi_var_nextname(size_t *namesize, efi_char *name, struct uuid *vendor) +{ + efi_status status; + + status = efi_runtime->rt_scanvar(namesize, name, vendor); + return (efi_status_to_errno(status)); +} + +int +efi_var_set(efi_char *name, struct uuid *vendor, uint32_t *attrib, + size_t *datasize, void *data) +{ + efi_status status; + + status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data); + return (efi_status_to_errno(status)); } Modified: head/sys/ia64/include/efi.h ============================================================================== --- head/sys/ia64/include/efi.h Thu Jan 14 01:16:20 2010 (r202270) +++ head/sys/ia64/include/efi.h Thu Jan 14 02:14:21 2010 (r202271) @@ -158,6 +158,9 @@ void efi_get_time(struct efi_tm *); struct efi_md *efi_md_first(void); struct efi_md *efi_md_next(struct efi_md *); void efi_reset_system(void); -efi_status efi_set_time(struct efi_tm *); +int efi_set_time(struct efi_tm *); +int efi_var_get(efi_char *, struct uuid *, uint32_t *, size_t *, void *); +int efi_var_nextname(size_t *, efi_char *, struct uuid *); +int efi_var_set(efi_char *, struct uuid *, uint32_t *, size_t *, void *); #endif /* _MACHINE_EFI_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 02:38:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BAA106568B; Thu, 14 Jan 2010 02:38:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B818FC0A; Thu, 14 Jan 2010 02:38: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 o0E2ckSb099050; Thu, 14 Jan 2010 02:38:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E2ckFi099047; Thu, 14 Jan 2010 02:38:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001140238.o0E2ckFi099047@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 14 Jan 2010 02:38: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: r202272 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 02:38:46 -0000 Author: marcel Date: Thu Jan 14 02:38:46 2010 New Revision: 202272 URL: http://svn.freebsd.org/changeset/base/202272 Log: Fix previous commitr:. efi_var_set() was copied from efi_var_get(), but wasn't actually changed. Modified: head/sys/ia64/ia64/efi.c head/sys/ia64/include/efi.h Modified: head/sys/ia64/ia64/efi.c ============================================================================== --- head/sys/ia64/ia64/efi.c Thu Jan 14 02:14:21 2010 (r202271) +++ head/sys/ia64/ia64/efi.c Thu Jan 14 02:38:46 2010 (r202272) @@ -214,11 +214,11 @@ efi_var_nextname(size_t *namesize, efi_c } int -efi_var_set(efi_char *name, struct uuid *vendor, uint32_t *attrib, - size_t *datasize, void *data) +efi_var_set(efi_char *name, struct uuid *vendor, uint32_t attrib, + size_t datasize, void *data) { efi_status status; - status = efi_runtime->rt_getvar(name, vendor, attrib, datasize, data); + status = efi_runtime->rt_setvar(name, vendor, attrib, datasize, data); return (efi_status_to_errno(status)); } Modified: head/sys/ia64/include/efi.h ============================================================================== --- head/sys/ia64/include/efi.h Thu Jan 14 02:14:21 2010 (r202271) +++ head/sys/ia64/include/efi.h Thu Jan 14 02:38:46 2010 (r202272) @@ -161,6 +161,6 @@ void efi_reset_system(void); int efi_set_time(struct efi_tm *); int efi_var_get(efi_char *, struct uuid *, uint32_t *, size_t *, void *); int efi_var_nextname(size_t *, efi_char *, struct uuid *); -int efi_var_set(efi_char *, struct uuid *, uint32_t *, size_t *, void *); +int efi_var_set(efi_char *, struct uuid *, uint32_t, size_t, void *); #endif /* _MACHINE_EFI_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 02:48:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E092C106566B; Thu, 14 Jan 2010 02:48:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE1208FC08; Thu, 14 Jan 2010 02:48: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 o0E2mdvW001368; Thu, 14 Jan 2010 02:48:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E2mdKe001365; Thu, 14 Jan 2010 02:48:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001140248.o0E2mdKe001365@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 14 Jan 2010 02:48: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: r202273 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 02:48:40 -0000 Author: marcel Date: Thu Jan 14 02:48:39 2010 New Revision: 202273 URL: http://svn.freebsd.org/changeset/base/202273 Log: Add ioctl requests to /dev/io on ia64 for reading and writing EFI variables. The primary reason for this is that it allows sysinstall(8) to add a boot menu item for the newly installed FreeBSD image. Modified: head/sys/ia64/ia64/iodev_machdep.c head/sys/ia64/include/iodev.h Modified: head/sys/ia64/ia64/iodev_machdep.c ============================================================================== --- head/sys/ia64/ia64/iodev_machdep.c Thu Jan 14 02:38:46 2010 (r202272) +++ head/sys/ia64/ia64/iodev_machdep.c Thu Jan 14 02:48:39 2010 (r202273) @@ -31,16 +31,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include static int iodev_pio_read(struct iodev_pio_req *req); static int iodev_pio_write(struct iodev_pio_req *req); +static int iodev_efivar_getvar(struct iodev_efivar_req *req); +static int iodev_efivar_nextname(struct iodev_efivar_req *req); +static int iodev_efivar_setvar(struct iodev_efivar_req *req); + /* ARGSUSED */ int ioopen(struct cdev *dev __unused, int flags __unused, int fmt __unused, @@ -69,6 +75,7 @@ int ioioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int fflag __unused, struct thread *td __unused) { + struct iodev_efivar_req *efivar_req; struct iodev_pio_req *pio_req; int error; @@ -88,6 +95,24 @@ ioioctl(struct cdev *dev __unused, u_lon break; } break; + case IODEV_EFIVAR: + efivar_req = (struct iodev_efivar_req *)data; + efivar_req->result = 0; /* So it's well-defined */ + switch (efivar_req->access) { + case IODEV_EFIVAR_GETVAR: + error = iodev_efivar_getvar(efivar_req); + break; + case IODEV_EFIVAR_NEXTNAME: + error = iodev_efivar_nextname(efivar_req); + break; + case IODEV_EFIVAR_SETVAR: + error = iodev_efivar_setvar(efivar_req); + break; + default: + error = EINVAL; + break; + } + break; } return (error); @@ -158,3 +183,118 @@ iodev_pio_write(struct iodev_pio_req *re return (0); } + +static int +iodev_efivar_getvar(struct iodev_efivar_req *req) +{ + void *data; + efi_char *name; + int error; + + if ((req->namesize & 1) != 0 || req->namesize < 4) + return (EINVAL); + if (req->datasize == 0) + return (EINVAL); + + /* + * Pre-zero the allocated memory and don't copy the last 2 bytes + * of the name. That should be the closing nul character (ucs-2) + * and if not, then we ensured a nul-terminating string. This is + * to protect the firmware and thus ourselves. + */ + name = malloc(req->namesize, M_TEMP, M_WAITOK | M_ZERO); + error = copyin(req->name, name, req->namesize - 2); + if (error) { + free(name, M_TEMP); + return (error); + } + + data = malloc(req->datasize, M_TEMP, M_WAITOK); + error = efi_var_get(name, &req->vendor, &req->attrib, &req->datasize, + data); + if (error == EOVERFLOW || error == ENOENT) { + req->result = error; + error = 0; + } + if (!error && !req->result) + error = copyout(data, req->data, req->datasize); + + free(data, M_TEMP); + free(name, M_TEMP); + return (error); +} + +static int +iodev_efivar_nextname(struct iodev_efivar_req *req) +{ + efi_char *name; + int error; + + /* Enforce a reasonable minimum size of the name buffer. */ + if (req->namesize < 4) + return (EINVAL); + + name = malloc(req->namesize, M_TEMP, M_WAITOK); + error = copyin(req->name, name, req->namesize); + if (error) { + free(name, M_TEMP); + return (error); + } + + error = efi_var_nextname(&req->namesize, name, &req->vendor); + if (error == EOVERFLOW || error == ENOENT) { + req->result = error; + error = 0; + } + if (!error && !req->result) + error = copyout(name, req->name, req->namesize); + + free(name, M_TEMP); + return (error); +} + +static int +iodev_efivar_setvar(struct iodev_efivar_req *req) +{ + void *data; + efi_char *name; + int error; + + if ((req->namesize & 1) != 0 || req->namesize < 4) + return (EINVAL); + + /* + * Pre-zero the allocated memory and don't copy the last 2 bytes + * of the name. That should be the closing nul character (ucs-2) + * and if not, then we ensured a nul-terminating string. This is + * to protect the firmware and thus ourselves. + */ + name = malloc(req->namesize, M_TEMP, M_WAITOK | M_ZERO); + error = copyin(req->name, name, req->namesize - 2); + if (error) { + free(name, M_TEMP); + return (error); + } + + if (req->datasize) { + data = malloc(req->datasize, M_TEMP, M_WAITOK); + error = copyin(req->data, data, req->datasize); + if (error) { + free(data, M_TEMP); + free(name, M_TEMP); + return (error); + } + } else + data = NULL; + + error = efi_var_set(name, &req->vendor, req->attrib, req->datasize, + data); + if (error == EAGAIN || error == ENOENT) { + req->result = error; + error = 0; + } + + free(data, M_TEMP); + free(name, M_TEMP); + return (error); +} Modified: head/sys/ia64/include/iodev.h ============================================================================== --- head/sys/ia64/include/iodev.h Thu Jan 14 02:38:46 2010 (r202272) +++ head/sys/ia64/include/iodev.h Thu Jan 14 02:48:39 2010 (r202273) @@ -29,6 +29,8 @@ #ifndef _MACHINE_IODEV_H_ #define _MACHINE_IODEV_H_ +#include + struct iodev_pio_req { u_int access; #define IODEV_PIO_READ 0 @@ -40,6 +42,22 @@ struct iodev_pio_req { #define IODEV_PIO _IOWR('I', 0, struct iodev_pio_req) +struct iodev_efivar_req { + u_int access; +#define IODEV_EFIVAR_GETVAR 0 +#define IODEV_EFIVAR_NEXTNAME 1 +#define IODEV_EFIVAR_SETVAR 2 + u_int result; /* errno value */ + size_t namesize; + u_short *name; /* UCS-2 */ + struct uuid vendor; + uint32_t attrib; + size_t datasize; + void *data; +}; + +#define IODEV_EFIVAR _IOWR('I', 1, struct iodev_efivar_req) + #ifdef _KERNEL d_open_t ioopen; From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 05:35:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A42106566B; Thu, 14 Jan 2010 05:35:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37108FC15; Thu, 14 Jan 2010 05:35: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 o0E5ZWlN038020; Thu, 14 Jan 2010 05:35:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E5ZWCx038013; Thu, 14 Jan 2010 05:35:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001140535.o0E5ZWCx038013@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 05:35:32 +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: r202274 - in head: . include lib/libc/gen libexec/getty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 05:35:32 -0000 Author: ed Date: Thu Jan 14 05:35:32 2010 New Revision: 202274 URL: http://svn.freebsd.org/changeset/base/202274 Log: Phase out ttyslot(3). The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots. Modified: head/ObsoleteFiles.inc head/include/unistd.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/ttyname.3 head/lib/libc/gen/ttyslot.c head/libexec/getty/ttys.5 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jan 14 02:48:39 2010 (r202273) +++ head/ObsoleteFiles.inc Thu Jan 14 05:35:32 2010 (r202274) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100114: removal of ttyslot(3) +OLD_FILES+=usr/share/man/man3/ttyslot.3.gz # 20100113: remove utmp.h, replace it by utmpx.h OLD_FILES+=usr/share/man/man3/login.3.gz OLD_FILES+=usr/share/man/man3/logout.3.gz Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Thu Jan 14 02:48:39 2010 (r202273) +++ head/include/unistd.h Thu Jan 14 05:35:32 2010 (r202274) @@ -574,7 +574,6 @@ int swapon(const char *); int swapoff(const char *); int syscall(int, ...); off_t __syscall(quad_t, ...); -int ttyslot(void); int undelete(const char *); int unwhiteout(const char *); void *valloc(size_t); /* obsoleted by malloc() */ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Jan 14 02:48:39 2010 (r202273) +++ head/lib/libc/gen/Symbol.map Thu Jan 14 05:35:32 2010 (r202274) @@ -272,7 +272,6 @@ FBSD_1.0 { openlog; closelog; setlogmask; - ttyslot; ttyname_r; ttyname; timezone; Modified: head/lib/libc/gen/ttyname.3 ============================================================================== --- head/lib/libc/gen/ttyname.3 Thu Jan 14 02:48:39 2010 (r202273) +++ head/lib/libc/gen/ttyname.3 Thu Jan 14 05:35:32 2010 (r202274) @@ -34,8 +34,7 @@ .Sh NAME .Nm ttyname , .Nm ttyname_r , -.Nm isatty , -.Nm ttyslot +.Nm isatty .Nd get name of associated terminal (tty) from file descriptor .Sh LIBRARY .Lb libc @@ -47,8 +46,6 @@ .Fn ttyname_r "int fd" "char *buf" "size_t len" .Ft int .Fn isatty "int fd" -.Ft int -.Fn ttyslot void .Sh DESCRIPTION These functions operate on the system file descriptors for terminal type devices. @@ -89,13 +86,6 @@ The .Fn ttyname_r function takes a buffer and length as arguments to avoid this problem. -.Pp -The -.Fn ttyslot -function -fetches the current process' control terminal number from the -.Xr ttys 5 -file entry. .Sh RETURN VALUES The .Fn ttyname @@ -110,12 +100,6 @@ The .Fn ttyname_r function returns 0 if successful. Otherwise an error number is returned. -.Pp -The -.Fn ttyslot -function -returns the unit number of the device file if found; otherwise -the value zero is returned. .Sh FILES .Bl -tag -width ".Pa /etc/ttys" -compact .It Pa /dev/\(** @@ -142,10 +126,9 @@ is smaller than the length of the string .Xr ttys 5 .Sh HISTORY The -.Fn isatty , -.Fn ttyname , +.Fn isatty and -.Fn ttyslot +.Fn ttyname functions appeared in .At v7 . Modified: head/lib/libc/gen/ttyslot.c ============================================================================== --- head/lib/libc/gen/ttyslot.c Thu Jan 14 02:48:39 2010 (r202273) +++ head/lib/libc/gen/ttyslot.c Thu Jan 14 05:35:32 2010 (r202274) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include int -ttyslot() +__ttyslot(void) { struct ttyent *ttyp; int slot; @@ -63,3 +63,5 @@ ttyslot() endttyent(); return(0); } + +__sym_compat(ttyslot, __ttyslot, FBSD_1.0); Modified: head/libexec/getty/ttys.5 ============================================================================== --- head/libexec/getty/ttys.5 Thu Jan 14 02:48:39 2010 (r202273) +++ head/libexec/getty/ttys.5 Thu Jan 14 05:35:32 2010 (r202274) @@ -158,7 +158,6 @@ ttyp1 none network off group=pty .Sh SEE ALSO .Xr login 1 , .Xr getttyent 3 , -.Xr ttyslot 3 , .Xr gettytab 5 , .Xr login.conf 5 , .Xr termcap 5 , From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 05:37:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A692106566B; Thu, 14 Jan 2010 05:37:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5947C8FC12; Thu, 14 Jan 2010 05:37: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 o0E5bhaX038521; Thu, 14 Jan 2010 05:37:43 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E5bhdj038518; Thu, 14 Jan 2010 05:37:43 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001140537.o0E5bhdj038518@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 05:37:43 +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: r202275 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 05:37:43 -0000 Author: ed Date: Thu Jan 14 05:37:43 2010 New Revision: 202275 URL: http://svn.freebsd.org/changeset/base/202275 Log: Add two changes that should have gone into commit r202274. Phase out ttyslot(3). The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots. Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/getttyent.3 Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Jan 14 05:35:32 2010 (r202274) +++ head/lib/libc/gen/Makefile.inc Thu Jan 14 05:37:43 2010 (r202275) @@ -177,7 +177,7 @@ MLINKS+=tcsetattr.3 cfgetispeed.3 tcseta tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfsetispeed.3 \ tcsetattr.3 cfsetospeed.3 tcsetattr.3 cfsetspeed.3 \ tcsetattr.3 tcgetattr.3 -MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3 ttyname.3 ttyslot.3 +MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyname_r.3 MLINKS+=tzset.3 tzsetwall.3 MLINKS+=unvis.3 strunvis.3 unvis.3 strunvisx.3 MLINKS+=vis.3 strvis.3 vis.3 strvisx.3 Modified: head/lib/libc/gen/getttyent.3 ============================================================================== --- head/lib/libc/gen/getttyent.3 Thu Jan 14 05:35:32 2010 (r202274) +++ head/lib/libc/gen/getttyent.3 Thu Jan 14 05:37:43 2010 (r202275) @@ -188,7 +188,6 @@ zero otherwise. .El .Sh SEE ALSO .Xr login 1 , -.Xr ttyslot 3 , .Xr gettytab 5 , .Xr termcap 5 , .Xr ttys 5 , From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 07:32:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10C1106568B; Thu, 14 Jan 2010 07:32:24 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id E6BF68FC15; Thu, 14 Jan 2010 07:32:22 +0000 (UTC) Received: by fxm27 with SMTP id 27so525861fxm.3 for ; Wed, 13 Jan 2010 23:32:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=K6iODhB5ZuLwETp20LHwGnw35ZM9QS3R91jRnUXXmgk=; b=epsBugqNL+Sk/ijC7DGSa1gfKv0mPv/AdBkFrzd17zOtsgtisyNOp47125Niuxj0vY 4p8yLGx6/f/4X6d6c7vzacGe1rh38pU/n0drpp5gma9TIR2Bif/18pFZ68OHyPwh1TsC LeiKECV+8FqveyzoZjjhe+F8ZRBxWl+DmC1CY= 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=ipfNN8OV8QVuShDA+a43UeYkAPRUmKyvpeU0V50GUEn70JsAHR2sQCQIJc2S0FUB7i jJFXm7RvUI03uzfEDABfEssGKbWKs6WYsogij2vPlOYIe6EFZONkYD4q9/aKR3yQu9cg y/EVA7wx4d2cqWzOYIYe/nDi3qPHucHWFsdIw= Received: by 10.223.76.65 with SMTP id b1mr450497fak.5.1263452935066; Wed, 13 Jan 2010 23:08:55 -0800 (PST) Received: from mbp-gige.totalterror.net (93-152-151-19.ddns.onlinedirect.bg [93.152.151.19]) by mx.google.com with ESMTPS id 18sm457098fks.4.2010.01.13.23.08.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Jan 2010 23:08:53 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: <20100113.150435.650865766805848595.imp@bsdimp.com> Date: Thu, 14 Jan 2010 09:08:48 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201001131515.08602.jhb@freebsd.org> <4B4E2ECA.90905@FreeBSD.org> <201001131633.09669.jhb@freebsd.org> <20100113.150435.650865766805848595.imp@bsdimp.com> To: M. Warner Losh X-Mailer: Apple Mail (2.1077) Cc: dougb@freebsd.org, jhb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org, svn-src-head@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 07:32:25 -0000 On 14 Jan, 2010, at 24:04 , M. Warner Losh wrote: > In message: <201001131633.09669.jhb@freebsd.org> > John Baldwin writes: > : On Wednesday 13 January 2010 3:36:26 pm Doug Barton wrote: > : > On 1/13/2010 12:15 PM, John Baldwin wrote: > : > > On Wednesday 13 January 2010 1:48:38 pm Doug Barton wrote: > : > >> To address the other responses, Tom, sorry, your suggested text = doesn't > : > >> address my concern. John, I don't think that users would = somehow > : > >> magically know to look in NOTES for more information about an = option > : > >> that is already in GENERIC. > : > >=20 > : > > You really think users do not already know to look in manpages = or NOTES to=20 > : > > find out more details about kernel options?=20 > : >=20 > : > That's not what I said. > :=20 > : > : I don't think that users would [..] know to look in NOTES for more = information=20 > : about an option that is [...] in GENERIC. > : > :=20 > : That seems really straight forward to me, or my English isn't good. = I do=20 > : think users "would know to look in NOTES for more information about = an option=20 > : that is in GENERIC". >=20 > Agreed. That's why I did what I did: I conformed to the usual = practice. >=20 > : > > Put=20 > : > > another way, what makes 'INCLUDE_CONFIG_FILE' sufficiently = special that it=20 > : > > deserves special treatment relative to other kernel options? > : >=20 > : > Because the default behavior (not including the actual file) for = the > : > option is contrary to user' reasonable expectation of how the = option > : > should work .... and now I'm repeating myself. > :=20 > : I think a better change would be to just change the default behavior = of=20 > : config(8) to do the reasonable thing. >=20 > -C should be the default, and we should invent a new > '--smaller-saved-config' option. >=20 > : > Seriously, don't you have anything better to do than argue against > : > including a comment in a config file? I know I do. What is the > : > overwhelming horror that will arise here if there are more = comments > : > GENERIC than you deem to be absolutely necessary? > :=20 > : What is the overwhelming horror about keeping a file readable and = allowing=20 > : users to find extended documentation for INCLUDE_CONFIG_FILE in the = same place=20 > : that they find extended documentation about every other kernel = option? >=20 > Yes. That's why I did what I did: to keep things readable. >=20 > : > And yes, I read the part of your message that I snipped about "why = do we > : > have these documents if users don't read them?" The answer is, = that's > : > why I'm suggesting a comment that tells users what man page to = read. > :=20 > : I think adding comments that merely redirect the users to further=20 > : documentation only serves to obfuscate. Left unchecked this = approach will=20 > : render files such as GENERIC with a very low signal-to-noise ratio = making it=20 > : harder to parse in a "big picture" way. >=20 > Yes. >=20 > Basically, I'm annoyed too: Our users aren't idiots, and we shouldn't > be treating them as such at every turn. If there are surprises with > how INCLUDE_CONFIG_FILE behaves, we should work to make it better, not > paper over it with a comment. >=20 > Warner Hello, I just want to add a user's point of view : To me INCLUDE_CONFIG_FILE sounds like the whole config file will be included, not just the output after preprocessing. So I was thinking about something like two different options, one "INCLUDE_CONFIG_FILE" which includes the whole file with comments, and the other to be just "INCLUDE_CONFIG". I think these would be pretty self-explanatory. Yes, it adds another kernel option, but having options to kernel options looks even more cryptic :) -- Regards, Niki= From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 08:08:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 469E8106566C; Thu, 14 Jan 2010 08:08:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364A98FC18; Thu, 14 Jan 2010 08:08: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 o0E88uxx071561; Thu, 14 Jan 2010 08:08:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E88uwq071559; Thu, 14 Jan 2010 08:08:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001140808.o0E88uwq071559@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 08:08: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: r202277 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 08:08:56 -0000 Author: ed Date: Thu Jan 14 08:08:55 2010 New Revision: 202277 URL: http://svn.freebsd.org/changeset/base/202277 Log: Don't use fseeko() to obtain the file offset. I was a bit confused with lseek(), which returns the new offset. We should ftello() to obtain it using stdio. Modified: head/lib/libc/gen/pututxline.c Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Thu Jan 14 07:13:06 2010 (r202276) +++ head/lib/libc/gen/pututxline.c Thu Jan 14 08:08:55 2010 (r202277) @@ -96,7 +96,7 @@ utx_active_add(const struct futx *fu) default: /* Allow us to overwrite unused records. */ if (partial == -1) - partial = fseeko(fp, 0, SEEK_CUR) - sizeof fe; + partial = ftello(fp) - sizeof fe; break; } } From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 09:30:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57F62106566C; Thu, 14 Jan 2010 09:30:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id D47D78FC0A; Thu, 14 Jan 2010 09:30:52 +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 o0E9UiIe076125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jan 2010 11:30:44 +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.3/8.14.3) with ESMTP id o0E9UiRu093535; Thu, 14 Jan 2010 11:30:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o0E9UiwF093534; Thu, 14 Jan 2010 11:30:44 +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: Thu, 14 Jan 2010 11:30:44 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20100114093044.GW62907@deviant.kiev.zoral.com.ua> References: <201001140535.o0E5ZWCx038013@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E75mJrUy8lRi9cGN" Content-Disposition: inline In-Reply-To: <201001140535.o0E5ZWCx038013@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202274 - in head: . include lib/libc/gen libexec/getty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 09:30:53 -0000 --E75mJrUy8lRi9cGN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 14, 2010 at 05:35:32AM +0000, Ed Schouten wrote: > Author: ed > Date: Thu Jan 14 05:35:32 2010 > New Revision: 202274 > URL: http://svn.freebsd.org/changeset/base/202274 >=20 > Log: > Phase out ttyslot(3). > =20 > The ttyslot() function was originally part for SUSv1, marked LEGACY in > SUSv2 and removed later on. This function only makes sense when using > utmp(5), because it was used to determine the offset of the record for > the controlling TTY. It makes little sense to keep it here, because the > new utmpx file format doesn't index based on TTY slots. >=20 > Modified: > head/ObsoleteFiles.inc > head/include/unistd.h > head/lib/libc/gen/Symbol.map > head/lib/libc/gen/ttyname.3 > head/lib/libc/gen/ttyslot.c > head/libexec/getty/ttys.5 >=20 > Modified: head/ObsoleteFiles.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ObsoleteFiles.inc Thu Jan 14 02:48:39 2010 (r202273) > +++ head/ObsoleteFiles.inc Thu Jan 14 05:35:32 2010 (r202274) > @@ -14,6 +14,8 @@ > # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS l= ast. > # > =20 > +# 20100114: removal of ttyslot(3) > +OLD_FILES+=3Dusr/share/man/man3/ttyslot.3.gz > # 20100113: remove utmp.h, replace it by utmpx.h > OLD_FILES+=3Dusr/share/man/man3/login.3.gz > OLD_FILES+=3Dusr/share/man/man3/logout.3.gz >=20 > Modified: head/include/unistd.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/include/unistd.h Thu Jan 14 02:48:39 2010 (r202273) > +++ head/include/unistd.h Thu Jan 14 05:35:32 2010 (r202274) > @@ -574,7 +574,6 @@ int swapon(const char *); > int swapoff(const char *); > int syscall(int, ...); > off_t __syscall(quad_t, ...); > -int ttyslot(void); > int undelete(const char *); > int unwhiteout(const char *); > void *valloc(size_t); /* obsoleted by malloc() */ >=20 > Modified: head/lib/libc/gen/Symbol.map > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/gen/Symbol.map Thu Jan 14 02:48:39 2010 (r202273) > +++ head/lib/libc/gen/Symbol.map Thu Jan 14 05:35:32 2010 (r202274) > @@ -272,7 +272,6 @@ FBSD_1.0 { > openlog; > closelog; > setlogmask; > - ttyslot; > ttyname_r; > ttyname; > timezone; You should never remove symbol from the version map for shared library. Doing that removes one of the reason for having symbol versioning at all (namely, pre-execution check that version requirements of the objects are satisfied). FreeBSD allows version maps to grow, that makes the check weaker then it ought to be. --E75mJrUy8lRi9cGN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktO5EQACgkQC3+MBN1Mb4hs5QCgzfDRqSb/+IWbD9dx2fsGmIuv 6SwAn2AV12ANI/URRiMhxlrE5XO1cfqh =1qS3 -----END PGP SIGNATURE----- --E75mJrUy8lRi9cGN-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 09:38:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9AFA106566B; Thu, 14 Jan 2010 09:38:03 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9C28FC13; Thu, 14 Jan 2010 09:38:03 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 854DB1CD96; Thu, 14 Jan 2010 10:38:02 +0100 (CET) Date: Thu, 14 Jan 2010 10:38:02 +0100 From: Ed Schouten To: Kostik Belousov Message-ID: <20100114093802.GZ64905@hoeg.nl> References: <201001140535.o0E5ZWCx038013@svn.freebsd.org> <20100114093044.GW62907@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d/uAuzW7m3hkRWVd" Content-Disposition: inline In-Reply-To: <20100114093044.GW62907@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202274 - in head: . include lib/libc/gen libexec/getty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 09:38:04 -0000 --d/uAuzW7m3hkRWVd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Kostik Belousov wrote: > You should never remove symbol from the version map for shared library. > Doing that removes one of the reason for having symbol versioning at all > (namely, pre-execution check that version requirements of the objects > are satisfied). FreeBSD allows version maps to grow, that makes the > check weaker then it ought to be. Ah, I see. I discussed this with kan@ the other day and I was under the impression that using __sym_compat() would be sufficient. So you say I should leave the __sym_compat(), but revert the change to the Symbol.map? Would that still allow me to use the symbol, but prevent linkage against it? --=20 Ed Schouten WWW: http://80386.nl/ --d/uAuzW7m3hkRWVd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktO5foACgkQ52SDGA2eCwXZEwCeKtHcXxfCN5hwmkBUn8K6h98A EsAAnRk/lc+0+hHZE3T6gTD6n6Ji7X0F =MjlP -----END PGP SIGNATURE----- --d/uAuzW7m3hkRWVd-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 09:38:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31C341065670; Thu, 14 Jan 2010 09:38:24 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 215AE8FC18; Thu, 14 Jan 2010 09:38: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 o0E9cOrM091131; Thu, 14 Jan 2010 09:38:24 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0E9cO4e091129; Thu, 14 Jan 2010 09:38:24 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <201001140938.o0E9cO4e091129@svn.freebsd.org> From: Peter Pentchev Date: Thu, 14 Jan 2010 09:38: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: r202278 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 09:38:24 -0000 Author: roam (doc,ports committer) Date: Thu Jan 14 09:38:23 2010 New Revision: 202278 URL: http://svn.freebsd.org/changeset/base/202278 Log: Document that the IEEE80211_DEBUG kernel option is needed for using the wlan(4) debugging controls with wording slightly different from that in the PR. PR: 142367 Submitted by: Matthew Thyer MFC after: 2 weeks Modified: head/share/man/man4/wlan.4 Modified: head/share/man/man4/wlan.4 ============================================================================== --- head/share/man/man4/wlan.4 Thu Jan 14 08:08:55 2010 (r202277) +++ head/share/man/man4/wlan.4 Thu Jan 14 09:38:23 2010 (r202278) @@ -130,7 +130,10 @@ Similarly there is an authenticator fram authentication services and a framework for integrating access control mechanisms specific to the 802.11 protocol. .Sh DEBUGGING -Debugging controls are available using: +If the +.Dv IEEE80211_DEBUG +option is included in the kernel configuration, +debugging controls are available using: .Pp .Dl "sysctl net.wlan.X.debug=mask" .Pp From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 09:50:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B0D31065696; Thu, 14 Jan 2010 09:50:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id DCDCE8FC0C; Thu, 14 Jan 2010 09:50:36 +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 o0E9oVYY078145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jan 2010 11:50:31 +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.3/8.14.3) with ESMTP id o0E9oUEt093648; Thu, 14 Jan 2010 11:50:30 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id o0E9oUCA093647; Thu, 14 Jan 2010 11:50:30 +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: Thu, 14 Jan 2010 11:50:30 +0200 From: Kostik Belousov To: Ed Schouten Message-ID: <20100114095030.GX62907@deviant.kiev.zoral.com.ua> References: <201001140535.o0E5ZWCx038013@svn.freebsd.org> <20100114093044.GW62907@deviant.kiev.zoral.com.ua> <20100114093802.GZ64905@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wfgmFf0LjPE7xkRl" Content-Disposition: inline In-Reply-To: <20100114093802.GZ64905@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202274 - in head: . include lib/libc/gen libexec/getty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 09:50:37 -0000 --wfgmFf0LjPE7xkRl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 14, 2010 at 10:38:02AM +0100, Ed Schouten wrote: > * Kostik Belousov wrote: > > You should never remove symbol from the version map for shared library. > > Doing that removes one of the reason for having symbol versioning at all > > (namely, pre-execution check that version requirements of the objects > > are satisfied). FreeBSD allows version maps to grow, that makes the > > check weaker then it ought to be. >=20 > Ah, I see. I discussed this with kan@ the other day and I was under the > impression that using __sym_compat() would be sufficient. So you say I > should leave the __sym_compat(), but revert the change to the > Symbol.map? Would that still allow me to use the symbol, but prevent > linkage against it? It should. You can recheck it with readelf/objdump. Symbol shall be exported only with FBSD_1.0 version, and have no default version. --wfgmFf0LjPE7xkRl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktO6OYACgkQC3+MBN1Mb4gvlQCgmPYomvYEN60bDJgRP8kbzD1S LUsAoNbdH0tYdqEjx/vZOBqp2iQeSo3a =ExXY -----END PGP SIGNATURE----- --wfgmFf0LjPE7xkRl-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 09:54:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7A021065670; Thu, 14 Jan 2010 09:54:44 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id ACDF58FC08; Thu, 14 Jan 2010 09:54:44 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 1FC881CCD8; Thu, 14 Jan 2010 10:54:44 +0100 (CET) Date: Thu, 14 Jan 2010 10:54:44 +0100 From: Ed Schouten To: Kostik Belousov Message-ID: <20100114095444.GA64905@hoeg.nl> References: <201001140535.o0E5ZWCx038013@svn.freebsd.org> <20100114093044.GW62907@deviant.kiev.zoral.com.ua> <20100114093802.GZ64905@hoeg.nl> <20100114095030.GX62907@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jBzvIQRTJnWuYzSb" Content-Disposition: inline In-Reply-To: <20100114095030.GX62907@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202274 - in head: . include lib/libc/gen libexec/getty X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 09:54:45 -0000 --jBzvIQRTJnWuYzSb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Kostik, * Kostik Belousov wrote: > It should. You can recheck it with readelf/objdump. Symbol shall be expor= ted > only with FBSD_1.0 version, and have no default version. I see. I will give it a try and commit a fix this afternoon. Thanks for the clarification! --=20 Ed Schouten WWW: http://80386.nl/ --jBzvIQRTJnWuYzSb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktO6eQACgkQ52SDGA2eCwWlggCfYEnOwVgJm8ew2Z7MnGotOyuS bNAAn2I95+P/PhBH3QfqbJK+BfXmFwJS =Drov -----END PGP SIGNATURE----- --jBzvIQRTJnWuYzSb-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 10:00:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AEF4106566C; Thu, 14 Jan 2010 10:00:01 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 569258FC13; Thu, 14 Jan 2010 10:00: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 o0EA01ST095912; Thu, 14 Jan 2010 10:00:01 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EA0182095910; Thu, 14 Jan 2010 10:00:01 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001141000.o0EA0182095910@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 10:00:01 +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: r202279 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 10:00:01 -0000 Author: ed Date: Thu Jan 14 10:00:01 2010 New Revision: 202279 URL: http://svn.freebsd.org/changeset/base/202279 Log: Revert the change to Symbol.map, made in r202274. Even though we use __sym_compat(), we should list the symbol in Symbol.map. ttyslot() is now listed as follows, which seems to do the right thing: | Symbol table '.dynsym' contains 2755 entries: | Num: Value Size Type Bind Vis Ndx Name | 613: 00000000000477b0 121 FUNC GLOBAL DEFAULT 10 ttyslot@FBSD_1.0 Reported by: kib Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Jan 14 09:38:23 2010 (r202278) +++ head/lib/libc/gen/Symbol.map Thu Jan 14 10:00:01 2010 (r202279) @@ -272,6 +272,7 @@ FBSD_1.0 { openlog; closelog; setlogmask; + ttyslot; ttyname_r; ttyname; timezone; From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 10:40:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622DB106568F; Thu, 14 Jan 2010 10:40: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 37FFA8FC1C; Thu, 14 Jan 2010 10:40: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 o0EAetFD007149; Thu, 14 Jan 2010 10:40:55 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EAetxU007146; Thu, 14 Jan 2010 10:40:55 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201001141040.o0EAetxU007146@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Jan 2010 10:40: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: r202280 - head/usr.bin/whois X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 10:40:55 -0000 Author: edwin Date: Thu Jan 14 10:40:54 2010 New Revision: 202280 URL: http://svn.freebsd.org/changeset/base/202280 Log: Remove -d option, whois.nic.mil doesn't exist anymore. PR: bin/142507 Submitted by: Dan Mahoney MFC after: 1 week Modified: head/usr.bin/whois/whois.1 head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Thu Jan 14 10:00:01 2010 (r202279) +++ head/usr.bin/whois/whois.1 Thu Jan 14 10:40:54 2010 (r202280) @@ -40,7 +40,7 @@ .Nd "Internet domain name and network number directory service" .Sh SYNOPSIS .Nm -.Op Fl aAbdfgiIklmQrR +.Op Fl aAbfgiIklmQrR .Op Fl c Ar country-code | Fl h Ar host .Op Fl p Ar port .Ar name ... @@ -82,11 +82,6 @@ This is the equivalent of using the .Fl h option with an argument of .Qq Ar country-code Ns Li .whois-servers.net . -.It Fl d -Use the US Department of Defense -database. -It contains points of contact for subdomains of -.Pa .MIL . .It Fl f Use the African Network Information Centre .Pq Tn AfriNIC Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Thu Jan 14 10:00:01 2010 (r202279) +++ head/usr.bin/whois/whois.c Thu Jan 14 10:40:54 2010 (r202280) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #define ABUSEHOST "whois.abuse.net" #define NICHOST "whois.crsnic.net" #define INICHOST "whois.networksolutions.com" -#define DNICHOST "whois.nic.mil" #define GNICHOST "whois.nic.gov" #define ANICHOST "whois.arin.net" #define LNICHOST "whois.lacnic.net" @@ -109,7 +108,7 @@ main(int argc, char *argv[]) country = host = qnichost = NULL; flags = use_qnichost = 0; - while ((ch = getopt(argc, argv, "aAbc:dfgh:iIklmp:QrR6")) != -1) { + while ((ch = getopt(argc, argv, "aAbc:fgh:iIklmp:QrR6")) != -1) { switch (ch) { case 'a': host = ANICHOST; @@ -123,9 +122,6 @@ main(int argc, char *argv[]) case 'c': country = optarg; break; - case 'd': - host = DNICHOST; - break; case 'f': host = FNICHOST; break; @@ -364,7 +360,7 @@ static void usage(void) { fprintf(stderr, - "usage: whois [-aAbdfgiIklmQrR6] [-c country-code | -h hostname] " + "usage: whois [-aAbfgiIklmQrR6] [-c country-code | -h hostname] " "[-p port] name ...\n"); exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 10:56:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2501106566C; Thu, 14 Jan 2010 10:56:54 +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 C17A48FC13; Thu, 14 Jan 2010 10:56: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 o0EAus1J010814; Thu, 14 Jan 2010 10:56:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EAusZL010812; Thu, 14 Jan 2010 10:56:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201001141056.o0EAusZL010812@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Jan 2010 10:56: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: r202281 - head/usr.bin/whois X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 10:56:54 -0000 Author: edwin Date: Thu Jan 14 10:56:54 2010 New Revision: 202281 URL: http://svn.freebsd.org/changeset/base/202281 Log: Make whois capable of searching for IPv6 addresses just like it can do for IPv4 addresses without having to explicetly specify that the ARIN server should be used to get the initial information PR: bin/128725 Submitted by: "Matt D. Harris" MFC after: 1 week Modified: head/usr.bin/whois/whois.c Modified: head/usr.bin/whois/whois.c ============================================================================== --- head/usr.bin/whois/whois.c Thu Jan 14 10:40:54 2010 (r202280) +++ head/usr.bin/whois/whois.c Thu Jan 14 10:56:54 2010 (r202281) @@ -215,6 +215,10 @@ choose_server(char *domain) { char *pos, *retval; + if (strchr(domain, ':')) { + s_asprintf(&retval, "%s", ANICHOST); + return (retval); + } for (pos = strchr(domain, '\0'); pos > domain && *--pos == '.';) *pos = '\0'; if (*domain == '\0') From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 11:03:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F3801065695; Thu, 14 Jan 2010 11:03:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF668FC27; Thu, 14 Jan 2010 11:03: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 o0EB3QWG012344; Thu, 14 Jan 2010 11:03:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EB3QYS012342; Thu, 14 Jan 2010 11:03:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001141103.o0EB3QYS012342@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 11:03: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: r202282 - head/usr.bin/chpass X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 11:03:26 -0000 Author: ed Date: Thu Jan 14 11:03:26 2010 New Revision: 202282 URL: http://svn.freebsd.org/changeset/base/202282 Log: The group field is called `gid', not `group'. Modified: head/usr.bin/chpass/chpass.1 Modified: head/usr.bin/chpass/chpass.1 ============================================================================== --- head/usr.bin/chpass/chpass.1 Thu Jan 14 10:56:54 2010 (r202281) +++ head/usr.bin/chpass/chpass.1 Thu Jan 14 11:03:26 2010 (r202282) @@ -168,7 +168,7 @@ that manipulate these files will often r entries, and that one by random selection. .Pp The -.Ar group +.Ar gid field is the group that the user will be placed in at login. Since .Bx From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 11:07:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A54E106566B; Thu, 14 Jan 2010 11:07:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 7B04A8FC12; Thu, 14 Jan 2010 11:07:17 +0000 (UTC) Received: from c122-106-161-214.carlnfd1.nsw.optusnet.com.au (c122-106-161-214.carlnfd1.nsw.optusnet.com.au [122.106.161.214]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0EB7BmW021064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jan 2010 22:07:14 +1100 Date: Thu, 14 Jan 2010 22:07:11 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andrey Chernov In-Reply-To: <20100111121938.GA57442@nagual.pp.ru> Message-ID: <20100114212822.R62635@delplex.bde.org> References: <201001101430.o0AEUURS051917@svn.freebsd.org> <20100110212548.GA47331@nagual.pp.ru> <4B4A5252.9070205@freebsd.org> <20100111134429.F1302@besplex.bde.org> <20100111121938.GA57442@nagual.pp.ru> 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, Colin Percival , Bruce Evans Subject: Re: svn commit: r201999 - head/lib/libc/stdio X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 11:07:19 -0000 On Mon, 11 Jan 2010, Andrey Chernov wrote: > On Mon, Jan 11, 2010 at 02:29:03PM +1100, Bruce Evans wrote: >>>> 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. >> >> There are none. I (we?) intentionally didn't set errno when the correct > > F.e. see fseek()/fseeko() stdio checks, as POSIX says: > > [EOVERFLOW] For fseek(), the resulting file offset would be a value which > cannot be represented correctly in an object of type long. > [EOVERFLOW] For fseeko(), the resulting file offset would be a value > which cannot be represented correctly in an object of type off_t. I meant only the i/o functions. Also, vswprintf() returns -1/EOVERFLOW if the buffer is too small, but I don't count it since: - this behaviour is not possible in C99 (no EOVERFLOW, only a negative return value) - this behaviour is not documented in FreeBSD's man page - only th wide char [v]sprintf does this. > Moreover, POSIX tends to introduce EOVERFLOW now in many places like > old system calls too, see read()/pread(): > > [EOVERFLOW] The file is a regular file, nbyte is greater than 0, the > starting position is before the end-of-file, and the starting position is > greater than or equal to the offset maximum established in the open file > description associated with fildes. > > (IEEE P1003.1 Draft 5.1 Issue 7 quoted in both cases) I know, since you fixed this in part of FreeBSD, and I cleaned up the fixes :-). This reminds me that the fixes are incomplete, with most file systems except ffs being unmaintained even if they were cloned from ffs. In /sys/fs only the following file systems reference EOVERFLOW: smbfs (!?), nfs. Many file systems there have a maxfilesize (variable) limit and many others have a compile-time limit. Similarly for /sys/gnu/fs except things are harder to find there. Just noticed a related delicate bug: For write(), the corresponding (and much older) error is EFBIG. POSIX says that it occurs when there is no space to write any bytes, but ffs_write() gives it when there is no space to write all the bytes. Since most programs don't understand short writes, the FreeBSD behaviour is safer. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 11:47:34 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98329106566C; Thu, 14 Jan 2010 11:47:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id 0D0788FC0C; Thu, 14 Jan 2010 11:47:33 +0000 (UTC) Received: from c122-106-161-214.carlnfd1.nsw.optusnet.com.au (c122-106-161-214.carlnfd1.nsw.optusnet.com.au [122.106.161.214]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0EBlP0U001407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jan 2010 22:47:27 +1100 Date: Thu, 14 Jan 2010 22:47:25 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Nikolay Denev In-Reply-To: Message-ID: <20100114222154.M62659@delplex.bde.org> References: <201001131515.08602.jhb@freebsd.org> <4B4E2ECA.90905@FreeBSD.org> <201001131633.09669.jhb@freebsd.org> <20100113.150435.650865766805848595.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: dougb@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, freebsd-arch@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 11:47:34 -0000 On Thu, 14 Jan 2010, Nikolay Denev wrote: > I just want to add a user's point of view : > To me INCLUDE_CONFIG_FILE sounds like the > whole config file will be included, > not just the output after preprocessing. It used to mean to actually include the config file. This became a broken meaning when the include directive was added in 2001, if this directory wass actually used, so that a typical config file looked like: include MOST options extra nooptions noextra This was fixed in 2007, but at the same time, for some reason stripping the comments became the default. Of course GENERIC shouldn't have verbose comments (except meta ones). Please remove any others :-). There are only 2 really annoying ones in the i386 GENERIC: - one for puc - a set of 3 separate 1-line extra ones for bpf, the first line of which essentially just repeats the expansion of the acronym `bpf' but does it with different capitalization. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 12:50:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30781065693; Thu, 14 Jan 2010 12:50:59 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mx1.freebsd.org (Postfix) with ESMTP id 2CAB98FC19; Thu, 14 Jan 2010 12:50:58 +0000 (UTC) Received: by qyk4 with SMTP id 4so11543174qyk.7 for ; Thu, 14 Jan 2010 04:50:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=3DhMqguGr+Sk70Ryx4dNIRL0ihQAvFTAIs+S5TsAyew=; b=BGX60GPx4tw+50/S75QWekvAJRgULCJ0lXsFOiYcbhBpUCEuJXSwQp6dgos2qpst1m QaHHSkSiqC3fFsEz2PTl/KHkgjrASeORt+vUa58Tk6g4tz1v9s/HRTKrVHPYSVIKVLtU Xa6D+Jj1sI0ZD9IX0yq1ajQyuPIAtT9xslRfg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=f5fflfvrvJmJ/1ByyUH1y+FOhNZg66MuxSeiTvYjOjGOVQtr2+u1BMczJq/Xv22/c+ ui5mVaOfxW+MRPzsL7u25uYZpu9EJmwr+voYmRWwrWth1SxKN6VQak20LlnfFPXUIxX+ TBEZ/Wv7dge2tSFcX7lXtS//Jvg2C8fds3+Eo= Received: by 10.224.69.164 with SMTP id z36mr494824qai.377.1263473453707; Thu, 14 Jan 2010 04:50:53 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 8sm1733472qwj.43.2010.01.14.04.50.51 (version=SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 04:50:52 -0800 (PST) Date: Thu, 14 Jan 2010 07:50:46 -0500 From: Alexander Kabaev To: Ed Schouten Message-ID: <20100114075046.6a2ebb71@kan.dnsalias.net> In-Reply-To: <201001141000.o0EA0182095910@svn.freebsd.org> References: <201001141000.o0EA0182095910@svn.freebsd.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/yIKllgEyDeoejAqG6=xLErk"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202279 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 12:50:59 -0000 --Sig_/yIKllgEyDeoejAqG6=xLErk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 14 Jan 2010 10:00:01 +0000 (UTC) Ed Schouten wrote: > Author: ed > Date: Thu Jan 14 10:00:01 2010 > New Revision: 202279 > URL: http://svn.freebsd.org/changeset/base/202279 >=20 > Log: > Revert the change to Symbol.map, made in r202274. > =20 > Even though we use __sym_compat(), we should list the symbol in > Symbol.map. > =20 > ttyslot() is now listed as follows, which seems to do the right > thing:=20 > | Symbol table '.dynsym' contains 2755 entries: > | Num: Value Size Type Bind Vis Ndx Name > | 613: 00000000000477b0 121 FUNC GLOBAL DEFAULT 10 > ttyslot@FBSD_1.0=20 > Reported by: kib >=20 > Modified: > head/lib/libc/gen/Symbol.map >=20 > Modified: head/lib/libc/gen/Symbol.map > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/gen/Symbol.map Thu Jan 14 09:38:23 > 2010 (r202278) +++ head/lib/libc/gen/Symbol.map Thu Jan > 14 10:00:01 2010 (r202279) @@ -272,6 +272,7 @@ FBSD_1.0 { > openlog; > closelog; > setlogmask; > + ttyslot; > ttyname_r; > ttyname; > timezone; Unnecessary, despite of what kib says. It was exported with proper version by __sym_compat already. This line in Symbol map is a NOP because there's no unadorned global 'ttyslot' symbol in the library for it to apply. Please back it out.=20 --=20 Alexander Kabaev --Sig_/yIKllgEyDeoejAqG6=xLErk Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFLTxMqQ6z1jMm+XZYRAspwAJsFVmiHBfeVhwKfDEkHHzxkqKBPigCghqJ1 cHdAktiy1OSpIB4fMHi6XEM= =mAXj -----END PGP SIGNATURE----- --Sig_/yIKllgEyDeoejAqG6=xLErk-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 14:30:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77312106566C; Thu, 14 Jan 2010 14:30:54 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 639678FC15; Thu, 14 Jan 2010 14:30: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 o0EEUsqY057935; Thu, 14 Jan 2010 14:30:54 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EEUssv057931; Thu, 14 Jan 2010 14:30:54 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <201001141430.o0EEUssv057931@svn.freebsd.org> From: Ulf Lilleengen Date: Thu, 14 Jan 2010 14:30: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: r202283 - in head/sys: conf fs/ext2fs gnu/fs/ext2fs gnu/fs/reiserfs modules/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 14:30:54 -0000 Author: lulf Date: Thu Jan 14 14:30:54 2010 New Revision: 202283 URL: http://svn.freebsd.org/changeset/base/202283 Log: Bring in the ext2fs work done by Aditya Sarawgi during and after Google Summer of Code 2009: - BSDL block and inode allocation policies for ext2fs. This involves the use FFS1 style block and inode allocation for ext2fs. Preallocation was removed since it was GPL'd. - Make ext2fs MPSAFE by introducing locks to per-mount datastructures. - Fixes for kern/122047 PR. - Various small bugfixes. - Move out of gnu/ directory. Sponsored by: Google Inc. Submitted by: Aditya Sarawgi Added: head/sys/fs/ext2fs/ - copied from r201427, head/sys/gnu/fs/ext2fs/ head/sys/fs/ext2fs/ext2_dinode.h (contents, props changed) head/sys/fs/ext2fs/ext2_dir.h (contents, props changed) head/sys/fs/ext2fs/ext2fs.h (contents, props changed) Deleted: head/sys/fs/ext2fs/COPYRIGHT.INFO head/sys/fs/ext2fs/ext2_bitops.h head/sys/fs/ext2fs/ext2_fs.h head/sys/fs/ext2fs/ext2_fs_sb.h head/sys/fs/ext2fs/ext2_linux_balloc.c head/sys/fs/ext2fs/ext2_linux_ialloc.c head/sys/fs/ext2fs/i386-bitops.h head/sys/gnu/fs/ext2fs/ Modified: head/sys/conf/files head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_readwrite.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h head/sys/gnu/fs/reiserfs/reiserfs_fs.h head/sys/modules/ext2fs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 14 11:03:26 2010 (r202282) +++ head/sys/conf/files Thu Jan 14 14:30:54 2010 (r202283) @@ -1956,18 +1956,15 @@ geom/virstor/binstream.c optional geom_v geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor geom/zero/g_zero.c optional geom_zero -gnu/fs/ext2fs/ext2_alloc.c optional ext2fs \ - warning "kernel contains GPL contaminated ext2fs filesystem" -gnu/fs/ext2fs/ext2_balloc.c optional ext2fs -gnu/fs/ext2fs/ext2_bmap.c optional ext2fs -gnu/fs/ext2fs/ext2_inode.c optional ext2fs -gnu/fs/ext2fs/ext2_inode_cnv.c optional ext2fs -gnu/fs/ext2fs/ext2_linux_balloc.c optional ext2fs -gnu/fs/ext2fs/ext2_linux_ialloc.c optional ext2fs -gnu/fs/ext2fs/ext2_lookup.c optional ext2fs -gnu/fs/ext2fs/ext2_subr.c optional ext2fs -gnu/fs/ext2fs/ext2_vfsops.c optional ext2fs -gnu/fs/ext2fs/ext2_vnops.c optional ext2fs +fs/ext2fs/ext2_alloc.c optional ext2fs +fs/ext2fs/ext2_balloc.c optional ext2fs +fs/ext2fs/ext2_bmap.c optional ext2fs +fs/ext2fs/ext2_inode.c optional ext2fs +fs/ext2fs/ext2_inode_cnv.c optional ext2fs +fs/ext2fs/ext2_lookup.c optional ext2fs +fs/ext2fs/ext2_subr.c optional ext2fs +fs/ext2fs/ext2_vfsops.c optional ext2fs +fs/ext2fs/ext2_vnops.c optional ext2fs gnu/fs/reiserfs/reiserfs_hashes.c optional reiserfs \ warning "kernel contains GPL contaminated ReiserFS filesystem" gnu/fs/reiserfs/reiserfs_inode.c optional reiserfs Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_alloc.c Sun Jan 3 12:17:51 2010 (r201427) +++ head/sys/fs/ext2fs/ext2_alloc.c Thu Jan 14 14:30:54 2010 (r202283) @@ -43,52 +43,54 @@ #include #include #include +#include -#include -#include -#include -#include -#include -#include - -static void ext2_fserr(struct ext2_sb_info *, u_int, char *); - -/* - * Linux calls this functions at the following locations: - * (1) the inode is freed - * (2) a preallocation miss occurs - * (3) truncate is called - * (4) release_file is called and f_mode & 2 - * - * I call it in ext2_inactive, ext2_truncate, ext2_vfree and in (2) - * the call in vfree might be redundant - */ -void -ext2_discard_prealloc(ip) - struct inode * ip; -{ -#ifdef EXT2_PREALLOCATE - if (ip->i_prealloc_count) { - int i = ip->i_prealloc_count; - ip->i_prealloc_count = 0; - ext2_free_blocks (ITOV(ip)->v_mount, - ip->i_prealloc_block, - i); - } -#endif -} - +#include +#include +#include +#include +#include + +static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); +static u_long ext2_dirpref(struct inode *); +static void ext2_fserr(struct m_ext2fs *, uid_t, char *); +static u_long ext2_hashalloc(struct inode *, int, long, int, + daddr_t (*)(struct inode *, int, daddr_t, + int)); +static daddr_t ext2_nodealloccg(struct inode *, int, daddr_t, int); +static daddr_t ext2_mapsearch(struct m_ext2fs *, char *, daddr_t); /* * Allocate a block in the file system. - * - * this takes the framework from ffs_alloc. To implement the - * actual allocation, it calls ext2_new_block, the ported version - * of the same Linux routine. * - * we note that this is always called in connection with ext2_blkpref + * A preference may be optionally specified. If a preference is given + * the following hierarchy is used to allocate a block: + * 1) allocate the requested block. + * 2) allocate a rotationally optimal block in the same cylinder. + * 3) allocate a block in the same cylinder group. + * 4) quadradically rehash into other cylinder groups, until an + * available block is located. + * If no block preference is given the following hierarchy is used + * to allocate a block: + * 1) allocate a block in the cylinder group that contains the + * inode for the file. + * 2) quadradically rehash into other cylinder groups, until an + * available block is located. * - * preallocation is done as Linux does it + * A preference may be optionally specified. If a preference is given + * the following hierarchy is used to allocate a block: + * 1) allocate the requested block. + * 2) allocate a rotationally optimal block in the same cylinder. + * 3) allocate a block in the same cylinder group. + * 4) quadradically rehash into other cylinder groups, until an + * available block is located. + * If no block preference is given the following hierarchy is used + * to allocate a block: + * 1) allocate a block in the cylinder group that contains the + * inode for the file. + * 2) quadradically rehash into other cylinder groups, until an + * available block is located. */ + int ext2_alloc(ip, lbn, bpref, size, cred, bnp) struct inode *ip; @@ -97,75 +99,46 @@ ext2_alloc(ip, lbn, bpref, size, cred, b struct ucred *cred; int32_t *bnp; { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; + struct ext2mount *ump; int32_t bno; - + int cg; *bnp = 0; fs = ip->i_e2fs; + ump = ip->i_ump; + mtx_assert(EXT2_MTX(ump), MA_OWNED); #ifdef DIAGNOSTIC - if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) { + if ((u_int)size > fs->e2fs_bsize || blkoff(fs, size) != 0) { vn_printf(ip->i_devvp, "bsize = %lu, size = %d, fs = %s\n", - fs->s_blocksize, size, fs->fs_fsmnt); + (long unsigned int)fs->e2fs_bsize, size, fs->e2fs_fsmnt); panic("ext2_alloc: bad size"); } if (cred == NOCRED) panic("ext2_alloc: missing credential"); #endif /* DIAGNOSTIC */ - if (size == fs->s_blocksize && fs->s_es->s_free_blocks_count == 0) + if (size == fs->e2fs_bsize && fs->e2fs->e2fs_fbcount == 0) goto nospace; if (cred->cr_uid != 0 && - fs->s_es->s_free_blocks_count < fs->s_es->s_r_blocks_count) + fs->e2fs->e2fs_fbcount < fs->e2fs->e2fs_rbcount) goto nospace; - if (bpref >= fs->s_es->s_blocks_count) + if (bpref >= fs->e2fs->e2fs_bcount) bpref = 0; - /* call the Linux code */ -#ifdef EXT2_PREALLOCATE - /* To have a preallocation hit, we must - * - have at least one block preallocated - * - and our preferred block must have that block number or one below - */ - if (ip->i_prealloc_count && - (bpref == ip->i_prealloc_block || - bpref + 1 == ip->i_prealloc_block)) - { - bno = ip->i_prealloc_block++; - ip->i_prealloc_count--; - /* ext2_debug ("preallocation hit (%lu/%lu).\n", - ++alloc_hits, ++alloc_attempts); */ - - /* Linux gets, clears, and releases the buffer at this - point - we don't have to that; we leave it to the caller - */ - } else { - ext2_discard_prealloc (ip); - /* ext2_debug ("preallocation miss (%lu/%lu).\n", - alloc_hits, ++alloc_attempts); */ - if (S_ISREG(ip->i_mode)) - bno = ext2_new_block - (ITOV(ip)->v_mount, bpref, - &ip->i_prealloc_count, - &ip->i_prealloc_block); - else - bno = (int32_t)ext2_new_block(ITOV(ip)->v_mount, - bpref, 0, 0); + if (bpref == 0) + cg = ino_to_cg(fs, ip->i_number); + else + cg = dtog(fs, bpref); + bno = (daddr_t)ext2_hashalloc(ip, cg, bpref, fs->e2fs_bsize, + ext2_alloccg); + if (bno > 0) { + ip->i_blocks += btodb(fs->e2fs_bsize); + ip->i_flag |= IN_CHANGE | IN_UPDATE; + *bnp = bno; + return (0); } -#else - bno = (int32_t)ext2_new_block(ITOV(ip)->v_mount, bpref, 0, 0); -#endif - - if (bno > 0) { - /* set next_alloc fields as done in block_getblk */ - ip->i_next_alloc_block = lbn; - ip->i_next_alloc_goal = bno; - - ip->i_blocks += btodb(size); - ip->i_flag |= IN_CHANGE | IN_UPDATE; - *bnp = bno; - return (0); - } nospace: + EXT2_UNLOCK(ump); ext2_fserr(fs, cred->cr_uid, "file system full"); - uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt); + uprintf("\n%s: write failed, file system is full\n", fs->e2fs_fsmnt); return (ENOSPC); } @@ -187,6 +160,8 @@ nospace: #ifdef FANCY_REALLOC #include static int doasyncfree = 1; +static int doreallocblks = 1; + #ifdef OPT_DEBUG SYSCTL_INT(_debug, 14, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""); #endif /* OPT_DEBUG */ @@ -204,19 +179,21 @@ ext2_reallocblks(ap) return ENOSPC; #else - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct inode *ip; struct vnode *vp; struct buf *sbp, *ebp; - int32_t *bap, *sbap, *ebap; + int32_t *bap, *sbap, *ebap = 0; + struct ext2mount *ump; struct cluster_save *buflist; - int32_t start_lbn, end_lbn, soff, eoff, newblk, blkno; struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp; + int32_t start_lbn, end_lbn, soff, newblk, blkno =0; int i, len, start_lvl, end_lvl, pref, ssize; vp = ap->a_vp; ip = VTOI(vp); fs = ip->i_e2fs; + ump = ip->i_ump; #ifdef UNKLAR if (fs->fs_contigsumsize <= 0) return (ENOSPC); @@ -238,8 +215,8 @@ return ENOSPC; if (dtog(fs, dbtofsb(fs, buflist->bs_children[0]->b_blkno)) != dtog(fs, dbtofsb(fs, buflist->bs_children[len - 1]->b_blkno))) return (ENOSPC); - if (ufs_getlbns(vp, start_lbn, start_ap, &start_lvl) || - ufs_getlbns(vp, end_lbn, end_ap, &end_lvl)) + if (ext2_getlbns(vp, start_lbn, start_ap, &start_lvl) || + ext2_getlbns(vp, end_lbn, end_ap, &end_lvl)) return (ENOSPC); /* * Get the starting offset and block map for the first block. @@ -249,7 +226,7 @@ return ENOSPC; soff = start_lbn; } else { idp = &start_ap[start_lvl - 1]; - if (bread(vp, idp->in_lbn, (int)fs->s_blocksize, NOCRED, &sbp)) { + if (bread(vp, idp->in_lbn, (int)fs->e2fs_bsize, NOCRED, &sbp)) { brelse(sbp); return (ENOSPC); } @@ -259,7 +236,8 @@ return ENOSPC; /* * Find the preferred location for the cluster. */ - pref = ext2_blkpref(ip, start_lbn, soff, sbap); + EXT2_LOCK(ump); + pref = ext2_blkpref(ip, start_lbn, soff, sbap, blkno); /* * If the block range spans two block maps, get the second map. */ @@ -271,16 +249,20 @@ return ENOSPC; panic("ext2_reallocblk: start == end"); #endif ssize = len - (idp->in_off + 1); - if (bread(vp, idp->in_lbn, (int)fs->s_blocksize, NOCRED, &ebp)) + if (bread(vp, idp->in_lbn, (int)fs->e2fs_bsize, NOCRED, &ebp)){ + EXT2_UNLOCK(ump); goto fail; + } ebap = (int32_t *)ebp->b_data; } /* * Search the block map looking for an allocation of the desired size. */ - if ((newblk = (int32_t)ext2_hashalloc(ip, dtog(fs, pref), (long)pref, - len, (u_long (*)())ext2_clusteralloc)) == 0) + if ((newblk = (int32_t)ext2_hashalloc(ip, dtog(fs, pref), pref, + len, ext2_clusteralloc)) == 0){ + EXT2_UNLOCK(ump); goto fail; + } /* * We have found a new contiguous block. * @@ -289,9 +271,10 @@ return ENOSPC; * with the file. */ blkno = newblk; - for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->s_frags_per_block) { + for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { if (i == ssize) bap = ebap; + soff = -i; #ifdef DIAGNOSTIC if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap)) panic("ext2_reallocblks: alloc mismatch"); @@ -322,17 +305,18 @@ return ENOSPC; if (!doasyncfree) ext2_update(vp, 1); } - if (ssize < len) + if (ssize < len) { if (doasyncfree) bdwrite(ebp); else bwrite(ebp); + } /* * Last, free the old blocks and assign the new blocks to the buffers. */ - for (blkno = newblk, i = 0; i < len; i++, blkno += fs->s_frags_per_block) { + for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) { ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->s_blocksize); + fs->e2fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); } return (0); @@ -350,8 +334,6 @@ fail: /* * Allocate an inode in the file system. * - * we leave the actual allocation strategy to the (modified) - * ext2_new_inode(), to make sure we get the policies right */ int ext2_valloc(pvp, mode, cred, vpp) @@ -361,21 +343,38 @@ ext2_valloc(pvp, mode, cred, vpp) struct vnode **vpp; { struct inode *pip; - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct inode *ip; - ino_t ino; - int i, error; + struct ext2mount *ump; + ino_t ino, ipref; + int i, error, cg; *vpp = NULL; pip = VTOI(pvp); fs = pip->i_e2fs; - if (fs->s_es->s_free_inodes_count == 0) - goto noinodes; + ump = pip->i_ump; - /* call the Linux routine - it returns the inode number only */ - ino = ext2_new_inode(pip, mode); + EXT2_LOCK(ump); + if (fs->e2fs->e2fs_ficount == 0) + goto noinodes; + /* + * If it is a directory then obtain a cylinder group based on + * ext2_dirpref else obtain it using ino_to_cg. The preferred inode is + * always the next inode. + */ + if((mode & IFMT) == IFDIR) { + cg = ext2_dirpref(pip); + if (fs->e2fs_contigdirs[cg] < 255) + fs->e2fs_contigdirs[cg]++; + } else { + cg = ino_to_cg(fs, pip->i_number); + if (fs->e2fs_contigdirs[cg] > 0) + fs->e2fs_contigdirs[cg]--; + } + ipref = cg * fs->e2fs->e2fs_ipg + 1; + ino = (ino_t)ext2_hashalloc(pip, cg, (long)ipref, mode, ext2_nodealloccg); - if (ino == 0) + if (ino == 0) goto noinodes; error = VFS_VGET(pvp->v_mount, ino, LK_EXCLUSIVE, vpp); if (error) { @@ -410,12 +409,126 @@ printf("ext2_valloc: allocated inode %d\ */ return (0); noinodes: + EXT2_UNLOCK(ump); ext2_fserr(fs, cred->cr_uid, "out of inodes"); - uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt); + uprintf("\n%s: create/symlink failed, no inodes free\n", fs->e2fs_fsmnt); return (ENOSPC); } /* + * Find a cylinder to place a directory. + * + * The policy implemented by this algorithm is to allocate a + * directory inode in the same cylinder group as its parent + * directory, but also to reserve space for its files inodes + * and data. Restrict the number of directories which may be + * allocated one after another in the same cylinder group + * without intervening allocation of files. + * + * If we allocate a first level directory then force allocation + * in another cylinder group. + * + */ +static u_long +ext2_dirpref(struct inode *pip) +{ + struct m_ext2fs *fs; + int cg, prefcg, dirsize, cgsize; + int avgifree, avgbfree, avgndir, curdirsize; + int minifree, minbfree, maxndir; + int mincg, minndir; + int maxcontigdirs; + + mtx_assert(EXT2_MTX(pip->i_ump), MA_OWNED); + fs = pip->i_e2fs; + + avgifree = fs->e2fs->e2fs_ficount / fs->e2fs_gcount; + avgbfree = fs->e2fs->e2fs_fbcount / fs->e2fs_gcount; + avgndir = fs->e2fs_total_dir / fs->e2fs_gcount; + + /* + * Force allocation in another cg if creating a first level dir. + */ + ASSERT_VOP_LOCKED(ITOV(pip), "ext2fs_dirpref"); + if (ITOV(pip)->v_vflag & VV_ROOT) { + prefcg = arc4random() % fs->e2fs_gcount; + mincg = prefcg; + minndir = fs->e2fs_ipg; + for (cg = prefcg; cg < fs->e2fs_gcount; cg++) + if (fs->e2fs_gd[cg].ext2bgd_ndirs < minndir && + fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { + mincg = cg; + minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; + } + for (cg = 0; cg < prefcg; cg++) + if (fs->e2fs_gd[cg].ext2bgd_ndirs < minndir && + fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= avgbfree) { + mincg = cg; + minndir = fs->e2fs_gd[cg].ext2bgd_ndirs; + } + + return (mincg); + } + + /* + * Count various limits which used for + * optimal allocation of a directory inode. + */ + maxndir = min(avgndir + fs->e2fs_ipg / 16, fs->e2fs_ipg); + minifree = avgifree - avgifree / 4; + if (minifree < 1) + minifree = 1; + minbfree = avgbfree - avgbfree / 4; + if (minbfree < 1) + minbfree = 1; + cgsize = fs->e2fs_fsize * fs->e2fs_fpg; + dirsize = AVGDIRSIZE; + curdirsize = avgndir ? (cgsize - avgbfree * fs->e2fs_bsize) / avgndir : 0; + if (dirsize < curdirsize) + dirsize = curdirsize; + if (dirsize <= 0) + maxcontigdirs = 0; /* dirsize overflowed */ + else + maxcontigdirs = min((avgbfree * fs->e2fs_bsize) / dirsize, 255); + maxcontigdirs = min(maxcontigdirs, fs->e2fs_ipg / AFPDIR); + if (maxcontigdirs == 0) + maxcontigdirs = 1; + + /* + * Limit number of dirs in one cg and reserve space for + * regular files, but only if we have no deficit in + * inodes or space. + */ + prefcg = ino_to_cg(fs, pip->i_number); + for (cg = prefcg; cg < fs->e2fs_gcount; cg++) + if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && + fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + if (fs->e2fs_contigdirs[cg] < maxcontigdirs) + return (cg); + } + for (cg = 0; cg < prefcg; cg++) + if (fs->e2fs_gd[cg].ext2bgd_ndirs < maxndir && + fs->e2fs_gd[cg].ext2bgd_nifree >= minifree && + fs->e2fs_gd[cg].ext2bgd_nbfree >= minbfree) { + if (fs->e2fs_contigdirs[cg] < maxcontigdirs) + return (cg); + } + /* + * This is a backstop when we have deficit in space. + */ + for (cg = prefcg; cg < fs->e2fs_gcount; cg++) + if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) + return (cg); + for (cg = 0; cg < prefcg; cg++) + if (fs->e2fs_gd[cg].ext2bgd_nifree >= avgifree) + break; + return (cg); +} + +/* * Select the desired position for the next block in a file. * * we try to mimic what Remy does in inode_getblk/block_getblk @@ -437,11 +550,12 @@ ext2_blkpref(ip, lbn, indx, bap, blocknr int32_t blocknr; { int tmp; + mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED); /* if the next block is actually what we thought it is, then set the goal to what we thought it should be */ - if(ip->i_next_alloc_block == lbn) + if(ip->i_next_alloc_block == lbn && ip->i_next_alloc_goal != 0) return ip->i_next_alloc_goal; /* now check whether we were provided with an array that basically @@ -458,13 +572,230 @@ ext2_blkpref(ip, lbn, indx, bap, blocknr return blocknr ? blocknr : (int32_t)(ip->i_block_group * EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + - ip->i_e2fs->s_es->s_first_data_block; + ip->i_e2fs->e2fs->e2fs_first_dblock; +} + +/* + * Implement the cylinder overflow algorithm. + * + * The policy implemented by this algorithm is: + * 1) allocate the block in its requested cylinder group. + * 2) quadradically rehash on the cylinder group number. + * 3) brute force search for a free block. + */ +static u_long +ext2_hashalloc(struct inode *ip, int cg, long pref, int size, + daddr_t (*allocator)(struct inode *, int, daddr_t, int)) +{ + struct m_ext2fs *fs; + ino_t result; + int i, icg = cg; + + mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED); + fs = ip->i_e2fs; + /* + * 1: preferred cylinder group + */ + result = (*allocator)(ip, cg, pref, size); + if (result) + return (result); + /* + * 2: quadratic rehash + */ + for (i = 1; i < fs->e2fs_gcount; i *= 2) { + cg += i; + if (cg >= fs->e2fs_gcount) + cg -= fs->e2fs_gcount; + result = (*allocator)(ip, cg, 0, size); + if (result) + return (result); + } + /* + * 3: brute force search + * Note that we start at i == 2, since 0 was checked initially, + * and 1 is always checked in the quadratic rehash. + */ + cg = (icg + 2) % fs->e2fs_gcount; + for (i = 2; i < fs->e2fs_gcount; i++) { + result = (*allocator)(ip, cg, 0, size); + if (result) + return (result); + cg++; + if (cg == fs->e2fs_gcount) + cg = 0; + } + return (0); +} + +/* + * Determine whether a block can be allocated. + * + * Check to see if a block of the appropriate size is available, + * and if it is, allocate it. + */ +static daddr_t +ext2_alloccg(struct inode *ip, int cg, daddr_t bpref, int size) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2mount *ump; + int error, bno, start, end, loc; + char *bbp; + /* XXX ondisk32 */ + fs = ip->i_e2fs; + ump = ip->i_ump; + if (fs->e2fs_gd[cg].ext2bgd_nbfree == 0) + return (0); + EXT2_UNLOCK(ump); + error = bread(ip->i_devvp, fsbtodb(fs, + fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + EXT2_LOCK(ump); + return (0); + } + bbp = (char *)bp->b_data; + + if (dtog(fs, bpref) != cg) + bpref = 0; + if (bpref != 0) { + bpref = dtogd(fs, bpref); + /* + * if the requested block is available, use it + */ + if (isclr(bbp, bpref)) { + bno = bpref; + goto gotit; + } + } + /* + * no blocks in the requested cylinder, so take next + * available one in this cylinder group. + * first try to get 8 contigous blocks, then fall back to a single + * block. + */ + if (bpref) + start = dtogd(fs, bpref) / NBBY; + else + start = 0; + end = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + for (loc = start; loc < end; loc++) { + if (bbp[loc] == 0) { + bno = loc * NBBY; + goto gotit; + } + } + for (loc = 0; loc < start; loc++) { + if (bbp[loc] == 0) { + bno = loc * NBBY; + goto gotit; + } + } + + bno = ext2_mapsearch(fs, bbp, bpref); + if (bno < 0){ + brelse(bp); + EXT2_LOCK(ump); + return (0); + } +gotit: +#ifdef DIAGNOSTIC + if (isset(bbp, (daddr_t)bno)) { + printf("ext2fs_alloccgblk: cg=%d bno=%d fs=%s\n", + cg, bno, fs->e2fs_fsmnt); + panic("ext2fs_alloccg: dup alloc"); + } +#endif + setbit(bbp, (daddr_t)bno); + EXT2_LOCK(ump); + fs->e2fs->e2fs_fbcount--; + fs->e2fs_gd[cg].ext2bgd_nbfree--; + fs->e2fs_fmod = 1; + EXT2_UNLOCK(ump); + bdwrite(bp); + return (cg * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bno); +} + +/* + * Determine whether an inode can be allocated. + * + * Check to see if an inode is available, and if it is, + * allocate it using tode in the specified cylinder group. + */ +static daddr_t +ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipref, int mode) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2mount *ump; + int error, start, len, loc, map, i; + char *ibp; + ipref--; /* to avoid a lot of (ipref -1) */ + if (ipref == -1) + ipref = 0; + fs = ip->i_e2fs; + ump = ip->i_ump; + if (fs->e2fs_gd[cg].ext2bgd_nifree == 0) + return (0); + EXT2_UNLOCK(ump); + error = bread(ip->i_devvp, fsbtodb(fs, + fs->e2fs_gd[cg].ext2bgd_i_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + EXT2_LOCK(ump); + return (0); + } + ibp = (char *)bp->b_data; + if (ipref) { + ipref %= fs->e2fs->e2fs_ipg; + if (isclr(ibp, ipref)) + goto gotit; + } + start = ipref / NBBY; + len = howmany(fs->e2fs->e2fs_ipg - ipref, NBBY); + loc = skpc(0xff, len, &ibp[start]); + if (loc == 0) { + len = start + 1; + start = 0; + loc = skpc(0xff, len, &ibp[0]); + if (loc == 0) { + printf("cg = %d, ipref = %lld, fs = %s\n", + cg, (long long)ipref, fs->e2fs_fsmnt); + panic("ext2fs_nodealloccg: map corrupted"); + /* NOTREACHED */ + } + } + i = start + len - loc; + map = ibp[i]; + ipref = i * NBBY; + for (i = 1; i < (1 << NBBY); i <<= 1, ipref++) { + if ((map & i) == 0) { + goto gotit; + } + } + printf("fs = %s\n", fs->e2fs_fsmnt); + panic("ext2fs_nodealloccg: block not in map"); + /* NOTREACHED */ +gotit: + setbit(ibp, ipref); + EXT2_LOCK(ump); + fs->e2fs_gd[cg].ext2bgd_nifree--; + fs->e2fs->e2fs_ficount--; + fs->e2fs_fmod = 1; + if ((mode & IFMT) == IFDIR) { + fs->e2fs_gd[cg].ext2bgd_ndirs++; + fs->e2fs_total_dir++; + } + EXT2_UNLOCK(ump); + bdwrite(bp); + return (cg * fs->e2fs->e2fs_ipg + ipref +1); } /* * Free a block or fragment. * - * pass on to the Linux code */ void ext2_blkfree(ip, bno, size) @@ -472,19 +803,47 @@ ext2_blkfree(ip, bno, size) int32_t bno; long size; { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; + struct buf *bp; + struct ext2mount *ump; + int cg, error; + char *bbp; fs = ip->i_e2fs; - /* - * call Linux code with mount *, block number, count - */ - ext2_free_blocks(ITOV(ip)->v_mount, bno, size / fs->s_frag_size); + ump = ip->i_ump; + cg = dtog(fs, bno); + if ((u_int)bno >= fs->e2fs->e2fs_bcount) { + printf("bad block %lld, ino %llu\n", (long long)bno, + (unsigned long long)ip->i_number); + ext2_fserr(fs, ip->i_uid, "bad block"); + return; + } + error = bread(ip->i_devvp, + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_b_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return; + } + bbp = (char *)bp->b_data; + bno = dtogd(fs, bno); + if (isclr(bbp, bno)) { + printf("block = %lld, fs = %s\n", + (long long)bno, fs->e2fs_fsmnt); + panic("blkfree: freeing free block"); + } + clrbit(bbp, bno); + EXT2_LOCK(ump); + fs->e2fs->e2fs_fbcount++; + fs->e2fs_gd[cg].ext2bgd_nbfree++; + fs->e2fs_fmod = 1; + EXT2_UNLOCK(ump); + bdwrite(bp); } /* * Free an inode. * - * the maintenance of the actual bitmaps is again up to the linux code */ int ext2_vfree(pvp, ino, mode) @@ -492,30 +851,94 @@ ext2_vfree(pvp, ino, mode) ino_t ino; int mode; { - struct ext2_sb_info *fs; + struct m_ext2fs *fs; struct inode *pip; - mode_t save_i_mode; + struct buf *bp; + struct ext2mount *ump; + int error, cg; + char * ibp; +/* mode_t save_i_mode; */ pip = VTOI(pvp); fs = pip->i_e2fs; - if ((u_int)ino > fs->s_inodes_per_group * fs->s_groups_count) + ump = pip->i_ump; + if ((u_int)ino > fs->e2fs_ipg * fs->e2fs_gcount) panic("ext2_vfree: range: devvp = %p, ino = %d, fs = %s", - pip->i_devvp, ino, fs->fs_fsmnt); + pip->i_devvp, ino, fs->e2fs_fsmnt); -/* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode); + cg = ino_to_cg(fs, ino); + error = bread(pip->i_devvp, + fsbtodb(fs, fs->e2fs_gd[cg].ext2bgd_i_bitmap), + (int)fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return (0); + } + ibp = (char *)bp->b_data; + ino = (ino - 1) % fs->e2fs->e2fs_ipg; + if (isclr(ibp, ino)) { + printf("ino = %llu, fs = %s\n", + (unsigned long long)ino, fs->e2fs_fsmnt); + if (fs->e2fs_ronly == 0) + panic("ifree: freeing free inode"); + } + clrbit(ibp, ino); + EXT2_LOCK(ump); + fs->e2fs->e2fs_ficount++; + fs->e2fs_gd[cg].ext2bgd_nifree++; + if ((mode & IFMT) == IFDIR) { + fs->e2fs_gd[cg].ext2bgd_ndirs--; + fs->e2fs_total_dir--; + } + fs->e2fs_fmod = 1; + EXT2_UNLOCK(ump); + bdwrite(bp); + return (0); +} + +/* + * Find a block in the specified cylinder group. + * + * It is a panic if a request is made to find a block if none are + * available. */ - ext2_discard_prealloc(pip); +static daddr_t +ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t bpref) +{ + daddr_t bno; + int start, len, loc, i, map; - /* we need to make sure that ext2_free_inode can adjust the - used_dir_counts in the group summary information - I'd - really like to know what the rationale behind this - 'set i_mode to zero to denote an unused inode' is + /* + * find the fragment by searching through the free block + * map for an appropriate bit pattern */ - save_i_mode = pip->i_mode; - pip->i_mode = mode; - ext2_free_inode(pip); - pip->i_mode = save_i_mode; - return (0); + if (bpref) + start = dtogd(fs, bpref) / NBBY; + else + start = 0; + len = howmany(fs->e2fs->e2fs_fpg, NBBY) - start; + loc = skpc(0xff, len, &bbp[start]); + if (loc == 0) { + len = start + 1; + start = 0; + loc = skpc(0xff, len, &bbp[start]); + if (loc == 0) { + printf("start = %d, len = %d, fs = %s\n", + start, len, fs->e2fs_fsmnt); + panic("ext2fs_alloccg: map corrupted"); + /* NOTREACHED */ + } + } + i = start + len - loc; + map = bbp[i]; + bno = i * NBBY; + for (i = 1; i < (1 << NBBY); i <<= 1, bno++) { + if ((map & i) == 0) + return (bno); + } + printf("fs = %s\n", fs->e2fs_fsmnt); + panic("ext2fs_mapsearch: block not in map"); + /* NOTREACHED */ } /* @@ -526,10 +949,25 @@ ext2_vfree(pvp, ino, mode) */ static void ext2_fserr(fs, uid, cp) - struct ext2_sb_info *fs; - u_int uid; + struct m_ext2fs *fs; + uid_t uid; char *cp; { - log(LOG_ERR, "uid %d on %s: %s\n", uid, fs->fs_fsmnt, cp); + log(LOG_ERR, "uid %u on %s: %s\n", uid, fs->e2fs_fsmnt, cp); +} + +int +cg_has_sb(int i) +{ + int a3, a5, a7; + + if (i == 0 || i == 1) + return 1; + for (a3 = 3, a5 = 5, a7 = 7; + a3 <= i || a5 <= i || a7 <= i; + a3 *= 3, a5 *= 5, a7 *= 7) + if (i == a3 || i == a5 || i == a7) + return 1; + return 0; } Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_balloc.c Sun Jan 3 12:17:51 2010 (r201427) +++ head/sys/fs/ext2fs/ext2_balloc.c Thu Jan 14 14:30:54 2010 (r202283) @@ -44,42 +44,39 @@ #include #include -#include -#include -#include -#include -#include - +#include +#include +#include +#include +#include /* * Balloc defines the structure of file system storage * by allocating the physical blocks on a device given * the inode and the logical block number in a file. */ int -ext2_balloc(ip, bn, size, cred, bpp, flags) +ext2_balloc(ip, lbn, size, cred, bpp, flags) struct inode *ip; - int32_t bn; + int32_t lbn; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 14:36:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029491065670; Thu, 14 Jan 2010 14:36:40 +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 CC2CC8FC17; Thu, 14 Jan 2010 14:36: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 o0EEadvL059226; Thu, 14 Jan 2010 14:36:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EEadDa059223; Thu, 14 Jan 2010 14:36:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001141436.o0EEadDa059223@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jan 2010 14:36: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: r202284 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 14:36:40 -0000 Author: jhb Date: Thu Jan 14 14:36:39 2010 New Revision: 202284 URL: http://svn.freebsd.org/changeset/base/202284 Log: - Update required headers for namei() to add and remove . - Add RETURN VALUES and ERROR sections for namei()'s error return values. - Add a missing link to NDHASGIANT.9. PR: docs/142815, docs/142816 Submitted by: Lachlan Kang (1, 2) MFC after: 3 days Modified: head/share/man/man9/Makefile head/share/man/man9/namei.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jan 14 14:30:54 2010 (r202283) +++ head/share/man/man9/Makefile Thu Jan 14 14:36:39 2010 (r202284) @@ -903,7 +903,8 @@ MLINKS+=mutex.9 mtx_assert.9 \ mutex.9 mtx_unlock_spin.9 \ mutex.9 mtx_unlock_spin_flags.9 MLINKS+=namei.9 NDFREE.9 \ - namei.9 NDINIT.9 + namei.9 NDINIT.9 \ + namei.9 NDHASGIANT.9 MLINKS+=pbuf.9 getpbuf.9 \ pbuf.9 relpbuf.9 \ pbuf.9 trypbuf.9 Modified: head/share/man/man9/namei.9 ============================================================================== --- head/share/man/man9/namei.9 Thu Jan 14 14:30:54 2010 (r202283) +++ head/share/man/man9/namei.9 Thu Jan 14 14:36:39 2010 (r202284) @@ -44,7 +44,7 @@ .Nd pathname translation and lookup operations .Sh SYNOPSIS .In sys/param.h -.In sys/proc.h +.In sys/fcntl.h .In sys/namei.h .Ft int .Fn namei "struct nameidata *ndp" @@ -315,6 +315,34 @@ flag can be passed to the .Fn NDFREE function. .El +.Sh RETURN VALUES +If successful, +.Fn namei +will return 0, otherwise it will return an error. +.Sh ERRORS +Errors which +.Fn namei +may return: +.Bl -tag -width Er +.It Bq Er ENOTDIR +A component of the specified pathname is not a directory when a directory is +expected. +.It Bq Er ENAMETOOLONG +A component of a pathname exceeded 255 characters, +or an entire pathname exceeded 1023 characters. +.It Bq Er ENOENT +A component of the specified pathname does not exist, +or the pathname is an empty string. +.It Bq Er ACCES +An attempt is made to access a file in a way forbidden by its file access +permissions. +.It Bq Er ELOOP +Too many symbolic links were encountered in translating the pathname. +.It Bq Er EISDIR +An attempt is made to open a directory with write mode specified. +.It Bq Er EROFS +An attempt is made to modify a file or directory on a read-only file system. +.El .Sh FILES .Bl -tag .It Pa src/sys/kern/vfs_lookup.c From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 14:43:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1138D106566C; Thu, 14 Jan 2010 14:43:17 +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 F38C18FC14; Thu, 14 Jan 2010 14:43: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 o0EEhGCc060702; Thu, 14 Jan 2010 14:43:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EEhG8e060700; Thu, 14 Jan 2010 14:43:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001141443.o0EEhG8e060700@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jan 2010 14:43: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: r202285 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 14:43:17 -0000 Author: jhb Date: Thu Jan 14 14:43:16 2010 New Revision: 202285 URL: http://svn.freebsd.org/changeset/base/202285 Log: - Note that if_xname, if_dname, and if_dunit are usually initialized via if_initname(). - Document if_drv_flags and replace references to IFF_(RUNNING|OACTIVE) with references to IFF_DRV_(RUNNING|OACTIVE). - Complete truncated sentence in the description of if_transmit by copying from the description in if_qflush. - Add missing line breaks for translators. Reviewed by: brooks (1) MFC after: 3 days Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Thu Jan 14 14:36:39 2010 (r202284) +++ head/share/man/man9/ifnet.9 Thu Jan 14 14:43:16 2010 (r202285) @@ -237,11 +237,15 @@ The name of the interface, .Dq Li fxp0 or .Dq Li lo0 ) . -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_dname .Pq Vt "const char *" The name of the driver. -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_dunit .Pq Vt int A unique number assigned to each interface managed by a particular @@ -249,7 +253,9 @@ driver. Drivers may choose to set this to .Dv IF_DUNIT_NONE if a unit number is not associated with the device. -(Initialized by driver.) +(Initialized by driver +(usually via +.Fn if_initname ) . ) .It Va if_addrhead .Pq Vt "struct ifaddrhead" The head of the @@ -282,7 +288,11 @@ to refer to a particular interface by in .It Va if_flags .Pq Vt int Flags describing operational parameters of this interface (see below). -(Manipulated by both driver and generic code.) +(Manipulated by generic code.) +.It Va if_drv_flags +.Pq Vt int +Flags describing operational status of this interface (see below). +(Manipulated by driver.) .It Va if_capabilities .Pq Vt int Flags describing the capabilities the interface supports (see below). @@ -349,18 +359,26 @@ Output a packet on interface or queue it on the output queue if the interface is already active. .It Fn if_transmit Transmit a packet on an interface or queue it if the interface is -in use. This function will return +in use. +This function will return .Dv ENOBUFS -if the devices software and hardware queues are both full. This -function must be installed after +if the devices software and hardware queues are both full. +This function must be installed after +.Fn if_attach +to override the default implementation. +This function is exposed in order to allow drivers to manage their own queues +and to reduce the latency caused by a frequently gratuitous enqueue / dequeue +pair to ifq. +The suggested internal software queueing mechanism is buf_ring. .It Fn if_qflush Free mbufs in internally managed queues when the interface is marked down. This function must be installed after .Fn if_attach -to override the default implementation. This function is exposed in order -to allow drivers to manage their own queues and to reduce the latency -caused by a frequently gratuitous enqueue / dequeue pair to ifq. The -suggested internal software queueing mechanism is buf_ring. +to override the default implementation. +This function is exposed in order to allow drivers to manage their own queues +and to reduce the latency caused by a frequently gratuitous enqueue / dequeue +pair to ifq. +The suggested internal software queueing mechanism is buf_ring. .It Fn if_start Start queued output on an interface. This function is exposed in @@ -369,10 +387,10 @@ order to provide for some interface clas among all drivers. .Fn if_start may only be called when the -.Dv IFF_OACTIVE +.Dv IFF_DRV_OACTIVE flag is not set. (Thus, -.Dv IFF_OACTIVE +.Dv IFF_DRV_OACTIVE does not literally mean that output is active, but rather that the device's internal output queue is full.) Please note that this function will soon be deprecated. @@ -406,7 +424,7 @@ Initialize and bring up the hardware, e.g., reset the chip and enable the receiver unit. Should mark the interface running, but not active -.Dv ( IFF_RUNNING , ~IIF_OACTIVE ) . +.Dv ( IFF_DRV_RUNNING , ~IIF_DRV_OACTIVE ) . .It Fn if_resolvemulti Check the requested multicast group membership, .Fa addr , @@ -425,6 +443,12 @@ Flags of the former kind are marked .Aq S in this table; the latter are marked .Aq D . +Flags which begin with +.Dq IFF_DRV_ +are stored in +.Va if_drv_flags ; +all other flags are stored in +.Va if_flags . .Pp The macro .Dv IFF_CANTCHANGE @@ -454,7 +478,7 @@ The interface is a loopback device. The interface is point-to-point; .Dq broadcast address is actually the address of the other end. -.It Dv IFF_RUNNING +.It Dv IFF_DRV_RUNNING .Aq D* The interface has been configured and dynamic resources were successfully allocated. @@ -473,7 +497,7 @@ This interface is in the permanently pro .It Dv IFF_ALLMULTI .Aq D* This interface is in all-multicasts mode (used by multicast routers). -.It Dv IFF_OACTIVE +.It Dv IFF_DRV_OACTIVE .Aq D* The interface's hardware output queue (if any) is full; output packets are to be queued. From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 15:07:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF7001065693; Thu, 14 Jan 2010 15:07:18 +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 BDE478FC0A; Thu, 14 Jan 2010 15:07: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 o0EF7Ihv066048; Thu, 14 Jan 2010 15:07:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EF7IQ9066047; Thu, 14 Jan 2010 15:07:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001141507.o0EF7IQ9066047@svn.freebsd.org> From: John Baldwin Date: Thu, 14 Jan 2010 15:07: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: r202286 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 15:07:18 -0000 Author: jhb Date: Thu Jan 14 15:07:18 2010 New Revision: 202286 URL: http://svn.freebsd.org/changeset/base/202286 Log: Update the ident for the XENHVM kernel config to match the filename. MFC after: 1 week Modified: head/sys/amd64/conf/XENHVM Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Thu Jan 14 14:43:16 2010 (r202285) +++ head/sys/amd64/conf/XENHVM Thu Jan 14 15:07:18 2010 (r202286) @@ -19,7 +19,7 @@ # $FreeBSD$ cpu HAMMER -ident GENERIC +ident XENHVM # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 15:20:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A981106566B; Thu, 14 Jan 2010 15:20:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 597228FC0A; Thu, 14 Jan 2010 15:20: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 o0EFK9A4068870; Thu, 14 Jan 2010 15:20:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EFK9L7068868; Thu, 14 Jan 2010 15:20:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001141520.o0EFK9L7068868@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 15:20: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: r202287 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 15:20:09 -0000 Author: ed Date: Thu Jan 14 15:20:09 2010 New Revision: 202287 URL: http://svn.freebsd.org/changeset/base/202287 Log: Unbreak pututxline() on 32-bit architectures. I forgot to cast the size_t's back to off_t before negating them, causing all sorts of artifacts where the log files would grow to 2^32 - 197 bytes. Reported by: ume Modified: head/lib/libc/gen/pututxline.c Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Thu Jan 14 15:07:18 2010 (r202286) +++ head/lib/libc/gen/pututxline.c Thu Jan 14 15:20:09 2010 (r202287) @@ -87,7 +87,7 @@ utx_active_add(const struct futx *fu) case DEAD_PROCESS: /* Overwrite when ut_id matches. */ if (memcmp(fu->fu_id, fe.fu_id, sizeof fe.fu_id) == 0) { - fseeko(fp, -sizeof fe, SEEK_CUR); + fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); goto exact; } if (fe.fu_type != DEAD_PROCESS) @@ -96,7 +96,7 @@ utx_active_add(const struct futx *fu) default: /* Allow us to overwrite unused records. */ if (partial == -1) - partial = ftello(fp) - sizeof fe; + partial = ftello(fp) - (off_t)sizeof fe; break; } } @@ -140,7 +140,7 @@ utx_active_remove(struct futx *fu) fu->fu_tv = fe.fu_tv; /* Terminate session. */ - fseeko(fp, -sizeof fe, SEEK_CUR); + fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); fwrite(fu, sizeof *fu, 1, fp); fclose(fp); return (0); @@ -181,7 +181,7 @@ utx_lastlogin_add(const struct futx *fu) goto done; /* Found a previous lastlogin entry for this user. */ - fseeko(fp, -sizeof fe, SEEK_CUR); + fseeko(fp, -(off_t)sizeof fe, SEEK_CUR); break; } fwrite(fu, sizeof *fu, 1, fp); From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 15:20:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61390106568F; Thu, 14 Jan 2010 15:20:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 377358FC22; Thu, 14 Jan 2010 15:20: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 o0EFKlvZ069071; Thu, 14 Jan 2010 15:20:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EFKldP069069; Thu, 14 Jan 2010 15:20:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001141520.o0EFKldP069069@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 15:20: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: r202288 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 15:20:47 -0000 Author: ed Date: Thu Jan 14 15:20:46 2010 New Revision: 202288 URL: http://svn.freebsd.org/changeset/base/202288 Log: Remove ttyslot from Symbol.map anyway. Requested by: kan Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Jan 14 15:20:09 2010 (r202287) +++ head/lib/libc/gen/Symbol.map Thu Jan 14 15:20:46 2010 (r202288) @@ -272,7 +272,6 @@ FBSD_1.0 { openlog; closelog; setlogmask; - ttyslot; ttyname_r; ttyname; timezone; From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 15:27:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13C6B1065670; Thu, 14 Jan 2010 15:27:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02B9E8FC08; Thu, 14 Jan 2010 15:27: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 o0EFRIf9070519; Thu, 14 Jan 2010 15:27:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EFRILD070517; Thu, 14 Jan 2010 15:27:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201001141527.o0EFRILD070517@svn.freebsd.org> From: Ed Maste Date: Thu, 14 Jan 2010 15:27: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: r202289 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 15:27:19 -0000 Author: emaste Date: Thu Jan 14 15:27:18 2010 New Revision: 202289 URL: http://svn.freebsd.org/changeset/base/202289 Log: Reject invalid CIDR widths rather than silently stopping at the first non-digit character. Due to an issue with rc(8) in a test configuration, ifconfig was being invoked with the address used again as the width - for example, ifconfig vlan0 10.0.0.1/10.0.0.1 Prior to this change, that address/width would be interpreted as 10.0.0.1/10. Modified: head/sbin/ifconfig/af_inet.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Thu Jan 14 15:20:46 2010 (r202288) +++ head/sbin/ifconfig/af_inet.c Thu Jan 14 15:27:18 2010 (r202289) @@ -37,6 +37,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -110,15 +111,18 @@ in_getaddr(const char *s, int which) char *p = NULL; if((p = strrchr(s, '/')) != NULL) { + const char *errstr; /* address is `name/masklen' */ int masklen; - int ret; struct sockaddr_in *min = sintab[MASK]; *p = '\0'; - ret = sscanf(p+1, "%u", &masklen); - if(ret != 1 || (masklen < 0 || masklen > 32)) { + if (!isdigit(*(p + 1))) + errstr = "invalid"; + else + masklen = (int)strtonum(p + 1, 0, 32, &errstr); + if (errstr != NULL) { *p = '/'; - errx(1, "%s: bad value", s); + errx(1, "%s: bad value (width %s)", s, errstr); } min->sin_len = sizeof(*min); min->sin_addr.s_addr = htonl(~((1LL << (32 - masklen)) - 1) & From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 16:49:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEAD5106566B; Thu, 14 Jan 2010 16:49:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9518FC12; Thu, 14 Jan 2010 16:49: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 o0EGnMRA088610; Thu, 14 Jan 2010 16:49:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EGnMp8088608; Thu, 14 Jan 2010 16:49:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001141649.o0EGnMp8088608@svn.freebsd.org> From: Christian Brueffer Date: Thu, 14 Jan 2010 16:49: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: r202290 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 16:49:23 -0000 Author: brueffer Date: Thu Jan 14 16:49:22 2010 New Revision: 202290 URL: http://svn.freebsd.org/changeset/base/202290 Log: Build iwi(4) and iwifw(4) modules on amd64 as well. PR: 113117 Submitted by: "O. Hartmann" MFC after: 1 week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Jan 14 15:27:18 2010 (r202289) +++ head/sys/modules/Makefile Thu Jan 14 16:49:22 2010 (r202290) @@ -513,6 +513,8 @@ _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw +_iwi= iwi +_iwifw= iwifw _iwn= iwn _iwnfw= iwnfw _ixgb= ixgb From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 16:53:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E5341065670; Thu, 14 Jan 2010 16:53:46 +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 D90238FC0C; Thu, 14 Jan 2010 16:53:45 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 761D946B29; Thu, 14 Jan 2010 11:53:45 -0500 (EST) Date: Thu, 14 Jan 2010 16:53:45 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Doug Barton In-Reply-To: <4B4E1586.7090102@FreeBSD.org> Message-ID: References: <20100110.210204.787670930858346133.imp@bsdimp.com> <4B4D109A.5060500@FreeBSD.org> <20100112.174326.337739863389869251.imp@bsdimp.com> <4B4E1586.7090102@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, "M. Warner Losh" , freebsd-arch@FreeBSD.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 16:53:46 -0000 > In the interests of bringing this to a close: > # Store the plain version of the configuration file in the kernel itself. > # For information on extraction, and storing the comments also, see > config(8). Am I right in thinking that even with this change, you still end up with a single giant config file whereas it may have been made up of several files in the original and assembled using the include directive? This means some caution (and a caveat of some sort) are still required. I agree entirely that we should be including the comments by default. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 17:30:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E041065694; Thu, 14 Jan 2010 17:30:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DAA628FC1B; Thu, 14 Jan 2010 17:30:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0EHKjMi012163; Thu, 14 Jan 2010 10:20:45 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 14 Jan 2010 10:21:42 -0700 (MST) Message-Id: <20100114.102142.328914705071816274.imp@bsdimp.com> To: rwatson@freebsd.org From: "M. Warner Losh" In-Reply-To: References: <20100112.174326.337739863389869251.imp@bsdimp.com> <4B4E1586.7090102@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 17:30:49 -0000 In message: Robert Watson writes: : : > In the interests of bringing this to a close: : > # Store the plain version of the configuration file in the kernel : > # itself. : > # For information on extraction, and storing the comments also, see : > config(8). : : Am I right in thinking that even with this change, you still end up : with a single giant config file whereas it may have been made up of : several files in the original and assembled using the include : directive? No. Without -C you get something that looks like: options CONFIG_AUTOGENERATED\n\ ident GENERIC\n\ machine amd64\n\ cpu HAMMER\n\ makeoptions DEBUG=-g\n\ options AH_SUPPORT_AR5416\n\ options IEEE80211_SUPPORT_MESH\n\ options IEEE80211_AMPDU_AGE\n\ which is the totally pre-processed config, with stuff sorted in a weird order (I think backwards in the file). This is the fully-processed config, including include files, option/nooption cancellation, etc. With -C you get: #\n\ # GENERIC -- Generic kernel configuration file for FreeBSD/amd64\n\ #\n\ # For more information on this file, please read the config(5) manual page,\n\ # and/or the handbook section on Kernel Configuration Files:\n\ #\n\ eg, an verbatim copy of the config file used, but do not get any files that were included such as DEFAULTS. Personally, I'd rather see us have two different options here, as suggested by others, so that it is clear and self-contained. I'd vote for INCLUDE_CONFIG for today's behavior without -C, and INCLUDE_CONFIG_FILE for config -C. -C then becomes a nop and the man page becomes correct. We can then put a single line: options INCLUDE_CONFIG_FILE # include this config file in kernel and be done with it in head. For MFC, having the extra comment lines isn't so horrible as an explicitly granted exception to the rule of not doing that so others won't be tempted to do it too. : This means some caution (and a caveat of some sort) are : still required. I agree entirely that we should be including the : comments by default. I disagree, for the reasons above. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 18:05:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 513E01065670; Thu, 14 Jan 2010 18:05:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E408C8FC0C; Thu, 14 Jan 2010 18:05:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0EHtODR012670; Thu, 14 Jan 2010 10:55:24 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 14 Jan 2010 10:56:22 -0700 (MST) Message-Id: <20100114.105622.457034909117828677.imp@bsdimp.com> To: rwatson@freebsd.org From: "M. Warner Losh" In-Reply-To: <20100114.102142.328914705071816274.imp@bsdimp.com> References: <4B4E1586.7090102@FreeBSD.org> <20100114.102142.328914705071816274.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Jan_14_10_56_22_2010_136)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 18:05:53 -0000 ----Next_Part(Thu_Jan_14_10_56_22_2010_136)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In message: <20100114.102142.328914705071816274.imp@bsdimp.com> "M. Warner Losh" writes: : Personally, I'd rather see us have two different options here, as : suggested by others, so that it is clear and self-contained. I'd vote : for INCLUDE_CONFIG for today's behavior without -C, and : INCLUDE_CONFIG_FILE for config -C. -C then becomes a nop and the man : page becomes correct. We can then put a single line: : : options INCLUDE_CONFIG_FILE # include this config file in kernel : : and be done with it in head. Consider the following patches, and the following lines in GENERIC: options INCLUDE_CONFIG_FILE # include this config file in kernel #options INCLUDE_CONFIG # processed config, without comments : For MFC, having the extra comment lines isn't so horrible as an : explicitly granted exception to the rule of not doing that so others : won't be tempted to do it too. That was worded badly. "I'm OK with merging the extra comments, so long as it is clear to everybody that this is done as a special case exception to the general rule that we don't do this." Finally, I'd like to appologize to Doug for hijacking his simple change and using it as an engine to make things better for the project. Warner P.S. I've also placed a copy of the diff at http://people.freebsd.org/~imp/config.diff ----Next_Part(Thu_Jan_14_10_56_22_2010_136)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config.diff" Index: sys/kern/kern_mib.c =================================================================== --- sys/kern/kern_mib.c (revision 202102) +++ sys/kern/kern_mib.c (working copy) @@ -351,7 +351,7 @@ CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl, "I", "Current secure level"); -#ifdef INCLUDE_CONFIG_FILE +#if defined(INCLUDE_CONFIG_FILE) || defined(INCLUDE_CONFIG) /* Actual kernel configuration options. */ extern char kernconfstring[]; Index: usr.sbin/config/kernconf.tmpl =================================================================== --- usr.sbin/config/kernconf.tmpl (revision 202102) +++ usr.sbin/config/kernconf.tmpl (working copy) @@ -5,13 +5,19 @@ * $FreeBSD$ */ #include "opt_config.h" -#ifdef INCLUDE_CONFIG_FILE /* - * For !INCLUDE_CONFIG_FILE case, you should look at kern_mib.c. This is - * where kernconfstring is defined then. + * If INCLUDE_CONFIG_FILE is defined, then we include the config file + * verbatim (and that's the only config file we include). Otherwise, if + * INCLUDE_CONFIG is defined, we include it. Otherwise, we include nothing + * at all. */ +#ifdef INCLUDE_CONFIG_FILE const char kernconfstring[] __attribute__ ((section("kern_conf"))) = "%%KERNCONFFILE%%"; - +#else /* INCLUDE_CONFIG_FILE */ +#ifdef INCLUDE_CONFIG +const char kernconfstring[] __attribute__ ((section("kern_conf"))) = +"%%KERNCONF%%"; +#endif /* INCLUDE_CONFIG */ #endif /* INCLUDE_CONFIG_FILE */ Index: usr.sbin/config/main.c =================================================================== --- usr.sbin/config/main.c (revision 202102) +++ usr.sbin/config/main.c (working copy) @@ -79,12 +79,6 @@ int found_defaults; int incignore; -/* - * Preserve old behaviour in INCLUDE_CONFIG_FILE handling (files are included - * literally). - */ -int filebased = 0; - static void configfile(void); static void get_srcdir(void); static void usage(void); @@ -114,7 +108,6 @@ while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) switch (ch) { case 'C': - filebased = 1; break; case 'd': if (*destdir == '\0') @@ -489,12 +482,18 @@ } } +static int +matches(const char *s1, const char *s2) +{ + return (strncmp(s1, s2, strlen(s2)) == 0); +} + static void configfile(void) { FILE *fo; - struct sbuf *sb; - char *p; + struct sbuf *sb1, *sb2; + char *p, *walker; /* Add main configuration file to the list of files to be included */ cfgfile_add(PREFIX); @@ -502,30 +501,30 @@ fo = fopen(p, "w"); if (!fo) err(2, "%s", p); - sb = sbuf_new(NULL, NULL, 2048, SBUF_AUTOEXTEND); - assert(sb != NULL); - sbuf_clear(sb); - if (filebased) { - /* Is needed, can be used for backward compatibility. */ - configfile_filebased(sb); - } else { - configfile_dynamic(sb); + sb1 = sbuf_new(NULL, NULL, 2048, SBUF_AUTOEXTEND); + assert(sb1 != NULL); + sb2 = sbuf_new(NULL, NULL, 2048, SBUF_AUTOEXTEND); + assert(sb2 != NULL); + sbuf_clear(sb1); + configfile_filebased(sb1); + sbuf_finish(sb1); + sbuf_clear(sb2); + configfile_dynamic(sb2); + sbuf_finish(sb2); + walker = kernconfstr; + while (*walker) { + if (matches(walker, KERNCONFFILETAG)) { + fprintf(fo, "%s", sbuf_data(sb1)); + walker += strlen(KERNCONFFILETAG); + } else if (matches(walker, KERNCONFTAG)) { + fprintf(fo, "%s", sbuf_data(sb2)); + walker += strlen(KERNCONFTAG); + } else { + fputc(*walker++, fo); + } } - sbuf_finish(sb); - /* - * We print first part of the tamplate, replace our tag with - * configuration files content and later continue writing our - * template. - */ - p = strstr(kernconfstr, KERNCONFTAG); - if (p == NULL) - errx(EXIT_FAILURE, "Something went terribly wrong!"); - *p = '\0'; - fprintf(fo, "%s", kernconfstr); - fprintf(fo, "%s", sbuf_data(sb)); - p += strlen(KERNCONFTAG); - fprintf(fo, "%s", p); - sbuf_delete(sb); + sbuf_delete(sb1); + sbuf_delete(sb2); fclose(fo); moveifchanged(path("config.c.new"), path("config.c")); cfgfile_removeall(); Index: usr.sbin/config/config.8 =================================================================== --- usr.sbin/config/config.8 (revision 202102) +++ usr.sbin/config/config.8 (working copy) @@ -65,9 +65,6 @@ .Nm version number. .It Fl C -If the INCLUDE_CONFIG_FILE is present in a configuration file, -kernel image will contain full configuration files included -literally (preserving comments). This flag is kept for backward compatibility. .It Fl d Ar destdir Use @@ -83,7 +80,9 @@ .It Fl x Ar kernel Print kernel configuration file embedded into a kernel file. -This option makes sense only if +This option makes sense only if either +.Cd "options INCLUDE_CONFIG" +or .Cd "options INCLUDE_CONFIG_FILE" entry was present in your configuration file. .It Fl p @@ -150,6 +149,17 @@ should be run again. Attempts to compile a system that had configuration errors are likely to fail. +.Pp +The kernel config file can be embedded into the kernel binary in one of +two ways. +First, a verbatim copy of the kernel config text file, without any of the +included config files, can be included using +.Cd "options INCLUDE_CONFIG_FILE" +in the config file. +Second, a copy of the fully process kernel config file, without any comments +at all, can be included using +.Cd "options INCLUDE_CONFIG" +in the config file. .Sh DEBUG KERNELS Traditional .Bx Index: usr.sbin/config/config.h =================================================================== --- usr.sbin/config/config.h (revision 202102) +++ usr.sbin/config/config.h (working copy) @@ -142,10 +142,11 @@ STAILQ_HEAD(hint_head, hint) hints; /* - * Tag present in the kernelconf.tmlp template file. It's mandatory for those - * two strings to be the same. Otherwise you'll get into trouble. + * Tags expanded in the kernconf.tmpl file. KERNCONFTAG is for the processed + * kernel file, while KERNCONFFILE is for the verbatim file. */ -#define KERNCONFTAG "%%KERNCONFFILE%%" +#define KERNCONFTAG "%%KERNCONF%%" +#define KERNCONFFILETAG "%%KERNCONFFILE%%" /* * Faked option to note, that the configuration file has been taken from the ----Next_Part(Thu_Jan_14_10_56_22_2010_136)---- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 18:44:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36ACF1065679; Thu, 14 Jan 2010 18:44:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id EF61B8FC0A; Thu, 14 Jan 2010 18:44:40 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 5DC1A1CCD8; Thu, 14 Jan 2010 19:44:40 +0100 (CET) Date: Thu, 14 Jan 2010 19:44:40 +0100 From: Ed Schouten To: Ulf Lilleengen Message-ID: <20100114184440.GL64905@hoeg.nl> References: <201001141430.o0EEUssv057931@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pUbUlJlI7D8AxsZW" Content-Disposition: inline In-Reply-To: <201001141430.o0EEUssv057931@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202283 - in head/sys: conf fs/ext2fs gnu/fs/ext2fs gnu/fs/reiserfs modules/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 18:44:41 -0000 --pUbUlJlI7D8AxsZW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Ulf Lilleengen wrote: > Bring in the ext2fs work done by Aditya Sarawgi during and after > Google Summer of Code 2009: Very nice! Congratulations, Aditya! --=20 Ed Schouten WWW: http://80386.nl/ --pUbUlJlI7D8AxsZW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAktPZhgACgkQ52SDGA2eCwU5VgCcDRtoxV1dW5SuwzIe/RkPfNyV pjEAn3AnctH+jtxE3HRqXGNDzAgx0QCC =nj6x -----END PGP SIGNATURE----- --pUbUlJlI7D8AxsZW-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 19:08:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD44A106566C; Thu, 14 Jan 2010 19:08:43 +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 AC40C8FC0C; Thu, 14 Jan 2010 19:08: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 o0EJ8hjv019461; Thu, 14 Jan 2010 19:08:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EJ8hTi019458; Thu, 14 Jan 2010 19:08:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001141908.o0EJ8hTi019458@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 19:08:43 +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: r202293 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 19:08:43 -0000 Author: yongari Date: Thu Jan 14 19:08:43 2010 New Revision: 202293 URL: http://svn.freebsd.org/changeset/base/202293 Log: For controllers that has dual mode PHY(copper or fiber) interfaces over GMII, make sure to enable GMII. With this change brgphy(4) is used to handle the dual mode PHY. Since we still don't have a sane way to pass PHY specific information to mii(4) layer special handling is needed in brgphy(4) to determine which mode of PHY was configured in parent interface. This change make BCM5715S work. Tested by: olli Obtained from: OpenBSD MFC after: 1 week Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Jan 14 17:35:07 2010 (r202292) +++ head/sys/dev/bge/if_bge.c Thu Jan 14 19:08:43 2010 (r202293) @@ -902,7 +902,8 @@ bge_miibus_statchg(device_t dev) mii = device_get_softc(sc->bge_miibus); BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); - if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || + IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); else BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); @@ -1783,13 +1784,20 @@ bge_blockinit(struct bge_softc *sc) if (!(BGE_IS_5705_PLUS(sc))) CSR_WRITE_4(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + val = BGE_MACMODE_TXDMA_ENB | BGE_MACMODE_RXDMA_ENB | + BGE_MACMODE_RX_STATS_CLEAR | BGE_MACMODE_TX_STATS_CLEAR | + BGE_MACMODE_RX_STATS_ENB | BGE_MACMODE_TX_STATS_ENB | + BGE_MACMODE_FRMHDR_DMA_ENB; + + if (sc->bge_flags & BGE_FLAG_TBI) + val |= BGE_PORTMODE_TBI; + else if (sc->bge_flags & BGE_FLAG_MII_SERDES) + val |= BGE_PORTMODE_GMII; + else + val |= BGE_PORTMODE_MII; + /* Turn on DMA, clear stats */ - CSR_WRITE_4(sc, BGE_MAC_MODE, BGE_MACMODE_TXDMA_ENB | - BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR | - BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB | - BGE_MACMODE_TX_STATS_ENB | BGE_MACMODE_FRMHDR_DMA_ENB | - ((sc->bge_flags & BGE_FLAG_TBI) ? - BGE_PORTMODE_TBI : BGE_PORTMODE_MII)); + CSR_WRITE_4(sc, BGE_MAC_MODE, val); /* Set misc. local control, enable interrupts on attentions */ CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN); @@ -2851,12 +2859,14 @@ bge_attach(device_t dev) hwcfg = ntohl(hwcfg); } - if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) - sc->bge_flags |= BGE_FLAG_TBI; - /* The SysKonnect SK-9D41 is a 1000baseSX card. */ - if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41) - sc->bge_flags |= BGE_FLAG_TBI; + if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == + SK_SUBSYSID_9D41 || (hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER) { + if (BGE_IS_5714_FAMILY(sc)) + sc->bge_flags |= BGE_FLAG_MII_SERDES; + else + sc->bge_flags |= BGE_FLAG_TBI; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd, Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu Jan 14 17:35:07 2010 (r202292) +++ head/sys/dev/bge/if_bgereg.h Thu Jan 14 19:08:43 2010 (r202293) @@ -2603,6 +2603,7 @@ struct bge_softc { #define BGE_FLAG_JUMBO 0x00000002 #define BGE_FLAG_WIRESPEED 0x00000004 #define BGE_FLAG_EADDR 0x00000008 +#define BGE_FLAG_MII_SERDES 0x00000010 #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 19:14:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92CD4106566B; Thu, 14 Jan 2010 19:14:24 +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 826C68FC0C; Thu, 14 Jan 2010 19:14: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 o0EJEO7d020759; Thu, 14 Jan 2010 19:14:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EJEOQw020757; Thu, 14 Jan 2010 19:14:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001141914.o0EJEOQw020757@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Jan 2010 19:14: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: r202294 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 19:14:24 -0000 Author: yongari Date: Thu Jan 14 19:14:24 2010 New Revision: 202294 URL: http://svn.freebsd.org/changeset/base/202294 Log: Add check for fiber mode for BCM5714 PHY. This PHY supports both copper and fiber interfaces over GMII so an explicit check is necessary to know whether it was configured for fiber interface. This change make BCM5715S work. Tested by: olli MFC after: 1 week Modified: head/sys/dev/mii/brgphy.c Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Thu Jan 14 19:08:43 2010 (r202293) +++ head/sys/dev/mii/brgphy.c Thu Jan 14 19:14:24 2010 (r202294) @@ -197,6 +197,7 @@ brgphy_attach(device_t dev) case MII_OUI_xxBROADCOM: switch (bsc->mii_model) { case MII_MODEL_xxBROADCOM_BCM5706: + case MII_MODEL_xxBROADCOM_BCM5714: /* * The 5464 PHY used in the 5706 supports both copper * and fiber interfaces over GMII. Need to check the From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 19:23:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99101106566C; Thu, 14 Jan 2010 19:23:41 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88CA38FC1B; Thu, 14 Jan 2010 19:23: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 o0EJNfvQ022837; Thu, 14 Jan 2010 19:23:41 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EJNf0m022835; Thu, 14 Jan 2010 19:23:41 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001141923.o0EJNf0m022835@svn.freebsd.org> From: Rui Paulo Date: Thu, 14 Jan 2010 19:23: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: r202295 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 19:23:41 -0000 Author: rpaulo Date: Thu Jan 14 19:23:41 2010 New Revision: 202295 URL: http://svn.freebsd.org/changeset/base/202295 Log: Fix bugs introduced in previous commit: off-by-one in add_meshconf() and big-endian bug on verify_meshconf() Modified: head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Thu Jan 14 19:14:24 2010 (r202294) +++ head/sys/net80211/ieee80211_mesh.c Thu Jan 14 19:23:41 2010 (r202295) @@ -2283,6 +2283,7 @@ mesh_verify_meshconf(struct ieee80211vap const struct ieee80211_meshconf_ie *meshconf = (const struct ieee80211_meshconf_ie *) ie; const struct ieee80211_mesh_state *ms = vap->iv_mesh; + uint16_t cap; if (meshconf == NULL) return 1; @@ -2316,8 +2317,10 @@ mesh_verify_meshconf(struct ieee80211vap meshconf->conf_pselid); return 1; } + /* NB: conf_cap is only read correctly here */ + cap = LE_READ_2(&meshconf->conf_cap); /* Not accepting peers */ - if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) { + if (!(cap & IEEE80211_MESHCONF_CAP_AP)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, "not accepting peers: 0x%x\n", meshconf->conf_cap); return 1; @@ -2403,7 +2406,6 @@ ieee80211_add_meshconf(uint8_t *frm, str if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD) caps |= IEEE80211_MESHCONF_CAP_FWRD; ADDSHORT(frm, caps); - frm += 1; return frm; } From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 20:01:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A81AD106566C for ; Thu, 14 Jan 2010 20:01:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 35A3B8FC1F for ; Thu, 14 Jan 2010 20:01:16 +0000 (UTC) Received: (qmail 20898 invoked by uid 399); 14 Jan 2010 20:01:16 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 14 Jan 2010 20:01:16 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B4F7810.2080003@FreeBSD.org> Date: Thu, 14 Jan 2010 12:01:20 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: "M. Warner Losh" References: <4B4E1586.7090102@FreeBSD.org> <20100114.102142.328914705071816274.imp@bsdimp.com> <20100114.105622.457034909117828677.imp@bsdimp.com> In-Reply-To: <20100114.105622.457034909117828677.imp@bsdimp.com> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:01:17 -0000 On 1/14/2010 9:56 AM, M. Warner Losh wrote: + * If INCLUDE_CONFIG_FILE is defined, then we include the config file + * verbatim (and that's the only config file we include). Otherwise, if + * INCLUDE_CONFIG is defined, we include it. Otherwise, we include nothing + * at all. FWIW, I actually think this makes it worse, not better. The INCLUDE_CONFIG_FILE option should include everything needed to recreate the kernel. If it doesn't, it's worse than worthless, it leads to a false sense of security which makes it dangerous. I wasn't actually aware that if you do the config -C trick that you'll get ONLY the one file, not everything. Frankly I'm flabbergasted that we could do something so stupid. And on that note, I officially give up. I have better things to do with my time than argue about this any more, and it's pretty clear that my perspective on this is not shared. Maybe it's not even reasonable, who knows? Good luck, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 20:12:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5E41065670; Thu, 14 Jan 2010 20:12:28 +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 55EEF8FC1A; Thu, 14 Jan 2010 20:12:28 +0000 (UTC) Received: from [192.168.2.102] (host86-178-254-187.range86-178.btcentralplus.com [86.178.254.187]) by cyrus.watson.org (Postfix) with ESMTPSA id EE0DE46B0D; Thu, 14 Jan 2010 15:12:26 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <4B4F7810.2080003@FreeBSD.org> Date: Thu, 14 Jan 2010 20:12:24 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> References: <4B4E1586.7090102@FreeBSD.org> <20100114.102142.328914705071816274.imp@bsdimp.com> <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "M. Warner Losh" , freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:12:28 -0000 On 14 Jan 2010, at 20:01, Doug Barton wrote: > FWIW, I actually think this makes it worse, not better. The > INCLUDE_CONFIG_FILE option should include everything needed to = recreate > the kernel. If it doesn't, it's worse than worthless, it leads to a > false sense of security which makes it dangerous. I wasn't actually > aware that if you do the config -C trick that you'll get ONLY the one > file, not everything. (...more irritated words stripped like the comments in a config file...) I agree. I see two kinds of users: - Desktop/server users who want their system to work without any special = tuning or magic, and likely feel the comments they put in configuration = files are important - Users who care a about a few hundred bytes of comments due to the = nature of their special embedded hardware target environment As such, I see a reasonable "default" -- i.e., i386/amd64 GENERIC -- be = to fully preserve the configuration and its comments. For the embedded = and appliance crowds, I definitely want them to be able to fully exclude = the configuration (by not including the option). I don't see a lot of = merit to supporting stripping the comments, but if someone wants that = special case, I'm OK with supporting it, but I think it's an unuseful = default for the desktop/server platforms. Robert= From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 20:37:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6091B106566B; Thu, 14 Jan 2010 20:37:40 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8B98FC14; Thu, 14 Jan 2010 20:37:39 +0000 (UTC) Received: by bwz5 with SMTP id 5so63737bwz.3 for ; Thu, 14 Jan 2010 12:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=nRCR/CR1i/7l0iwlDyLJCogZTQQ4XzxJ8gEvWGfJGpw=; b=qXOdKftPqVXhZ8cig7A/wAYW7BDdztEYCQPKXKKnP21+kAUhkhvK1hp3BWq8iDyZKx B8E3Y2H6IhcT+WcADBXiYWC+K/fx4v10cLIdjLLGyFN19IR7XRZ+ZW7P/GaAGxK4R4wf zw98JxN4TmZR4+BURUQwNtPd/caBaBlBfSuN4= 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:content-transfer-encoding; b=U6ouhO5iQ4CsdgAHLAX1BkRVQIYmS69zaBvFTFn+nowJRWalM4cSU25B6Vmbe1vw3A qeREhjgrZJqPmILXLpr/AVK4yf3rKaAkQ7xtws9/kjFtAG1uapfV5hKiwDrEYR/aAtFr qqQZomCAcHEE0AVYn0koYMjNQ3I7DoymuD6Co= MIME-Version: 1.0 Received: by 10.204.15.145 with SMTP id k17mr771595bka.70.1263501448967; Thu, 14 Jan 2010 12:37:28 -0800 (PST) In-Reply-To: <201001141430.o0EEUssv057931@svn.freebsd.org> References: <201001141430.o0EEUssv057931@svn.freebsd.org> Date: Thu, 14 Jan 2010 23:37:28 +0300 Message-ID: From: pluknet To: Ulf Lilleengen 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: r202283 - in head/sys: conf fs/ext2fs gnu/fs/ext2fs gnu/fs/reiserfs modules/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:37:40 -0000 2010/1/14 Ulf Lilleengen : > Author: lulf > Date: Thu Jan 14 14:30:54 2010 > New Revision: 202283 > URL: http://svn.freebsd.org/changeset/base/202283 > Sorry for my late comment. Please, dedup those comments below (came from p4 165599). thanks! > =A0/* > =A0* Allocate a block in the file system. > - * > - * this takes the framework from ffs_alloc. To implement the > - * actual allocation, it calls ext2_new_block, the ported version > - * of the same Linux routine. > =A0* > - * we note that this is always called in connection with ext2_blkpref > + * A preference may be optionally specified. If a preference is given > + * the following hierarchy is used to allocate a block: > + * =A0 1) allocate the requested block. > + * =A0 2) allocate a rotationally optimal block in the same cylinder. > + * =A0 3) allocate a block in the same cylinder group. > + * =A0 4) quadradically rehash into other cylinder groups, until an > + * =A0 =A0 =A0 =A0available block is located. > + * If no block preference is given the following hierarchy is used > + * to allocate a block: > + * =A0 1) allocate a block in the cylinder group that contains the > + * =A0 =A0 =A0 =A0inode for the file. > + * =A0 2) quadradically rehash into other cylinder groups, until an > + * =A0 =A0 =A0 =A0available block is located. > =A0* > - * preallocation is done as Linux does it > + * A preference may be optionally specified. If a preference is given > + * the following hierarchy is used to allocate a block: > + * =A0 1) allocate the requested block. > + * =A0 2) allocate a rotationally optimal block in the same cylinder. > + * =A0 3) allocate a block in the same cylinder group. > + * =A0 4) quadradically rehash into other cylinder groups, until an > + * =A0 =A0 =A0 =A0available block is located. > + * If no block preference is given the following hierarchy is used > + * to allocate a block: > + * =A0 1) allocate a block in the cylinder group that contains the > + * =A0 =A0 =A0 =A0inode for the file. > + * =A0 2) quadradically rehash into other cylinder groups, until an > + * =A0 =A0 =A0 =A0available block is located. > =A0*/ --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 20:58:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C0C106566C; Thu, 14 Jan 2010 20:58:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52EAF8FC0A; Thu, 14 Jan 2010 20:58: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 o0EKwkk7044243; Thu, 14 Jan 2010 20:58:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EKwkPK044236; Thu, 14 Jan 2010 20:58:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001142058.o0EKwkPK044236@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 20:58: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: r202301 - in head: . lib/libc/gen usr.bin usr.bin/wtmpcvt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 20:58:46 -0000 Author: ed Date: Thu Jan 14 20:58:45 2010 New Revision: 202301 URL: http://svn.freebsd.org/changeset/base/202301 Log: Add wtmpcvt(1). This utility allows users to convert their wtmp databases to the new format. It makes no sense for users to keep their wtmp log files if they are unable to view them. It basically copies ut_line into ut_id as well. This makes it possible for last(1) and ac(8) to match login records with their corresponding logout record. Added: head/usr.bin/wtmpcvt/ head/usr.bin/wtmpcvt/Makefile (contents, props changed) head/usr.bin/wtmpcvt/wtmpcvt.1 (contents, props changed) head/usr.bin/wtmpcvt/wtmpcvt.c (contents, props changed) Modified: head/UPDATING head/lib/libc/gen/getutxent.3 head/usr.bin/Makefile Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jan 14 20:58:19 2010 (r202300) +++ head/UPDATING Thu Jan 14 20:58:45 2010 (r202301) @@ -37,7 +37,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. After the system has been upgraded, it is safe to remove the old log files (/var/run/utmp, /var/log/lastlog and /var/log/wtmp*), - assuming their contents is of no importance anymore. + assuming their contents is of no importance anymore. Old wtmp + databases can only be used by last(1) and ac(8) after they have + been converted to the new format using wtmpcvt(1). 20100108: Introduce the kernel thread "deadlock resolver" (which can be enabled Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Thu Jan 14 20:58:19 2010 (r202300) +++ head/lib/libc/gen/getutxent.3 Thu Jan 14 20:58:45 2010 (r202301) @@ -401,6 +401,7 @@ The file format is invalid. .Sh SEE ALSO .Xr last 1 , .Xr write 1 , +.Xr wtmpcvt 1 , .Xr getpid 2 , .Xr gettimeofday 2 , .Xr tty 4 , Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Jan 14 20:58:19 2010 (r202300) +++ head/usr.bin/Makefile Thu Jan 14 20:58:45 2010 (r202301) @@ -225,6 +225,7 @@ SUBDIR= alias \ who \ whois \ write \ + wtmpcvt \ xargs \ xinstall \ ${_xlint} \ Added: head/usr.bin/wtmpcvt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/wtmpcvt/Makefile Thu Jan 14 20:58:45 2010 (r202301) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +PROG= wtmpcvt + +.include Added: head/usr.bin/wtmpcvt/wtmpcvt.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/wtmpcvt/wtmpcvt.1 Thu Jan 14 20:58:45 2010 (r202301) @@ -0,0 +1,66 @@ +.\" Copyright (c) 2010 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 14, 2010 +.Os +.Dt WTMPCVT 1 +.Sh NAME +.Nm wtmpcvt +.Nd convert wtmp files to the utmpx format +.Sh SYNOPSIS +.Nm +.Ar input +.Ar output +.Sh DESCRIPTION +The +.Nm +utility converts traditional +.Pa wtmp +user accounting database files to the same format that is used by +.Pa /var/log/utx.log . +This makes it possible to view their contents using existing accouting +utilities, such as +.Xr last 1 +and +.Xr ac 8 . +.Sh SEE ALSO +.Xr last 1 , +.Xr getutxent 3 , +.Xr ac 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.0 . +.Sh BUGS +The application assumes the +.Ar input +file has the same byte order as the host system. +The +.Ar output +file can be used on any architecture. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/usr.bin/wtmpcvt/wtmpcvt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/wtmpcvt/wtmpcvt.c Thu Jan 14 20:58:45 2010 (r202301) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2010 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../../lib/libc/gen/utxdb.h" + +struct outmp { + char ut_line[8]; + char ut_user[16]; + char ut_host[16]; + int32_t ut_time; +}; + +static void +usage(void) +{ + + fprintf(stderr, "usage: wtmpcvt input output\n"); + exit(1); +} + +static void +outmp_to_futx(const struct outmp *ui, struct futx *uo) +{ + + memset(uo, 0, sizeof *uo); +#define COPY_STRING(field) do { \ + strncpy(uo->fu_ ## field, ui->ut_ ## field, \ + MIN(sizeof uo->fu_ ## field, sizeof ui->ut_ ## field)); \ +} while (0) +#define COPY_LINE_TO_ID() do { \ + strncpy(uo->fu_id, ui->ut_line, \ + MIN(sizeof uo->fu_id, sizeof ui->ut_line)); \ +} while (0) +#define MATCH(field, value) (strncmp(ui->ut_ ## field, (value), \ + sizeof(ui->ut_ ## field)) == 0) + if (MATCH(user, "reboot") && MATCH(line, "~")) + uo->fu_type = BOOT_TIME; + else if (MATCH(user, "date") && MATCH(line, "|")) + uo->fu_type = OLD_TIME; + else if (MATCH(user, "date") && MATCH(line, "{")) + uo->fu_type = NEW_TIME; + else if (MATCH(user, "shutdown") && MATCH(line, "~")) + uo->fu_type = SHUTDOWN_TIME; + else if (MATCH(user, "") && MATCH(host, "") && !MATCH(line, "")) { + uo->fu_type = DEAD_PROCESS; + COPY_LINE_TO_ID(); + } else if (!MATCH(user, "") && !MATCH(line, "") && ui->ut_time != 0) { + uo->fu_type = USER_PROCESS; + COPY_STRING(user); + COPY_STRING(line); + COPY_STRING(host); + COPY_LINE_TO_ID(); + } else { + uo->fu_type = EMPTY; + return; + } +#undef COPY_STRING +#undef COPY_LINE_TO_ID +#undef MATCH + + /* Timestamp conversion. XXX: Assumes host byte order! */ + uo->fu_tv = htobe64((uint64_t)ui->ut_time * 1000000); +} + +int +main(int argc, char *argv[]) +{ + FILE *in, *out; + struct outmp ui; + struct futx uo; + size_t l; + uint16_t lo; + + if (argc != 3) + usage(); + + /* Open files. */ + in = fopen(argv[1], "r"); + if (in == NULL) + err(1, argv[1]); + out = fopen(argv[2], "w"); + if (out == NULL) + err(1, argv[2]); + + /* Process entries. */ + while (fread(&ui, sizeof ui, 1, in) == 1) { + outmp_to_futx(&ui, &uo); + if (uo.fu_type == EMPTY) + continue; + + /* Write new entry to output file. */ + for (l = sizeof uo; l > 0 && + ((const char *)&uo)[l - 1] == '\0'; l--); + lo = htobe16(l); + fwrite(&lo, sizeof lo, 1, out); + fwrite(&uo, l, 1, out); + } + + fclose(in); + fclose(out); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 21:06:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F396106566C; Thu, 14 Jan 2010 21:06:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CF2218FC14; Thu, 14 Jan 2010 21:06:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0EKwWth014817; Thu, 14 Jan 2010 13:58:32 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 14 Jan 2010 13:59:30 -0700 (MST) Message-Id: <20100114.135930.80200584442733547.imp@bsdimp.com> To: rwatson@freebsd.org From: "M. Warner Losh" In-Reply-To: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> References: <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 21:06:55 -0000 In message: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> "Robert N. M. Watson" writes: : : On 14 Jan 2010, at 20:01, Doug Barton wrote: : : > FWIW, I actually think this makes it worse, not better. The : > INCLUDE_CONFIG_FILE option should include everything needed to recreate : > the kernel. If it doesn't, it's worse than worthless, it leads to a : > false sense of security which makes it dangerous. I wasn't actually : > aware that if you do the config -C trick that you'll get ONLY the one : > file, not everything. : : (...more irritated words stripped like the comments in a config file...) : : I agree. I see two kinds of users: : : - Desktop/server users who want their system to work without any : special tuning or magic, and likely feel the comments they put in : configuration files are important : - Users who care a about a few hundred bytes of comments due to the : nature of their special embedded hardware target environment : : As such, I see a reasonable "default" -- i.e., i386/amd64 GENERIC -- : be to fully preserve the configuration and its comments. For the : embedded and appliance crowds, I definitely want them to be able to : fully exclude the configuration (by not including the option). I : don't see a lot of merit to supporting stripping the comments, but : if someone wants that special case, I'm OK with supporting it, but I : think it's an unuseful default for the desktop/server platforms. I think you are confusing two different things. The embedded folks omit this entirely. That's not the issue at all here. Space is not the concern. We're putting it into GENERIC. Why are there two ways? Because there are two points in the process one can squirt the data out of config. Let me explain (sorry for the length, but it is necessary to clear up the confusion): The first way is "preserve the FILE the user used to create the kernel" on the assumption that the FILE is what is important. This will preserve the comments, but assumes that every single included file from that file is recoverable in a trivial manner (eg, from cvs, svn, p4, release ISOs, etc). This model works well for the casual user. In this model, we're therefore able to preserve the kernel config by copying the file, verbatim, into the kernel. I think this is the model that best fits most user's needs, since they EITHER take GENERIC and hack on it (in which case we preserve all that), OR they include GENERIC and opt in/out of things based on that default. Either way, this is the best way for users of releases to preserve the data they need to recreate the kernel without losing data that's important to the user, but not config (comments, spacing, order, etc). The other way of preserving the config file is to say "I want EVERYTHING applied, and I want a copy of that!" To get that, you have to walk through config's internal data structures. By the time we get to *THAT* point in the processing, comments are but a distant memory. Those are discarded early, along with the variations in spacing, blank lines. By this point in the process, even the original ordering is long gone, as is the origin of each of the remaining items in config's internal data structures. However, the resulting config file that we generate here is GUARANTEED to recreate the same kernel from the same sources modulo any silly time/date/path stuff we encode. There's a class of user that would find this comforting, or essential, since they may have multiple include files that they control, etc. In addition, since the config is presented as a sysctl, users could query it to see if the kernel had certain things compiled in or not. For some applications, this is important to know, even though other methods usually work better. So it isn't that there's an option to just strip comments or not strip comments, these two different options save data at two radically different points in the process. Both have their pros and cons. If space isn't an issue, we could save BOTH. That would be a bigger patch, since we'd have to alter config to extract both kinds of data. All I did was to move the -C option from an obscure src.conf variable to be a full-fledged kernel option, leaving the rest of the infrastructure intact. The advantage is that we cover both bases and could export both views as a sysctl (right now we overload the two different views with one sysctl). Heck, we could save the whole src/sys tree as a tarball in a separate non-loadable ELF section if people that that was useful. This could be implemented entirely in the *.mk files, however, without the need to modify config(8). Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 22:04:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA29E106568D; Thu, 14 Jan 2010 22:04:08 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90E6F8FC23; Thu, 14 Jan 2010 22:04: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 o0EM480s059395; Thu, 14 Jan 2010 22:04:08 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EM48fQ059393; Thu, 14 Jan 2010 22:04:08 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201001142204.o0EM48fQ059393@svn.freebsd.org> From: Joel Dahl Date: Thu, 14 Jan 2010 22:04: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: r202312 - head/usr.sbin/adduser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:04:08 -0000 Author: joel (doc committer) Date: Thu Jan 14 22:04:08 2010 New Revision: 202312 URL: http://svn.freebsd.org/changeset/base/202312 Log: Fix a few whitespace issues and comment typos that I found while reading through this file. Modified: head/usr.sbin/adduser/adduser.sh Modified: head/usr.sbin/adduser/adduser.sh ============================================================================== --- head/usr.sbin/adduser/adduser.sh Thu Jan 14 22:00:33 2010 (r202311) +++ head/usr.sbin/adduser/adduser.sh Thu Jan 14 22:04:08 2010 (r202312) @@ -28,20 +28,20 @@ # # err msg -# Display $msg on stderr, unless we're being quiet. -# +# Display $msg on stderr, unless we're being quiet. +# err() { if [ -z "$quietflag" ]; then - echo 1>&2 ${THISCMD}: ERROR: $* + echo 1>&2 ${THISCMD}: ERROR: $* fi } # info msg -# Display $msg on stdout, unless we're being quiet. -# +# Display $msg on stdout, unless we're being quiet. +# info() { if [ -z "$quietflag" ]; then - echo ${THISCMD}: INFO: $* + echo ${THISCMD}: INFO: $* fi } @@ -50,7 +50,7 @@ info() { # is not, output the value of the next higher uid that is available. # If a uid is not specified, output the first available uid, as indicated # by pw(8). -# +# get_nextuid () { _uid=$1 _nextuid= @@ -163,8 +163,7 @@ fullpath_from_shell() { # the path is invalid or it is not executable it # will emit an informational message saying so. # -shell_exists() -{ +shell_exists() { _sh="$1" _shellchk="${GREPCMD} '^$_sh$' ${ETCSHELLS} > /dev/null 2>&1" @@ -647,7 +646,6 @@ input_from_file() { # the user database. # input_interactive() { - _disable= _pass= _passconfirm= @@ -887,7 +885,7 @@ defaultshell="${DEFAULTSHELL}" defaultHomePerm= # Make sure the user running this program is root. This isn't a security -# measure as much as it is a usefull method of reminding the user to +# measure as much as it is a useful method of reminding the user to # 'su -' before he/she wastes time entering data that won't be saved. # procowner=${procowner:-`/usr/bin/id -u`} From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 22:21:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8CE6106566C; Thu, 14 Jan 2010 22:21:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FDF8FC0C; Thu, 14 Jan 2010 22:21: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 o0EMLKi8063553; Thu, 14 Jan 2010 22:21:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMLKYO063551; Thu, 14 Jan 2010 22:21:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001142221.o0EMLKYO063551@svn.freebsd.org> From: Ed Schouten Date: Thu, 14 Jan 2010 22:21: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: r202316 - head/usr.bin/wtmpcvt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:21:20 -0000 Author: ed Date: Thu Jan 14 22:21:20 2010 New Revision: 202316 URL: http://svn.freebsd.org/changeset/base/202316 Log: Fix a typo: accouting -> accounting. Modified: head/usr.bin/wtmpcvt/wtmpcvt.1 Modified: head/usr.bin/wtmpcvt/wtmpcvt.1 ============================================================================== --- head/usr.bin/wtmpcvt/wtmpcvt.1 Thu Jan 14 22:18:55 2010 (r202315) +++ head/usr.bin/wtmpcvt/wtmpcvt.1 Thu Jan 14 22:21:20 2010 (r202316) @@ -41,7 +41,7 @@ utility converts traditional .Pa wtmp user accounting database files to the same format that is used by .Pa /var/log/utx.log . -This makes it possible to view their contents using existing accouting +This makes it possible to view their contents using existing accounting utilities, such as .Xr last 1 and From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 22:21:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13CF11065694; Thu, 14 Jan 2010 22:21:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5EEA8FC1A; Thu, 14 Jan 2010 22:21: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 o0EMLh2Q063703; Thu, 14 Jan 2010 22:21:43 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0EMLhOb063699; Thu, 14 Jan 2010 22:21:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001142221.o0EMLhOb063699@svn.freebsd.org> From: Christian Brueffer Date: Thu, 14 Jan 2010 22:21:43 +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: r202317 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 22:21:44 -0000 Author: brueffer Date: Thu Jan 14 22:21:43 2010 New Revision: 202317 URL: http://svn.freebsd.org/changeset/base/202317 Log: Add manpages for ipwfw(4) and iwifw(4), based on iwnfw(4). MFC after: 2 weeks Added: head/share/man/man4/ipwfw.4 (contents, props changed) head/share/man/man4/iwifw.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jan 14 22:21:20 2010 (r202316) +++ head/share/man/man4/Makefile Thu Jan 14 22:21:43 2010 (r202317) @@ -156,10 +156,12 @@ MAN= aac.4 \ ips.4 \ ipsec.4 \ ipw.4 \ + ipwfw.4 \ iscsi_initiator.4 \ isp.4 \ ispfw.4 \ iwi.4 \ + iwifw.4 \ iwn.4 \ iwnfw.4 \ ixgb.4 \ Added: head/share/man/man4/ipwfw.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ipwfw.4 Thu Jan 14 22:21:43 2010 (r202317) @@ -0,0 +1,75 @@ +.\" Copyright (c) 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. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 14, 2010 +.Dt IPWFW 4 +.Os +.Sh NAME +.Nm ipwfw +.Nd "Firmware Module for Intel PRO/Wireless 2100 driver" +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ipwfw" +.Ed +.Pp +This will include three firmware images inside the kernel. +If you want to pick only the firmware image for the mode you want to operate +your network adapter in choose one of the following: +.Bd -ragged -offset indent +.Cd "device ipwbssfw" +.Cd "device ipwibssfw" +.Cd "device ipwmonitorfw" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ipw_bss_load="YES" +ipw_ibss_load="YES" +ipw_monitor_load="YES" +.Ed +.Sh DESCRIPTION +This module provides access to firmware sets for the +Intel PRO/Wireless 2100 series of IEEE 802.11 adapters. +It may be statically linked into the kernel, or loaded as a module. +.Pp +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/intel_ipw/LICENSE +must be agreed to by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.intel_ipw.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/intel_ipw/LICENSE" -compact +.It Pa /usr/share/doc/legal/intel_ipw/LICENSE +.Nm +firmware license +.El +.Sh SEE ALSO +.Xr ipw 4 , +.Xr firmware 9 Added: head/share/man/man4/iwifw.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/iwifw.4 Thu Jan 14 22:21:43 2010 (r202317) @@ -0,0 +1,75 @@ +.\" Copyright (c) 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. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 14, 2010 +.Dt IWIFW 4 +.Os +.Sh NAME +.Nm iwifw +.Nd "Firmware Module for Intel PRO/Wireless 2200BG/2225BG/2915ABG driver" +.Sh SYNOPSIS +To compile this module into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device iwifw" +.Ed +.Pp +This will include three firmware images inside the kernel. +If you want to pick only the firmware image for the mode you want to operate +your network adapter in choose one of the following: +.Bd -ragged -offset indent +.Cd "device iwibssfw" +.Cd "device iwiibssfw" +.Cd "device iwimonitorfw" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +iwi_bss_load="YES" +iwi_ibss_load="YES" +iwi_monitor_load="YES" +.Ed +.Sh DESCRIPTION +This module provides access to firmware sets for the +Intel PRO/Wireless 2200BG/2225BG/2915ABG series of IEEE 802.11 adapters. +It may be statically linked into the kernel, or loaded as a module. +.Pp +For the loaded firmware to be enabled for use the license at +.Pa /usr/share/doc/legal/intel_iwi/LICENSE +must be agreed to by adding the following line to +.Xr loader.conf 5 : +.Pp +.Dl "legal.intel_iwi.license_ack=1" +.Sh FILES +.Bl -tag -width ".Pa /usr/share/doc/legal/intel_iwi/LICENSE" -compact +.It Pa /usr/share/doc/legal/intel_iwi/LICENSE +.Nm +firmware license +.El +.Sh SEE ALSO +.Xr iwi 4 , +.Xr firmware 9 From owner-svn-src-head@FreeBSD.ORG Thu Jan 14 23:27:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9020E106568B; Thu, 14 Jan 2010 23:27:23 +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 7F6308FC19; Thu, 14 Jan 2010 23:27: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 o0ENRNrB078615; Thu, 14 Jan 2010 23:27:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ENRNF8078613; Thu, 14 Jan 2010 23:27:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001142327.o0ENRNF8078613@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 14 Jan 2010 23:27: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: r202324 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2010 23:27:23 -0000 Author: jilles Date: Thu Jan 14 23:27:23 2010 New Revision: 202324 URL: http://svn.freebsd.org/changeset/base/202324 Log: In 'make delete-old', use 'exec' to redirect an fd persistently. That is, write 'exec 3<&0' instead of '3<&0'. Due to an sh(1) bug fixed in r199953, the latter also persisted, provided that fd 3 was not open before. With newer sh or fd 3 open, it would not delete orphaned catpages. MFC after: 2 weeks Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 14 22:37:06 2010 (r202323) +++ head/Makefile.inc1 Thu Jan 14 23:27:23 2010 (r202324) @@ -1266,7 +1266,7 @@ delete-old-files: fi; \ done # Remove catpages without corresponding manpages. - @3<&0; \ + @exec 3<&0; \ find ${DESTDIR}/usr/share/man/cat* ! -type d | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ while read catpage; do \ From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 01:19:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150E11065676; Fri, 15 Jan 2010 01:19:59 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03EE58FC25; Fri, 15 Jan 2010 01:19: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 o0F1JwW3003508; Fri, 15 Jan 2010 01:19:58 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F1JwXq003506; Fri, 15 Jan 2010 01:19:58 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001150119.o0F1JwXq003506@svn.freebsd.org> From: David Xu Date: Fri, 15 Jan 2010 01:19: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: r202326 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 01:19:59 -0000 Author: davidxu Date: Fri Jan 15 01:19:58 2010 New Revision: 202326 URL: http://svn.freebsd.org/changeset/base/202326 Log: Also call sem_module_init in sem_close to initialize mutex with some attributes. Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Fri Jan 15 00:41:46 2010 (r202325) +++ head/lib/libc/gen/sem_new.c Fri Jan 15 01:19:58 2010 (r202326) @@ -255,6 +255,8 @@ _sem_close(sem_t *sem) return (-1); } + _pthread_once(&once, sem_module_init); + _pthread_mutex_lock(&sem_llock); LIST_FOREACH(ni, &sem_list, next) { if (sem == ni->sem) { From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 01:51:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8ECB1065670; Fri, 15 Jan 2010 01:51:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 271048FC13; Fri, 15 Jan 2010 01:51:04 +0000 (UTC) Received: from c220-239-227-214.carlnfd1.nsw.optusnet.com.au (c220-239-227-214.carlnfd1.nsw.optusnet.com.au [220.239.227.214]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0F1otJu012208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jan 2010 12:50:58 +1100 Date: Fri, 15 Jan 2010 12:50:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "M. Warner Losh" In-Reply-To: <20100114.135930.80200584442733547.imp@bsdimp.com> Message-ID: <20100115114822.O63406@delplex.bde.org> References: <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> <20100114.135930.80200584442733547.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: dougb@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rwatson@FreeBSD.org, freebsd-arch@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 01:51:05 -0000 On Thu, 14 Jan 2010, M. Warner Losh wrote: > In message: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> > "Robert N. M. Watson" writes: > : I agree. I see two kinds of users: > : > : - Desktop/server users who want their system to work without any > : special tuning or magic, and likely feel the comments they put in > : configuration files are important > : - Users who care a about a few hundred bytes of comments due to the > : nature of their special embedded hardware target environment "Stripping" comments has nothing to do with saving space. It is because it is technically difficult, and not implemented, to not strip them, except in the old limited code that just preserves the unprocessed top-level-only config file. > : As such, I see a reasonable "default" -- i.e., i386/amd64 GENERIC -- > : be to fully preserve the configuration and its comments. For the Your code to implement this is welcome :-). Even GENERIC is not quite complete, since it is missing the implicit include of DEFAULTS. OTOH, completing the config by merging with DEFAULTS, as I think the processed version must do, may give an unusable config by repeating things in DEFAULTS. The merge should probably have no processing at all, with include files concatenated and not replacing include directives, and DEFAULTS not included. > I think you are confusing two different things. > > The embedded folks omit this entirely. That's not the issue at all > here. Space is not the concern. We're putting it into GENERIC. > > Why are there two ways? Because there are two points in the process > one can squirt the data out of config. Let me explain (sorry for the > length, but it is necessary to clear up the confusion): > > The first way is "preserve the FILE the user used to create the > kernel" on the assumption that the FILE is what is important. No, it is on the non-assumption that the include directive didn't exist when the INCLUDE_CONFIG_FILE option was implemented. > This > will preserve the comments, but assumes that every single included > file from that file is recoverable in a trivial manner (eg, from cvs, > svn, p4, release ISOs, etc). This assumption is false, so this model became just broken when the include directive was implemented. History: INCLUDE_CONFIG_FILE option: 1996 include directive: 2001 processed output and -C: 2007 The -C option just preserves the breakage at its 2001-2007 level. > This model works well for the casual > user. Casual users presumably didn't notice the problem (until comments were lost in 2007) since they use GENERIC as is or with minor editing, and GENERIC doesn't use the include directive. Non-casual users don't notice since they know what is in their config files and don't use the INCLUDE_CONFIG_FILE option. (I use a combination of 3 levels of include files and 2 levels of symlinks to handle about 6 configurations times 2 arches times 4 FreeBSD versions.) > In this model, we're therefore able to preserve the kernel > config by copying the file, verbatim, into the kernel. I think this > is the model that best fits most user's needs, since they EITHER take > GENERIC and hack on it (in which case we preserve all that), OR they > include GENERIC and opt in/out of things based on that default. > Either way, this is the best way for users of releases to preserve the > data they need to recreate the kernel without losing data that's > important to the user, but not config (comments, spacing, order, etc). This may be enough, but it is a historical accident that config "works" this way. > The other way of preserving the config file is to say "I want > EVERYTHING applied, and I want a copy of that!" To get that, you have > to walk through config's internal data structures. By the time we get > to *THAT* point in the processing, comments are but a distant memory. Getting output from cpp has the same problems: - you can get fully preprocessed output fairly easily - cpp normally discards comments early, so you can't get them easily. I think gnu cpp now has an option to not discard them. - so you usually get only the fully preprocessed output - but sometimes you don't want so much preprocessing. None might be best. I don't know of any option in gnu cpp to get none. - the problem is harder in cpp than in config due to ifdefed out C code normally being completely removed, while config doesn't even have ifdef. Teaching cpp to preserve (only some) ifdefed out code, and presenting the results nicely (need to preserve the original ifdef structure) would be difficult. Except it might not be too difficult for either cpp or config to just concatenate all the files used. > Those are discarded early, along with the variations in spacing, blank > lines. By this point in the process, even the original ordering is > long gone, as is the origin of each of the remaining items in config's > internal data structures. However, the resulting config file that we > generate here is GUARANTEED to recreate the same kernel from the same > sources modulo any silly time/date/path stuff we encode. There's a I checked what happens with repeating DEFAULTS. Repeating it using "include" results in many warnings but the same generated files. > If space isn't an issue, we could save BOTH. That would be a bigger > patch, since we'd have to alter config to extract both kinds of data. > All I did was to move the -C option from an obscure src.conf variable > to be a full-fledged kernel option, leaving the rest of the > infrastructure intact. The advantage is that we cover both bases and > could export both views as a sysctl (right now we overload the two > different views with one sysctl). ISTR a long discussion about the -C option when it was implemented. Why didn't you complain back then? :-). I looked at my old mail about this. I wasn't involved with the initial discussion, but imp was :-). My mail was after the initial commit. I reported the following problems: - DEFAULTS wasn't processed - several ordering problems. Ones that reordered directives of the form: options FOO=bar nooptions FOO options FOO=baz made the generated file unusable. - many formatting problems in the generated file, making it a bad example. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 03:56:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE16B106566B; Fri, 15 Jan 2010 03:56:48 +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 BCBAC8FC0A; Fri, 15 Jan 2010 03:56: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 o0F3um2J039157; Fri, 15 Jan 2010 03:56:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F3um2s039155; Fri, 15 Jan 2010 03:56:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150356.o0F3um2s039155@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 03:56: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: r202339 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 03:56:48 -0000 Author: dougb Date: Fri Jan 15 03:56:48 2010 New Revision: 202339 URL: http://svn.freebsd.org/changeset/base/202339 Log: Now that we've officially arrived at FreeBSD 9, remove the IGNORE_MOTD compat shim as advertised. This change should not be MFC'ed. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:39:03 2010 (r202338) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:56:48 2010 (r202339) @@ -651,17 +651,14 @@ case "${RERUN}" in ;; esac - # Avoid comparing the motd if the user specifies it in .mergemasterrc - # Compatibility shim to be removed in FreeBSD 9.x case "${IGNORE_MOTD}" in - '') ;; - *) IGNORE_FILES="${IGNORE_FILES} /etc/motd" + *) echo '' echo "*** You have the IGNORE_MOTD option set in your mergemaster rc file." echo " This option is deprecated in favor of the IGNORE_FILES option." echo " Please update your rc file accordingly." echo '' - press_to_continue + exit 1 ;; esac From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 04:09:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8CA6106566C; Fri, 15 Jan 2010 04:09:22 +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 B7C7C8FC13; Fri, 15 Jan 2010 04:09: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 o0F49MxR041950; Fri, 15 Jan 2010 04:09:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F49MUY041948; Fri, 15 Jan 2010 04:09:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001150409.o0F49MUY041948@svn.freebsd.org> From: Doug Barton Date: Fri, 15 Jan 2010 04:09: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: r202340 - head/usr.sbin/mergemaster X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 04:09:22 -0000 Author: dougb Date: Fri Jan 15 04:09:22 2010 New Revision: 202340 URL: http://svn.freebsd.org/changeset/base/202340 Log: Oops, deleted one line too many. Add back the null case for IGNORE_MOTD Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 03:56:48 2010 (r202339) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri Jan 15 04:09:22 2010 (r202340) @@ -652,6 +652,7 @@ case "${RERUN}" in esac case "${IGNORE_MOTD}" in + '') ;; *) echo '' echo "*** You have the IGNORE_MOTD option set in your mergemaster rc file." From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 07:05:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893B7106566B; Fri, 15 Jan 2010 07:05:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 785178FC1E; Fri, 15 Jan 2010 07:05: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 o0F750Rw080814; Fri, 15 Jan 2010 07:05:00 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F750Oh080811; Fri, 15 Jan 2010 07:05:00 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001150705.o0F750Oh080811@svn.freebsd.org> From: Brooks Davis Date: Fri, 15 Jan 2010 07:05: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: r202341 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 07:05:00 -0000 Author: brooks Date: Fri Jan 15 07:05:00 2010 New Revision: 202341 URL: http://svn.freebsd.org/changeset/base/202341 Log: Since all other comparisons involving ngroups_max use "ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent "> ngroups_max" to reduce confusion. Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_uid16.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jan 15 04:09:22 2010 (r202340) +++ head/sys/compat/linux/linux_misc.c Fri Jan 15 07:05:00 2010 (r202341) @@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struc struct proc *p; ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp > ngroups_max) + if (ngrp < 0 || ngrp >= ngroups_max + 1) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); Modified: head/sys/compat/linux/linux_uid16.c ============================================================================== --- head/sys/compat/linux/linux_uid16.c Fri Jan 15 04:09:22 2010 (r202340) +++ head/sys/compat/linux/linux_uid16.c Fri Jan 15 07:05:00 2010 (r202341) @@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, str #endif ngrp = args->gidsetsize; - if (ngrp < 0 || ngrp > ngroups_max) + if (ngrp < 0 || ngrp >= ngroups_max + 1) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 07:18:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B596A106566C; Fri, 15 Jan 2010 07:18:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B9308FC19; Fri, 15 Jan 2010 07:18: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 o0F7IkXn084384; Fri, 15 Jan 2010 07:18:46 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0F7IkTM084381; Fri, 15 Jan 2010 07:18:46 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001150718.o0F7IkTM084381@svn.freebsd.org> From: Brooks Davis Date: Fri, 15 Jan 2010 07:18: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: r202342 - in head/sys: i386/ibcs2 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 07:18:46 -0000 Author: brooks Date: Fri Jan 15 07:18:46 2010 New Revision: 202342 URL: http://svn.freebsd.org/changeset/base/202342 Log: Only allocate the space we need before calling kern_getgroups instead of allocating what ever the user asks for up to "ngroups_max + 1". On systems with large values of kern.ngroups this will be more efficient. The now redundant check that the array is large enough in kern_getgroups() is deliberate to allow this change to be merged to stable/8 without breaking potential third party consumers of the API. Reported by: bde MFC after: 28 days Modified: head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/kern_prot.c Modified: head/sys/i386/ibcs2/ibcs2_misc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_misc.c Fri Jan 15 07:05:00 2010 (r202341) +++ head/sys/i386/ibcs2/ibcs2_misc.c Fri Jan 15 07:18:46 2010 (r202342) @@ -663,9 +663,13 @@ ibcs2_getgroups(td, uap) u_int i, ngrp; int error; - if (uap->gidsetsize < 0) - return (EINVAL); - ngrp = MIN(uap->gidsetsize, ngroups_max + 1); + if (uap->gidsetsize < td->td_ucred->cr_ngroups) { + if (uap->gidsetsize == 0) + ngrp = 0; + else + return (EINVAL); + } else + ngrp = td->td_ucred->cr_ngroups; gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK); error = kern_getgroups(td, &ngrp, gp); if (error) Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Jan 15 07:05:00 2010 (r202341) +++ head/sys/kern/kern_prot.c Fri Jan 15 07:18:46 2010 (r202342) @@ -283,7 +283,13 @@ getgroups(struct thread *td, register st u_int ngrp; int error; - ngrp = MIN(uap->gidsetsize, ngroups_max + 1); + if (uap->gidsetsize < td->td_ucred->cr_ngroups) { + if (uap->gidsetsize == 0) + ngrp = 0; + else + return (EINVAL); + } else + ngrp = td->td_ucred->cr_ngroups; groups = malloc(ngrp * sizeof(*groups), M_TEMP, M_WAITOK); error = kern_getgroups(td, &ngrp, groups); if (error) From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 08:59:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32D6F106566B; Fri, 15 Jan 2010 08:59:04 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id A65D48FC12; Fri, 15 Jan 2010 08:59:03 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c122-106-232-83.belrs3.nsw.optusnet.com.au [122.106.232.83]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o0F8x0DF007625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Jan 2010 19:59:01 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id o0F8wvg3002662; Fri, 15 Jan 2010 19:58:57 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id o0F8wvsT002661; Fri, 15 Jan 2010 19:58:57 +1100 (EST) (envelope-from peter) Date: Fri, 15 Jan 2010 19:58:57 +1100 From: Peter Jeremy To: "Robert N. M. Watson" Message-ID: <20100115085856.GA2556@server.vk2pj.dyndns.org> References: <4B4E1586.7090102@FreeBSD.org> <20100114.102142.328914705071816274.imp@bsdimp.com> <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 08:59:04 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-Jan-14 20:12:24 +0000, "Robert N. M. Watson" = wrote: >- Desktop/server users who want their system to work without any > special tuning or magic, and likely feel the comments they put in > configuration files are important As far as I'm concerned, the most critical bit of my kernel config file is the $Header...$ comment - which lets me extract the remainder of the file from my CVS repository. I don't currently use includes (because most of my config files have roots pre-dating the include directive). I find it a PITA that INCLUDE_CONFIG_FILE _doesn't_ include comments (or at least my $Header$ line) by default. IMO, it would be useful to have an "include this literal string in the kernel" config directive. This would allow config file version control information to be embedded without needing the comments. And that would resolve the issue of embedding fully expanded details of all included files without the hassle of keeping the comments around. --=20 Peter Jeremy --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAktQLlAACgkQ/opHv/APuIdnTACbBsmd1V4Uc0RiXeRtoShXcNj+ NNkAoKNtcWOc91kvt/28hBQRiuaaVO9T =8ot2 -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT-- From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 12:39:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F1B3106566B; Fri, 15 Jan 2010 12:39:49 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F168B8FC1B; Fri, 15 Jan 2010 12:39: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 o0FCdmU2073796; Fri, 15 Jan 2010 12:39:48 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCdmfA073794; Fri, 15 Jan 2010 12:39:48 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201001151239.o0FCdmfA073794@svn.freebsd.org> From: Olivier Houchard Date: Fri, 15 Jan 2010 12:39: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: r202353 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:39:49 -0000 Author: cognet Date: Fri Jan 15 12:39:48 2010 New Revision: 202353 URL: http://svn.freebsd.org/changeset/base/202353 Log: Do not free the dmamap if it is still busy. Submitted by: Mark Tinguely MFC after: 3 days Modified: head/sys/arm/arm/busdma_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c ============================================================================== --- head/sys/arm/arm/busdma_machdep.c Fri Jan 15 12:27:46 2010 (r202352) +++ head/sys/arm/arm/busdma_machdep.c Fri Jan 15 12:39:48 2010 (r202353) @@ -555,12 +555,12 @@ int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - _busdma_free_dmamap(map); if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); return (EBUSY); } + _busdma_free_dmamap(map); if (dmat->bounce_zone) dmat->bounce_zone->map_count--; dmat->map_count--; From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 12:42:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CAA0106566B; Fri, 15 Jan 2010 12:42:36 +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 31A238FC1A; Fri, 15 Jan 2010 12:42: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 o0FCgagN074440; Fri, 15 Jan 2010 12:42:36 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FCga2p074439; Fri, 15 Jan 2010 12:42:36 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151242.o0FCga2p074439@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 12:42: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: r202354 - head/contrib/groff X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 12:42:36 -0000 Author: ru Date: Fri Jan 15 12:42:35 2010 New Revision: 202354 URL: http://svn.freebsd.org/changeset/base/202354 Log: Bootstrap merge history. Modified: Directory Properties: head/contrib/groff/ (props changed) From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 13:59:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75B03106566C; Fri, 15 Jan 2010 13:59:51 +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 60BCC8FC15; Fri, 15 Jan 2010 13:59: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 o0FDxpDq091868; Fri, 15 Jan 2010 13:59:51 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FDxpfn091859; Fri, 15 Jan 2010 13:59:51 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151359.o0FDxpfn091859@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 13:59: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: r202358 - in head: contrib/groff/font/devutf8 contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 13:59:51 -0000 Author: ru Date: Fri Jan 15 13:59:50 2010 New Revision: 202358 URL: http://svn.freebsd.org/changeset/base/202358 Log: Pull up vendor changes. The following local changes made obsolete: - Addition of several FreeBSD versions. - r192561 that attempted to fix UTF-8 issues. Modified: head/contrib/groff/font/devutf8/R.proto head/contrib/groff/tmac/an-old.tmac head/contrib/groff/tmac/doc-common head/contrib/groff/tmac/doc-old.tmac head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/doc.tmac head/contrib/groff/tmac/groff_mdoc.man head/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: head/contrib/groff/ (props changed) Modified: head/contrib/groff/font/devutf8/R.proto ============================================================================== --- head/contrib/groff/font/devutf8/R.proto Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/font/devutf8/R.proto Fri Jan 15 13:59:50 2010 (r202358) @@ -726,7 +726,7 @@ st 24 0 0x220B product 24 0 0x220F coproduct 24 0 0x2210 sum 24 0 0x2211 -\- 24 0 0x002D +\- 24 0 0x2212 mi " -+ 24 0 0x2213 ** 24 0 0x2217 Modified: head/contrib/groff/tmac/an-old.tmac ============================================================================== --- head/contrib/groff/tmac/an-old.tmac Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/an-old.tmac Fri Jan 15 13:59:50 2010 (r202358) @@ -630,6 +630,18 @@ . hy \n[HY] .\} . +.\" For UTF-8, map some characters conservatively for the sake +.\" of easy cut and paste. +. +.if '\*[.T]'utf8' \{\ +. rchar \- - ' ` +. +. char \- \N'45' +. char - \N'45' +. char ' \N'39' +. char ` \N'96' +.\} +. .\" Load local modifications. .mso man.local . Modified: head/contrib/groff/tmac/doc-common ============================================================================== --- head/contrib/groff/tmac/doc-common Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/doc-common Fri Jan 15 13:59:50 2010 (r202358) @@ -219,6 +219,7 @@ .\" NS doc-document-title .\" NS doc-section .\" NS doc-volume +.\" NS doc-command-name .\" NS .\" NS local variables: .\" NS doc-volume-as-XXX @@ -319,6 +320,7 @@ . ds doc-document-title UNTITLED . ds doc-volume LOCAL . ds doc-section Null +. ds doc-command-name . . if !"\$1"" \ . ds doc-document-title "\$1 @@ -357,6 +359,12 @@ . if !"\$3"" \ . if "\*[doc-volume]"LOCAL" \ . ds doc-volume \$3 +. +. if !\n[cR] \ +. if \n[nl] \{\ + . doc-setup-header +. bp +. \} .. . . @@ -379,6 +387,7 @@ .\" NS .\" NS modifies: .\" NS doc-operating-system +.\" NS doc-command-name .\" NS .\" NS local variables: .\" NS doc-operating-system-XXX-XXX @@ -435,9 +444,14 @@ .ds doc-operating-system-NetBSD-2.0 2.0 .ds doc-operating-system-NetBSD-2.0.1 2.0.1 .ds doc-operating-system-NetBSD-2.0.2 2.0.2 +.ds doc-operating-system-NetBSD-2.0.3 2.0.3 .ds doc-operating-system-NetBSD-2.1 2.1 .ds doc-operating-system-NetBSD-3.0 3.0 +.ds doc-operating-system-NetBSD-3.0.1 3.0.1 +.ds doc-operating-system-NetBSD-3.0.2 3.0.2 +.ds doc-operating-system-NetBSD-3.1 3.1 .ds doc-operating-system-NetBSD-4.0 4.0 +.ds doc-operating-system-NetBSD-4.0.1 4.0.1 . .ds doc-operating-system-FreeBSD-1.0 1.0 .ds doc-operating-system-FreeBSD-1.1 1.1 @@ -486,23 +500,48 @@ .ds doc-operating-system-FreeBSD-6.0 6.0 .ds doc-operating-system-FreeBSD-6.1 6.1 .ds doc-operating-system-FreeBSD-6.2 6.2 +.ds doc-operating-system-FreeBSD-6.3 6.3 +.ds doc-operating-system-FreeBSD-6.4 6.4 .ds doc-operating-system-FreeBSD-7.0 7.0 +.ds doc-operating-system-FreeBSD-7.1 7.1 . -.ds doc-operating-system-Darwin-8.0.0 8.0.0 -.ds doc-operating-system-Darwin-8.1.0 8.1.0 -.ds doc-operating-system-Darwin-8.2.0 8.2.0 -.ds doc-operating-system-Darwin-8.3.0 8.3.0 -.ds doc-operating-system-Darwin-8.4.0 8.4.0 -.ds doc-operating-system-Darwin-8.5.0 8.5.0 -. -.ds doc-operating-system-DragonFly-1.0 1.0 -.ds doc-operating-system-DragonFly-1.1 1.1 -.ds doc-operating-system-DragonFly-1.2 1.2 -.ds doc-operating-system-DragonFly-1.3 1.3 -.ds doc-operating-system-DragonFly-1.4 1.4 -.ds doc-operating-system-DragonFly-1.5 1.5 +.ds doc-operating-system-Darwin-8.0.0 8.0.0 +.ds doc-operating-system-Darwin-8.1.0 8.1.0 +.ds doc-operating-system-Darwin-8.2.0 8.2.0 +.ds doc-operating-system-Darwin-8.3.0 8.3.0 +.ds doc-operating-system-Darwin-8.4.0 8.4.0 +.ds doc-operating-system-Darwin-8.5.0 8.5.0 +.ds doc-operating-system-Darwin-8.6.0 8.6.0 +.ds doc-operating-system-Darwin-8.7.0 8.7.0 +.ds doc-operating-system-Darwin-8.8.0 8.8.0 +.ds doc-operating-system-Darwin-8.9.0 8.9.0 +.ds doc-operating-system-Darwin-8.10.0 8.10.0 +.ds doc-operating-system-Darwin-8.11.0 8.11.0 +.ds doc-operating-system-Darwin-9.0.0 9.0.0 +.ds doc-operating-system-Darwin-9.1.0 9.1.0 +.ds doc-operating-system-Darwin-9.2.0 9.2.0 +.ds doc-operating-system-Darwin-9.3.0 9.3.0 +.ds doc-operating-system-Darwin-9.4.0 9.4.0 +.ds doc-operating-system-Darwin-9.5.0 9.5.0 +.ds doc-operating-system-Darwin-9.6.0 9.6.0 +. +.ds doc-operating-system-DragonFly-1.0 1.0 +.ds doc-operating-system-DragonFly-1.1 1.1 +.ds doc-operating-system-DragonFly-1.2 1.2 +.ds doc-operating-system-DragonFly-1.3 1.3 +.ds doc-operating-system-DragonFly-1.4 1.4 +.ds doc-operating-system-DragonFly-1.5 1.5 +.ds doc-operating-system-DragonFly-1.6 1.6 +.ds doc-operating-system-DragonFly-1.8 1.8 +.ds doc-operating-system-DragonFly-1.8.1 1.8.1 +.ds doc-operating-system-DragonFly-1.10 1.10 +.ds doc-operating-system-DragonFly-1.12 1.12 +.ds doc-operating-system-DragonFly-1.12.2 1.12.2 +.ds doc-operating-system-DragonFly-2.0 2.0 . .de Os +. ds doc-command-name +. . ie "\$1"" \ . ds doc-operating-system "\*[doc-default-operating-system] . el \{ .ie "\$1"ATT" \{\ @@ -563,6 +602,7 @@ .\" NS .\" NS modifies: .\" NS doc-date-string +.\" NS doc-command-name .\" NS .\" NS local variables: .\" NS doc-date-XXX @@ -583,6 +623,8 @@ .ds doc-date-12 December . .de Dd +. ds doc-command-name +. . ie \n[.$] \{\ . ie (\n[.$] == 3) \ . ds doc-date-string \$1\~\$2 \$3 Modified: head/contrib/groff/tmac/doc-old.tmac ============================================================================== --- head/contrib/groff/tmac/doc-old.tmac Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/doc-old.tmac Fri Jan 15 13:59:50 2010 (r202358) @@ -40,7 +40,7 @@ .ds aD \fI .\" Argument Reference Style .ds aR \f(CO -.\" Interactive Comand Modifier (flag) +.\" Interactive Command Modifier (flag) .ds cM \f(CB .\" Emphasis (in the English sense - usually italics) .ds eM \fI Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/doc-syms Fri Jan 15 13:59:50 2010 (r202358) @@ -651,6 +651,8 @@ .\" X/Open .ds doc-str-St--susv2 Version\~2 of the Single \*[doc-Tn-font-size]UNIX\*[doc-str-St] Specification .as doc-str-St--susv2 " (\*[Lq]\*[doc-Tn-font-size]SUSv2\*[doc-str-St]\*[Rq]) +.ds doc-str-St--susv3 Version\~3 of the Single \*[doc-Tn-font-size]UNIX\*[doc-str-St] Specification +.as doc-str-St--susv3 " (\*[Lq]\*[doc-Tn-font-size]SUSv3\*[doc-str-St]\*[Rq]) .ds doc-str-St--svid4 System\~V Interface Definition, Fourth Edition .as doc-str-St--svid4 " (\*[Lq]\*[doc-Tn-font-size]SVID\*[doc-str-St]\^4\*[Rq]) .ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] System Interface Definitions Issue\~5 Modified: head/contrib/groff/tmac/doc.tmac ============================================================================== --- head/contrib/groff/tmac/doc.tmac Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/doc.tmac Fri Jan 15 13:59:50 2010 (r202358) @@ -356,10 +356,10 @@ . ds doc-macro-name Fl . doc-parse-args \$@ . -. if !\n[.$] \{\ -. \" no arguments +. \" no arguments +. if !\n[.$] \ . nop \|\-\|\f[]\s[0] -. \}\} +. \} . . if !\n[doc-arg-limit] \ . return @@ -481,8 +481,8 @@ . el \{\ . nr doc-reg-dpr \n[doc-arg-ptr] . +. \" the `\%' prevents hyphenation on a dash (`-') . ie (\n[doc-reg-dpr1] == 2) \ -. \" the `\%' prevents hyphenation on a dash (`-') . nop \%\*[doc-str-dpr]\&\c . el \{\ . \" punctuation character @@ -595,10 +595,10 @@ . ds doc-macro-name Ar . doc-parse-args \$@ . -. if !\n[.$] \{\ -. \" no argument +. \" no argument +. if !\n[.$] \ . nop \)\*[doc-str-Ar-default]\&\f[]\s[0] -. \}\} +. \} . . if !\n[doc-arg-limit] \ . return @@ -1034,10 +1034,10 @@ . ds doc-macro-name Pa . doc-parse-args \$@ . -. if !\n[.$] \{\ -. \" default value +. \" default value +. if !\n[.$] \ . nop \*[doc-Pa-font]~\f[]\s[0] -. \}\} +. \} . . if !\n[doc-arg-limit] \ . return @@ -6425,6 +6425,19 @@ .blm doc-empty-line . . +.\" For UTF-8, map some characters conservatively for the sake +.\" of easy cut and paste. +. +.if '\*[.T]'utf8' \{\ +. rchar \- - ' ` +. +. char \- \N'45' +. char - \N'45' +. char ' \N'39' +. char ` \N'96' +.\} +. +. .ec . . Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Fri Jan 15 13:48:29 2010 (r202357) +++ head/contrib/groff/tmac/groff_mdoc.man Fri Jan 15 13:59:50 2010 (r202358) @@ -864,16 +864,18 @@ the release ID. .It NetBSD 0.8, 0.8a, 0.9, 0.9a, 1.0, 1.0a, 1.1, 1.2, 1.2a, 1.2b, 1.2c, 1.2d, 1.2e, 1.3, 1.3a, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1, -1.6.2, 2.0, 2.0.1, 2.0.2, 2.1, 3.0 +1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.1, 4.0, +4.0.1 .It FreeBSD 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1, 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1, -5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 7.0 +5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1 .It DragonFly -1.0, 1.1, 1.2, 1.3, 1.4, 1.5 +1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0 .It Darwin -8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0 +8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, +8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0 .El .Ed .Pp @@ -1995,6 +1997,8 @@ X/Open .Pp .It Li \-susv2 .St -susv2 +.It Li \-susv3 +.St -susv3 .It Li \-svid4 .St -svid4 .It Li \-xbd5 @@ -4086,11 +4090,12 @@ Definitions used for all other devices. .It Pa mdoc.local Local additions and customizations. .It Pa andoc.tmac -This file checks whether the +Use this file if you don't know whether the .Nm \-mdoc or the .Nm \-man package should be used. +Multiple man pages (in either format) can be handled. .El . . Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jan 15 13:48:29 2010 (r202357) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jan 15 13:59:50 2010 (r202358) @@ -69,9 +69,6 @@ .ds doc-default-operating-system FreeBSD\~9.0 . .\" FreeBSD releases not found in doc-common -.ds doc-operating-system-FreeBSD-6.3 6.3 -.ds doc-operating-system-FreeBSD-6.4 6.4 -.ds doc-operating-system-FreeBSD-7.1 7.1 .ds doc-operating-system-FreeBSD-7.2 7.2 .ds doc-operating-system-FreeBSD-7.3 7.3 .ds doc-operating-system-FreeBSD-8.0 8.0 From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 14:05:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E6E5106568F; Fri, 15 Jan 2010 14:05:07 +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 3C0F58FC08; Fri, 15 Jan 2010 14:05: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 o0FE5706093080; Fri, 15 Jan 2010 14:05:07 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FE57ap093077; Fri, 15 Jan 2010 14:05:07 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151405.o0FE57ap093077@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 14:05: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: r202359 - in head: contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:05:07 -0000 Author: ru Date: Fri Jan 15 14:05:06 2010 New Revision: 202359 URL: http://svn.freebsd.org/changeset/base/202359 Log: Moved the doc-str-Lb-libulog string definition to where it belongs. Modified: head/contrib/groff/tmac/doc-syms head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Fri Jan 15 13:59:50 2010 (r202358) +++ head/contrib/groff/tmac/doc-syms Fri Jan 15 14:05:06 2010 (r202359) @@ -779,7 +779,6 @@ .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) .ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap) .ds doc-str-Lb-libusbhid USB Human Interface Devices Library (libusbhid, \-lusbhid) -.ds doc-str-Lb-libulog User Login Record Library (libulog, \-lulog) .ds doc-str-Lb-libutil System Utilities Library (libutil, \-lutil) .ds doc-str-Lb-libx86_64 x86_64 Architecture Library (libx86_64, \-lx86_64) .ds doc-str-Lb-libz Compression Library (libz, \-lz) Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jan 15 13:59:50 2010 (r202358) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Fri Jan 15 14:05:06 2010 (r202359) @@ -60,6 +60,7 @@ .ds doc-str-Lb-libthr 1:1 Threading Library (libthr, \-lthr) .ds doc-str-Lb-libufs UFS File System Access Library (libufs, \-lufs) .ds doc-str-Lb-libugidfw File System Firewall Interface Library (libugidfw, \-lugidfw) +.ds doc-str-Lb-libulog User Login Record Library (libulog, \-lulog) .ds doc-str-Lb-libvgl Video Graphics Library (libvgl, \-lvgl) . .\" FreeBSD architectures not found in doc-common From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 14:58:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BCBB1065679; Fri, 15 Jan 2010 14:58:20 +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 390218FC22; Fri, 15 Jan 2010 14: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 o0FEwKje005153; Fri, 15 Jan 2010 14:58:20 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FEwKsO005151; Fri, 15 Jan 2010 14:58:20 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001151458.o0FEwKsO005151@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 15 Jan 2010 14: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: r202364 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 14:58:20 -0000 Author: netchild Date: Fri Jan 15 14:58:19 2010 New Revision: 202364 URL: http://svn.freebsd.org/changeset/base/202364 Log: This is v4l support for the linuxulator. This allows to access FreeBSD native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri Jan 15 14:47:26 2010 (r202363) +++ head/sys/compat/linux/linux_ioctl.c Fri Jan 15 14:58:19 2010 (r202364) @@ -2624,7 +2624,6 @@ bsd_to_linux_v4l_tuner(struct video_tune return (0); } -#if 0 static int linux_to_bsd_v4l_clip(struct l_video_clip *lvc, struct video_clip *vc) { @@ -2635,7 +2634,6 @@ linux_to_bsd_v4l_clip(struct l_video_cli vc->next = PTRIN(lvc->next); /* possible pointer size conversion */ return (0); } -#endif static int linux_to_bsd_v4l_window(struct l_video_window *lvw, struct video_window *vw) @@ -2696,29 +2694,21 @@ linux_to_bsd_v4l_code(struct l_video_cod return (0); } -#if 0 static int -linux_v4l_cliplist_copy(struct l_video_window *lvw, struct video_window *vw) +linux_v4l_clip_copy(void *lvc, struct video_clip **ppvc) { + int error; struct video_clip vclip; struct l_video_clip l_vclip; - struct video_clip **ppvc; - struct l_video_clip *plvc; - int error; - ppvc = &(vw->clips); - for (plvc = (struct l_video_clip *) PTRIN(lvw->clips); - plvc != NULL; - plvc = (struct l_video_clip *) PTRIN(plvc->next)) { - error = copyin((void *) plvc, &l_vclip, sizeof(l_vclip)); - if (error) return (error); - linux_to_bsd_v4l_clip(&l_vclip, &vclip); - /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */ - if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL) - return (ENOMEM); /* XXX: linux has no ENOMEM here */ - memcpy(&vclip, *ppvc, sizeof(vclip)); - ppvc = &((*ppvc)->next); - } + error = copyin(lvc, &l_vclip, sizeof(l_vclip)); + if (error) return (error); + linux_to_bsd_v4l_clip(&l_vclip, &vclip); + /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */ + if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL) + return (ENOMEM); /* XXX: linux has no ENOMEM here */ + memcpy(&vclip, *ppvc, sizeof(vclip)); + (*ppvc)->next = NULL; return (0); } @@ -2734,7 +2724,71 @@ linux_v4l_cliplist_free(struct video_win } return (0); } -#endif + +static int +linux_v4l_cliplist_copy(struct l_video_window *lvw, struct video_window *vw) +{ + int error; + int clipcount; + void *plvc; + struct video_clip **ppvc; + + /* + * XXX: The cliplist is used to pass in a list of clipping + * rectangles or, if clipcount == VIDEO_CLIP_BITMAP, a + * clipping bitmap. Some Linux apps, however, appear to + * leave cliplist and clips uninitialized. In any case, + * the cliplist is not used by pwc(4), at the time of + * writing, FreeBSD's only V4L driver. When a driver + * that uses the cliplist is developed, this code may + * need re-examiniation. + */ + error = 0; + clipcount = vw->clipcount; + if (clipcount == VIDEO_CLIP_BITMAP) { + /* + * In this case, the pointer (clips) is overloaded + * to be a "void *" to a bitmap, therefore there + * is no struct video_clip to copy now. + */ + } else if (clipcount > 0 && clipcount <= 16384) { + /* + * Clips points to list of clip rectangles, so + * copy the list. + * + * XXX: Upper limit of 16384 was used here to try to + * avoid cases when clipcount and clips pointer + * are uninitialized and therefore have high random + * values, as is the case in the Linux Skype + * application. The value 16384 was chosen as that + * is what is used in the Linux stradis(4) MPEG + * decoder driver, the only place we found an + * example of cliplist use. + */ + plvc = PTRIN(lvw->clips); + ppvc = &(vw->clips); + while (clipcount-- > 0) { + if (plvc == 0) + error = EFAULT; + if (!error) + error = linux_v4l_clip_copy(plvc, ppvc); + if (error) { + linux_v4l_cliplist_free(vw); + break; + } + ppvc = &((*ppvc)->next); + plvc = PTRIN(((struct l_video_clip *) plvc)->next); + } + } else { + /* + * clipcount == 0 or negative (but not VIDEO_CLIP_BITMAP) + * Force cliplist to null. + */ + vw->clipcount = 0; + vw->clips = NULL; + } + return (error); +} static int linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) @@ -2805,21 +2859,14 @@ linux_ioctl_v4l(struct thread *td, struc return (error); } linux_to_bsd_v4l_window(&l_vwin, &vwin); -#if 0 - /* - * XXX: some Linux apps call SWIN but do not store valid - * values in clipcount or in the clips pointer. Until - * we have someone calling to support this, the code - * to handle the list of video_clip structures is removed. - */ error = linux_v4l_cliplist_copy(&l_vwin, &vwin); -#endif - if (!error) - error = fo_ioctl(fp, VIDIOCSWIN, &vwin, td->td_ucred, td); + if (error) { + fdrop(fp, td); + return (error); + } + error = fo_ioctl(fp, VIDIOCSWIN, &vwin, td->td_ucred, td); fdrop(fp, td); -#if 0 linux_v4l_cliplist_free(&vwin); -#endif return (error); case LINUX_VIDIOCGFBUF: From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 15:10:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 712EB106566B; Fri, 15 Jan 2010 15:10:29 +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 5EABC8FC24; Fri, 15 Jan 2010 15:10: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 o0FFATED007908; Fri, 15 Jan 2010 15:10:29 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFATAW007904; Fri, 15 Jan 2010 15:10:29 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151510.o0FFATAW007904@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 15:10: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: r202366 - head/contrib/groff/tmac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:10:29 -0000 Author: ru Date: Fri Jan 15 15:10:29 2010 New Revision: 202366 URL: http://svn.freebsd.org/changeset/base/202366 Log: Pull up vendor changes. Modified: head/contrib/groff/tmac/doc-common head/contrib/groff/tmac/doc.tmac head/contrib/groff/tmac/groff_mdoc.man Directory Properties: head/contrib/groff/ (props changed) Modified: head/contrib/groff/tmac/doc-common ============================================================================== --- head/contrib/groff/tmac/doc-common Fri Jan 15 15:07:32 2010 (r202365) +++ head/contrib/groff/tmac/doc-common Fri Jan 15 15:10:29 2010 (r202366) @@ -46,6 +46,7 @@ .nr %Q 1 .nr %R 1 .nr %T 1 +.nr %U 1 .nr %V 1 .nr Ac 3 .nr Ad 12n @@ -77,6 +78,7 @@ .nr Dq 12n .nr Ds 6n\" many manpages still use this as a -width value .nr Dv 12n +.nr Dx 1 .nr Ec 3 .nr Ef 8n\" ? .nr Ek 8n\" ? @@ -1170,6 +1172,8 @@ . tm doc-reference-title-count == \n[doc-reference-title-count] . tm doc-reference-title-name == `\*[doc-reference-title-name]' . tm doc-reference-title-name-for-book == `\*[doc-reference-title-name-for-book]' +. tm doc-url-count == \n[doc-url-count] +. tm doc-url-name == `\*[doc-url-name]' . tm doc-volume-count == \n[doc-volume-count] . tm doc-volume-name == `\*[doc-volume-name]' . tm doc-have-author == \n[doc-have-author] Modified: head/contrib/groff/tmac/doc.tmac ============================================================================== --- head/contrib/groff/tmac/doc.tmac Fri Jan 15 15:07:32 2010 (r202365) +++ head/contrib/groff/tmac/doc.tmac Fri Jan 15 15:10:29 2010 (r202366) @@ -3430,6 +3430,8 @@ . nr doc-reference-title-count-saved \n[doc-reference-title-count] . ds doc-reference-title-name-saved "\*[doc-reference-title-name] . ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book] +. nr doc-url-count-saved \n[doc-url-count] +. ds doc-url-name-saved "\*[doc-url-name] . nr doc-volume-count-saved \n[doc-volume-count] . ds doc-volume-name-saved "\*[doc-volume-name] . nr doc-have-author-saved \n[doc-have-author] @@ -3570,6 +3572,8 @@ . nr doc-reference-title-count \n[doc-reference-title-count-saved] . ds doc-reference-title-name "\*[doc-reference-title-name-saved] . ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved] +. nr doc-url-count \n[doc-url-count-saved] +. ds doc-url-name "\*[doc-url-name-saved] . nr doc-volume-count \n[doc-volume-count-saved] . ds doc-volume-name "\*[doc-volume-name-saved] . nr doc-have-author \n[doc-have-author-saved] @@ -5194,6 +5198,8 @@ .\" NS doc-reference-title-name-for-book .\" NS doc-report-count .\" NS doc-report-name +.\" NS doc-url-count +.\" NS doc-url-name .\" NS doc-volume-count .\" NS doc-volume-name . @@ -5208,6 +5214,7 @@ . nr doc-corporate-count 0 . nr doc-report-count 0 . nr doc-reference-title-count 0 +. nr doc-url-count 0 . nr doc-volume-count 0 . nr doc-date-count 0 . nr doc-page-number-count 0 @@ -5222,6 +5229,7 @@ . ds doc-report-name . ds doc-reference-title-name . ds doc-reference-title-name-for-book +. ds doc-url-name . ds doc-volume-name . ds doc-date . ds doc-page-number-string @@ -5316,6 +5324,13 @@ . doc-finish-reference \n[doc-volume-count] . \} . +. if \n[doc-url-count] \{\ +. unformat doc-url-name +. chop doc-url-name +. nop \*[doc-url-name]\c +. doc-finish-reference \n[doc-url-count] +. \} +. . if \n[doc-page-number-count] \{\ . unformat doc-page-number-string . chop doc-page-number-string @@ -6019,6 +6034,18 @@ .. . . +.\" NS doc-url-count global register +.\" NS counter of hypertext references +. +.nr doc-url-count 0 +. +. +.\" NS doc-url-name global box +.\" NS string of collected hypertext references +. +.ds doc-url-name +. +. .\" NS doc-volume-count global register .\" NS counter of reference title references . @@ -6031,6 +6058,48 @@ .ds doc-volume-name . . +.\" NS %U user macro +.\" NS hypertext reference +.\" NS +.\" NS modifies: +.\" NS doc-arg-ptr +.\" NS doc-curr-font +.\" NS doc-curr-size +.\" NS doc-macro-name +.\" NS doc-reference-count +.\" NS doc-url-count +.\" NS +.\" NS local variables: +.\" NS doc-env-%U +.\" NS +.\" NS width register `%U' set in doc-common +. +.de %U +. if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\ +. tm Usage: .%U URL ... (#\n[.c]) +. return +. \} +. +. nr doc-url-count +1 +. nr doc-reference-count +1 +. +. ds doc-macro-name %U +. doc-parse-args \$@ +. +. nr doc-arg-ptr +1 +. nr doc-curr-font \n[.f] +. nr doc-curr-size \n[.ps] +. +. \" append to reference box +. boxa doc-url-name +. ev doc-env-%U +. evc 0 +. in 0 +. nf +. doc-do-references +.. +. +. .\" NS %V user macro .\" NS reference volume .\" NS @@ -6039,7 +6108,7 @@ .\" NS doc-curr-font .\" NS doc-curr-size .\" NS doc-macro-name -.\" NS doc-reference-title-count +.\" NS doc-reference-count .\" NS doc-volume-count .\" NS .\" NS local variables: @@ -6425,6 +6494,9 @@ .blm doc-empty-line . . +.ec +. +. .\" For UTF-8, map some characters conservatively for the sake .\" of easy cut and paste. . @@ -6438,9 +6510,6 @@ .\} . . -.ec -. -. .\" load local modifications .mso mdoc.local . Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Fri Jan 15 15:07:32 2010 (r202365) +++ head/contrib/groff/tmac/groff_mdoc.man Fri Jan 15 15:10:29 2010 (r202366) @@ -2556,6 +2556,8 @@ Corporate or foreign author. Report name. .It Li .%T Title of article. +.It Li .%U +Optional hypertext reference. .It Li .%V Volume. .El From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 15:38:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A092106568D; Fri, 15 Jan 2010 15:38:32 +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 F28548FC26; Fri, 15 Jan 2010 15: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 o0FFcVSh014583; Fri, 15 Jan 2010 15:38:31 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FFcVOA014581; Fri, 15 Jan 2010 15:38:31 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001151538.o0FFcVOA014581@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 15 Jan 2010 15: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: r202376 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 15:38:32 -0000 Author: netchild Date: Fri Jan 15 15:38:31 2010 New Revision: 202376 URL: http://svn.freebsd.org/changeset/base/202376 Log: Whitespace change to be able to provide the correct commit log for r202364: ---snip--- Add video clipping support but with the caveats below. Background info: Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided. Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized. Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips. How the linuxulator handles this from this commit on: * if (clipcount == VIDEO_CLIP_BITMAP) The clips variable is a void * pointer to a 128*625 byte (1024*625 bit) memory area containing a bitmap of the clipping area. The pointer in the video_window structure is copied, but no video_clip structures are copied. * if (clipcount > 0 && clipcount <= 16384) The clips variable is pointer to a list of video_clip structures. Up to clipcount structures are copied and passed to the driver. The upper limit of 16384 was imposed here so that user code that does not properly initialize clipcount falls through below and no attempt is made to copy an uninitialized list. This value was found by examining Linux drivers that support the clip list. * else The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or positive (> 16384). All these cases are treated as invalid data. Both the clipcount field and clips pointer are forced to zero/NULL and passed to the driver. It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping. Submitted by: J.R. Oldroyd MFC after: 1 month ---snip--- Modified: head/sys/compat/linux/linux_ioctl.c Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri Jan 15 15:37:28 2010 (r202375) +++ head/sys/compat/linux/linux_ioctl.c Fri Jan 15 15:38:31 2010 (r202376) @@ -143,7 +143,7 @@ struct handler_element }; static TAILQ_HEAD(, handler_element) handlers = - TAILQ_HEAD_INITIALIZER(handlers); + TAILQ_HEAD_INITIALIZER(handlers); static struct sx linux_ioctl_sx; SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "linux ioctl handlers"); From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 16:01:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38B0E106566B; Fri, 15 Jan 2010 16:01:23 +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 21C478FC13; Fri, 15 Jan 2010 16:01: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 o0FG1N0u020395; Fri, 15 Jan 2010 16:01:23 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FG1M5O020349; Fri, 15 Jan 2010 16:01:22 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001151601.o0FG1M5O020349@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 15 Jan 2010 16:01: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: r202386 - in head: sbin/setkey share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.sparc64 share/man/man7 share/man/man9 usr.bin/brandelf usr.bin/elfdump usr.sbin/faithd usr.sbi... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:01:23 -0000 Author: ru Date: Fri Jan 15 16:01:22 2010 New Revision: 202386 URL: http://svn.freebsd.org/changeset/base/202386 Log: Use the newly brought %U macro. Modified: head/sbin/setkey/setkey.8 head/share/man/man4/acpi.4 head/share/man/man4/acpi_asus.4 head/share/man/man4/aue.4 head/share/man/man4/axe.4 head/share/man/man4/cdce.4 head/share/man/man4/dc.4 head/share/man/man4/gif.4 head/share/man/man4/hme.4 head/share/man/man4/lge.4 head/share/man/man4/mac.4 head/share/man/man4/man4.i386/vpd.4 head/share/man/man4/man4.sparc64/ebus.4 head/share/man/man4/mpt.4 head/share/man/man4/ndis.4 head/share/man/man4/nge.4 head/share/man/man4/pcm.4 head/share/man/man4/pcn.4 head/share/man/man4/psm.4 head/share/man/man4/ral.4 head/share/man/man4/re.4 head/share/man/man4/rl.4 head/share/man/man4/rue.4 head/share/man/man4/rum.4 head/share/man/man4/sf.4 head/share/man/man4/sis.4 head/share/man/man4/sk.4 head/share/man/man4/smbus.4 head/share/man/man4/snd_uaudio.4 head/share/man/man4/ste.4 head/share/man/man4/targ.4 head/share/man/man4/udav.4 head/share/man/man4/ural.4 head/share/man/man4/urio.4 head/share/man/man4/urtw.4 head/share/man/man4/vr.4 head/share/man/man4/wi.4 head/share/man/man7/release.7 head/share/man/man9/mac.9 head/share/man/man9/pci.9 head/usr.bin/brandelf/brandelf.1 head/usr.bin/elfdump/elfdump.1 head/usr.sbin/faithd/faithd.8 head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/smbmsg/smbmsg.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Fri Jan 15 15:47:31 2010 (r202385) +++ head/sbin/setkey/setkey.8 Fri Jan 15 16:01:22 2010 (r202386) @@ -707,7 +707,7 @@ add 10.1.10.34 10.1.10.36 tcp 0x1000 -A .Xr sysctl 8 .Rs .%T "Changed manual key configuration for IPsec" -.%O "http://www.kame.net/newsletter/19991007/" +.%U http://www.kame.net/newsletter/19991007/ .%D "October 1999" .Re .\" Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/acpi.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -559,7 +559,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: head/share/man/man4/acpi_asus.4 ============================================================================== --- head/share/man/man4/acpi_asus.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/acpi_asus.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -162,7 +162,7 @@ which is parsed at boot-time. .Xr sysctl 8 .Rs .%T The acpi4asus Project -.%O http://sourceforge.net/projects/acpi4asus/ +.%U http://sourceforge.net/projects/acpi4asus/ .Re .Sh HISTORY The Modified: head/share/man/man4/aue.4 ============================================================================== --- head/share/man/man4/aue.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/aue.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: head/share/man/man4/axe.4 ============================================================================== --- head/share/man/man4/axe.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/axe.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -199,7 +199,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: head/share/man/man4/cdce.4 ============================================================================== --- head/share/man/man4/cdce.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/cdce.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: head/share/man/man4/dc.4 ============================================================================== --- head/share/man/man4/dc.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/dc.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom8.com .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/gif.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U ftp://ftp.isi.edu/in-notes/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: head/share/man/man4/hme.4 ============================================================================== --- head/share/man/man4/hme.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/hme.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -139,7 +139,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: head/share/man/man4/lge.4 ============================================================================== --- head/share/man/man4/lge.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/lge.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: head/share/man/man4/mac.4 ============================================================================== --- head/share/man/man4/mac.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/mac.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -219,7 +219,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: head/share/man/man4/man4.i386/vpd.4 ============================================================================== --- head/share/man/man4/man4.i386/vpd.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/man4.i386/vpd.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: head/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- head/share/man/man4/man4.sparc64/ebus.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/man4.sparc64/ebus.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/mpt.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -159,7 +159,7 @@ can take on - no separate compilation is .Xr gmultipath 8 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsilogic.com/ .Re .Sh HISTORY The Modified: head/share/man/man4/ndis.4 ============================================================================== --- head/share/man/man4/ndis.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/ndis.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -137,7 +137,7 @@ before a timeout expired. .Xr ndisgen 8 .Rs .%T "NDIS 5.1 specification" -.%O http://www.microsoft.com +.%U http://www.microsoft.com .Re .Sh HISTORY The Modified: head/share/man/man4/nge.4 ============================================================================== --- head/share/man/man4/nge.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/nge.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -230,11 +230,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/pcm.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -633,19 +633,19 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "Cookbook formulae for audio EQ biquad filter coefficients, by Robert Bristow-Johnson" -.%O "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" +.%U "http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt" .Re .Rs .%T "Julius O'Smith's Digital Audio Resampling" -.%O "http://ccrma.stanford.edu/~jos/resample/" +.%U "http://ccrma.stanford.edu/~jos/resample/" .Re .Rs .%T "Polynomial Interpolators for High-Quality Resampling of Oversampled Audio, by Olli Niemitalo" -.%O "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" +.%U "http://www.student.oulu.fi/~oniemita/dsp/deip.pdf" .Re .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: head/share/man/man4/pcn.4 ============================================================================== --- head/share/man/man4/pcn.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/pcn.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/psm.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -858,7 +858,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: head/share/man/man4/ral.4 ============================================================================== --- head/share/man/man4/ral.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/ral.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -242,7 +242,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/re.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -212,7 +212,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: head/share/man/man4/rl.4 ============================================================================== --- head/share/man/man4/rl.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/rl.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -255,7 +255,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: head/share/man/man4/rue.4 ============================================================================== --- head/share/man/man4/rue.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/rue.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -140,7 +140,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%U ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ .Re .Sh HISTORY The Modified: head/share/man/man4/rum.4 ============================================================================== --- head/share/man/man4/rum.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/rum.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -167,7 +167,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: head/share/man/man4/sf.4 ============================================================================== --- head/share/man/man4/sf.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/sf.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: head/share/man/man4/sis.4 ============================================================================== --- head/share/man/man4/sis.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/sis.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -193,11 +193,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: head/share/man/man4/sk.4 ============================================================================== --- head/share/man/man4/sk.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/sk.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -247,11 +247,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: head/share/man/man4/smbus.4 ============================================================================== --- head/share/man/man4/smbus.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/smbus.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: head/share/man/man4/snd_uaudio.4 ============================================================================== --- head/share/man/man4/snd_uaudio.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/snd_uaudio.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -78,7 +78,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: head/share/man/man4/ste.4 ============================================================================== --- head/share/man/man4/ste.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/ste.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: head/share/man/man4/targ.4 ============================================================================== --- head/share/man/man4/targ.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/targ.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: head/share/man/man4/udav.4 ============================================================================== --- head/share/man/man4/udav.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/udav.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: head/share/man/man4/ural.4 ============================================================================== --- head/share/man/man4/ural.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/ural.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -148,7 +148,7 @@ This should not happen. .Xr wpa_supplicant 8 . .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: head/share/man/man4/urio.4 ============================================================================== --- head/share/man/man4/urio.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/urio.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: head/share/man/man4/urtw.4 ============================================================================== --- head/share/man/man4/urtw.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/urtw.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -111,7 +111,7 @@ ifconfig wlan create wlandev urtw0 ssid .Xr wpa_supplicant 8 .Rs .%T Realtek -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: head/share/man/man4/vr.4 ============================================================================== --- head/share/man/man4/vr.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/vr.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: head/share/man/man4/wi.4 ============================================================================== --- head/share/man/man4/wi.4 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man4/wi.4 Fri Jan 15 16:01:22 2010 (r202386) @@ -321,7 +321,7 @@ command. .Xr wpa_supplicant 8 . .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://www.wavelan.com .Re .Sh HISTORY The Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man7/release.7 Fri Jan 15 16:01:22 2010 (r202386) @@ -518,15 +518,15 @@ make release CHROOTDIR=/local3/release B .Xr sysctl 8 .Rs .%T "FreeBSD Release Engineering" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/ +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/ .Re .Rs .%T "FreeBSD Release Engineering of Third Party Packages" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/ +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/ .Re .Rs .%T "FreeBSD Developers' Handbook" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ .Re .Sh HISTORY .Fx Modified: head/share/man/man9/mac.9 ============================================================================== --- head/share/man/man9/mac.9 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man9/mac.9 Fri Jan 15 16:01:22 2010 (r202386) @@ -173,7 +173,7 @@ for information on the MAC Framework API .Xr VFS 9 .Rs .%T "The FreeBSD Architecture Handbook" -.%O "http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/arch-handbook/" +.%U "http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/arch-handbook/" .Re .Sh HISTORY The Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Fri Jan 15 15:47:31 2010 (r202385) +++ head/share/man/man9/pci.9 Fri Jan 15 16:01:22 2010 (r202386) @@ -257,7 +257,7 @@ space on the target architecture. .Rs .%B FreeBSD Developers' Handbook .%T NewBus -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ .Re .Rs .%A Shanley Modified: head/usr.bin/brandelf/brandelf.1 ============================================================================== --- head/usr.bin/brandelf/brandelf.1 Fri Jan 15 15:47:31 2010 (r202385) +++ head/usr.bin/brandelf/brandelf.1 Fri Jan 15 16:01:22 2010 (r202386) @@ -96,7 +96,7 @@ brandelf -t Linux file .%A The Santa Cruz Operation, Inc. .%T System V Application Binary Interface .%D April 29, 1998 (DRAFT) -.%O http://www.sco.com/developer/devspecs/ +.%U http://www.sco.com/developer/devspecs/ .Re .Sh HISTORY The Modified: head/usr.bin/elfdump/elfdump.1 ============================================================================== --- head/usr.bin/elfdump/elfdump.1 Fri Jan 15 15:47:31 2010 (r202385) +++ head/usr.bin/elfdump/elfdump.1 Fri Jan 15 16:01:22 2010 (r202386) @@ -89,7 +89,7 @@ command: .Rs .%A "AT&T Unix Systems Labs" .%T "System V Application Binary Interface" -.%O http://www.sco.com/developers/gabi/ +.%U http://www.sco.com/developers/gabi/ .Re .Sh HISTORY The Modified: head/usr.sbin/faithd/faithd.8 ============================================================================== --- head/usr.sbin/faithd/faithd.8 Fri Jan 15 15:47:31 2010 (r202385) +++ head/usr.sbin/faithd/faithd.8 Fri Jan 15 16:01:22 2010 (r202386) @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U ftp://ftp.isi.edu/in-notes/rfc3142.txt .%D June 2001 .Re .\" Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 15:47:31 2010 (r202385) +++ head/usr.sbin/mergemaster/mergemaster.8 Fri Jan 15 16:01:22 2010 (r202386) @@ -443,7 +443,7 @@ comparison, use: .Pp .Pa /usr/src/etc/Makefile .Rs -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html .%T The Cutting Edge (using make world) .%A Nik Clayton .Re Modified: head/usr.sbin/smbmsg/smbmsg.8 ============================================================================== --- head/usr.sbin/smbmsg/smbmsg.8 Fri Jan 15 15:47:31 2010 (r202385) +++ head/usr.sbin/smbmsg/smbmsg.8 Fri Jan 15 16:01:22 2010 (r202386) @@ -273,7 +273,7 @@ Diagnostic messages issued are supposed .Xr smbus 4 .Rs .%T "The SMBus specification" -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 16:04:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D37DD1065670; Fri, 15 Jan 2010 16:04:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFC308FC12; Fri, 15 Jan 2010 16: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 o0FG4UgF021123; Fri, 15 Jan 2010 16:04:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FG4UDK021113; Fri, 15 Jan 2010 16:04:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001151604.o0FG4UDK021113@svn.freebsd.org> From: Attilio Rao Date: Fri, 15 Jan 2010 16: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: r202387 - in head/sys: amd64/amd64 amd64/include amd64/isa conf i386/i386 i386/include i386/isa pc98/cbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 16:04:30 -0000 Author: attilio Date: Fri Jan 15 16:04:30 2010 New Revision: 202387 URL: http://svn.freebsd.org/changeset/base/202387 Log: Handling all the three clocks (hardclock, softclock, profclock) with the LAPIC may lead to aliasing for softclock and profclock because frequencies are sized in order to fit mainly hardclock. atrtc used to take care of the softclock and profclock and it does still do, if the LAPIC can't handle the clocks properly. Revert the change when the LAPIC started taking charge of all three of them and let atrtc handle softclock and profclock if not explicitly requested. Such request can be made setting != 0 the new tunable machdep.lapic_allclocks or if the new device ATPIC is not present within the i386 kernel config (atrtc is linked to atpic presence). Diagnosed by: Sandvine Incorporated Reviewed by: jhb, emaste Sponsored by: Sandvine Incorporated MFC: 3 weeks Modified: head/sys/amd64/amd64/local_apic.c head/sys/amd64/include/apicvar.h head/sys/amd64/isa/clock.c head/sys/conf/options.i386 head/sys/i386/i386/local_apic.c head/sys/i386/include/apicvar.h head/sys/i386/isa/clock.c head/sys/pc98/cbus/clock.c Modified: head/sys/amd64/amd64/local_apic.c ============================================================================== --- head/sys/amd64/amd64/local_apic.c Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/amd64/amd64/local_apic.c Fri Jan 15 16:04:30 2010 (r202387) @@ -160,6 +160,9 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); + static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -415,10 +418,11 @@ lapic_disable_pmc(void) /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so * that it can drive hardclock, statclock, and profclock. This function - * returns true if it is able to use the local APIC timer to drive the - * clocks and false if it is not able. + * returns a positive integer if it is convenient to use the local APIC + * for all the clocks, a negative integer if it is convenient to use the + * local APIC only for the hardclock and 0 if none of them can be handled. */ -int +enum lapic_clock lapic_setup_clock(void) { u_long value; @@ -426,10 +430,10 @@ lapic_setup_clock(void) /* Can't drive the timer without a local APIC. */ if (lapic == NULL) - return (0); + return (LAPIC_CLOCK_NONE); if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (0); + return (LAPIC_CLOCK_NONE); /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -461,19 +465,27 @@ lapic_setup_clock(void) * (and profhz) run at hz. If 'hz' is below 1500 but above * 750, then we let the lapic timer run at 2 * 'hz'. If 'hz' * is below 750 then we let the lapic timer run at 4 * 'hz'. + * + * Please note that stathz and profhz are set only if all the + * clocks are handled through the local APIC. */ - if (hz >= 1500) + if (lapic_allclocks != 0) { + if (hz >= 1500) + lapic_timer_hz = hz; + else if (hz >= 750) + lapic_timer_hz = hz * 2; + else + lapic_timer_hz = hz * 4; + } else lapic_timer_hz = hz; - else if (hz >= 750) - lapic_timer_hz = hz * 2; - else - lapic_timer_hz = hz * 4; - if (lapic_timer_hz < 128) - stathz = lapic_timer_hz; - else - stathz = lapic_timer_hz / (lapic_timer_hz / 128); - profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; + if (lapic_allclocks != 0) { + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); + profhz = lapic_timer_hz; + } /* * Start up the timer on the BSP. The APs will kick off their @@ -481,7 +493,7 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (1); + return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); } void @@ -784,20 +796,23 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } + if (lapic_allclocks != 0) { - /* Fire statclock at stathz. */ - la->la_stat_ticks += stathz; - if (la->la_stat_ticks >= lapic_timer_hz) { - la->la_stat_ticks -= lapic_timer_hz; - statclock(TRAPF_USERMODE(frame)); - } + /* Fire statclock at stathz. */ + la->la_stat_ticks += stathz; + if (la->la_stat_ticks >= lapic_timer_hz) { + la->la_stat_ticks -= lapic_timer_hz; + statclock(TRAPF_USERMODE(frame)); + } - /* Fire profclock at profhz, but only when needed. */ - la->la_prof_ticks += profhz; - if (la->la_prof_ticks >= lapic_timer_hz) { - la->la_prof_ticks -= lapic_timer_hz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + /* Fire profclock at profhz, but only when needed. */ + la->la_prof_ticks += profhz; + if (la->la_prof_ticks >= lapic_timer_hz) { + la->la_prof_ticks -= lapic_timer_hz; + if (profprocs != 0) + profclock(TRAPF_USERMODE(frame), + TRAPF_PC(frame)); + } } critical_exit(); } Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/amd64/include/apicvar.h Fri Jan 15 16:04:30 2010 (r202387) @@ -157,6 +157,12 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI +enum lapic_clock { + LAPIC_CLOCK_NONE, + LAPIC_CLOCK_HARDCLOCK, + LAPIC_CLOCK_ALL +}; + /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -224,7 +230,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -int lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(void); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: head/sys/amd64/isa/clock.c ============================================================================== --- head/sys/amd64/isa/clock.c Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/amd64/isa/clock.c Fri Jan 15 16:04:30 2010 (r202387) @@ -91,7 +91,7 @@ static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; static int using_atrtc_timer; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -160,7 +160,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); if (using_atrtc_timer) { #ifdef SMP @@ -422,7 +423,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -485,7 +486,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -508,7 +509,7 @@ cpu_initclocks() * kernel clocks, then setup the RTC to periodically interrupt to * drive statclock() and profclock(). */ - if (!using_lapic_timer) { + if (using_lapic_timer != LAPIC_CLOCK_ALL) { using_atrtc_timer = atrtc_setup_clock(); if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ @@ -532,7 +533,7 @@ void cpu_startprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_PROF); psdiv = pscnt = psratio; @@ -542,7 +543,7 @@ void cpu_stopprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_NOPROF); psdiv = pscnt = 1; Modified: head/sys/conf/options.i386 ============================================================================== --- head/sys/conf/options.i386 Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/conf/options.i386 Fri Jan 15 16:04:30 2010 (r202387) @@ -105,6 +105,7 @@ NETGRAPH_CRONYX opt_ng_cronyx.h # Device options DEV_APIC opt_apic.h +DEV_ATPIC opt_atpic.h DEV_NPX opt_npx.h ASR_COMPAT opt_asr.h Modified: head/sys/i386/i386/local_apic.c ============================================================================== --- head/sys/i386/i386/local_apic.c Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/i386/i386/local_apic.c Fri Jan 15 16:04:30 2010 (r202387) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -160,6 +161,17 @@ static uint32_t lvt_mode(struct lapic *l struct pic lapic_pic = { .pic_resume = lapic_resume }; +/* + * The atrtc device is compiled in only if atpic is present. + * If it is not, force lapic to take care of all the clocks. + */ +#ifdef DEV_ATPIC +static int lapic_allclocks; +TUNABLE_INT("machdep.lapic_allclocks", &lapic_allclocks); +#else +static int lapic_allclocks = 1; +#endif + static uint32_t lvt_mode(struct lapic *la, u_int pin, uint32_t value) { @@ -416,11 +428,9 @@ lapic_disable_pmc(void) /* * Called by cpu_initclocks() on the BSP to setup the local APIC timer so - * that it can drive hardclock, statclock, and profclock. This function - * returns true if it is able to use the local APIC timer to drive the - * clocks and false if it is not able. + * that it can drive hardclock, statclock, and profclock. */ -int +enum lapic_clock lapic_setup_clock(void) { u_long value; @@ -428,10 +438,10 @@ lapic_setup_clock(void) /* Can't drive the timer without a local APIC. */ if (lapic == NULL) - return (0); + return (LAPIC_CLOCK_NONE); if (resource_int_value("apic", 0, "clock", &i) == 0 && i == 0) - return (0); + return (LAPIC_CLOCK_NONE); /* Start off with a divisor of 2 (power on reset default). */ lapic_timer_divisor = 2; @@ -463,19 +473,27 @@ lapic_setup_clock(void) * (and profhz) run at hz. If 'hz' is below 1500 but above * 750, then we let the lapic timer run at 2 * 'hz'. If 'hz' * is below 750 then we let the lapic timer run at 4 * 'hz'. + * + * Please note that stathz and profhz are set only if all the + * clocks are handled through the local APIC. */ - if (hz >= 1500) + if (lapic_allclocks != 0) { + if (hz >= 1500) + lapic_timer_hz = hz; + else if (hz >= 750) + lapic_timer_hz = hz * 2; + else + lapic_timer_hz = hz * 4; + } else lapic_timer_hz = hz; - else if (hz >= 750) - lapic_timer_hz = hz * 2; - else - lapic_timer_hz = hz * 4; - if (lapic_timer_hz < 128) - stathz = lapic_timer_hz; - else - stathz = lapic_timer_hz / (lapic_timer_hz / 128); - profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; + if (lapic_allclocks != 0) { + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); + profhz = lapic_timer_hz; + } /* * Start up the timer on the BSP. The APs will kick off their @@ -483,7 +501,7 @@ lapic_setup_clock(void) */ lapic_timer_periodic(lapic_timer_period); lapic_timer_enable_intr(); - return (1); + return (lapic_allclocks == 0 ? LAPIC_CLOCK_HARDCLOCK : LAPIC_CLOCK_ALL); } void @@ -786,20 +804,23 @@ lapic_handle_timer(struct trapframe *fra else hardclock_cpu(TRAPF_USERMODE(frame)); } + if (lapic_allclocks != 0) { - /* Fire statclock at stathz. */ - la->la_stat_ticks += stathz; - if (la->la_stat_ticks >= lapic_timer_hz) { - la->la_stat_ticks -= lapic_timer_hz; - statclock(TRAPF_USERMODE(frame)); - } + /* Fire statclock at stathz. */ + la->la_stat_ticks += stathz; + if (la->la_stat_ticks >= lapic_timer_hz) { + la->la_stat_ticks -= lapic_timer_hz; + statclock(TRAPF_USERMODE(frame)); + } - /* Fire profclock at profhz, but only when needed. */ - la->la_prof_ticks += profhz; - if (la->la_prof_ticks >= lapic_timer_hz) { - la->la_prof_ticks -= lapic_timer_hz; - if (profprocs != 0) - profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + /* Fire profclock at profhz, but only when needed. */ + la->la_prof_ticks += profhz; + if (la->la_prof_ticks >= lapic_timer_hz) { + la->la_prof_ticks -= lapic_timer_hz; + if (profprocs != 0) + profclock(TRAPF_USERMODE(frame), + TRAPF_PC(frame)); + } } critical_exit(); } Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/i386/include/apicvar.h Fri Jan 15 16:04:30 2010 (r202387) @@ -186,6 +186,12 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI +enum lapic_clock { + LAPIC_CLOCK_NONE, + LAPIC_CLOCK_HARDCLOCK, + LAPIC_CLOCK_ALL +}; + /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -253,7 +259,7 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -int lapic_setup_clock(void); +enum lapic_clock lapic_setup_clock(void); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: head/sys/i386/isa/clock.c ============================================================================== --- head/sys/i386/isa/clock.c Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/i386/isa/clock.c Fri Jan 15 16:04:30 2010 (r202387) @@ -106,7 +106,7 @@ static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; static int using_atrtc_timer; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -175,7 +175,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); #ifdef KDTRACE_HOOKS /* @@ -453,7 +454,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -533,7 +534,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); @@ -556,7 +557,7 @@ cpu_initclocks() * kernel clocks, then setup the RTC to periodically interrupt to * drive statclock() and profclock(). */ - if (!using_lapic_timer) { + if (using_lapic_timer != LAPIC_CLOCK_ALL) { using_atrtc_timer = atrtc_setup_clock(); if (using_atrtc_timer) { /* Enable periodic interrupts from the RTC. */ @@ -580,7 +581,7 @@ void cpu_startprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_PROF); psdiv = pscnt = psratio; @@ -590,7 +591,7 @@ void cpu_stopprofclock(void) { - if (using_lapic_timer || !using_atrtc_timer) + if (using_lapic_timer == LAPIC_CLOCK_ALL || !using_atrtc_timer) return; atrtc_rate(RTCSA_NOPROF); psdiv = pscnt = 1; Modified: head/sys/pc98/cbus/clock.c ============================================================================== --- head/sys/pc98/cbus/clock.c Fri Jan 15 16:01:22 2010 (r202386) +++ head/sys/pc98/cbus/clock.c Fri Jan 15 16:04:30 2010 (r202387) @@ -101,7 +101,7 @@ static u_int32_t i8254_lastcount; static u_int32_t i8254_offset; static int (*i8254_pending)(struct intsrc *); static int i8254_ticked; -static int using_lapic_timer; +static enum lapic_clock using_lapic_timer = LAPIC_CLOCK_NONE; /* Values for timerX_state: */ #define RELEASED 0 @@ -164,7 +164,8 @@ clkintr(struct trapframe *frame) clkintr_pending = 0; mtx_unlock_spin(&clock_lock); } - KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer")); + KASSERT(using_lapic_timer == LAPIC_CLOCK_NONE, + ("clk interrupt enabled with lapic timer")); #ifdef KDTRACE_HOOKS /* @@ -360,7 +361,7 @@ set_i8254_freq(u_int freq, int intr_freq i8254_timecounter.tc_frequency = freq; mtx_lock_spin(&clock_lock); i8254_freq = freq; - if (using_lapic_timer) + if (using_lapic_timer != LAPIC_CLOCK_NONE) new_i8254_real_max_count = 0x10000; else new_i8254_real_max_count = TIMER_DIV(intr_freq); @@ -443,7 +444,7 @@ cpu_initclocks() * that it can drive hardclock(). Otherwise, change the 8254 * timecounter to user a simpler algorithm. */ - if (!using_lapic_timer) { + if (using_lapic_timer == LAPIC_CLOCK_NONE) { intr_add_handler("clk", 0, (driver_filter_t *)clkintr, NULL, NULL, INTR_TYPE_CLK, NULL); i8254_intsrc = intr_lookup_source(0); From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 17:41:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0058C106566B; Fri, 15 Jan 2010 17:41:34 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id D30D78FC13; Fri, 15 Jan 2010 17:41:34 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KWA00BP5UH6GK30@asmtp025.mac.com>; Fri, 15 Jan 2010 09:41:34 -0800 (PST) From: Marcel Moolenaar In-reply-to: <20100115174711.GF1990@FreeBSD.org> Date: Fri, 15 Jan 2010 09:41:30 -0800 Message-id: References: <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> <20100114.135930.80200584442733547.imp@bsdimp.com> <20100115114822.O63406@delplex.bde.org> <20100115174711.GF1990@FreeBSD.org> To: "Wojciech A. Koszek" X-Mailer: Apple Mail (2.1077) Cc: dougb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, Bruce Evans , freebsd-arch@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 17:41:35 -0000 On Jan 15, 2010, at 9:47 AM, Wojciech A. Koszek wrote: > On Fri, Jan 15, 2010 at 12:50:55PM +1100, Bruce Evans wrote: >> On Thu, 14 Jan 2010, M. Warner Losh wrote: >> >>> In message: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> >>> "Robert N. M. Watson" writes: >>> : I agree. I see two kinds of users: >>> : > > [..] > > Reasoning behind -C was that in 2007, Robert and Peter mentioned about a need > of having comments in the config file. I divided users into two groups: Why don't we stop dividing people in groups and classes and instead just add directives for what to include. Such as: embed options embed devices embed comments embed includes embed "$FreeBSD$" Combine this with syntactic sugaring and you can have something like: embed everything noembed comments Is this really so hard? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 17:55:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47C5D106566B; Fri, 15 Jan 2010 17:55:19 +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 36FAF8FC1A; Fri, 15 Jan 2010 17:55: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 o0FHtJIU046744; Fri, 15 Jan 2010 17:55:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FHtJDF046742; Fri, 15 Jan 2010 17:55:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001151755.o0FHtJDF046742@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 15 Jan 2010 17:55: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: r202406 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 17:55:19 -0000 Author: yongari Date: Fri Jan 15 17:55:18 2010 New Revision: 202406 URL: http://svn.freebsd.org/changeset/base/202406 Log: Don't free mbuf chains when bge(4) fails to collapse the mbuf chains. This part of code is to enhance performance so failing the collapsing should not free TX frames. Otherwise bge(4) will unnecessarily drop frames which in turn can freeze the network connection. Reported by: Igor Sysoev (is <> rambler-co dot ru) Tested by: Igor Sysoev (is <> rambler-co dot ru) Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Jan 15 16:57:53 2010 (r202405) +++ head/sys/dev/bge/if_bge.c Fri Jan 15 17:55:18 2010 (r202406) @@ -3950,11 +3950,8 @@ bge_encap(struct bge_softc *sc, struct m m = m_defrag(m, M_DONTWAIT); else m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); - if (m == NULL) { - m_freem(*m_head); - *m_head = NULL; - return (ENOBUFS); - } + if (m == NULL) + m = *m_head; *m_head = m; } From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 17:57:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E936C106566B; Fri, 15 Jan 2010 17:57:07 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id 8A02C8FC13; Fri, 15 Jan 2010 17:57:07 +0000 (UTC) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by freebsd.czest.pl (8.14.2/8.14.2) with ESMTP id o0FHlCmp050844; Fri, 15 Jan 2010 18:47:12 +0100 (CET) (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.2/8.14.2/Submit) id o0FHlBc2050843; Fri, 15 Jan 2010 18:47:11 +0100 (CET) (envelope-from wkoszek) Date: Fri, 15 Jan 2010 18:47:11 +0100 From: "Wojciech A. Koszek" To: Bruce Evans Message-ID: <20100115174711.GF1990@FreeBSD.org> Mail-Followup-To: Bruce Evans , "M. Warner Losh" , dougb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, freebsd-arch@freebsd.org, svn-src-head@freebsd.org References: <20100114.105622.457034909117828677.imp@bsdimp.com> <4B4F7810.2080003@FreeBSD.org> <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> <20100114.135930.80200584442733547.imp@bsdimp.com> <20100115114822.O63406@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20100115114822.O63406@delplex.bde.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0 (freebsd.czest.pl [212.87.224.105]); Fri, 15 Jan 2010 18:47:12 +0100 (CET) Cc: dougb@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, freebsd-arch@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 17:57:08 -0000 On Fri, Jan 15, 2010 at 12:50:55PM +1100, Bruce Evans wrote: > On Thu, 14 Jan 2010, M. Warner Losh wrote: > >> In message: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> >> "Robert N. M. Watson" writes: >> : I agree. I see two kinds of users: >> : [..] Reasoning behind -C was that in 2007, Robert and Peter mentioned about a need of having comments in the config file. I divided users into two groups: - those who don't care because they can't reconfigure the FreeBSD kernel anyway no matter what - with or without comments, they're baked anyway, because "make xconfig" doesn't work. - those who don't care in which format config file is, since they just glance at the output from config -x, use Copy's and Paste's method and get everything fixed; preprocessing of configuration files was done for them and for system administrators woken up at 3am with a task of recreating exact machine configuration. I don't want to argue on my view, but I glanced at Warner's patch and if people want it, I believe it can make our world a bit better. > "Stripping" comments has nothing to do with saving space. It is because > it is technically difficult, and not implemented, to not strip them, > except in the old limited code that just preserves the unprocessed > top-level-only config file. This is exactly why comments aren't there. Below in this thread, Peter Jeremy gives us good suggestion on bringing additional option like "comment", which would include string literal. I think this is a good proposal. >> : As such, I see a reasonable "default" -- i.e., i386/amd64 GENERIC -- >> : be to fully preserve the configuration and its comments. For the > > Your code to implement this is welcome :-). Even GENERIC is not quite > complete, since it is missing the implicit include of DEFAULTS. OTOH, > completing the config by merging with DEFAULTS, as I think the processed > version must do, may give an unusable config by repeating things in > DEFAULTS. The merge should probably have no processing at all, with > include files concatenated and not replacing include directives, and > DEFAULTS not included. My opinion is that DEFAULTS should be included in every GENERIC explicitly by include directive, and that the code dealing with DEFAULTS which is right now present in config(8) should be removed. >> This >> will preserve the comments, but assumes that every single included >> file from that file is recoverable in a trivial manner (eg, from cvs, >> svn, p4, release ISOs, etc). > > This assumption is false, so this model became just broken when the > include directive was implemented. History: > INCLUDE_CONFIG_FILE option: 1996 > include directive: 2001 > processed output and -C: 2007 > The -C option just preserves the breakage at its 2001-2007 level. I just tried to make is "suck less", so -C right now takes all "include " directives and brings in configuration file. >> If space isn't an issue, we could save BOTH. That would be a bigger >> patch, since we'd have to alter config to extract both kinds of data. >> All I did was to move the -C option from an obscure src.conf variable >> to be a full-fledged kernel option, leaving the rest of the >> infrastructure intact. The advantage is that we cover both bases and >> could export both views as a sysctl (right now we overload the two >> different views with one sysctl). > > ISTR a long discussion about the -C option when it was implemented. Why > didn't you complain back then? :-). I looked at my old mail about this. > I wasn't involved with the initial discussion, but imp was :-). My mail > was after the initial commit. I reported the following problems: Warner was within a very small group of people that actually did care about config(8) when I touched it, and helped me to fix world/config(8) breakage when people on DevSummit (BSDCan?) couldn't get their kernel to configure properly. > - DEFAULTS wasn't processed I don't seem to remember this one... With -C it's not included, but I propose a solution above. Is this an issue you're referring here? > - several ordering problems. Ones that reordered directives of the form: > options FOO=bar > nooptions FOO > options FOO=baz > made the generated file unusable. This was found and fixed thanks to your devil's configuration tarball. Anyway... Each time I see our kernel modules being built I cry and think of this page: http://wiki.freebsd.org/NewConfig This is a list of my random ideas related with solving config(8) problems in long run. Without promising anything I can say that narrowing requirements down would help me to figure out, how big the problem is. Maybe I could help somehow with the configuration file mess in the future.. Mail me your suggestions privately, and I'll bring them to the Wiki. -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 18:06:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 679ED1065670; Fri, 15 Jan 2010 18:06:14 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 26ACB8FC0A; Fri, 15 Jan 2010 18:06:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0FI4iCQ034251; Fri, 15 Jan 2010 11:04:44 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 15 Jan 2010 11:05:28 -0700 (MST) Message-Id: <20100115.110528.849557997928257031.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: References: <20100115114822.O63406@delplex.bde.org> <20100115174711.GF1990@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: dougb@freebsd.org, svn-src-all@freebsd.org, wkoszek@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, brde@optusnet.com.au, freebsd-arch@freebsd.org, svn-src-head@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 18:06:14 -0000 In message: Marcel Moolenaar writes: : : On Jan 15, 2010, at 9:47 AM, Wojciech A. Koszek wrote: : : > On Fri, Jan 15, 2010 at 12:50:55PM +1100, Bruce Evans wrote: : >> On Thu, 14 Jan 2010, M. Warner Losh wrote: : >> : >>> In message: <86625798-F339-4863-8F97-63B5232A6CF7@freebsd.org> : >>> "Robert N. M. Watson" writes: : >>> : I agree. I see two kinds of users: : >>> : : > : > [..] : > : > Reasoning behind -C was that in 2007, Robert and Peter mentioned about a need : > of having comments in the config file. I divided users into two groups: : : Why don't we stop dividing people in groups and classes and : instead just add directives for what to include. Such as: : : embed options : embed devices : embed comments : embed includes : embed "$FreeBSD$" : : Combine this with syntactic sugaring and you can have something : like: : embed everything : noembed comments : : Is this really so hard? Yes. Didn't you read the message I posted about why this is hard? There would be a ton of lexer and parser work to make this happen, as well as a lot of work to internal data structures to keep the file as parsed, rather than as convenient to do config's job. It is a big pita. Right now there's two places where you can tap into the config file information. The first one is where we know the filename of the file we're configuring. The second is after all the lexing has happened and we know the options, but their order has been lost as well as any formatting and text. The latter was done to address concerns over the 'include' directive, but it has its own set of problems and isn't perfect either. I think the way forward isn't as you suggest. It would be a ton of work to fix the lexer to carry forward the comments. A comments directive is just plain silly. The embedding stuff is too fine-grained control. It is a bandaide on a bandaide over a kludge. What is needed really is a fresher approach to solving the problem correctly. I've been thinking hard about this. The better approach is actually very simple to implement and do, and is very extensible. Stay with me here for a moment. First, we change the section in the ELF file that contains the config file a little. This section will define a couple of symbols, with weak symbols backing them in kern/kern_mib.c (more on why that particular file later). This new section would be just a normal text file. The mib that exports the current config file would export this text file. The config -x command that looks for the config would still print out the same section of the file. So far, there's no change from what we have today, which is good. The reporting side can remain exactly as it is. However, we'd have config create a new file in the kernel directory. It would contain a list of all the files that were included (directly or indirectly) as part of the config parsing. This would also include not only files brought in by the 'config' directive, but also files brought in by the env or hints directives. This change is very small, and about a dozen lines of code to implement. I could produce a patch easily enough. The build process would change a little. Rather than config creating config.c, the build process would create it based on a dependency on this file and all the files in this file. The build scripts would then create a simple shar file of all the files listed in this file (included, env, hints, etc). This would be embedded in the kernel. This would solve the 'I forgot to save this included file' problem completely. It would solve the ordering problems we have without -C. It would solve the comments going away. Heck, we could have two options: one to include the entire src/sys tree (modulo binaries) and one to just include the config files. If there are space concerns, it can be made into a gzip -9'd tarball and no longer text for all I care :). But the src/sys option would be a little slow and really bloat the kernel. Now, the reason that kern/kern_mib.c was singled out is that's where we export this blob to userland. My idea is to keep the text format that we have now for compatibility, and I'd rather not have the mib do the decompression. But if we break with compat, then we can easily have the binary blob that's preserved there which can trivially be extracted either by config -x, or by the sysctl on the running kernel. Frankly, that sort of thing is the right way to fix the include problem. There's no space reason for including just a subset: it was purely an easy of implementation choice that drove the two ways. If we really make it include everything, then -C can go away, the weird pseudo thing we have can go away, and we know get everything. And it is easy to implement... Comments? Warner From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 18:59:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DAAD106568F; Fri, 15 Jan 2010 18:59:42 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 205958FC16; Fri, 15 Jan 2010 18:59:41 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KWA00DXOY2OK690@asmtp029.mac.com>; Fri, 15 Jan 2010 10:59:30 -0800 (PST) From: Marcel Moolenaar In-reply-to: <20100115.110528.849557997928257031.imp@bsdimp.com> Date: Fri, 15 Jan 2010 10:59:11 -0800 Message-id: References: <20100115114822.O63406@delplex.bde.org> <20100115174711.GF1990@FreeBSD.org> <20100115.110528.849557997928257031.imp@bsdimp.com> To: "M. Warner Losh" X-Mailer: Apple Mail (2.1077) Cc: dougb@freebsd.org, svn-src-all@freebsd.org, wkoszek@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, brde@optusnet.com.au, freebsd-arch@freebsd.org, svn-src-head@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 18:59:42 -0000 On Jan 15, 2010, at 10:05 AM, M. Warner Losh wrote: > : Is this really so hard? > > Yes. Didn't you read the message I posted about why this is hard? No, I didn't. > There would be a ton of lexer and parser work to make this happen, as > well as a lot of work to internal data structures to keep the file as > parsed, rather than as convenient to do config's job. It is a big > pita. PITA != hard. If we're not willing to put in the effort to fix something, I don't think we should call it hard to do. We should call it like it is: non-trivial, involved or significant. Heck, we can even call it a major undertaking. But hard? No, I don't think it's hard at all. > I think the way forward isn't as you suggest. Fine. Just stop trying to classify people as a basis for what behaviour we should implement. It never works... > If > we really make it include everything, then -C can go away, the weird > pseudo thing we have can go away, and we know get everything. And it > is easy to implement... > > Comments? How does this address the "I don't want everything, I just want my CVS keyword" example? How does it handle the delicate balance between space vs. functionality that exists on embedded and/or low-end platforms. An all inclusive implementation seems not to take that into account that well. Sure, you can compress but then you add a runtime overhead to uncompress. In any case: I personally don't use the option so I really should not get involved. If I were to implement something from scratch though, I would treat it as a C file: the config file is the source and you "compile" it into a binary form suitable for inclusion into the kernel and you have compile-time options that control the binary output. No comments will be included in that case and there will be no option for it. But that's just me... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 19:34:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78643106566C; Fri, 15 Jan 2010 19:34:40 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66DD78FC1A; Fri, 15 Jan 2010 19:34: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 o0FJYeBh069231; Fri, 15 Jan 2010 19:34:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FJYesX069228; Fri, 15 Jan 2010 19:34:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001151934.o0FJYesX069228@svn.freebsd.org> From: Christian Brueffer Date: Fri, 15 Jan 2010 19:34: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: r202412 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:34:40 -0000 Author: brueffer Date: Fri Jan 15 19:34:40 2010 New Revision: 202412 URL: http://svn.freebsd.org/changeset/base/202412 Log: Manpage for the siba(4) Sonic Inc. Silicon Backplane driver. Submitted by: weongyo Added: head/share/man/man4/siba.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Jan 15 19:12:34 2010 (r202411) +++ head/share/man/man4/Makefile Fri Jan 15 19:34:40 2010 (r202412) @@ -340,6 +340,7 @@ MAN= aac.4 \ ses.4 \ sf.4 \ si.4 \ + siba.4 \ sio.4 \ siis.4 \ sis.4 \ Added: head/share/man/man4/siba.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/siba.4 Fri Jan 15 19:34:40 2010 (r202412) @@ -0,0 +1,90 @@ +.\" Copyright (c) 2010 Weongyo Jeong +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 8, 2010 +.Dt SIBA 4 +.Os +.Sh NAME +.Nm siba +.Nd Sonic Inc. Silicon Backplane driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device siba" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +siba_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the Sonic Inc. Silicon Backplane, the interblock +communications architecture that can be found in most Broadcom +wireless NICs. +.Pp +A bus connects all of the Silicon Backplane's functional blocks. +These functional blocks, known as cores, use the Open Core Protocol +(OCP) interface to communicate with agents attached to the Silicon +Backplane. +.Pp +Each NIC uses a chip from the same chip family. +Each member of the family contains a different set of cores, but +shares basic architectural features such as address space definition, +interrupt and error architecture, and backplane register definitions. +.Pp +Each core can have an initiator agent that passes read and write +requests onto the system backplane and a target agent that returns +responses to those requests. +Not all cores contain both an initiator and a target agent. +Initiator agents are present in cores that contain +host interfaces (PCI, PCMCIA), embedded processors (MIPS), +or DMA processors associated with communications cores. +.Pp +All cores other than PCMCIA have a target agent. +.Sh SEE ALSO +.Xr bwn 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Bruce M. Simpson +.Aq bms@FreeBSD.org +and +.An Weongyo Jeong +.Aq weongyo@FreeBSD.org . +.Sh CAVEATS +Host mode is not supported at this moment. From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 19:54:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A567810656FD; Fri, 15 Jan 2010 19:54:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 52E528FC36; Fri, 15 Jan 2010 19:54:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o0FJlPCH035384; Fri, 15 Jan 2010 12:47:25 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 15 Jan 2010 12:48:09 -0700 (MST) Message-Id: <20100115.124809.21010533849792633.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: References: <20100115.110528.849557997928257031.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: dougb@freebsd.org, svn-src-all@freebsd.org, wkoszek@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, brde@optusnet.com.au, freebsd-arch@freebsd.org, svn-src-head@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 19:54:18 -0000 In message: Marcel Moolenaar writes: : : On Jan 15, 2010, at 10:05 AM, M. Warner Losh wrote: : > : Is this really so hard? : > : > Yes. Didn't you read the message I posted about why this is hard? : : No, I didn't. : : > There would be a ton of lexer and parser work to make this happen, as : > well as a lot of work to internal data structures to keep the file as : > parsed, rather than as convenient to do config's job. It is a big : > pita. : : PITA != hard. If we're not willing to put in the effort to fix : something, I don't think we should call it hard to do. We should : call it like it is: non-trivial, involved or significant. Heck, : we can even call it a major undertaking. But hard? No, I don't : think it's hard at all. Agreed. But having retrofitted grammars in the past, coupled with the fact that config doesn't create a proper parse tree means we'd be rewriting huge portions of config, almost a complete rewrite from scratch, I'd say, would be necessary. And then you've sunk a huge amount of time into solving a tiny problem. Rewriting config should produce more benefits than just this one problem. That's why I called it hard. : > I think the way forward isn't as you suggest. : : Fine. Just stop trying to classify people as a basis for what : behaviour we should implement. It never works... Actually, engineering is all about identifying classes of users, and showing that solutions map well onto those classes of users. In showing which classes of users the solutions works well for, we can also find holes in the current setup. : > If : > we really make it include everything, then -C can go away, the weird : > pseudo thing we have can go away, and we know get everything. And it : > is easy to implement... : > : > Comments? : : How does this address the "I don't want everything, I just want : my CVS keyword" example? How does it handle the delicate balance : between space vs. functionality that exists on embedded and/or : low-end platforms. An all inclusive implementation seems not to : take that into account that well. Sure, you can compress but : then you add a runtime overhead to uncompress. I don't understand the "I just want my CVS keywords expanded" example. I think that's an orthogonal problem entirely (and maybe a small bug-fix to config to include an ident keyword if people really want the config file saved). The CVS keywords for the rest of the kernel are controlled by sys/cdefs, which creates .ident lines which the toolchain is responsible for keeping or ditching. Embedded platforms wouldn't embed the whole config file at all, so I don't see what we do for platforms that aren't resource sensitive would matter here. But all the includes is only 14k on amd64 and i386 (our biggest config file platforms). These particular config files compress down to about 6k. Embedded config files tend to be even smaller, and would likely compress down to about 1.5k-2k (AR71XX is 1.3k without the extra included files). Since the kernel is itself compressed, we wouldn't have to worry too much about it. So even in embedded, the resources consumed are small. : In any case: I personally don't use the option so I really should : not get involved. If I were to implement something from scratch : though, I would treat it as a C file: the config file is the source : and you "compile" it into a binary form suitable for inclusion into : the kernel and you have compile-time options that control the binary : output. No comments will be included in that case and there will be : no option for it. But that's just me... That's basically what's implemented to day: we're but a whisper away from a pure binary for (no -C)... Warner From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 20:08:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9361065696; Fri, 15 Jan 2010 20:08:08 +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 6EA118FC15; Fri, 15 Jan 2010 20:08: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 o0FK88Ju077025; Fri, 15 Jan 2010 20:08:08 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0FK88I7077023; Fri, 15 Jan 2010 20:08:08 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201001152008.o0FK88I7077023@svn.freebsd.org> From: Matt Jacob Date: Fri, 15 Jan 2010 20:08: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: r202418 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 20:08:08 -0000 Author: mjacob Date: Fri Jan 15 20:08:08 2010 New Revision: 202418 URL: http://svn.freebsd.org/changeset/base/202418 Log: Amazingly we've been freeing a handle and using that which it refers to for years. Bad! MFC after: 1 week Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri Jan 15 19:54:12 2010 (r202417) +++ head/sys/dev/isp/isp.c Fri Jan 15 20:08:08 2010 (r202418) @@ -5185,7 +5185,6 @@ again: ISP_WRITE(isp, isp->isp_respoutrp, optr); continue; } - isp_destroy_handle(isp, sp->req_handle); if (req_status_flags & RQSTF_BUS_RESET) { XS_SETERR(xs, HBA_BUSRESET); ISP_SET_SENDMARKER(isp, XS_CHANNEL(xs), 1); @@ -5321,6 +5320,7 @@ again: if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, sp->req_handle); } + isp_destroy_handle(isp, sp->req_handle); if (((isp->isp_dblev & (ISP_LOGDEBUG1|ISP_LOGDEBUG2|ISP_LOGDEBUG3))) || ((isp->isp_dblev & ISP_LOGDEBUG0) && ((!XS_NOERR(xs)) || From owner-svn-src-head@FreeBSD.ORG Fri Jan 15 20:37:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 971F7106566B; Fri, 15 Jan 2010 20:37:37 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout023.mac.com (asmtpout023.mac.com [17.148.16.98]) by mx1.freebsd.org (Postfix) with ESMTP id 79C158FC18; Fri, 15 Jan 2010 20:37:37 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp023.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KWB006JR2MM3440@asmtp023.mac.com>; Fri, 15 Jan 2010 12:37:35 -0800 (PST) From: Marcel Moolenaar In-reply-to: <20100115.124809.21010533849792633.imp@bsdimp.com> Date: Fri, 15 Jan 2010 12:37:34 -0800 Message-id: <86DE85B0-2556-48A3-8AB0-C4969823A93E@mac.com> References: <20100115.110528.849557997928257031.imp@bsdimp.com> <20100115.124809.21010533849792633.imp@bsdimp.com> To: "M. Warner Losh" X-Mailer: Apple Mail (2.1077) Cc: dougb@freebsd.org, svn-src-all@freebsd.org, wkoszek@freebsd.org, src-committers@freebsd.org, rwatson@freebsd.org, brde@optusnet.com.au, freebsd-arch@freebsd.org, svn-src-head@freebsd.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2010 20:37:37 -0000 On Jan 15, 2010, at 11:48 AM, M. Warner Losh wrote: > : PITA != hard. If we're not willing to put in the effort to fix > : something, I don't think we should call it hard to do. We should > : call it like it is: non-trivial, involved or significant. Heck, > : we can even call it a major undertaking. But hard? No, I don't > : think it's hard at all. > > Agreed. But having retrofitted grammars in the past, coupled with the > fact that config doesn't create a proper parse tree means we'd be > rewriting huge portions of config, almost a complete rewrite from > scratch, I'd say, would be necessary. And then you've sunk a huge > amount of time into solving a tiny problem. Rewriting config should > produce more benefits than just this one problem. That's why I called > it hard. Yes. I do believe that it's a "big job" and it's fair to ask whether it's worth. > : How does this address the "I don't want everything, I just want > : my CVS keyword" example? *snip* > I don't understand the "I just want my CVS keywords expanded" > example. The inspiration came from Peter Jeremy's email in this thread. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 01:37:08 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E031065672; Sat, 16 Jan 2010 01:37:08 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from smtp6.server.rpi.edu (smtp6.server.rpi.edu [128.113.2.226]) by mx1.freebsd.org (Postfix) with ESMTP id EDA6E8FC08; Sat, 16 Jan 2010 01:37:07 +0000 (UTC) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp6.server.rpi.edu (8.13.1/8.13.1) with ESMTP id o0G1awAu013377; Fri, 15 Jan 2010 20:36:59 -0500 Mime-Version: 1.0 Message-Id: In-Reply-To: <86DE85B0-2556-48A3-8AB0-C4969823A93E@mac.com> References: <20100115.110528.849557997928257031.imp@bsdimp.com> <20100115.124809.21010533849792633.imp@bsdimp.com> <86DE85B0-2556-48A3-8AB0-C4969823A93E@mac.com> Date: Fri, 15 Jan 2010 20:36:57 -0500 To: Marcel Moolenaar , "M. Warner Losh" From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Bayes-Prob: 0.0001 (Score 0) X-RPI-SA-Score: 0.70 () [Hold at 20.00] COMBINED_FROM,J_CHICKENPOX_72 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.226 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rwatson@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: INCLUDE_CONFIG_FILE in GENERIC X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 01:37:08 -0000 At the risk of sounding overly simplistic, how hard is it to just go ahead and include both versions? In my current /boot/kernel/kernel , it looks like there's 2675 bytes of CONFIG_AUTOGENERATED lines. My original config file is 13540 bytes. I don't see that there's all that much pain in including both versions, maybe with an extra separator-line or two added in. And personally, I feel that both versions are useful to have. Then have OPTIONs for those who only wanted the original config, or only wanted the autogen'ed version, or who don't want either version. -- Garance Alistair Drosehn = drosehn@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 09:52:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2C391065676; Sat, 16 Jan 2010 09:52:49 +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 8C6D98FC0C; Sat, 16 Jan 2010 09:52: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 o0G9qn8g059158; Sat, 16 Jan 2010 09:52:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0G9qnLl059144; Sat, 16 Jan 2010 09:52:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001160952.o0G9qnLl059144@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 16 Jan 2010 09:52: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: r202437 - in head: etc/mtree include sbin/geom/class sbin/geom/class/mountver sbin/geom/core sys/boot/forth sys/conf sys/geom/mountver sys/modules/geom sys/modules/geom/geom_mountver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 09:52:49 -0000 Author: trasz Date: Sat Jan 16 09:52:49 2010 New Revision: 202437 URL: http://svn.freebsd.org/changeset/base/202437 Log: Add gmountver, disk mount verification GEOM class. Note that due to e.g. write throttling ('wdrain'), it can stall all the disk I/O instead of just the device it's configured for. Using it for removable media is therefore not a good idea. Reviewed by: pjd (earlier version) Added: head/sbin/geom/class/mountver/ head/sbin/geom/class/mountver/Makefile (contents, props changed) head/sbin/geom/class/mountver/geom_mountver.c (contents, props changed) head/sbin/geom/class/mountver/gmountver.8 (contents, props changed) head/sys/geom/mountver/ head/sys/geom/mountver/g_mountver.c (contents, props changed) head/sys/geom/mountver/g_mountver.h (contents, props changed) head/sys/modules/geom/geom_mountver/ head/sys/modules/geom/geom_mountver/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/geom/class/Makefile head/sbin/geom/core/geom.8 head/sys/boot/forth/loader.conf head/sys/conf/files head/sys/modules/geom/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Jan 16 09:25:24 2010 (r202436) +++ head/etc/mtree/BSD.include.dist Sat Jan 16 09:52:49 2010 (r202437) @@ -174,6 +174,8 @@ .. mirror .. + mountver + .. multipath .. nop Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Jan 16 09:25:24 2010 (r202436) +++ head/include/Makefile Sat Jan 16 09:52:49 2010 (r202437) @@ -46,7 +46,7 @@ LSUBDIRS= cam/ata cam/scsi \ fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ - geom/mirror geom/multipath geom/nop \ + geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid3 geom/shsec geom/stripe geom/virstor \ netgraph/atm netgraph/netflow \ security/audit \ Modified: head/sbin/geom/class/Makefile ============================================================================== --- head/sbin/geom/class/Makefile Sat Jan 16 09:25:24 2010 (r202436) +++ head/sbin/geom/class/Makefile Sat Jan 16 09:52:49 2010 (r202437) @@ -10,6 +10,7 @@ SUBDIR+=eli SUBDIR+=journal SUBDIR+=label SUBDIR+=mirror +SUBDIR+=mountver SUBDIR+=multipath SUBDIR+=nop SUBDIR+=part Added: head/sbin/geom/class/mountver/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/mountver/Makefile Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../misc + +CLASS= mountver + +.include Added: head/sbin/geom/class/mountver/geom_mountver.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/mountver/geom_mountver.c Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2010 Edward Tomasz Napierala + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "core/geom.h" + + +uint32_t lib_version = G_LIB_VERSION; +uint32_t version = G_MOUNTVER_VERSION; + +struct g_command class_commands[] = { + { "create", G_FLAG_VERBOSE | G_FLAG_LOADKLD, NULL, + { + G_OPT_SENTINEL + }, + NULL, "[-v] dev ..." + }, + { "destroy", G_FLAG_VERBOSE, NULL, + { + { 'f', "force", NULL, G_TYPE_BOOL }, + G_OPT_SENTINEL + }, + NULL, "[-fv] prov ..." + }, + G_CMD_SENTINEL +}; Added: head/sbin/geom/class/mountver/gmountver.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/mountver/gmountver.8 Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,129 @@ +.\"- +.\" Copyright (c) 2010 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD 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 January 14, 2010 +.Dt GMOUNTVER 8 +.Os +.Sh NAME +.Nm gmountver +.Nd "control utility for disk mount verification GEOM class" +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl v +.Ar dev ... +.Nm +.Cm destroy +.Op Fl fv +.Ar prov ... +.Nm +.Cm list +.Nm +.Cm status +.Op Fl s Ar name +.Nm +.Cm load +.Op Fl v +.Nm +.Cm unload +.Op Fl v +.Sh DESCRIPTION +The +.Nm +utility is used to control mount verification GEOM class. +When configured, it passes all the I/O requests to the underlying provider. +When the underlying provider disappears - for example because the disk device +got disconnected - it queues all the I/O requests and waits for the provider +to reappear. +When that happens, it attaches to it and sends the queued requests. +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm destroy" +.It Cm create +Cache the given devices with specified +.Ar name . +The kernel module +.Pa geom_mountver.ko +will be loaded if it is not loaded already. +.It Cm destroy +Destroy +.Ar name . +.It Cm list +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . +.It Cm load +See +.Xr geom 8 . +.It Cm unload +See +.Xr geom 8 . +.El +.Pp +Additional options: +.Bl -tag -width indent +.It Fl f +Force the removal of the specified mountver device. +.It Fl v +Be more verbose. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to control the behavior of the +.Nm MOUNTVER +GEOM class. +The default value is shown next to each variable. +.Bl -tag -width indent +.It Va kern.geom.mountver.debug : No 0 +Debug level of the +.Nm MOUNTVER +GEOM class. +This can be set to a number between 0 and 3 inclusive. +If set to 0 minimal debug information is printed, and if set to 3 the +maximum amount of debug information is printed. +.It Va kern.geom.mountver.check.check_ident : No 1 +This can be set to 0 or 1. If set to 0, +.Nm +will reattach to the device even if the device reports different disk ID. +.El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. +.Sh SEE ALSO +.Xr geom 4 , +.Xr geom 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.0 . +.Sh AUTHORS +.An Edward Tomasz Napierala Aq trasz@FreeBSD.org Modified: head/sbin/geom/core/geom.8 ============================================================================== --- head/sbin/geom/core/geom.8 Sat Jan 16 09:25:24 2010 (r202436) +++ head/sbin/geom/core/geom.8 Sat Jan 16 09:52:49 2010 (r202437) @@ -172,6 +172,7 @@ geom md unload .Xr gjournal 8 , .Xr glabel 8 , .Xr gmirror 8 , +.Xr gmountver 8 , .Xr gmultipath 8 , .Xr gnop 8 , .Xr gpart 8 , Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Jan 16 09:25:24 2010 (r202436) +++ head/sys/boot/forth/loader.conf Sat Jan 16 09:52:49 2010 (r202437) @@ -155,6 +155,7 @@ geom_label_load="NO" # File system labe geom_md_load="NO" # Memory disk driver (vnode/swap/malloc) (see # md(4), mdconfig(8)) geom_mirror_load="NO" # RAID1 disk driver (see gmirror(8)) +geom_mountver_load="NO" # Mount verification disk driver geom_nop_load="NO" # Transparent disk driver (see gnop(8)) geom_raid3_load="NO" # RAID3 disk driver (see graid3(8)) geom_shsec_load="NO" # Shared secret disk driver (see gshsec(8)) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 16 09:25:24 2010 (r202436) +++ head/sys/conf/files Sat Jan 16 09:52:49 2010 (r202437) @@ -1936,6 +1936,7 @@ geom/label/g_label_gpt.c optional geom_l geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror geom/mirror/g_mirror_ctl.c optional geom_mirror +geom/mountver/g_mountver.c optional geom_mountver geom/multipath/g_multipath.c optional geom_multipath geom/nop/g_nop.c optional geom_nop geom/part/g_part.c standard Added: head/sys/geom/mountver/g_mountver.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/mountver/g_mountver.c Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,646 @@ +/*- + * Copyright (c) 2010 Edward Tomasz Napierala + * Copyright (c) 2004-2006 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, mountver, CTLFLAG_RW, + 0, "GEOM_MOUNTVER stuff"); +static u_int g_mountver_debug = 0; +static u_int g_mountver_check_ident = 1; +SYSCTL_UINT(_kern_geom_mountver, OID_AUTO, debug, CTLFLAG_RW, + &g_mountver_debug, 0, "Debug level"); +SYSCTL_UINT(_kern_geom_mountver, OID_AUTO, check_ident, CTLFLAG_RW, + &g_mountver_check_ident, 0, "Check disk ident when reattaching"); + +static eventhandler_tag g_mountver_pre_sync = NULL; + +static void g_mountver_queue(struct bio *bp); +static void g_mountver_orphan(struct g_consumer *cp); +static int g_mountver_destroy(struct g_geom *gp, boolean_t force); +static g_taste_t g_mountver_taste; +static int g_mountver_destroy_geom(struct gctl_req *req, struct g_class *mp, + struct g_geom *gp); +static void g_mountver_config(struct gctl_req *req, struct g_class *mp, + const char *verb); +static void g_mountver_dumpconf(struct sbuf *sb, const char *indent, + struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); +static void g_mountver_init(struct g_class *mp); +static void g_mountver_fini(struct g_class *mp); + +struct g_class g_mountver_class = { + .name = G_MOUNTVER_CLASS_NAME, + .version = G_VERSION, + .ctlreq = g_mountver_config, + .taste = g_mountver_taste, + .destroy_geom = g_mountver_destroy_geom, + .init = g_mountver_init, + .fini = g_mountver_fini +}; + +static void +g_mountver_done(struct bio *bp) +{ + struct g_mountver_softc *sc; + struct g_geom *gp; + struct bio *pbp; + + if (bp->bio_error != ENXIO) { + g_std_done(bp); + return; + } + + /* + * When the device goes away, it's possible that few requests + * will be completed with ENXIO before g_mountver_orphan() + * gets called. To work around that, we have to queue requests + * that failed with ENXIO, in order to send them later. + */ + gp = bp->bio_from->geom; + sc = gp->softc; + + pbp = bp->bio_parent; + KASSERT(pbp->bio_to == LIST_FIRST(&gp->provider), + ("parent request was for someone else")); + g_destroy_bio(bp); + pbp->bio_inbed++; + g_mountver_queue(pbp); +} + +static void +g_mountver_send(struct bio *bp) +{ + struct g_geom *gp; + struct bio *cbp; + + gp = bp->bio_to->geom; + + cbp = g_clone_bio(bp); + if (cbp == NULL) { + g_io_deliver(bp, ENOMEM); + return; + } + + cbp->bio_done = g_mountver_done; + g_io_request(cbp, LIST_FIRST(&gp->consumer)); +} + +static void +g_mountver_queue(struct bio *bp) +{ + struct g_mountver_softc *sc; + struct g_geom *gp; + + gp = bp->bio_to->geom; + sc = gp->softc; + + mtx_lock(&sc->sc_mtx); + TAILQ_INSERT_TAIL(&sc->sc_queue, bp, bio_queue); + mtx_unlock(&sc->sc_mtx); +} + +static void +g_mountver_send_queued(struct g_geom *gp) +{ + struct g_mountver_softc *sc; + struct bio *bp; + + sc = gp->softc; + + mtx_lock(&sc->sc_mtx); + while ((bp = TAILQ_FIRST(&sc->sc_queue)) != NULL) { + TAILQ_REMOVE(&sc->sc_queue, bp, bio_queue); + G_MOUNTVER_LOGREQ(bp, "Sending queued request."); + g_mountver_send(bp); + } + mtx_unlock(&sc->sc_mtx); +} + +static void +g_mountver_discard_queued(struct g_geom *gp) +{ + struct g_mountver_softc *sc; + struct bio *bp; + + sc = gp->softc; + + mtx_lock(&sc->sc_mtx); + while ((bp = TAILQ_FIRST(&sc->sc_queue)) != NULL) { + TAILQ_REMOVE(&sc->sc_queue, bp, bio_queue); + G_MOUNTVER_LOGREQ(bp, "Discarding queued request."); + g_io_deliver(bp, ENXIO); + } + mtx_unlock(&sc->sc_mtx); +} + +static void +g_mountver_start(struct bio *bp) +{ + struct g_mountver_softc *sc; + struct g_geom *gp; + + gp = bp->bio_to->geom; + sc = gp->softc; + G_MOUNTVER_LOGREQ(bp, "Request received."); + + /* + * It is possible that some bios were returned with ENXIO, even though + * orphaning didn't happen yet. In that case, queue all subsequent + * requests in order to maintain ordering. + */ + if (sc->sc_orphaned || !TAILQ_EMPTY(&sc->sc_queue)) { + G_MOUNTVER_LOGREQ(bp, "Queueing request."); + g_mountver_queue(bp); + if (!sc->sc_orphaned) + g_mountver_send_queued(gp); + } else { + G_MOUNTVER_LOGREQ(bp, "Sending request."); + g_mountver_send(bp); + } +} + +static int +g_mountver_access(struct g_provider *pp, int dr, int dw, int de) +{ + struct g_mountver_softc *sc; + struct g_geom *gp; + struct g_consumer *cp; + + g_topology_assert(); + + gp = pp->geom; + cp = LIST_FIRST(&gp->consumer); + sc = gp->softc; + if (sc == NULL && dr <= 0 && dw <= 0 && de <= 0) + return (0); + KASSERT(sc != NULL, ("Trying to access withered provider \"%s\".", pp->name)); + + sc->sc_access_r += dr; + sc->sc_access_w += dw; + sc->sc_access_e += de; + + if (sc->sc_orphaned) + return (0); + + return (g_access(cp, dr, dw, de)); +} + +static int +g_mountver_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp) +{ + struct g_mountver_softc *sc; + struct g_geom *gp; + struct g_provider *newpp; + struct g_consumer *cp; + char name[64]; + int error; + int identsize = DISK_IDENT_SIZE; + + g_topology_assert(); + + gp = NULL; + newpp = NULL; + cp = NULL; + + snprintf(name, sizeof(name), "%s%s", pp->name, G_MOUNTVER_SUFFIX); + LIST_FOREACH(gp, &mp->geom, geom) { + if (strcmp(gp->name, name) == 0) { + gctl_error(req, "Provider %s already exists.", name); + return (EEXIST); + } + } + gp = g_new_geomf(mp, name); + if (gp == NULL) { + gctl_error(req, "Cannot create geom %s.", name); + return (ENOMEM); + } + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->sc_mtx, "gmountver", NULL, MTX_DEF); + TAILQ_INIT(&sc->sc_queue); + sc->sc_provider_name = strdup(pp->name, M_GEOM); + gp->softc = sc; + gp->start = g_mountver_start; + gp->orphan = g_mountver_orphan; + gp->access = g_mountver_access; + gp->dumpconf = g_mountver_dumpconf; + + newpp = g_new_providerf(gp, gp->name); + if (newpp == NULL) { + gctl_error(req, "Cannot create provider %s.", name); + error = ENOMEM; + goto fail; + } + newpp->mediasize = pp->mediasize; + newpp->sectorsize = pp->sectorsize; + + cp = g_new_consumer(gp); + if (cp == NULL) { + gctl_error(req, "Cannot create consumer for %s.", gp->name); + error = ENOMEM; + goto fail; + } + error = g_attach(cp, pp); + if (error != 0) { + gctl_error(req, "Cannot attach to provider %s.", pp->name); + goto fail; + } + error = g_access(cp, 1, 0, 0); + if (error != 0) { + gctl_error(req, "Cannot access provider %s.", pp->name); + goto fail; + } + error = g_io_getattr("GEOM::ident", cp, &identsize, sc->sc_ident); + g_access(cp, -1, 0, 0); + if (error != 0) { + if (g_mountver_check_ident) { + gctl_error(req, "Cannot get disk ident from %s; error = %d.", pp->name, error); + goto fail; + } + + G_MOUNTVER_DEBUG(0, "Cannot get disk ident from %s; error = %d.", pp->name, error); + sc->sc_ident[0] = '\0'; + } + + g_error_provider(newpp, 0); + G_MOUNTVER_DEBUG(0, "Device %s created.", gp->name); + return (0); +fail: + if (sc->sc_provider_name != NULL) + g_free(sc->sc_provider_name); + if (cp != NULL) { + if (cp->provider != NULL) + g_detach(cp); + g_destroy_consumer(cp); + } + if (newpp != NULL) + g_destroy_provider(newpp); + if (gp != NULL) { + if (gp->softc != NULL) + g_free(gp->softc); + g_destroy_geom(gp); + } + return (error); +} + +static int +g_mountver_destroy(struct g_geom *gp, boolean_t force) +{ + struct g_mountver_softc *sc; + struct g_provider *pp; + + g_topology_assert(); + if (gp->softc == NULL) + return (ENXIO); + sc = gp->softc; + pp = LIST_FIRST(&gp->provider); + if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { + if (force) { + G_MOUNTVER_DEBUG(0, "Device %s is still open, so it " + "can't be definitely removed.", pp->name); + } else { + G_MOUNTVER_DEBUG(1, "Device %s is still open (r%dw%de%d).", + pp->name, pp->acr, pp->acw, pp->ace); + return (EBUSY); + } + } else { + G_MOUNTVER_DEBUG(0, "Device %s removed.", gp->name); + } + g_orphan_provider(pp, ENXIO); + g_mountver_discard_queued(gp); + g_free(sc->sc_provider_name); + g_free(gp->softc); + gp->softc = NULL; + g_wither_geom(gp, ENXIO); + + return (0); +} + +static int +g_mountver_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) +{ + + return (g_mountver_destroy(gp, 0)); +} + +static void +g_mountver_ctl_create(struct gctl_req *req, struct g_class *mp) +{ + struct g_provider *pp; + const char *name; + char param[16]; + int i, *nargs; + + g_topology_assert(); + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument", "nargs"); + return; + } + if (*nargs <= 0) { + gctl_error(req, "Missing device(s)."); + return; + } + for (i = 0; i < *nargs; i++) { + snprintf(param, sizeof(param), "arg%d", i); + name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%d' argument", i); + return; + } + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + pp = g_provider_by_name(name); + if (pp == NULL) { + G_MOUNTVER_DEBUG(1, "Provider %s is invalid.", name); + gctl_error(req, "Provider %s is invalid.", name); + return; + } + if (g_mountver_create(req, mp, pp) != 0) + return; + } +} + +static struct g_geom * +g_mountver_find_geom(struct g_class *mp, const char *name) +{ + struct g_geom *gp; + + LIST_FOREACH(gp, &mp->geom, geom) { + if (strcmp(gp->name, name) == 0) + return (gp); + } + return (NULL); +} + +static void +g_mountver_ctl_destroy(struct gctl_req *req, struct g_class *mp) +{ + int *nargs, *force, error, i; + struct g_geom *gp; + const char *name; + char param[16]; + + g_topology_assert(); + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument", "nargs"); + return; + } + if (*nargs <= 0) { + gctl_error(req, "Missing device(s)."); + return; + } + force = gctl_get_paraml(req, "force", sizeof(*force)); + if (force == NULL) { + gctl_error(req, "No 'force' argument"); + return; + } + + for (i = 0; i < *nargs; i++) { + snprintf(param, sizeof(param), "arg%d", i); + name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%d' argument", i); + return; + } + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + gp = g_mountver_find_geom(mp, name); + if (gp == NULL) { + G_MOUNTVER_DEBUG(1, "Device %s is invalid.", name); + gctl_error(req, "Device %s is invalid.", name); + return; + } + error = g_mountver_destroy(gp, *force); + if (error != 0) { + gctl_error(req, "Cannot destroy device %s (error=%d).", + gp->name, error); + return; + } + } +} + +static void +g_mountver_orphan(struct g_consumer *cp) +{ + struct g_mountver_softc *sc; + + g_topology_assert(); + + sc = cp->geom->softc; + sc->sc_orphaned = 1; + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + g_access(cp, -cp->acr, -cp->acw, -cp->ace); + g_detach(cp); + G_MOUNTVER_DEBUG(0, "%s is offline. Mount verification in progress.", sc->sc_provider_name); +} + +static int +g_mountver_ident_matches(struct g_geom *gp) +{ + struct g_consumer *cp; + struct g_mountver_softc *sc; + char ident[DISK_IDENT_SIZE]; + int error, identsize = DISK_IDENT_SIZE; + + sc = gp->softc; + cp = LIST_FIRST(&gp->consumer); + + if (g_mountver_check_ident == 0) + return (0); + + error = g_access(cp, 1, 0, 0); + if (error != 0) { + G_MOUNTVER_DEBUG(0, "Cannot access %s; " + "not attaching; error = %d.", gp->name, error); + return (1); + } + error = g_io_getattr("GEOM::ident", cp, &identsize, ident); + g_access(cp, -1, 0, 0); + if (error != 0) { + G_MOUNTVER_DEBUG(0, "Cannot get disk ident for %s; " + "not attaching; error = %d.", gp->name, error); + return (1); + } + if (strcmp(ident, sc->sc_ident) != 0) { + G_MOUNTVER_DEBUG(1, "Disk ident for %s (\"%s\") is different " + "from expected \"%s\", not attaching.", gp->name, ident, + sc->sc_ident); + return (1); + } + + return (0); +} + +static struct g_geom * +g_mountver_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) +{ + struct g_mountver_softc *sc; + struct g_consumer *cp; + struct g_geom *gp; + int error; + + g_topology_assert(); + g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); + G_MOUNTVER_DEBUG(2, "Tasting %s.", pp->name); + + /* + * Let's check if device already exists. + */ + LIST_FOREACH(gp, &mp->geom, geom) { + sc = gp->softc; + if (sc == NULL) + continue; + + /* Already attached? */ + if (pp == LIST_FIRST(&gp->provider)) + return (NULL); + + if (sc->sc_orphaned && strcmp(pp->name, sc->sc_provider_name) == 0) + break; + } + if (gp == NULL) + return (NULL); + + cp = LIST_FIRST(&gp->consumer); + g_attach(cp, pp); + error = g_mountver_ident_matches(gp); + if (error != 0) { + g_detach(cp); + return (NULL); + } + if (sc->sc_access_r > 0 || sc->sc_access_w > 0 || sc->sc_access_e > 0) { + error = g_access(cp, sc->sc_access_r, sc->sc_access_w, sc->sc_access_e); + if (error != 0) { + G_MOUNTVER_DEBUG(0, "Cannot access %s; error = %d.", pp->name, error); + g_detach(cp); + return (NULL); + } + } + g_mountver_send_queued(gp); + sc->sc_orphaned = 0; + G_MOUNTVER_DEBUG(0, "%s has completed mount verification.", sc->sc_provider_name); + + return (gp); +} + +static void +g_mountver_config(struct gctl_req *req, struct g_class *mp, const char *verb) +{ + uint32_t *version; + + g_topology_assert(); + + version = gctl_get_paraml(req, "version", sizeof(*version)); + if (version == NULL) { + gctl_error(req, "No '%s' argument.", "version"); + return; + } + if (*version != G_MOUNTVER_VERSION) { + gctl_error(req, "Userland and kernel parts are out of sync."); + return; + } + + if (strcmp(verb, "create") == 0) { + g_mountver_ctl_create(req, mp); + return; + } else if (strcmp(verb, "destroy") == 0) { + g_mountver_ctl_destroy(req, mp); + return; + } + + gctl_error(req, "Unknown verb."); +} + +static void +g_mountver_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, + struct g_consumer *cp, struct g_provider *pp) +{ + struct g_mountver_softc *sc; + + if (pp != NULL || cp != NULL) + return; + + sc = gp->softc; + sbuf_printf(sb, "%s%s\n", indent, + sc->sc_orphaned ? "OFFLINE" : "ONLINE"); + sbuf_printf(sb, "%s%s\n", indent, sc->sc_provider_name); + sbuf_printf(sb, "%s%s\n", indent, sc->sc_ident); +} + +static void +g_mountver_shutdown_pre_sync(void *arg, int howto) +{ + struct g_class *mp; + struct g_geom *gp, *gp2; + + mp = arg; + DROP_GIANT(); + g_topology_lock(); + LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) + g_mountver_destroy(gp, 1); + g_topology_unlock(); + PICKUP_GIANT(); +} + +static void +g_mountver_init(struct g_class *mp) +{ + + g_mountver_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, + g_mountver_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_mountver_pre_sync == NULL) + G_MOUNTVER_DEBUG(0, "Warning! Cannot register shutdown event."); +} + +static void +g_mountver_fini(struct g_class *mp) +{ + + if (g_mountver_pre_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_mountver_pre_sync); +} + +DECLARE_GEOM_CLASS(g_mountver_class, g_mountver); Added: head/sys/geom/mountver/g_mountver.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/mountver/g_mountver.h Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2010 Edward Tomasz Napierala + * Copyright (c) 2004-2006 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 _G_MOUNTVER_H_ +#define _G_MOUNTVER_H_ + +#define G_MOUNTVER_CLASS_NAME "MOUNTVER" +#define G_MOUNTVER_VERSION 4 +#define G_MOUNTVER_SUFFIX ".mountver" + +#ifdef _KERNEL + +#define G_MOUNTVER_DEBUG(lvl, ...) do { \ + if (g_mountver_debug >= (lvl)) { \ + printf("GEOM_MOUNTVER"); \ + if (g_mountver_debug > 0) \ + printf("[%u]", lvl); \ + printf(": "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ + } \ +} while (0) +#define G_MOUNTVER_LOGREQ(bp, ...) do { \ + if (g_mountver_debug >= 2) { \ + printf("GEOM_MOUNTVER[2]: "); \ + printf(__VA_ARGS__); \ + printf(" "); \ + g_print_bio(bp); \ + printf("\n"); \ + } \ +} while (0) + +struct g_mountver_softc { + TAILQ_HEAD(, bio) sc_queue; + struct mtx sc_mtx; + char *sc_provider_name; + char sc_ident[DISK_IDENT_SIZE]; + int sc_orphaned; + int sc_access_r; + int sc_access_w; + int sc_access_e; +}; +#endif /* _KERNEL */ + +#endif /* _G_MOUNTVER_H_ */ Modified: head/sys/modules/geom/Makefile ============================================================================== --- head/sys/modules/geom/Makefile Sat Jan 16 09:25:24 2010 (r202436) +++ head/sys/modules/geom/Makefile Sat Jan 16 09:52:49 2010 (r202437) @@ -13,6 +13,7 @@ SUBDIR= geom_bde \ geom_linux_lvm \ geom_mbr \ geom_mirror \ + geom_mountver \ geom_multipath \ geom_nop \ geom_part \ Added: head/sys/modules/geom/geom_mountver/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/geom/geom_mountver/Makefile Sat Jan 16 09:52:49 2010 (r202437) @@ -0,0 +1,8 @@ +# $FreeBSD$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 12:20:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F3C106566C; Sat, 16 Jan 2010 12:20:26 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B58B38FC1D; Sat, 16 Jan 2010 12:20: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 o0GCKQfT093508; Sat, 16 Jan 2010 12:20:26 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GCKQaF093505; Sat, 16 Jan 2010 12:20:26 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001161220.o0GCKQaF093505@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 12:20: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: r202440 - in head: share/mk usr.sbin/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 12:20:26 -0000 Author: antoine Date: Sat Jan 16 12:20:26 2010 New Revision: 202440 URL: http://svn.freebsd.org/changeset/base/202440 Log: Unbreak world WITHOUT_NETGRAPH. PR: 137487 Submitted by: bf (previous version) No objections: net@ MFC after: 2 weeks Modified: head/share/mk/bsd.own.mk head/usr.sbin/ppp/Makefile Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat Jan 16 12:18:44 2010 (r202439) +++ head/share/mk/bsd.own.mk Sat Jan 16 12:20:26 2010 (r202440) @@ -468,6 +468,11 @@ MK_MAILWRAPPER:= no MK_SENDMAIL:= no .endif +.if ${MK_NETGRAPH} == "no" +MK_ATM:= no +MK_BLUETOOTH:= no +.endif + .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no Modified: head/usr.sbin/ppp/Makefile ============================================================================== --- head/usr.sbin/ppp/Makefile Sat Jan 16 12:18:44 2010 (r202439) +++ head/usr.sbin/ppp/Makefile Sat Jan 16 12:20:26 2010 (r202440) @@ -25,6 +25,9 @@ PPP_NO_SUID= .if ${MK_ATM} == "no" PPP_NO_ATM= .endif +.if ${MK_NETGRAPH} == "no" +PPP_NO_NETGRAPH= +.endif .if ${MK_PAM_SUPPORT} == "no" PPP_NO_PAM= .endif From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 12:24:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A128C106568F; Sat, 16 Jan 2010 12:24:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905CF8FC1B; Sat, 16 Jan 2010 12:24: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 o0GCOCDt094362; Sat, 16 Jan 2010 12:24:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GCOCOI094360; Sat, 16 Jan 2010 12:24:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001161224.o0GCOCOI094360@svn.freebsd.org> From: Attilio Rao Date: Sat, 16 Jan 2010 12:24: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: r202441 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 12:24:12 -0000 Author: attilio Date: Sat Jan 16 12:24:12 2010 New Revision: 202441 URL: http://svn.freebsd.org/changeset/base/202441 Log: Unbreak the build for pc98. Specify the newly introduced, for ia32, DEV_ATPIC also for pc98. Pointy hat to: me Modified: head/sys/conf/options.pc98 Modified: head/sys/conf/options.pc98 ============================================================================== --- head/sys/conf/options.pc98 Sat Jan 16 12:20:26 2010 (r202440) +++ head/sys/conf/options.pc98 Sat Jan 16 12:24:12 2010 (r202441) @@ -90,6 +90,7 @@ PC98 opt_global.h # Device options DEV_APIC opt_apic.h +DEV_ATPIC opt_atpic.h DEV_MECIA opt_mecia.h DEV_NPX opt_npx.h From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 12:27:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83C601065672; Sat, 16 Jan 2010 12:27:15 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72CDE8FC14; Sat, 16 Jan 2010 12: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 o0GCRFhx095047; Sat, 16 Jan 2010 12:27:15 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GCRF6w095045; Sat, 16 Jan 2010 12:27:15 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001161227.o0GCRF6w095045@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 12:27: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: r202442 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 12:27:15 -0000 Author: antoine Date: Sat Jan 16 12:27:15 2010 New Revision: 202442 URL: http://svn.freebsd.org/changeset/base/202442 Log: regen MFC after: 2 weeks Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Jan 16 12:24:12 2010 (r202441) +++ head/share/man/man5/src.conf.5 Sat Jan 16 12:27:15 2010 (r202442) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd June 1, 2009 +.Dd January 16, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -584,6 +584,10 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_ATM +.It +.Va WITHOUT_BLUETOOTH +.It .Va WITHOUT_NETGRAPH_SUPPORT .El .It Va WITHOUT_NETGRAPH_SUPPORT From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 13:09:48 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2CC21065692; Sat, 16 Jan 2010 13:09:48 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 605D88FC1E; Sat, 16 Jan 2010 13:09:48 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id o0GD9gL5017384; Sat, 16 Jan 2010 22:09:44 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sat, 16 Jan 2010 22:08:40 +0900 (JST) Message-Id: <20100116.220840.91363215.nyan@FreeBSD.org> To: attilio@FreeBSD.org From: TAKAHASHI Yoshihiro In-Reply-To: <201001161224.o0GCOCOI094360@svn.freebsd.org> References: <201001161224.o0GCOCOI094360@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sat_Jan_16_22_08_40_2010_213)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r202441 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 13:09:48 -0000 ----Next_Part(Sat_Jan_16_22_08_40_2010_213)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In article <201001161224.o0GCOCOI094360@svn.freebsd.org> Attilio Rao writes: > Log: > Unbreak the build for pc98. Specify the newly introduced, for ia32, > DEV_ATPIC also for pc98. This is not enough to real fix since DEV_ATPIC is never defined on pc98. I attached my incomplete patch. Even with this change, it's error if the apic device (and SMP option) is not defined in a kernel config file. BTW, the same problem exists on i386. --- TAKAHASHI Yoshihiro ----Next_Part(Sat_Jan_16_22_08_40_2010_213)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.diff" Index: conf/files.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.pc98,v retrieving revision 1.377 diff -u -r1.377 files.pc98 --- conf/files.pc98 26 Sep 2009 12:45:28 -0000 1.377 +++ conf/files.pc98 16 Jan 2010 12:41:17 -0000 @@ -194,7 +194,7 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 -i386/isa/atpic.c standard +i386/isa/atpic.c optional atpic #i386/isa/atpic_vector.s standard i386/isa/elink.c optional ep | ie i386/isa/isa.c optional isa @@ -240,7 +240,7 @@ pc98/cbus/nmi.c standard pc98/cbus/olpt.c optional olpt pc98/cbus/pckbd.c optional pckbd -pc98/cbus/pcrtc.c standard +pc98/cbus/pcrtc.c optional atpic pc98/cbus/pmc.c optional pmc pc98/cbus/scgdcrndr.c optional sc gdc pc98/cbus/scterm-sck.c optional sc Index: conf/options.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/options.pc98,v retrieving revision 1.206 diff -u -r1.206 options.pc98 --- conf/options.pc98 13 Aug 2009 17:09:45 -0000 1.206 +++ conf/options.pc98 16 Jan 2010 12:41:17 -0000 @@ -90,6 +90,7 @@ # Device options DEV_APIC opt_apic.h +DEV_ATPIC opt_atpic.h DEV_MECIA opt_mecia.h DEV_NPX opt_npx.h Index: pc98/conf/DEFAULTS =================================================================== RCS file: /home/ncvs/src/sys/pc98/conf/DEFAULTS,v retrieving revision 1.15 diff -u -r1.15 DEFAULTS --- pc98/conf/DEFAULTS 4 Jan 2010 21:30:04 -0000 1.15 +++ pc98/conf/DEFAULTS 16 Jan 2010 12:41:27 -0000 @@ -24,3 +24,6 @@ # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 + +# enable support for native hardware +device atpic ----Next_Part(Sat_Jan_16_22_08_40_2010_213)---- From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 14:31:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B84F1065670; Sat, 16 Jan 2010 14:31:02 +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 3BB8B8FC1C; Sat, 16 Jan 2010 14:31: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 o0GEV2rd022121; Sat, 16 Jan 2010 14:31:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GEV2J7022119; Sat, 16 Jan 2010 14:31:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001161431.o0GEV2J7022119@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 16 Jan 2010 14:31: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: r202443 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 14:31:02 -0000 Author: gavin Date: Sat Jan 16 14:31:01 2010 New Revision: 202443 URL: http://svn.freebsd.org/changeset/base/202443 Log: Xref sysctl(3) Approved by: ed (mentor) Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sat Jan 16 12:27:15 2010 (r202442) +++ head/share/man/man9/sysctl.9 Sat Jan 16 14:31:01 2010 (r202443) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2006 +.Dd January 16, 2010 .Dt SYSCTL 9 .Os .Sh NAME @@ -282,6 +282,7 @@ A temporary sysctl node that should not as such by a leading underscore character in its name. For example: .Va _dirty_hack . .Sh SEE ALSO +.Xr sysctl 3 , .Xr sysctl 8 , .Xr sysctl_add_oid 9 , .Xr sysctl_ctx_free 9 , From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 14:32:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78727106566B; Sat, 16 Jan 2010 14:32:02 +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 688158FC08; Sat, 16 Jan 2010 14:32: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 o0GEW2AQ022397; Sat, 16 Jan 2010 14:32:02 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GEW2IA022395; Sat, 16 Jan 2010 14:32:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001161432.o0GEW2IA022395@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 16 Jan 2010 14:32: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: r202444 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 14:32:02 -0000 Author: gavin Date: Sat Jan 16 14:32:02 2010 New Revision: 202444 URL: http://svn.freebsd.org/changeset/base/202444 Log: Fix loader.conf(5) Xref Approved by: ed (mentor, implicit) Modified: head/share/man/man4/epair.4 Modified: head/share/man/man4/epair.4 ============================================================================== --- head/share/man/man4/epair.4 Sat Jan 16 14:31:01 2010 (r202443) +++ head/share/man/man4/epair.4 Sat Jan 16 14:32:02 2010 (r202444) @@ -104,7 +104,7 @@ support on top of it. .Xr bpf 4 , .Xr if_bridge 4 , .Xr vlan 4 , -.Xr loader.conf 5, +.Xr loader.conf 5 , .Xr rc.conf 5 , .Xr ifconfig 8 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 14:33:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3922B1065672; Sat, 16 Jan 2010 14:33:23 +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 2964D8FC0A; Sat, 16 Jan 2010 14:33: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 o0GEXNnl022742; Sat, 16 Jan 2010 14:33:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GEXNdD022740; Sat, 16 Jan 2010 14:33:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001161433.o0GEXNdD022740@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 16 Jan 2010 14:33: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: r202445 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 14:33:23 -0000 Author: gavin Date: Sat Jan 16 14:33:22 2010 New Revision: 202445 URL: http://svn.freebsd.org/changeset/base/202445 Log: Fix HISTORY section to detail the history of the driver, not the man page. Approved by: ed (mentor, implicit) Modified: head/share/man/man4/sysmouse.4 Modified: head/share/man/man4/sysmouse.4 ============================================================================== --- head/share/man/man4/sysmouse.4 Sat Jan 16 14:32:02 2010 (r202444) +++ head/share/man/man4/sysmouse.4 Sat Jan 16 14:33:22 2010 (r202445) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 1997 +.Dd January 16, 2010 .Dt SYSMOUSE 4 .Os .Sh NAME @@ -467,7 +467,7 @@ virtual consoles .Sh HISTORY The .Nm -manual page example first appeared in +driver first appeared in .Fx 2.2 . .Sh AUTHORS .An -nosplit From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 15:36:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 870E31065672; Sat, 16 Jan 2010 15:36:21 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 99FB88FC0A; Sat, 16 Jan 2010 15:36:20 +0000 (UTC) Received: by fxm27 with SMTP id 27so999483fxm.3 for ; Sat, 16 Jan 2010 07:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=U6JrlyKUxo5NBAl3Vd3tpmf8NdxOF6/xhY9J8kdhQa8=; b=e6kbeqzIRrH6efdZOh03GygI8iDrOtd0avd+z6iKP17IBqJeB7NCbwVA1NKKVkhlWj bWC/d2M4iwofSA7dP+of+zmQ0J/5bsS+Q8ipEZ1PDemUfRMGTLO+bxJBhKHC9YkeBvZl dZjClCMrJiiqRhB6M5CqrCkdWj6hD7sGi13xI= 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=YmgqpUmu66CaxyezQ2TxIUrAPwv/uzZzjUvA7zQm4cDYYrjqR9QW2qSAzU6zNlaqxe wX3VkZtkAbeVK5WK17jc0mJXwHR91MWnK2zBuo+c+57qlAjIRtIsQgtheLJ9NpLuV2pe XUX9xjRApPalq9QU7RlujUMtPKvhWOF8A7eF4= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.4.84 with SMTP id 20mr4280916faq.97.1263656176611; Sat, 16 Jan 2010 07:36:16 -0800 (PST) In-Reply-To: <20100116.220840.91363215.nyan@FreeBSD.org> References: <201001161224.o0GCOCOI094360@svn.freebsd.org> <20100116.220840.91363215.nyan@FreeBSD.org> Date: Sat, 16 Jan 2010 16:36:16 +0100 X-Google-Sender-Auth: 80989bc2bb756f33 Message-ID: <3bbf2fe11001160736h185d8916ma0ba074f6a6a6dca@mail.gmail.com> From: Attilio Rao To: TAKAHASHI Yoshihiro 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: r202441 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 15:36:21 -0000 2010/1/16 TAKAHASHI Yoshihiro : > In article <201001161224.o0GCOCOI094360@svn.freebsd.org> > Attilio Rao writes: > >> Log: >> =C2=A0 Unbreak the build for pc98. Specify the newly introduced, for ia3= 2, >> =C2=A0 DEV_ATPIC also for pc98. > > This is not enough to real fix since DEV_ATPIC is never defined on > pc98. =C2=A0I attached my incomplete patch. =C2=A0Even with this change, = it's > error if the apic device (and SMP option) is not defined in a kernel > config file. > > BTW, the same problem exists on i386. Thanks for reporting this. This further patch should fix the problem for i386 and possibly pc98 (linked with your patch): http://www.freebsd.org/~attilio/atpic.diff Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 17:05:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC6CB1065692; Sat, 16 Jan 2010 17:05:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBD4E8FC0A; Sat, 16 Jan 2010 17:05: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 o0GH5R7c056242; Sat, 16 Jan 2010 17:05:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GH5ReU056240; Sat, 16 Jan 2010 17:05:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001161705.o0GH5ReU056240@svn.freebsd.org> From: Ed Schouten Date: Sat, 16 Jan 2010 17:05: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: r202447 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 17:05:27 -0000 Author: ed Date: Sat Jan 16 17:05:27 2010 New Revision: 202447 URL: http://svn.freebsd.org/changeset/base/202447 Log: Unexpose the old uname(3) function. Nowadays uname(3) is an inline function around __xuname(3). Prevent linkage of new binaries against this compatibility function, similar to what I did with ttyslot(3). Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/uname.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Jan 16 15:00:35 2010 (r202446) +++ head/lib/libc/gen/Symbol.map Sat Jan 16 17:05:27 2010 (r202447) @@ -296,7 +296,6 @@ FBSD_1.0 { tcflow; ualarm; ulimit; - uname; unvis; strunvis; strunvisx; Modified: head/lib/libc/gen/uname.c ============================================================================== --- head/lib/libc/gen/uname.c Sat Jan 16 15:00:35 2010 (r202446) +++ head/lib/libc/gen/uname.c Sat Jan 16 17:05:27 2010 (r202447) @@ -33,15 +33,15 @@ static char sccsid[] = "From: @(#)uname. #include __FBSDID("$FreeBSD$"); -#define uname wrapped_uname #include #include #include #include -#undef uname int -uname(struct utsname *name) +__uname(struct utsname *name) { return __xuname(32, name); } + +__sym_compat(uname, __uname, FBSD_1.0); From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 17:08:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8BB1065692; Sat, 16 Jan 2010 17:08:22 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69DF28FC13; Sat, 16 Jan 2010 17:08: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 o0GH8MNn056898; Sat, 16 Jan 2010 17:08:22 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GH8M88056896; Sat, 16 Jan 2010 17:08:22 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001161708.o0GH8M88056896@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 17:08: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: r202448 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 17:08:22 -0000 Author: antoine Date: Sat Jan 16 17:08:22 2010 New Revision: 202448 URL: http://svn.freebsd.org/changeset/base/202448 Log: Do not build netgraph kernel modules if WITHOUT_NETGRAPH is set in src.conf Submitted by: bf MFC after: 2 weeks Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Jan 16 17:05:27 2010 (r202447) +++ head/sys/modules/Makefile Sat Jan 16 17:08:22 2010 (r202448) @@ -192,7 +192,7 @@ SUBDIR= ${_3dfx} \ ${_ncp} \ ${_ncv} \ ${_ndis} \ - netgraph \ + ${_netgraph} \ ${_nfe} \ nfscl \ nfsclient \ @@ -327,6 +327,10 @@ _random= random _ipfilter= ipfilter .endif +.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES) +_netgraph= netgraph +.endif + .if ${MK_PF} != "no" || defined(ALL_MODULES) _pf= pf _pflog= pflog From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 20:04:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9237106568B; Sat, 16 Jan 2010 20:04:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5A178FC08; Sat, 16 Jan 2010 20:04: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 o0GK4HAT095647; Sat, 16 Jan 2010 20:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GK4H2s095640; Sat, 16 Jan 2010 20:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001162004.o0GK4H2s095640@svn.freebsd.org> From: Michael Tuexen Date: Sat, 16 Jan 2010 20:04:17 +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: r202449 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 20:04:17 -0000 Author: tuexen Date: Sat Jan 16 20:04:17 2010 New Revision: 202449 URL: http://svn.freebsd.org/changeset/base/202449 Log: Get rid of support of an old version of the SCTP-AUTH draft. Get rid of unused MD5 code. MFC after: 1 week Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_auth.c Sat Jan 16 20:04:17 2010 (r202449) @@ -456,21 +456,6 @@ sctp_compute_hashkey(sctp_key_t * key1, /* concatenate the keys */ if (sctp_compare_key(key1, key2) <= 0) { -#ifdef SCTP_AUTH_DRAFT_04 - /* key is key1 + shared + key2 */ - if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); - key_ptr += key1->keylen; - } - if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); - key_ptr += shared->keylen; - } - if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); - key_ptr += key2->keylen; - } -#else /* key is shared + key1 + key2 */ if (sctp_get_keylen(shared)) { bcopy(shared->key, key_ptr, shared->keylen); @@ -484,23 +469,7 @@ sctp_compute_hashkey(sctp_key_t * key1, bcopy(key2->key, key_ptr, key2->keylen); key_ptr += key2->keylen; } -#endif } else { -#ifdef SCTP_AUTH_DRAFT_04 - /* key is key2 + shared + key1 */ - if (sctp_get_keylen(key2)) { - bcopy(key2->key, key_ptr, key2->keylen); - key_ptr += key2->keylen; - } - if (sctp_get_keylen(shared)) { - bcopy(shared->key, key_ptr, shared->keylen); - key_ptr += shared->keylen; - } - if (sctp_get_keylen(key1)) { - bcopy(key1->key, key_ptr, key1->keylen); - key_ptr += key1->keylen; - } -#else /* key is shared + key2 + key1 */ if (sctp_get_keylen(shared)) { bcopy(shared->key, key_ptr, shared->keylen); @@ -514,7 +483,6 @@ sctp_compute_hashkey(sctp_key_t * key1, bcopy(key1->key, key_ptr, key1->keylen); key_ptr += key1->keylen; } -#endif } return (new_key); } @@ -739,7 +707,7 @@ sctp_auth_add_hmacid(sctp_hmaclist_t * l (hmac_id != SCTP_AUTH_HMAC_ID_SHA384) && (hmac_id != SCTP_AUTH_HMAC_ID_SHA512) && #endif - (hmac_id != SCTP_AUTH_HMAC_ID_MD5)) { + 1) { return (-1); } /* Now is it already in the list */ @@ -802,12 +770,6 @@ sctp_negotiate_hmacid(sctp_hmaclist_t * for (i = 0; i < peer->num_algo; i++) { for (j = 0; j < local->num_algo; j++) { if (peer->hmac[i] == local->hmac[j]) { -#ifndef SCTP_AUTH_DRAFT_04 - /* "skip" MD5 as it's been deprecated */ - if (peer->hmac[i] == SCTP_AUTH_HMAC_ID_MD5) - continue; -#endif - /* found the "best" one */ SCTPDBG(SCTP_DEBUG_AUTH1, "SCTP: negotiated peer HMAC id %u\n", @@ -911,8 +873,6 @@ sctp_get_hmac_digest_len(uint16_t hmac_a switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: return (SCTP_AUTH_DIGEST_LEN_SHA1); - case SCTP_AUTH_HMAC_ID_MD5: - return (SCTP_AUTH_DIGEST_LEN_MD5); #ifdef HAVE_SHA224 case SCTP_AUTH_HMAC_ID_SHA224: return (SCTP_AUTH_DIGEST_LEN_SHA224); @@ -936,7 +896,6 @@ sctp_get_hmac_block_len(uint16_t hmac_al { switch (hmac_algo) { case SCTP_AUTH_HMAC_ID_SHA1: - case SCTP_AUTH_HMAC_ID_MD5: #ifdef HAVE_SHA224 case SCTP_AUTH_HMAC_ID_SHA224: #endif @@ -962,9 +921,6 @@ sctp_hmac_init(uint16_t hmac_algo, sctp_ case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Init(&ctx->sha1); break; - case SCTP_AUTH_HMAC_ID_MD5: - MD5_Init(&ctx->md5); - break; #ifdef HAVE_SHA224 case SCTP_AUTH_HMAC_ID_SHA224: break; @@ -995,9 +951,6 @@ sctp_hmac_update(uint16_t hmac_algo, sct case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Update(&ctx->sha1, text, textlen); break; - case SCTP_AUTH_HMAC_ID_MD5: - MD5_Update(&ctx->md5, text, textlen); - break; #ifdef HAVE_SHA224 case SCTP_AUTH_HMAC_ID_SHA224: break; @@ -1028,9 +981,6 @@ sctp_hmac_final(uint16_t hmac_algo, sctp case SCTP_AUTH_HMAC_ID_SHA1: SHA1_Final(digest, &ctx->sha1); break; - case SCTP_AUTH_HMAC_ID_MD5: - MD5_Final(digest, &ctx->md5); - break; #ifdef HAVE_SHA224 case SCTP_AUTH_HMAC_ID_SHA224: break; @@ -1636,15 +1586,6 @@ sctp_auth_get_cookie_params(struct sctp_ (uint8_t *) & tmp_param); } /* concatenate the full random key */ -#ifdef SCTP_AUTH_DRAFT_04 - keylen = random_len; - new_key = sctp_alloc_key(keylen); - if (new_key != NULL) { - /* copy in the RANDOM */ - if (p_random != NULL) - bcopy(p_random->random_data, new_key->key, random_len); - } -#else keylen = sizeof(*p_random) + random_len + sizeof(*hmacs) + hmacs_len; if (chunks != NULL) { keylen += sizeof(*chunks) + num_chunks; @@ -1668,15 +1609,10 @@ sctp_auth_get_cookie_params(struct sctp_ sizeof(*hmacs) + hmacs_len); } } -#endif if (stcb->asoc.authinfo.random != NULL) sctp_free_key(stcb->asoc.authinfo.random); stcb->asoc.authinfo.random = new_key; stcb->asoc.authinfo.random_len = random_len; -#ifdef SCTP_AUTH_DRAFT_04 - /* don't include the chunks and hmacs for draft -04 */ - stcb->asoc.authinfo.random->keylen = random_len; -#endif sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.assoc_keyid); sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.recv_keyid); @@ -2143,11 +2079,6 @@ sctp_initialize_auth_params(struct sctp_ &stcb->asoc.shared_keys); /* now set the concatenated key (random + chunks + hmacs) */ -#ifdef SCTP_AUTH_DRAFT_04 - /* don't include the chunks and hmacs for draft -04 */ - keylen = random_len; - new_key = sctp_generate_random_key(keylen); -#else /* key includes parameter headers */ keylen = (3 * sizeof(struct sctp_paramhdr)) + random_len + chunks_len + hmacs_len; @@ -2188,436 +2119,8 @@ sctp_initialize_auth_params(struct sctp_ (void)sctp_serialize_hmaclist(stcb->asoc.local_hmacs, new_key->key + keylen); } -#endif if (stcb->asoc.authinfo.random != NULL) sctp_free_key(stcb->asoc.authinfo.random); stcb->asoc.authinfo.random = new_key; stcb->asoc.authinfo.random_len = random_len; } - - -#ifdef SCTP_HMAC_TEST -/* - * HMAC and key concatenation tests - */ -static void -sctp_print_digest(uint8_t * digest, uint32_t digestlen, const char *str) -{ - uint32_t i; - - printf("\n%s: 0x", str); - if (digest == NULL) - return; - - for (i = 0; i < digestlen; i++) - printf("%02x", digest[i]); -} - -static int -sctp_test_hmac(const char *str, uint16_t hmac_id, uint8_t * key, - uint32_t keylen, uint8_t * text, uint32_t textlen, - uint8_t * digest, uint32_t digestlen) -{ - uint8_t computed_digest[SCTP_AUTH_DIGEST_LEN_MAX]; - - printf("\n%s:", str); - sctp_hmac(hmac_id, key, keylen, text, textlen, computed_digest); - sctp_print_digest(digest, digestlen, "Expected digest"); - sctp_print_digest(computed_digest, digestlen, "Computed digest"); - if (memcmp(digest, computed_digest, digestlen) != 0) { - printf("\nFAILED"); - return (-1); - } else { - printf("\nPASSED"); - return (0); - } -} - - -/* - * RFC 2202: HMAC-SHA1 test cases - */ -void -sctp_test_hmac_sha1(void) -{ - uint8_t *digest; - uint8_t key[128]; - uint32_t keylen; - uint8_t text[128]; - uint32_t textlen; - uint32_t digestlen = 20; - int failed = 0; - - /*- - * test_case = 1 - * key = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b - * key_len = 20 - * data = "Hi There" - * data_len = 8 - * digest = 0xb617318655057264e28bc0b6fb378c8ef146be00 - */ - keylen = 20; - memset(key, 0x0b, keylen); - textlen = 8; - strcpy(text, "Hi There"); - digest = "\xb6\x17\x31\x86\x55\x05\x72\x64\xe2\x8b\xc0\xb6\xfb\x37\x8c\x8e\xf1\x46\xbe\x00"; - if (sctp_test_hmac("SHA1 test case 1", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 2 - * key = "Jefe" - * key_len = 4 - * data = "what do ya want for nothing?" - * data_len = 28 - * digest = 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79 - */ - keylen = 4; - strcpy(key, "Jefe"); - textlen = 28; - strcpy(text, "what do ya want for nothing?"); - digest = "\xef\xfc\xdf\x6a\xe5\xeb\x2f\xa2\xd2\x74\x16\xd5\xf1\x84\xdf\x9c\x25\x9a\x7c\x79"; - if (sctp_test_hmac("SHA1 test case 2", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 3 - * key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - * key_len = 20 - * data = 0xdd repeated 50 times - * data_len = 50 - * digest = 0x125d7342b9ac11cd91a39af48aa17b4f63f175d3 - */ - keylen = 20; - memset(key, 0xaa, keylen); - textlen = 50; - memset(text, 0xdd, textlen); - digest = "\x12\x5d\x73\x42\xb9\xac\x11\xcd\x91\xa3\x9a\xf4\x8a\xa1\x7b\x4f\x63\xf1\x75\xd3"; - if (sctp_test_hmac("SHA1 test case 3", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 4 - * key = 0x0102030405060708090a0b0c0d0e0f10111213141516171819 - * key_len = 25 - * data = 0xcd repeated 50 times - * data_len = 50 - * digest = 0x4c9007f4026250c6bc8414f9bf50c86c2d7235da - */ - keylen = 25; - memcpy(key, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", keylen); - textlen = 50; - memset(text, 0xcd, textlen); - digest = "\x4c\x90\x07\xf4\x02\x62\x50\xc6\xbc\x84\x14\xf9\xbf\x50\xc8\x6c\x2d\x72\x35\xda"; - if (sctp_test_hmac("SHA1 test case 4", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 5 - * key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c - * key_len = 20 - * data = "Test With Truncation" - * data_len = 20 - * digest = 0x4c1a03424b55e07fe7f27be1d58bb9324a9a5a04 - * digest-96 = 0x4c1a03424b55e07fe7f27be1 - */ - keylen = 20; - memset(key, 0x0c, keylen); - textlen = 20; - strcpy(text, "Test With Truncation"); - digest = "\x4c\x1a\x03\x42\x4b\x55\xe0\x7f\xe7\xf2\x7b\xe1\xd5\x8b\xb9\x32\x4a\x9a\x5a\x04"; - if (sctp_test_hmac("SHA1 test case 5", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 6 - * key = 0xaa repeated 80 times - * key_len = 80 - * data = "Test Using Larger Than Block-Size Key - Hash Key First" - * data_len = 54 - * digest = 0xaa4ae5e15272d00e95705637ce8a3b55ed402112 - */ - keylen = 80; - memset(key, 0xaa, keylen); - textlen = 54; - strcpy(text, "Test Using Larger Than Block-Size Key - Hash Key First"); - digest = "\xaa\x4a\xe5\xe1\x52\x72\xd0\x0e\x95\x70\x56\x37\xce\x8a\x3b\x55\xed\x40\x21\x12"; - if (sctp_test_hmac("SHA1 test case 6", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 7 - * key = 0xaa repeated 80 times - * key_len = 80 - * data = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" - * data_len = 73 - * digest = 0xe8e99d0f45237d786d6bbaa7965c7808bbff1a91 - */ - keylen = 80; - memset(key, 0xaa, keylen); - textlen = 73; - strcpy(text, "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"); - digest = "\xe8\xe9\x9d\x0f\x45\x23\x7d\x78\x6d\x6b\xba\xa7\x96\x5c\x78\x08\xbb\xff\x1a\x91"; - if (sctp_test_hmac("SHA1 test case 7", SCTP_AUTH_HMAC_ID_SHA1, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /* done with all tests */ - if (failed) - printf("\nSHA1 test results: %d cases failed", failed); - else - printf("\nSHA1 test results: all test cases passed"); -} - -/* - * RFC 2202: HMAC-MD5 test cases - */ -void -sctp_test_hmac_md5(void) -{ - uint8_t *digest; - uint8_t key[128]; - uint32_t keylen; - uint8_t text[128]; - uint32_t textlen; - uint32_t digestlen = 16; - int failed = 0; - - /*- - * test_case = 1 - * key = 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b - * key_len = 16 - * data = "Hi There" - * data_len = 8 - * digest = 0x9294727a3638bb1c13f48ef8158bfc9d - */ - keylen = 16; - memset(key, 0x0b, keylen); - textlen = 8; - strcpy(text, "Hi There"); - digest = "\x92\x94\x72\x7a\x36\x38\xbb\x1c\x13\xf4\x8e\xf8\x15\x8b\xfc\x9d"; - if (sctp_test_hmac("MD5 test case 1", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 2 - * key = "Jefe" - * key_len = 4 - * data = "what do ya want for nothing?" - * data_len = 28 - * digest = 0x750c783e6ab0b503eaa86e310a5db738 - */ - keylen = 4; - strcpy(key, "Jefe"); - textlen = 28; - strcpy(text, "what do ya want for nothing?"); - digest = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7\x38"; - if (sctp_test_hmac("MD5 test case 2", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 3 - * key = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - * key_len = 16 - * data = 0xdd repeated 50 times - * data_len = 50 - * digest = 0x56be34521d144c88dbb8c733f0e8b3f6 - */ - keylen = 16; - memset(key, 0xaa, keylen); - textlen = 50; - memset(text, 0xdd, textlen); - digest = "\x56\xbe\x34\x52\x1d\x14\x4c\x88\xdb\xb8\xc7\x33\xf0\xe8\xb3\xf6"; - if (sctp_test_hmac("MD5 test case 3", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 4 - * key = 0x0102030405060708090a0b0c0d0e0f10111213141516171819 - * key_len = 25 - * data = 0xcd repeated 50 times - * data_len = 50 - * digest = 0x697eaf0aca3a3aea3a75164746ffaa79 - */ - keylen = 25; - memcpy(key, "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19", keylen); - textlen = 50; - memset(text, 0xcd, textlen); - digest = "\x69\x7e\xaf\x0a\xca\x3a\x3a\xea\x3a\x75\x16\x47\x46\xff\xaa\x79"; - if (sctp_test_hmac("MD5 test case 4", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 5 - * key = 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c - * key_len = 16 - * data = "Test With Truncation" - * data_len = 20 - * digest = 0x56461ef2342edc00f9bab995690efd4c - * digest-96 = 0x56461ef2342edc00f9bab995 - */ - keylen = 16; - memset(key, 0x0c, keylen); - textlen = 20; - strcpy(text, "Test With Truncation"); - digest = "\x56\x46\x1e\xf2\x34\x2e\xdc\x00\xf9\xba\xb9\x95\x69\x0e\xfd\x4c"; - if (sctp_test_hmac("MD5 test case 5", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 6 - * key = 0xaa repeated 80 times - * key_len = 80 - * data = "Test Using Larger Than Block-Size Key - Hash Key First" - * data_len = 54 - * digest = 0x6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd - */ - keylen = 80; - memset(key, 0xaa, keylen); - textlen = 54; - strcpy(text, "Test Using Larger Than Block-Size Key - Hash Key First"); - digest = "\x6b\x1a\xb7\xfe\x4b\xd7\xbf\x8f\x0b\x62\xe6\xce\x61\xb9\xd0\xcd"; - if (sctp_test_hmac("MD5 test case 6", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /*- - * test_case = 7 - * key = 0xaa repeated 80 times - * key_len = 80 - * data = "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data" - * data_len = 73 - * digest = 0x6f630fad67cda0ee1fb1f562db3aa53e - */ - keylen = 80; - memset(key, 0xaa, keylen); - textlen = 73; - strcpy(text, "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"); - digest = "\x6f\x63\x0f\xad\x67\xcd\xa0\xee\x1f\xb1\xf5\x62\xdb\x3a\xa5\x3e"; - if (sctp_test_hmac("MD5 test case 7", SCTP_AUTH_HMAC_ID_MD5, key, keylen, - text, textlen, digest, digestlen) < 0) - failed++; - - /* done with all tests */ - if (failed) - printf("\nMD5 test results: %d cases failed", failed); - else - printf("\nMD5 test results: all test cases passed"); -} - -/* - * test assoc key concatenation - */ -static int -sctp_test_key_concatenation(sctp_key_t * key1, sctp_key_t * key2, - sctp_key_t * expected_key) -{ - sctp_key_t *key; - int ret_val; - - sctp_show_key(key1, "\nkey1"); - sctp_show_key(key2, "\nkey2"); - key = sctp_compute_hashkey(key1, key2, NULL); - sctp_show_key(expected_key, "\nExpected"); - sctp_show_key(key, "\nComputed"); - if (memcmp(key, expected_key, expected_key->keylen) != 0) { - printf("\nFAILED"); - ret_val = -1; - } else { - printf("\nPASSED"); - ret_val = 0; - } - sctp_free_key(key1); - sctp_free_key(key2); - sctp_free_key(expected_key); - sctp_free_key(key); - return (ret_val); -} - - -void -sctp_test_authkey(void) -{ - sctp_key_t *key1, *key2, *expected_key; - int failed = 0; - - /* test case 1 */ - key1 = sctp_set_key("\x01\x01\x01\x01", 4); - key2 = sctp_set_key("\x01\x02\x03\x04", 4); - expected_key = sctp_set_key("\x01\x01\x01\x01\x01\x02\x03\x04", 8); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 2 */ - key1 = sctp_set_key("\x00\x00\x00\x01", 4); - key2 = sctp_set_key("\x02", 1); - expected_key = sctp_set_key("\x00\x00\x00\x01\x02", 5); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 3 */ - key1 = sctp_set_key("\x01", 1); - key2 = sctp_set_key("\x00\x00\x00\x02", 4); - expected_key = sctp_set_key("\x01\x00\x00\x00\x02", 5); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 4 */ - key1 = sctp_set_key("\x00\x00\x00\x01", 4); - key2 = sctp_set_key("\x01", 1); - expected_key = sctp_set_key("\x01\x00\x00\x00\x01", 5); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 5 */ - key1 = sctp_set_key("\x01", 1); - key2 = sctp_set_key("\x00\x00\x00\x01", 4); - expected_key = sctp_set_key("\x01\x00\x00\x00\x01", 5); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 6 */ - key1 = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07", 11); - key2 = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x08", 11); - expected_key = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x08", 22); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* test case 7 */ - key1 = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x08", 11); - key2 = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07", 11); - expected_key = sctp_set_key("\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x08", 22); - if (sctp_test_key_concatenation(key1, key2, expected_key) < 0) - failed++; - - /* done with all tests */ - if (failed) - printf("\nKey concatenation test results: %d cases failed", failed); - else - printf("\nKey concatenation test results: all test cases passed"); -} - - -#if defined(STANDALONE_HMAC_TEST) -int -main(void) -{ - sctp_test_hmac_sha1(); - sctp_test_hmac_md5(); - sctp_test_authkey(); -} - -#endif /* STANDALONE_HMAC_TEST */ - -#endif /* SCTP_HMAC_TEST */ Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_auth.h Sat Jan 16 20:04:17 2010 (r202449) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); /* digest lengths */ #define SCTP_AUTH_DIGEST_LEN_SHA1 20 -#define SCTP_AUTH_DIGEST_LEN_MD5 16 #define SCTP_AUTH_DIGEST_LEN_SHA224 28 #define SCTP_AUTH_DIGEST_LEN_SHA256 32 #define SCTP_AUTH_DIGEST_LEN_SHA384 48 @@ -52,7 +51,6 @@ __FBSDID("$FreeBSD$"); /* union of all supported HMAC algorithm contexts */ typedef union sctp_hash_context { SHA1_CTX sha1; - MD5_CTX md5; #ifdef HAVE_SHA2 SHA256_CTX sha256; SHA384_CTX sha384; @@ -234,8 +232,4 @@ sctp_initialize_auth_params(struct sctp_ struct sctp_tcb *stcb); /* test functions */ -extern void sctp_test_hmac_sha1(void); -extern void sctp_test_hmac_md5(void); -extern void sctp_test_authkey(void); - #endif /* __SCTP_AUTH_H__ */ Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_os_bsd.h Sat Jan 16 20:04:17 2010 (r202449) @@ -478,12 +478,6 @@ sctp_get_mbuf_for_msg(unsigned int space #include #endif -#include -/* map standard crypto API names */ -#define MD5_Init MD5Init -#define MD5_Update MD5Update -#define MD5_Final MD5Final - #endif #define SCTP_DECREMENT_AND_CHECK_REFCOUNT(addr) (atomic_fetchadd_int(addr, -1) == 1) Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_output.c Sat Jan 16 20:04:17 2010 (r202449) @@ -4313,16 +4313,8 @@ sctp_send_initiate(struct sctp_inpcb *in if (stcb->asoc.authinfo.random != NULL) { randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); p_len = sizeof(*randp) + stcb->asoc.authinfo.random_len; -#ifdef SCTP_AUTH_DRAFT_04 - randp->ph.param_type = htons(SCTP_RANDOM); - randp->ph.param_length = htons(p_len); - bcopy(stcb->asoc.authinfo.random->key, - randp->random_data, - stcb->asoc.authinfo.random_len); -#else /* random key already contains the header */ bcopy(stcb->asoc.authinfo.random->key, randp, p_len); -#endif /* zero out any padding required */ bzero((caddr_t)randp + p_len, SCTP_SIZE32(p_len) - p_len); SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_pcb.c Sat Jan 16 20:04:17 2010 (r202449) @@ -6254,15 +6254,6 @@ next_param: return (-33); } /* concatenate the full random key */ -#ifdef SCTP_AUTH_DRAFT_04 - keylen = random_len; - new_key = sctp_alloc_key(keylen); - if (new_key != NULL) { - /* copy in the RANDOM */ - if (p_random != NULL) - bcopy(p_random->random_data, new_key->key, random_len); - } -#else keylen = sizeof(*p_random) + random_len + sizeof(*hmacs) + hmacs_len; if (chunks != NULL) { keylen += sizeof(*chunks) + num_chunks; @@ -6285,19 +6276,13 @@ next_param: bcopy(hmacs, new_key->key + keylen, sizeof(*hmacs) + hmacs_len); } - } -#endif - else { + } else { /* failed to get memory for the key */ return (-34); } if (stcb->asoc.authinfo.peer_random != NULL) sctp_free_key(stcb->asoc.authinfo.peer_random); stcb->asoc.authinfo.peer_random = new_key; -#ifdef SCTP_AUTH_DRAFT_04 - /* don't include the chunks and hmacs for draft -04 */ - stcb->asoc.authinfo.peer_random->keylen = random_len; -#endif sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.assoc_keyid); sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.recv_keyid); Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Sat Jan 16 17:08:22 2010 (r202448) +++ head/sys/netinet/sctp_uio.h Sat Jan 16 20:04:17 2010 (r202449) @@ -526,7 +526,6 @@ struct sctp_hmacalgo { /* AUTH hmac_id */ #define SCTP_AUTH_HMAC_ID_RSVD 0x0000 #define SCTP_AUTH_HMAC_ID_SHA1 0x0001 /* default, mandatory */ -#define SCTP_AUTH_HMAC_ID_MD5 0x0002 /* deprecated */ #define SCTP_AUTH_HMAC_ID_SHA256 0x0003 #define SCTP_AUTH_HMAC_ID_SHA224 0x0004 #define SCTP_AUTH_HMAC_ID_SHA384 0x0005 From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 20:36:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB4C9106566C; Sat, 16 Jan 2010 20:36:27 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989408FC08; Sat, 16 Jan 2010 20:36: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 o0GKaRgS002848; Sat, 16 Jan 2010 20:36:27 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GKaRF5002846; Sat, 16 Jan 2010 20:36:27 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001162036.o0GKaRF5002846@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 20:36: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: r202450 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 20:36:27 -0000 Author: antoine Date: Sat Jan 16 20:36:27 2010 New Revision: 202450 URL: http://svn.freebsd.org/changeset/base/202450 Log: Add files to remove when MK_CALENDAR=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:04:17 2010 (r202449) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:36:27 2010 (r202450) @@ -466,9 +466,65 @@ OLD_FILES+=usr/share/man/man8/sdpd.8.gz # to be filled in #.endif -#.if ${MK_CALENDAR} == no -# to be filled in -#.endif +.if ${MK_CALENDAR} == no +OLD_FILES+=etc/periodic/daily/300.calendar +OLD_FILES+=usr/bin/calendar +OLD_FILES+=usr/share/calendar/calendar.all +OLD_FILES+=usr/share/calendar/calendar.australia +OLD_FILES+=usr/share/calendar/calendar.birthday +OLD_FILES+=usr/share/calendar/calendar.christian +OLD_FILES+=usr/share/calendar/calendar.computer +OLD_FILES+=usr/share/calendar/calendar.croatian +OLD_FILES+=usr/share/calendar/calendar.dutch +OLD_FILES+=usr/share/calendar/calendar.freebsd +OLD_FILES+=usr/share/calendar/calendar.french +OLD_FILES+=usr/share/calendar/calendar.german +OLD_FILES+=usr/share/calendar/calendar.history +OLD_FILES+=usr/share/calendar/calendar.holiday +OLD_FILES+=usr/share/calendar/calendar.hungarian +OLD_FILES+=usr/share/calendar/calendar.judaic +OLD_FILES+=usr/share/calendar/calendar.lotr +OLD_FILES+=usr/share/calendar/calendar.music +OLD_FILES+=usr/share/calendar/calendar.newzealand +OLD_FILES+=usr/share/calendar/calendar.russian +OLD_FILES+=usr/share/calendar/calendar.southafrica +OLD_FILES+=usr/share/calendar/calendar.ukrainian +OLD_FILES+=usr/share/calendar/calendar.usholiday +OLD_FILES+=usr/share/calendar/calendar.world +OLD_DIRS+=usr/share/calendar/de_AT.ISO_8859-15 +OLD_FILES+=usr/share/calendar/de_AT.ISO_8859-15/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.feiertag +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.geschichte +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.kirche +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.literatur +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.musik +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-1/calendar.wissenschaft +OLD_FILES+=usr/share/calendar/de_DE.ISO8859-15 +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.all +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.fetes +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.french +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.jferies +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-1/calendar.proverbes +OLD_FILES+=usr/share/calendar/fr_FR.ISO8859-15 +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hr_HR.ISO8859-2/calendar.praznici +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.all +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.nevnapok +OLD_FILES+=usr/share/calendar/hu_HU.ISO8859-2/calendar.unnepek +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.all +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.common +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.holiday +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.military +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.msk +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.orthodox +OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.pagan +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.all +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.holiday +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.misc +OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.orthodox +OLD_FILES+=usr/share/man/man1/calendar.1.gz +.endif .if ${MK_CDDL} == no OLD_LIBS+=lib/libavl.so.1 From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 20:40:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 846E9106566B; Sat, 16 Jan 2010 20:40:12 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58F698FC0A; Sat, 16 Jan 2010 20:40: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 o0GKeCsI003773; Sat, 16 Jan 2010 20:40:12 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GKeCDW003771; Sat, 16 Jan 2010 20:40:12 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001162040.o0GKeCDW003771@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 20:40: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: r202451 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 20:40:12 -0000 Author: antoine Date: Sat Jan 16 20:40:12 2010 New Revision: 202451 URL: http://svn.freebsd.org/changeset/base/202451 Log: Update files to remove when MK_CDDL=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:36:27 2010 (r202450) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:40:12 2010 (r202451) @@ -527,18 +527,69 @@ OLD_FILES+=usr/share/man/man1/calendar.1 .endif .if ${MK_CDDL} == no -OLD_LIBS+=lib/libavl.so.1 -OLD_LIBS+=lib/libnvpair.so.1 -OLD_LIBS+=lib/libumem.so.1 -OLD_LIBS+=lib/libuutil.so.1 +OLD_LIBS+=lib/libavl.so.2 +OLD_LIBS+=lib/libctf.so.2 +OLD_LIBS+=lib/libdtrace.so.2 +OLD_LIBS+=lib/libnvpair.so.2 +OLD_LIBS+=lib/libumem.so.2 +OLD_LIBS+=lib/libuutil.so.2 +OLD_FILES+=usr/bin/ctfconvert +OLD_FILES+=usr/bin/ctfdump +OLD_FILES+=usr/bin/ctfmerge +OLD_FILES+=usr/bin/sgsmsg +OLD_FILES+=usr/lib/dtrace/drti.o +OLD_FILES+=usr/lib/dtrace/errno.d +OLD_FILES+=usr/lib/dtrace/psinfo.d +OLD_FILES+=usr/lib/dtrace/signal.d +OLD_FILES+=usr/lib/dtrace/unistd.d OLD_FILES+=usr/lib/libavl.a OLD_FILES+=usr/lib/libavl.so +OLD_FILES+=usr/lib/libavl_p.a +OLD_FILES+=usr/lib/libctf.a +OLD_FILES+=usr/lib/libctf.so +OLD_FILES+=usr/lib/libctf_p.a +OLD_FILES+=usr/lib/libdtrace.a +OLD_FILES+=usr/lib/libdtrace.so +OLD_FILES+=usr/lib/libdtrace_p.a OLD_FILES+=usr/lib/libnvpair.a OLD_FILES+=usr/lib/libnvpair.so +OLD_FILES+=usr/lib/libnvpair_p.a OLD_FILES+=usr/lib/libumem.a OLD_FILES+=usr/lib/libumem.so +OLD_FILES+=usr/lib/libumem_p.a OLD_FILES+=usr/lib/libuutil.a OLD_FILES+=usr/lib/libuutil.so +OLD_FILES+=usr/lib/libuutil_p.a +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib32/dtrace/drti.o +OLD_FILES+=usr/lib32/libavl.a +OLD_FILES+=usr/lib32/libavl.so +OLD_LIBS+=usr/lib32/libavl.so.2 +OLD_FILES+=usr/lib32/libavl_p.a +OLD_FILES+=usr/lib32/libctf.a +OLD_FILES+=usr/lib32/libctf.so +OLD_LIBS+=usr/lib32/libctf.so.2 +OLD_FILES+=usr/lib32/libctf_p.a +OLD_FILES+=usr/lib32/libdtrace.a +OLD_FILES+=usr/lib32/libdtrace.so +OLD_LIBS+=usr/lib32/libdtrace.so.2 +OLD_FILES+=usr/lib32/libdtrace_p.a +OLD_FILES+=usr/lib32/libnvpair.a +OLD_FILES+=usr/lib32/libnvpair.so +OLD_LIBS+=usr/lib32/libnvpair.so.2 +OLD_FILES+=usr/lib32/libnvpair_p.a +OLD_FILES+=usr/lib32/libumem.a +OLD_FILES+=usr/lib32/libumem.so +OLD_LIBS+=usr/lib32/libumem.so.2 +OLD_FILES+=usr/lib32/libumem_p.a +OLD_FILES+=usr/lib32/libuutil.a +OLD_FILES+=usr/lib32/libuutil.so +OLD_LIBS+=usr/lib32/libuutil.so.2 +OLD_FILES+=usr/lib32/libuutil_p.a +.endif +OLD_FILES+=usr/sbin/dtrace +OLD_FILES+=usr/sbin/lockstat +OLD_FILES+=usr/share/man/man1/dtrace.1.gz .endif .if ${MK_ZFS} == no From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 20:42:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA581065679; Sat, 16 Jan 2010 20:42:50 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD898FC0C; Sat, 16 Jan 2010 20:42: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 o0GKgodV004382; Sat, 16 Jan 2010 20:42:50 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GKgoQI004380; Sat, 16 Jan 2010 20:42:50 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001162042.o0GKgoQI004380@svn.freebsd.org> From: Antoine Brodin Date: Sat, 16 Jan 2010 20:42: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: r202452 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 20:42:50 -0000 Author: antoine Date: Sat Jan 16 20:42:50 2010 New Revision: 202452 URL: http://svn.freebsd.org/changeset/base/202452 Log: Update files to remove when MK_ZFS=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:40:12 2010 (r202451) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 16 20:42:50 2010 (r202452) @@ -593,15 +593,31 @@ OLD_FILES+=usr/share/man/man1/dtrace.1.g .endif .if ${MK_ZFS} == no -OLD_LIBS+=lib/libzfs.so.1 -OLD_LIBS+=lib/libzpool.so.1 +OLD_FILES+=boot/gptzfsboot +OLD_FILES+=boot/zfsboot +OLD_FILES+=boot/zfsloader +OLD_LIBS+=lib/libzfs.so.2 +OLD_LIBS+=lib/libzpool.so.2 +OLD_FILES+=rescue/zfs +OLD_FILES+=rescue/zpool OLD_FILES+=sbin/zfs OLD_FILES+=sbin/zpool +OLD_FILES+=usr/bin/zinject +OLD_FILES+=usr/bin/ztest OLD_FILES+=usr/lib/libzfs.a OLD_FILES+=usr/lib/libzfs.so +OLD_FILES+=usr/lib/libzfs_p.a OLD_FILES+=usr/lib/libzpool.a OLD_FILES+=usr/lib/libzpool.so -OLD_FILES+=usr/bin/ztest +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib32/libzfs.a +OLD_FILES+=usr/lib32/libzfs.so +OLD_LIBS+=usr/lib32/libzfs.so.2 +OLD_FILES+=usr/lib32/libzfs_p.a +OLD_FILES+=usr/lib32/libzpool.a +OLD_FILES+=usr/lib32/libzpool.so +OLD_LIBS+=usr/lib32/libzpool.so.2 +.endif OLD_FILES+=usr/sbin/zdb OLD_FILES+=usr/share/man/man8/zdb.8.gz OLD_FILES+=usr/share/man/man8/zfs.8.gz From owner-svn-src-head@FreeBSD.ORG Sat Jan 16 20:51:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2AF71065676; Sat, 16 Jan 2010 20:51:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D074A8FC0C; Sat, 16 Jan 2010 20:51:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0GKpXQU006419; Sat, 16 Jan 2010 20:51:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0GKpX8O006417; Sat, 16 Jan 2010 20:51:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001162051.o0GKpX8O006417@svn.freebsd.org> From: Marius Strobl Date: Sat, 16 Jan 2010 20:51:33 +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: r202453 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 20:51:34 -0000 Author: marius Date: Sat Jan 16 20:51:33 2010 New Revision: 202453 URL: http://svn.freebsd.org/changeset/base/202453 Log: Update the sparc64 hardware list regarding machines that will be supported by 7.3-RELEASE. Approved by: blackend MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jan 16 20:42:50 2010 (r202452) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Jan 16 20:51:33 2010 (r202453) @@ -515,6 +515,10 @@ + &sun.fire; V215 (support first appeared in 7.3-RELEASE) + + + &sun.fire; V250 @@ -524,6 +528,11 @@ + &sun.fire; V480 (501-6780 and 501-6790 centerplanes only, for + which support first appeared in 7.3-RELEASE) + + + &sun.fire; V880 @@ -543,6 +552,10 @@ &sun.fire; V240 + + + &sun.fire; V245 (support first appeared in 7.3-RELEASE) +