From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 05:52:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2CF6106564A; Sun, 16 Sep 2012 05:52:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 533708FC08; Sun, 16 Sep 2012 05:52:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G5qttR017346; Sun, 16 Sep 2012 05:52:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G5qtwf017344; Sun, 16 Sep 2012 05:52:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209160552.q8G5qtwf017344@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Sep 2012 05:52: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: r240546 - head/usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 05:52:55 -0000 Author: kib Date: Sun Sep 16 05:52:54 2012 New Revision: 240546 URL: http://svn.freebsd.org/changeset/base/240546 Log: Handle AT_TIMEKEEP in procstat(1) -x [1]. Remove the AT_COUNT switch case, since AT_COUNT is not an aux vector, it is the counter of total number of defined vectors. PR: bin/171662 [1] MFC after: 1 week Modified: head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sun Sep 16 00:35:09 2012 (r240545) +++ head/usr.bin/procstat/procstat_auxv.c Sun Sep 16 05:52:54 2012 (r240546) @@ -231,9 +231,11 @@ procstat_auxv(struct kinfo_proc *kipp) else PRINT(AT_STACKPROT, %s, "EXECUTABLE"); break; - case AT_COUNT: - PRINT(AT_COUNT, %ld, (long)auxv[i].a_un.a_val); +#ifdef AT_TIMEKEEP + case AT_TIMEKEEP: + PRINT(AT_TIMEKEEP, %p, auxv[i].a_un.a_ptr); break; +#endif default: PRINT_UNKNOWN(auxv[i].a_type, auxv[i].a_un.a_val); break; From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 06:01:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9D22106564A; Sun, 16 Sep 2012 06:01:34 +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 A55258FC1B; Sun, 16 Sep 2012 06:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G61YM9018705; Sun, 16 Sep 2012 06:01:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G61Y7i018703; Sun, 16 Sep 2012 06:01:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209160601.q8G61Y7i018703@svn.freebsd.org> From: Rui Paulo Date: Sun, 16 Sep 2012 06:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240547 - 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, 16 Sep 2012 06:01:34 -0000 Author: rpaulo Date: Sun Sep 16 06:01:34 2012 New Revision: 240547 URL: http://svn.freebsd.org/changeset/base/240547 Log: Add Perforce support. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Sep 16 05:52:54 2012 (r240546) +++ head/sys/conf/newvers.sh Sun Sep 16 06:01:34 2012 (r240547) @@ -88,9 +88,11 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -x "${dir}/svnversion" ] ; then + if [ -x "${dir}/svnversion" ] && [ -z ${svnversion} ] ; then svnversion=${dir}/svnversion - break + fi + if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then + p4_cmd=${dir}/p4 fi done if [ -d "${SYSDIR}/../.git" ] ; then @@ -132,10 +134,27 @@ if [ -n "$git_cmd" ] ; then fi fi +if [ -n "$p4_cmd" ] ; then + p4version=`cd ${SYSDIR} && $p4_cmd changes -m1 "./...#have" 2>&1 | \ + awk '{ print $2 }'` + case "$p4version" in + [0-9]*) + p4version=" ${p4version}" + p4opened=`$p4_cmd opened 2>&1` + case "$p4opened" in + File*) ;; + *) p4version="${p4version}+pending" ;; + esac + ;; + *) unset p4version ;; + esac +fi + + cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${p4version}: ${t}" +#define VERSTR "${VERSION} #${v}${svn}${git}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 06:44:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE0C106566C; Sun, 16 Sep 2012 06:44:58 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B14B18FC1D; Sun, 16 Sep 2012 06:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G6iwmE025215; Sun, 16 Sep 2012 06:44:58 GMT (envelope-from peterj@svn.freebsd.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G6iw6A025212; Sun, 16 Sep 2012 06:44:58 GMT (envelope-from peterj@svn.freebsd.org) Message-Id: <201209160644.q8G6iw6A025212@svn.freebsd.org> From: Peter Jeremy Date: Sun, 16 Sep 2012 06:44: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: r240548 - in head: share/misc usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 06:44:59 -0000 Author: peterj Date: Sun Sep 16 06:44:58 2012 New Revision: 240548 URL: http://svn.freebsd.org/changeset/base/240548 Log: - Add myself as a new src committer. - Sort jhb's mentees - Add grog's (ex-)mentor Approved by: jhb (co-mentor), grog (co-mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Sep 16 06:01:34 2012 (r240547) +++ head/share/misc/committers-src.dot Sun Sep 16 06:44:58 2012 (r240548) @@ -215,6 +215,7 @@ obrien [label="David E. O'Brien\nobrien@ olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] +peterj [label="Peter Jeremy\npeterj@FreeBSD.org\n2012/09/14"] pfg [label="Pedro Giffuni\npfg@FreeBSD.org\n2011/12/01"] philip [label="Philip Paeps\nphilip@FreeBSD.org\n2004/01/21"] phk [label="Poul-Henning Kamp\nphk@FreeBSD.org\n1994/02/21"] @@ -396,6 +397,7 @@ gnn -> davide grog -> edwin grog -> le +grog -> peterj imp -> akiyama imp -> ambrisko @@ -439,9 +441,11 @@ jhb -> arr jhb -> avg jhb -> jeff jhb -> kbyanc -jhb -> rnoland +jhb -> peterj jhb -> pfg +jhb -> rnoland +jkh -> grog jkh -> imp jkh -> jlemon jkh -> joerg Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 16 06:01:34 2012 (r240547) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Sep 16 06:44:58 2012 (r240548) @@ -119,6 +119,7 @@ 04/03 Tong Liu born in Beijing, People's Republic of China, 1981 04/03 Gabor Pali born in Kunhegyes, Hungary, 1982 04/05 Stacey Son born in Burley, Idaho, United States, 1967 +04/06 Peter Jeremy born in Sydney, New South Wales, Australia, 1961 04/07 Edward Tomasz Napierala born in Wolsztyn, Poland, 1981 04/08 Jordan K. Hubbard born in Honolulu, Hawaii, United States, 1963 04/09 Ceri Davies born in Haverfordwest, Pembrokeshire, United Kingdom, 1976 From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 07:55:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D421D106564A; Sun, 16 Sep 2012 07:55:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF32E8FC08; Sun, 16 Sep 2012 07:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G7tnuX036334; Sun, 16 Sep 2012 07:55:49 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G7tnMH036332; Sun, 16 Sep 2012 07:55:49 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160755.q8G7tnMH036332@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 07:55: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: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 07:55:50 -0000 Author: andrew Date: Sun Sep 16 07:55:49 2012 New Revision: 240549 URL: http://svn.freebsd.org/changeset/base/240549 Log: The cpu_reset function is noreturn, make sure this is true on Tegra 2. While here fix a typo. Modified: head/sys/arm/tegra/common.c Modified: head/sys/arm/tegra/common.c ============================================================================== --- head/sys/arm/tegra/common.c Sun Sep 16 06:44:58 2012 (r240548) +++ head/sys/arm/tegra/common.c Sun Sep 16 07:55:49 2012 (r240549) @@ -47,9 +47,11 @@ void cpu_reset(void) { bus_space_handle_t bsh; - printf("Restetting...\n"); + printf("Resetting...\n"); bus_space_map(fdtbus_bs_tag,TEGRA2_CLK_RST_PA_BASE, 0x1000, 0, &bsh); bus_space_write_4(fdtbus_bs_tag, bsh, 4, 4); + + while(1); } struct fdt_fixup_entry fdt_fixup_table[] = { From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 08:00:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A891065673; Sun, 16 Sep 2012 08:00:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0070F8FC12; Sun, 16 Sep 2012 08:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G80Twk037029; Sun, 16 Sep 2012 08:00:29 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G80TV3037028; Sun, 16 Sep 2012 08:00:29 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160800.q8G80TV3037028@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 08:00: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: r240550 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 08:00:30 -0000 Author: andrew Date: Sun Sep 16 08:00:29 2012 New Revision: 240550 URL: http://svn.freebsd.org/changeset/base/240550 Log: In the Tegra 2 standard config: * Remove an unneeded makeoption * Set machine correctly * Properly indent the include of files.tegra2 Modified: head/sys/arm/tegra/std.tegra2 Modified: head/sys/arm/tegra/std.tegra2 ============================================================================== --- head/sys/arm/tegra/std.tegra2 Sun Sep 16 07:55:49 2012 (r240549) +++ head/sys/arm/tegra/std.tegra2 Sun Sep 16 08:00:29 2012 (r240550) @@ -2,7 +2,7 @@ #$FreeBSD$ cpu CPU_CORTEXA -makeoption ARM_LITTLE_ENDIAN +machine arm armv6 options PHYSADDR=0x00000000 @@ -13,4 +13,4 @@ options KERNVIRTADDR=0xc0200000 options STARTUP_PAGETABLE_ADDR=0x00100000 -files "../tegra/files.tegra2" +files "../tegra/files.tegra2" From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 08:09:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35241106564A; Sun, 16 Sep 2012 08:09:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1615E8FC08; Sun, 16 Sep 2012 08:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8G89A5U038290; Sun, 16 Sep 2012 08:09:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8G89AUA038288; Sun, 16 Sep 2012 08:09:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209160809.q8G89AUA038288@svn.freebsd.org> From: Andrew Turner Date: Sun, 16 Sep 2012 08:09: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: r240551 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 08:09:11 -0000 Author: andrew Date: Sun Sep 16 08:09:10 2012 New Revision: 240551 URL: http://svn.freebsd.org/changeset/base/240551 Log: Start to clean up ARMv6 initarm implementations by making the Tegra 2 version similar to the Ti version. Modified: head/sys/arm/tegra/tegra2_machdep.c Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sun Sep 16 08:00:29 2012 (r240550) +++ head/sys/arm/tegra/tegra2_machdep.c Sun Sep 16 08:09:10 2012 (r240551) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* FIXME move to tegrareg.h */ #define TEGRA2_BASE 0xE0000000 /* KVM base for peripherials */ -#define TEGRA2_UARTA_VA_BASE 0xE1006000 +#define TEGRA2_UARTA_VA_BASE 0xE0006000 #define TEGRA2_UARTA_PA_BASE 0x70006000 @@ -96,8 +97,6 @@ __FBSDID("$FreeBSD$"); #define UND_STACK_SIZE 1 #define FIQ_STACK_SIZE 1 -#define PTE_DEVICE 3 - #define debugf(fmt, args...) printf(fmt, ##args) #define KERNEL_PT_SYS 0 /* Page table for mapping proc0 zero page */ @@ -126,12 +125,7 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; - - -static struct pv_addr kernel_l1pt; /* Level-1 page table entry */ - /* Physical and virtual addresses for some global pages */ - vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; @@ -141,18 +135,17 @@ static int availmem_regions_sz; extern vm_offset_t pmap_bootstrap_lastaddr; vm_offset_t pmap_bootstrap_lastaddr; +vm_paddr_t pmap_pa; const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; -static struct pv_addr fiqstack; -static struct pv_addr irqstack; -static struct pv_addr undstack; -static struct pv_addr abtstack; -static struct pv_addr kernelstack; +static struct pv_addr irqstack; +static struct pv_addr undstack; +static struct pv_addr abtstack; +static struct pv_addr kernelstack; -#define PHYS2VIRT(x) ((x - KERNPHYSADDR) + KERNVIRTADDR) -#define VIRT2PHYS(x) ((x - KERNVIRTADDR) + KERNPHYSADDR) +static void set_stackptrs(int cpu); static int platform_devmap_init(void); @@ -170,53 +163,6 @@ kenv_next(char *cp) return (cp); } - -/* - * Early Print - */ - -#define DEBUGBUF_SIZE 256 -#define LSR_THRE 0x20 /* Xmit holding register empty */ -#define EARLY_UART_VA_BASE TEGRA2_UARTA_VA_BASE -#define EARLY_UART_PA_BASE TEGRA2_UARTA_PA_BASE -char debugbuf[DEBUGBUF_SIZE]; - -void early_putstr(unsigned char *str) -{ - volatile uint8_t *p_lsr = (volatile uint8_t*) (EARLY_UART_VA_BASE + 0x14); - volatile uint8_t *p_thr = (volatile uint8_t*) (EARLY_UART_VA_BASE + 0x00); - - do { - while ((*p_lsr & LSR_THRE) == 0); - *p_thr = *str; - - if (*str == '\n') - { - while ((*p_lsr & LSR_THRE) == 0); - *p_thr = '\r'; - } - } while (*++str != '\0'); -} - -#if (STARTUP_PAGETABLE_ADDR < PHYSADDR) || \ - (STARTUP_PAGETABLE_ADDR > (PHYSADDR + (64 * 1024 * 1024))) -#error STARTUP_PAGETABLE_ADDR is not within init. MMU table, early print support not possible -#endif - -void -early_print_init(void) -{ - volatile uint32_t *mmu_tbl = (volatile uint32_t*)STARTUP_PAGETABLE_ADDR; - mmu_tbl[(EARLY_UART_VA_BASE >> L1_S_SHIFT)] = L1_TYPE_S | L1_S_AP(AP_KRW) | (EARLY_UART_PA_BASE & L1_S_FRAME); - __asm __volatile ("mcr p15, 0, r0, c8, c7, 0"); /* invalidate I+D TLBs */ - __asm __volatile ("mcr p15, 0, r0, c7, c10, 4"); /* drain the write buffer */ - early_putstr("Early printf initialise\n"); -} - -#define EPRINTF(args...) \ - snprintf(debugbuf,DEBUGBUF_SIZE, ##args ); \ - early_putstr(debugbuf); - static void print_kenv(void) { @@ -348,6 +294,7 @@ physmap_init(void) #define OSC_FREQ_DET_TRIG (1<<31) #define OSC_FREQ_DET_BUSY (1<<31) +#if 0 static int tegra2_osc_freq_detect(void) { @@ -386,73 +333,28 @@ tegra2_osc_freq_detect(void) bus_space_free(fdtbus_bs_tag, bsh, 0x1000); return r; } +#endif void * -initarm(void *mdp, void *unused __unused) +initarm(struct arm_boot_params *abp) { - vm_offset_t freemempos; - vm_offset_t dtbp; - vm_offset_t lastaddr; - vm_offset_t l2_start; - struct pv_addr dpcpu; - uint32_t memsize = 0; - u_int l1pagetable; - uint32_t l2size; - int i = 0; - int j = 0; + struct pv_addr kernel_l1pt; + struct pv_addr dpcpu; + vm_offset_t dtbp, freemempos, l2_start, lastaddr; + uint32_t memsize, l2size; void *kmdp; + u_int l1pagetable; + int i = 0, j = 0, err_devmap = 0; - lastaddr = 0; - dtbp = (vm_offset_t)NULL; - - /* FIXME */ - early_print_init(); - -#define PHYS2VIRT(x) ((x - KERNPHYSADDR) + KERNVIRTADDR) -#define VIRT2PHYS(x) ((x - KERNVIRTADDR) + KERNPHYSADDR) - -#define VALLOC_PAGES(var, np) \ - ALLOC_PAGES((var).pv_pa, (np)); \ - (var).pv_va = PHYS2VIRT((var).pv_pa); - -#define ALLOC_PAGES(var, np) \ - (var) = freemempos; \ - freemempos += (np * PAGE_SIZE); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - -#define ROUND_L_PAGE(x) (((x) + L2_L_OFFSET) & L2_L_FRAME) - + lastaddr = parse_boot_param(abp); + memsize = 0; set_cpufuncs(); - /* - * Mask metadata pointer: it is supposed to be on page boundary. If - * the first argument (mdp) doesn't point to a valid address the - * bootloader must have passed us something else than the metadata - * ptr... In this case we want to fall back to some built-in settings. - */ - mdp = (void *)((uint32_t)mdp & ~PAGE_MASK); - - /* Parse metadata and fetch parameters */ - if (mdp != NULL) { - preload_metadata = mdp; - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) { - boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); - lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, - vm_offset_t); -#ifdef DDB - ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); - ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); -#endif - } - - preload_addr_relocate = KERNVIRTADDR - KERNPHYSADDR; - } else { - /* Fall back to hardcoded metadata. */ - lastaddr = fake_preload_metadata(); - } + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; #if defined(FDT_DTB_STATIC) /* @@ -487,18 +389,33 @@ initarm(void *mdp, void *unused __unused /* * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map and make it div by 4. + * L1 and L2 tables map and one for vectors map. */ l2size += 3; + + /* Make it divisible by 4 */ l2size = (l2size + 3) & ~3; - freemempos = VIRT2PHYS(ROUND_L_PAGE(lastaddr)); +#define KERNEL_TEXT_BASE (KERNBASE) + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; - VALLOC_PAGES(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); + /* Define a macro to simplify memory allocation */ +#define valloc_pages(var, np) \ + alloc_pages((var).pv_va, (np)); \ + (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + +#define alloc_pages(var, np) \ + (var) = freemempos; \ + freemempos += (np * PAGE_SIZE); \ + memset((char *)(var), 0, ((np) * PAGE_SIZE)); + + while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) + freemempos += PAGE_SIZE; + valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); for (i = 0; i < l2size; ++i) { if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { - VALLOC_PAGES(kernel_pt_table[i], + valloc_pages(kernel_pt_table[i], L2_TABLE_SIZE / PAGE_SIZE); j = i; } else { @@ -515,24 +432,21 @@ initarm(void *mdp, void *unused __unused * or 0xffff0000. This page will just contain the system vectors * and can be shared by all processes. */ - - VALLOC_PAGES(systempage, 1); - EPRINTF("systempage PA:0x%08x VA:0x%08x\n", systempage.pv_pa, systempage.pv_va); + valloc_pages(systempage, 1); /* Allocate dynamic per-cpu area. */ - VALLOC_PAGES(dpcpu, DPCPU_SIZE / PAGE_SIZE); + valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); dpcpu_init((void *)dpcpu.pv_va, 0); /* Allocate stacks for all modes */ - VALLOC_PAGES(fiqstack, FIQ_STACK_SIZE); - VALLOC_PAGES(irqstack, IRQ_STACK_SIZE); - VALLOC_PAGES(abtstack, ABT_STACK_SIZE); - VALLOC_PAGES(undstack, UND_STACK_SIZE); - VALLOC_PAGES(kernelstack, KSTACK_PAGES); + valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); + valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); + valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); + valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); init_param1(); - VALLOC_PAGES(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -561,6 +475,7 @@ initarm(void *mdp, void *unused __unused (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + /* Map L1 directory and allocated L2 page tables */ pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); @@ -572,7 +487,7 @@ initarm(void *mdp, void *unused __unused /* Map allocated DPCPU, stacks and msgbuf */ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, - PHYS2VIRT(freemempos) - dpcpu.pv_va, + freemempos - dpcpu.pv_va, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Link and map the vector page */ @@ -582,28 +497,37 @@ initarm(void *mdp, void *unused __unused VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); /* Map pmap_devmap[] entries */ - if (platform_devmap_init() != 0) - while (1); + err_devmap = platform_devmap_init(); pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); - /* Switch L1 table */ - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); + cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | + DOMAIN_CLIENT); + pmap_pa = kernel_l1pt.pv_pa; setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2))); + cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); + /* + * Only after the SOC registers block is mapped we can perform device + * tree fixups, as they may attempt to read parameters from hardware. + */ OF_interpret("perform-fixup", 0); cninit(); + physmem = memsize / PAGE_SIZE; debugf("initarm: console initialized\n"); - debugf(" arg1 mdp = 0x%08x\n", (uint32_t)mdp); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); - printf(" dtbp = 0x%08x\n", (uint32_t)dtbp); + debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); print_kernel_section_addr(); print_kenv(); + if (err_devmap != 0) + printf("WARNING: could not fully configure devmap, error=%d\n", + err_devmap); + /* * Pages were allocated during the secondary bootstrap for the * stacks for different CPU modes. @@ -613,14 +537,8 @@ initarm(void *mdp, void *unused __unused * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_FIQ32_MODE, - fiqstack.pv_va + FIQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... @@ -643,12 +561,8 @@ initarm(void *mdp, void *unused __unused init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - dump_avail[0] = 0; - dump_avail[1] = memsize; - dump_avail[2] = 0; - dump_avail[3] = 0; - - pmap_bootstrap(PHYS2VIRT(freemempos), pmap_bootstrap_lastaddr, &kernel_l1pt); + arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); mutex_init(); @@ -656,16 +570,29 @@ initarm(void *mdp, void *unused __unused /* * Prepare map of physical memory regions available to vm subsystem. */ - physmap_init(); /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } +static void +set_stackptrs(int cpu) +{ + + set_stackptr(PSR_IRQ32_MODE, + irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_ABT32_MODE, + abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_UND32_MODE, + undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); +} + + #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } @@ -689,7 +616,6 @@ platform_devmap_init(void) return (0); } - struct arm32_dma_range * bus_dma_get_range(void) { From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 09:28:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 015DD1065672; Sun, 16 Sep 2012 09:28:18 +0000 (UTC) Date: Sun, 16 Sep 2012 09:28:18 +0000 From: Alexey Dokuchaev To: Andrew Turner Message-ID: <20120916092818.GA81952@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201209160755.q8G7tnMH036332@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 09:28:19 -0000 On Sun, Sep 16, 2012 at 07:55:49AM +0000, Andrew Turner wrote: > New Revision: 240549 > URL: http://svn.freebsd.org/changeset/base/240549 > > Log: > The cpu_reset function is noreturn, make sure this is true on Tegra 2. > While here fix a typo. > > + > + while(1); I thought preferred and more style(9) compliant way to code this is: for (;;) continue; ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 09:38:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F5FB1065670; Sun, 16 Sep 2012 09:38:36 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id D1EE38FC12; Sun, 16 Sep 2012 09:38:34 +0000 (UTC) Received: by lage12 with SMTP id e12so4352040lag.13 for ; Sun, 16 Sep 2012 02:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=F+XGuZBq9j4rXBng8NXwLFQtqjfBQ88fCkEu8Mw4X6w=; b=ixkxJkwrVfSWjpfDj4XG6lOOFrMaFELoZrNIJa1NP9lMbukcZRdW2adfA6cBnGD0aX 7+l+XGOI5Tqxi9ZkwliMTPqdx4VLhdMgvtqW+QxlLtWy9qTGhVBp9EWYLC9lHy3vNMq6 NqL7wj1e8P46O8Q/7vFd4MlnVRlUJfwnR/Yl6h7XV/Pybh6vxbgq8rfZi96TQ1uFLx8K 03sEAsG4waMfSKNqMVO984BzR86owQoGhtJ4AJzYeYOGUI5iuioRkd+IhTMhZCiwZWnt eDCG7HiE4dj6feDzWbLSQCidPLp6X5ahoqKB5KSGz5yy3Mh3DIGzWJpBerRJZHEEFeMY Mijw== Received: by 10.152.105.210 with SMTP id go18mr7093994lab.13.1347788307682; Sun, 16 Sep 2012 02:38:27 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 02:37:56 -0700 (PDT) In-Reply-To: <20120916092818.GA81952@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> From: Chris Rees Date: Sun, 16 Sep 2012 10:37:56 +0100 X-Google-Sender-Auth: MmkOXEjZvJ-OK1n_Py2mwTPa44o Message-ID: To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 09:38:36 -0000 On 16 September 2012 10:28, Alexey Dokuchaev wrote: > On Sun, Sep 16, 2012 at 07:55:49AM +0000, Andrew Turner wrote: >> New Revision: 240549 >> URL: http://svn.freebsd.org/changeset/base/240549 >> >> Log: >> The cpu_reset function is noreturn, make sure this is true on Tegra 2. >> While here fix a typo. >> >> + >> + while(1); > > I thought preferred and more style(9) compliant way to code this is: > > for (;;) > continue; Actually: for (;;) ; Chris From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 09:53:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 184941065672; Sun, 16 Sep 2012 09:53:55 +0000 (UTC) Date: Sun, 16 Sep 2012 09:53:55 +0000 From: Alexey Dokuchaev To: Chris Rees Message-ID: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 09:53:56 -0000 On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > On 16 September 2012 10:28, Alexey Dokuchaev wrote: > > I thought preferred and more style(9) compliant way to code [empty > > endless loop] is: > > > > for (;;) > > continue; > > Actually: > > for (;;) > ; Explicit "continue" is supposed to tell reviewer that original author did not make a typo, but indeed knew what he was doing. Lonely semicolon is too ambiguous in this case. ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 10:07:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF28106566C; Sun, 16 Sep 2012 10:07:36 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8598FC14; Sun, 16 Sep 2012 10:07:34 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so4415905lbb.13 for ; Sun, 16 Sep 2012 03:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QOYHahmx4bH7EJO0PHaPl1JygXdI5ZAsaxgC8wS3kJA=; b=G4ASdw422HMrkCuHLk2CpAwRtY2AjZxlPLIELWag0HWZxCH7Zh1SeSE7lel1Vv7i/W A47RmlZNYIWPuR7mk2MdBaNWXuPIXIf8wu/M7UFbz0kzGM3hhbkO+H3elf+M9HCdUMN1 GAqWgFNmcxLer5dxhplRAXfn9BkqAKt8bredL3m/30kmD3nnj9dz8kDsTsNAaCinjalL NsdfO8Pg6WgIQXvyiIPxes8v3dcZOPqgRlNGi0ftvvV27MScVdcEOKn5LQWIWVfrrO9p AqCKiAmVRpZ7b9XLA4fc1Y/lV0pFzrGbgoF1ttI/YAVagsOA0pgaaGV7QsoHAhv+THwI BucA== MIME-Version: 1.0 Received: by 10.152.162.10 with SMTP id xw10mr7009337lab.12.1347790054001; Sun, 16 Sep 2012 03:07:34 -0700 (PDT) Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 03:07:33 -0700 (PDT) Received: by 10.112.43.199 with HTTP; Sun, 16 Sep 2012 03:07:33 -0700 (PDT) In-Reply-To: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> Date: Sun, 16 Sep 2012 11:07:33 +0100 Message-ID: From: Chris Rees To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 10:07:36 -0000 On 16 Sep 2012 10:53, "Alexey Dokuchaev" wrote: > > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > > On 16 September 2012 10:28, Alexey Dokuchaev wrote: > > > I thought preferred and more style(9) compliant way to code [empty > > > endless loop] is: > > > > > > for (;;) > > > continue; > > > > Actually: > > > > for (;;) > > ; > > Explicit "continue" is supposed to tell reviewer that original author did > not make a typo, but indeed knew what he was doing. Lonely semicolon is too > ambiguous in this case. > > ./danfe > That's not what man style says... Chris From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 13:13:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F8A106566C; Sun, 16 Sep 2012 13:13:02 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF198FC0A; Sun, 16 Sep 2012 13:13:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GDD2qP091524; Sun, 16 Sep 2012 13:13:02 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GDD2LH091522; Sun, 16 Sep 2012 13:13:02 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209161313.q8GDD2LH091522@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Sun, 16 Sep 2012 13:13: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: r240561 - 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: Sun, 16 Sep 2012 13:13:02 -0000 Author: melifaro Date: Sun Sep 16 13:13:02 2012 New Revision: 240561 URL: http://svn.freebsd.org/changeset/base/240561 Log: Add section describing existing filtering points. Document byteorder behavior in AF_INET[6] hooks in new section. MFC after: 2 weeks Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sun Sep 16 12:08:06 2012 (r240560) +++ head/share/man/man9/pfil.9 Sun Sep 16 13:13:02 2012 (r240561) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 29, 2004 +.Dd September 16, 2012 .Dt PFIL 9 .Os .Sh NAME @@ -122,6 +122,18 @@ The filter returns an error (errno) if t if the processing is to continue. If the packet processing is to stop, it is the responsibility of the filter to free the packet. +.Sh FILTERING POINTS +Currently, filtering points are implemented for the following link types: +.Pp +.Bl -tag -width "AF_INET6" -offset XXX -compact +.It AF_INET +.It AF_INET6 +IPv4 and IPv6 packets. Note that packet header is already +.Cm converted to host format. +Host format has to be preserved in case of header modifications. +.It AF_LINK +Link-layer packets. +.El .Sh RETURN VALUES If successful, .Fn pfil_head_get @@ -187,23 +199,6 @@ The function is only safe for internal use. .Pp -.Fx -implements only hooks for -.Dv AF_INET -and -.Dv AF_INET6 . -Packets diverted through these hooks have data in -host byte order contrary to the above statements. -.Pp -The -.Xr if_bridge 4 -diverts -.Dv AF_INET -and -.Dv AF_INET6 -traffic according to its sysctl settings, but contrary to the above -statements, the data is provided in host byte order. -.Pp When a .Vt pfil_head is being modified, no traffic is diverted From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 14:24:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89303106566B; Sun, 16 Sep 2012 14:24:49 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 723318FC08; Sun, 16 Sep 2012 14:24:47 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFADvgVVBbsSJD/2dsb2JhbABFhUBHtgqBCIIgAQEFIzMiARALDgoJFgsCAgkDAgECASceBg0BBQIBAYgAB6dvkWmLIYVWgRIDjmmBIIZtjw2CaA Received: from 67.34-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.34.67]) by relay.skynet.be with ESMTP; 16 Sep 2012 16:24:39 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q8GEOcZk042835; Sun, 16 Sep 2012 16:24:38 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <5055E121.2030208@coosemans.org> Date: Sun, 16 Sep 2012 16:24:33 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:14.0) Gecko/20120804 Thunderbird/14.0 MIME-Version: 1.0 To: Eitan Adler References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig64D04E78E6E01D521E57E296" Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 14:24:49 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig64D04E78E6E01D521E57E296 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16-09-2012 01:27, Eitan Adler wrote: > On 15 September 2012 17:20, Bruce Cran wrote: >> On 15/09/2012 21:57, Tijl Coosemans wrote: >>> >>> Freeing memory right before exiting is a waste of time. The tool shou= ldn't >>> complain about it. >=20 > Perhaps, but tools do. This has already been brought up on cfe-dev. >=20 >> "/Stop wasting time and just exit already/." - >> http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >=20 > I read this blog post when it came out. :) In this case the free is actually wrong, because the pointer can point to memory allocated by getmntinfo(3) and that manpage says an application= cannot free it. --------------enig64D04E78E6E01D521E57E296 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlBV4SYACgkQfoCS2CCgtiumFAD+LnchYDKAQbLekIn2QPiSI6cp 1fP1DNaeX+1N5Mu+jI4A/2PDG2/qlwF+499uPoZQjXQ1DfkMFO2VYUY69V1VKU+h =0FKG -----END PGP SIGNATURE----- --------------enig64D04E78E6E01D521E57E296-- From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 14:38:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B79E1065674; Sun, 16 Sep 2012 14:38:02 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2578E8FC12; Sun, 16 Sep 2012 14:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GEc19M008272; Sun, 16 Sep 2012 14:38:01 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GEc14B008266; Sun, 16 Sep 2012 14:38:01 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209161438.q8GEc14B008266@svn.freebsd.org> From: Andrey Zonov Date: Sun, 16 Sep 2012 14:38: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: r240562 - head/usr.bin/truss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 14:38:02 -0000 Author: zont Date: Sun Sep 16 14:38:01 2012 New Revision: 240562 URL: http://svn.freebsd.org/changeset/base/240562 Log: - Make truss thread-aware. Approved by: kib (mentor) MFC after: 2 weeks Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/main.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/setup.c head/usr.bin/truss/sparc64-fbsd.c head/usr.bin/truss/syscalls.c head/usr.bin/truss/truss.h Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-fbsd.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "syscalls.h" static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); @@ -77,30 +75,35 @@ static int nsyscalls = sizeof(syscallnam * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd_syscall { +struct freebsd_syscall { struct syscall *sc; const char *name; int number; unsigned long *args; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -115,14 +118,14 @@ amd64_syscall_entry(struct trussinfo *tr { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; int i, reg, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -142,57 +145,60 @@ amd64_syscall_entry(struct trussinfo *tr break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "fork") == 0 || - strcmp(fsc.name, "rfork") == 0|| - strcmp(fsc.name, "vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "rfork") == 0 || + strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) return; - fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + fsc->args = malloc((1 + nargs) * sizeof(unsigned long)); for (i = 0; i < nargs && reg < 6; i++, reg++) { switch (reg) { - case 0: fsc.args[i] = regs.r_rdi; break; - case 1: fsc.args[i] = regs.r_rsi; break; - case 2: fsc.args[i] = regs.r_rdx; break; - case 3: fsc.args[i] = regs.r_rcx; break; - case 4: fsc.args[i] = regs.r_r8; break; - case 5: fsc.args[i] = regs.r_r9; break; + case 0: fsc->args[i] = regs.r_rdi; break; + case 1: fsc->args[i] = regs.r_rsi; break; + case 2: fsc->args[i] = regs.r_rdx; break; + case 3: fsc->args[i] = regs.r_rcx; break; + case 4: fsc->args[i] = regs.r_r8; break; + case 5: fsc->args[i] = regs.r_r9; break; } } if (nargs > i) { iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = (void *)(regs.r_rsp + sizeof(register_t)); - iorequest.piod_addr = &fsc.args[i]; + iorequest.piod_addr = &fsc->args[i]; iorequest.piod_len = (nargs - i) * sizeof(register_t); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + ptrace(PT_IO, tid, (caddr_t)&iorequest, 0); if (iorequest.piod_len == 0) return; } - sc = get_syscall(fsc.name); + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -202,19 +208,19 @@ amd64_syscall_entry(struct trussinfo *tr * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%lx%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -226,30 +232,29 @@ amd64_syscall_entry(struct trussinfo *tr fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "execve") == 0) { + if (strcmp(fsc->name, "execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -263,16 +268,18 @@ long amd64_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -285,10 +292,11 @@ amd64_syscall_exit(struct trussinfo *tru * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -303,18 +311,18 @@ amd64_syscall_exit(struct trussinfo *tru */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } - if (fsc.name != NULL && (strcmp(fsc.name, "execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; /* @@ -322,9 +330,9 @@ amd64_syscall_exit(struct trussinfo *tru * but that complicates things considerably. */ - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-fbsd32.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "freebsd32_syscalls.h" static int nsyscalls = sizeof(freebsd32_syscallnames) / @@ -78,7 +76,7 @@ static int nsyscalls = sizeof(freebsd32_ * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd32_syscall { +struct freebsd32_syscall { struct syscall *sc; const char *name; int number; @@ -86,25 +84,29 @@ static struct freebsd32_syscall { unsigned int *args32; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd32_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd32_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd32_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.args32) - free(fsc.args32); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + free(fsc->args32); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -119,15 +121,15 @@ amd64_fbsd32_syscall_entry(struct trussi { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd32_syscall *fsc; struct syscall *sc; + lwpid_t tid; unsigned long parm_offset; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -141,60 +143,63 @@ amd64_fbsd32_syscall_entry(struct trussi syscall_num = regs.r_rax; switch (syscall_num) { case SYS_syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(int); break; case SYS___syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(quad_t); break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : freebsd32_syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "fork") == 0 || - strcmp(fsc.name, "rfork") == 0|| - strcmp(fsc.name, "vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "fork") == 0 || + strcmp(fsc->name, "rfork") == 0 || + strcmp(fsc->name, "vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) return; - fsc.args32 = malloc((1 + nargs) * sizeof(unsigned int)); + fsc->args32 = malloc((1 + nargs) * sizeof(unsigned int)); iorequest.piod_op = PIOD_READ_D; iorequest.piod_offs = (void *)parm_offset; - iorequest.piod_addr = fsc.args32; + iorequest.piod_addr = fsc->args32; iorequest.piod_len = (1 + nargs) * sizeof(unsigned int); - ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); + ptrace(PT_IO, tid, (caddr_t)&iorequest, 0); if (iorequest.piod_len == 0) return; - fsc.args = malloc((1 + nargs) * sizeof(unsigned long)); + fsc->args = malloc((1 + nargs) * sizeof(unsigned long)); for (i = 0; i < nargs + 1; i++) - fsc.args[i] = fsc.args32[i]; + fsc->args[i] = fsc->args32[i]; sc = NULL; - if (fsc.name) - sc = get_syscall(fsc.name); + if (fsc->name) + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -204,19 +209,19 @@ amd64_fbsd32_syscall_entry(struct trussi * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%x%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -228,30 +233,29 @@ amd64_fbsd32_syscall_entry(struct trussi fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0|| - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "freebsd32_execve") == 0) { + if (strcmp(fsc->name, "freebsd32_execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -265,16 +269,18 @@ long amd64_fbsd32_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) { struct reg regs; + struct freebsd32_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -287,10 +293,11 @@ amd64_fbsd32_syscall_exit(struct trussin * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -305,18 +312,18 @@ amd64_fbsd32_syscall_exit(struct trussin */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } - if (fsc.name != NULL && (strcmp(fsc.name, "freebsd32_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "freebsd32_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; /* @@ -324,9 +331,9 @@ amd64_fbsd32_syscall_exit(struct trussin * but that complicates things considerably. */ - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/amd64-linux32.c Sun Sep 16 14:38:01 2012 (r240562) @@ -59,8 +59,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "linux32_syscalls.h" static int nsyscalls = @@ -75,28 +73,34 @@ static int nsyscalls = * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct linux_syscall { +struct linux_syscall { struct syscall *sc; const char *name; int number; unsigned long args[5]; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct linux_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct linux_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct linux_syscall *fsc) { int i; - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -110,31 +114,34 @@ void amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) { struct reg regs; + struct linux_syscall *fsc; struct syscall *sc; + lwpid_t tid; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } syscall_num = regs.r_rax; - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : linux32_syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && - (strcmp(fsc.name, "linux_fork") == 0|| - strcmp(fsc.name, "linux_vfork") == 0)) + if (fsc->name && (trussinfo->flags & FOLLOWFORKS) && + (strcmp(fsc->name, "linux_fork") == 0 || + strcmp(fsc->name, "linux_vfork") == 0)) trussinfo->curthread->in_fork = 1; if (nargs == 0) @@ -148,25 +155,25 @@ amd64_linux32_syscall_entry(struct truss * that have more than five arguments? */ - fsc.args[0] = regs.r_rbx; - fsc.args[1] = regs.r_rcx; - fsc.args[2] = regs.r_rdx; - fsc.args[3] = regs.r_rsi; - fsc.args[4] = regs.r_rdi; + fsc->args[0] = regs.r_rbx; + fsc->args[1] = regs.r_rcx; + fsc->args[2] = regs.r_rdx; + fsc->args[3] = regs.r_rsi; + fsc->args[4] = regs.r_rdi; - sc = get_syscall(fsc.name); + sc = get_syscall(fsc->name); if (sc) - fsc.nargs = sc->nargs; + fsc->nargs = sc->nargs; else { #if DEBUG fprintf(trussinfo->outfile, "unknown syscall %s -- setting " - "args to %d\n", fsc.name, nargs); + "args to %d\n", fsc->name, nargs); #endif - fsc.nargs = nargs; + fsc->nargs = nargs; } - fsc.s_args = calloc(1, (1 + fsc.nargs) * sizeof(char *)); - fsc.sc = sc; + fsc->s_args = calloc(1, (1 + fsc->nargs) * sizeof(char *)); + fsc->sc = sc; /* * At this point, we set up the system call arguments. @@ -176,19 +183,19 @@ amd64_linux32_syscall_entry(struct truss * passed in *and* out, however. */ - if (fsc.name) { + if (fsc->name) { #if DEBUG - fprintf(stderr, "syscall %s(", fsc.name); + fprintf(stderr, "syscall %s(", fsc->name); #endif - for (i = 0; i < fsc.nargs; i++) { + for (i = 0; i < fsc->nargs; i++) { #if DEBUG fprintf(stderr, "0x%x%s", sc ? - fsc.args[sc->args[i].offset] : fsc.args[i], - i < (fsc.nargs - 1) ? "," : ""); + fsc->args[sc->args[i].offset] : fsc->args[i], + i < (fsc->nargs - 1) ? "," : ""); #endif if (sc && !(sc->args[i].type & OUT)) { - fsc.s_args[i] = print_arg(&sc->args[i], - fsc.args, 0, trussinfo); + fsc->s_args[i] = print_arg(&sc->args[i], + fsc->args, 0, trussinfo); } } #if DEBUG @@ -200,30 +207,29 @@ amd64_linux32_syscall_entry(struct truss fprintf(trussinfo->outfile, "\n"); #endif - if (fsc.name != NULL && (strcmp(fsc.name, "linux_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) { + if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) { /* * XXX * This could be done in a more general * manner but it still wouldn't be very pretty. */ - if (strcmp(fsc.name, "linux_execve") == 0) { + if (strcmp(fsc->name, "linux_execve") == 0) { if ((trussinfo->flags & EXECVEARGS) == 0) { - if (fsc.s_args[1]) { - free(fsc.s_args[1]); - fsc.s_args[1] = NULL; + if (fsc->s_args[1]) { + free(fsc->s_args[1]); + fsc->s_args[1] = NULL; } } if ((trussinfo->flags & EXECVEENVS) == 0) { - if (fsc.s_args[2]) { - free(fsc.s_args[2]); - fsc.s_args[2] = NULL; + if (fsc->s_args[2]) { + free(fsc->s_args[2]); + fsc->s_args[2] = NULL; } } } } - - return; + trussinfo->curthread->fsc = fsc; } /* @@ -246,16 +252,18 @@ amd64_linux32_syscall_exit(struct trussi int syscall_num __unused) { struct reg regs; + struct linux_syscall *fsc; struct syscall *sc; + lwpid_t tid; long retval; int errorp, i; - if (fsc.name == NULL) + if (trussinfo->curthread->fsc == NULL) return (-1); - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } @@ -268,10 +276,11 @@ amd64_linux32_syscall_exit(struct trussi * stand some significant cleaning. */ - sc = fsc.sc; + fsc = trussinfo->curthread->fsc; + sc = fsc->sc; if (!sc) { - for (i = 0; i < fsc.nargs; i++) - asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); + for (i = 0; i < fsc->nargs; i++) + asprintf(&fsc->s_args[i], "0x%lx", fsc->args[i]); } else { /* * Here, we only look for arguments that have OUT masked in -- @@ -286,12 +295,12 @@ amd64_linux32_syscall_exit(struct trussi */ if (errorp) { asprintf(&temp, "0x%lx", - fsc.args[sc->args[i].offset]); + fsc->args[sc->args[i].offset]); } else { temp = print_arg(&sc->args[i], - fsc.args, retval, trussinfo); + fsc->args, retval, trussinfo); } - fsc.s_args[i] = temp; + fsc->s_args[i] = temp; } } } @@ -308,13 +317,13 @@ amd64_linux32_syscall_exit(struct trussi } } - if (fsc.name != NULL && (strcmp(fsc.name, "linux_execve") == 0 || - strcmp(fsc.name, "exit") == 0)) + if (fsc->name != NULL && (strcmp(fsc->name, "linux_execve") == 0 || + strcmp(fsc->name, "exit") == 0)) trussinfo->curthread->in_syscall = 1; - print_syscall_ret(trussinfo, fsc.name, fsc.nargs, fsc.s_args, errorp, - errorp ? i : retval, fsc.sc); - clear_fsc(); + print_syscall_ret(trussinfo, fsc->name, fsc->nargs, fsc->s_args, errorp, + errorp ? i : retval, fsc->sc); + free_fsc(fsc); return (retval); } Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Sun Sep 16 13:13:02 2012 (r240561) +++ head/usr.bin/truss/i386-fbsd.c Sun Sep 16 14:38:01 2012 (r240562) @@ -62,8 +62,6 @@ static const char rcsid[] = #include "syscall.h" #include "extern.h" -static int cpid = -1; - #include "syscalls.h" static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); @@ -77,30 +75,35 @@ static int nsyscalls = sizeof(syscallnam * 'struct syscall' describes the system call; it may be NULL, however, * if we don't know about this particular system call yet. */ -static struct freebsd_syscall { +struct freebsd_syscall { struct syscall *sc; const char *name; int number; unsigned long *args; int nargs; /* number of arguments -- *not* number of words! */ char **s_args; /* the printable arguments */ -} fsc; +}; + +static struct freebsd_syscall * +alloc_fsc(void) +{ + + return (malloc(sizeof(struct freebsd_syscall))); +} /* Clear up and free parts of the fsc structure. */ -static __inline void -clear_fsc(void) +static void +free_fsc(struct freebsd_syscall *fsc) { int i; - if (fsc.args) - free(fsc.args); - if (fsc.s_args) { - for (i = 0; i < fsc.nargs; i++) - if (fsc.s_args[i]) - free(fsc.s_args[i]); - free(fsc.s_args); + free(fsc->args); + if (fsc->s_args) { + for (i = 0; i < fsc->nargs; i++) + free(fsc->s_args[i]); + free(fsc->s_args); } - memset(&fsc, 0, sizeof(fsc)); + free(fsc); } /* @@ -115,15 +118,15 @@ i386_syscall_entry(struct trussinfo *tru { struct ptrace_io_desc iorequest; struct reg regs; + struct freebsd_syscall *fsc; struct syscall *sc; + lwpid_t tid; unsigned int parm_offset; int i, syscall_num; - clear_fsc(); - - cpid = trussinfo->curthread->tid; + tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, cpid, (caddr_t)®s, 0) < 0) { + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) < 0) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return; } @@ -137,56 +140,59 @@ i386_syscall_entry(struct trussinfo *tru syscall_num = regs.r_eax; switch (syscall_num) { case SYS_syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(int); break; case SYS___syscall: - syscall_num = ptrace(PT_READ_D, cpid, (caddr_t)parm_offset, 0); + syscall_num = ptrace(PT_READ_D, tid, (caddr_t)parm_offset, 0); parm_offset += sizeof(quad_t); break; } - fsc.number = syscall_num; - fsc.name = (syscall_num < 0 || syscall_num >= nsyscalls) ? + fsc = alloc_fsc(); + if (fsc == NULL) + return; + fsc->number = syscall_num; + fsc->name = (syscall_num < 0 || syscall_num >= nsyscalls) ? NULL : syscallnames[syscall_num]; - if (!fsc.name) { + if (!fsc->name) { fprintf(trussinfo->outfile, "-- UNKNOWN SYSCALL %d --\n", syscall_num); } - if (fsc.name && (trussinfo->flags & FOLLOWFORKS) && *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 15:09:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 260E1106564A; Sun, 16 Sep 2012 15:09:21 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id CCB618FC08; Sun, 16 Sep 2012 15:09:20 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8522752pbb.13 for ; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=eR7xCxIQ5sh/Rt8TZMgkcOCnQtBfoqQZO5epbgfr1JI=; b=J0pP9dD/FaJukx0UoHtOBvrc41ZvrKnxUPkfkzqg9999NCo7oN6lUqu2SwKkhcmOeI 7+wngUBy8CBAPrJCy+/IYJ0mV+em467XKJ8xcyFcB8+a2G3IDWesPqAlM/wFnFGZpiZt UZ124x4Qb0e9TojEI07rJND5S8GAnVvIl0vbZHbVZXze1YXltKqknaENwXy7o8HGREQZ Eqyah/Omj6ZIfya26HQoRK6W9T35mbEO5mDUObFC/4tJxsbwkj4zvsokWk98csJPlKwZ eLbnq/p/rVmWuKVD3Qhr6Uou5m9stkuHK4iuOMoozTovJ5FfV3XL548iKZ4GNKq0pzoA JI6w== MIME-Version: 1.0 Received: by 10.68.234.98 with SMTP id ud2mr16323522pbc.165.1347808160307; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.13.170 with HTTP; Sun, 16 Sep 2012 08:09:20 -0700 (PDT) In-Reply-To: <20120916095355.GA83285@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> Date: Sun, 16 Sep 2012 08:09:20 -0700 X-Google-Sender-Auth: gwBE-1mTUzcmWupgK6iDOU54sj4 Message-ID: From: mdf@FreeBSD.org To: Alexey Dokuchaev Content-Type: text/plain; charset=ISO-8859-1 Cc: Chris Rees , Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 15:09:21 -0000 On Sun, Sep 16, 2012 at 2:53 AM, Alexey Dokuchaev wrote: > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: >> On 16 September 2012 10:28, Alexey Dokuchaev wrote: >> > I thought preferred and more style(9) compliant way to code [empty >> > endless loop] is: >> > >> > for (;;) >> > continue; >> >> Actually: >> >> for (;;) >> ; > > Explicit "continue" is supposed to tell reviewer that original author did > not make a typo, but indeed knew what he was doing. Lonely semicolon is too > ambiguous in this case. The semicolon being on its own line is not ambiguous, and is good style everywhere. A semicolon on the same line as a while or for is a red flag that it may be unintentional. Cheers, matthew From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 15:18:22 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1817A106566C; Sun, 16 Sep 2012 15:18:22 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id D37F78FC0C; Sun, 16 Sep 2012 15:18:21 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cmbg15-2-0-cust445.5-4.cable.virginmedia.com [86.26.13.190]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id q8GFID3S051728 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 16 Sep 2012 15:18:14 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: Date: Sun, 16 Sep 2012 16:18:08 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> To: Chris Rees X-Mailer: Apple Mail (2.1278) Cc: Andrew Turner , svn-src-head@FreeBSD.org, Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 15:18:22 -0000 On 16 Sep 2012, at 10:37, Chris Rees wrote: > Actually: >=20 > for (;;) > ; This form will generate a compiler warning, because it looks like a = missing loop body. You can silence the warning by this form: for (;;) {} This makes it clear that you have an explicit body containing no = statements. =20 David= From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 15:22:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D916106564A; Sun, 16 Sep 2012 15:22:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECCC68FC12; Sun, 16 Sep 2012 15:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GFMFhU016651; Sun, 16 Sep 2012 15:22:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GFMFco016649; Sun, 16 Sep 2012 15:22:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201209161522.q8GFMFco016649@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 16 Sep 2012 15:22: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: r240563 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 15:22:16 -0000 Author: des Date: Sun Sep 16 15:22:15 2012 New Revision: 240563 URL: http://svn.freebsd.org/changeset/base/240563 Log: Warn about filesystem-based attacks. Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Sep 16 14:38:01 2012 (r240562) +++ head/usr.sbin/jail/jail.8 Sun Sep 16 15:22:15 2012 (r240563) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2012 +.Dd September 15, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -1225,3 +1225,11 @@ directory that is moved out of the jail' access to the file space outside of the jail. It is recommended that directories always be copied, rather than moved, out of a jail. +.Pp +In addition, there are several ways in which an unprivileged user +outside the jail can cooperate with a privileged user inside the jail +and thereby obtain elevated privileges in the host environment. +Most of these attacks can be mitigated by ensuring that the jail root +is not accessible to unprivileged users in the host environment. +Regardless, as a general rule, untrusted users with privileged access +to a jail should not be given access to the host environment. From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 16:06:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 787D11065673 for ; Sun, 16 Sep 2012 16:06:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 414998FC12 for ; Sun, 16 Sep 2012 16:06:12 +0000 (UTC) Received: by dadr6 with SMTP id r6so3864157dad.13 for ; Sun, 16 Sep 2012 09:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=QAI+qv46z2LVY2EEXRQ8ZYLM4whKsP1pnMHkHh0T+GM=; b=C7hBqH7d3ivETlQYmVV4Vi1RViu5n5aKXHULgEnmqAASKlaKCQjvPZ+AZJFkdVUc6t pFHc4UXOvr3E0liae4MohHxURqn+o1M4egpapfPBeESaOk9v4pnmSl5XDpQ0AHjf4B5D oBjK+O6yHHUSVBmHxAadtqbKxfWTu/oKzJbuk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=QAI+qv46z2LVY2EEXRQ8ZYLM4whKsP1pnMHkHh0T+GM=; b=Q1GWodGXiWiohSKHWboWQdpBsOzAB+a11HLH8sg5+RPmni3hTba4karBMbPnaDwRxD CDozDSk0rSEkZhKN/NNnvxgexl/lCQwgziZor9iXncn3Vt3voblMO5cdDozrqOTCCbNR 9kUjz2xVy6QKP4lF2Lx3hkvFZ3n2kZVUaakzwr2yAUYsFicEHVl9OWPVwLP/F8ZvvfA/ gXY9gVW61onglKLuIiT21YU3DC8SmviAxZLwfNVGymOOXpQPYNl3GLOXZgBXJHLiQpLo e/ZE/Cby2CA/SntLIsaclr7r7Q4F6dQlTzMRkA7gxYdFgIWnf90m9brpQ/IEHy8+9cAT LFNQ== Received: by 10.68.210.207 with SMTP id mw15mr123048pbc.81.1347811571801; Sun, 16 Sep 2012 09:06:11 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.87.41 with HTTP; Sun, 16 Sep 2012 09:05:41 -0700 (PDT) In-Reply-To: <5055E121.2030208@coosemans.org> References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> From: Eitan Adler Date: Sun, 16 Sep 2012 12:05:41 -0400 X-Google-Sender-Auth: 1uxuEuBFkE9yU7Rwb09DhC4HenE Message-ID: To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnhEIY5wzbXdgXR/PvB7UlRgIkfPiwZSe9A48p0/3YhPRI4f5MvucAeiXgK1XYdeaAxW+BX Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 16:06:12 -0000 On 16 September 2012 10:24, Tijl Coosemans wrote: > On 16-09-2012 01:27, Eitan Adler wrote: >> On 15 September 2012 17:20, Bruce Cran wrote: >>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>> >>>> Freeing memory right before exiting is a waste of time. The tool shouldn't >>>> complain about it. >> >> Perhaps, but tools do. This has already been brought up on cfe-dev. >> >>> "/Stop wasting time and just exit already/." - >>> http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >> >> I read this blog post when it came out. :) > > In this case the free is actually wrong, because the pointer can point > to memory allocated by getmntinfo(3) and that manpage says an application > cannot free it. Ah, I missed that. I wish this point was brought up earlier. I'll revert the commit -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 16:08:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AC5A106566C; Sun, 16 Sep 2012 16:08:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E408FC08; Sun, 16 Sep 2012 16:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GG8K9H025643; Sun, 16 Sep 2012 16:08:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GG8KBQ025640; Sun, 16 Sep 2012 16:08:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209161608.q8GG8KBQ025640@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Sep 2012 16:08: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: r240565 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 16:08:21 -0000 Author: eadler Date: Sun Sep 16 16:08:20 2012 New Revision: 240565 URL: http://svn.freebsd.org/changeset/base/240565 Log: Revert 240527: mntbuf can poit to memory allocated by getmntinfo(3) which can't be freed PR: bin/171634 Approved by: cperciva (implicit) Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Sun Sep 16 15:35:05 2012 (r240564) +++ head/bin/df/df.c Sun Sep 16 16:08:20 2012 (r240565) @@ -290,7 +290,6 @@ main(int argc, char *argv[]) prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); - free(mntbuf); return (rv); } From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 16:58:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FD46106566C; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA448FC08; Sun, 16 Sep 2012 16:58:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GGwn2x034877; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GGwnM6034873; Sun, 16 Sep 2012 16:58:49 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201209161658.q8GGwnM6034873@svn.freebsd.org> From: Tijl Coosemans Date: Sun, 16 Sep 2012 16: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: r240566 - head/lib/msun/i387 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 16:58:50 -0000 Author: tijl Date: Sun Sep 16 16:58:49 2012 New Revision: 240566 URL: http://svn.freebsd.org/changeset/base/240566 Log: Optimise i387 trigonometric functions. Replace "andw 0x400,%ax \ jnz" with "sahf \ jp", "fprem1" with "fprem" and "fstsw %ax" with "fnstsw %ax". Modified: head/lib/msun/i387/s_cos.S head/lib/msun/i387/s_sin.S head/lib/msun/i387/s_tan.S Modified: head/lib/msun/i387/s_cos.S ============================================================================== --- head/lib/msun/i387/s_cos.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_cos.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(cos) fldl 4(%esp) fcos fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fcos ret Modified: head/lib/msun/i387/s_sin.S ============================================================================== --- head/lib/msun/i387/s_sin.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_sin.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,16 +40,16 @@ ENTRY(sin) fldl 4(%esp) fsin fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 +2: fprem fnstsw %ax - andw $0x400,%ax - jnz 2b + sahf + jp 2b fstp %st(1) fsin ret Modified: head/lib/msun/i387/s_tan.S ============================================================================== --- head/lib/msun/i387/s_tan.S Sun Sep 16 16:08:20 2012 (r240565) +++ head/lib/msun/i387/s_tan.S Sun Sep 16 16:58:49 2012 (r240566) @@ -40,17 +40,17 @@ ENTRY(tan) fldl 4(%esp) fptan fnstsw %ax - andw $0x400,%ax - jnz 1f + sahf + jp 1f fstp %st(0) ret 1: fldpi fadd %st(0) fxch %st(1) -2: fprem1 - fstsw %ax - andw $0x400,%ax - jnz 2b +2: fprem + fnstsw %ax + sahf + jp 2b fstp %st(1) fptan fstp %st(0) From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 17:30:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B2F106564A; Sun, 16 Sep 2012 17:30:21 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 15B938FC14; Sun, 16 Sep 2012 17:30:19 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1948733bkc.13 for ; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IrcpWgGXOGh/xt8Dc5mdEojijdCQWSH+FnOmVD4PjoU=; b=sCOA5V0SJbO8IrEghZhRGXsl7FxPytJnWU1QQ8vqo+J7tIakzTMVRy7dxNhNepHJMm /3gaVey1D1tL726YqV9+dhaSRiud1Lh0CMm1Ko6kT3fqefPz5xsPfyQCITZ8dzAyFjRQ kGF3npux8RjEy1aGcnB40X0LnI06ucLk8kuOkNEODS3wurgyiZ86fdCucq/rtj0luO6Z zo7QugkVdUxjI70iLnt1ZYFmVy8Z17oHNEKB2OK77cEl2yMwbZRfgOXcIuIdAy9Qezfn UbGjeyOLPt5PUrBabYeLeWt5sgCXUAZM5RbDO2UQ6p4q2D5q0j9Q6Z1jO1Xz3C8NtNFX Pt3w== MIME-Version: 1.0 Received: by 10.204.129.14 with SMTP id m14mr3641207bks.7.1347816618652; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:30:18 -0700 (PDT) In-Reply-To: <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> Date: Sun, 16 Sep 2012 18:30:18 +0100 Message-ID: From: Chris Rees To: David Chisnall , Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , svn-src-all@freebsd.org, src-committers@freebsd.org, Alexey Dokuchaev Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 17:30:21 -0000 On 16 Sep 2012 16:19, "David Chisnall" wrote: > > On 16 Sep 2012, at 10:37, Chris Rees wrote: > > > Actually: > > > > for (;;) > > ; > > This form will generate a compiler warning, because it looks like a missing loop body. You can silence the warning by this form: > > for (;;) {} > > This makes it clear that you have an explicit body containing no statements. Please fix the style man page then, and make sure bde approves! Chris From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 17:42:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EA41106564A; Sun, 16 Sep 2012 17:42:15 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id B0B058FC1C; Sun, 16 Sep 2012 17:41:56 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q8GHfnYl004300; Sun, 16 Sep 2012 11:41:49 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q8GHfOPM055096; Sun, 16 Sep 2012 11:41:24 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: Chris Rees In-Reply-To: References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 16 Sep 2012 11:41:24 -0600 Message-ID: <1347817284.1114.2.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 17:42:15 -0000 On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: > On 16 Sep 2012 16:19, "David Chisnall" wrote: > > > > On 16 Sep 2012, at 10:37, Chris Rees wrote: > > > > > Actually: > > > > > > for (;;) > > > ; > > > > This form will generate a compiler warning, because it looks like a > missing loop body. You can silence the warning by this form: > > > > for (;;) {} > > > > This makes it clear that you have an explicit body containing no > statements. > > Please fix the style man page then, and make sure bde approves! One of the examples allows for (;;) stmt; Using "continue;" as the statement is consistant with that. -- Ian From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 17:46:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C923106566B; Sun, 16 Sep 2012 17:46:04 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B68EA8FC12; Sun, 16 Sep 2012 17:46:02 +0000 (UTC) Received: by bkcje9 with SMTP id je9so1952572bkc.13 for ; Sun, 16 Sep 2012 10:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=foLDBXJCXa0lDansQ7xq14N3C9dLa0UmahRpiY7SgIA=; b=eC7C/9fc8LfmV8Lua4mqwUNfaZSf/IdJaDA27TflC8Rd3K9vzlEz/9MndCNnJtwJSC JeZkkCmSaz3m9++d/duVS2JSbTMIUyvaQdjIc2d5CI5zig8JETSOi01VIJwNmo6AvLkL jPMSwo/WJRRsyD10Pd/IzfSoZQCIeTtAjh9JJYLULn+yQEwvDK9TIhXLVUjwERKTteWp r9vh4IjCVMoimENBF2U5iuyOSiKXldp2Pe/pIvWx7qpc0A3s3ukhbscao673EMyYUjuW 98PE4TvQWDSuCSYvrRYzWHTME6X2i6y91goCQMn+awIeFjwcQmTHl+3GApR3D1N5nXip RW+w== Received: by 10.204.145.82 with SMTP id c18mr3508156bkv.133.1347817561299; Sun, 16 Sep 2012 10:46:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.10.141 with HTTP; Sun, 16 Sep 2012 10:45:30 -0700 (PDT) In-Reply-To: <1347817284.1114.2.camel@revolution.hippie.lan> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> From: Chris Rees Date: Sun, 16 Sep 2012 18:45:30 +0100 Message-ID: To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 17:46:04 -0000 On 16 September 2012 18:41, Ian Lepore wrote: > On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >> On 16 Sep 2012 16:19, "David Chisnall" wrote: >> > >> > On 16 Sep 2012, at 10:37, Chris Rees wrote: >> > >> > > Actually: >> > > >> > > for (;;) >> > > ; >> > >> > This form will generate a compiler warning, because it looks like a >> missing loop body. You can silence the warning by this form: >> > >> > for (;;) {} >> > >> > This makes it clear that you have an explicit body containing no >> statements. >> >> Please fix the style man page then, and make sure bde approves! > > One of the examples allows > > for (;;) > stmt; > > Using "continue;" as the statement is consistant with that. Ok, so with approval from a docs/src guy I'd like to commit [1] to update the style page to use continue; instead of a lone ; Anyone like to approve/commit? Chris [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 18:00:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 97AEB106566C; Sun, 16 Sep 2012 18:00:49 +0000 (UTC) Date: Sun, 16 Sep 2012 18:00:49 +0000 From: Alexey Dokuchaev To: Chris Rees Message-ID: <20120916180049.GA62999@FreeBSD.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 18:00:49 -0000 On Sun, Sep 16, 2012 at 06:45:30PM +0100, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: > > One of the examples allows > > > > for (;;) > > stmt; > > > > Using "continue;" as the statement is consistant with that. > > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > > Anyone like to approve/commit? I personally like you patch, but I'd really want to get bde@'s blessing. (Maybe that "nothing" in comment should be replaced with "do nothing", hmm... Bruce, where are you?) ./danfe > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 18:38:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833731065675 for ; Sun, 16 Sep 2012 18:38:05 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1755D8FC15 for ; Sun, 16 Sep 2012 18:38:04 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8676950pbb.13 for ; Sun, 16 Sep 2012 11:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=LmiwIronrD7Z01DBz6AmMXeW2eEJRla6L73fvD9KASc=; b=YozUTjtUIGX03lxR3sDwo2yWNrSSUrUOi1TEuTc3i1SeSTvFDmCraXagqvkEjCpYL5 xLpHYz4UHW/nFfWfexeYwvCGrDtoA2P8HofUgFSbzVksc/qwCxoRE3fGsXdd66+0MUQP x0xggjJPgCN23SoLp/p2CmjYxB4DT2bTH3p74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=LmiwIronrD7Z01DBz6AmMXeW2eEJRla6L73fvD9KASc=; b=AZr7ZZetcm4GRmLMvR4lk/iXeMtTSeb8f8ItYRJ7/3Ssba5qRxM6FmWBO35+o6uUC8 +5+/ZGXIgkhZkOnnVAivWvDpAk07tHutDwvMBbEbDzilgSe4vnf+fYOgsmhpuY/LEibQ ICG08a5rtql2tCNkzKmMMDKmARiRosWZhTH9tSpCAy98cgl0DxSfdlfwJClYN5lwhuJu IbglB5qWePZZXBS3xw+kD5BRGHH096kTIi4p0fxvOi+cpUa4fcvFCe0WfvWn3iWk8y+N AeEF4lhcooOMo4/ffhNN32VJE95j5RBqrhj5l28MKmckXPDekbpdx0yZ0xW0AUEglyIC dbXQ== Received: by 10.66.73.100 with SMTP id k4mr15547593pav.49.1347820681827; Sun, 16 Sep 2012 11:38:01 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.87.41 with HTTP; Sun, 16 Sep 2012 11:37:31 -0700 (PDT) In-Reply-To: References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> From: Eitan Adler Date: Sun, 16 Sep 2012 14:37:31 -0400 X-Google-Sender-Auth: lwVCgZQMLzZVERymXgTVArVn_vM Message-ID: To: Chris Rees Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn2FVM1+MxtRo9C4a9YypucRYEmI9ndEMpbCQOJqZ3ItRI6y3mlXclPbWfVzVJwGb7PDF6e Cc: Ian Lepore , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 18:38:05 -0000 On 16 September 2012 13:45, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: >> On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >>> On 16 Sep 2012 16:19, "David Chisnall" wrote: >>> > >>> > On 16 Sep 2012, at 10:37, Chris Rees wrote: >>> > >>> > > Actually: >>> > > >>> > > for (;;) >>> > > ; >>> > >>> > This form will generate a compiler warning, because it looks like a >>> missing loop body. You can silence the warning by this form: >>> > >>> > for (;;) {} >>> > >>> > This makes it clear that you have an explicit body containing no >>> statements. >>> >>> Please fix the style man page then, and make sure bde approves! >> >> One of the examples allows >> >> for (;;) >> stmt; >> >> Using "continue;" as the statement is consistant with that. > > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > > Anyone like to approve/commit? +1 to your patch, though I prefer "do nothing" to "nothing." > > Chris > > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff > -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 18:57:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFCFD106579D; Sun, 16 Sep 2012 18:57:42 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8878FC19; Sun, 16 Sep 2012 18:57:42 +0000 (UTC) Received: from [192.168.1.27] (unknown [176.222.238.90]) by csmtp3.one.com (Postfix) with ESMTPA id 4182C240B1C3; Sun, 16 Sep 2012 18:57:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Erik Cederstrand In-Reply-To: Date: Sun, 16 Sep 2012 20:57:34 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> To: Eitan Adler X-Mailer: Apple Mail (2.1486) Cc: Bruce Cran , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tijl Coosemans , src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 18:57:43 -0000 Den 16/09/2012 kl. 18.05 skrev Eitan Adler : > On 16 September 2012 10:24, Tijl Coosemans wrote: >> On 16-09-2012 01:27, Eitan Adler wrote: >>> On 15 September 2012 17:20, Bruce Cran wrote: >>>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>>>=20 >>>>> Freeing memory right before exiting is a waste of time. The tool = shouldn't >>>>> complain about it. >>>=20 >>> Perhaps, but tools do. This has already been brought up on cfe-dev. >>>=20 >>>> "/Stop wasting time and just exit already/." - >>>> = http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx >>>=20 >>> I read this blog post when it came out. :) >>=20 >> In this case the free is actually wrong, because the pointer can = point >> to memory allocated by getmntinfo(3) and that manpage says an = application >> cannot free it. >=20 > Ah, I missed that. I wish this point was brought up earlier. I'll > revert the commit I was the one who filed the PR = (http://www.freebsd.org/cgi/query-pr.cgi?pr=3D171634). I'm embarrassed = to have caused a wrong commit. The big picture is I'm looking through the Clang Analyzer scans at = http://scan.freebsd.your.org/freebsd-head trying to find false positives = to report back to LLVM. Their PR originated in this warning: = http://scan.freebsd.your.org/freebsd-head/bin.df/2012-09-12-amd64/report-W= wB2qk.html#EndPath The scan has 326 warnings about possible memory leaks = in world, so I'd really like to do something here, be it either via bug = report with LLVM or FreeBSD or to annotate the code to say it's okay to = break the rules. There response from LLVM (disregarding that mntbuf can't be freed) is = either that: 1) if main() is redefined as a macro, it's still a leak, = and 2) they can skip the warning only if it's feasible to reason that = prtstat() doesn't allocate memory. I noticed that the sentence "The memory allocated by getmntinfo() cannot = be free(3)'d by the application." in the getmntinfo(3) manage is in the = bugs section. Does this mean it's something that should be fixed in = FreeBSD eventually? Erik= From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 18:58:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BDCEA10656D4; Sun, 16 Sep 2012 18:58:48 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 8665A8FC12; Sun, 16 Sep 2012 18:58:48 +0000 (UTC) Received: from JRE-MBP-2.local (c-50-143-149-8.hsd1.ca.comcast.net [50.143.149.8]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id q8GIwfoe081548 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 16 Sep 2012 11:58:42 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <50562161.2000103@freebsd.org> Date: Sun, 16 Sep 2012 11:58:41 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Chris Rees References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <20120916095355.GA83285@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Andrew Turner , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 18:58:49 -0000 On 9/16/12 3:07 AM, Chris Rees wrote: > > > On 16 Sep 2012 10:53, "Alexey Dokuchaev" > wrote: > > > > On Sun, Sep 16, 2012 at 10:37:56AM +0100, Chris Rees wrote: > > > On 16 September 2012 10:28, Alexey Dokuchaev > wrote: > > > > I thought preferred and more style(9) compliant way to code [empty > > > > endless loop] is: > > > > > > > > for (;;) > > > > continue; > > > > > > Actually: > > > > > > for (;;) > > > ; > > > > Explicit "continue" is supposed to tell reviewer that original > author did > > not make a typo, but indeed knew what he was doing. Lonely > semicolon is too > > ambiguous in this case. > > > > ./danfe > > > for (;;) {} > That's not what man style says... > > Chris > From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 19:42:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876D01065712; Sun, 16 Sep 2012 19:42:28 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72B5E8FC08; Sun, 16 Sep 2012 19:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GJgSjW064951; Sun, 16 Sep 2012 19:42:28 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GJgSxK064948; Sun, 16 Sep 2012 19:42:28 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201209161942.q8GJgSxK064948@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Sep 2012 19:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240571 - head/sys/arm/ti/cpsw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 19:42:28 -0000 Author: jmg Date: Sun Sep 16 19:42:27 2012 New Revision: 240571 URL: http://svn.freebsd.org/changeset/base/240571 Log: remove some unnecessary debugging statements, dead code and incorrect comment... Reviewed by: gnn, imp Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Sun Sep 16 18:57:32 2012 (r240570) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sun Sep 16 19:42:27 2012 (r240571) @@ -713,8 +713,6 @@ cpsw_ioctl(struct ifnet *ifp, u_long com sc->cpsw_if_flags = ifp->if_flags; CPSW_GLOBAL_UNLOCK(sc); break; - printf("%s: SIOCSIFFLAGS\n",__func__); - break; case SIOCADDMULTI: printf("%s: SIOCADDMULTI\n",__func__); break; @@ -724,12 +722,10 @@ cpsw_ioctl(struct ifnet *ifp, u_long com case SIOCSIFCAP: printf("%s: SIOCSIFCAP\n",__func__); break; - case SIOCGIFMEDIA: /* fall through */ - printf("%s: SIOCGIFMEDIA\n",__func__); + case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); break; case SIOCSIFMEDIA: - printf("%s: SIOCSIFMEDIA\n",__func__); error = ifmedia_ioctl(ifp, ifr, &sc->mii->mii_media, command); break; default: From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 19:48:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 94082106566C; Sun, 16 Sep 2012 19:48:49 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2FC8FC18; Sun, 16 Sep 2012 19:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GJmnEJ066092; Sun, 16 Sep 2012 19:48:49 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GJmnon066073; Sun, 16 Sep 2012 19:48:49 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201209161948.q8GJmnon066073@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Sep 2012 19:48: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: r240572 - head/sys/arm/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, 16 Sep 2012 19:48:49 -0000 Author: jmg Date: Sun Sep 16 19:48:48 2012 New Revision: 240572 URL: http://svn.freebsd.org/changeset/base/240572 Log: fix the kernel files to match our standard "option" format such that when commenting/uncommentting lines, horizontal spacing is maintained... Also fix some minor comment formatting to line things up, etc... Reviewed by: gnn, imp MFC after: 1 week Modified: head/sys/arm/conf/ARMADAXP head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/EA3250 head/sys/arm/conf/GUMSTIX-QEMU head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/PANDABOARD head/sys/arm/conf/QILA9G20 head/sys/arm/conf/RPI-B head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 Modified: head/sys/arm/conf/ARMADAXP ============================================================================== --- head/sys/arm/conf/ARMADAXP Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/ARMADAXP Sun Sep 16 19:48:48 2012 (r240572) @@ -92,8 +92,8 @@ device mge # Marvell Gigabit Ethernet device mii device e1000phy device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan #PCI/PCIE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/BEAGLEBONE Sun Sep 16 19:48:48 2012 (r240572) @@ -25,52 +25,52 @@ include "../ti/am335x/std.beaglebone" makeoptions MODULES_OVERRIDE="" makeoptions WITHOUT_MODULES="ahc" -options HZ=100 -options SCHED_4BSD #4BSD scheduler -options INET #InterNETworking -options INET6 #IPv6 communications protocols -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 MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options PROCFS #Process filesystem (requires PSEUDOFS) -options PSEUDOFS #Pseudo-filesystem framework -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI -options KTRACE #ktrace(1) support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions -options KBD_INSTALL_CDEV # install a CDEV entry in /dev -options PREEMPTION +options HZ=100 +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options INET6 #IPv6 communications protocols +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 MSDOSFS #MSDOS Filesystem +options CD9660 #ISO 9660 Filesystem +options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options KBD_INSTALL_CDEV # install a CDEV entry in /dev +options PREEMPTION # Debugging makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT #Enable verbose sysinit messages -options KDB -options DDB #Enable the kernel debugger -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 -#options DIAGNOSTIC +options BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT #Enable verbose sysinit messages +options KDB +options DDB #Enable the kernel debugger +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 +#options DIAGNOSTIC # NFS support -#options NFSCL -#options NFSSERVER #Network Filesystem Server -#options NFSCLIENT #Network Filesystem Client +#options NFSCL +#options NFSSERVER #Network Filesystem Server +#options NFSCLIENT #Network Filesystem Client # Uncomment this for NFS root -#options NFS_ROOT #NFS usable as /, requires NFSCLIENT -#options BOOTP_NFSROOT -#options BOOTP_COMPAT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=cpsw0 +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=cpsw0 # MMC/SD/SDIO card slot support @@ -78,7 +78,7 @@ device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards # Boot device is 2nd slice on MMC/SD card -options ROOTDEVNAME=\"ufs:mmcsd0s2\" +options ROOTDEVNAME=\"ufs:mmcsd0s2\" # Console and misc device uart @@ -99,9 +99,9 @@ device gpio # USB support device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +options USB_DEBUG +#options USB_REQ_DEBUG +#options USB_VERBOSE device musb device umass device scbus # SCSI bus (required for SCSI) Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/CNS11XXNAS Sun Sep 16 19:48:48 2012 (r240572) @@ -47,9 +47,9 @@ options DDB #Enable the kernel debugg #options DIAGNOSTIC -#options COMPAT_FREEBSD5 -#options COMPAT_FREEBSD6 -#options COMPAT_FREEBSD7 +#options COMPAT_FREEBSD5 +#options COMPAT_FREEBSD6 +#options COMPAT_FREEBSD7 options SCHED_ULE #ULE scheduler @@ -121,4 +121,4 @@ device geom_label device geom_journal device geom_part_bsd -options ROOTDEVNAME=\"ufs:da0s1a\" +options ROOTDEVNAME=\"ufs:da0s1a\" Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/DOCKSTAR Sun Sep 16 19:48:48 2012 (r240572) @@ -56,8 +56,8 @@ device ether device mge # Marvell Gigabit Ethernet controller device mii device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan # USB @@ -71,5 +71,5 @@ device da # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=dockstar.dts Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/EA3250 Sun Sep 16 19:48:48 2012 (r240572) @@ -65,7 +65,7 @@ device bpf device lpe # USB -options USB_DEBUG +options USB_DEBUG device usb device ohci device umass Modified: head/sys/arm/conf/GUMSTIX-QEMU ============================================================================== --- head/sys/arm/conf/GUMSTIX-QEMU Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/GUMSTIX-QEMU Sun Sep 16 19:48:48 2012 (r240572) @@ -21,5 +21,5 @@ include GUMSTIX ident GUMSTIX-QEMU -options QEMU_WORKAROUNDS +options QEMU_WORKAROUNDS nooptions ARM_CACHE_LOCK_ENABLE # QEMU does not implement this Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/HL201 Sun Sep 16 19:48:48 2012 (r240572) @@ -49,7 +49,7 @@ options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ate0 options BOOTP_COMPAT -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem @@ -128,5 +128,5 @@ device pass # Passthrough device (dire #device wlan_ccmp # 802.11 CCMP support #device wlan_tkip # 802.11 TKIP support #device wlan_amrr # AMRR transmit rate control algorithm -options ROOTDEVNAME=\"ufs:da0s1a\" +options ROOTDEVNAME=\"ufs:da0s1a\" Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/KB920X Sun Sep 16 19:48:48 2012 (r240572) @@ -144,6 +144,6 @@ device usfs # emulate a flash device cdce # emulate an ethernet device usb_template # Control of the gadget -options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_MESH -options AH_SUPPORT_AR5416 +options AH_SUPPORT_AR5416 Modified: head/sys/arm/conf/LN2410SBC ============================================================================== --- head/sys/arm/conf/LN2410SBC Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/LN2410SBC Sun Sep 16 19:48:48 2012 (r240572) @@ -40,7 +40,7 @@ options FFS #Berkeley Fast Filesystem #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device #options MD_ROOT_SIZE=4096 # 4MB ram disk -options ROOTDEVNAME=\"ufs:da0s1\" +options ROOTDEVNAME=\"ufs:da0s1\" #options BOOTP #options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info Modified: head/sys/arm/conf/PANDABOARD ============================================================================== --- head/sys/arm/conf/PANDABOARD Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/PANDABOARD Sun Sep 16 19:48:48 2012 (r240572) @@ -46,15 +46,15 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories options NFSCLIENT #Network Filesystem Client device snp -#options NFSCL +#options NFSCL #options NFSSERVER #Network Filesystem Server options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options BREAK_TO_DEBUGGER -options BOOTP_NFSROOT -options BOOTP_COMPAT -options BOOTP -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ue0 +options BREAK_TO_DEBUGGER +options BOOTP_NFSROOT +options BOOTP_COMPAT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ue0 options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem #options PROCFS #Process filesystem (requires PSEUDOFS) @@ -93,7 +93,7 @@ device pty device pl310 # PL310 L2 cache controller # Debugging for use in -current -#options VERBOSE_SYSINIT #Enable verbose sysinit messages +#options VERBOSE_SYSINIT #Enable verbose sysinit messages options KDB options DDB #Enable the kernel debugger #options INVARIANTS #Enable calls of extra sanity checking @@ -106,16 +106,16 @@ device md # The following enables MFS as root, this seems similar to an initramfs or initrd # as used in Linux. -# options MD_ROOT -# options MD_ROOT_SIZE=7560 +#options MD_ROOT +#options MD_ROOT_SIZE=7560 device random # Entropy device # USB support device usb options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE +#options USB_REQ_DEBUG +#options USB_VERBOSE device ohci device ehci device umass @@ -125,7 +125,7 @@ device da # Direct Access (disks) # USB Ethernet support, requires miibus device miibus -# device axe # ASIX Electronics USB Ethernet +#device axe # ASIX Electronics USB Ethernet device smsc # SMSC LAN95xx USB Ethernet @@ -140,5 +140,5 @@ options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=pandaboard.dts -# device vfp # vfp/neon -# options ARM_VFP_SUPPORT # vfp/neon +#device vfp # vfp/neon +#options ARM_VFP_SUPPORT # vfp/neon Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/QILA9G20 Sun Sep 16 19:48:48 2012 (r240572) @@ -51,7 +51,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/RPI-B Sun Sep 16 19:48:48 2012 (r240572) @@ -24,12 +24,12 @@ cpu CPU_ARM11 files "../broadcom/bcm2835/files.bcm2835" makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0xc0100000 +options KERNVIRTADDR=0xc0100000 makeoptions KERNVIRTADDR=0xc0100000 -options KERNPHYSADDR=0x00100000 +options KERNPHYSADDR=0x00100000 makeoptions KERNPHYSADDR=0x00100000 -options PHYSADDR=0x00000000 -options STARTUP_PAGETABLE_ADDR=0x01000000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x01000000 makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols options HZ=100 @@ -42,13 +42,13 @@ options UFS_ACL #Support for access c options UFS_DIRHASH #Improve performance on big directories device snp -# options NFSCL #Network Filesystem Client -# options NFS_ROOT #NFS usable as /, requires NFSCLIENT -# options BOOTP_NFSROOT -# options BOOTP_COMPAT -# options BOOTP -# options BOOTP_NFSV3 -# options BOOTP_WIRED_TO=ue0 +#options NFSCL #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP_NFSROOT +#options BOOTP_COMPAT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SAM9G20EK Sun Sep 16 19:48:48 2012 (r240572) @@ -50,7 +50,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SAM9X25EK Sun Sep 16 19:48:48 2012 (r240572) @@ -51,7 +51,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SHEEVAPLUG Sun Sep 16 19:48:48 2012 (r240572) @@ -56,8 +56,8 @@ device mge # Marvell Gigabit Ethernet device mii device e1000phy device bpf -options HZ=1000 -options DEVICE_POLLING +options HZ=1000 +options DEVICE_POLLING device vlan device cesa # Marvell security engine @@ -78,5 +78,5 @@ device nand # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=sheevaplug.dts Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/SN9G45 Sun Sep 16 19:48:48 2012 (r240572) @@ -50,7 +50,7 @@ options NFSCL #New Network Filesystem options ROOTDEVNAME=\"ufs:/dev/da0s1\" -options ALT_BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER #options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Sep 16 19:42:27 2012 (r240571) +++ head/sys/arm/conf/TS7800 Sun Sep 16 19:48:48 2012 (r240572) @@ -74,6 +74,6 @@ options ATA_CAM # Flattened Device Tree options FDT -options FDT_DTB_STATIC +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=ts7800.dts From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 21:17:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBC8106566B; Sun, 16 Sep 2012 21:17:28 +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 98A898FC0C; Sun, 16 Sep 2012 21:17:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GLHSAn082099; Sun, 16 Sep 2012 21:17:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GLHSQT082096; Sun, 16 Sep 2012 21:17:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209162117.q8GLHSQT082096@svn.freebsd.org> From: Joel Dahl Date: Sun, 16 Sep 2012 21:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240573 - 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: Sun, 16 Sep 2012 21:17:28 -0000 Author: joel (doc committer) Date: Sun Sep 16 21:17:28 2012 New Revision: 240573 URL: http://svn.freebsd.org/changeset/base/240573 Log: Remove trailing whitespace. Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Sun Sep 16 19:48:48 2012 (r240572) +++ head/share/man/man9/pfil.9 Sun Sep 16 21:17:28 2012 (r240573) @@ -132,7 +132,7 @@ IPv4 and IPv6 packets. Note that packet .Cm converted to host format. Host format has to be preserved in case of header modifications. .It AF_LINK -Link-layer packets. +Link-layer packets. .El .Sh RETURN VALUES If successful, From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 21:22:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4961106564A; Sun, 16 Sep 2012 21:22:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD728FC0A; Sun, 16 Sep 2012 21:22:05 +0000 (UTC) Received: from c122-106-157-84.carlnfd1.nsw.optusnet.com.au (c122-106-157-84.carlnfd1.nsw.optusnet.com.au [122.106.157.84]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q8GLLqsa026855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Sep 2012 07:21:53 +1000 Date: Mon, 17 Sep 2012 07:21:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Chris Rees In-Reply-To: Message-ID: <20120917063509.E3825@besplex.bde.org> References: <201209160755.q8G7tnMH036332@svn.freebsd.org> <20120916092818.GA81952@FreeBSD.org> <38FB39C4-7626-4D54-8197-E302BB9452D2@FreeBSD.org> <1347817284.1114.2.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ian Lepore , Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Andrew Turner , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r240549 - head/sys/arm/tegra X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 21:22:07 -0000 On Sun, 16 Sep 2012, Chris Rees wrote: > On 16 September 2012 18:41, Ian Lepore wrote: >> On Sun, 2012-09-16 at 18:30 +0100, Chris Rees wrote: >>> On 16 Sep 2012 16:19, "David Chisnall" wrote: >>>> >>>> On 16 Sep 2012, at 10:37, Chris Rees wrote: >>>> >>>>> Actually: >>>>> >>>>> for (;;) >>>>> ; >>>> >>>> This form will generate a compiler warning, because it looks like a >>> missing loop body. You can silence the warning by this form: >>>> >>>> for (;;) {} >>>> >>>> This makes it clear that you have an explicit body containing no >>> statements. This is forbidden by style(9) (it has excessive braces). >>> Please fix the style man page then, and make sure bde approves! >> >> One of the examples allows >> >> for (;;) >> stmt; >> >> Using "continue;" as the statement is consistant with that. So is using a null statement. Actually, the informal grammar in the example is buggy. In more formal grammars, the semicolon is part of a statement (unless the statement is compound). So the above should really be: for (;;) statement but that looks strange, and we know what the current version means. > Ok, so with approval from a docs/src guy I'd like to commit [1] to > update the style page to use continue; instead of a lone ; > ... > [1] http://www.bayofrum.net/~crees/patches/style-empty-loop.diff I don't like this. The style is whatever it was, not what you want it to be. However, I couldn't find a single example in /usr/src/*bin or libc that has an empty for loop. Normal code just doesn't do that. It would be better to remove the example of the empty loop in style(9), so that style(9) doesn't require any particular style for rarely-written code. Oops. The loop that you changed is not the above fully empty one, but one with control statements but no body. I couldn't find any like the above, and ones with control statements are too hard to grep for. The one that you changed is basically strlen(), and an example of existing (mal)practice was in the 4.4BSD version of strlen.c: % size_t % strlen(str) % const char *str; % { % const char *s; % % for (s = str; *s; ++s); % return(s - str); % } It doesn't even put the semicolon on a new line. strlen.c is now recomplicated, so it no longer provides a bad example. strlen() is also in K&R, with better style but a while loop: while (s[i] != '\0') i++; and of course the classic obfuscated idiom for strcpy is to do all the work in the control statment. This obfuscation is done fairly well in 4.4BSD again: for (; *to = *from; ++from, ++to); (why not *to++, etc?). I use a single semicolon for fully empty loops, but not put all of the work in the control statement for loops that do something, so that the never have an empty body. Adding 'continue /* nothing */' to the old BSD code wouldn't improve it. Its only good point is that it is concise, and this is defeated by redundant addiitons. Bruce From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 22:45:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D4C106564A; Sun, 16 Sep 2012 22:45:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 083B98FC08; Sun, 16 Sep 2012 22:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GMj054098524; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GMj0Ig098522; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209162245.q8GMj0Ig098522@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Sep 2012 22:45: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: r240574 - 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: Sun, 16 Sep 2012 22:45:01 -0000 Author: adrian Date: Sun Sep 16 22:45:00 2012 New Revision: 240574 URL: http://svn.freebsd.org/changeset/base/240574 Log: Fix a crash bug introduced in the iterate node work recently done. When resuming, the first VAP is checked for max_aid; however if there is no VAP, this results in a NULL pointer dereference and kernel panic. Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Sep 16 21:17:28 2012 (r240573) +++ head/sys/net80211/ieee80211_node.c Sun Sep 16 22:45:00 2012 (r240574) @@ -2245,8 +2245,16 @@ ieee80211_iterate_nodes(struct ieee80211 size_t size; int i; uint16_t max_aid; + struct ieee80211vap *vap; + + /* Overdoing it default */ + max_aid = IEEE80211_AID_MAX; + + /* Handle the case of there being no vaps just yet */ + vap = TAILQ_FIRST(&nt->nt_ic->ic_vaps); + if (vap != NULL) + max_aid = vap->iv_max_aid; - max_aid = TAILQ_FIRST(&nt->nt_ic->ic_vaps)->iv_max_aid; size = max_aid * sizeof(struct ieee80211_node *); ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE, M_NOWAIT | M_ZERO); From owner-svn-src-head@FreeBSD.ORG Sun Sep 16 23:25:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 449BA106564A; Sun, 16 Sep 2012 23:25:14 +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 3006F8FC08; Sun, 16 Sep 2012 23:25:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8GNPEi7005514; Sun, 16 Sep 2012 23:25:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GNPDQC005510; Sun, 16 Sep 2012 23:25:13 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201209162325.q8GNPDQC005510@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 16 Sep 2012 23:25: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: r240575 - head/usr.bin/rctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Sep 2012 23:25:14 -0000 Author: trasz Date: Sun Sep 16 23:25:13 2012 New Revision: 240575 URL: http://svn.freebsd.org/changeset/base/240575 Log: Remove references to userstat(1) and jailstat(1). Those tools were never merged from the Perforce branch. They might be brought in when %CPU limits go into the tree. PR: docs/171240 MFC after: 2 weeks Modified: head/usr.bin/rctl/rctl.8 Modified: head/usr.bin/rctl/rctl.8 ============================================================================== --- head/usr.bin/rctl/rctl.8 Sun Sep 16 22:45:00 2012 (r240574) +++ head/usr.bin/rctl/rctl.8 Sun Sep 16 23:25:13 2012 (r240575) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2012 +.Dd September 16, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -184,9 +184,7 @@ Display resource usage information for j .Pp Display all the rules applicable to process with PID 512. .Sh SEE ALSO -.Xr rctl.conf 5 , -.Xr jailstat 8 , -.Xr userstat 8 +.Xr rctl.conf 5 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 01:09:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DCA33106564A; Mon, 17 Sep 2012 01:09:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE4F38FC08; Mon, 17 Sep 2012 01:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H19HaF020108; Mon, 17 Sep 2012 01:09:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H19HJD020106; Mon, 17 Sep 2012 01:09:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170109.q8H19HJD020106@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:09: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: r240583 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:09:18 -0000 Author: adrian Date: Mon Sep 17 01:09:17 2012 New Revision: 240583 URL: http://svn.freebsd.org/changeset/base/240583 Log: Improve performance of the Sample rate algorithm on 802.11n networks. * Don't treat high percentage failures as "sucessive failures" - high MCS rates are very picky and will quite happily "fade" from low to high failure % and back again within a few seconds. If they really don't work, the aggregate will just plain fail. * Only sample MCS rates +/- 3 from the current MCS. Sample will back off quite quickly, so there's no need to sample _all_ MCS rates between a high MCS rate and MCS0; there may be a lot of them. * Modify the smoothing rate to be 75% rather than 95% - it's more adaptive but it comes with a cost of being slightly less stable at times. A per-node, hysterisis behaviour would be nicer. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 17 00:56:10 2012 (r240582) +++ head/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 17 01:09:17 2012 (r240583) @@ -293,27 +293,17 @@ pick_sample_rate(struct sample_softc *ss } /* - * When doing aggregation, successive failures don't happen - * as often, as sometimes some of the sub-frames get through. - * - * If the sample rix average tx time is greater than the - * average tx time of the current rix, don't immediately use - * the rate for sampling. + * For HT, only sample a few rates on either side of the + * current rix; there's quite likely a lot of them. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if ((sn->stats[size_bin][rix].average_tx_time * 10 > - sn->stats[size_bin][current_rix].average_tx_time * 9) && - (ticks - sn->stats[size_bin][rix].last_tx < ssc->stale_failure_timeout)) { + if (rix < (current_rix - 3) || + rix > (current_rix + 3)) { mask &= ~((uint64_t) 1< 11M for non-HT rates */ if (! (an->an_node.ni_flags & IEEE80211_NODE_HT)) { if (DOT11RATE(rix) > 2*11 && rix > current_rix + 2) { @@ -1420,7 +1410,7 @@ ath_rate_attach(struct ath_softc *sc) if (ssc == NULL) return NULL; ssc->arc.arc_space = sizeof(struct sample_node); - ssc->smoothing_rate = 95; /* ewma percentage ([0..99]) */ + ssc->smoothing_rate = 75; /* ewma percentage ([0..99]) */ ssc->smoothing_minpackets = 100 / (100 - ssc->smoothing_rate); ssc->sample_rate = 10; /* %time to try diff tx rates */ ssc->max_successive_failures = 3; /* threshold for rate sampling*/ From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 01:18:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EB4B106566C; Mon, 17 Sep 2012 01:18:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59E5E8FC08; Mon, 17 Sep 2012 01:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H1Im5t021340; Mon, 17 Sep 2012 01:18:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H1ImMg021338; Mon, 17 Sep 2012 01:18:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170118.q8H1ImMg021338@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:18: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: r240584 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:18:48 -0000 Author: adrian Date: Mon Sep 17 01:18:47 2012 New Revision: 240584 URL: http://svn.freebsd.org/changeset/base/240584 Log: Add a debug bit for TX destination filtering. Modified: head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Mon Sep 17 01:09:17 2012 (r240583) +++ head/sys/dev/ath/if_ath_debug.h Mon Sep 17 01:18:47 2012 (r240584) @@ -65,6 +65,7 @@ enum { ATH_DEBUG_FATAL = 0x080000000ULL, /* fatal errors */ ATH_DEBUG_SW_TX_BAR = 0x100000000ULL, /* BAR TX */ ATH_DEBUG_EDMA_RX = 0x200000000ULL, /* RX EDMA state */ + ATH_DEBUG_SW_TX_FILT = 0x400000000ULL, /* SW TX FF */ ATH_DEBUG_ANY = 0xffffffffffffffffULL }; From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 01:21:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9625106566B; Mon, 17 Sep 2012 01:21:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3A28FC08; Mon, 17 Sep 2012 01:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H1Ltba021743; Mon, 17 Sep 2012 01:21:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H1Lta0021740; Mon, 17 Sep 2012 01:21:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170121.q8H1Lta0021740@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 01:21: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: r240585 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 01:21:55 -0000 Author: adrian Date: Mon Sep 17 01:21:55 2012 New Revision: 240585 URL: http://svn.freebsd.org/changeset/base/240585 Log: Add a per-TID filter queue and filter state bits. These are intended for software TX filtering support, where the NIC decides there has been too many successive failues to a destination and will filter it. Although the filtering is done per-destination (via the keycache), the state and queue is kept per-TID for now. It simplifies the overall architecture design and locking. Whilst here, add ATH_TID_UNLOCK_ASSERT(). Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Sep 17 01:18:47 2012 (r240584) +++ head/sys/dev/ath/if_athvar.h Mon Sep 17 01:21:55 2012 (r240585) @@ -107,6 +107,12 @@ struct ath_tid { int ac; /* which AC gets this trafic */ int hwq_depth; /* how many buffers are on HW */ + struct { + TAILQ_HEAD(,ath_buf) axq_q; /* filtered queue */ + u_int axq_depth; /* SW queue depth */ + char axq_name[48]; /* lock name */ + } filtq; + /* * Entry on the ath_txq; when there's traffic * to send @@ -114,9 +120,16 @@ struct ath_tid { TAILQ_ENTRY(ath_tid) axq_qelem; int sched; int paused; /* >0 if the TID has been paused */ + + /* + * These are flags - perhaps later collapse + * down to a single uint32_t ? + */ int addba_tx_pending; /* TX ADDBA pending */ int bar_wait; /* waiting for BAR */ int bar_tx; /* BAR TXed */ + int isfiltered; /* is this node currently filtered */ + int clrdmask; /* has clrdmask been set */ /* * Is the TID being cleaned up after a transition @@ -336,6 +349,8 @@ struct ath_txq { #define ATH_TID_LOCK_ASSERT(_sc, _tid) \ ATH_TXQ_LOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac]) +#define ATH_TID_UNLOCK_ASSERT(_sc, _tid) \ + ATH_TXQ_UNLOCK_ASSERT((_sc)->sc_ac2q[(_tid)->ac]) #define ATH_TXQ_INSERT_HEAD(_tq, _elm, _field) do { \ TAILQ_INSERT_HEAD(&(_tq)->axq_q, (_elm), _field); \ From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 02:23:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 095CE106564A; Mon, 17 Sep 2012 02:23:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D071A8FC17; Mon, 17 Sep 2012 02:23:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2N30s029390; Mon, 17 Sep 2012 02:23:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2N3Bi029388; Mon, 17 Sep 2012 02:23:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170223.q8H2N3Bi029388@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:23: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: r240586 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:23:04 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:23:03 2012 New Revision: 240586 URL: http://svn.freebsd.org/changeset/base/240586 Log: Update generate-release.sh script: - Use svn for ports and doc trees - When installing a binary textproc/docproj package, switch pkg_add(1) to pkg(8) [1] Reviewed by: nwhitehorn Approved by: nwhitehorn Enhanced by: glebius [1] MFC After: 1 week X-MFC-To: 9-only Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Mon Sep 17 01:21:55 2012 (r240585) +++ head/release/generate-release.sh Mon Sep 17 02:23:03 2012 (r240586) @@ -23,16 +23,24 @@ usage() { - echo "Usage: $0 [-r revision] svn-branch scratch-dir" + echo "Usage: $0 [-r revision] [-d docrevision] [-p portsrevision] svn-branch scratch-dir" exit 1 } REVISION= -while getopts r: opt; do +DOCREVISION= +PORTSREVISION= +while getopts d:r:p: opt; do case $opt in + d) + DOCREVISION="-r $OPTARG" + ;; r) REVISION="-r $OPTARG" ;; + p) + PORTSREVISION="-r $OPTARG" + ;; \?) usage ;; @@ -57,22 +65,8 @@ esac mkdir -p $2/usr/src svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION -if [ ! -z $CVSUP_HOST ]; then - cat > $2/docports-supfile << EOF - *default host=$CVSUP_HOST - *default base=/var/db - *default prefix=/usr - *default release=cvs tag=${CVS_TAG:-.} - *default delete use-rel-suffix - *default compress - ports-all - doc-all -EOF -elif [ ! -z $CVSROOT ]; then - cd $2/usr - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} ports - cvs -R ${CVSARGS} -d ${CVSROOT} co -P -r ${CVS_TAG:-HEAD} doc -fi +svn co ${SVNROOT:-svn://svn.freebsd.org/doc}/head $2/usr/doc $DOCREVISION +svn co ${SVNROOT:-svn://svn.freebsd.org/ports}/head $2/usr/ports $PORTSREVISION cd $2/usr/src make $MAKE_FLAGS buildworld @@ -80,18 +74,11 @@ make installworld distribution DESTDIR=$ mount -t devfs devfs $2/dev trap "umount $2/dev" EXIT # Clean up devfs mount on exit -if [ ! -z $CVSUP_HOST ]; then - cp /etc/resolv.conf $2/etc/resolv.conf - - # Checkout ports and doc trees - chroot $2 /usr/bin/csup /docports-supfile -fi - if [ -d $2/usr/doc ]; then cp /etc/resolv.conf $2/etc/resolv.conf - # Build ports to build release documentation - chroot $2 /bin/sh -c 'pkg_add -r docproj || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' + # Install docproj to build release documentation + chroot $2 /bin/sh -c '(export ASSUME_ALWAYS_YES=1 && /usr/sbin/pkg install -y docproj) || (cd /usr/ports/textproc/docproj && make install clean BATCH=yes WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes)' fi chroot $2 make -C /usr/src $MAKE_FLAGS buildworld buildkernel From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 02:35:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 436F2106564A; Mon, 17 Sep 2012 02:35:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E62E8FC16; Mon, 17 Sep 2012 02:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2Z1JY030951; Mon, 17 Sep 2012 02:35:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2Z0XO030949; Mon, 17 Sep 2012 02:35:00 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170235.q8H2Z0XO030949@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:35: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: r240587 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:35:01 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:35:00 2012 New Revision: 240587 URL: http://svn.freebsd.org/changeset/base/240587 Log: Update usage() in comment section. Remove CVS_* variables in comments. MFC after: 1 week X-MFC-With: r240586 Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Mon Sep 17 02:23:03 2012 (r240586) +++ head/release/generate-release.sh Mon Sep 17 02:35:00 2012 (r240587) @@ -3,14 +3,10 @@ # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh [-r revision] svn-branch scratch-dir +# Usage: generate-release.sh [-r revision] [-d docrevision] \ +# [-p portsrevision] svn-branch scratch-dir # # Environment variables: -# CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation -# trees. This or CVSROOT must be set to include ports and documentation. -# CVSROOT: CVS root to obtain the ports and documentation trees. This or -# CVSUP_HOST must be set to include ports and documentation. -# CVS_TAG: CVS tag for ports and documentation (HEAD by default) # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 02:45:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A840106564A; Mon, 17 Sep 2012 02:45:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7458FC08; Mon, 17 Sep 2012 02:45:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2jrJQ032513; Mon, 17 Sep 2012 02:45:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2jrdK032511; Mon, 17 Sep 2012 02:45:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201209170245.q8H2jrdK032511@svn.freebsd.org> From: Glen Barber Date: Mon, 17 Sep 2012 02:45: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: r240588 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 02:45:53 -0000 Author: gjb (doc,ports committer) Date: Mon Sep 17 02:45:52 2012 New Revision: 240588 URL: http://svn.freebsd.org/changeset/base/240588 Log: Update release(7) to reflect changes from r240586 and r240587: - Remove cvs(1) references. - Remove CVS* environment references. - Add default entries for the default SVNROOT for the Ports Collection, and Documentation Project. - While here, update 'SGML-based documentation' to 'XML-based', since the recent SGML->XML conversion. - Update an example providing SVNROOT environment usage. Reminded by: nwhitehorn MFC After: 1 week X-MFC-With: r240586, r240587 Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Mon Sep 17 02:35:00 2012 (r240587) +++ head/share/man/man7/release.7 Mon Sep 17 02:45:52 2012 (r240588) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2012 +.Dd September 16, 2012 .Dt RELEASE 7 .Os .Sh NAME @@ -105,11 +105,7 @@ environment in It then checks out the src tree specified by .Ar svn-branch using -.Xr svn 1 -and (optionally) the ports and documentation trees using -.Xr csup 1 -or -.Xr cvs 1 . +.Xr svn 1 . Once the various source trees have been obtained, it executes .Dq Li "make release" within the @@ -122,33 +118,19 @@ release media. .Pp Environment variables: .Bl -tag -width ".Cm MAKE_FLAGS" -.It Ev CVSUP_HOST -The CVSUP server to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVSROOT -The location of the -.Fx -CVS repository to use for the doc and ports trees. One of -.Ev CVSUP_HOST -or -.Ev CVSROOT -must be specified for ports and documentation to be included in the release. -.It Ev CVS_TAG -If the variable -.Ev CVS_TAG -is set, that tag will be used for CVS checkouts (doc and ports), otherwise -.Ic generate-release.sh -will use HEAD. .It Ev MAKE_FLAGS This environment variable can be set to pass flags (e.g. -j) to .Xr make 1 when invoked by the script. .It Ev SVNROOT -The location of the FreeBSD SVN source repository. Defaults to -.Pa svn://svn.freebsd.org/base . +The location of the FreeBSD SVN source, doc, and ports repositories. +Defaults to +.Pa svn://svn.freebsd.org/base +for the source tree, +.Pa svn://svn.freebsd.org/ports/head +for the Ports Collection, and +.Pa svn://svn.freebsd.org/doc/head +for the Documentation Project source. .It Ev RELSTRING Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). Defaults to the output of @@ -246,7 +228,7 @@ If defined, the Ports Collection will be .It Va NOSRC If set, do not include system source code in the release. .It Va NODOC -If defined, the SGML-based documentation from the +If defined, the XML-based documentation from the .Fx Documentation Project will not be built. However, the @@ -317,7 +299,7 @@ The following sequence of commands can b in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release -export CVSUP_HOST=cvsupN.freebsd.org +export SVNROOT=svn://svn.freebsd.org/base sh generate-release.sh head /local3/release .Ed .Pp @@ -326,7 +308,6 @@ After running these commands, all prepar directory. .Sh SEE ALSO .Xr cc 1 , -.Xr cvs 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 Pq Pa ports/devel/subversion-freebsd , @@ -376,7 +357,7 @@ was overhauled and the wrapper script introduced to support the introduction of a new installer. .Pp At near 1000 revisions spread over multiple branches, the -.Xr cvs 1 +.Xr svn 1 log of .Pa src/release/Makefile contains a vivid historical record of some From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 02:49:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90106106564A; Mon, 17 Sep 2012 02:49:03 +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 7BA438FC08; Mon, 17 Sep 2012 02:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2n3iV032943; Mon, 17 Sep 2012 02:49:03 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2n3o8032941; Mon, 17 Sep 2012 02:49:03 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209170249.q8H2n3o8032941@svn.freebsd.org> From: Matt Jacob Date: Mon, 17 Sep 2012 02:49: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: r240589 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:49:03 -0000 Author: mjacob Date: Mon Sep 17 02:49:02 2012 New Revision: 240589 URL: http://svn.freebsd.org/changeset/base/240589 Log: Add some edits to the changed comments so that they make more sense. MFC after: 1 day Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:45:52 2012 (r240588) +++ head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:49:02 2012 (r240589) @@ -1735,10 +1735,10 @@ isp_target_start_ctio(ispsoftc_t *isp, u /* * Mode 1, status, no data. Only possible when we are sending status, have - * no data to transfer, and any sense length can fit in the ct7_entry. + * no data to transfer, and any sense data can fit in the ct7_entry. * - * Mode 2, status, no data. We have to use this in the case sense data - * won't fit into a ct7_entry_t. + * Mode 2, status, no data. We have to use this in the case that + * the sense data won't fit into a ct7_entry_t. * */ if (sendstatus && xfrlen == 0) { From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 02:50:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 131C31065672; Mon, 17 Sep 2012 02:50:17 +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 F37188FC16; Mon, 17 Sep 2012 02:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H2oGPd033209; Mon, 17 Sep 2012 02:50:16 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H2oGlb033206; Mon, 17 Sep 2012 02:50:16 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209170250.q8H2oGlb033206@svn.freebsd.org> From: Matt Jacob Date: Mon, 17 Sep 2012 02:50: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: r240590 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 02:50:17 -0000 Author: mjacob Date: Mon Sep 17 02:50:16 2012 New Revision: 240590 URL: http://svn.freebsd.org/changeset/base/240590 Log: Minor correction. MFC after: 1 day Modified: head/sys/dev/isp/isp_freebsd.c Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:49:02 2012 (r240589) +++ head/sys/dev/isp/isp_freebsd.c Mon Sep 17 02:50:16 2012 (r240590) @@ -1735,7 +1735,7 @@ isp_target_start_ctio(ispsoftc_t *isp, u /* * Mode 1, status, no data. Only possible when we are sending status, have - * no data to transfer, and any sense data can fit in the ct7_entry. + * no data to transfer, and any sense data can fit into a ct7_entry_t. * * Mode 2, status, no data. We have to use this in the case that * the sense data won't fit into a ct7_entry_t. From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 03:17:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54011106566B; Mon, 17 Sep 2012 03:17:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7B48FC14; Mon, 17 Sep 2012 03:17:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H3HhAN037195; Mon, 17 Sep 2012 03:17:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H3HhX0037193; Mon, 17 Sep 2012 03:17:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209170317.q8H3HhX0037193@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 03:17: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: r240592 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 03:17:43 -0000 Author: adrian Date: Mon Sep 17 03:17:42 2012 New Revision: 240592 URL: http://svn.freebsd.org/changeset/base/240592 Log: Take credit for the work I've done in this source file. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Sep 17 03:12:42 2012 (r240591) +++ head/sys/dev/ath/if_ath_tx.c Mon Sep 17 03:17:42 2012 (r240592) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2010-2012 Adrian Chadd, Xenion Pty Ltd * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 07:14:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17C88106564A; Mon, 17 Sep 2012 07:14:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECF178FC08; Mon, 17 Sep 2012 07:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H7E7Fd067508; Mon, 17 Sep 2012 07:14:07 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H7E7SQ067505; Mon, 17 Sep 2012 07:14:07 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209170714.q8H7E7SQ067505@svn.freebsd.org> From: Andrew Turner Date: Mon, 17 Sep 2012 07:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240594 - head/sys/boot/fdt/dts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 07:14:08 -0000 Author: andrew Date: Mon Sep 17 07:14:07 2012 New Revision: 240594 URL: http://svn.freebsd.org/changeset/base/240594 Log: Add the Tegra2 DTS files. Now our dtc supports including other files use this support to pull out the SoC specific parts of the dts file. Added: head/sys/boot/fdt/dts/tegra20-paz00.dts (contents, props changed) head/sys/boot/fdt/dts/tegra20.dtsi (contents, props changed) Added: head/sys/boot/fdt/dts/tegra20-paz00.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/tegra20-paz00.dts Mon Sep 17 07:14:07 2012 (r240594) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2012 Andrew Turner + * All rights reserved. + * + * Developed by Damjan Marion + * + * 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$ + */ +/dts-v1/; + +/include/ "tegra20.dtsi" + +/ { + model = "Toshiba AC100 / Dynabook AZ"; + + aliases { + serial0 = &serial0; + soc = &SOC; + }; + + memory { + device_type = "memory"; + reg = < 0x00000000 0x20000000 >; /* 512MB RAM at 0x0 */ + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; + + SOC: tegra20@0 { + serial0: serial@70006000 { + }; + }; +}; + Added: head/sys/boot/fdt/dts/tegra20.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/tegra20.dtsi Mon Sep 17 07:14:07 2012 (r240594) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2012 Andrew Turner + * All rights reserved. + * + * Developed by Damjan Marion + * + * 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$ + */ + +/ { + compatible = "compal,paz00", "nvidia,tegra20"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&GIC>; + + SOC: tegra20@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + GIC: interrupt-controller@50041000 { + compatible = "arm,gic"; + reg = < 0x50041000 0x1000 >, /* Distributor Registers */ + < 0x50040100 0x0100 >; /* CPU Interface Registers */ + interrupt-controller; + #interrupt-cells = <1>; + }; + + mp_tmr@50040200 { + compatible = "arm,mpcore-timers"; + clock-frequency = < 50040200 >; + #address-cells = <1>; + #size-cells = <0>; + reg = < 0x50040200 0x100 >, /* Global Timer Registers */ + < 0x50040600 0x100 >; /* Private Timer Registers */ + interrupts = < 27 29 >; + interrupt-parent = <&GIC>; + }; + + serial@70006000 { + compatible = "ns16550"; + reg = <0x70006000 0x40>; + reg-shift = <2>; + interrupts = < 68 >; + interrupt-parent = <&GIC>; + clock-frequency = < 215654400 >; + }; + }; +}; + From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 07:32:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 554F81065672; Mon, 17 Sep 2012 07:32:54 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F6858FC1E; Mon, 17 Sep 2012 07:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H7Ws4H070016; Mon, 17 Sep 2012 07:32:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H7Wsvr070014; Mon, 17 Sep 2012 07:32:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201209170732.q8H7Wsvr070014@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 17 Sep 2012 07:32: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: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 07:32:54 -0000 Author: trociny Date: Mon Sep 17 07:32:53 2012 New Revision: 240595 URL: http://svn.freebsd.org/changeset/base/240595 Log: In snmp_hostres, device_map table is used for consistent device table indexing. When a device has gone it is not removed from device_map table but just its entry_p field is set to NULL. So when traversing device_map in disk_OS_get_ATA_disks() and disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the bsnmpd crash is possible when a removed map entry is dereferenced. Before the fix, for disk_OS_get_ATA_disks() the crash could be easily reproduced running: atacontrol detach ata1 The crash was not observed in disk_OS_get_MD_disks() because currently snmp_hostres does no see md(4) disks: to get the device list it uses devinfo(3), which does not return md devices. Reported by: Miroslav Lachman 000.fbsd quip.cz MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 17 07:14:07 2012 (r240594) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon Sep 17 07:32:53 2012 (r240595) @@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void) /* Walk over the device table looking for ata disks */ STAILQ_FOREACH(map, &device_map, link) { + /* Skip deleted entries. */ + if (map->entry_p == NULL) + continue; for (found = lookup; found->media != DSM_UNKNOWN; found++) { if (strncmp(map->name_key, found->dev_name, strlen(found->dev_name)) != 0) @@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void) /* Look for md devices */ STAILQ_FOREACH(map, &device_map, link) { + /* Skip deleted entries. */ + if (map->entry_p == NULL) + continue; if (sscanf(map->name_key, "md%d", &unit) != 1) continue; From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 07:46:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34988106566C; Mon, 17 Sep 2012 07:46:45 +0000 (UTC) (envelope-from gber@freebsd.org) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id D1B408FC12; Mon, 17 Sep 2012 07:46:44 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 2D0FB119C09; Mon, 17 Sep 2012 09:46:38 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id PIz3S5hI7BtK; Mon, 17 Sep 2012 09:46:37 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id 76BEA119C00; Mon, 17 Sep 2012 09:46:37 +0200 (CEST) Message-ID: <5056F10C.9000602@freebsd.org> Date: Mon, 17 Sep 2012 11:44:44 +0200 From: Grzegorz Bernacki User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.24) Gecko/20120127 Thunderbird/3.1.16 MIME-Version: 1.0 To: Aleksandr Rybalko References: <201209140933.q8E9XZnd088621@svn.freebsd.org> <20120914171652.780e25c6.ray@freebsd.org> <50535E29.2030102@freebsd.org> <20120916022702.055cb08b.ray@freebsd.org> In-Reply-To: <20120916022702.055cb08b.ray@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240484 - head/sys/dev/fdt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 07:46:45 -0000 On 09/16/12 01:27, Aleksandr Rybalko wrote: > On Fri, 14 Sep 2012 18:41:13 +0200 > Grzegorz Bernacki wrote: > >> On 09/14/12 16:16, Aleksandr Rybalko wrote: >>> On Fri, 14 Sep 2012 09:33:35 +0000 (UTC) >>> Grzegorz Bernacki wrote: >>> >>>> Author: gber >>>> Date: Fri Sep 14 09:33:35 2012 >>>> New Revision: 240484 >>>> URL: http://svn.freebsd.org/changeset/base/240484 >>>> >>>> Log: >>>> Set busaddr and bussize to 0 when fdt_get_range() fails. >>> >>> Why bussize is 0? >> >> I though that setting it to 0 makes sense, since we do not use >> this variable in this function and setting it to some value could be >> confused. I could skip setting it, but I also thought it could cause >> confusion :). If you think that setting it to other value or remove >> it will be better please let me know and I will change it. >> >> thanks >> grzesiek > > Yeah, indeed, false alarm. Sorry for noise. > > But it will be very nice to hear developers opinion about ePAPR1.1 row > (about "range" property): > "If the property is not present in a bus node, it is assumed that no > mapping exists between children of the node and the parent address > space." > > Assuming since in most cases root node have no "ranges" property, but > his child "SOC" have that property with defaults (0x0 x 0xffffffff). > So nodes which have property "ranges" or not, must be processed same > way. Right? > > WBW Hi, I am not quite sure that I understand your question. What nodes are you referring to and what to you mean by processing them the same way? regards, grzesiek From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 08:03:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7CBF1106564A; Mon, 17 Sep 2012 08:03:07 +0000 (UTC) (envelope-from bawitabooks@gmail.com) Received: from mail-ob0-f186.google.com (mail-ob0-f186.google.com [209.85.214.186]) by mx1.freebsd.org (Postfix) with ESMTP id C68F18FC08; Mon, 17 Sep 2012 08:03:06 +0000 (UTC) Received: by obbta17 with SMTP id ta17so5002999obb.13 for ; Mon, 17 Sep 2012 01:03:06 -0700 (PDT) Received: by 10.236.201.134 with SMTP id b6mr1570298yho.15.1347868986296; Mon, 17 Sep 2012 01:03:06 -0700 (PDT) X-Google-Doc-Id: b02296497a1e81be X-Google-Web-Client: true Date: Mon, 17 Sep 2012 01:03:05 -0700 (PDT) From: John Rumbaugh To: bsdmailinglist@googlegroups.com Message-Id: <6190ae24-a88a-41f7-8998-aad48184985c@googlegroups.com> In-Reply-To: <201209170732.q8H7Wsvr070014@svn.freebsd.org> References: <201209170732.q8H7Wsvr070014@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_197_16140277.1347868985469" X-Google-IP: 75.171.18.210 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, trociny@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240595 - head/usr.sbin/bsnmpd/modules/snmp_hostres X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 08:03:07 -0000 ------=_Part_197_16140277.1347868985469 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit http://www.chumleaf.com On Monday, September 17, 2012 12:34:10 AM UTC-7, Mikolaj Golub wrote: > > Author: trociny > Date: Mon Sep 17 07:32:53 2012 > New Revision: 240595 > URL: http://svn.freebsd.org/changeset/base/240595 > > Log: > In snmp_hostres, device_map table is used for consistent device table > indexing. When a device has gone it is not removed from device_map > table but just its entry_p field is set to NULL. > > So when traversing device_map in disk_OS_get_ATA_disks() and > disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the > bsnmpd crash is possible when a removed map entry is dereferenced. > > Before the fix, for disk_OS_get_ATA_disks() the crash could be easily > reproduced running: > > atacontrol detach ata1 > > The crash was not observed in disk_OS_get_MD_disks() because currently > snmp_hostres does no see md(4) disks: to get the device list it uses > devinfo(3), which does not return md devices. > > Reported by: Miroslav Lachman 000.fbsd quip.cz > MFC after: 1 week > > Modified: > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c > > Modified: > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c > ============================================================================== > > --- > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon > Sep 17 07:14:07 2012 (r240594) > +++ > head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c Mon > Sep 17 07:32:53 2012 (r240595) > @@ -287,6 +287,9 @@ disk_OS_get_ATA_disks(void) > > /* Walk over the device table looking for ata disks */ > STAILQ_FOREACH(map, &device_map, link) { > + /* Skip deleted entries. */ > + if (map->entry_p == NULL) > + continue; > for (found = lookup; found->media != DSM_UNKNOWN; > found++) { > if (strncmp(map->name_key, found->dev_name, > strlen(found->dev_name)) != 0) > @@ -345,6 +348,9 @@ disk_OS_get_MD_disks(void) > > /* Look for md devices */ > STAILQ_FOREACH(map, &device_map, link) { > + /* Skip deleted entries. */ > + if (map->entry_p == NULL) > + continue; > if (sscanf(map->name_key, "md%d", &unit) != 1) > continue; > > _______________________________________________ > svn-s...@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all...@freebsd.org " > > ------=_Part_197_16140277.1347868985469-- From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 09:22:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D15781065670; Mon, 17 Sep 2012 09:22:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2F428FC14; Mon, 17 Sep 2012 09:22:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H9MxNa085623; Mon, 17 Sep 2012 09:22:59 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H9MxIw085621; Mon, 17 Sep 2012 09:22:59 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209170922.q8H9MxIw085621@svn.freebsd.org> From: Andrew Turner Date: Mon, 17 Sep 2012 09:22: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: r240596 - head/sys/arm/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, 17 Sep 2012 09:22:59 -0000 Author: andrew Date: Mon Sep 17 09:22:59 2012 New Revision: 240596 URL: http://svn.freebsd.org/changeset/base/240596 Log: Add a kernel config for the Toshiba AC100. The AC100 is an ARM laptop with an NVidia Tegra 2 CPU. Tegra 2 needs an external patch to pmap for atomic operations to work. Even with this the Kernel only gets to the mount root prompt. As such Tegra support is considered experimental, however adding the kernel config will help ensure the Tegra code builds. Added: head/sys/arm/conf/AC100 (contents, props changed) Added: head/sys/arm/conf/AC100 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/AC100 Mon Sep 17 09:22:59 2012 (r240596) @@ -0,0 +1,96 @@ +# +# Custom kernel for Toshiba AC100 +# +# $FreeBSD$ +# + +ident AC100 +include "../tegra/std.tegra2" + +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions WERROR="-Werror" + +#options SCHED_ULE #ULE scheduler +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options NFSCL #Network Filesystem Client +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=mge0 + +options GEOM_PART_GPT +options ROOTDEVNAME=\"ufs:/dev/da0p1\" + +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +#options SMP + +# Debugging +options VERBOSE_SYSINIT +#options ALT_BREAK_TO_DEBUGGER +options DDB +options GDB +options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options KDB +options KDB_TRACE +#options KTR +#options KTR_VERBOSE=0 +#options KTR_ENTRIES=16384 +#options KTR_MASK=(KTR_SPARE2) +#options KTR_COMPILE=KTR_ALL +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options WITNESS_KDB +options MUTEX_DEBUG + +# Pseudo devices +device random +device pty +device loop +device md + +# USB +#options USB_DEBUG # enable debug msgs +#device usb +#device ehci +#device umass +#device scbus +#device pass +#device da + +# SATA +#device ata +#device atadisk +#device mvs + +# Serial ports +device uart + +# I2C (TWSI) +#device iic +#device iicbus + +#Network +device ether + +#FDT +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=tegra20-paz00.dts + From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 09:32:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D1E106564A; Mon, 17 Sep 2012 09:32:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFC08FC0C; Mon, 17 Sep 2012 09:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8H9WBGn087076; Mon, 17 Sep 2012 09:32:11 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8H9WB45087074; Mon, 17 Sep 2012 09:32:11 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209170932.q8H9WB45087074@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Sep 2012 09:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240597 - head/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: Mon, 17 Sep 2012 09:32:12 -0000 Author: kevlo Date: Mon Sep 17 09:32:11 2012 New Revision: 240597 URL: http://svn.freebsd.org/changeset/base/240597 Log: Remove unused variable cd. This variable is initialized but not used. Modified: head/sys/dev/usb/net/uhso.c Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Mon Sep 17 09:22:59 2012 (r240596) +++ head/sys/dev/usb/net/uhso.c Mon Sep 17 09:32:11 2012 (r240597) @@ -540,7 +540,6 @@ 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; @@ -561,7 +560,6 @@ uhso_attach(device_t self) sc->sc_ttys = 0; sc->sc_radio = 1; - cd = usbd_get_config_descriptor(uaa->device); id = usbd_get_interface_descriptor(uaa->iface); sc->sc_ctrl_iface_no = id->bInterfaceNumber; From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 12:51:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1883C1065687; Mon, 17 Sep 2012 12:51: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 044098FC0A; Mon, 17 Sep 2012 12:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HCpmpO017783; Mon, 17 Sep 2012 12:51:48 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HCpmwT017781; Mon, 17 Sep 2012 12:51:48 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209171251.q8HCpmwT017781@svn.freebsd.org> From: Gavin Atkinson Date: Mon, 17 Sep 2012 12:51: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: r240602 - head/sys/dev/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: Mon, 17 Sep 2012 12:51:49 -0000 Author: gavin Date: Mon Sep 17 12:51:48 2012 New Revision: 240602 URL: http://svn.freebsd.org/changeset/base/240602 Log: - Add #defines for the bits within the iPCI Express PCIR_EXPRESS_LINK_CTL register - Add missing register PCIR_EXPRESS_ROOT_CAP - Correct a spelling mistake (SLAT -> SLOT) [1] Reviewed by: jhb [1] Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Mon Sep 17 11:39:28 2012 (r240601) +++ head/sys/dev/pci/pcireg.h Mon Sep 17 12:51:48 2012 (r240602) @@ -687,6 +687,19 @@ #define PCIM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 #define PCIM_LINK_CAP_PORT 0xff000000 #define PCIR_EXPRESS_LINK_CTL 0x10 +#define PCIM_EXP_LINK_CTL_ASPMC_DIS 0x0000 +#define PCIM_EXP_LINK_CTL_ASPMC_L0S 0x0001 +#define PCIM_EXP_LINK_CTL_ASPMC_L1 0x0002 +#define PCIM_EXP_LINK_CTL_ASPMC 0x0003 +#define PCIM_EXP_LINK_CTL_RCB 0x0008 +#define PCIM_EXP_LINK_CTL_LINK_DIS 0x0010 +#define PCIM_EXP_LINK_CTL_RETRAIN_LINK 0x0020 +#define PCIM_EXP_LINK_CTL_COMMON_CLOCK 0x0040 +#define PCIM_EXP_LINK_CTL_EXTENDED_SYNC 0x0080 +#define PCIM_EXP_LINK_CTL_ECPM 0x0100 +#define PCIM_EXP_LINK_CTL_HAWD 0x0200 +#define PCIM_EXP_LINK_CTL_LBMIE 0x0400 +#define PCIM_EXP_LINK_CTL_LABIE 0x0800 #define PCIR_EXPRESS_LINK_STA 0x12 #define PCIM_LINK_STA_SPEED 0x000f #define PCIM_LINK_STA_WIDTH 0x03f0 @@ -732,6 +745,7 @@ #define PCIM_EXP_SLOT_STA_EIS 0x0080 #define PCIM_EXP_SLOT_STA_DLLSC 0x0100 #define PCIR_EXPRESS_ROOT_CTL 0x1c +#define PCIR_EXPRESS_ROOT_CAP 0x1e #define PCIR_EXPRESS_ROOT_STA 0x20 #define PCIR_EXPRESS_DEVICE_CAP2 0x24 #define PCIR_EXPRESS_DEVICE_CTL2 0x28 @@ -753,7 +767,7 @@ #define PCIR_EXPRESS_LINK_CAP2 0x2c #define PCIR_EXPRESS_LINK_CTL2 0x30 #define PCIR_EXPRESS_LINK_STA2 0x32 -#define PCIR_EXPRESS_SLAT_CAP2 0x34 +#define PCIR_EXPRESS_SLOT_CAP2 0x34 #define PCIR_EXPRESS_SLOT_CTL2 0x38 #define PCIR_EXPRESS_SLOT_STA2 0x3a From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 13:36:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E71FC106564A; Mon, 17 Sep 2012 13:36:47 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14758FC0C; Mon, 17 Sep 2012 13:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HDalGM026656; Mon, 17 Sep 2012 13:36:47 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HDalx3026645; Mon, 17 Sep 2012 13:36:47 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201209171336.q8HDalx3026645@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Mon, 17 Sep 2012 13:36: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: r240605 - head/usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 13:36:48 -0000 Author: melifaro Date: Mon Sep 17 13:36:47 2012 New Revision: 240605 URL: http://svn.freebsd.org/changeset/base/240605 Log: Make systat(1) accept fractional number of seconds. Make old alarm(3)-based code use select(2). MFC after: 2 weeks Modified: head/usr.bin/systat/cmds.c head/usr.bin/systat/extern.h head/usr.bin/systat/icmp.c head/usr.bin/systat/icmp6.c head/usr.bin/systat/ip.c head/usr.bin/systat/ip6.c head/usr.bin/systat/keyboard.c head/usr.bin/systat/main.c head/usr.bin/systat/systat.1 head/usr.bin/systat/tcp.c Modified: head/usr.bin/systat/cmds.c ============================================================================== --- head/usr.bin/systat/cmds.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/cmds.c Mon Sep 17 13:36:47 2012 (r240605) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)cmds.c 8.2 (Berkeley) 4/29/95"; #endif +#include + #include #include #include @@ -49,10 +51,9 @@ command(const char *cmd) { struct cmdtab *p; char *cp, *tmpstr, *tmpstr1; - int interval, omask; + double t; tmpstr = tmpstr1 = strdup(cmd); - omask = sigblock(sigmask(SIGALRM)); for (cp = tmpstr1; *cp && !isspace(*cp); cp++) ; if (*cp) @@ -68,7 +69,7 @@ command(const char *cmd) goto done; } if (strcmp(tmpstr1, "stop") == 0) { - alarm(0); + delay = 0; mvaddstr(CMDLINE, 0, "Refresh disabled."); clrtoeol(); goto done; @@ -88,19 +89,23 @@ command(const char *cmd) clrtoeol(); goto done; } - interval = atoi(tmpstr1); - if (interval <= 0 && - (strcmp(tmpstr1, "start") == 0 || strcmp(tmpstr1, "interval") == 0)) { - interval = *cp ? atoi(cp) : naptime; - if (interval <= 0) { - error("%d: bad interval.", interval); - goto done; + t = strtod(tmpstr1, NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; + if ((t <= 0 || t > (double)UINT_MAX) && + (strcmp(tmpstr1, "start") == 0 || + strcmp(tmpstr1, "interval") == 0)) { + if (*cp != '\0') { + t = strtod(cp, NULL) * 1000000.0; + if (t <= 0 || t >= (double)UINT_MAX) { + error("%d: bad interval.", (int)t); + goto done; + } } } - if (interval > 0) { - alarm(0); - naptime = interval; - display(0); + if (t > 0) { + delay = (unsigned int)t; + display(); status(); goto done; } @@ -112,7 +117,6 @@ command(const char *cmd) if (p) { if (curcmd == p) goto done; - alarm(0); (*curcmd->c_close)(wnd); curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); @@ -133,14 +137,13 @@ command(const char *cmd) } curcmd = p; labels(); - display(0); + display(); status(); goto done; } if (curcmd->c_cmd == 0 || !(*curcmd->c_cmd)(tmpstr1, cp)) error("%s: Unknown command.", tmpstr1); done: - sigsetmask(omask); free(tmpstr); } @@ -177,7 +180,7 @@ status(void) { error("Showing %s, refresh every %d seconds.", - curcmd->c_name, naptime); + curcmd->c_name, delay / 1000000); } int Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/extern.h Mon Sep 17 13:36:47 2012 (r240605) @@ -49,11 +49,12 @@ extern int CMDLINE; extern int dk_ndrive; extern int hz, stathz; extern double hertz; /* sampling frequency for cp_time and dk_time */ -extern int naptime, col; +extern int col; extern int nhosts; extern int nports; extern int protos; extern int verbose; +extern unsigned int delay; struct inpcb; @@ -87,7 +88,7 @@ int cmdnetstat(const char *, const char struct cmdtab *lookup(const char *); void command(const char *); void die(int); -void display(int); +void display(void); int dkinit(void); int dkcmd(char *, char *); void error(const char *fmt, ...) __printflike(1, 2); Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/icmp.c Mon Sep 17 13:36:47 2012 (r240605) @@ -138,7 +138,7 @@ domode(struct icmpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/icmp6.c ============================================================================== --- head/usr.bin/systat/icmp6.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/icmp6.c Mon Sep 17 13:36:47 2012 (r240605) @@ -137,7 +137,7 @@ domode(struct icmp6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/ip.c Mon Sep 17 13:36:47 2012 (r240605) @@ -146,7 +146,7 @@ domode(struct stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/ip6.c ============================================================================== --- head/usr.bin/systat/ip6.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/ip6.c Mon Sep 17 13:36:47 2012 (r240605) @@ -142,7 +142,7 @@ domode(struct ip6stat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; Modified: head/usr.bin/systat/keyboard.c ============================================================================== --- head/usr.bin/systat/keyboard.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/keyboard.c Mon Sep 17 13:36:47 2012 (r240605) @@ -35,88 +35,146 @@ __FBSDID("$FreeBSD$"); static const char sccsid[] = "@(#)keyboard.c 8.1 (Berkeley) 6/6/93"; #endif +#include +#include + #include #include -#include #include #include +#include #include "systat.h" #include "extern.h" +static char line[80]; +static int keyboard_dispatch(int ch); + int keyboard(void) { - char line[80]; - int ch, oldmask; + int ch, n; + struct timeval last, intvl, now, tm; + fd_set rfds; + /* Set initial timings */ + gettimeofday(&last, NULL); + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; for (;;) { col = 0; move(CMDLINE, 0); - do { - refresh(); - ch = getch(); - if (ch == ERR) { - if (errno == EINTR) - continue; - exit(1); + for (;;) { + /* Determine interval to sleep */ + (void)gettimeofday(&now, NULL); + tm.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec; + tm.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec; + while (tm.tv_usec < 0) { + tm.tv_usec += 1000000; + tm.tv_sec--; + } + while (tm.tv_usec >= 1000000) { + tm.tv_usec -= 1000000; + tm.tv_sec++; + } + if (tm.tv_sec < 0) { + /* We have to update screen immediately */ + display(); + gettimeofday(&last, NULL); + continue; } - if (ch >= 'A' && ch <= 'Z') - ch += 'a' - 'A'; - if (col == 0) { -#define mask(s) (1 << ((s) - 1)) - if (ch == CTRL('l')) { - oldmask = sigblock(mask(SIGALRM)); - wrefresh(curscr); - sigsetmask(oldmask); - continue; - } - if (ch == CTRL('g')) { - oldmask = sigblock(mask(SIGALRM)); - status(); - sigsetmask(oldmask); + + /* Prepare select */ + FD_ZERO(&rfds); + FD_SET(STDIN_FILENO, &rfds); + n = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tm); + + if (n > 0) { + /* Read event on stdin */ + ch = getch(); + + if (keyboard_dispatch(ch) == 0) { + refresh(); continue; } - if (ch != ':') - continue; - move(CMDLINE, 0); - clrtoeol(); - } - if (ch == erasechar() && col > 0) { - if (col == 1 && line[0] == ':') - continue; - col--; - goto doerase; - } - if (ch == CTRL('w') && col > 0) { - while (--col >= 0 && isspace(line[col])) - ; - col++; - while (--col >= 0 && !isspace(line[col])) - if (col == 0 && line[0] == ':') - break; - col++; - goto doerase; - } - if (ch == killchar() && col > 0) { - col = 0; - if (line[0] == ':') - col++; - doerase: - move(CMDLINE, col); - clrtoeol(); - continue; - } - if (isprint(ch) || ch == ' ') { - line[col] = ch; - mvaddch(CMDLINE, col, ch); - col++; + + line[col] = '\0'; + command(line + 1); + /* Refresh delay */ + intvl.tv_sec = delay / 1000000; + intvl.tv_usec = delay % 1000000; + refresh(); + break; } - } while (col == 0 || (ch != '\r' && ch != '\n')); - line[col] = '\0'; - oldmask = sigblock(mask(SIGALRM)); - command(line + 1); - sigsetmask(oldmask); + + if (n < 0 && errno != EINTR) + exit(1); + + /* Timeout or signal. Call display another time */ + display(); + gettimeofday(&last, NULL); + } } - /*NOTREACHED*/ +} + +static int +keyboard_dispatch(int ch) +{ + + if (ch == ERR) { + if (errno == EINTR) + return 0; + exit(1); + } + if (ch >= 'A' && ch <= 'Z') + ch += 'a' - 'A'; + if (col == 0) { + if (ch == CTRL('l')) { + wrefresh(curscr); + return 0; + } + if (ch == CTRL('g')) { + status(); + return 0; + } + if (ch != ':') + return 0; + move(CMDLINE, 0); + clrtoeol(); + } + if (ch == erasechar() && col > 0) { + if (col == 1 && line[0] == ':') + return 0; + col--; + goto doerase; + } + if (ch == CTRL('w') && col > 0) { + while (--col >= 0 && isspace(line[col])) + ; + col++; + while (--col >= 0 && !isspace(line[col])) + if (col == 0 && line[0] == ':') + return 1; + col++; + goto doerase; + } + if (ch == killchar() && col > 0) { + col = 0; + if (line[0] == ':') + col++; +doerase: + move(CMDLINE, col); + clrtoeol(); + return 0; + } + if (isprint(ch) || ch == ' ') { + line[col] = ch; + mvaddch(CMDLINE, col, ch); + col++; + } + + if (col == 0 || (ch != '\r' && ch != '\n')) + return 0; + + return 1; } Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/main.c Mon Sep 17 13:36:47 2012 (r240605) @@ -64,7 +64,7 @@ kvm_t *kd; sig_t sigtstpdfl; double avenrun[3]; int col; -int naptime = 5; +unsigned int delay = 5000000; /* in microseconds */ int verbose = 1; /* to report kvm read errs */ struct clockinfo clkinfo; double hertz; @@ -82,6 +82,7 @@ main(int argc, char **argv) { char errbuf[_POSIX2_LINE_MAX], dummy; size_t size; + double t; (void) setlocale(LC_ALL, ""); @@ -97,9 +98,9 @@ main(int argc, char **argv) errx(1, "%s: unknown request", &argv[0][1]); curcmd = p; } else { - naptime = atoi(argv[0]); - if (naptime <= 0) - naptime = 5; + t = strtod(argv[0], NULL) * 1000000.0; + if (t > 0 && t < (double)UINT_MAX) + delay = (unsigned int)t; } argc--, argv++; } @@ -166,8 +167,7 @@ main(int argc, char **argv) dellave = 0.0; - signal(SIGALRM, display); - display(0); + display(); noecho(); crmode(); keyboard(); @@ -192,7 +192,7 @@ labels(void) } void -display(int signo __unused) +display() { int i, j; @@ -223,7 +223,6 @@ display(int signo __unused) wrefresh(wnd); move(CMDLINE, col); refresh(); - alarm(naptime); } void Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/systat.1 Mon Sep 17 13:36:47 2012 (r240605) @@ -28,7 +28,7 @@ .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd October 14, 2007 +.Dd September 17, 2012 .Dt SYSTAT 1 .Os .Sh NAME @@ -109,6 +109,7 @@ full detail below. The .Ar refresh-value specifies the screen refresh time interval in seconds. +Time interval can be fractional. .El .Pp Certain characters cause immediate action by Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Mon Sep 17 13:06:47 2012 (r240604) +++ head/usr.bin/systat/tcp.c Mon Sep 17 13:36:47 2012 (r240605) @@ -147,7 +147,7 @@ domode(struct tcpstat *ret) switch(currentmode) { case display_RATE: sub = &oldstat; - divisor = naptime; + divisor = (delay > 1000000) ? delay / 1000000 : 1; break; case display_DELTA: sub = &oldstat; From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 13:42:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8730106566B; Mon, 17 Sep 2012 13:42:45 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 62A198FC15; Mon, 17 Sep 2012 13:42:45 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=dhcp170-36-red.yandex.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1TDbeN-0006SD-GA; Mon, 17 Sep 2012 17:46:11 +0400 Message-ID: <505728D3.3000707@ipfw.ru> Date: Mon, 17 Sep 2012 17:42:43 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120627 Thunderbird/13.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201209171336.q8HDalx3026645@svn.freebsd.org> In-Reply-To: <201209171336.q8HDalx3026645@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r240605 - head/usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 13:42:45 -0000 On 17.09.2012 17:36, Alexander V. Chernikov wrote: > Author: melifaro > Date: Mon Sep 17 13:36:47 2012 > New Revision: 240605 > URL: http://svn.freebsd.org/changeset/base/240605 > > Log: > Make systat(1) accept fractional number of seconds. > Make old alarm(3)-based code use select(2). Ability to specify small intervals can be very handy while debugging traffic microbursts. Note that locale-aware strtod(3) is used to parse delay which is slightly different from ping. > > MFC after: 2 weeks From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 15:27:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 72376106566C; Mon, 17 Sep 2012 15:27:31 +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 5BB158FC0C; Mon, 17 Sep 2012 15:27:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HFRVPB043810; Mon, 17 Sep 2012 15:27:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HFRVjF043807; Mon, 17 Sep 2012 15:27:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209171527.q8HFRVjF043807@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Sep 2012 15:27: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: r240608 - head/sys/dev/mlx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 15:27:31 -0000 Author: jhb Date: Mon Sep 17 15:27:30 2012 New Revision: 240608 URL: http://svn.freebsd.org/changeset/base/240608 Log: Add locking to mlx(4) to make it MPSAFE along with some other fixes: - Use callout(9) rather than timeout(9). - Add a mutex as an I/O lock that protects the adapter and is used for the I/O path. - Add an sx lock as a configuration lock that protects the relationship of configured volumes. - Freeze the request queue when a DMA load is deferred with EINPROGRESS and unfreeze the queue when the DMA callback is invoked. - Explicitly poll the hardware while waiting to submit a command to allow completed commands to free up slots in the command ring. - Remove driver-wide 'initted' variable from mlx_*_fw_handshake() routines. That state should be per-controller instead. Add it as an argument since the first caller knows when it is the first caller. - Remove explicit bus_space tag/handle and use bus_*() rather than bus_space_*(). - Move duplicated PCI device ID probing into a mlx_pci_match() routine. - Don't check for PCIM_CMD_MEMEN (the PCI bus will enable that when allocating the resource) and use pci_enable_busmaster() rather than manipulating the register directly. Tested by: no one despite multiple requests (hope it works) Modified: head/sys/dev/mlx/mlx.c head/sys/dev/mlx/mlx_disk.c head/sys/dev/mlx/mlx_pci.c head/sys/dev/mlx/mlxreg.h head/sys/dev/mlx/mlxvar.h Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Mon Sep 17 14:54:58 2012 (r240607) +++ head/sys/dev/mlx/mlx.c Mon Sep 17 15:27:30 2012 (r240608) @@ -32,8 +32,11 @@ #include #include +#include #include +#include #include +#include #include #include @@ -53,7 +56,6 @@ static struct cdevsw mlx_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, .d_open = mlx_open, .d_close = mlx_close, .d_ioctl = mlx_ioctl, @@ -68,17 +70,17 @@ devclass_t mlx_devclass; static int mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v3_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v3_intaction(struct mlx_softc *sc, int action); -static int mlx_v3_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v3_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); static int mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v4_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v4_intaction(struct mlx_softc *sc, int action); -static int mlx_v4_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v4_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); static int mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc); static int mlx_v5_findcomplete(struct mlx_softc *sc, u_int8_t *slot, u_int16_t *status); static void mlx_v5_intaction(struct mlx_softc *sc, int action); -static int mlx_v5_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2); +static int mlx_v5_fw_handshake(struct mlx_softc *sc, int *error, int *param1, int *param2, int first); /* * Status monitoring @@ -130,8 +132,9 @@ static void mlx_setup_dmamap(struct ml bus_dma_segment_t *segs, int nsegments, int error); static void mlx_unmapcmd(struct mlx_command *mc); +static int mlx_shutdown_locked(struct mlx_softc *sc); static int mlx_start(struct mlx_command *mc); -static int mlx_done(struct mlx_softc *sc); +static int mlx_done(struct mlx_softc *sc, int startio); static void mlx_complete(struct mlx_softc *sc); /* @@ -164,14 +167,24 @@ mlx_free(struct mlx_softc *sc) debug_called(1); + /* destroy control device */ + if (sc->mlx_dev_t != NULL) + destroy_dev(sc->mlx_dev_t); + + if (sc->mlx_intr) + bus_teardown_intr(sc->mlx_dev, sc->mlx_irq, sc->mlx_intr); + /* cancel status timeout */ - untimeout(mlx_periodic, sc, sc->mlx_timeout); + MLX_IO_LOCK(sc); + callout_stop(&sc->mlx_timeout); /* throw away any command buffers */ while ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) { TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); mlx_freecmd(mc); } + MLX_IO_UNLOCK(sc); + callout_drain(&sc->mlx_timeout); /* destroy data-transfer DMA tag */ if (sc->mlx_buffer_dmat) @@ -184,8 +197,6 @@ mlx_free(struct mlx_softc *sc) bus_dma_tag_destroy(sc->mlx_sg_dmat); /* disconnect the interrupt handler */ - if (sc->mlx_intr) - bus_teardown_intr(sc->mlx_dev, sc->mlx_irq, sc->mlx_intr); if (sc->mlx_irq != NULL) bus_release_resource(sc->mlx_dev, SYS_RES_IRQ, 0, sc->mlx_irq); @@ -201,9 +212,8 @@ mlx_free(struct mlx_softc *sc) if (sc->mlx_enq2 != NULL) free(sc->mlx_enq2, M_DEVBUF); - /* destroy control device */ - if (sc->mlx_dev_t != (struct cdev *)NULL) - destroy_dev(sc->mlx_dev_t); + sx_destroy(&sc->mlx_config_lock); + mtx_destroy(&sc->mlx_io_lock); } /******************************************************************************** @@ -327,7 +337,9 @@ mlx_attach(struct mlx_softc *sc) } /* disable interrupts before we start talking to the controller */ + MLX_IO_LOCK(sc); sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); + MLX_IO_UNLOCK(sc); /* * Wait for the controller to come ready, handshake with the firmware if required. @@ -336,7 +348,8 @@ mlx_attach(struct mlx_softc *sc) */ hsmsg = 0; DELAY(1000); - while ((hscode = sc->mlx_fw_handshake(sc, &hserror, &hsparam1, &hsparam2)) != 0) { + while ((hscode = sc->mlx_fw_handshake(sc, &hserror, &hsparam1, &hsparam2, + hsmsg == 0)) != 0) { /* report first time around... */ if (hsmsg == 0) { device_printf(sc->mlx_dev, "controller initialisation in progress...\n"); @@ -364,7 +377,8 @@ mlx_attach(struct mlx_softc *sc) device_printf(sc->mlx_dev, "can't allocate interrupt\n"); return(ENXIO); } - error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | INTR_ENTROPY, NULL, mlx_intr, sc, &sc->mlx_intr); + error = bus_setup_intr(sc->mlx_dev, sc->mlx_irq, INTR_TYPE_BIO | + INTR_ENTROPY | INTR_MPSAFE, NULL, mlx_intr, sc, &sc->mlx_intr); if (error) { device_printf(sc->mlx_dev, "can't set up interrupt\n"); return(ENXIO); @@ -382,7 +396,7 @@ mlx_attach(struct mlx_softc *sc) BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ 0, /* flags */ busdma_lock_mutex, /* lockfunc */ - &Giant, /* lockarg */ + &sc->mlx_io_lock, /* lockarg */ &sc->mlx_buffer_dmat); if (error != 0) { device_printf(sc->mlx_dev, "can't allocate buffer DMA tag\n"); @@ -407,7 +421,9 @@ mlx_attach(struct mlx_softc *sc) /* * Obtain controller feature information */ + MLX_IO_LOCK(sc); if ((sc->mlx_enq2 = mlx_enquire(sc, MLX_CMD_ENQUIRY2, sizeof(struct mlx_enquiry2), NULL)) == NULL) { + MLX_IO_UNLOCK(sc); device_printf(sc->mlx_dev, "ENQUIRY2 failed\n"); return(ENXIO); } @@ -420,6 +436,7 @@ mlx_attach(struct mlx_softc *sc) case MLX_IFTYPE_2: /* These controllers don't report the firmware version in the ENQUIRY2 response */ if ((meo = mlx_enquire(sc, MLX_CMD_ENQUIRY_OLD, sizeof(struct mlx_enquiry_old), NULL)) == NULL) { + MLX_IO_UNLOCK(sc); device_printf(sc->mlx_dev, "ENQUIRY_OLD failed\n"); return(ENXIO); } @@ -453,8 +470,10 @@ mlx_attach(struct mlx_softc *sc) } break; default: + MLX_IO_UNLOCK(sc); return(ENXIO); /* should never happen */ } + MLX_IO_UNLOCK(sc); /* * Create the final scatter/gather mappings now that we have characterised the controller. @@ -481,7 +500,7 @@ mlx_attach(struct mlx_softc *sc) /* * Start the timeout routine. */ - sc->mlx_timeout = timeout(mlx_periodic, sc, hz); + callout_reset(&sc->mlx_timeout, hz, mlx_periodic, sc); /* print a little information about the controller */ mlx_describe_controller(sc); @@ -505,13 +524,16 @@ mlx_startup(struct mlx_softc *sc) * Scan all the system drives and attach children for those that * don't currently have them. */ + MLX_IO_LOCK(sc); mes = mlx_enquire(sc, MLX_CMD_ENQSYSDRIVE, sizeof(*mes) * MLX_MAXDRIVES, NULL); + MLX_IO_UNLOCK(sc); if (mes == NULL) { device_printf(sc->mlx_dev, "error fetching drive status\n"); return; } /* iterate over drives returned */ + MLX_CONFIG_LOCK(sc); for (i = 0, dr = &sc->mlx_sysdrive[0]; (i < MLX_MAXDRIVES) && (mes[i].sd_size != 0xffffffff); i++, dr++) { @@ -543,10 +565,13 @@ mlx_startup(struct mlx_softc *sc) device_printf(sc->mlx_dev, "bus_generic_attach returned %d", error); /* mark controller back up */ + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_SHUTDOWN; /* enable interrupts */ sc->mlx_intaction(sc, MLX_INTACTION_ENABLE); + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); } /******************************************************************************** @@ -557,12 +582,12 @@ mlx_detach(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); struct mlxd_softc *mlxd; - int i, s, error; + int i, error; debug_called(1); error = EBUSY; - s = splbio(); + MLX_CONFIG_LOCK(sc); if (sc->mlx_state & MLX_STATE_OPEN) goto out; @@ -577,12 +602,13 @@ mlx_detach(device_t dev) } if ((error = mlx_shutdown(dev))) goto out; + MLX_CONFIG_UNLOCK(sc); mlx_free(sc); - error = 0; + return (0); out: - splx(s); + MLX_CONFIG_UNLOCK(sc); return(error); } @@ -600,13 +626,24 @@ int mlx_shutdown(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); - int i, s, error; + int error; + + MLX_CONFIG_LOCK(sc); + error = mlx_shutdown_locked(sc); + MLX_CONFIG_UNLOCK(sc); + return (error); +} + +static int +mlx_shutdown_locked(struct mlx_softc *sc) +{ + int i, error; debug_called(1); - s = splbio(); - error = 0; + MLX_CONFIG_ASSERT_LOCKED(sc); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_SHUTDOWN; sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); @@ -617,19 +654,18 @@ mlx_shutdown(device_t dev) } else { printf("done\n"); } + MLX_IO_UNLOCK(sc); /* delete all our child devices */ for (i = 0; i < MLX_MAXDRIVES; i++) { if (sc->mlx_sysdrive[i].ms_disk != 0) { if ((error = device_delete_child(sc->mlx_dev, sc->mlx_sysdrive[i].ms_disk)) != 0) - goto out; + return (error); sc->mlx_sysdrive[i].ms_disk = 0; } } - out: - splx(s); - return(error); + return (0); } /******************************************************************************** @@ -639,11 +675,10 @@ int mlx_suspend(device_t dev) { struct mlx_softc *sc = device_get_softc(dev); - int s; debug_called(1); - s = splbio(); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_SUSPEND; /* flush controller */ @@ -651,7 +686,7 @@ mlx_suspend(device_t dev) printf("%s\n", mlx_flush(sc) ? "failed" : "done"); sc->mlx_intaction(sc, MLX_INTACTION_DISABLE); - splx(s); + MLX_IO_UNLOCK(sc); return(0); } @@ -666,8 +701,10 @@ mlx_resume(device_t dev) debug_called(1); + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_SUSPEND; sc->mlx_intaction(sc, MLX_INTACTION_ENABLE); + MLX_IO_UNLOCK(sc); return(0); } @@ -684,7 +721,9 @@ mlx_intr(void *arg) debug_called(1); /* collect finished commands, queue anything waiting */ - mlx_done(sc); + MLX_IO_LOCK(sc); + mlx_done(sc, 1); + MLX_IO_UNLOCK(sc); }; /******************************************************************************* @@ -694,14 +733,12 @@ mlx_intr(void *arg) int mlx_submit_buf(struct mlx_softc *sc, mlx_bio *bp) { - int s; debug_called(1); - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); MLX_BIO_QINSERT(sc->mlx_bioq, bp); sc->mlx_waitbufs++; - splx(s); mlx_startio(sc); return(0); } @@ -714,7 +751,11 @@ mlx_open(struct cdev *dev, int flags, in { struct mlx_softc *sc = dev->si_drv1; + MLX_CONFIG_LOCK(sc); + MLX_IO_LOCK(sc); sc->mlx_state |= MLX_STATE_OPEN; + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); return(0); } @@ -726,7 +767,11 @@ mlx_close(struct cdev *dev, int flags, i { struct mlx_softc *sc = dev->si_drv1; + MLX_CONFIG_LOCK(sc); + MLX_IO_LOCK(sc); sc->mlx_state &= ~MLX_STATE_OPEN; + MLX_IO_UNLOCK(sc); + MLX_CONFIG_UNLOCK(sc); return (0); } @@ -753,12 +798,14 @@ mlx_ioctl(struct cdev *dev, u_long cmd, */ case MLX_NEXT_CHILD: /* search system drives */ + MLX_CONFIG_LOCK(sc); for (i = 0; i < MLX_MAXDRIVES; i++) { /* is this one attached? */ if (sc->mlx_sysdrive[i].ms_disk != 0) { /* looking for the next one we come across? */ if (*arg == -1) { *arg = device_get_unit(sc->mlx_sysdrive[i].ms_disk); + MLX_CONFIG_UNLOCK(sc); return(0); } /* we want the one after this one */ @@ -766,13 +813,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, *arg = -1; } } + MLX_CONFIG_UNLOCK(sc); return(ENOENT); /* * Scan the controller to see whether new drives have appeared. */ case MLX_RESCAN_DRIVES: + mtx_lock(&Giant); mlx_startup(sc); + mtx_unlock(&Giant); return(0); /* @@ -780,10 +830,12 @@ mlx_ioctl(struct cdev *dev, u_long cmd, * away. */ case MLX_DETACH_DRIVE: /* detach one drive */ - + MLX_CONFIG_LOCK(sc); if (((dr = mlx_findunit(sc, *arg)) == NULL) || - ((mlxd = device_get_softc(dr->ms_disk)) == NULL)) + ((mlxd = device_get_softc(dr->ms_disk)) == NULL)) { + MLX_CONFIG_UNLOCK(sc); return(ENOENT); + } device_printf(dr->ms_disk, "detaching..."); error = 0; @@ -793,10 +845,13 @@ mlx_ioctl(struct cdev *dev, u_long cmd, } /* flush controller */ + MLX_IO_LOCK(sc); if (mlx_flush(sc)) { + MLX_IO_UNLOCK(sc); error = EBUSY; goto detach_out; } + MLX_IO_UNLOCK(sc); /* nuke drive */ if ((error = device_delete_child(sc->mlx_dev, dr->ms_disk)) != 0) @@ -804,6 +859,7 @@ mlx_ioctl(struct cdev *dev, u_long cmd, dr->ms_disk = 0; detach_out: + MLX_CONFIG_UNLOCK(sc); if (error) { printf("failed\n"); } else { @@ -823,28 +879,33 @@ mlx_ioctl(struct cdev *dev, u_long cmd, if (!(sc->mlx_feature & MLX_FEAT_PAUSEWORKS)) return(EOPNOTSUPP); + /* check time values */ mp = (struct mlx_pause *)addr; + if ((mp->mp_when < 0) || (mp->mp_when > 3600)) + return(EINVAL); + if ((mp->mp_howlong < 1) || (mp->mp_howlong > (0xf * 30))) + return(EINVAL); + + MLX_IO_LOCK(sc); if ((mp->mp_which == MLX_PAUSE_CANCEL) && (sc->mlx_pause.mp_when != 0)) { /* cancel a pending pause operation */ sc->mlx_pause.mp_which = 0; } else { /* fix for legal channels */ mp->mp_which &= ((1 << sc->mlx_enq2->me_actual_channels) -1); - /* check time values */ - if ((mp->mp_when < 0) || (mp->mp_when > 3600)) - return(EINVAL); - if ((mp->mp_howlong < 1) || (mp->mp_howlong > (0xf * 30))) - return(EINVAL); /* check for a pause currently running */ - if ((sc->mlx_pause.mp_which != 0) && (sc->mlx_pause.mp_when == 0)) + if ((sc->mlx_pause.mp_which != 0) && (sc->mlx_pause.mp_when == 0)) { + MLX_IO_UNLOCK(sc); return(EBUSY); + } /* looks ok, go with it */ sc->mlx_pause.mp_which = mp->mp_which; sc->mlx_pause.mp_when = time_second + mp->mp_when; sc->mlx_pause.mp_howlong = sc->mlx_pause.mp_when + mp->mp_howlong; } + MLX_IO_UNLOCK(sc); return(0); /* @@ -857,7 +918,9 @@ mlx_ioctl(struct cdev *dev, u_long cmd, * Start a rebuild on a given SCSI disk */ case MLX_REBUILDASYNC: + MLX_IO_LOCK(sc); if (sc->mlx_background != 0) { + MLX_IO_UNLOCK(sc); rb->rr_status = 0x0106; return(EBUSY); } @@ -887,13 +950,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, } if (error == 0) sc->mlx_background = MLX_BACKGROUND_REBUILD; + MLX_IO_UNLOCK(sc); return(error); /* * Get the status of the current rebuild or consistency check. */ case MLX_REBUILDSTAT: + MLX_IO_LOCK(sc); *rs = sc->mlx_rebuildstat; + MLX_IO_UNLOCK(sc); return(0); /* @@ -902,12 +968,16 @@ mlx_ioctl(struct cdev *dev, u_long cmd, */ case MLX_GET_SYSDRIVE: error = ENOENT; + MLX_CONFIG_LOCK(sc); + mtx_lock(&Giant); mlxd = (struct mlxd_softc *)devclass_get_softc(mlxd_devclass, *arg); + mtx_unlock(&Giant); if ((mlxd != NULL) && (mlxd->mlxd_drive >= sc->mlx_sysdrive) && (mlxd->mlxd_drive < (sc->mlx_sysdrive + MLX_MAXDRIVES))) { error = 0; *arg = mlxd->mlxd_drive - sc->mlx_sysdrive; } + MLX_CONFIG_UNLOCK(sc); return(error); default: @@ -930,14 +1000,18 @@ mlx_submit_ioctl(struct mlx_softc *sc, s * Return the current status of this drive. */ case MLXD_STATUS: + MLX_IO_LOCK(sc); *arg = drive->ms_state; + MLX_IO_UNLOCK(sc); return(0); /* * Start a background consistency check on this drive. */ case MLXD_CHECKASYNC: /* start a background consistency check */ + MLX_IO_LOCK(sc); if (sc->mlx_background != 0) { + MLX_IO_UNLOCK(sc); *arg = 0x0106; return(EBUSY); } @@ -964,6 +1038,7 @@ mlx_submit_ioctl(struct mlx_softc *sc, s } if (error == 0) sc->mlx_background = MLX_BACKGROUND_CHECK; + MLX_IO_UNLOCK(sc); *arg = result; return(error); @@ -987,6 +1062,7 @@ mlx_periodic(void *data) struct mlx_softc *sc = (struct mlx_softc *)data; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* * Run a bus pause? @@ -1045,10 +1121,10 @@ mlx_periodic(void *data) mlx_enquire(sc, MLX_CMD_REBUILDSTAT, sizeof(struct mlx_rebuild_stat), mlx_periodic_rebuild); /* deal with possibly-missed interrupts and timed-out commands */ - mlx_done(sc); + mlx_done(sc, 1); /* reschedule another poll next second or so */ - sc->mlx_timeout = timeout(mlx_periodic, sc, hz); + callout_reset(&sc->mlx_timeout, hz, mlx_periodic, sc); } /******************************************************************************** @@ -1060,6 +1136,7 @@ mlx_periodic_enquiry(struct mlx_command struct mlx_softc *sc = mc->mc_sc; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* Command completed OK? */ if (mc->mc_status != 0) { @@ -1124,7 +1201,7 @@ mlx_periodic_enquiry(struct mlx_command debug(1, "event log pointer was %d, now %d\n", sc->mlx_lastevent, sc->mlx_currevent); /* mark the event log as busy */ - atomic_set_int(&sc->mlx_flags, MLX_EVENTLOG_BUSY); + sc->mlx_flags |= MLX_EVENTLOG_BUSY; /* drain new eventlog entries */ mlx_periodic_eventlog_poll(sc); @@ -1205,6 +1282,7 @@ mlx_periodic_eventlog_poll(struct mlx_so int error = 0; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1263,6 +1341,7 @@ mlx_periodic_eventlog_respond(struct mlx char *reason; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); sc->mlx_lastevent++; /* next message... */ if (mc->mc_status == 0) { @@ -1321,7 +1400,7 @@ mlx_periodic_eventlog_respond(struct mlx mlx_periodic_eventlog_poll(sc); } else { /* clear log-busy status */ - atomic_clear_int(&sc->mlx_flags, MLX_EVENTLOG_BUSY); + sc->mlx_flags &= ~MLX_EVENTLOG_BUSY; } } @@ -1334,6 +1413,7 @@ mlx_periodic_rebuild(struct mlx_command struct mlx_softc *sc = mc->mc_sc; struct mlx_rebuild_status *mr = (struct mlx_rebuild_status *)mc->mc_data; + MLX_IO_ASSERT_LOCKED(sc); switch(mc->mc_status) { case 0: /* operation running, update stats */ sc->mlx_rebuildstat = *mr; @@ -1384,6 +1464,8 @@ mlx_pause_action(struct mlx_softc *sc) struct mlx_command *mc; int failsafe, i, command; + MLX_IO_ASSERT_LOCKED(sc); + /* What are we doing here? */ if (sc->mlx_pause.mp_when == 0) { command = MLX_CMD_STARTCHANNEL; @@ -1440,7 +1522,8 @@ mlx_pause_done(struct mlx_command *mc) struct mlx_softc *sc = mc->mc_sc; int command = mc->mc_mailbox[0]; int channel = mc->mc_mailbox[2] & 0xf; - + + MLX_IO_ASSERT_LOCKED(sc); if (mc->mc_status != 0) { device_printf(sc->mlx_dev, "%s command failed - %s\n", command == MLX_CMD_STOPCHANNEL ? "pause" : "resume", mlx_diagnose_command(mc)); @@ -1509,6 +1592,7 @@ mlx_enquire(struct mlx_softc *sc, int co int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1562,6 +1646,7 @@ mlx_flush(struct mlx_softc *sc) int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 1; @@ -1604,6 +1689,7 @@ mlx_check(struct mlx_softc *sc, int driv int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 0x10000; @@ -1647,6 +1733,7 @@ mlx_rebuild(struct mlx_softc *sc, int ch int error; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); /* get ourselves a command buffer */ error = 0x10000; @@ -1689,6 +1776,7 @@ mlx_wait_command(struct mlx_command *mc) int error, count; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); mc->mc_complete = NULL; mc->mc_private = mc; /* wake us when you're done */ @@ -1698,7 +1786,7 @@ mlx_wait_command(struct mlx_command *mc) count = 0; /* XXX better timeout? */ while ((mc->mc_status == MLX_STATUS_BUSY) && (count < 30)) { - tsleep(mc->mc_private, PRIBIO | PCATCH, "mlxwcmd", hz); + mtx_sleep(mc->mc_private, &sc->mlx_io_lock, PRIBIO | PCATCH, "mlxwcmd", hz); } if (mc->mc_status != 0) { @@ -1720,9 +1808,10 @@ static int mlx_poll_command(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int error, count, s; + int error, count; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); mc->mc_complete = NULL; mc->mc_private = NULL; /* we will poll for it */ @@ -1732,13 +1821,11 @@ mlx_poll_command(struct mlx_command *mc) count = 0; do { /* poll for completion */ - mlx_done(mc->mc_sc); + mlx_done(mc->mc_sc, 1); } while ((mc->mc_status == MLX_STATUS_BUSY) && (count++ < 15000000)); if (mc->mc_status != MLX_STATUS_BUSY) { - s = splbio(); TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); - splx(s); return(0); } device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); @@ -1809,30 +1896,27 @@ mlx_startio_cb(void *arg, bus_dma_segmen mc->mc_status = MLX_STATUS_WEDGED; mlx_completeio(mc); } + + sc->mlx_state &= ~MLX_STATE_QFROZEN; } /******************************************************************************** * Pull as much work off the softc's work queue as possible and give it to the * controller. Leave a couple of slots free for emergencies. - * - * Must be called at splbio or in an equivalent fashion that prevents - * reentry or activity on the bioq. */ static void mlx_startio(struct mlx_softc *sc) { struct mlx_command *mc; mlx_bio *bp; - int s; int error; - /* avoid reentrancy */ - if (mlx_lock_tas(sc, MLX_LOCK_STARTING)) - return; + MLX_IO_ASSERT_LOCKED(sc); /* spin until something prevents us from doing any work */ - s = splbio(); for (;;) { + if (sc->mlx_state & MLX_STATE_QFROZEN) + break; /* see if there's work to be done */ if ((bp = MLX_BIO_QFIRST(sc->mlx_bioq)) == NULL) @@ -1848,7 +1932,6 @@ mlx_startio(struct mlx_softc *sc) /* get the buf containing our work */ MLX_BIO_QREMOVE(sc->mlx_bioq, bp); sc->mlx_waitbufs--; - splx(s); /* connect the buf to the command */ mc->mc_complete = mlx_completeio; @@ -1859,14 +1942,11 @@ mlx_startio(struct mlx_softc *sc) /* map the command so the controller can work with it */ error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, mc->mc_length, mlx_startio_cb, mc, 0); - if (error == EINPROGRESS) { - break; + if (error == EINPROGRESS) { + sc->mlx_state |= MLX_STATE_QFROZEN; + break; } - - s = splbio(); } - splx(s); - mlx_lock_clr(sc, MLX_LOCK_STARTING); } /******************************************************************************** @@ -1878,7 +1958,8 @@ mlx_completeio(struct mlx_command *mc) struct mlx_softc *sc = mc->mc_sc; mlx_bio *bp = (mlx_bio *)mc->mc_private; struct mlxd_softc *mlxd = (struct mlxd_softc *)MLX_BIO_SOFTC(bp); - + + MLX_IO_ASSERT_LOCKED(sc); if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ MLX_BIO_SET_ERROR(bp, EIO); @@ -1969,8 +2050,11 @@ mlx_user_command(struct mlx_softc *sc, s error = ENOMEM; /* get ourselves a command and copy in from user space */ - if ((mc = mlx_alloccmd(sc)) == NULL) + MLX_IO_LOCK(sc); + if ((mc = mlx_alloccmd(sc)) == NULL) { + MLX_IO_UNLOCK(sc); return(error); + } bcopy(mu->mu_command, mc->mc_mailbox, sizeof(mc->mc_mailbox)); debug(0, "got command buffer"); @@ -1983,9 +2067,13 @@ mlx_user_command(struct mlx_softc *sc, s error = EINVAL; goto out; } + MLX_IO_UNLOCK(sc); if (((kbuf = malloc(mu->mu_datasize, M_DEVBUF, M_WAITOK)) == NULL) || - (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) + (error = copyin(mu->mu_buf, kbuf, mu->mu_datasize))) { + MLX_IO_LOCK(sc); goto out; + } + MLX_IO_LOCK(sc); debug(0, "got kernel buffer"); } @@ -2010,17 +2098,20 @@ mlx_user_command(struct mlx_softc *sc, s mc->mc_private = mu; error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, mc->mc_length, mlx_user_cb, mc, BUS_DMA_NOWAIT); + if (error) + goto out; /* copy out status and data */ mu->mu_status = mc->mc_status; - if ((mu->mu_datasize > 0) && - ((error = copyout(kbuf, mu->mu_buf, mu->mu_datasize)))) - goto out; - - error = 0; + if (mu->mu_datasize > 0) { + MLX_IO_UNLOCK(sc); + error = copyout(kbuf, mu->mu_buf, mu->mu_datasize); + MLX_IO_LOCK(sc); + } out: mlx_releasecmd(mc); + MLX_IO_UNLOCK(sc); if (kbuf != NULL) free(kbuf, M_DEVBUF); return(error); @@ -2042,10 +2133,12 @@ static int mlx_getslot(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int s, slot, limit; + int slot, limit; debug_called(1); + MLX_IO_ASSERT_LOCKED(sc); + /* * Enforce slot-usage limit, if we have the required information. */ @@ -2062,7 +2155,6 @@ mlx_getslot(struct mlx_command *mc) * * XXX linear search is slow */ - s = splbio(); for (slot = 0; slot < limit; slot++) { debug(2, "try slot %d", slot); if (sc->mlx_busycmd[slot] == NULL) @@ -2072,7 +2164,6 @@ mlx_getslot(struct mlx_command *mc) sc->mlx_busycmd[slot] = mc; sc->mlx_busycmds++; } - splx(s); /* out of slots? */ if (slot >= limit) @@ -2153,7 +2244,7 @@ static int mlx_start(struct mlx_command *mc) { struct mlx_softc *sc = mc->mc_sc; - int i, s, done; + int i; debug_called(1); @@ -2165,22 +2256,17 @@ mlx_start(struct mlx_command *mc) /* set a default 60-second timeout XXX tunable? XXX not currently used */ mc->mc_timeout = time_second + 60; - + /* spin waiting for the mailbox */ - for (i = 100000, done = 0; (i > 0) && !done; i--) { - s = splbio(); + for (i = 100000; i > 0; i--) { if (sc->mlx_tryqueue(sc, mc)) { - done = 1; /* move command to work queue */ TAILQ_INSERT_TAIL(&sc->mlx_work, mc, mc_link); - } - splx(s); /* drop spl to allow completion interrupts */ + return (0); + } else if (i > 1) + mlx_done(sc, 0); } - /* command is enqueued */ - if (done) - return(0); - /* * We couldn't get the controller to take the command. Revoke the slot * that the command was given and return it with a bad status. @@ -2200,19 +2286,19 @@ mlx_start(struct mlx_command *mc) * Returns nonzero if one or more commands were completed. */ static int -mlx_done(struct mlx_softc *sc) +mlx_done(struct mlx_softc *sc, int startio) { struct mlx_command *mc; - int s, result; + int result; u_int8_t slot; u_int16_t status; debug_called(2); + MLX_IO_ASSERT_LOCKED(sc); result = 0; /* loop collecting completed commands */ - s = splbio(); for (;;) { /* poll for a completed command's identifier and status */ if (sc->mlx_findcomplete(sc, &slot, &status)) { @@ -2235,10 +2321,9 @@ mlx_done(struct mlx_softc *sc) break; } } - splx(s); /* if we've completed any commands, try posting some more */ - if (result) + if (result && startio) mlx_startio(sc); /* handle completion and timeouts */ @@ -2254,15 +2339,9 @@ static void mlx_complete(struct mlx_softc *sc) { struct mlx_command *mc, *nc; - int s; debug_called(2); - - /* avoid reentrancy XXX might want to signal and request a restart */ - if (mlx_lock_tas(sc, MLX_LOCK_COMPLETING)) - return; - - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); /* scan the list of busy/done commands */ mc = TAILQ_FIRST(&sc->mlx_work); @@ -2299,9 +2378,6 @@ mlx_complete(struct mlx_softc *sc) } mc = nc; } - splx(s); - - mlx_lock_clr(sc, MLX_LOCK_COMPLETING); } /******************************************************************************** @@ -2329,14 +2405,12 @@ mlx_alloccmd(struct mlx_softc *sc) { struct mlx_command *mc; int error; - int s; debug_called(1); - s = splbio(); + MLX_IO_ASSERT_LOCKED(sc); if ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); - splx(s); /* allocate a new command buffer? */ if (mc == NULL) { @@ -2362,13 +2436,11 @@ mlx_alloccmd(struct mlx_softc *sc) static void mlx_releasecmd(struct mlx_command *mc) { - int s; debug_called(1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 15:43:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B273106564A; Mon, 17 Sep 2012 15:43:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34B128FC1B; Mon, 17 Sep 2012 15:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HFhwvJ045948; Mon, 17 Sep 2012 15:43:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HFhwY5045945; Mon, 17 Sep 2012 15:43:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209171543.q8HFhwY5045945@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Sep 2012 15:43: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: r240609 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:43:58 -0000 Author: hselasky Date: Mon Sep 17 15:43:57 2012 New Revision: 240609 URL: http://svn.freebsd.org/changeset/base/240609 Log: Implement support for USB Audio v2.0. Remove some redundant USB audio v1.0 debug data, hence userspace tools like lsusb exist to show this information properly. Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:27:30 2012 (r240608) +++ head/sys/dev/sound/usb/uaudio.c Mon Sep 17 15:43:57 2012 (r240609) @@ -115,13 +115,28 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { int32_t minval; int32_t maxval; @@ -162,11 +177,9 @@ struct uaudio_chan { struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +205,7 @@ struct uaudio_chan { uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,12 +256,21 @@ struct umidi_chan { uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; @@ -273,24 +296,28 @@ struct uaudio_softc { uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +330,7 @@ struct uaudio_format { const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +348,24 @@ static const struct uaudio_format uaudio {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -346,18 +391,8 @@ static usb_callback_t uaudio_mixer_write static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +413,56 @@ static uint16_t uaudio_mixer_determine_c struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,9 +479,6 @@ static int umidi_detach(device_t dev); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config @@ -614,10 +677,12 @@ uaudio_attach(device_t dev) id = usbd_get_interface_descriptor(uaa->iface); - uaudio_chan_fill_info(sc, uaa->device); - + /* must fill mixer info before channel info */ uaudio_mixer_fill_info(sc, uaa->device, id); + /* fill channel info */ + uaudio_chan_fill_info(sc, uaa->device); + DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -628,7 +693,7 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.valid) { device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); @@ -637,7 +702,7 @@ uaudio_attach(device_t dev) if (sc->sc_rec_chan.valid) { device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -857,28 +922,88 @@ uaudio_record_fix_fs(usb_endpoint_descri } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d rate=%u\n", + iface_no, clockid, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + (((rate - min) % res) == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1048,258 @@ uaudio_chan_fill_info_sub(struct uaudio_ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; + } + + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == AS_GENERAL) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; - } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (audio_if == 0 || asid.v1 == NULL || + asf1d.v1 == NULL || ed1 == NULL || + sed.v1 == NULL) { + /* need more descriptors */ + continue; + } + + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + + /* We ignore sync endpoint information until further. */ + + if (audio_rev >= UAUDIO_VERSION_30) { + goto next_ep; + } else if (audio_rev >= UAUDIO_VERSION_20) { + + uint32_t dwFormat; + uint8_t bSubslotSize; + + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + DPRINTF("Checking clock ID=%d\n", x); - /* We ignore sync endpoint information until further. */ + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; - if (asf1d->bSamFreqType == 0) { + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } - - audio_if = 0; - continue; + goto next_ep; found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; + } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; } - audio_if = 0; - continue; - - found_format: - - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); - - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; - - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; - - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); - - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); + + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; - } + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; + + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; + + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); + } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1390,7 +1602,7 @@ uaudio_chan_init(struct uaudio_softc *sc format = ch->p_fmt->freebsd_fmt; - switch (ch->p_asf1d->bNrChannels) { + switch (ch->channels) { case 2: /* stereo */ format = SND_FORMAT(format, 2, 0); @@ -1402,7 +1614,7 @@ uaudio_chan_init(struct uaudio_softc *sc default: /* surround and more */ format = feeder_matrix_default_format( - SND_FORMAT(format, ch->p_asf1d->bNrChannels, 0)); + SND_FORMAT(format, ch->channels, 0)); break; } @@ -1438,13 +1650,43 @@ uaudio_chan_init(struct uaudio_softc *sc * Only set the sample rate if the channel reports that it * supports the frequency control. */ - if (ch->p_sed->bmAttributes & UA_SED_FREQ_CONTROL) { + + if (sc->sc_audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (sc->sc_audio_rev >= UAUDIO_VERSION_20) { + unsigned int x; + + for (x = 0; x != 256; x++) { + if (dir == PCMDIR_PLAY) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + if (uaudio20_set_speed(sc->sc_udev, + sc->sc_mixer_iface_no, x, ch->sample_rate)) { + /* + * If the endpoint is adaptive setting + * the speed may fail. + */ + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); + } + } + } else if (ch->p_sed.v1->bmAttributes & UA_SED_FREQ_CONTROL) { if (uaudio_set_speed(sc->sc_udev, endpoint, ch->sample_rate)) { /* - * If the endpoint is adaptive setting the speed may - * fail. + * If the endpoint is adaptive setting the + * speed may fail. */ - DPRINTF("setting of sample rate failed! (continuing anyway)\n"); + DPRINTF("setting of sample rate failed! " + "(continuing anyway)\n"); } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, @@ -1679,13 +1921,10 @@ uaudio_mixer_add_ctl(struct uaudio_softc /* determine min and max values */ - mc->minval = uaudio_mixer_get(sc->sc_udev, GET_MIN, mc); - - mc->minval = uaudio_mixer_signext(mc->type, mc->minval); - - mc->maxval = uaudio_mixer_get(sc->sc_udev, GET_MAX, mc); - - mc->maxval = uaudio_mixer_signext(mc->type, mc->maxval); + mc->minval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MIN, mc); + mc->maxval = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_MAX, mc); /* check if max and min was swapped */ @@ -1701,7 +1940,8 @@ uaudio_mixer_add_ctl(struct uaudio_softc mc->mul = 1; /* compute value alignment */ - res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); + res = uaudio_mixer_get(sc->sc_udev, + sc->sc_audio_rev, GET_RES, mc); DPRINTF("Resolution = %d\n", (int)res); } @@ -1724,42 +1964,12 @@ uaudio_mixer_add_ctl(struct uaudio_softc } static void -uaudio_mixer_add_input(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_input_terminal *d = iot[id].u.it; - - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " - "iChannelNames=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bNrChannels, UGETW(d->wChannelConfig), - d->iChannelNames); -#endif -} - -static void -uaudio_mixer_add_output(struct uaudio_softc *sc, - const struct uaudio_terminal_node *iot, int id) -{ -#ifdef USB_DEBUG - const struct usb_audio_output_terminal *d = iot[id].u.ot; - - DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " - "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", - d->bTerminalId, UGETW(d->wTerminalType), d->bAssocTerminal, - d->bSourceId, d->iTerminal); -#endif -} - -static void uaudio_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { struct uaudio_mixer_node mix; - const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu_v1; const struct usb_audio_mixer_unit_1 *d1; uint32_t bno; /* bit number */ @@ -1780,8 +1990,8 @@ uaudio_mixer_add_mixer(struct uaudio_sof ichs = 0; for (i = 0; i < d0->bNrInPins; i++) { - ichs += (uaudio_mixer_get_cluster(d0->baSourceId[i], iot) - .bNrChannels); + ichs += uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; } d1 = (const void *)(d0->baSourceId + d0->bNrInPins); @@ -1798,23 +2008,22 @@ uaudio_mixer_add_mixer(struct uaudio_sof uaudio_mixer_determine_class(&iot[id], &mix); mix.type = MIX_SIGNED_16; - if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) { + if (uaudio_mixer_verify_desc(d0, ((ichs * ochs) + 7) / 8) == NULL) return; - } + for (p = i = 0; i < d0->bNrInPins; i++) { - chs = uaudio_mixer_get_cluster(d0->baSourceId[i], iot).bNrChannels; + chs = uaudio_mixer_get_cluster( + d0->baSourceId[i], iot).bNrChannels; mc = 0; for (c = 0; c < chs; c++) { mo = 0; for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mo++; - } } - if (mo == 1) { + if (mo == 1) mc++; - } } if ((mc == chs) && (chs <= MIX_MAX_CHAN)) { @@ -1824,62 +2033,183 @@ uaudio_mixer_add_mixer(struct uaudio_sof for (c = 0; c < chs; c++) { for (o = 0; o < ochs; o++) { bno = ((p + c) * ochs) + o; - if (BIT_TEST(d1->bmControls, bno)) { + if (BIT_TEST(d1->bmControls, bno)) mix.wValue[mc++] = MAKE_WORD(p + c + 1, o + 1); - } } } mix.nchan = chs; uaudio_mixer_add_ctl(sc, &mix); - } else { - /* XXX */ } p += chs; } } static void -uaudio_mixer_add_selector(struct uaudio_softc *sc, +uaudio20_mixer_add_mixer(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb_audio_selector_unit *d = iot[id].u.su; struct uaudio_mixer_node mix; - uint16_t i; - DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", - d->bUnitId, d->bNrInPins); + const struct usb_audio20_mixer_unit_0 *d0 = iot[id].u.mu_v2; + const struct usb_audio20_mixer_unit_1 *d1; - if (d->bNrInPins == 0) { - return; - } - memset(&mix, 0, sizeof(mix)); + uint32_t bno; /* bit number */ + uint32_t p; /* bit number accumulator */ + uint32_t mo; /* matching outputs */ + uint32_t mc; /* matching channels */ + uint32_t ichs; /* input channels */ + uint32_t ochs; /* output channels */ + uint32_t c; + uint32_t chs; /* channels */ + uint32_t i; + uint32_t o; - mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - mix.wValue[0] = MAKE_WORD(0, 0); - uaudio_mixer_determine_class(&iot[id], &mix); - mix.nchan = 1; - mix.type = MIX_SELECTOR; + DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", + d0->bUnitId, d0->bNrInPins); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 19:06:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBD0A1065674; Mon, 17 Sep 2012 19:06:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE0B68FC24; Mon, 17 Sep 2012 19:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJ6ZaQ070964; Mon, 17 Sep 2012 19:06:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJ6ZEC070957; Mon, 17 Sep 2012 19:06:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209171906.q8HJ6ZEC070957@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 17 Sep 2012 19:06: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: r240615 - in head: share/man/man4 sys/dev/usb/input sys/dev/usb/quirk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 19:06:36 -0000 Author: hselasky Date: Mon Sep 17 19:06:35 2012 New Revision: 240615 URL: http://svn.freebsd.org/changeset/base/240615 Log: Add UQ_UMS_IGNORE quirk. Wrap two long lines. Some minor spelling correction. PR: usb/171721 Modified: head/share/man/man4/usb_quirk.4 head/sys/dev/usb/input/ums.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Mon Sep 17 16:39:32 2012 (r240614) +++ head/share/man/man4/usb_quirk.4 Mon Sep 17 19:06:35 2012 (r240615) @@ -66,6 +66,8 @@ device should be ignored by hid class device should be ignored by kbd class .It UQ_KBD_BOOTPROTO device should set the boot protocol +.It UQ_UMS_IGNORE +device should be ignored by ums class .It UQ_MS_BAD_CLASS doesn't identify properly .It UQ_MS_LEADING_BYTE Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/input/ums.c Mon Sep 17 19:06:35 2012 (r240615) @@ -381,6 +381,9 @@ ums_probe(device_t dev) if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_UMS_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) return (BUS_PROBE_DEFAULT); Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Sep 17 19:06:35 2012 (r240615) @@ -494,6 +494,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", + [UQ_UMS_IGNORE] = "UQ_UMS_IGNORE", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Mon Sep 17 16:39:32 2012 (r240614) +++ head/sys/dev/usb/quirk/usb_quirk.h Mon Sep 17 19:06:35 2012 (r240615) @@ -29,7 +29,7 @@ enum { /* - * Keep in sync with theusb_quirk_str usb_quirk.c, and with the + * Keep in sync with usb_quirk_str in usb_quirk.c, and with * share/man/man4/usb_quirk.4 */ UQ_NONE, /* not a valid quirk */ @@ -49,6 +49,7 @@ enum { UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ + UQ_UMS_IGNORE, /* device should be ignored by ums class */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ @@ -64,7 +65,10 @@ enum { UQ_CFG_INDEX_0, /* select configuration index 0 by default */ UQ_ASSUME_CM_OVER_DATA, /* assume cm over data feature */ - /* USB Mass Storage Quirks. See "storage/umass.c" for a detailed description. */ + /* + * USB Mass Storage Quirks. See "storage/umass.c" for a + * detailed description. + */ UQ_MSC_NO_TEST_UNIT_READY, /* send start/stop instead of TUR */ UQ_MSC_NO_RS_CLEAR_UA, /* does not reset Unit Att. */ UQ_MSC_NO_START_STOP, /* does not support start/stop */ From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 19:23:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62521106564A; Mon, 17 Sep 2012 19:23:02 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1069D8FC08; Mon, 17 Sep 2012 19:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJN27D073084; Mon, 17 Sep 2012 19:23:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJN1IZ073080; Mon, 17 Sep 2012 19:23:01 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171923.q8HJN1IZ073080@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:23: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: r240616 - in head/sys/dev: nvd nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 19:23:02 -0000 Author: jimharris Date: Mon Sep 17 19:23:01 2012 New Revision: 240616 URL: http://svn.freebsd.org/changeset/base/240616 Log: This is the first of several commits which will add NVM Express (NVMe) support to FreeBSD. A full description of the overall functionality being added is below. nvmexpress.org defines NVM Express as "an optimized register interface, command set and feature set fo PCI Express (PCIe)-based Solid-State Drives (SSDs)." This commit adds nvme(4) and nvd(4) driver source code and Makefiles to the tree. Full NVMe functionality description: Add nvme(4) and nvd(4) drivers and nvmecontrol(8) for NVM Express (NVMe) device support. There will continue to be ongoing work on NVM Express support, but there is more than enough to allow for evaluation of pre-production NVM Express devices as well as soliciting feedback. Questions and feedback are welcome. nvme(4) implements NVMe hardware abstraction and is a provider of NVMe namespaces. The closest equivalent of an NVMe namespace is a SCSI LUN. nvd(4) is an NVMe consumer, surfacing NVMe namespaces as GEOM disks. nvmecontrol(8) is used for NVMe configuration and management. The following are currently supported: nvme(4) - full mandatory NVM command set support - per-CPU IO queues (enabled by default but configurable) - per-queue sysctls for statistics and full command/completion queue dumps for debugging - registration API for NVMe namespace consumers - I/O error handling (except for timeoutsee below) - compilation switches for support back to stable-7 nvd(4) - BIO_DELETE and BIO_FLUSH (if supported by controller) - proper BIO_ORDERED handling nvmecontrol(8) - devlist: list NVMe controllers and their namespaces - identify: display controller or namespace identify data in human-readable or hex format - perftest: quick and dirty performance test to measure raw performance of NVMe device without userspace/physio/GEOM overhead The following are still work in progress and will be completed over the next 3-6 months in rough priority order: - complete man pages - firmware download and activation - asynchronous error requests - command timeout error handling - controller resets - nvmecontrol(8) log page retrieval This has been primarily tested on amd64, with light testing on i386. I would be happy to provide assistance to anyone interested in porting this to other architectures, but am not currently planning to do this work myself. Big-endian and dmamap sync for command/completion queues are the main areas that would need to be addressed. The nvme(4) driver currently has references to Chatham, which is an Intel-developed prototype board which is not fully spec compliant. These references will all be removed over time. Sponsored by: Intel Contributions from: Joe Golio/EMC Added: head/sys/dev/nvd/ head/sys/dev/nvd/nvd.c (contents, props changed) head/sys/dev/nvme/ head/sys/dev/nvme/nvme.c (contents, props changed) head/sys/dev/nvme/nvme.h (contents, props changed) head/sys/dev/nvme/nvme_ctrlr.c (contents, props changed) head/sys/dev/nvme/nvme_ctrlr_cmd.c (contents, props changed) head/sys/dev/nvme/nvme_ns.c (contents, props changed) head/sys/dev/nvme/nvme_ns_cmd.c (contents, props changed) head/sys/dev/nvme/nvme_private.h (contents, props changed) head/sys/dev/nvme/nvme_qpair.c (contents, props changed) head/sys/dev/nvme/nvme_sysctl.c (contents, props changed) head/sys/dev/nvme/nvme_test.c (contents, props changed) head/sys/dev/nvme/nvme_uio.c (contents, props changed) Added: head/sys/dev/nvd/nvd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvd/nvd.c Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,318 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 + +struct nvd_disk; + +static disk_ioctl_t nvd_ioctl; +static disk_strategy_t nvd_strategy; + +static void create_geom_disk(void *, struct nvme_namespace *ns); +static void destroy_geom_disk(struct nvd_disk *ndisk); + +static int nvd_load(void); +static void nvd_unload(void); + +MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); + +struct nvme_consumer *consumer_handle; + +struct nvd_disk { + + struct bio_queue_head bioq; + struct task bioqtask; + struct mtx bioqlock; + + struct disk *disk; + struct taskqueue *tq; + struct nvme_namespace *ns; + + uint32_t cur_depth; + + TAILQ_ENTRY(nvd_disk) tailq; +}; + +TAILQ_HEAD(, nvd_disk) nvd_head; + +static int nvd_modevent(module_t mod, int type, void *arg) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + error = nvd_load(); + break; + case MOD_UNLOAD: + nvd_unload(); + break; + default: + break; + } + + return (error); +} + +moduledata_t nvd_mod = { + "nvd", + (modeventhand_t)nvd_modevent, + 0 +}; + +DECLARE_MODULE(nvd, nvd_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); +MODULE_VERSION(nvd, 1); +MODULE_DEPEND(nvd, nvme, 1, 1, 1); + +static int +nvd_load() +{ + + TAILQ_INIT(&nvd_head); + consumer_handle = nvme_register_consumer(create_geom_disk, NULL); + + return (consumer_handle != NULL ? 0 : -1); +} + +static void +nvd_unload() +{ + struct nvd_disk *nvd; + + while (!TAILQ_EMPTY(&nvd_head)) { + nvd = TAILQ_FIRST(&nvd_head); + TAILQ_REMOVE(&nvd_head, nvd, tailq); + destroy_geom_disk(nvd); + free(nvd, M_NVD); + } + + nvme_unregister_consumer(consumer_handle); +} + +static void +nvd_strategy(struct bio *bp) +{ + struct nvd_disk *ndisk; + + ndisk = (struct nvd_disk *)bp->bio_disk->d_drv1; + + mtx_lock(&ndisk->bioqlock); + bioq_insert_tail(&ndisk->bioq, bp); + mtx_unlock(&ndisk->bioqlock); + taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); +} + +static int +nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, + struct thread *td) +{ + int ret = 0; + + switch (cmd) { + default: + ret = EIO; + } + + return (ret); +} + +static void +nvd_done(void *arg, const struct nvme_completion *status) +{ + struct bio *bp; + struct nvd_disk *ndisk; + + bp = (struct bio *)arg; + + ndisk = bp->bio_disk->d_drv1; + + if (atomic_fetchadd_int(&ndisk->cur_depth, -1) == NVME_QD) + taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); + + /* + * TODO: add more extensive translation of NVMe status codes + * to different bio error codes (i.e. EIO, EINVAL, etc.) + */ + if (status->sf_sc || status->sf_sct) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + } else + bp->bio_resid = 0; + + biodone(bp); +} + +static void +nvd_bioq_process(void *arg, int pending) +{ + struct nvd_disk *ndisk = arg; + struct bio *bp; + int err; + + for (;;) { + if (atomic_load_acq_int(&ndisk->cur_depth) >= NVME_QD) + break; + + mtx_lock(&ndisk->bioqlock); + bp = bioq_takefirst(&ndisk->bioq); + mtx_unlock(&ndisk->bioqlock); + if (bp == NULL) + break; + +#ifdef BIO_ORDERED + /* + * BIO_ORDERED flag dictates that all outstanding bios + * must be completed before processing the bio with + * BIO_ORDERED flag set. + */ + if (bp->bio_flags & BIO_ORDERED) { + while (ndisk->cur_depth > 0) { + pause("nvd flush", 1); + } + } +#endif + + bp->bio_driver1 = NULL; + atomic_add_acq_int(&ndisk->cur_depth, 1); + + err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done); + + if (err) { + atomic_add_acq_int(&ndisk->cur_depth, -1); + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + } + +#ifdef BIO_ORDERED + /* + * BIO_ORDERED flag dictates that the bio with BIO_ORDERED + * flag set must be completed before proceeding with + * additional bios. + */ + if (bp->bio_flags & BIO_ORDERED) { + while (ndisk->cur_depth > 0) { + pause("nvd flush", 1); + } + } +#endif + } +} + +static void +create_geom_disk(void *arg, struct nvme_namespace *ns) +{ + struct nvd_disk *ndisk; + struct disk *disk; + + ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_NOWAIT); + + disk = disk_alloc(); + disk->d_strategy = nvd_strategy; + disk->d_ioctl = nvd_ioctl; + disk->d_name = "nvd"; + disk->d_drv1 = ndisk; + + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); + disk->d_sectorsize = nvme_ns_get_sector_size(ns); + disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + + if (TAILQ_EMPTY(&nvd_head)) + disk->d_unit = 0; + else + disk->d_unit = TAILQ_FIRST(&nvd_head)->disk->d_unit + 1; + + disk->d_flags = 0; + + if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) + disk->d_flags |= DISKFLAG_CANDELETE; + + if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) + disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + + strlcpy(disk->d_ident, nvme_ns_get_serial_number(ns), + sizeof(disk->d_ident)); + +#if __FreeBSD_version >= 900034 + strlcpy(disk->d_descr, nvme_ns_get_model_number(ns), + sizeof(disk->d_descr)); +#endif + + disk_create(disk, DISK_VERSION); + + ndisk->ns = ns; + ndisk->disk = disk; + ndisk->cur_depth = 0; + + mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); + bioq_init(&ndisk->bioq); + + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, + taskqueue_thread_enqueue, &ndisk->tq); + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); + + TAILQ_INSERT_HEAD(&nvd_head, ndisk, tailq); +} + +static void +destroy_geom_disk(struct nvd_disk *ndisk) +{ + struct bio *bp; + + taskqueue_free(ndisk->tq); + disk_destroy(ndisk->disk); + + mtx_lock(&ndisk->bioqlock); + for (;;) { + bp = bioq_takefirst(&ndisk->bioq); + if (bp == NULL) + break; + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + + biodone(bp); + } + mtx_unlock(&ndisk->bioqlock); + + mtx_destroy(&ndisk->bioqlock); +} Added: head/sys/dev/nvme/nvme.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvme/nvme.c Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,408 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 "nvme_private.h" + +struct nvme_consumer { + nvme_consumer_cb_fn_t cb_fn; + void *cb_arg; +}; + +struct nvme_consumer nvme_consumer[NVME_MAX_CONSUMERS]; + +MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) memory allocations"); + +static int nvme_probe(device_t); +static int nvme_attach(device_t); +static int nvme_detach(device_t); + +static devclass_t nvme_devclass; + +static device_method_t nvme_pci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, nvme_probe), + DEVMETHOD(device_attach, nvme_attach), + DEVMETHOD(device_detach, nvme_detach), + { 0, 0 } +}; + +static driver_t nvme_pci_driver = { + "nvme", + nvme_pci_methods, + sizeof(struct nvme_controller), +}; + +DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, 0, 0); +MODULE_VERSION(nvme, 1); + +static struct _pcsid +{ + u_int32_t type; + const char *desc; +} pci_ids[] = { + { 0x01118086, "NVMe Controller" }, + { CHATHAM_PCI_ID, "Chatham Prototype NVMe Controller" }, + { IDT_PCI_ID, "IDT NVMe Controller" }, + { 0x00000000, NULL } +}; + +static int +nvme_probe (device_t device) +{ + u_int32_t type = pci_get_devid(device); + struct _pcsid *ep = pci_ids; + + while (ep->type && ep->type != type) + ++ep; + + if (ep->desc) { + device_set_desc(device, ep->desc); + return (BUS_PROBE_DEFAULT); + } else + return (ENXIO); +} + +static void +nvme_load(void) +{ +} + +static void +nvme_unload(void) +{ +} + +static void +nvme_shutdown(void) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + union cc_register cc; + union csts_register csts; + int dev, devcount; + + if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) + return; + + for (dev = 0; dev < devcount; dev++) { + /* + * Only notify controller of shutdown when a real shutdown is + * in process, not when a module unload occurs. It seems at + * least some controllers (Chatham at least) don't let you + * re-enable the controller after shutdown notification has + * been received. + */ + ctrlr = DEVICE2SOFTC(devlist[dev]); + cc.raw = nvme_mmio_read_4(ctrlr, cc); + cc.bits.shn = NVME_SHN_NORMAL; + nvme_mmio_write_4(ctrlr, cc, cc.raw); + csts.raw = nvme_mmio_read_4(ctrlr, csts); + while (csts.bits.shst != NVME_SHST_COMPLETE) { + DELAY(5); + csts.raw = nvme_mmio_read_4(ctrlr, csts); + } + } + + free(devlist, M_TEMP); +} + +static int +nvme_modevent(module_t mod, int type, void *arg) +{ + + switch (type) { + case MOD_LOAD: + nvme_load(); + break; + case MOD_UNLOAD: + nvme_unload(); + break; + case MOD_SHUTDOWN: + nvme_shutdown(); + break; + default: + break; + } + + return (0); +} + +moduledata_t nvme_mod = { + "nvme", + (modeventhand_t)nvme_modevent, + 0 +}; + +DECLARE_MODULE(nvme, nvme_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); + +void +nvme_dump_command(struct nvme_command *cmd) +{ + printf("opc:%x f:%x r1:%x cid:%x nsid:%x r2:%x r3:%x " + "mptr:%qx prp1:%qx prp2:%qx cdw:%x %x %x %x %x %x\n", + cmd->opc, cmd->fuse, cmd->rsvd1, cmd->cid, cmd->nsid, + cmd->rsvd2, cmd->rsvd3, + (long long unsigned int)cmd->mptr, + (long long unsigned int)cmd->prp1, + (long long unsigned int)cmd->prp2, + cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, + cmd->cdw15); +} + +void +nvme_dump_completion(struct nvme_completion *cpl) +{ + printf("cdw0:%08x sqhd:%04x sqid:%04x " + "cid:%04x p:%x sc:%02x sct:%x m:%x dnr:%x\n", + cpl->cdw0, cpl->sqhd, cpl->sqid, + cpl->cid, cpl->p, cpl->sf_sc, cpl->sf_sct, cpl->sf_m, + cpl->sf_dnr); +} + +void +nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + struct nvme_tracker *tr; + struct nvme_qpair *qpair; + struct nvme_prp_list *prp_list; + uint32_t cur_nseg; + + KASSERT(error == 0, ("nvme_payload_map error != 0\n")); + + tr = (struct nvme_tracker *)arg; + qpair = tr->qpair; + + /* + * Note that we specified PAGE_SIZE for alignment and max + * segment size when creating the bus dma tags. So here + * we can safely just transfer each segment to its + * associated PRP entry. + */ + tr->cmd.prp1 = seg[0].ds_addr; + + if (nseg == 2) { + tr->cmd.prp2 = seg[1].ds_addr; + } else if (nseg > 2) { + KASSERT(tr->prp_list, + ("prp_list needed but not attached to tracker\n")); + cur_nseg = 1; + prp_list = tr->prp_list; + tr->cmd.prp2 = (uint64_t)prp_list->bus_addr; + while (cur_nseg < nseg) { + prp_list->prp[cur_nseg-1] = + (uint64_t)seg[cur_nseg].ds_addr; + cur_nseg++; + } + } + + nvme_qpair_submit_cmd(qpair, tr); +} + +struct nvme_tracker * +nvme_allocate_tracker(struct nvme_controller *ctrlr, boolean_t is_admin, + nvme_cb_fn_t cb_fn, void *cb_arg, uint32_t payload_size, void *payload) +{ + struct nvme_tracker *tr; + struct nvme_qpair *qpair; + uint32_t modulo, offset, num_prps; + boolean_t alloc_prp_list = FALSE; + + if (is_admin) { + qpair = &ctrlr->adminq; + } else { + if (ctrlr->per_cpu_io_queues) + qpair = &ctrlr->ioq[curcpu]; + else + qpair = &ctrlr->ioq[0]; + } + + num_prps = payload_size / PAGE_SIZE; + modulo = payload_size % PAGE_SIZE; + offset = (uint32_t)((uintptr_t)payload % PAGE_SIZE); + + if (modulo || offset) + num_prps += 1 + (modulo + offset - 1) / PAGE_SIZE; + + if (num_prps > 2) + alloc_prp_list = TRUE; + + tr = nvme_qpair_allocate_tracker(qpair, alloc_prp_list); + + memset(&tr->cmd, 0, sizeof(tr->cmd)); + + tr->qpair = qpair; + tr->cb_fn = cb_fn; + tr->cb_arg = cb_arg; + tr->payload_size = payload_size; + + return (tr); +} + +static int +nvme_attach(device_t dev) +{ + struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + int status; + + status = nvme_ctrlr_construct(ctrlr, dev); + + if (status != 0) + return (status); + + /* + * Reset controller twice to ensure we do a transition from cc.en==1 + * to cc.en==0. This is because we don't really know what status + * the controller was left in when boot handed off to OS. + */ + status = nvme_ctrlr_reset(ctrlr); + if (status != 0) + return (status); + + status = nvme_ctrlr_reset(ctrlr); + if (status != 0) + return (status); + + ctrlr->config_hook.ich_func = nvme_ctrlr_start; + ctrlr->config_hook.ich_arg = ctrlr; + + config_intrhook_establish(&ctrlr->config_hook); + + return (0); +} + +static int +nvme_detach (device_t dev) +{ + struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); + struct nvme_namespace *ns; + int i; + + if (ctrlr->taskqueue) { + taskqueue_drain(ctrlr->taskqueue, &ctrlr->task); + taskqueue_free(ctrlr->taskqueue); + } + + for (i = 0; i < NVME_MAX_NAMESPACES; i++) { + ns = &ctrlr->ns[i]; + if (ns->cdev) + destroy_dev(ns->cdev); + } + + if (ctrlr->cdev) + destroy_dev(ctrlr->cdev); + + for (i = 0; i < ctrlr->num_io_queues; i++) { + nvme_io_qpair_destroy(&ctrlr->ioq[i]); + } + + free(ctrlr->ioq, M_NVME); + + nvme_admin_qpair_destroy(&ctrlr->adminq); + + if (ctrlr->resource != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + ctrlr->resource_id, ctrlr->resource); + } + +#ifdef CHATHAM2 + if (ctrlr->chatham_resource != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + ctrlr->chatham_resource_id, ctrlr->chatham_resource); + } +#endif + + if (ctrlr->tag) + bus_teardown_intr(ctrlr->dev, ctrlr->res, ctrlr->tag); + + if (ctrlr->res) + bus_release_resource(ctrlr->dev, SYS_RES_IRQ, + rman_get_rid(ctrlr->res), ctrlr->res); + + if (ctrlr->msix_enabled) + pci_release_msi(dev); + + return (0); +} + +static void +nvme_notify_consumer(struct nvme_consumer *consumer) +{ + device_t *devlist; + struct nvme_controller *ctrlr; + int dev, ns, devcount; + + if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) + return; + + for (dev = 0; dev < devcount; dev++) { + ctrlr = DEVICE2SOFTC(devlist[dev]); + for (ns = 0; ns < ctrlr->cdata.nn; ns++) + (*consumer->cb_fn)(consumer->cb_arg, &ctrlr->ns[ns]); + } + + free(devlist, M_TEMP); +} + +struct nvme_consumer * +nvme_register_consumer(nvme_consumer_cb_fn_t cb_fn, void *cb_arg) +{ + int i; + + /* + * TODO: add locking around consumer registration. Not an issue + * right now since we only have one nvme consumer - nvd(4). + */ + for (i = 0; i < NVME_MAX_CONSUMERS; i++) + if (nvme_consumer[i].cb_fn == NULL) { + nvme_consumer[i].cb_fn = cb_fn; + nvme_consumer[i].cb_arg = cb_arg; + + nvme_notify_consumer(&nvme_consumer[i]); + return (&nvme_consumer[i]); + } + + printf("nvme(4): consumer not registered - no slots available\n"); + return (NULL); +} + +void +nvme_unregister_consumer(struct nvme_consumer *consumer) +{ + + consumer->cb_fn = NULL; + consumer->cb_arg = NULL; +} + Added: head/sys/dev/nvme/nvme.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/nvme/nvme.h Mon Sep 17 19:23:01 2012 (r240616) @@ -0,0 +1,738 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 __NVME_H__ +#define __NVME_H__ + +#ifdef _KERNEL +#include +#endif + +#define NVME_IDENTIFY_CONTROLLER _IOR('n', 0, struct nvme_controller_data) +#define NVME_IDENTIFY_NAMESPACE _IOR('n', 1, struct nvme_namespace_data) +#define NVME_IO_TEST _IOWR('n', 2, struct nvme_io_test) +#define NVME_BIO_TEST _IOWR('n', 4, struct nvme_io_test) + +/* + * Use to mark a command to apply to all namespaces, or to retrieve global + * log pages. + */ +#define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) + +union cap_lo_register { + uint32_t raw; + struct { + /** maximum queue entries supported */ + uint32_t mqes : 16; + + /** contiguous queues required */ + uint32_t cqr : 1; + + /** arbitration mechanism supported */ + uint32_t ams : 2; + + uint32_t reserved1 : 5; + + /** timeout */ + uint32_t to : 8; + } bits __packed; +} __packed; + +union cap_hi_register { + uint32_t raw; + struct { + /** doorbell stride */ + uint32_t dstrd : 4; + + uint32_t reserved3 : 1; + + /** command sets supported */ + uint32_t css_nvm : 1; + + uint32_t css_reserved : 3; + uint32_t reserved2 : 7; + + /** memory page size minimum */ + uint32_t mpsmin : 4; + + /** memory page size maximum */ + uint32_t mpsmax : 4; + + uint32_t reserved1 : 8; + } bits __packed; +} __packed; + +union cc_register { + uint32_t raw; + struct { + /** enable */ + uint32_t en : 1; + + uint32_t reserved1 : 3; + + /** i/o command set selected */ + uint32_t css : 3; + + /** memory page size */ + uint32_t mps : 4; + + /** arbitration mechanism selected */ + uint32_t ams : 3; + + /** shutdown notification */ + uint32_t shn : 2; + + /** i/o submission queue entry size */ + uint32_t iosqes : 4; + + /** i/o completion queue entry size */ + uint32_t iocqes : 4; + + uint32_t reserved2 : 8; + } bits __packed; +} __packed; + +enum shn_value { + NVME_SHN_NORMAL = 0x1, + NVME_SHN_ABRUPT = 0x2, +}; + +union csts_register { + uint32_t raw; + struct { + /** ready */ + uint32_t rdy : 1; + + /** controller fatal status */ + uint32_t cfs : 1; + + /** shutdown status */ + uint32_t shst : 2; + + uint32_t reserved1 : 28; + } bits __packed; +} __packed; + +enum shst_value { + NVME_SHST_NORMAL = 0x0, + NVME_SHST_OCCURRING = 0x1, + NVME_SHST_COMPLETE = 0x2, +}; + +union aqa_register { + uint32_t raw; + struct { + /** admin submission queue size */ + uint32_t asqs : 12; + + uint32_t reserved1 : 4; + + /** admin completion queue size */ + uint32_t acqs : 12; + + uint32_t reserved2 : 4; + } bits __packed; +} __packed; + +struct nvme_registers +{ + /** controller capabilities */ + union cap_lo_register cap_lo; + union cap_hi_register cap_hi; + + uint32_t vs; /* version */ + uint32_t intms; /* interrupt mask set */ + uint32_t intmc; /* interrupt mask clear */ + + /** controller configuration */ + union cc_register cc; + + uint32_t reserved1; + uint32_t csts; /* controller status */ + uint32_t reserved2; + + /** admin queue attributes */ + union aqa_register aqa; + + uint64_t asq; /* admin submission queue base addr */ + uint64_t acq; /* admin completion queue base addr */ + uint32_t reserved3[0x3f2]; + + struct { + uint32_t sq_tdbl; /* submission queue tail doorbell */ + uint32_t cq_hdbl; /* completion queue head doorbell */ + } doorbell[1] __packed; +} __packed; + +struct nvme_command +{ + /* dword 0 */ + uint16_t opc : 8; /* opcode */ + uint16_t fuse : 2; /* fused operation */ + uint16_t rsvd1 : 6; + uint16_t cid; /* command identifier */ + + /* dword 1 */ + uint32_t nsid; /* namespace identifier */ + + /* dword 2-3 */ + uint32_t rsvd2; + uint32_t rsvd3; + + /* dword 4-5 */ + uint64_t mptr; /* metadata pointer */ + + /* dword 6-7 */ + uint64_t prp1; /* prp entry 1 */ + + /* dword 8-9 */ + uint64_t prp2; /* prp entry 2 */ + + /* dword 10-15 */ + uint32_t cdw10; /* command-specific */ + uint32_t cdw11; /* command-specific */ + uint32_t cdw12; /* command-specific */ + uint32_t cdw13; /* command-specific */ + uint32_t cdw14; /* command-specific */ + uint32_t cdw15; /* command-specific */ +} __packed; + +struct nvme_completion { + + /* dword 0 */ + uint32_t cdw0; /* command-specific */ + + /* dword 1 */ + uint32_t rsvd1; + + /* dword 2 */ + uint16_t sqhd; /* submission queue head pointer */ + uint16_t sqid; /* submission queue identifier */ + + /* dword 3 */ + uint16_t cid; /* command identifier */ + uint16_t p : 1; /* phase tag */ + uint16_t sf_sc : 8; /* status field - status code */ + uint16_t sf_sct : 3; /* status field - status code type */ + uint16_t rsvd2 : 2; + uint16_t sf_m : 1; /* status field - more */ + uint16_t sf_dnr : 1; /* status field - do not retry */ +} __packed; + +struct nvme_dsm_range { + + uint32_t attributes; + uint32_t length; + uint64_t starting_lba; +} __packed; + +/* status code types */ +enum nvme_status_code_type { + NVME_SCT_GENERIC = 0x0, + NVME_SCT_COMMAND_SPECIFIC = 0x1, + NVME_SCT_MEDIA_ERROR = 0x2, + /* 0x3-0x6 - reserved */ + NVME_SCT_VENDOR_SPECIFIC = 0x7, +}; + +/* generic command status codes */ +enum nvme_generic_command_status_code { + NVME_SC_SUCCESS = 0x00, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 19:26:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7DBDD1065673; Mon, 17 Sep 2012 19:26:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6863A8FC12; Mon, 17 Sep 2012 19:26:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJQYAB073567; Mon, 17 Sep 2012 19:26:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJQYKV073561; Mon, 17 Sep 2012 19:26:34 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171926.q8HJQYKV073561@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240618 - in head/sys: amd64/conf conf i386/conf 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: Mon, 17 Sep 2012 19:26:34 -0000 Author: jimharris Date: Mon Sep 17 19:26:33 2012 New Revision: 240618 URL: http://svn.freebsd.org/changeset/base/240618 Log: Integrate nvme(4) and nvd(4) into the amd64 and i386 builds. Sponsored by: Intel Modified: head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/amd64/conf/NOTES Mon Sep 17 19:26:33 2012 (r240618) @@ -428,6 +428,11 @@ device isci options ISCI_LOGGING # enable debugging in isci HAL # +# NVM Express (NVMe) support +device nvme # base NVMe driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/conf/files.amd64 Mon Sep 17 19:26:33 2012 (r240618) @@ -212,7 +212,17 @@ dev/kbd/kbd.c optional atkbd | sc | uk dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci +dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci +dev/nvme/nvme.c optional nvme +dev/nvme/nvme_ctrlr.c optional nvme +dev/nvme/nvme_ctrlr_cmd.c optional nvme +dev/nvme/nvme_ns.c optional nvme +dev/nvme/nvme_ns_cmd.c optional nvme +dev/nvme/nvme_qpair.c optional nvme +dev/nvme/nvme_sysctl.c optional nvme +dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_uio.c optional nvme dev/nvram/nvram.c optional nvram isa dev/random/ivy.c optional random rdrand_rng dev/random/nehemiah.c optional random padlock_rng Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/conf/files.i386 Mon Sep 17 19:26:33 2012 (r240618) @@ -224,7 +224,17 @@ dev/lindev/lindev.c optional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci +dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci +dev/nvme/nvme.c optional nvme +dev/nvme/nvme_ctrlr.c optional nvme +dev/nvme/nvme_ctrlr_cmd.c optional nvme +dev/nvme/nvme_ns.c optional nvme +dev/nvme/nvme_ns_cmd.c optional nvme +dev/nvme/nvme_qpair.c optional nvme +dev/nvme/nvme_sysctl.c optional nvme +dev/nvme/nvme_test.c optional nvme +dev/nvme/nvme_uio.c optional nvme dev/nvram/nvram.c optional nvram isa dev/pcf/pcf_isa.c optional pcf dev/random/ivy.c optional random rdrand_rng Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/i386/conf/NOTES Mon Sep 17 19:26:33 2012 (r240618) @@ -747,6 +747,11 @@ device isci options ISCI_LOGGING # enable debugging in isci HAL # +# NVM Express (NVMe) support +device nvme # base NVMe driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# # SafeNet crypto driver: can be moved to the MI NOTES as soon as # it's tested on a big-endian machine # Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Sep 17 19:25:24 2012 (r240617) +++ head/sys/modules/Makefile Mon Sep 17 19:26:33 2012 (r240618) @@ -244,7 +244,9 @@ SUBDIR= \ ntfs \ ntfs_iconv \ nullfs \ + ${_nvd} \ ${_nve} \ + ${_nvme} \ ${_nvram} \ ${_nwfs} \ ${_nxge} \ @@ -586,9 +588,11 @@ _ixgb= ixgb _ixgbe= ixgbe _mly= mly _nfe= nfe +_nvd= nvd .if ${MK_SOURCELESS_HOST} != "no" _nve= nve .endif +_nvme= nvme _nvram= nvram _nxge= nxge _tpm= tpm @@ -695,9 +699,11 @@ _mthca= mthca .endif _ndis= ndis _nfe= nfe +_nvd= nvd .if ${MK_SOURCELESS_HOST} != "no" _nve= nve .endif +_nvme= nvme _nvram= nvram _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 19:58:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2089D106564A; Mon, 17 Sep 2012 19:58:03 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5298FC19; Mon, 17 Sep 2012 19:58:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HJw2g3077597; Mon, 17 Sep 2012 19:58:02 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HJw2pj077595; Mon, 17 Sep 2012 19:58:02 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209171958.q8HJw2pj077595@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 19:58: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: r240619 - in head/sys/modules: nvd nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 19:58:03 -0000 Author: jimharris Date: Mon Sep 17 19:58:02 2012 New Revision: 240619 URL: http://svn.freebsd.org/changeset/base/240619 Log: Add nvme(4) and nvd(4) Makefiles to the tree. Noticed by: pluknet Pointy-hat to: jimharris Added: head/sys/modules/nvd/ head/sys/modules/nvd/Makefile (contents, props changed) head/sys/modules/nvme/ head/sys/modules/nvme/Makefile (contents, props changed) Added: head/sys/modules/nvd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nvd/Makefile Mon Sep 17 19:58:02 2012 (r240619) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nvd + +KMOD= nvd +SRCS= nvd.c opt_geom.h device_if.h bus_if.h + +.include Added: head/sys/modules/nvme/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nvme/Makefile Mon Sep 17 19:58:02 2012 (r240619) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/nvme + +KMOD = nvme + +SRCS = nvme.c \ + nvme_ctrlr.c \ + nvme_ctrlr_cmd.c \ + nvme_ns.c \ + nvme_ns_cmd.c \ + nvme_qpair.c \ + nvme_sysctl.c \ + nvme_test.c \ + nvme_uio.c \ + \ + bus_if.h \ + device_if.h \ + pci_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 21:26:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37DF81065678; Mon, 17 Sep 2012 21:26:56 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EADD98FC21; Mon, 17 Sep 2012 21:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HLQtBv089412; Mon, 17 Sep 2012 21:26:55 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HLQtrp089409; Mon, 17 Sep 2012 21:26:55 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209172126.q8HLQtrp089409@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 21:26: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: r240620 - head/sbin/nvmecontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 21:26:56 -0000 Author: jimharris Date: Mon Sep 17 21:26:55 2012 New Revision: 240620 URL: http://svn.freebsd.org/changeset/base/240620 Log: Add nvmecontrol(8) source code and beginnings of a man page to the tree. Sponsored by: Intel Contributions from: Joe Golio/EMC Added: head/sbin/nvmecontrol/ head/sbin/nvmecontrol/Makefile (contents, props changed) head/sbin/nvmecontrol/nvmecontrol.8 (contents, props changed) head/sbin/nvmecontrol/nvmecontrol.c (contents, props changed) Added: head/sbin/nvmecontrol/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/Makefile Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= nvmecontrol +MAN= nvmecontrol.8 + +.include Added: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/nvmecontrol.8 Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,87 @@ +.\" +.\" Copyright (c) 2012 Intel Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" nvmecontrol man page. +.\" +.\" Author: Jim Harris +.\" +.\" $FreeBSD$ +.\" +.Dd September 17, 2012 +.Dt NVMECONTROL 8 +.Os +.Sh NAME +.Nm nvmecontrol +.Nd NVM Express control utility +.Sh SYNOPSIS +.Nm +.Ic devlist +.Nm +.Ic identify +.Op Fl v +.Op Fl x +.Aq device id +.Nm +.Ic perftest +.Aq Fl n Ar num_threads +.Aq Fl o Ar read|write +.Op Fl p +.Aq Fl s Ar size_in_bytes +.Aq Fl t Ar time_in_sec +.Aq device id +.Sh DESCRIPTION +NVM Express (NVMe) is a storage protocol standard, for SSDs and other +high-speed storage devices over PCI Express. +.Sh EXAMPLES +.Dl nvmecontrol devlist +.Pp +Display a list of NVMe controllers and namespaces along with their device nodes. +.Dl nvmecontrol identify nvme0 +.Pp +Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data. +.Pp +.Dl nvmecontrol identify -x -v nvme0ns1 +.Pp +Display a hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace +1. +.Pp +.Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 +.Pp +Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each +thread will issue a single 512 byte read command. Results are printed to +stdout when 30 seconds expires. +.Pp +.Sh AUTHORS +.An -nosplit +.Nm +was developed by Intel and originally written by +.An Jim Harris Aq jimharris@FreeBSD.org . +.Pp +This man page was written by +.An Jim Harris Aq jimharris@FreeBSD.org . Added: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/nvmecontrol.c Mon Sep 17 21:26:55 2012 (r240620) @@ -0,0 +1,600 @@ +/*- + * Copyright (C) 2012 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 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 +#include + +#define DEVLIST_USAGE \ +" nvmecontrol devlist\n" + +#define IDENTIFY_USAGE \ +" nvmecontrol identify \n" + +#define PERFTEST_USAGE \ +" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ +" <-s size_in_bytes> <-t time_in_seconds>\n" \ +" <-i intr|wait> [-f refthread] [-p]\n" \ +" \n" + +static void perftest_usage(void); + +static void +usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + fprintf(stderr, IDENTIFY_USAGE); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +static void +print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)cdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_controller(struct nvme_controller_data *cdata) +{ + printf("Controller Capabilities/Features\n"); + printf("================================\n"); + printf("Vendor ID: %04x\n", cdata->vid); + printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); + printf("Serial Number: %s\n", cdata->sn); + printf("Model Number: %s\n", cdata->mn); + printf("Firmware Version: %s\n", cdata->fr); + printf("Recommended Arb Burst: %d\n", cdata->rab); + printf("IEEE OUI Identifier: %02x %02x %02x\n", + cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); + printf("Multi-Interface Cap: %02x\n", cdata->mic); + /* TODO: Use CAP.MPSMIN to determine true memory page size. */ + printf("Max Data Transfer Size: "); + if (cdata->mdts == 0) + printf("Unlimited\n"); + else + printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); + printf("\n"); + + printf("Admin Command Set Attributes\n"); + printf("============================\n"); + printf("Security Send/Receive: %s\n", + cdata->oacs.security ? "Supported" : "Not Supported"); + printf("Format NVM: %s\n", + cdata->oacs.format ? "Supported" : "Not Supported"); + printf("Firmware Activate/Download: %s\n", + cdata->oacs.firmware ? "Supported" : "Not Supported"); + printf("Abort Command Limit: %d\n", cdata->acl+1); + printf("Async Event Request Limit: %d\n", cdata->aerl+1); + printf("Number of Firmware Slots: "); + if (cdata->oacs.firmware != 0) + printf("%d\n", cdata->frmw.num_slots); + else + printf("N/A\n"); + printf("Firmware Slot 1 Read-Only: "); + if (cdata->oacs.firmware != 0) + printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); + else + printf("N/A\n"); + printf("Per-Namespace SMART Log: %s\n", + cdata->lpa.ns_smart ? "Yes" : "No"); + printf("Error Log Page Entries: %d\n", cdata->elpe+1); + printf("Number of Power States: %d\n", cdata->npss+1); + printf("\n"); + + printf("NVM Command Set Attributes\n"); + printf("==========================\n"); + printf("Submission Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->sqes.max); + printf(" Min: %d\n", 1 << cdata->sqes.min); + printf("Completion Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->cqes.max); + printf(" Min: %d\n", 1 << cdata->cqes.min); + printf("Number of Namespaces: %d\n", cdata->nn); + printf("Compare Command: %s\n", + cdata->oncs.compare ? "Supported" : "Not Supported"); + printf("Write Uncorrectable Command: %s\n", + cdata->oncs.write_unc ? "Supported" : "Not Supported"); + printf("Dataset Management Command: %s\n", + cdata->oncs.dsm ? "Supported" : "Not Supported"); + printf("Volatile Write Cache: %s\n", + cdata->vwc.present ? "Present" : "Not Present"); +} + +static void +print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)nsdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_namespace(struct nvme_namespace_data *nsdata) +{ + uint32_t i; + + printf("Size (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nsze, + (long long)nsdata->nsze / 1024 / 1024); + printf("Capacity (in LBAs): %lld (%lldM)\n", + (long long)nsdata->ncap, + (long long)nsdata->ncap / 1024 / 1024); + printf("Utilization (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nuse, + (long long)nsdata->nuse / 1024 / 1024); + printf("Thin Provisioning: %s\n", + nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); + printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); + printf("Current LBA Format: LBA Format #%d\n", + nsdata->flbas.format); + for (i = 0; i <= nsdata->nlbaf; i++) { + printf("LBA Format #%d:\n", i); + printf(" LBA Data Size: %d\n", + 1 << nsdata->lbaf[i].lbads); + } +} + +static uint32_t +ns_get_sector_size(struct nvme_namespace_data *nsdata) +{ + + return (1 << nsdata->lbaf[0].lbads); +} + + +static void +devlist(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct nvme_namespace_data nsdata; + struct stat devstat; + char name[64], path[64]; + uint32_t i; + int ch, ctrlr, exit_code, fd, found; + + exit_code = EX_OK; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + usage(); + } + } + + ctrlr = -1; + found = 0; + + while (1) { + ctrlr++; + sprintf(name, "nvme%d", ctrlr); + sprintf(path, "/dev/%s", name); + + if (stat(path, &devstat) != 0) + break; + + found++; + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit_code = EX_NOPERM; + continue; + } + + if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit_code = EX_IOERR; + continue; + } + + printf("%6s: %s\n", name, cdata.mn); + + for (i = 0; i < cdata.nn; i++) { + sprintf(name, "nvme%dns%d", ctrlr, i+1); + sprintf(path, "/dev/%s", name); + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit_code = EX_NOPERM; + continue; + } + if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit_code = EX_IOERR; + continue; + } + printf(" %10s (%lldGB)\n", + name, + nsdata.nsze * + (long long)ns_get_sector_size(&nsdata) / + 1024 / 1024 / 1024); + } + } + + if (found == 0) + printf("No NVMe controllers found.\n"); + + exit(exit_code); +} + +static void +identify_ctrlr(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct stat devstat; + char path[64]; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + usage(); + } + } + + sprintf(path, "/dev/%s", argv[optind]); + + if (stat(path, &devstat) != 0) { + printf("Invalid device node '%s'.\n", path); + exit(EX_IOERR); + } + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit(EX_NOPERM); + } + + if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit(EX_IOERR); + } + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_controller_data); + else + hexlength = offsetof(struct nvme_controller_data, + reserved5); + print_controller_hex(&cdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + usage(); + } + + print_controller(&cdata); + exit(EX_OK); +} + +static void +identify_ns(int argc, char *argv[]) +{ + struct nvme_namespace_data nsdata; + struct stat devstat; + char path[64]; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + usage(); + } + } + + sprintf(path, "/dev/%s", argv[optind]); + + if (stat(path, &devstat) != 0) { + printf("Invalid device node '%s'.\n", path); + exit(EX_IOERR); + } + + fd = open(path, O_RDWR); + if (fd < 0) { + printf("Could not open %s.\n", path); + exit(EX_NOPERM); + } + + if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) { + printf("ioctl to %s failed.\n", path); + exit(EX_IOERR); + } + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_namespace_data); + else + hexlength = offsetof(struct nvme_namespace_data, + reserved6); + print_namespace_hex(&nsdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + usage(); + } + + print_namespace(&nsdata); + exit(EX_OK); +} + +static void +identify(int argc, char *argv[]) +{ + char *target; + + if (argc < 2) + usage(); + + while (getopt(argc, argv, "vx") != -1) ; + + target = argv[optind]; + + /* Specified device node must have "nvme" in it. */ + if (strstr(argv[optind], "nvme") == NULL) { + printf("Invalid device node '%s'.\n", argv[optind]); + exit(EX_IOERR); + } + + optreset = 1; + optind = 1; + + /* + * If devicde node contains "ns", we consider it a namespace, + * otherwise, consider it a controller. + */ + if (strstr(target, "ns") == NULL) + identify_ctrlr(argc, argv); + else + identify_ns(argc, argv); +} + +static void +print_perftest(struct nvme_io_test *io_test, bool perthread) +{ + uint32_t i, io_completed = 0, iops, mbps; + + for (i = 0; i < io_test->num_threads; i++) + io_completed += io_test->io_completed[i]; + + iops = io_completed/io_test->time; + mbps = iops * io_test->size / (1024*1024); + + printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", + io_test->num_threads, io_test->size, + io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", + io_test->time, iops, mbps); + + if (perthread) + for (i = 0; i < io_test->num_threads; i++) + printf("\t%3d: %8d IO/s\n", i, + io_test->io_completed[i]/io_test->time); + + exit(1); +} + +static void +perftest_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +static void +perftest(int argc, char *argv[]) +{ + struct nvme_io_test io_test; + int fd; + char ch; + char *p; + const char *name; + char path[64]; + u_long ioctl_cmd = NVME_IO_TEST; + bool nflag, oflag, sflag, tflag; + int err, perthread = 0; + + nflag = oflag = sflag = tflag = false; + name = NULL; + + memset(&io_test, 0, sizeof(io_test)); + + while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { + switch (ch) { + case 'f': + if (!strcmp(optarg, "refthread")) + io_test.flags |= NVME_TEST_FLAG_REFTHREAD; + break; + case 'i': + if (!strcmp(optarg, "bio") || + !strcmp(optarg, "wait")) + ioctl_cmd = NVME_BIO_TEST; + else if (!strcmp(optarg, "io") || + !strcmp(optarg, "intr")) + ioctl_cmd = NVME_IO_TEST; + break; + case 'n': + nflag = true; + io_test.num_threads = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } else if (io_test.num_threads == 0 || + io_test.num_threads > 128) { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } + break; + case 'o': + oflag = true; + if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) + io_test.opc = NVME_OPC_READ; + else if (!strcmp(optarg, "write") || + !strcmp(optarg, "WRITE")) + io_test.opc = NVME_OPC_WRITE; + else { + fprintf(stderr, "\"%s\" not valid opcode.\n", + optarg); + perftest_usage(); + } + break; + case 'p': + perthread = 1; + break; + case 's': + sflag = true; + io_test.size = strtoul(optarg, &p, 0); + if (p == NULL || *p == '\0' || toupper(*p) == 'B') { + // do nothing + } else if (toupper(*p) == 'K') { + io_test.size *= 1024; + } else if (toupper(*p) == 'M') { + io_test.size *= 1024 * 1024; + } else { + fprintf(stderr, "\"%s\" not valid size.\n", + optarg); + perftest_usage(); + } + break; + case 't': + tflag = true; + io_test.time = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid time duration.\n", + optarg); + perftest_usage(); + } + break; + } + } + + name = argv[optind]; + + if (!nflag || !oflag || !sflag || !tflag || name == NULL) + perftest_usage(); + + sprintf(path, "/dev/%s", name); + + fd = open(path, O_RDWR); + if (fd < 0) { + fprintf(stderr, "%s not valid device.\n", path); + perftest_usage(); + } + + err = ioctl(fd, ioctl_cmd, &io_test); + + if (err) { + fprintf(stderr, "NVME_IO_TEST returned %d\n", errno); + exit(EX_IOERR); + } + + print_perftest(&io_test, perthread); + exit(EX_OK); +} + +int +main(int argc, char *argv[]) +{ + + if (argc < 2) + usage(); + + if (strcmp(argv[1], "devlist") == 0) + devlist(argc-1, &argv[1]); + else if (strcmp(argv[1], "identify") == 0) + identify(argc-1, &argv[1]); + else if (strcmp(argv[1], "perftest") == 0) + perftest(argc-1, &argv[1]); + + usage(); + + return (0); +} From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 21:41:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E28D106564A; Mon, 17 Sep 2012 21:41:39 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDA68FC15; Mon, 17 Sep 2012 21:41:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HLfc2o091252; Mon, 17 Sep 2012 21:41:38 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HLfc3R091247; Mon, 17 Sep 2012 21:41:38 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209172141.q8HLfc3R091247@svn.freebsd.org> From: Jim Harris Date: Mon, 17 Sep 2012 21:41: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: r240621 - in head: etc/mtree include sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 21:41:39 -0000 Author: jimharris Date: Mon Sep 17 21:41:38 2012 New Revision: 240621 URL: http://svn.freebsd.org/changeset/base/240621 Log: Integrate nvmecontrol(8) into the amd64 and i386 builds. This includes adding NVMe header files to /usr/include/dev/nvme. Sponsored by: Intel Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/sbin/Makefile.amd64 head/sbin/Makefile.i386 Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Mon Sep 17 21:26:55 2012 (r240620) +++ head/etc/mtree/BSD.include.dist Mon Sep 17 21:41:38 2012 (r240621) @@ -126,6 +126,8 @@ .. nand .. + nvme + .. ofw .. pbio Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Mon Sep 17 21:26:55 2012 (r240620) +++ head/include/Makefile Mon Sep 17 21:41:38 2012 (r240621) @@ -40,8 +40,8 @@ LDIRS= bsm cam geom net net80211 netatal LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ - dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ + dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ + dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ Modified: head/sbin/Makefile.amd64 ============================================================================== --- head/sbin/Makefile.amd64 Mon Sep 17 21:26:55 2012 (r240620) +++ head/sbin/Makefile.amd64 Mon Sep 17 21:41:38 2012 (r240621) @@ -2,3 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += nvmecontrol Modified: head/sbin/Makefile.i386 ============================================================================== --- head/sbin/Makefile.i386 Mon Sep 17 21:26:55 2012 (r240620) +++ head/sbin/Makefile.i386 Mon Sep 17 21:41:38 2012 (r240621) @@ -2,4 +2,5 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += nvmecontrol SUBDIR += sconfig From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 23:04:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 21E121065670; Mon, 17 Sep 2012 23:04:16 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7BE98FC16; Mon, 17 Sep 2012 23:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HN4F5j001852; Mon, 17 Sep 2012 23:04:15 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HN4FwU001850; Mon, 17 Sep 2012 23:04:15 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209172304.q8HN4FwU001850@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 17 Sep 2012 23:04: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: r240622 - head/usr.bin/yes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Sep 2012 23:04:16 -0000 Author: obrien Date: Mon Sep 17 23:04:15 2012 New Revision: 240622 URL: http://svn.freebsd.org/changeset/base/240622 Log: yes(1) actually comes from V7. Submitted by: Simon Gerraty Modified: head/usr.bin/yes/yes.1 Modified: head/usr.bin/yes/yes.1 ============================================================================== --- head/usr.bin/yes/yes.1 Mon Sep 17 21:41:38 2012 (r240621) +++ head/usr.bin/yes/yes.1 Mon Sep 17 23:04:15 2012 (r240622) @@ -49,4 +49,4 @@ forever. The .Nm command appeared in -.At 32v . +.At v7 . From owner-svn-src-head@FreeBSD.ORG Mon Sep 17 23:24:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7224106564A; Mon, 17 Sep 2012 23:24:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B21018FC17; Mon, 17 Sep 2012 23:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8HNOjUa005105; Mon, 17 Sep 2012 23:24:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8HNOjCr005101; Mon, 17 Sep 2012 23:24:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209172324.q8HNOjCr005101@svn.freebsd.org> From: Adrian Chadd Date: Mon, 17 Sep 2012 23:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240623 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 23:24:46 -0000 Author: adrian Date: Mon Sep 17 23:24:45 2012 New Revision: 240623 URL: http://svn.freebsd.org/changeset/base/240623 Log: Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with internal atheros HAL code. Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah.c Mon Sep 17 23:24:45 2012 (r240623) @@ -1053,7 +1053,7 @@ ath_hal_getChanNoise(struct ath_hal *ah, * populated with values from NOISE_FLOOR[] + ath_hal_getNfAdjust(). * * The caller must supply ctl/ext NF arrays which are at least - * AH_MIMO_MAX_CHAINS entries long. + * AH_MAX_CHAINS entries long. */ int ath_hal_get_mimo_chan_noise(struct ath_hal *ah, @@ -1069,7 +1069,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h HALDEBUG(ah, HAL_DEBUG_NFCAL, "%s: invalid channel %u/0x%x; no mapping\n", __func__, chan->ic_freq, chan->ic_flags); - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = 0; } return 0; @@ -1077,7 +1077,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h /* Return 0 if there's no valid MIMO values (yet) */ if (! (ichan->privFlags & CHANNEL_MIMO_NF_VALID)) { - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = 0; } return 0; @@ -1090,7 +1090,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h * stations which have a very low RSSI, below the * 'normalised' NF values in NOISE_FLOOR[]. */ - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = nf_ext[i] = NOISE_FLOOR[mode] + ath_hal_getNfAdjust(ah, ichan); } @@ -1109,7 +1109,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h * don't "wrap" when RSSI is less than the "adjusted" NF value. * ("Adjust" here is via ichan->noiseFloorAdjust.) */ - for (i = 0; i < AH_MIMO_MAX_CHAINS; i++) { + for (i = 0; i < AH_MAX_CHAINS; i++) { nf_ctl[i] = ichan->noiseFloorCtl[i] + ath_hal_getNfAdjust(ah, ichan); nf_ext[i] = ichan->noiseFloorExt[i] + ath_hal_getNfAdjust(ah, ichan); } Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah.h Mon Sep 17 23:24:45 2012 (r240623) @@ -35,7 +35,7 @@ * This is intended to be used by various statistics gathering operations * (NF, RSSI, EVM). */ -#define AH_MIMO_MAX_CHAINS 3 +#define AH_MAX_CHAINS 3 #define AH_MIMO_MAX_EVM_PILOTS 6 /* Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Mon Sep 17 23:04:15 2012 (r240622) +++ head/sys/dev/ath/ath_hal/ah_internal.h Mon Sep 17 23:24:45 2012 (r240623) @@ -153,8 +153,8 @@ typedef struct { int16_t rawNoiseFloor; int16_t noiseFloorAdjust; #ifdef AH_SUPPORT_AR5416 - int16_t noiseFloorCtl[AH_MIMO_MAX_CHAINS]; - int16_t noiseFloorExt[AH_MIMO_MAX_CHAINS]; + int16_t noiseFloorCtl[AH_MAX_CHAINS]; + int16_t noiseFloorExt[AH_MAX_CHAINS]; #endif /* AH_SUPPORT_AR5416 */ uint16_t mainSpur; /* cached spur value for this channel */ } HAL_CHANNEL_INTERNAL; From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 00:43:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0692D106566C; Tue, 18 Sep 2012 00:43:16 +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 CD0E28FC1C; Tue, 18 Sep 2012 00:43:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I0hFkX012213; Tue, 18 Sep 2012 00:43:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I0hFHx012210; Tue, 18 Sep 2012 00:43:15 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201209180043.q8I0hFHx012210@svn.freebsd.org> From: Attilio Rao Date: Tue, 18 Sep 2012 00:43: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: r240624 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 00:43:16 -0000 Author: attilio Date: Tue Sep 18 00:43:15 2012 New Revision: 240624 URL: http://svn.freebsd.org/changeset/base/240624 Log: Remove namespace pollution in _rmlock.h by defining rm_queue structure directly in _rmlock.h and then including it (and its dependencies) in pcpu.h. This leads to few _*.h headers to be included in pcpu.h but this is not considered a big deal. Really pc_rm_queue should be implemented as a dynamic member with DPCPU interface, but we really want to keep the read acquisition as fast as possible, so even the further pc_dynamic indirection should be avoided, and the pollution is dealt like this. Discussed with: jhb MFC after: 1 week Modified: head/sys/sys/_rmlock.h head/sys/sys/pcpu.h Modified: head/sys/sys/_rmlock.h ============================================================================== --- head/sys/sys/_rmlock.h Mon Sep 17 23:24:45 2012 (r240623) +++ head/sys/sys/_rmlock.h Tue Sep 18 00:43:15 2012 (r240624) @@ -32,17 +32,17 @@ #ifndef _SYS__RMLOCK_H_ #define _SYS__RMLOCK_H_ -/* - * XXXUPS remove as soon as we have per cpu variable - * linker sets and can define rm_queue in _rm_lock.h -*/ -#include /* * Mostly reader/occasional writer lock. */ LIST_HEAD(rmpriolist,rm_priotracker); +struct rm_queue { + struct rm_queue *volatile rmq_next; + struct rm_queue *volatile rmq_prev; +}; + struct rmlock { struct lock_object lock_object; volatile cpuset_t rm_writecpus; Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Mon Sep 17 23:24:45 2012 (r240623) +++ head/sys/sys/pcpu.h Tue Sep 18 00:43:15 2012 (r240624) @@ -38,7 +38,11 @@ #endif #include +#include +#include +#include #include +#include #include #include #include @@ -137,15 +141,6 @@ extern uintptr_t dpcpu_off[]; #endif /* _KERNEL */ -/* - * XXXUPS remove as soon as we have per cpu variable - * linker sets and can define rm_queue in _rm_lock.h - */ -struct rm_queue { - struct rm_queue* volatile rmq_next; - struct rm_queue* volatile rmq_prev; -}; - /* * This structure maps out the global data that needs to be kept on a * per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR @@ -169,15 +164,7 @@ struct pcpu { void *pc_netisr; /* netisr SWI cookie */ int pc_dnweight; /* vm_page_dontneed() */ int pc_domain; /* Memory domain. */ - - /* - * Stuff for read mostly lock - * - * XXXUPS remove as soon as we have per cpu variable - * linker sets. - */ - struct rm_queue pc_rm_queue; - + struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ /* From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 01:27:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07692106564A; Tue, 18 Sep 2012 01:27:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5E698FC08; Tue, 18 Sep 2012 01:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I1ROei016404; Tue, 18 Sep 2012 01:27:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I1RORL016402; Tue, 18 Sep 2012 01:27:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209180127.q8I1RORL016402@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 01:27: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: r240625 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 01:27:25 -0000 Author: adrian Date: Tue Sep 18 01:27:24 2012 New Revision: 240625 URL: http://svn.freebsd.org/changeset/base/240625 Log: Add a couple of accessor inline functions for state that exists in net80211. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 18 00:43:15 2012 (r240624) +++ head/sys/dev/ath/ath_hal/ah_internal.h Tue Sep 18 01:27:24 2012 (r240625) @@ -913,5 +913,36 @@ extern int16_t ath_ee_interpolate(uint16 AH_PRIVATE((_ah))->ah_caps.halSupportsFastClock5GHz && \ ath_hal_eepromGetFlag((_ah), AR_EEP_FSTCLK_5G)) +/* + * Fetch the maximum regulatory domain power for the given channel + * in 1/2dBm steps. + */ +static inline int +ath_hal_get_twice_max_regpower(struct ath_hal_private *ahp, + const HAL_CHANNEL_INTERNAL *ichan, const struct ieee80211_channel *chan) +{ + struct ath_hal *ah = &ahp->h; + + if (! chan) { + ath_hal_printf(ah, "%s: called with chan=NULL!\n", __func__); + return (0); + } + return (chan->ic_maxpower); +} + +/* + * Get the maximum antenna gain allowed, in 1/2dBm steps. + */ +static inline int +ath_hal_getantennaallowed(struct ath_hal *ah, + const struct ieee80211_channel *chan) +{ + + if (! chan) + return (0); + + return (chan->ic_maxantgain); +} + #endif /* _ATH_AH_INTERAL_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 02:19:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B751065670; Tue, 18 Sep 2012 02:19:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E27AA8FC16; Tue, 18 Sep 2012 02:19:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I2Jhev021164; Tue, 18 Sep 2012 02:19:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I2JhV2021161; Tue, 18 Sep 2012 02:19:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209180219.q8I2JhV2021161@svn.freebsd.org> From: Kevin Lo Date: Tue, 18 Sep 2012 02:19: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: r240627 - in head/sys/dev: ata mly X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 02:19:44 -0000 Author: kevlo Date: Tue Sep 18 02:19:43 2012 New Revision: 240627 URL: http://svn.freebsd.org/changeset/base/240627 Log: Remove bogus break statements. Obtained from: DragonFly Modified: head/sys/dev/ata/ata-lowlevel.c head/sys/dev/mly/mly.c Modified: head/sys/dev/ata/ata-lowlevel.c ============================================================================== --- head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:14:47 2012 (r240626) +++ head/sys/dev/ata/ata-lowlevel.c Tue Sep 18 02:19:43 2012 (r240627) @@ -370,7 +370,6 @@ ata_end_transaction(struct ata_request * "%s trying to write on read buffer\n", ata_cmd2str(request)); goto end_finished; - break; } ata_pio_write(request, length); request->donecount += length; Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Tue Sep 18 02:14:47 2012 (r240626) +++ head/sys/dev/mly/mly.c Tue Sep 18 02:19:43 2012 (r240627) @@ -1350,7 +1350,6 @@ mly_process_event(struct mly_softc *sc, if (action == 'r') sc->mly_btl[bus][target].mb_flags |= MLY_BTL_RESCAN; break; - break; case 's': /* report of sense data */ if (((ssd->flags & SSD_KEY) == SSD_KEY_NO_SENSE) || (((ssd->flags & SSD_KEY) == SSD_KEY_NOT_READY) && From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 02:33:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27B8E106566C; Tue, 18 Sep 2012 02:33:23 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAEBE8FC12; Tue, 18 Sep 2012 02:33:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I2XNcn022366; Tue, 18 Sep 2012 02:33:23 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I2XNs3022364; Tue, 18 Sep 2012 02:33:23 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201209180233.q8I2XNs3022364@svn.freebsd.org> From: Benjamin Kaduk Date: Tue, 18 Sep 2012 02: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: r240628 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 02:33:24 -0000 Author: bjk (doc committer) Date: Tue Sep 18 02:33:23 2012 New Revision: 240628 URL: http://svn.freebsd.org/changeset/base/240628 Log: Whitespace cleanup for ipfw.8 -- start each sentence on a new line, and put a comma after e.g. and i.e.. While here, wrap long lines. PR: docs/157452 Approved by: hrs (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Sep 18 02:19:43 2012 (r240627) +++ head/sbin/ipfw/ipfw.8 Tue Sep 18 02:33:23 2012 (r240628) @@ -141,7 +141,7 @@ the firewall will have a .Em stateful behaviour, i.e., upon a match it will create .Em dynamic rules , -i.e. rules that match packets with the same 5-tuple +i.e., rules that match packets with the same 5-tuple (protocol, source and destination addresses and ports) as the packet which caused their creation. Dynamic rules, which have a limited lifetime, are checked @@ -223,14 +223,15 @@ When listing and is specified, also show expired dynamic rules. .It Fl f Do not ask for confirmation for commands that can cause problems -if misused, -.No i.e. Cm flush . +if misused, i.e., +.Cm flush . If there is no tty associated with the process, this is implied. .It Fl i When listing a table (see the .Sx LOOKUP TABLES section below for more information on lookup tables), format values -as IP addresses. By default, values are shown as integers. +as IP addresses. +By default, values are shown as integers. .It Fl n Only check syntax of the command strings, without actually passing them to the kernel. @@ -421,7 +422,7 @@ Keywords are case-sensitive, whereas arg or may not be case-sensitive depending on their nature (e.g.\& uid's are, hostnames are not). .Pp -Some arguments (e.g. port or address lists) are comma-separated +Some arguments (e.g., port or address lists) are comma-separated lists of values. In this case, spaces after commas ',' are allowed to make the line more readable. @@ -873,7 +874,8 @@ Takes rule number saved to internal stac action and returns ruleset processing to the first rule with number greater than number of corresponding .Cm call -rule. See description of the +rule. +See description of the .Cm call action for more details. .Pp @@ -960,23 +962,29 @@ Initially this is limited to the values Processing continues at the next rule. It is possible to use the .Cm tablearg -keyword with a setfib. If tablearg value is not within compiled FIB range packet fib is set to 0. +keyword with a setfib. +If tablearg value is not within compiled FIB range packet fib is set to 0. .It Cm reass Queue and reassemble ip fragments. -If the packet is not fragmented, counters are updated and processing continues with the next rule. +If the packet is not fragmented, counters are updated and +processing continues with the next rule. If the packet is the last logical fragment, the packet is reassembled and, if .Va net.inet.ip.fw.one_pass -is set to 0, processing continues with the next rule, else packet is allowed to pass and search terminates. -If the packet is a fragment in the middle, it is consumed and processing stops immediately. +is set to 0, processing continues with the next rule, else packet is +allowed to pass and search terminates. +If the packet is a fragment in the middle, it is consumed and +processing stops immediately. .Pp Fragments handling can be tuned via .Va net.inet.ip.maxfragpackets and .Va net.inet.ip.maxfragsperpacket -which limit, respectively, the maximum number of processable fragments (default: 800) and +which limit, respectively, the maximum number of processable +fragments (default: 800) and the maximum number of fragments per packet (default: 16). .Pp -NOTA BENE: since fragments do not contain port numbers, they should be avoided with the +NOTA BENE: since fragments do not contain port numbers, +they should be avoided with the .Nm reass rule. Alternatively, direction-based (like @@ -1596,7 +1604,8 @@ This is the short form of .It Cm sockarg Matches packets that are associated to a local socket and for which the SO_USER_COOKIE socket option has been set -to a non-zero value. As a side effect, the value of the +to a non-zero value. +As a side effect, the value of the option is made available as .Cm tablearg value, which in turn can be used as @@ -1746,7 +1755,7 @@ connected networks instead of all source .El .Sh LOOKUP TABLES Lookup tables are useful to handle large sparse sets of -addresses or other search keys (e.g. ports, jail IDs, interface names). +addresses or other search keys (e.g., ports, jail IDs, interface names). In the rest of this section we will use the term ``address''. There may be up to 65535 different lookup tables, numbered 0 to 65534. .Pp @@ -1784,7 +1793,8 @@ the routing table (see .Xr route 4 ) . .Pp Lookup tables currently support only ports, jail IDs, IPv4/IPv6 addresses -and interface names. Wildcards is not supported for interface names. +and interface names. +Wildcards is not supported for interface names. .Pp The .Cm tablearg @@ -1813,7 +1823,8 @@ Section for example usage of tables and When used with the .Cm skipto action, the user should be aware that the code will walk the ruleset -up to a rule equal to, or past, the given number, and should therefore try keep the +up to a rule equal to, or past, the given number, +and should therefore try keep the ruleset compact between the skipto and the target rules. .Sh SETS OF RULES Each rule belongs to one of 32 different @@ -2021,10 +2032,12 @@ As an example, using ``src-ip 0xffffff00 for each /24 destination subnet. .Pp The FLOW_MASK, together with the SCHED_MASK, is used to split -packets into flows. As an example, using +packets into flows. +As an example, using ``src-ip 0x000000ff'' together with the previous SCHED_MASK makes a flow for -each individual source address. In turn, flows for each /24 +each individual source address. +In turn, flows for each /24 subnet will be sent to the same scheduler instance. .Pp The above diagram holds even for the @@ -2143,12 +2156,13 @@ A file specifying the additional overhea of a packet on the link. .Pp Some link types introduce extra delays in the transmission -of a packet, e.g. because of MAC level framing, contention on +of a packet, e.g., because of MAC level framing, contention on the use of the channel, MAC level retransmissions and so on. From our point of view, the channel is effectively unavailable for this extra time, which is constant or variable depending -on the link type. Additionally, packets may be dropped after this -time (e.g. on a wireless link after too many retransmissions). +on the link type. +Additionally, packets may be dropped after this +time (e.g., on a wireless link after too many retransmissions). We can model the additional delay with an empirical curve that represents its distribution. .Bd -literal -offset indent @@ -2184,7 +2198,7 @@ If not specified here, it must be presen explicitly as a configuration parameter for the pipe; .It Cm loss-level Ar L the probability above which packets are lost. -(0.0 <= L <= 1.0, default 1.0 i.e. no loss); +(0.0 <= L <= 1.0, default 1.0 i.e., no loss); .It Cm samples Ar N the number of samples used in the internal representation of the curve (2..1024; default 100); @@ -2249,7 +2263,8 @@ but gives no service guarantees. .It Cm wf2q+ implements the WF2Q+ algorithm, which is a Weighted Fair Queueing algorithm which permits flows to share bandwidth according to -their weights. Note that weights are not priorities; even a flow +their weights. +Note that weights are not priorities; even a flow with a minuscule weight will never starve. WF2Q+ has O(log N) per-packet processing cost, where N is the number of flows, and is the default algorithm used by previous versions @@ -2535,7 +2550,8 @@ in .Xr natd 8 for more information. .It Cm tablearg -Uses argument supplied in lookup table. See +Uses argument supplied in lookup table. +See .Sx LOOKUP TABLES section below for more information on lookup tables. .El @@ -2597,11 +2613,13 @@ or before ipfw module gets loaded. .Bl -tag -width indent .It Va net.inet.ip.fw.default_to_accept: No 0 -Defines ipfw last rule behavior. This value overrides +Defines ipfw last rule behavior. +This value overrides .Cd "options IPFW_DEFAULT_TO_(ACCEPT|DENY)" from kernel configuration file. .It Va net.inet.ip.fw.tables_max: No 128 -Defines number of tables available in ipfw. Number cannot exceed 65534. +Defines number of tables available in ipfw. +Number cannot exceed 65534. .El .Sh SYSCTL VARIABLES A set of @@ -2631,12 +2649,14 @@ Option 1 should never be selected as thi An attacker can establish multiple fake associations by sending AddIP messages. .It Va net.inet.ip.alias.sctp.chunk_proc_limit: No 5 -Defines the maximum number of chunks in an SCTP packet that will be parsed for a +Defines the maximum number of chunks in an SCTP packet that will be +parsed for a packet that matches an existing association. This value is enforced to be greater or equal than .Cm net.inet.ip.alias.sctp.initialising_chunk_proc_limit . A high value is -a DoS risk yet setting too low a value may result in important control chunks in +a DoS risk yet setting too low a value may result in +important control chunks in the packet not being located and parsed. .It Va net.inet.ip.alias.sctp.error_on_ootb: No 1 Defines when the @@ -2658,7 +2678,8 @@ This value is only useful if the .Nm nat is tracking global IP addresses. .It Cm 3 -ErrorM is sent in response to all OOTB packets on both the local and global side +ErrorM is sent in response to all OOTB packets on both +the local and global side (DoS risk). .El .Pp @@ -2709,12 +2730,14 @@ will only be an INIT or ASCONF-AddIP pac A higher value may become a DoS risk as malformed packets can consume processing resources. .It Va net.inet.ip.alias.sctp.param_proc_limit: No 25 -Defines the maximum number of parameters within a chunk that will be parsed in a +Defines the maximum number of parameters within a chunk that will be +parsed in a packet. As for other similar sysctl variables, larger values pose a DoS risk. .It Va net.inet.ip.alias.sctp.log_level: No 0 Level of detail in the system log messages (0 \- minimal, 1 \- event, -2 \- info, 3 \- detail, 4 \- debug, 5 \- max debug). May be a good +2 \- info, 3 \- detail, 4 \- debug, 5 \- max debug). +May be a good option in high loss environments. .It Va net.inet.ip.alias.sctp.shutdown_time: No 15 Timeout value while waiting for SHUTDOWN-COMPLETE. @@ -2733,7 +2756,8 @@ association is limited to this value .El .Pp This variable is fully dynamic, the new value will be adopted for all newly -arriving associations, existing associations are treated as they were previously. +arriving associations, existing associations are treated +as they were previously. Global tracking will decrease the number of collisions within the .Nm nat at a cost @@ -3280,7 +3304,8 @@ Some early work (1999-2000) on the traffic shaper supported by Akamba Corp. .Pp The ipfw core (ipfw2) has been completely redesigned and -reimplemented by Luigi Rizzo in summer 2002. Further +reimplemented by Luigi Rizzo in summer 2002. +Further actions and options have been added by various developer over the years. .Pp From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 05:15:29 2012 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 23FF9106566B; Tue, 18 Sep 2012 05:15:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 59EE414E1D4; Tue, 18 Sep 2012 05:15:27 +0000 (UTC) Message-ID: <5058036F.1010104@FreeBSD.org> Date: Mon, 17 Sep 2012 22:15:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Benjamin Kaduk References: <201209180233.q8I2XNs3022364@svn.freebsd.org> In-Reply-To: <201209180233.q8I2XNs3022364@svn.freebsd.org> X-Enigmail-Version: 1.4.4 OpenPGP: id=1A1ABC84 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, hrs@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 05:15:29 -0000 On 09/17/2012 19:33, Benjamin Kaduk wrote: > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, We generally don't do this at all absent other changes. We definitely don't make whitespace-only changes mixed in with other changes, as it makes the diff too hard to read. Your mentor should have caught this. -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 07:57:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649EB106566B; Tue, 18 Sep 2012 07:57:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 505078FC1D; Tue, 18 Sep 2012 07:57:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I7vZE6052887; Tue, 18 Sep 2012 07:57:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I7vZnF052885; Tue, 18 Sep 2012 07:57:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180757.q8I7vZnF052885@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 07:57: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: r240629 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 07:57:35 -0000 Author: avg Date: Tue Sep 18 07:57:34 2012 New Revision: 240629 URL: http://svn.freebsd.org/changeset/base/240629 Log: g_disk_flushcache definitely should not be traced under G_T_TOPOLOGY ... use G_T_BIO instead MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Sep 18 02:33:23 2012 (r240628) +++ head/sys/geom/geom_disk.c Tue Sep 18 07:57:34 2012 (r240629) @@ -392,7 +392,7 @@ g_disk_start(struct bio *bp) error = ENOIOCTL; break; case BIO_FLUSH: - g_trace(G_T_TOPOLOGY, "g_disk_flushcache(%s)", + g_trace(G_T_BIO, "g_disk_flushcache(%s)", bp->bio_to->name); if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) { error = EOPNOTSUPP; From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:00:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F20191065680; Tue, 18 Sep 2012 08:00:43 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50D18FC08; Tue, 18 Sep 2012 08:00:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I80hrO053283; Tue, 18 Sep 2012 08:00:43 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I80hNs053281; Tue, 18 Sep 2012 08:00:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209180800.q8I80hNs053281@svn.freebsd.org> From: Kevin Lo Date: Tue, 18 Sep 2012 08:00: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: r240630 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 08:00:44 -0000 Author: kevlo Date: Tue Sep 18 08:00:43 2012 New Revision: 240630 URL: http://svn.freebsd.org/changeset/base/240630 Log: Add missing break Modified: head/sys/netipsec/xform_ipip.c Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Tue Sep 18 07:57:34 2012 (r240629) +++ head/sys/netipsec/xform_ipip.c Tue Sep 18 08:00:43 2012 (r240630) @@ -575,6 +575,7 @@ ipip_output( itos = ntohl(itos32) >> 20; ip6o->ip6_nxt = IPPROTO_IPV6; + break; } default: goto nofamily; From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:00:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406D61065675; Tue, 18 Sep 2012 08:00:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3608FC1E; Tue, 18 Sep 2012 08:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I80vC5053339; Tue, 18 Sep 2012 08:00:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I80uJ5053337; Tue, 18 Sep 2012 08:00:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180800.q8I80uJ5053337@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:00: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: r240631 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 08:00:57 -0000 Author: avg Date: Tue Sep 18 08:00:56 2012 New Revision: 240631 URL: http://svn.freebsd.org/changeset/base/240631 Log: zfs: allow both DEBUG and ZFS_DEBUG to be defined on command line Discussed with: pjd MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Sep 18 08:00:43 2012 (r240630) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Tue Sep 18 08:00:56 2012 (r240631) @@ -43,8 +43,10 @@ extern "C" { */ #if defined(DEBUG) || !defined(_KERNEL) +#if !defined(ZFS_DEBUG) #define ZFS_DEBUG #endif +#endif extern int zfs_flags; From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:02:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A19D106566C; Tue, 18 Sep 2012 08:02:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1589E8FC1D; Tue, 18 Sep 2012 08:02:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I82s0q053615; Tue, 18 Sep 2012 08:02:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I82sbu053613; Tue, 18 Sep 2012 08:02:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180802.q8I82sbu053613@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:02: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: r240632 - 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: Tue, 18 Sep 2012 08:02:55 -0000 Author: avg Date: Tue Sep 18 08:02:54 2012 New Revision: 240632 URL: http://svn.freebsd.org/changeset/base/240632 Log: zfs: correctly calculate dn_bonuslen for saving SAs to disk Since all attribute values start at 8-byte aligned boundary, we would previously incorrectly calculate dn_bonuslen if any attribute but the last had a variable-length value with length not multiple of 8. Reported by: Nicolas Rachinsky Tested by: Nicolas Rachinsky Reviewed by: Matthew Ahrens (for upstream) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Sep 18 08:00:56 2012 (r240631) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Tue Sep 18 08:02:54 2012 (r240632) @@ -578,7 +578,7 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_ for (i = 0; i != attr_count; i++) { boolean_t is_var_sz; - *total += attr_desc[i].sa_length; + *total += P2ROUNDUP(attr_desc[i].sa_length, 8); if (done) goto next; @@ -713,6 +713,8 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu length = SA_REGISTERED_LEN(sa, attrs[i]); if (length == 0) length = attr_desc[i].sa_length; + else + VERIFY(length == attr_desc[i].sa_length); if (buf_space < length) { /* switch to spill buffer */ VERIFY(bonustype == DMU_OT_SA); @@ -742,6 +744,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bu if (sa->sa_attr_table[attrs[i]].sa_length == 0) { sahdr->sa_lengths[len_idx++] = length; } + VERIFY((uintptr_t)data_start % 8 == 0); data_start = (void *)P2ROUNDUP(((uintptr_t)data_start + length), 8); buf_space -= P2ROUNDUP(length, 8); From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:12:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95EB91065670; Tue, 18 Sep 2012 08:12:28 +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 821348FC17; Tue, 18 Sep 2012 08:12:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8CSgl054745; Tue, 18 Sep 2012 08:12:28 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8CSVh054743; Tue, 18 Sep 2012 08:12:28 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209180812.q8I8CSVh054743@svn.freebsd.org> From: Joel Dahl Date: Tue, 18 Sep 2012 08:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240633 - head/sbin/nvmecontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 08:12:28 -0000 Author: joel (doc committer) Date: Tue Sep 18 08:12:28 2012 New Revision: 240633 URL: http://svn.freebsd.org/changeset/base/240633 Log: mdoc: remove superfluous paragraph macro. Modified: head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Tue Sep 18 08:02:54 2012 (r240632) +++ head/sbin/nvmecontrol/nvmecontrol.8 Tue Sep 18 08:12:28 2012 (r240633) @@ -76,7 +76,6 @@ Display a hexadecimal dump of the nvme0 Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each thread will issue a single 512 byte read command. Results are printed to stdout when 30 seconds expires. -.Pp .Sh AUTHORS .An -nosplit .Nm From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:17:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E862B1065675; Tue, 18 Sep 2012 08:17:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D2C8FC08; Tue, 18 Sep 2012 08:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8HTCo055324; Tue, 18 Sep 2012 08:17:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8HTNH055322; Tue, 18 Sep 2012 08:17:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180817.q8I8HTNH055322@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:17: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: r240634 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 08:17:30 -0000 Author: avg Date: Tue Sep 18 08:17:29 2012 New Revision: 240634 URL: http://svn.freebsd.org/changeset/base/240634 Log: acpi_cpu: explicitly notify userland about c-state changes ... after they are committed. A notification is sent per CPU. Reviewed by: imp MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Sep 18 08:12:28 2012 (r240633) +++ head/sys/dev/acpica/acpi_cpu.c Tue Sep 18 08:17:29 2012 (r240634) @@ -1063,6 +1063,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no ACPI_SERIAL_BEGIN(cpu); acpi_cpu_set_cx_lowest(sc); ACPI_SERIAL_END(cpu); + + acpi_UserNotify("PROCESSOR", sc->cpu_handle, notify); } static int From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 08:53:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21F8106566B; Tue, 18 Sep 2012 08:53:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D99A8FC14; Tue, 18 Sep 2012 08:53:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I8rBQh059277; Tue, 18 Sep 2012 08:53:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I8rBlQ059275; Tue, 18 Sep 2012 08:53:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209180853.q8I8rBlQ059275@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 08:53: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: r240637 - head/sys/boot/i386/loader X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 08:53:11 -0000 Author: avg Date: Tue Sep 18 08:53:11 2012 New Revision: 240637 URL: http://svn.freebsd.org/changeset/base/240637 Log: loader/i386: replace ugly inb/outb re-implementations with cpufunc.h Use of __builtin_constant_p in a function that is only called via a pointer is a good example of how out-of-date it was. Suggested by: bde MFC after: 1 week Modified: head/sys/boot/i386/loader/main.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Tue Sep 18 08:28:08 2012 (r240636) +++ head/sys/boot/i386/loader/main.c Tue Sep 18 08:53:11 2012 (r240637) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -321,34 +322,19 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ +/* ISA bus access functions for PnP. */ static int isa_inb(int port) { - u_char data; - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } + outb(port, value); } #ifdef LOADER_ZFS_SUPPORT From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 09:15:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD328106564A; Tue, 18 Sep 2012 09:15:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C92C18FC15; Tue, 18 Sep 2012 09:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8I9FWTb061931; Tue, 18 Sep 2012 09:15:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8I9FWo5061929; Tue, 18 Sep 2012 09:15:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209180915.q8I9FWo5061929@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 09:15: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: r240638 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 09:15:33 -0000 Author: glebius Date: Tue Sep 18 09:15:32 2012 New Revision: 240638 URL: http://svn.freebsd.org/changeset/base/240638 Log: Fix DIOCNATLOOK: zero key padding before performing lookup. Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 08:53:11 2012 (r240637) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 09:15:32 2012 (r240638) @@ -1808,6 +1808,7 @@ DIOCGETSTATES_full: (!pnl->dport || !pnl->sport))) error = EINVAL; else { + bzero(&key, sizeof(key)); key.af = pnl->af; key.proto = pnl->proto; PF_ACPY(&key.addr[sidx], &pnl->saddr, pnl->af); From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 10:14:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70A8C1065673; Tue, 18 Sep 2012 10:14:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ADC28FC14; Tue, 18 Sep 2012 10:14:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAEIlZ068973; Tue, 18 Sep 2012 10:14:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAEIcn068969; Tue, 18 Sep 2012 10:14:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209181014.q8IAEIcn068969@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 10:14: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: r240639 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 10:14:18 -0000 Author: adrian Date: Tue Sep 18 10:14:17 2012 New Revision: 240639 URL: http://svn.freebsd.org/changeset/base/240639 Log: Implement my first cut at filtered frames in aggregation sessions. The hardware can optionally "filter" frames if successive transmissions to a given node (ie, "entry in the keycache") fail. That way the hardware can implement a kind of early abort of all the other frames queued to that destination, rather than simply trying to TX each frame to that destination (and failing.) The background: * If a frame comes back as being filtered, the hardware didn't try to TX it (or it was outside the TX burst opportunity.) So, take it as a hint that some (but not all, see below) frames to the destination may be filtered. * If the CLRDMASK bit is set in a TX descriptor, the "filter to this destination" bit in the keycache entry is cleared and TX to that host will be unconditionally retried. * Right now everything has the CLRDMASK bit set, so filtered frames tend to be aggregates and frames that fall outside of the WME burst window. It was a bit worse in the past as I had messed up the TX flags and CLRDMASK wasn't being set on aggregate frames. The annoying bits: * It's easy (ish) to do for aggregate session frames - firstly, they can be retried in any order as long as they're within the BAW, and there's already a bunch of infrastructure tracking how many frames the TID has queued to the hardware (tid->hwq_depth.) However, for frames that bypassed the software queue, hwq_depth doesn't get incremented. I'll fix that in a subsequent commit. * For non-aggregate session frames, the only retries that can occur are ones for sequence numbers that hvaen't successfully been TXed yet. Since there's no re-ordering going on in non-aggregate sessions, if any subsequent seqno frames make it out, any filtered frames before that seqno need to be dropped. Hence why this initially is just for aggregate session frames. * Since there may be intermediary frames to the destination that have CLRDMASK set - for example, any directly dispatched management frames to that destination - it's possible that there will be some filtered frames followed up by some non filtered frames. Thus, it can't be assumed that once you see a filtered frame for the given destination node, all subsequent frames for all TIDs will be filtered. Ok, with that in mind: * Create a per-TID filtered frame queue for frames that the hardware returns as filtered. * Track filtered frames per-tid, rather than per-node. It just makes the locking much easier. * When a filtered frame appears in the completion function, the node transitions to "filtered", and all subsequent completed error frames (filtered or otherwise) are put on the filtered frame queue. The TID is paused once (during the transition from non-filtered to filtered). * If a filtered frame retry count exceeds SWMAX_RETRIES, a BAR should be sent. * Once all the frames queued to the hardware for the given filtered frame TID, transition back from filtered frame to non-filtered frame, which means pre-pending all the filtered frames onto the head of the software queue, clearing the filtered frame state and unpausing the TID. Things get quite hairy around handling completion (aggr, non-aggr, norm, direct-dispatched frames to a hardware queue); whether it's an "error", "cleanup" or "BAR" state as well as filtered, which order to do things in (eg do filtered BEFORE checking for BAR, as the filter completion may be needed to actually transmit a BAR frame.) This work has definitely reminded me that I have to tidy up all the locking and remove some of the ridiculous lock/unlock/lock/unlock going on in the completion functions. It's also reminded me that I should really split out TID versus hardware TXQ locking, even if the underlying locking is still the destination hardware TXQ. Finally, this is all pre-requisite for working on AP mode power save support (PS-POLL, uAPSD) as well as improving performance to misbehaving nodes (as they can transition into filter mode, stopping any TX until everything has caught up.) Finally (ish) - this should also be done for non-aggregate sessions as there are still plenty of laptops and mobile devices that don't speak 802.11n but do wish for stable, useful power save AP support where packets aren't simply dropped. This requires software retransmission for non-aggregate sessions to be implemented, which includes the caveats I've mentioned above. Finally finally - this doesn't yet do anything about the CLRDMASK bit in the TX descriptor. That's still unconditionally set to 1. I'll debug the current work (mostly ensuring I haven't busted up the hairy transitions between BAR, filtered, error (all frames in an aggregate failing) and cleanup (when transitioning from aggregation -> non-aggregation.)) Finally finally finally - this is all original work by yours truely, rather than ported from the Atheros internal driver codebase or Linux ath9k. Tested: * AR9280, AR5416 in STA mode * AR9280, AR9130 in hostap mode * Lots and lots of iperf testing in very marginal and non-marginal conditions, complete with inducing filtered frames + BAR TX conditions. Modified: head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Sep 18 10:14:17 2012 (r240639) @@ -937,6 +937,8 @@ ath_sysctl_stats_attach(struct ath_softc "Number of multicast frames exceeding maximum mcast queue depth"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_keymiss", CTLFLAG_RD, &sc->sc_stats.ast_rx_keymiss, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_swfiltered", CTLFLAG_RD, + &sc->sc_stats.ast_tx_swfiltered, 0, ""); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_ath_tx.c Tue Sep 18 10:14:17 2012 (r240639) @@ -114,6 +114,9 @@ static ieee80211_seq ath_tx_tid_seqno_as struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0); static int ath_tx_action_frame_override_queue(struct ath_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, int *tid); +static struct ath_buf * +ath_tx_retry_clone(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf); /* * Whether to use the 11n rate scenario functions or not @@ -145,6 +148,22 @@ ath_tx_gettid(struct ath_softc *sc, cons return WME_AC_TO_TID(pri); } +static void +ath_tx_set_retry(struct ath_softc *sc, struct ath_buf *bf) +{ + struct ieee80211_frame *wh; + + wh = mtod(bf->bf_m, struct ieee80211_frame *); + /* Only update/resync if needed */ + if (bf->bf_state.bfs_isretried == 0) { + wh->i_fc[1] |= IEEE80211_FC1_RETRY; + bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, + BUS_DMASYNC_PREWRITE); + } + bf->bf_state.bfs_isretried = 1; + bf->bf_state.bfs_retries ++; +} + /* * Determine what the correct AC queue for the given frame * should be. @@ -2711,7 +2730,12 @@ ath_tx_tid_init(struct ath_softc *sc, st for (i = 0; i < IEEE80211_TID_SIZE; i++) { atid = &an->an_tid[i]; + + /* XXX now with this bzer(), is the field 0'ing needed? */ + bzero(atid, sizeof(*atid)); + TAILQ_INIT(&atid->axq_q); + TAILQ_INIT(&atid->filtq.axq_q); atid->tid = i; atid->an = an; for (j = 0; j < ATH_TID_MAX_BUFS; j++) @@ -2721,6 +2745,7 @@ ath_tx_tid_init(struct ath_softc *sc, st atid->sched = 0; atid->hwq_depth = 0; atid->cleanup_inprogress = 0; + atid->clrdmask = 1; /* Always start by setting this bit */ if (i == IEEE80211_NONQOS_TID) atid->ac = WME_AC_BE; else @@ -2762,6 +2787,12 @@ ath_tx_tid_resume(struct ath_softc *sc, return; } + /* XXX isfiltered shouldn't ever be 0 at this point */ + if (tid->isfiltered == 1) { + device_printf(sc->sc_dev, "%s: filtered?!\n", __func__); + return; + } + ath_tx_tid_sched(sc, tid); /* Punt some frames to the hardware if needed */ //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); @@ -2769,6 +2800,192 @@ ath_tx_tid_resume(struct ath_softc *sc, } /* + * Add the given ath_buf to the TID filtered frame list. + * This requires the TID be filtered. + */ +static void +ath_tx_tid_filt_addbuf(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + if (! tid->isfiltered) + device_printf(sc->sc_dev, "%s: not filtered?!\n", __func__); + + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: bf=%p\n", __func__, bf); + + /* Set the retry bit and bump the retry counter */ + ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swfiltered++; + + ATH_TXQ_INSERT_TAIL(&tid->filtq, bf, bf_list); +} + +/* + * Handle a completed filtered frame from the given TID. + * This just enables/pauses the filtered frame state if required + * and appends the filtered frame to the filtered queue. + */ +static void +ath_tx_tid_filt_comp_buf(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (! tid->isfiltered) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: filter transition\n", + __func__); + tid->isfiltered = 1; + ath_tx_tid_pause(sc, tid); + } + + /* Add the frame to the filter queue */ + ath_tx_tid_filt_addbuf(sc, tid, bf); +} + +/* + * Complete the filtered frame TX completion. + * + * If there are no more frames in the hardware queue, unpause/unfilter + * the TID if applicable. Otherwise we will wait for a node PS transition + * to unfilter. + */ +static void +ath_tx_tid_filt_comp_complete(struct ath_softc *sc, struct ath_tid *tid) +{ + struct ath_buf *bf; + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (tid->hwq_depth != 0) + return; + + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: hwq=0, transition back\n", + __func__); + tid->isfiltered = 0; + tid->clrdmask = 1; + + /* XXX this is really quite inefficient */ + while ((bf = TAILQ_LAST(&tid->filtq.axq_q, ath_bufhead_s)) != NULL) { + ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list); + ATH_TXQ_INSERT_HEAD(tid, bf, bf_list); + } + + ath_tx_tid_resume(sc, tid); +} + +/* + * Called when a single (aggregate or otherwise) frame is completed. + * + * Returns 1 if the buffer could be added to the filtered list + * (cloned or otherwise), 0 if the buffer couldn't be added to the + * filtered list (failed clone; expired retry) and the caller should + * free it and handle it like a failure (eg by sending a BAR.) + */ +static int +ath_tx_tid_filt_comp_single(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + struct ath_buf *nbf; + int retval; + + ATH_TID_LOCK_ASSERT(sc, tid); + + /* + * Don't allow a filtered frame to live forever. + */ + if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: bf=%p, seqno=%d, exceeded retries\n", + __func__, + bf, + bf->bf_state.bfs_seqno); + return (0); + } + + /* + * A busy buffer can't be added to the retry list. + * It needs to be cloned. + */ + if (bf->bf_flags & ATH_BUF_BUSY) { + nbf = ath_tx_retry_clone(sc, tid->an, tid, bf); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer clone: %p -> %p\n", + __func__, bf, nbf); + } else { + nbf = bf; + } + + if (nbf == NULL) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer couldn't be cloned (%p)!\n", + __func__, bf); + retval = 1; + } else { + ath_tx_tid_filt_comp_buf(sc, tid, nbf); + retval = 0; + } + ath_tx_tid_filt_comp_complete(sc, tid); + + return (retval); +} + +static void +ath_tx_tid_filt_comp_aggr(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf_first, ath_bufhead *bf_q) +{ + struct ath_buf *bf, *bf_next, *nbf; + + ATH_TID_LOCK_ASSERT(sc, tid); + + bf = bf_first; + while (bf) { + bf_next = bf->bf_next; + bf->bf_next = NULL; /* Remove it from the aggr list */ + + /* + * Don't allow a filtered frame to live forever. + */ + if (bf->bf_state.bfs_retries > SWMAX_RETRIES) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: bf=%p, seqno=%d, exceeded retries\n", + __func__, + bf, + bf->bf_state.bfs_seqno); + TAILQ_INSERT_TAIL(bf_q, bf, bf_list); + goto next; + } + + if (bf->bf_flags & ATH_BUF_BUSY) { + nbf = ath_tx_retry_clone(sc, tid->an, tid, bf); + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: busy buffer cloned: %p -> %p", + __func__, bf, nbf); + } else { + nbf = bf; + } + + /* + * If the buffer couldn't be cloned, add it to bf_q; + * the caller will free the buffer(s) as required. + */ + if (nbf == NULL) { + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, + "%s: buffer couldn't be cloned! (%p)\n", + __func__, bf); + TAILQ_INSERT_TAIL(bf_q, bf, bf_list); + } else { + ath_tx_tid_filt_comp_buf(sc, tid, nbf); + } +next: + bf = bf_next; + } + + ath_tx_tid_filt_comp_complete(sc, tid); +} + +/* * Suspend the queue because we need to TX a BAR. */ static void @@ -2924,6 +3141,80 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, ath_tx_tid_bar_unsuspend(sc, tid); } +static void +ath_tx_tid_drain_pkt(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, ath_bufhead *bf_cq, struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + /* + * If the current TID is running AMPDU, update + * the BAW. + */ + if (ath_tx_ampdu_running(sc, an, tid->tid) && + bf->bf_state.bfs_dobaw) { + /* + * Only remove the frame from the BAW if it's + * been transmitted at least once; this means + * the frame was in the BAW to begin with. + */ + if (bf->bf_state.bfs_retries > 0) { + ath_tx_update_baw(sc, an, tid, bf); + bf->bf_state.bfs_dobaw = 0; + } + /* + * This has become a non-fatal error now + */ + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } + TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); +} + +static void +ath_tx_tid_drain_print(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf) +{ + struct ieee80211_node *ni = &an->an_node; + struct ath_txq *txq = sc->sc_ac2q[tid->ac]; + struct ieee80211_tx_ampdu *tap; + + tap = ath_tx_get_tx_tid(an, tid->tid); + + device_printf(sc->sc_dev, + "%s: node %p: bf=%p: addbaw=%d, dobaw=%d, " + "seqno=%d, retry=%d\n", + __func__, ni, bf, + bf->bf_state.bfs_addedbaw, + bf->bf_state.bfs_dobaw, + SEQNO(bf->bf_state.bfs_seqno), + bf->bf_state.bfs_retries); + device_printf(sc->sc_dev, + "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, isfiltered=%d\n", + __func__, ni, bf, + tid->axq_depth, + tid->hwq_depth, + tid->bar_wait, + tid->isfiltered); + device_printf(sc->sc_dev, + "%s: node %p: tid %d: txq_depth=%d, " + "txq_aggr_depth=%d, sched=%d, paused=%d, " + "hwq_depth=%d, incomp=%d, baw_head=%d, " + "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", + __func__, ni, tid->tid, txq->axq_depth, + txq->axq_aggr_depth, tid->sched, tid->paused, + tid->hwq_depth, tid->incomp, tid->baw_head, + tid->baw_tail, tap == NULL ? -1 : tap->txa_start, + ni->ni_txseqs[tid->tid]); + + /* XXX Dump the frame, see what it is? */ + ieee80211_dump_pkt(ni->ni_ic, + mtod(bf->bf_m, const uint8_t *), + bf->bf_m->m_len, 0, -1); +} /* * Free any packets currently pending in the software TX queue. @@ -2947,14 +3238,14 @@ ath_tx_tid_drain(struct ath_softc *sc, s struct ath_buf *bf; struct ieee80211_tx_ampdu *tap; struct ieee80211_node *ni = &an->an_node; - int t = 0; - struct ath_txq *txq = sc->sc_ac2q[tid->ac]; + int t; tap = ath_tx_get_tx_tid(an, tid->tid); - ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + ATH_TID_LOCK_ASSERT(sc, tid); /* Walk the queue, free frames */ + t = 0; for (;;) { bf = TAILQ_FIRST(&tid->axq_q); if (bf == NULL) { @@ -2962,65 +3253,28 @@ ath_tx_tid_drain(struct ath_softc *sc, s } if (t == 0) { - device_printf(sc->sc_dev, - "%s: node %p: bf=%p: addbaw=%d, dobaw=%d, " - "seqno=%d, retry=%d\n", - __func__, ni, bf, - bf->bf_state.bfs_addedbaw, - bf->bf_state.bfs_dobaw, - SEQNO(bf->bf_state.bfs_seqno), - bf->bf_state.bfs_retries); - device_printf(sc->sc_dev, - "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d\n", - __func__, ni, bf, - tid->axq_depth, - tid->hwq_depth, - tid->bar_wait); - device_printf(sc->sc_dev, - "%s: node %p: tid %d: txq_depth=%d, " - "txq_aggr_depth=%d, sched=%d, paused=%d, " - "hwq_depth=%d, incomp=%d, baw_head=%d, " - "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", - __func__, ni, tid->tid, txq->axq_depth, - txq->axq_aggr_depth, tid->sched, tid->paused, - tid->hwq_depth, tid->incomp, tid->baw_head, - tid->baw_tail, tap == NULL ? -1 : tap->txa_start, - ni->ni_txseqs[tid->tid]); - - /* XXX Dump the frame, see what it is? */ - ieee80211_dump_pkt(ni->ni_ic, - mtod(bf->bf_m, const uint8_t *), - bf->bf_m->m_len, 0, -1); - + ath_tx_tid_drain_print(sc, an, tid, bf); t = 1; } + ATH_TXQ_REMOVE(tid, bf, bf_list); + ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf); + } - /* - * If the current TID is running AMPDU, update - * the BAW. - */ - if (ath_tx_ampdu_running(sc, an, tid->tid) && - bf->bf_state.bfs_dobaw) { - /* - * Only remove the frame from the BAW if it's - * been transmitted at least once; this means - * the frame was in the BAW to begin with. - */ - if (bf->bf_state.bfs_retries > 0) { - ath_tx_update_baw(sc, an, tid, bf); - bf->bf_state.bfs_dobaw = 0; - } - /* - * This has become a non-fatal error now - */ - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, - "%s: wasn't added: seqno %d\n", - __func__, SEQNO(bf->bf_state.bfs_seqno)); + /* And now, drain the filtered frame queue */ + t = 0; + for (;;) { + bf = TAILQ_FIRST(&tid->filtq.axq_q); + if (bf == NULL) + break; + + if (t == 0) { + ath_tx_tid_drain_print(sc, an, tid, bf); + t = 1; } - ATH_TXQ_REMOVE(tid, bf, bf_list); - TAILQ_INSERT_TAIL(bf_cq, bf, bf_list); + + ATH_TXQ_REMOVE(&tid->filtq, bf, bf_list); + ath_tx_tid_drain_pkt(sc, an, tid, bf_cq, bf); } /* @@ -3134,9 +3388,29 @@ ath_tx_normal_comp(struct ath_softc *sc, __func__, bf, fail, atid->hwq_depth - 1); atid->hwq_depth--; + + if (atid->isfiltered) + device_printf(sc->sc_dev, "%s: isfiltered=1, normal_comp?\n", + __func__); + if (atid->hwq_depth < 0) device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); + + /* + * If the queue is filtered, potentially mark it as complete + * and reschedule it as needed. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* @@ -3209,6 +3483,16 @@ ath_tx_tid_cleanup(struct ath_softc *sc, ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); /* + * Move the filtered frames to the TX queue, before + * we run off and discard/process things. + */ + /* XXX this is really quite inefficient */ + while ((bf = TAILQ_LAST(&atid->filtq.axq_q, ath_bufhead_s)) != NULL) { + ATH_TXQ_REMOVE(&atid->filtq, bf, bf_list); + ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); + } + + /* * Update the frames in the software TX queue: * * + Discard retry frames in the queue @@ -3287,23 +3571,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, } } -static void -ath_tx_set_retry(struct ath_softc *sc, struct ath_buf *bf) -{ - struct ieee80211_frame *wh; - - wh = mtod(bf->bf_m, struct ieee80211_frame *); - /* Only update/resync if needed */ - if (bf->bf_state.bfs_isretried == 0) { - wh->i_fc[1] |= IEEE80211_FC1_RETRY; - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, - BUS_DMASYNC_PREWRITE); - } - sc->sc_stats.ast_tx_swretries++; - bf->bf_state.bfs_isretried = 1; - bf->bf_state.bfs_retries ++; -} - static struct ath_buf * ath_tx_retry_clone(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, struct ath_buf *bf) @@ -3352,6 +3619,7 @@ ath_tx_retry_clone(struct ath_softc *sc, bf->bf_m = NULL; bf->bf_node = NULL; ath_freebuf(sc, bf); + return nbf; } @@ -3433,6 +3701,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft * body. */ ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swretries++; /* * Insert this at the head of the queue, so it's @@ -3468,6 +3737,7 @@ ath_tx_retry_subframe(struct ath_softc * /* XXX clr11naggr should be done for all subframes */ ath_hal_clr11n_aggr(sc->sc_ah, bf->bf_desc); ath_hal_set11nburstduration(sc->sc_ah, bf->bf_desc, 0); + /* ath_hal_set11n_virtualmorefrag(sc->sc_ah, bf->bf_desc, 0); */ /* @@ -3504,6 +3774,7 @@ ath_tx_retry_subframe(struct ath_softc * } ath_tx_set_retry(sc, bf); + sc->sc_stats.ast_tx_swretries++; bf->bf_next = NULL; /* Just to make sure */ /* Clear the aggregate state */ @@ -3590,6 +3861,7 @@ ath_tx_comp_aggr_error(struct ath_softc */ if (ath_tx_tid_bar_tx_ready(sc, tid)) ath_tx_tid_bar_tx(sc, tid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); /* Complete frames which errored out */ @@ -3633,8 +3905,10 @@ ath_tx_comp_cleanup_aggr(struct ath_soft } /* Send BAR if required */ + /* XXX why would we send a BAR when transitioning to non-aggregation? */ if (ath_tx_tid_bar_tx_ready(sc, atid)) ath_tx_tid_bar_tx(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); /* Handle frame completion */ @@ -3681,6 +3955,9 @@ ath_tx_aggr_comp_aggr(struct ath_softc * DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", __func__, atid->hwq_depth); + TAILQ_INIT(&bf_q); + TAILQ_INIT(&bf_cq); + /* The TID state is kept behind the TXQ lock */ ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); @@ -3690,15 +3967,69 @@ ath_tx_aggr_comp_aggr(struct ath_softc * __func__, atid->hwq_depth); /* + * If the TID is filtered, handle completing the filter + * transition before potentially kicking it to the cleanup + * function. + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * Punt cleanup to the relevant function, not our problem now */ if (atid->cleanup_inprogress) { + if (atid->isfiltered) + device_printf(sc->sc_dev, + "%s: isfiltered=1, normal_comp?\n", + __func__); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); ath_tx_comp_cleanup_aggr(sc, bf_first); return; } /* + * If the frame is filtered, transition to filtered frame + * mode and add this to the filtered frame list. + * + * XXX TODO: figure out how this interoperates with + * BAR, pause and cleanup states. + */ + if ((ts.ts_status & HAL_TXERR_FILT) || + (ts.ts_status != 0 && atid->isfiltered)) { + if (fail != 0) + device_printf(sc->sc_dev, + "%s: isfiltered=1, fail=%d\n", __func__, fail); + ath_tx_tid_filt_comp_aggr(sc, atid, bf_first, &bf_cq); + + /* Remove from BAW */ + TAILQ_FOREACH_SAFE(bf, &bf_cq, bf_list, bf_next) { + if (bf->bf_state.bfs_addedbaw) + drops++; + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, + SEQNO(bf->bf_state.bfs_seqno)); + } + bf->bf_state.bfs_dobaw = 0; + } + /* + * If any intermediate frames in the BAW were dropped when + * handling filtering things, send a BAR. + */ + if (drops) + ath_tx_tid_bar_suspend(sc, atid); + + /* + * Finish up by sending a BAR if required and freeing + * the frames outside of the TX lock. + */ + goto finish_send_bar; + } + + /* * Take a copy; this may be needed -after- bf_first * has been completed and freed. */ @@ -3725,8 +4056,6 @@ ath_tx_aggr_comp_aggr(struct ath_softc * return; } - TAILQ_INIT(&bf_q); - TAILQ_INIT(&bf_cq); tap = ath_tx_get_tx_tid(an, tid); /* @@ -3883,6 +4212,21 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ath_tx_tid_sched(sc, atid); /* + * If the queue is filtered, re-schedule as required. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + +finish_send_bar: + + /* * Send BAR if required */ if (ath_tx_tid_bar_tx_ready(sc, atid)) @@ -3912,6 +4256,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc int tid = bf->bf_state.bfs_tid; struct ath_tid *atid = &an->an_tid[tid]; struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + int drops = 0; /* * Update rate control status here, before we possibly @@ -3946,12 +4291,24 @@ ath_tx_aggr_comp_unaggr(struct ath_softc __func__, atid->hwq_depth); /* + * If the TID is filtered, handle completing the filter + * transition before potentially kicking it to the cleanup + * function. + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * If a cleanup is in progress, punt to comp_cleanup; * rather than handling it here. It's thus their * responsibility to clean up, call the completion * function in net80211, etc. */ if (atid->cleanup_inprogress) { + if (atid->isfiltered) + device_printf(sc->sc_dev, + "%s: isfiltered=1, normal_comp?\n", + __func__); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: cleanup_unaggr\n", __func__); @@ -3960,6 +4317,66 @@ ath_tx_aggr_comp_unaggr(struct ath_softc } /* + * XXX TODO: how does cleanup, BAR and filtered frame handling + * overlap? + * + * If the frame is filtered OR if it's any failure but + * the TID is filtered, the frame must be added to the + * filtered frame list. + * + * However - a busy buffer can't be added to the filtered + * list as it will end up being recycled without having + * been made available for the hardware. + */ + if ((ts->ts_status & HAL_TXERR_FILT) || + (ts->ts_status != 0 && atid->isfiltered)) { + int freeframe; + + if (fail != 0) + device_printf(sc->sc_dev, + "%s: isfiltered=1, fail=%d\n", + __func__, + fail); + freeframe = ath_tx_tid_filt_comp_single(sc, atid, bf); + if (freeframe) { + /* Remove from BAW */ + if (bf->bf_state.bfs_addedbaw) + drops++; + if (bf->bf_state.bfs_dobaw) { + ath_tx_update_baw(sc, an, atid, bf); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } + bf->bf_state.bfs_dobaw = 0; + } + + /* + * If the frame couldn't be filtered, treat it as a drop and + * prepare to send a BAR. + */ + if (freeframe && drops) + ath_tx_tid_bar_suspend(sc, atid); + + /* + * Send BAR if required + */ + if (ath_tx_tid_bar_tx_ready(sc, atid)) + ath_tx_tid_bar_tx(sc, atid); + + ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + /* + * If freeframe is set, then the frame couldn't be + * cloned and bf is still valid. Just complete/free it. + */ + if (freeframe) + ath_tx_default_comp(sc, bf, fail); + + + return; + } + /* * Don't bother with the retry check if all frames * are being failed (eg during queue deletion.) */ @@ -3987,6 +4404,19 @@ ath_tx_aggr_comp_unaggr(struct ath_softc } /* + * If the queue is filtered, re-schedule as required. + * + * This is required as there may be a subsequent TX descriptor + * for this end-node that has CLRDMASK set, so it's quite possible + * that a filtered frame will be followed by a non-filtered + * (complete or otherwise) frame. + * + * XXX should we do this before we complete the frame? + */ + if (atid->isfiltered) + ath_tx_tid_filt_comp_complete(sc, atid); + + /* * Send BAR if required */ if (ath_tx_tid_bar_tx_ready(sc, atid)) Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue Sep 18 09:15:32 2012 (r240638) +++ head/sys/dev/ath/if_athioctl.h Tue Sep 18 10:14:17 2012 (r240639) @@ -162,8 +162,9 @@ struct ath_stats { u_int32_t ast_tx_aggr_fail; /* aggregate TX failed */ u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ u_int32_t ast_rx_keymiss; + u_int32_t ast_tx_swfiltered; - u_int32_t ast_pad[16]; + u_int32_t ast_pad[15]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 10:37:40 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D500B106564A; Tue, 18 Sep 2012 10:37:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 396C78FC08; Tue, 18 Sep 2012 10:37:40 +0000 (UTC) Received: from alph.allbsd.org (p1137-ipbf1505funabasi.chiba.ocn.ne.jp [118.7.212.137]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id q8IAbNoJ030011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Sep 2012 19:37:33 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id q8IAbN8L069206; Tue, 18 Sep 2012 19:37:23 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 18 Sep 2012 19:36:50 +0900 (JST) Message-Id: <20120918.193650.1501104806829364201.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <5058036F.1010104@FreeBSD.org> References: <201209180233.q8I2XNs3022364@svn.freebsd.org> <5058036F.1010104@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Sep_18_19_36_50_2012_640)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Tue, 18 Sep 2012 19:37:33 +0900 (JST) X-Spam-Status: No, score=-96.8 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT, RCVD_IN_RP_RNBL, SAMEHELOBY2HOP, USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, bjk@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 10:37:41 -0000 ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <5058036F.1010104@FreeBSD.org>: do> On 09/17/2012 19:33, Benjamin Kaduk wrote: do> > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, do> do> We generally don't do this at all absent other changes. do> do> We definitely don't make whitespace-only changes mixed in with other do> changes, as it makes the diff too hard to read. Please read docs/157452 before blaming the commit. And I do not think adding commas is not making the diff hard to read. -- Hiroki ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAlBYTsIACgkQTyzT2CeTzy1SAwCgyC212UjWPexiuf9SCCfqf70Z 7WcAoJTVb4mY9yeFwfflLDvWw/7uXqFR =d/fz -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Sep_18_19_36_50_2012_640)---- From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 10:52:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34FDA1065680; Tue, 18 Sep 2012 10:52:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2048D8FC0A; Tue, 18 Sep 2012 10:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAqkHO074912; Tue, 18 Sep 2012 10:52:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAqkT1074910; Tue, 18 Sep 2012 10:52:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181052.q8IAqkT1074910@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 10:52: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: r240640 - 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: Tue, 18 Sep 2012 10:52:47 -0000 Author: glebius Date: Tue Sep 18 10:52:46 2012 New Revision: 240640 URL: http://svn.freebsd.org/changeset/base/240640 Log: - Add $FreeBSD$ to allow modifications to this file. - Move $OpenBSD$ to a more standard place. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 10:14:17 2012 (r240639) +++ head/sys/net/pfvar.h Tue Sep 18 10:52:46 2012 (r240640) @@ -1,5 +1,3 @@ -/* $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ - /* * Copyright (c) 2001 Daniel Hartmeier * All rights reserved. @@ -28,6 +26,8 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ + * $FreeBSD$ */ #ifndef _NET_PFVAR_H_ From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 10:54:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC3B21065672; Tue, 18 Sep 2012 10:54:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7B78FC1B; Tue, 18 Sep 2012 10:54:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IAsuFq075255; Tue, 18 Sep 2012 10:54:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IAsug5075250; Tue, 18 Sep 2012 10:54:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181054.q8IAsug5075250@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 10:54: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: r240641 - in head/sys: net netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 10:54:56 -0000 Author: glebius Date: Tue Sep 18 10:54:56 2012 New Revision: 240641 URL: http://svn.freebsd.org/changeset/base/240641 Log: Make ruleset anchors in pf(4) reentrant. We've got two problems here: 1) Ruleset parser uses a global variable for anchor stack. 2) When processing a wildcard anchor, matching anchors are marked. To fix the first one: o Allocate anchor processing stack on stack. To make this allocation as small as possible, following measures taken: - Maximum stack size reduced from 64 to 32. - The struct pf_anchor_stackframe trimmed by one pointer - parent. We can always obtain the parent via the rule pointer. - When pf_test_rule() calls pf_get_translation(), the former lends its stack to the latter, to avoid recursive allocation 32 entries. The second one appeared more tricky. The code, that marks anchors was added in OpenBSD rev. 1.516 of pf.c. According to commit log, the idea is to enable the "quick" keyword on an anchor rule. The feature isn't documented anywhere. The most obscure part of the 1.516 was that code examines the "match" mark on a just processed child, which couldn't be put here by current frame. Since this wasn't documented even in the commit message and functionality of this is not clear to me, I decided to drop this examination for now. The rest of 1.516 is redone in a thread safe manner - the mark isn't put on the anchor itself, but on current stack frame. To avoid growing stack frame, we utilize LSB from the rule pointer, relying on kernel malloc(9) returning pointer aligned addresses. Discussed with: dhartmei Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_lb.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/net/pfvar.h Tue Sep 18 10:54:56 2012 (r240641) @@ -989,7 +989,7 @@ struct pf_anchor { char path[MAXPATHLEN]; struct pf_ruleset ruleset; int refcnt; /* anchor rules */ - int match; + int match; /* XXX: used for pfctl black magic */ }; RB_PROTOTYPE(pf_anchor_global, pf_anchor, entry_global, pf_anchor_compare); RB_PROTOTYPE(pf_anchor_node, pf_anchor, entry_node, pf_anchor_compare); @@ -1019,6 +1019,8 @@ RB_PROTOTYPE(pf_anchor_node, pf_anchor, PFR_TFLAG_REFDANCHOR | \ PFR_TFLAG_COUNTERS) +struct pf_anchor_stackframe; + struct pfr_table { char pfrt_anchor[MAXPATHLEN]; char pfrt_name[PF_TABLE_NAME_SIZE]; @@ -1938,11 +1940,12 @@ int pf_osfp_match(struct pf_osfp_enlist #ifdef _KERNEL void pf_print_host(struct pf_addr *, u_int16_t, u_int8_t); -void pf_step_into_anchor(int *, struct pf_ruleset **, int, - struct pf_rule **, struct pf_rule **, int *); -int pf_step_out_of_anchor(int *, struct pf_ruleset **, - int, struct pf_rule **, struct pf_rule **, - int *); +void pf_step_into_anchor(struct pf_anchor_stackframe *, int *, + struct pf_ruleset **, int, struct pf_rule **, + struct pf_rule **, int *); +int pf_step_out_of_anchor(struct pf_anchor_stackframe *, int *, + struct pf_ruleset **, int, struct pf_rule **, + struct pf_rule **, int *); int pf_map_addr(u_int8_t, struct pf_rule *, struct pf_addr *, struct pf_addr *, @@ -1951,7 +1954,7 @@ struct pf_rule *pf_get_translation(stru int, int, struct pfi_kif *, struct pf_src_node **, struct pf_state_key **, struct pf_state_key **, struct pf_addr *, struct pf_addr *, - u_int16_t, u_int16_t); + uint16_t, uint16_t, struct pf_anchor_stackframe *); struct pf_state_key *pf_state_key_setup(struct pf_pdesc *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/netpfil/pf/pf.c Tue Sep 18 10:54:56 2012 (r240641) @@ -127,15 +127,6 @@ VNET_DEFINE(int, pf_tcp_secret_init); VNET_DEFINE(int, pf_tcp_iss_off); #define V_pf_tcp_iss_off VNET(pf_tcp_iss_off) -struct pf_anchor_stackframe { - struct pf_ruleset *rs; - struct pf_rule *r; - struct pf_anchor_node *parent; - struct pf_anchor *child; -}; -VNET_DEFINE(struct pf_anchor_stackframe, pf_anchor_stack[64]); -#define V_pf_anchor_stack VNET(pf_anchor_stack) - /* * Queue for pf_intr() sends. */ @@ -2461,37 +2452,56 @@ pf_tag_packet(struct mbuf *m, struct pf_ return (0); } +#define PF_ANCHOR_STACKSIZE 32 +struct pf_anchor_stackframe { + struct pf_ruleset *rs; + struct pf_rule *r; /* XXX: + match bit */ + struct pf_anchor *child; +}; + +/* + * XXX: We rely on malloc(9) returning pointer aligned addresses. + */ +#define PF_ANCHORSTACK_MATCH 0x00000001 +#define PF_ANCHORSTACK_MASK (PF_ANCHORSTACK_MATCH) + +#define PF_ANCHOR_MATCH(f) ((uintptr_t)(f)->r & PF_ANCHORSTACK_MATCH) +#define PF_ANCHOR_RULE(f) (struct pf_rule *) \ + ((uintptr_t)(f)->r & ~PF_ANCHORSTACK_MASK) +#define PF_ANCHOR_SET_MATCH(f) do { (f)->r = (void *) \ + ((uintptr_t)(f)->r | PF_ANCHORSTACK_MATCH); \ +} while (0) + void -pf_step_into_anchor(int *depth, struct pf_ruleset **rs, int n, - struct pf_rule **r, struct pf_rule **a, int *match) +pf_step_into_anchor(struct pf_anchor_stackframe *stack, int *depth, + struct pf_ruleset **rs, int n, struct pf_rule **r, struct pf_rule **a, + int *match) { struct pf_anchor_stackframe *f; PF_RULES_RASSERT(); - (*r)->anchor->match = 0; if (match) *match = 0; - if (*depth >= sizeof(V_pf_anchor_stack) / - sizeof(V_pf_anchor_stack[0])) { - printf("pf_step_into_anchor: stack overflow\n"); + if (*depth >= PF_ANCHOR_STACKSIZE) { + printf("%s: anchor stack overflow on %s\n", + __func__, (*r)->anchor->name); *r = TAILQ_NEXT(*r, entries); return; } else if (*depth == 0 && a != NULL) *a = *r; - f = V_pf_anchor_stack + (*depth)++; + f = stack + (*depth)++; f->rs = *rs; f->r = *r; if ((*r)->anchor_wildcard) { - f->parent = &(*r)->anchor->children; - if ((f->child = RB_MIN(pf_anchor_node, f->parent)) == - NULL) { + struct pf_anchor_node *parent = &(*r)->anchor->children; + + if ((f->child = RB_MIN(pf_anchor_node, parent)) == NULL) { *r = NULL; return; } *rs = &f->child->ruleset; } else { - f->parent = NULL; f->child = NULL; *rs = &(*r)->anchor->ruleset; } @@ -2499,10 +2509,12 @@ pf_step_into_anchor(int *depth, struct p } int -pf_step_out_of_anchor(int *depth, struct pf_ruleset **rs, int n, - struct pf_rule **r, struct pf_rule **a, int *match) +pf_step_out_of_anchor(struct pf_anchor_stackframe *stack, int *depth, + struct pf_ruleset **rs, int n, struct pf_rule **r, struct pf_rule **a, + int *match) { struct pf_anchor_stackframe *f; + struct pf_rule *fr; int quick = 0; PF_RULES_RASSERT(); @@ -2510,14 +2522,26 @@ pf_step_out_of_anchor(int *depth, struct do { if (*depth <= 0) break; - f = V_pf_anchor_stack + *depth - 1; - if (f->parent != NULL && f->child != NULL) { - if (f->child->match || - (match != NULL && *match)) { - f->r->anchor->match = 1; + f = stack + *depth - 1; + fr = PF_ANCHOR_RULE(f); + if (f->child != NULL) { + struct pf_anchor_node *parent; + + /* + * This block traverses through + * a wildcard anchor. + */ + parent = &fr->anchor->children; + if (match != NULL && *match) { + /* + * If any of "*" matched, then + * "foo/ *" matched, mark frame + * appropriately. + */ + PF_ANCHOR_SET_MATCH(f); *match = 0; } - f->child = RB_NEXT(pf_anchor_node, f->parent, f->child); + f->child = RB_NEXT(pf_anchor_node, parent, f->child); if (f->child != NULL) { *rs = &f->child->ruleset; *r = TAILQ_FIRST((*rs)->rules[n].active.ptr); @@ -2531,9 +2555,9 @@ pf_step_out_of_anchor(int *depth, struct if (*depth == 0 && a != NULL) *a = NULL; *rs = f->rs; - if (f->r->anchor->match || (match != NULL && *match)) - quick = f->r->quick; - *r = TAILQ_NEXT(f->r, entries); + if (PF_ANCHOR_MATCH(f) || (match != NULL && *match)) + quick = fr->quick; + *r = TAILQ_NEXT(fr, entries); } while (*r == NULL); return (quick); @@ -2887,6 +2911,7 @@ pf_test_rule(struct pf_rule **rm, struct u_int16_t sport = 0, dport = 0; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; + struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; PF_RULES_RASSERT(); @@ -2950,7 +2975,7 @@ pf_test_rule(struct pf_rule **rm, struct /* check packet for BINAT/NAT/RDR */ if ((nr = pf_get_translation(pd, m, off, direction, kif, &nsn, &sk, - &nk, saddr, daddr, sport, dport)) != NULL) { + &nk, saddr, daddr, sport, dport, anchor_stack)) != NULL) { KASSERT(sk != NULL, ("%s: null sk", __func__)); KASSERT(nk != NULL, ("%s: null nk", __func__)); @@ -3150,11 +3175,12 @@ pf_test_rule(struct pf_rule **rm, struct break; r = TAILQ_NEXT(r, entries); } else - pf_step_into_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, + &match); } - if (r == NULL && pf_step_out_of_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match)) + if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, &match)) break; } r = *rm; @@ -3527,6 +3553,7 @@ pf_test_fragment(struct pf_rule **rm, in int tag = -1; int asd = 0; int match = 0; + struct pf_anchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; PF_RULES_RASSERT(); @@ -3577,11 +3604,12 @@ pf_test_fragment(struct pf_rule **rm, in break; r = TAILQ_NEXT(r, entries); } else - pf_step_into_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, + &match); } - if (r == NULL && pf_step_out_of_anchor(&asd, &ruleset, - PF_RULESET_FILTER, &r, &a, &match)) + if (r == NULL && pf_step_out_of_anchor(anchor_stack, &asd, + &ruleset, PF_RULESET_FILTER, &r, &a, &match)) break; } r = *rm; Modified: head/sys/netpfil/pf/pf_lb.c ============================================================================== --- head/sys/netpfil/pf/pf_lb.c Tue Sep 18 10:52:46 2012 (r240640) +++ head/sys/netpfil/pf/pf_lb.c Tue Sep 18 10:54:56 2012 (r240641) @@ -58,7 +58,7 @@ static void pf_hash(struct pf_addr *, static struct pf_rule *pf_match_translation(struct pf_pdesc *, struct mbuf *, int, int, struct pfi_kif *, struct pf_addr *, u_int16_t, struct pf_addr *, - u_int16_t, int); + uint16_t, int, struct pf_anchor_stackframe *); static int pf_get_sport(sa_family_t, u_int8_t, struct pf_rule *, struct pf_addr *, struct pf_addr *, u_int16_t, struct pf_addr *, u_int16_t*, u_int16_t, u_int16_t, @@ -124,7 +124,8 @@ pf_hash(struct pf_addr *inaddr, struct p static struct pf_rule * pf_match_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, struct pfi_kif *kif, struct pf_addr *saddr, u_int16_t sport, - struct pf_addr *daddr, u_int16_t dport, int rs_num) + struct pf_addr *daddr, uint16_t dport, int rs_num, + struct pf_anchor_stackframe *anchor_stack) { struct pf_rule *r, *rm = NULL; struct pf_ruleset *ruleset = NULL; @@ -189,12 +190,12 @@ pf_match_translation(struct pf_pdesc *pd if (r->anchor == NULL) { rm = r; } else - pf_step_into_anchor(&asd, &ruleset, rs_num, - &r, NULL, NULL); + pf_step_into_anchor(anchor_stack, &asd, + &ruleset, rs_num, &r, NULL, NULL); } if (r == NULL) - pf_step_out_of_anchor(&asd, &ruleset, rs_num, &r, - NULL, NULL); + pf_step_out_of_anchor(anchor_stack, &asd, &ruleset, + rs_num, &r, NULL, NULL); } if (tag > 0 && pf_tag_packet(m, pd, tag)) @@ -499,7 +500,7 @@ pf_get_translation(struct pf_pdesc *pd, struct pfi_kif *kif, struct pf_src_node **sn, struct pf_state_key **skp, struct pf_state_key **nkp, struct pf_addr *saddr, struct pf_addr *daddr, - u_int16_t sport, u_int16_t dport) + uint16_t sport, uint16_t dport, struct pf_anchor_stackframe *anchor_stack) { struct pf_rule *r = NULL; struct pf_addr *naddr; @@ -511,16 +512,18 @@ pf_get_translation(struct pf_pdesc *pd, if (direction == PF_OUT) { r = pf_match_translation(pd, m, off, direction, kif, saddr, - sport, daddr, dport, PF_RULESET_BINAT); + sport, daddr, dport, PF_RULESET_BINAT, anchor_stack); if (r == NULL) r = pf_match_translation(pd, m, off, direction, kif, - saddr, sport, daddr, dport, PF_RULESET_NAT); + saddr, sport, daddr, dport, PF_RULESET_NAT, + anchor_stack); } else { r = pf_match_translation(pd, m, off, direction, kif, saddr, - sport, daddr, dport, PF_RULESET_RDR); + sport, daddr, dport, PF_RULESET_RDR, anchor_stack); if (r == NULL) r = pf_match_translation(pd, m, off, direction, kif, - saddr, sport, daddr, dport, PF_RULESET_BINAT); + saddr, sport, daddr, dport, PF_RULESET_BINAT, + anchor_stack); } if (r == NULL) From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 11:07:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 264121065672; Tue, 18 Sep 2012 11:07:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 103BD8FC14; Tue, 18 Sep 2012 11:07:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IB7JBf077204; Tue, 18 Sep 2012 11:07:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IB7J1C077198; Tue, 18 Sep 2012 11:07:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181107.q8IB7J1C077198@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 11:07: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: r240642 - in head: share/man/man4 sys/conf sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 11:07:20 -0000 Author: glebius Date: Tue Sep 18 11:07:19 2012 New Revision: 240642 URL: http://svn.freebsd.org/changeset/base/240642 Log: Provide kernel compile time option to make pf(4) default rule to drop. This is important to secure a small timeframe at boot time, when network is already configured, but pf(4) is not yet. PR: kern/171622 Submitted by: Olivier Cochard-LabbИ Modified: head/share/man/man4/pf.4 head/sys/conf/NOTES head/sys/conf/options head/sys/netpfil/pf/pf_ioctl.c Modified: head/share/man/man4/pf.4 ============================================================================== --- head/share/man/man4/pf.4 Tue Sep 18 10:54:56 2012 (r240641) +++ head/share/man/man4/pf.4 Tue Sep 18 11:07:19 2012 (r240642) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 29 2012 +.Dd September 18 2012 .Dt PF 4 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nd packet filter .Sh SYNOPSIS .Cd "device pf" +.Cd "options PF_DEFAULT_TO_DROP" .Sh DESCRIPTION Packet filtering takes place in the kernel. A pseudo-device, @@ -94,6 +95,15 @@ Read only .Xr sysctl 8 variables with matching names are provided to obtain current values at runtime. +.Sh KERNEL OPTIONS +The following options in the kernel configuration file are related to +.Nm +operation: +.Pp +.Bl -tag -width ".Dv PF_DEFAULT_TO_DROP" -compact +.It Dv PF_DEFAULT_TO_DROP +Change default policy to drop by default +.El .Sh IOCTL INTERFACE .Nm supports the following Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/conf/NOTES Tue Sep 18 11:07:19 2012 (r240642) @@ -918,6 +918,8 @@ device lagg # packets without touching the TTL). This can be useful to hide firewalls # from traceroute and similar tools. # +# PF_DEFAULT_TO_DROP causes the default pf(4) rule to deny everything. +# # TCPDEBUG enables code which keeps traces of the TCP state machine # for sockets with the SO_DEBUG option set, which can then be examined # using the trpt(8) utility. @@ -937,6 +939,7 @@ options IPFILTER_LOG #ipfilter logging options IPFILTER_LOOKUP #ipfilter pools options IPFILTER_DEFAULT_BLOCK #block all packets by default options IPSTEALTH #support for stealth forwarding +options PF_DEFAULT_TO_DROP #drop everything by default options TCPDEBUG options RADIX_MPATH Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/conf/options Tue Sep 18 11:07:19 2012 (r240642) @@ -430,6 +430,7 @@ NCP NETATALK opt_atalk.h NFSLOCKD PCBGROUP opt_pcbgroup.h +PF_DEFAULT_TO_DROP opt_pf.h RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h SLIP_IFF_OPTS opt_slip.h Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 10:54:56 2012 (r240641) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Sep 18 11:07:19 2012 (r240642) @@ -216,7 +216,11 @@ pfattach(void) /* default rule should never be garbage collected */ V_pf_default_rule.entries.tqe_prev = &V_pf_default_rule.entries.tqe_next; +#ifdef PF_DEFAULT_TO_DROP + V_pf_default_rule.action = PF_DROP; +#else V_pf_default_rule.action = PF_PASS; +#endif V_pf_default_rule.nr = -1; V_pf_default_rule.rtableid = -1; From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 12:21:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 329061065672; Tue, 18 Sep 2012 12:21:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7628FC1A; Tue, 18 Sep 2012 12:21:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICLWbI088981; Tue, 18 Sep 2012 12:21:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICLWmq088979; Tue, 18 Sep 2012 12:21:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181221.q8ICLWmq088979@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 12:21: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: r240644 - 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: Tue, 18 Sep 2012 12:21:33 -0000 Author: glebius Date: Tue Sep 18 12:21:32 2012 New Revision: 240644 URL: http://svn.freebsd.org/changeset/base/240644 Log: Fix build, pass the pointy hat please. Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Tue Sep 18 11:25:04 2012 (r240643) +++ head/sys/net/pfvar.h Tue Sep 18 12:21:32 2012 (r240644) @@ -26,7 +26,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ */ + * $OpenBSD: pfvar.h,v 1.282 2009/01/29 15:12:28 pyr Exp $ * $FreeBSD$ */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 12:25:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68211106564A; Tue, 18 Sep 2012 12:25:15 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399428FC14; Tue, 18 Sep 2012 12:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICPFM0089603; Tue, 18 Sep 2012 12:25:15 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICPF3r089600; Tue, 18 Sep 2012 12:25:15 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209181225.q8ICPF3r089600@svn.freebsd.org> From: Andrey Zonov Date: Tue, 18 Sep 2012 12:25: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: r240645 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 12:25:15 -0000 Author: zont Date: Tue Sep 18 12:25:14 2012 New Revision: 240645 URL: http://svn.freebsd.org/changeset/base/240645 Log: - Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively. Approved by: kib (mentor) MFC after: 1 week Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Tue Sep 18 12:21:32 2012 (r240644) +++ head/bin/ps/keyword.c Tue Sep 18 12:25:14 2012 (r240645) @@ -79,6 +79,7 @@ static VAR var[] = { {"cow", "COW", NULL, 0, kvar, KOFF(ki_cow), UINT, "u", 0}, {"cpu", "CPU", NULL, 0, kvar, KOFF(ki_estcpu), UINT, "d", 0}, {"cputime", "", "time", 0, NULL, 0, CHAR, NULL, 0}, + {"dsiz", "DSIZ", NULL, 0, kvar, KOFF(ki_dsize), PGTOK, "ld", 0}, {"egid", "", "gid", 0, NULL, 0, CHAR, NULL, 0}, {"egroup", "", "group", 0, NULL, 0, CHAR, NULL, 0}, {"emul", "EMUL", NULL, LJUST, emulname, 0, CHAR, NULL, 0}, @@ -141,6 +142,7 @@ static VAR var[] = { UINT, "x", 0}, {"sigmask", "BLOCKED", NULL, 0, kvar, KOFF(ki_sigmask), UINT, "x", 0}, {"sl", "SL", NULL, INF127, kvar, KOFF(ki_slptime), UINT, "d", 0}, + {"ssiz", "SSIZ", NULL, 0, kvar, KOFF(ki_ssize), PGTOK, "ld", 0}, {"start", "STARTED", NULL, LJUST|USER, started, 0, CHAR, NULL, 0}, {"stat", "", "state", 0, NULL, 0, CHAR, NULL, 0}, {"state", "STAT", NULL, LJUST, state, 0, CHAR, NULL, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Sep 18 12:21:32 2012 (r240644) +++ head/bin/ps/ps.1 Tue Sep 18 12:25:14 2012 (r240645) @@ -500,6 +500,8 @@ command and arguments number of copy-on-write faults .It Cm cpu short-term CPU usage factor (for scheduling) +.It Cm dsiz +data size (in Kbytes) .It Cm emul system-call emulation environment .It Cm etime @@ -610,6 +612,8 @@ blocked signals (alias .Cm blocked ) .It Cm sl sleep time (in seconds; 127 = infinity) +.It Cm ssiz +stack size (in Kbytes) .It Cm start time started .It Cm state From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 12:34:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 607DC106566B; Tue, 18 Sep 2012 12:34:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6B48FC16; Tue, 18 Sep 2012 12:34:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8ICYa9A091113; Tue, 18 Sep 2012 12:34:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8ICYaFB091109; Tue, 18 Sep 2012 12:34:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209181234.q8ICYaFB091109@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 12:34: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: r240646 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 12:34:36 -0000 Author: glebius Date: Tue Sep 18 12:34:35 2012 New Revision: 240646 URL: http://svn.freebsd.org/changeset/base/240646 Log: Do more than r236298 did in the projects/pf branch: use M_NOWAIT in altq_add() and its descendants. Currently altq(4) in FreeBSD is configured via pf(4) ioctls, which can't configure altq(4) w/o holding locks. Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive NULL from malloc(9), so change is mostly mechanical. While here, utilize M_ZERO instead of bzero(). A large redesign needed to achieve M_WAITOK usage when configuring altq(4). Or an alternative (not pf(4)) configuration interface should be implemented. Reported by: pluknet Modified: head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_hfsc.c Tue Sep 18 12:34:35 2012 (r240646) @@ -400,15 +400,13 @@ hfsc_class_create(struct hfsc_if *hif, s } #endif - cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct hfsc_class)); - cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl->cl_q == NULL) goto err_ret; - bzero(cl->cl_q, sizeof(class_queue_t)); cl->cl_actc = actlist_alloc(); if (cl->cl_actc == NULL) @@ -466,7 +464,7 @@ hfsc_class_create(struct hfsc_if *hif, s if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) { cl->cl_rsc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_rsc == NULL) goto err_ret; sc2isc(rsc, cl->cl_rsc); @@ -475,7 +473,7 @@ hfsc_class_create(struct hfsc_if *hif, s } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) { cl->cl_fsc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_fsc == NULL) goto err_ret; sc2isc(fsc, cl->cl_fsc); @@ -483,7 +481,7 @@ hfsc_class_create(struct hfsc_if *hif, s } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) { cl->cl_usc = malloc(sizeof(struct internal_sc), - M_DEVBUF, M_WAITOK); + M_DEVBUF, M_NOWAIT); if (cl->cl_usc == NULL) goto err_ret; sc2isc(usc, cl->cl_usc); Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_priq.c Tue Sep 18 12:34:35 2012 (r240646) @@ -316,17 +316,15 @@ priq_class_create(struct priq_if *pif, i red_destroy(cl->cl_red); #endif } else { - cl = malloc(sizeof(struct priq_class), - M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct priq_class), M_DEVBUF, + M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct priq_class)); - cl->cl_q = malloc(sizeof(class_queue_t), - M_DEVBUF, M_WAITOK); + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, + M_NOWAIT | M_ZERO); if (cl->cl_q == NULL) goto err_ret; - bzero(cl->cl_q, sizeof(class_queue_t)); } pif->pif_classes[pri] = cl; Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Tue Sep 18 12:25:14 2012 (r240645) +++ head/sys/contrib/altq/altq/altq_rmclass.c Tue Sep 18 12:34:35 2012 (r240646) @@ -218,19 +218,15 @@ rmc_newclass(int pri, struct rm_ifdat *i } #endif - cl = malloc(sizeof(struct rm_class), - M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct rm_class), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl == NULL) return (NULL); - bzero(cl, sizeof(struct rm_class)); CALLOUT_INIT(&cl->callout_); - cl->q_ = malloc(sizeof(class_queue_t), - M_DEVBUF, M_WAITOK); + cl->q_ = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (cl->q_ == NULL) { free(cl, M_DEVBUF); return (NULL); } - bzero(cl->q_, sizeof(class_queue_t)); /* * Class initialization. From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 12:53:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEA831065670; Tue, 18 Sep 2012 12:53:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5B08FC0C; Tue, 18 Sep 2012 12:53:06 +0000 (UTC) Received: by iayy25 with SMTP id y25so7784849iay.13 for ; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=9q45l/hesWue2eCBAFwuc8uIiLp1sZy+N0wOJXZ0hRI=; b=AQ8bPd1U8+AYaEwHswGDTvQATgU2+Zz3+yOSn+RLaWxUfwKxyDPIFi66bZrQqAeNNs 2T30Ubw4vX8G8uRRUgCXF7Vju0QzQQHPOjP0/iy812HB9iqovlzrLf57lXU+0BUtEI/q 3uBa+VHxhYkM5p51qOIGvyPtpwrS3xywW8ck/oS6zkcIFS+4hmRlk7QvAw/GCrh5REj9 dGflk0ia2cq1MDujA65n0o1B2KR2vE5SiEt4ikkq2OhE16bDhU23pZpVE6hoAEVRC0zw JjivphlocvtULgnj4cYIg09xAQo7rkqatjH4y+Ul6+ayke1BHs/6qoAoo+O8NRDq6g8B S27Q== MIME-Version: 1.0 Received: by 10.43.48.129 with SMTP id uw1mr97572icb.10.1347972785780; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.64.165.34 with HTTP; Tue, 18 Sep 2012 05:53:05 -0700 (PDT) In-Reply-To: <201209181234.q8ICYaFB091109@svn.freebsd.org> References: <201209181234.q8ICYaFB091109@svn.freebsd.org> Date: Tue, 18 Sep 2012 16:53:05 +0400 X-Google-Sender-Auth: Zd_k75c10pjoiIRwA3zfjnVWf-4 Message-ID: From: Sergey Kandaurov To: Gleb Smirnoff 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: r240646 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 12:53:06 -0000 On 18 September 2012 16:34, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Sep 18 12:34:35 2012 > New Revision: 240646 > URL: http://svn.freebsd.org/changeset/base/240646 > > Log: > Do more than r236298 did in the projects/pf branch: use M_NOWAIT in > altq_add() and its descendants. Currently altq(4) in FreeBSD is configured > via pf(4) ioctls, which can't configure altq(4) w/o holding locks. > Fortunately, altq(4) code in spife of using M_WAITOK is ready to receive > NULL from malloc(9), so change is mostly mechanical. While here, utilize > M_ZERO instead of bzero(). > > A large redesign needed to achieve M_WAITOK usage when configuring altq(4). > Or an alternative (not pf(4)) configuration interface should be implemented. > > Reported by: pluknet Actually Kim Culhan was initial reporter. I just reposted the problem closer to glebius and pointed out the roots. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 13:24:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4C0E106566B; Tue, 18 Sep 2012 13:24:15 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 971318FC12; Tue, 18 Sep 2012 13:24:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDOFMo099920; Tue, 18 Sep 2012 13:24:15 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDOFLB099918; Tue, 18 Sep 2012 13:24:15 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201209181324.q8IDOFLB099918@svn.freebsd.org> From: Andrey Zonov Date: Tue, 18 Sep 2012 13:24: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: r240649 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 13:24:15 -0000 Author: zont Date: Tue Sep 18 13:24:14 2012 New Revision: 240649 URL: http://svn.freebsd.org/changeset/base/240649 Log: - Bump date. Submitted by: pluknet Approved by: kib (mentor) X-MFC-With: r240645 Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Sep 18 13:13:28 2012 (r240648) +++ head/bin/ps/ps.1 Tue Sep 18 13:24:14 2012 (r240649) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 20, 2012 +.Dd September 18, 2012 .Dt PS 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 13:33:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BF93E106566C; Tue, 18 Sep 2012 13:33:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB3F58FC12; Tue, 18 Sep 2012 13:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IDXdlM001773; Tue, 18 Sep 2012 13:33:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IDXdf9001771; Tue, 18 Sep 2012 13:33:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209181333.q8IDXdf9001771@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Sep 2012 13:33: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: r240650 - head/sys/dev/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 13:33:39 -0000 Author: avg Date: Tue Sep 18 13:33:39 2012 New Revision: 240650 URL: http://svn.freebsd.org/changeset/base/240650 Log: hwpmc amd_pcpu_fini: fix a bug in code locked under DEBUG MFC after: 16 days Modified: head/sys/dev/hwpmc/hwpmc_amd.c Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Tue Sep 18 13:24:14 2012 (r240649) +++ head/sys/dev/hwpmc/hwpmc_amd.c Tue Sep 18 13:33:39 2012 (r240650) @@ -839,7 +839,7 @@ amd_pcpu_fini(struct pmc_mdep *md, int c for (i = 0; i < AMD_NPMCS; i++) { KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL, ("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i)); - KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + (i-1)), + KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + i), ("[amd,%d] CPU%d/PMC%d not stopped", __LINE__, cpu, i)); } #endif From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 14:09:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA91A1065670; Tue, 18 Sep 2012 14:09:09 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id E939B8FC0A; Tue, 18 Sep 2012 14:09:08 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAAt/WFBbsUA+/2dsb2JhbABFvDuBCYIgAQEEAVYiAQULCxgJFg8JAwIBAgEnHgYNAQUCAQEFh3EKB7o6ixuGcAOOaYEghm6PDYJo Received: from 62.64-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.64.62]) by relay.skynet.be with ESMTP; 18 Sep 2012 16:07:58 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q8IE7vrH002986; Tue, 18 Sep 2012 16:07:57 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <50588037.6010009@coosemans.org> Date: Tue, 18 Sep 2012 16:07:51 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:14.0) Gecko/20120804 Thunderbird/14.0 MIME-Version: 1.0 To: Erik Cederstrand References: <201209142347.q8ENlN7N034951@svn.freebsd.org> <5054EBCB.6070105@coosemans.org> <5054F116.8090503@cran.org.uk> <5055E121.2030208@coosemans.org> <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> In-Reply-To: <950ECA11-BDDF-4805-AB9F-07F233A8429E@cederstrand.dk> X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig009E4C34CAAFB2C1D94D079F" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240527 - head/bin/df X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 14:09:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig009E4C34CAAFB2C1D94D079F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 16-09-2012 20:57, Erik Cederstrand wrote: > Den 16/09/2012 kl. 18.05 skrev Eitan Adler : >> On 16 September 2012 10:24, Tijl Coosemans wrote:= >>> On 16-09-2012 01:27, Eitan Adler wrote: >>>> On 15 September 2012 17:20, Bruce Cran wrote: >>>>> On 15/09/2012 21:57, Tijl Coosemans wrote: >>>>>> Freeing memory right before exiting is a waste of time. The tool s= houldn't >>>>>> complain about it. >>>> >>>> Perhaps, but tools do. This has already been brought up on cfe-dev. >>> >>> In this case the free is actually wrong, because the pointer can poin= t >>> to memory allocated by getmntinfo(3) and that manpage says an applica= tion >>> cannot free it. >> >> Ah, I missed that. I wish this point was brought up earlier. I'll >> revert the commit >=20 > I was the one who filed the PR > (http://www.freebsd.org/cgi/query-pr.cgi?pr=3D171634). I'm embarrassed > to have caused a wrong commit. >=20 > The big picture is I'm looking through the Clang Analyzer scans at > http://scan.freebsd.your.org/freebsd-head trying to find false > positives to report back to LLVM. Their PR originated in this > warning: > http://scan.freebsd.your.org/freebsd-head/bin.df/2012-09-12-amd64/repor= t-WwB2qk.html#EndPath > The scan has 326 warnings about possible memory leaks in world, so > I'd really like to do something here, be it either via bug report > with LLVM or FreeBSD or to annotate the code to say it's okay to > break the rules. >=20 > There response from LLVM (disregarding that mntbuf can't be freed) is > either that: 1) if main() is redefined as a macro, it's still a leak, If main is renamed using a macro it isn't main anymore and it's ok to complain about leaks. A more valid objection would be that main is still an ordinary function that can be called from other functions, so a memory leak there is potentially just as problematic as in any other function. But that's very theoretical. In practice I think not complaining about leaks in main by default would take out more false positives than create false negatives. > and 2) they can skip the warning only if it's feasible to reason that > prtstat() doesn't allocate memory. I don't understand why this is a requirement. If there's a call to exit(3) instead of a return statement the analyzer already doesn't seem to complain and a return from main() is the same as a call to exit() in practice. > I noticed that the sentence "The memory allocated by getmntinfo() > cannot be free(3)'d by the application." in the getmntinfo(3) manage > is in the bugs section. Does this mean it's something that should be > fixed in FreeBSD eventually? Probably not. The section could be renamed CAVEATS like basename(3). --------------enig009E4C34CAAFB2C1D94D079F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlBYgDwACgkQfoCS2CCgtitI5gD/bLujB/9Bq+5V8jV33oqIq2i7 MxTEOA0cgFXj2Tvs7/IA/3bIl9H31NooDVuGKHQ5ycHC53Pe+Y+McHTTTat0GtDb =XN7/ -----END PGP SIGNATURE----- --------------enig009E4C34CAAFB2C1D94D079F-- From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 15:38:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05DE5106564A; Tue, 18 Sep 2012 15:38:43 +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 E4C808FC14; Tue, 18 Sep 2012 15:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IFcgop018341; Tue, 18 Sep 2012 15:38:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IFcguO018335; Tue, 18 Sep 2012 15:38:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209181538.q8IFcguO018335@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Sep 2012 15:38: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: r240655 - head/sys/boot/ofw/libofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 15:38:43 -0000 Author: mav Date: Tue Sep 18 15:38:42 2012 New Revision: 240655 URL: http://svn.freebsd.org/changeset/base/240655 Log: Fix panics on attempt to dereference uninitizlized pointer, returned via 'path' argument of ofw_parsedev() if devspec refers raw device with no path. For example, `ls /pci@1f,0/ide@d/disk@0,0:a/` works fine, while `ls /pci@1f,0/ide@d/disk@0,0:a` panicked before this change. Modified: head/sys/boot/ofw/libofw/devicename.c Modified: head/sys/boot/ofw/libofw/devicename.c ============================================================================== --- head/sys/boot/ofw/libofw/devicename.c Tue Sep 18 14:33:27 2012 (r240654) +++ head/sys/boot/ofw/libofw/devicename.c Tue Sep 18 15:38:42 2012 (r240655) @@ -105,7 +105,7 @@ ofw_parsedev(struct ofw_devdesc **dev, c return(ENOENT); found: - if (path != NULL && *s != '\0') + if (path != NULL) *path = s; idev = malloc(sizeof(struct ofw_devdesc)); if (idev == NULL) { From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 16:00:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C33F1106564A; Tue, 18 Sep 2012 16:00:44 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D128FC15; Tue, 18 Sep 2012 16:00:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IG0ile021119; Tue, 18 Sep 2012 16:00:44 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IG0iY4021117; Tue, 18 Sep 2012 16:00:44 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201209181600.q8IG0iY4021117@svn.freebsd.org> From: Benjamin Kaduk Date: Tue, 18 Sep 2012 16:00: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: r240656 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 16:00:44 -0000 Author: bjk (doc committer) Date: Tue Sep 18 16:00:44 2012 New Revision: 240656 URL: http://svn.freebsd.org/changeset/base/240656 Log: Fix grammar in the portion about FIBs. Also, cross-reference setfib(2) instead of setfib(1) for the 16-FIB limit. PR: docs/157452 Approved by: hrs (mentor) Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Sep 18 15:38:42 2012 (r240655) +++ head/sbin/ipfw/ipfw.8 Tue Sep 18 16:00:44 2012 (r240656) @@ -957,25 +957,27 @@ actions. The packet is tagged so as to use the FIB (routing table) .Ar fibnum in any subsequent forwarding decisions. -Initially this is limited to the values 0 through 15, see -.Xr setfib 1 . +In the current implementation, this is limited to the values 0 through 15, see +.Xr setfib 2 . Processing continues at the next rule. It is possible to use the .Cm tablearg -keyword with a setfib. -If tablearg value is not within compiled FIB range packet fib is set to 0. +keyword with setfib. +If the tablearg value is not within the compiled range of fibs, +the packet's fib is set to 0. .It Cm reass -Queue and reassemble ip fragments. +Queue and reassemble IP fragments. If the packet is not fragmented, counters are updated and processing continues with the next rule. If the packet is the last logical fragment, the packet is reassembled and, if .Va net.inet.ip.fw.one_pass -is set to 0, processing continues with the next rule, else packet is -allowed to pass and search terminates. -If the packet is a fragment in the middle, it is consumed and +is set to 0, processing continues with the next rule. +Otherwise, the packet is allowed to pass and the search terminates. +If the packet is a fragment in the middle of a logical group of fragments, +it is consumed and processing stops immediately. .Pp -Fragments handling can be tuned via +Fragment handling can be tuned via .Va net.inet.ip.maxfragpackets and .Va net.inet.ip.maxfragsperpacket From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 18:16:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90C321065679; Tue, 18 Sep 2012 18:16:53 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 790468FC14; Tue, 18 Sep 2012 18:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IIGrBT038931; Tue, 18 Sep 2012 18:16:53 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IIGrSc038928; Tue, 18 Sep 2012 18:16:53 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209181816.q8IIGrSc038928@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Sep 2012 18:16: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: r240671 - head/sys/dev/nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 18:16:53 -0000 Author: jimharris Date: Tue Sep 18 18:16:52 2012 New Revision: 240671 URL: http://svn.freebsd.org/changeset/base/240671 Log: Add __aligned(4) to NVMe defined data structures. This fixes issue in nvmecontrol(8), where clang throws a cast-align warning when casting a __packed structure pointer to a uint32_t pointer as part of printing raw hex output. Reported by: dhw Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Tue Sep 18 17:30:08 2012 (r240670) +++ head/sys/dev/nvme/nvme.h Tue Sep 18 18:16:52 2012 (r240671) @@ -513,7 +513,7 @@ struct nvme_controller_data { /* bytes 3072-4095: vendor specific */ uint8_t reserved7[1024]; -} __packed; +} __packed __aligned(4); struct nvme_namespace_data { @@ -603,7 +603,7 @@ struct nvme_namespace_data { uint8_t reserved6[192]; uint8_t vendor_specific[3712]; -}; +} __packed __aligned(4); enum nvme_log_page { @@ -661,7 +661,7 @@ struct nvme_health_information_page { uint64_t num_error_info_log_entries[2]; uint8_t reserved2[320]; -} __packed; +} __packed __aligned(4); #define NVME_TEST_MAX_THREADS 128 From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 18:23:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C120106566C; Tue, 18 Sep 2012 18:23:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 379238FC0A; Tue, 18 Sep 2012 18:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IINM2h039789; Tue, 18 Sep 2012 18:23:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IINMMp039787; Tue, 18 Sep 2012 18:23:22 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209181823.q8IINMMp039787@svn.freebsd.org> From: Jim Harris Date: Tue, 18 Sep 2012 18:23: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: r240672 - head/sys/dev/nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 18:23:22 -0000 Author: jimharris Date: Tue Sep 18 18:23:21 2012 New Revision: 240672 URL: http://svn.freebsd.org/changeset/base/240672 Log: Add #if 0 around nvme_async_event_cb() until NVMe AER functionality can be tested. This fixes a build warning found only with clang. Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Tue Sep 18 18:16:52 2012 (r240671) +++ head/sys/dev/nvme/nvme_ctrlr.c Tue Sep 18 18:23:21 2012 (r240672) @@ -381,6 +381,11 @@ nvme_ctrlr_reset(struct nvme_controller return (nvme_ctrlr_enable(ctrlr)); } +/* + * Disable this code for now, since Chatham doesn't support + * AERs so I have no good way to test them. + */ +#if 0 static void nvme_async_event_cb(void *arg, const struct nvme_completion *status) { @@ -398,6 +403,7 @@ nvme_async_event_cb(void *arg, const str nvme_ctrlr_cmd_asynchronous_event_request(ctrlr, nvme_async_event_cb, ctrlr); } +#endif static int nvme_ctrlr_identify(struct nvme_controller *ctrlr) From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 20:28:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BE8106566B; Tue, 18 Sep 2012 20:28:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E28298FC0A; Tue, 18 Sep 2012 20:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IKStfM056966; Tue, 18 Sep 2012 20:28:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IKStPK056964; Tue, 18 Sep 2012 20:28:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209182028.q8IKStPK056964@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 18 Sep 2012 20:28: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: r240676 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 20:28:56 -0000 Author: glebius Date: Tue Sep 18 20:28:55 2012 New Revision: 240676 URL: http://svn.freebsd.org/changeset/base/240676 Log: If caller specifies UMA_ZONE_OFFPAGE explicitly, then do not waste memory in an allocation for a slab. Reviewed by: jeff Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Sep 18 20:28:01 2012 (r240675) +++ head/sys/vm/uma_core.c Tue Sep 18 20:28:55 2012 (r240676) @@ -1127,7 +1127,9 @@ keg_small_init(uma_keg_t keg) keg->uk_rsize = rsize; keg->uk_ppera = 1; - if (keg->uk_flags & UMA_ZONE_REFCNT) { + if (keg->uk_flags & UMA_ZONE_OFFPAGE) { + shsize = 0; + } else if (keg->uk_flags & UMA_ZONE_REFCNT) { rsize += UMA_FRITMREF_SZ; /* linkage & refcnt */ shsize = sizeof(struct uma_slab_refcnt); } else { From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 20:33:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A30DA106566C; Tue, 18 Sep 2012 20:33:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2528FC0C; Tue, 18 Sep 2012 20:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IKX4QH057549; Tue, 18 Sep 2012 20:33:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IKX4O5057547; Tue, 18 Sep 2012 20:33:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209182033.q8IKX4O5057547@svn.freebsd.org> From: Adrian Chadd Date: Tue, 18 Sep 2012 20:33: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: r240677 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 20:33:04 -0000 Author: adrian Date: Tue Sep 18 20:33:04 2012 New Revision: 240677 URL: http://svn.freebsd.org/changeset/base/240677 Log: Oops - take a copy of ath_tx_status from the buffer before the TX processing is done. The aggregate path was definitely accessing 'ts' before it was actually being assigned. This had the side effect of over-filtering frames, since occasionally that bit would be '1'. Whilst here, do the same thing in the non-aggregate completion function - as calling the filter function may also invalidate bf. Pointy hat to: adrian, for not noticing this over many, many code reviews. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Sep 18 20:28:55 2012 (r240676) +++ head/sys/dev/ath/if_ath_tx.c Tue Sep 18 20:33:04 2012 (r240677) @@ -3955,6 +3955,12 @@ ath_tx_aggr_comp_aggr(struct ath_softc * DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: called; hwq_depth=%d\n", __func__, atid->hwq_depth); + /* + * Take a copy; this may be needed -after- bf_first + * has been completed and freed. + */ + ts = bf_first->bf_status.ds_txstat; + TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); @@ -3970,6 +3976,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * * If the TID is filtered, handle completing the filter * transition before potentially kicking it to the cleanup * function. + * + * XXX this is duplicate work, ew. */ if (atid->isfiltered) ath_tx_tid_filt_comp_complete(sc, atid); @@ -4030,11 +4038,6 @@ ath_tx_aggr_comp_aggr(struct ath_softc * } /* - * Take a copy; this may be needed -after- bf_first - * has been completed and freed. - */ - ts = bf_first->bf_status.ds_txstat; - /* * XXX for now, use the first frame in the aggregate for * XXX rate control completion; it's at least consistent. */ @@ -4255,10 +4258,16 @@ ath_tx_aggr_comp_unaggr(struct ath_softc struct ath_node *an = ATH_NODE(ni); int tid = bf->bf_state.bfs_tid; struct ath_tid *atid = &an->an_tid[tid]; - struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + struct ath_tx_status ts; int drops = 0; /* + * Take a copy of this; filtering/cloning the frame may free the + * bf pointer. + */ + ts = bf->bf_status.ds_txstat; + + /* * Update rate control status here, before we possibly * punt to retry or cleanup. * @@ -4268,7 +4277,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, &bf->bf_status.ds_txstat, bf->bf_state.bfs_pktlen, - 1, (ts->ts_status == 0) ? 0 : 1); + 1, (ts.ts_status == 0) ? 0 : 1); /* * This is called early so atid->hwq_depth can be tracked. @@ -4328,8 +4337,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc * list as it will end up being recycled without having * been made available for the hardware. */ - if ((ts->ts_status & HAL_TXERR_FILT) || - (ts->ts_status != 0 && atid->isfiltered)) { + if ((ts.ts_status & HAL_TXERR_FILT) || + (ts.ts_status != 0 && atid->isfiltered)) { int freeframe; if (fail != 0) @@ -4383,7 +4392,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc #if 0 if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) { #endif - if (fail == 0 && ts->ts_status != 0) { + if (fail == 0 && ts.ts_status != 0) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n", __func__); From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 22:05:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 318CF1065674; Tue, 18 Sep 2012 22:05:00 +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 1812D8FC12; Tue, 18 Sep 2012 22:05:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IM50fD070498; Tue, 18 Sep 2012 22:05:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IM4xMX070480; Tue, 18 Sep 2012 22:04:59 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209182204.q8IM4xMX070480@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 18 Sep 2012 22:04: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: r240680 - in head: sys/dev/alc sys/dev/bge sys/dev/cxgb sys/dev/cxgbe sys/dev/e1000 sys/dev/et sys/dev/jme sys/dev/pci sys/dev/re sys/ofed/include/linux sys/powerpc/mpc85xx usr.sbin/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: Tue, 18 Sep 2012 22:05:00 -0000 Author: gavin Date: Tue Sep 18 22:04:59 2012 New Revision: 240680 URL: http://svn.freebsd.org/changeset/base/240680 Log: Align the PCI Express #defines with the style used for the PCI-X #defines. This also has the advantage that it makes the names more compact, iand also allows us to correct the non-uniform naming of the PCIM_LINK_* defines, making them all consistent amongst themselves. This is a mostly mechanical rename: s/PCIR_EXPRESS_/PCIER_/g s/PCIM_EXP_/PCIEM_/g s/PCIM_LINK_/PCIEM_LINK_/g When this is MFC'd, #defines will be added for the old names to assist out-of-tree drivers. Discussed with: jhb MFC after: 1 week Modified: head/sys/dev/alc/if_alc.c head/sys/dev/bge/if_bge.c head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_osdep.h head/sys/dev/cxgbe/osdep.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/e1000/if_em.c head/sys/dev/et/if_et.c head/sys/dev/jme/if_jme.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h head/sys/dev/re/if_re.c head/sys/ofed/include/linux/pci.h head/sys/powerpc/mpc85xx/pci_fdt.c head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/err.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/alc/if_alc.c Tue Sep 18 22:04:59 2012 (r240680) @@ -683,7 +683,7 @@ alc_aspm(struct alc_softc *sc, int media if ((sc->alc_flags & (ALC_FLAG_APS | ALC_FLAG_PCIE)) == (ALC_FLAG_APS | ALC_FLAG_PCIE)) linkcfg = CSR_READ_2(sc, sc->alc_expcap + - PCIR_EXPRESS_LINK_CTL); + PCIER_LINK_CTL); else linkcfg = 0; pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; @@ -698,7 +698,7 @@ alc_aspm(struct alc_softc *sc, int media if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B && sc->alc_rev == ATHEROS_AR8152_B_V10) linkcfg |= 0x80; - CSR_WRITE_2(sc, sc->alc_expcap + PCIR_EXPRESS_LINK_CTL, + CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL, linkcfg); pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB | PM_CFG_HOTRST); @@ -798,10 +798,10 @@ alc_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, &base) == 0) { sc->alc_flags |= ALC_FLAG_PCIE; sc->alc_expcap = base; - burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL); + burst = CSR_READ_2(sc, base + PCIER_DEVICE_CTL); sc->alc_dma_rd_burst = - (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12; - sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5; + (burst & PCIEM_CTL_MAX_READ_REQUEST) >> 12; + sc->alc_dma_wr_burst = (burst & PCIEM_CTL_MAX_PAYLOAD) >> 5; if (bootverbose) { device_printf(dev, "Read request size : %u bytes.\n", alc_dma_burst[sc->alc_dma_rd_burst]); @@ -831,9 +831,9 @@ alc_attach(device_t dev) CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val); } /* Disable ASPM L0S and L1. */ - cap = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CAP); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { - ctl = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CTL); + cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { + ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); if ((ctl & 0x08) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/bge/if_bge.c Tue Sep 18 22:04:59 2012 (r240680) @@ -3625,17 +3625,17 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, 0xC4, val | (1 << 15), 4); } devctl = pci_read_config(dev, - sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + sc->bge_expcap + PCIER_DEVICE_CTL, 2); /* Clear enable no snoop and disable relaxed ordering. */ - devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE | - PCIM_EXP_CTL_NOSNOOP_ENABLE); - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl &= ~(PCIEM_CTL_RELAXED_ORD_ENABLE | + PCIEM_CTL_NOSNOOP_ENABLE); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_CTL, devctl, 2); /* Clear error status. */ - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, - PCIM_EXP_STA_CORRECTABLE_ERROR | - PCIM_EXP_STA_NON_FATAL_ERROR | PCIM_EXP_STA_FATAL_ERROR | - PCIM_EXP_STA_UNSUPPORTED_REQ, 2); + pci_write_config(dev, sc->bge_expcap + PCIER_DEVICE_STA, + PCIEM_STA_CORRECTABLE_ERROR | + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | + PCIEM_STA_UNSUPPORTED_REQ, 2); } /* Reset some of the PCI state that got zapped by reset. */ Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgb/cxgb_main.c Tue Sep 18 22:04:59 2012 (r240680) @@ -476,8 +476,8 @@ cxgb_controller_attach(device_t dev) if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { uint16_t lnk; - lnk = pci_read_config(dev, reg + PCIR_EXPRESS_LINK_STA, 2); - sc->link_width = (lnk & PCIM_LINK_STA_WIDTH) >> 4; + lnk = pci_read_config(dev, reg + PCIER_LINK_STA, 2); + sc->link_width = (lnk & PCIEM_LINK_STA_WIDTH) >> 4; if (sc->link_width < 8 && (ai->caps & SUPPORTED_10000baseT_Full)) { device_printf(sc->dev, Modified: head/sys/dev/cxgb/cxgb_osdep.h ============================================================================== --- head/sys/dev/cxgb/cxgb_osdep.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgb/cxgb_osdep.h Tue Sep 18 22:04:59 2012 (r240680) @@ -215,11 +215,11 @@ static const int debug_flags = DBG_RX; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA /* * Linux compatibility macros Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgbe/osdep.h Tue Sep 18 22:04:59 2012 (r240680) @@ -118,13 +118,13 @@ typedef boolean_t bool; #define PCI_VPD_DATA PCIR_VPD_DATA #define PCI_CAP_ID_EXP PCIY_EXPRESS -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_DEVCTL_PAYLOAD PCIM_EXP_CTL_MAX_PAYLOAD -#define PCI_EXP_DEVCTL_READRQ PCIM_EXP_CTL_MAX_READ_REQUEST -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL -#define PCI_EXP_LNKSTA PCIR_EXPRESS_LINK_STA -#define PCI_EXP_LNKSTA_CLS PCIM_LINK_STA_SPEED -#define PCI_EXP_LNKSTA_NLW PCIM_LINK_STA_WIDTH +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_DEVCTL_PAYLOAD PCIEM_CTL_MAX_PAYLOAD +#define PCI_EXP_DEVCTL_READRQ PCIEM_CTL_MAX_READ_REQUEST +#define PCI_EXP_LNKCTL PCIER_LINK_CTL +#define PCI_EXP_LNKSTA PCIER_LINK_STA +#define PCI_EXP_LNKSTA_CLS PCIEM_LINK_STA_SPEED +#define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH #define PCI_EXP_DEVCTL2 0x28 static inline int Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/cxgbe/t4_main.c Tue Sep 18 22:04:59 2012 (r240680) @@ -429,9 +429,9 @@ t4_attach(device_t dev) uint32_t v; pci_set_max_read_req(dev, 4096); - v = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); - v |= PCIM_EXP_CTL_RELAXED_ORD_ENABLE; - pci_write_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, v, 2); + v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); + v |= PCIEM_CTL_RELAXED_ORD_ENABLE; + pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } snprintf(sc->lockname, sizeof(sc->lockname), "%s", Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/e1000/if_em.c Tue Sep 18 22:04:59 2012 (r240680) @@ -5113,11 +5113,11 @@ em_disable_aspm(struct adapter *adapter) } if (pci_find_cap(dev, PCIY_EXPRESS, &base) != 0) return; - reg = base + PCIR_EXPRESS_LINK_CAP; + reg = base + PCIER_LINK_CAP; link_cap = pci_read_config(dev, reg, 2); - if ((link_cap & PCIM_LINK_CAP_ASPM) == 0) + if ((link_cap & PCIEM_LINK_CAP_ASPM) == 0) return; - reg = base + PCIR_EXPRESS_LINK_CTL; + reg = base + PCIER_LINK_CTL; link_ctrl = pci_read_config(dev, reg, 2); link_ctrl &= 0xFFFC; /* turn off bit 1 and 2 */ pci_write_config(dev, reg, link_ctrl, 2); Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/et/if_et.c Tue Sep 18 22:04:59 2012 (r240680) @@ -700,8 +700,8 @@ et_bus_config(struct et_softc *sc) * max playload size */ val = pci_read_config(sc->dev, - sc->sc_expcap + PCIR_EXPRESS_DEVICE_CAP, 4); - max_plsz = val & PCIM_EXP_CAP_MAX_PAYLOAD; + sc->sc_expcap + PCIER_DEVICE_CAP, 4); + max_plsz = val & PCIEM_CAP_MAX_PAYLOAD; switch (max_plsz) { case ET_PCIV_DEVICE_CAPS_PLSZ_128: @@ -732,7 +732,7 @@ et_bus_config(struct et_softc *sc) * Set L0s and L1 latency timer to 2us */ val = pci_read_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, 4); - val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); + val &= ~(PCIEM_LINK_CAP_L0S_EXIT | PCIEM_LINK_CAP_L1_EXIT); /* L0s exit latency : 2us */ val |= 0x00005000; /* L1 exit latency : 2us */ Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/jme/if_jme.c Tue Sep 18 22:04:59 2012 (r240680) @@ -778,7 +778,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); + burst = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/pci/pci.c Tue Sep 18 22:04:59 2012 (r240680) @@ -743,8 +743,8 @@ pci_read_cap(device_t pcib, pcicfgregs * */ pcie_chipset = 1; cfg->pcie.pcie_location = ptr; - val = REG(ptr + PCIR_EXPRESS_FLAGS, 2); - cfg->pcie.pcie_type = val & PCIM_EXP_FLAGS_TYPE; + val = REG(ptr + PCIER_FLAGS, 2); + cfg->pcie.pcie_type = val & PCIEM_FLAGS_TYPE; break; default: break; @@ -1791,8 +1791,8 @@ pci_get_max_read_req(device_t dev) cap = dinfo->cfg.pcie.pcie_location; if (cap == 0) return (0); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_READ_REQUEST; val >>= 12; return (1 << (val + 7)); } @@ -1812,10 +1812,10 @@ pci_set_max_read_req(device_t dev, int s if (size > 4096) size = 4096; size = (1 << (fls(size) - 1)); - val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= ~PCIEM_CTL_MAX_READ_REQUEST; val |= (fls(size) - 8) << 12; - pci_write_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + pci_write_config(dev, cap + PCIER_DEVICE_CTL, val, 2); return (size); } @@ -4469,28 +4469,28 @@ pci_cfg_restore_pcie(device_t dev, struc cfg = &dinfo->cfg.pcie; pos = cfg->pcie_location; - version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + version = cfg->pcie_flags & PCIEM_FLAGS_VERSION; - WREG(PCIR_EXPRESS_DEVICE_CTL, cfg->pcie_device_ctl); + WREG(PCIER_DEVICE_CTL, cfg->pcie_device_ctl); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || - cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) - WREG(PCIR_EXPRESS_LINK_CTL, cfg->pcie_link_ctl); - - if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && - (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) - WREG(PCIR_EXPRESS_SLOT_CTL, cfg->pcie_slot_ctl); - - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) - WREG(PCIR_EXPRESS_ROOT_CTL, cfg->pcie_root_ctl); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ENDPOINT || + cfg->pcie_type == PCIEM_TYPE_LEGACY_ENDPOINT) + WREG(PCIER_LINK_CTL, cfg->pcie_link_ctl); + + if (version > 1 || (cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIEM_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIEM_FLAGS_SLOT)))) + WREG(PCIER_SLOT_CTL, cfg->pcie_slot_ctl); + + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ROOT_EC) + WREG(PCIER_ROOT_CTL, cfg->pcie_root_ctl); if (version > 1) { - WREG(PCIR_EXPRESS_DEVICE_CTL2, cfg->pcie_device_ctl2); - WREG(PCIR_EXPRESS_LINK_CTL2, cfg->pcie_link_ctl2); - WREG(PCIR_EXPRESS_SLOT_CTL2, cfg->pcie_slot_ctl2); + WREG(PCIER_DEVICE_CTL2, cfg->pcie_device_ctl2); + WREG(PCIER_LINK_CTL2, cfg->pcie_link_ctl2); + WREG(PCIER_SLOT_CTL2, cfg->pcie_slot_ctl2); } #undef WREG } @@ -4562,30 +4562,30 @@ pci_cfg_save_pcie(device_t dev, struct p cfg = &dinfo->cfg.pcie; pos = cfg->pcie_location; - cfg->pcie_flags = RREG(PCIR_EXPRESS_FLAGS); + cfg->pcie_flags = RREG(PCIER_FLAGS); - version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION; + version = cfg->pcie_flags & PCIEM_FLAGS_VERSION; - cfg->pcie_device_ctl = RREG(PCIR_EXPRESS_DEVICE_CTL); + cfg->pcie_device_ctl = RREG(PCIER_DEVICE_CTL); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT || - cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT) - cfg->pcie_link_ctl = RREG(PCIR_EXPRESS_LINK_CTL); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ENDPOINT || + cfg->pcie_type == PCIEM_TYPE_LEGACY_ENDPOINT) + cfg->pcie_link_ctl = RREG(PCIER_LINK_CTL); - if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT && - (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT)))) - cfg->pcie_slot_ctl = RREG(PCIR_EXPRESS_SLOT_CTL); + if (version > 1 || (cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + (cfg->pcie_type == PCIEM_TYPE_DOWNSTREAM_PORT && + (cfg->pcie_flags & PCIEM_FLAGS_SLOT)))) + cfg->pcie_slot_ctl = RREG(PCIER_SLOT_CTL); - if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT || - cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC) - cfg->pcie_root_ctl = RREG(PCIR_EXPRESS_ROOT_CTL); + if (version > 1 || cfg->pcie_type == PCIEM_TYPE_ROOT_PORT || + cfg->pcie_type == PCIEM_TYPE_ROOT_EC) + cfg->pcie_root_ctl = RREG(PCIER_ROOT_CTL); if (version > 1) { - cfg->pcie_device_ctl2 = RREG(PCIR_EXPRESS_DEVICE_CTL2); - cfg->pcie_link_ctl2 = RREG(PCIR_EXPRESS_LINK_CTL2); - cfg->pcie_slot_ctl2 = RREG(PCIR_EXPRESS_SLOT_CTL2); + cfg->pcie_device_ctl2 = RREG(PCIER_DEVICE_CTL2); + cfg->pcie_link_ctl2 = RREG(PCIER_LINK_CTL2); + cfg->pcie_slot_ctl2 = RREG(PCIER_SLOT_CTL2); } #undef RREG } Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/pci/pcireg.h Tue Sep 18 22:04:59 2012 (r240680) @@ -629,147 +629,147 @@ #define PCIR_SUBVENDCAP_ID 0x4 /* PCI Express definitions */ -#define PCIR_EXPRESS_FLAGS 0x2 -#define PCIM_EXP_FLAGS_VERSION 0x000F -#define PCIM_EXP_FLAGS_TYPE 0x00F0 -#define PCIM_EXP_TYPE_ENDPOINT 0x0000 -#define PCIM_EXP_TYPE_LEGACY_ENDPOINT 0x0010 -#define PCIM_EXP_TYPE_ROOT_PORT 0x0040 -#define PCIM_EXP_TYPE_UPSTREAM_PORT 0x0050 -#define PCIM_EXP_TYPE_DOWNSTREAM_PORT 0x0060 -#define PCIM_EXP_TYPE_PCI_BRIDGE 0x0070 -#define PCIM_EXP_TYPE_PCIE_BRIDGE 0x0080 -#define PCIM_EXP_TYPE_ROOT_INT_EP 0x0090 -#define PCIM_EXP_TYPE_ROOT_EC 0x00a0 -#define PCIM_EXP_FLAGS_SLOT 0x0100 -#define PCIM_EXP_FLAGS_IRQ 0x3e00 -#define PCIR_EXPRESS_DEVICE_CAP 0x4 -#define PCIM_EXP_CAP_MAX_PAYLOAD 0x00000007 -#define PCIM_EXP_CAP_PHANTHOM_FUNCS 0x00000018 -#define PCIM_EXP_CAP_EXT_TAG_FIELD 0x00000020 -#define PCIM_EXP_CAP_L0S_LATENCY 0x000001c0 -#define PCIM_EXP_CAP_L1_LATENCY 0x00000e00 -#define PCIM_EXP_CAP_ROLE_ERR_RPT 0x00008000 -#define PCIM_EXP_CAP_SLOT_PWR_LIM_VAL 0x03fc0000 -#define PCIM_EXP_CAP_SLOT_PWR_LIM_SCALE 0x0c000000 -#define PCIM_EXP_CAP_FLR 0x10000000 -#define PCIR_EXPRESS_DEVICE_CTL 0x8 -#define PCIM_EXP_CTL_COR_ENABLE 0x0001 -#define PCIM_EXP_CTL_NFER_ENABLE 0x0002 -#define PCIM_EXP_CTL_FER_ENABLE 0x0004 -#define PCIM_EXP_CTL_URR_ENABLE 0x0008 -#define PCIM_EXP_CTL_RELAXED_ORD_ENABLE 0x0010 -#define PCIM_EXP_CTL_MAX_PAYLOAD 0x00e0 -#define PCIM_EXP_CTL_EXT_TAG_FIELD 0x0100 -#define PCIM_EXP_CTL_PHANTHOM_FUNCS 0x0200 -#define PCIM_EXP_CTL_AUX_POWER_PM 0x0400 -#define PCIM_EXP_CTL_NOSNOOP_ENABLE 0x0800 -#define PCIM_EXP_CTL_MAX_READ_REQUEST 0x7000 -#define PCIM_EXP_CTL_BRDG_CFG_RETRY 0x8000 /* PCI-E - PCI/PCI-X bridges */ -#define PCIM_EXP_CTL_INITIATE_FLR 0x8000 /* FLR capable endpoints */ -#define PCIR_EXPRESS_DEVICE_STA 0xa -#define PCIM_EXP_STA_CORRECTABLE_ERROR 0x0001 -#define PCIM_EXP_STA_NON_FATAL_ERROR 0x0002 -#define PCIM_EXP_STA_FATAL_ERROR 0x0004 -#define PCIM_EXP_STA_UNSUPPORTED_REQ 0x0008 -#define PCIM_EXP_STA_AUX_POWER 0x0010 -#define PCIM_EXP_STA_TRANSACTION_PND 0x0020 -#define PCIR_EXPRESS_LINK_CAP 0xc -#define PCIM_LINK_CAP_MAX_SPEED 0x0000000f -#define PCIM_LINK_CAP_MAX_WIDTH 0x000003f0 -#define PCIM_LINK_CAP_ASPM 0x00000c00 -#define PCIM_LINK_CAP_L0S_EXIT 0x00007000 -#define PCIM_LINK_CAP_L1_EXIT 0x00038000 -#define PCIM_LINK_CAP_CLOCK_PM 0x00040000 -#define PCIM_LINK_CAP_SURPRISE_DOWN 0x00080000 -#define PCIM_LINK_CAP_DL_ACTIVE 0x00100000 -#define PCIM_LINK_CAP_LINK_BW_NOTIFY 0x00200000 -#define PCIM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 -#define PCIM_LINK_CAP_PORT 0xff000000 -#define PCIR_EXPRESS_LINK_CTL 0x10 -#define PCIM_EXP_LINK_CTL_ASPMC_DIS 0x0000 -#define PCIM_EXP_LINK_CTL_ASPMC_L0S 0x0001 -#define PCIM_EXP_LINK_CTL_ASPMC_L1 0x0002 -#define PCIM_EXP_LINK_CTL_ASPMC 0x0003 -#define PCIM_EXP_LINK_CTL_RCB 0x0008 -#define PCIM_EXP_LINK_CTL_LINK_DIS 0x0010 -#define PCIM_EXP_LINK_CTL_RETRAIN_LINK 0x0020 -#define PCIM_EXP_LINK_CTL_COMMON_CLOCK 0x0040 -#define PCIM_EXP_LINK_CTL_EXTENDED_SYNC 0x0080 -#define PCIM_EXP_LINK_CTL_ECPM 0x0100 -#define PCIM_EXP_LINK_CTL_HAWD 0x0200 -#define PCIM_EXP_LINK_CTL_LBMIE 0x0400 -#define PCIM_EXP_LINK_CTL_LABIE 0x0800 -#define PCIR_EXPRESS_LINK_STA 0x12 -#define PCIM_LINK_STA_SPEED 0x000f -#define PCIM_LINK_STA_WIDTH 0x03f0 -#define PCIM_LINK_STA_TRAINING_ERROR 0x0400 -#define PCIM_LINK_STA_TRAINING 0x0800 -#define PCIM_LINK_STA_SLOT_CLOCK 0x1000 -#define PCIM_LINK_STA_DL_ACTIVE 0x2000 -#define PCIM_LINK_STA_LINK_BW_MGMT 0x4000 -#define PCIM_LINK_STA_LINK_AUTO_BW 0x8000 -#define PCIR_EXPRESS_SLOT_CAP 0x14 -#define PCIM_EXP_SLOT_CAP_APB 0x00000001 -#define PCIM_EXP_SLOT_CAP_PCP 0x00000002 -#define PCIM_EXP_SLOT_CAP_MRLSP 0x00000004 -#define PCIM_EXP_SLOT_CAP_AIP 0x00000008 -#define PCIM_EXP_SLOT_CAP_PIP 0x00000010 -#define PCIM_EXP_SLOT_CAP_HPS 0x00000020 -#define PCIM_EXP_SLOT_CAP_HPC 0x00000040 -#define PCIM_EXP_SLOT_CAP_SPLV 0x00007f80 -#define PCIM_EXP_SLOT_CAP_SPLS 0x00018000 -#define PCIM_EXP_SLOT_CAP_EIP 0x00020000 -#define PCIM_EXP_SLOT_CAP_NCCS 0x00040000 -#define PCIM_EXP_SLOT_CAP_PSN 0xfff80000 -#define PCIR_EXPRESS_SLOT_CTL 0x18 -#define PCIM_EXP_SLOT_CTL_ABPE 0x0001 -#define PCIM_EXP_SLOT_CTL_PFDE 0x0002 -#define PCIM_EXP_SLOT_CTL_MRLSCE 0x0004 -#define PCIM_EXP_SLOT_CTL_PDCE 0x0008 -#define PCIM_EXP_SLOT_CTL_CCIE 0x0010 -#define PCIM_EXP_SLOT_CTL_HPIE 0x0020 -#define PCIM_EXP_SLOT_CTL_AIC 0x00c0 -#define PCIM_EXP_SLOT_CTL_PIC 0x0300 -#define PCIM_EXP_SLOT_CTL_PCC 0x0400 -#define PCIM_EXP_SLOT_CTL_EIC 0x0800 -#define PCIM_EXP_SLOT_CTL_DLLSCE 0x1000 -#define PCIR_EXPRESS_SLOT_STA 0x1a -#define PCIM_EXP_SLOT_STA_ABP 0x0001 -#define PCIM_EXP_SLOT_STA_PFD 0x0002 -#define PCIM_EXP_SLOT_STA_MRLSC 0x0004 -#define PCIM_EXP_SLOT_STA_PDC 0x0008 -#define PCIM_EXP_SLOT_STA_CC 0x0010 -#define PCIM_EXP_SLOT_STA_MRLSS 0x0020 -#define PCIM_EXP_SLOT_STA_PDS 0x0040 -#define PCIM_EXP_SLOT_STA_EIS 0x0080 -#define PCIM_EXP_SLOT_STA_DLLSC 0x0100 -#define PCIR_EXPRESS_ROOT_CTL 0x1c -#define PCIR_EXPRESS_ROOT_CAP 0x1e -#define PCIR_EXPRESS_ROOT_STA 0x20 -#define PCIR_EXPRESS_DEVICE_CAP2 0x24 -#define PCIR_EXPRESS_DEVICE_CTL2 0x28 -#define PCIM_EXP_CTL2_COMP_TIMEOUT_VAL 0x000f -#define PCIM_EXP_CTL2_COMP_TIMEOUT_DIS 0x0010 -#define PCIM_EXP_CTL2_ARI 0x0020 -#define PCIM_EXP_CTL2_ATOMIC_REQ_ENABLE 0x0040 -#define PCIM_EXP_CTL2_ATOMIC_EGR_BLOCK 0x0080 -#define PCIM_EXP_CTL2_ID_ORDERED_REQ_EN 0x0100 -#define PCIM_EXP_CTL2_ID_ORDERED_CMP_EN 0x0200 -#define PCIM_EXP_CTL2_LTR_ENABLE 0x0400 -#define PCIM_EXP_CTL2_OBFF 0x6000 -#define PCIM_EXP_OBFF_DISABLE 0x0000 -#define PCIM_EXP_OBFF_MSGA_ENABLE 0x2000 -#define PCIM_EXP_OBFF_MSGB_ENABLE 0x4000 -#define PCIM_EXP_OBFF_WAKE_ENABLE 0x6000 -#define PCIM_EXP_CTL2_END2END_TLP 0x8000 -#define PCIR_EXPRESS_DEVICE_STA2 0x2a -#define PCIR_EXPRESS_LINK_CAP2 0x2c -#define PCIR_EXPRESS_LINK_CTL2 0x30 -#define PCIR_EXPRESS_LINK_STA2 0x32 -#define PCIR_EXPRESS_SLOT_CAP2 0x34 -#define PCIR_EXPRESS_SLOT_CTL2 0x38 -#define PCIR_EXPRESS_SLOT_STA2 0x3a +#define PCIER_FLAGS 0x2 +#define PCIEM_FLAGS_VERSION 0x000F +#define PCIEM_FLAGS_TYPE 0x00F0 +#define PCIEM_TYPE_ENDPOINT 0x0000 +#define PCIEM_TYPE_LEGACY_ENDPOINT 0x0010 +#define PCIEM_TYPE_ROOT_PORT 0x0040 +#define PCIEM_TYPE_UPSTREAM_PORT 0x0050 +#define PCIEM_TYPE_DOWNSTREAM_PORT 0x0060 +#define PCIEM_TYPE_PCI_BRIDGE 0x0070 +#define PCIEM_TYPE_PCIE_BRIDGE 0x0080 +#define PCIEM_TYPE_ROOT_INT_EP 0x0090 +#define PCIEM_TYPE_ROOT_EC 0x00a0 +#define PCIEM_FLAGS_SLOT 0x0100 +#define PCIEM_FLAGS_IRQ 0x3e00 +#define PCIER_DEVICE_CAP 0x4 +#define PCIEM_CAP_MAX_PAYLOAD 0x00000007 +#define PCIEM_CAP_PHANTHOM_FUNCS 0x00000018 +#define PCIEM_CAP_EXT_TAG_FIELD 0x00000020 +#define PCIEM_CAP_L0S_LATENCY 0x000001c0 +#define PCIEM_CAP_L1_LATENCY 0x00000e00 +#define PCIEM_CAP_ROLE_ERR_RPT 0x00008000 +#define PCIEM_CAP_SLOT_PWR_LIM_VAL 0x03fc0000 +#define PCIEM_CAP_SLOT_PWR_LIM_SCALE 0x0c000000 +#define PCIEM_CAP_FLR 0x10000000 +#define PCIER_DEVICE_CTL 0x8 +#define PCIEM_CTL_COR_ENABLE 0x0001 +#define PCIEM_CTL_NFER_ENABLE 0x0002 +#define PCIEM_CTL_FER_ENABLE 0x0004 +#define PCIEM_CTL_URR_ENABLE 0x0008 +#define PCIEM_CTL_RELAXED_ORD_ENABLE 0x0010 +#define PCIEM_CTL_MAX_PAYLOAD 0x00e0 +#define PCIEM_CTL_EXT_TAG_FIELD 0x0100 +#define PCIEM_CTL_PHANTHOM_FUNCS 0x0200 +#define PCIEM_CTL_AUX_POWER_PM 0x0400 +#define PCIEM_CTL_NOSNOOP_ENABLE 0x0800 +#define PCIEM_CTL_MAX_READ_REQUEST 0x7000 +#define PCIEM_CTL_BRDG_CFG_RETRY 0x8000 /* PCI-E - PCI/PCI-X bridges */ +#define PCIEM_CTL_INITIATE_FLR 0x8000 /* FLR capable endpoints */ +#define PCIER_DEVICE_STA 0xa +#define PCIEM_STA_CORRECTABLE_ERROR 0x0001 +#define PCIEM_STA_NON_FATAL_ERROR 0x0002 +#define PCIEM_STA_FATAL_ERROR 0x0004 +#define PCIEM_STA_UNSUPPORTED_REQ 0x0008 +#define PCIEM_STA_AUX_POWER 0x0010 +#define PCIEM_STA_TRANSACTION_PND 0x0020 +#define PCIER_LINK_CAP 0xc +#define PCIEM_LINK_CAP_MAX_SPEED 0x0000000f +#define PCIEM_LINK_CAP_MAX_WIDTH 0x000003f0 +#define PCIEM_LINK_CAP_ASPM 0x00000c00 +#define PCIEM_LINK_CAP_L0S_EXIT 0x00007000 +#define PCIEM_LINK_CAP_L1_EXIT 0x00038000 +#define PCIEM_LINK_CAP_CLOCK_PM 0x00040000 +#define PCIEM_LINK_CAP_SURPRISE_DOWN 0x00080000 +#define PCIEM_LINK_CAP_DL_ACTIVE 0x00100000 +#define PCIEM_LINK_CAP_LINK_BW_NOTIFY 0x00200000 +#define PCIEM_LINK_CAP_ASPM_COMPLIANCE 0x00400000 +#define PCIEM_LINK_CAP_PORT 0xff000000 +#define PCIER_LINK_CTL 0x10 +#define PCIEM_LINK_CTL_ASPMC_DIS 0x0000 +#define PCIEM_LINK_CTL_ASPMC_L0S 0x0001 +#define PCIEM_LINK_CTL_ASPMC_L1 0x0002 +#define PCIEM_LINK_CTL_ASPMC 0x0003 +#define PCIEM_LINK_CTL_RCB 0x0008 +#define PCIEM_LINK_CTL_LINK_DIS 0x0010 +#define PCIEM_LINK_CTL_RETRAIN_LINK 0x0020 +#define PCIEM_LINK_CTL_COMMON_CLOCK 0x0040 +#define PCIEM_LINK_CTL_EXTENDED_SYNC 0x0080 +#define PCIEM_LINK_CTL_ECPM 0x0100 +#define PCIEM_LINK_CTL_HAWD 0x0200 +#define PCIEM_LINK_CTL_LBMIE 0x0400 +#define PCIEM_LINK_CTL_LABIE 0x0800 +#define PCIER_LINK_STA 0x12 +#define PCIEM_LINK_STA_SPEED 0x000f +#define PCIEM_LINK_STA_WIDTH 0x03f0 +#define PCIEM_LINK_STA_TRAINING_ERROR 0x0400 +#define PCIEM_LINK_STA_TRAINING 0x0800 +#define PCIEM_LINK_STA_SLOT_CLOCK 0x1000 +#define PCIEM_LINK_STA_DL_ACTIVE 0x2000 +#define PCIEM_LINK_STA_LINK_BW_MGMT 0x4000 +#define PCIEM_LINK_STA_LINK_AUTO_BW 0x8000 +#define PCIER_SLOT_CAP 0x14 +#define PCIEM_SLOT_CAP_APB 0x00000001 +#define PCIEM_SLOT_CAP_PCP 0x00000002 +#define PCIEM_SLOT_CAP_MRLSP 0x00000004 +#define PCIEM_SLOT_CAP_AIP 0x00000008 +#define PCIEM_SLOT_CAP_PIP 0x00000010 +#define PCIEM_SLOT_CAP_HPS 0x00000020 +#define PCIEM_SLOT_CAP_HPC 0x00000040 +#define PCIEM_SLOT_CAP_SPLV 0x00007f80 +#define PCIEM_SLOT_CAP_SPLS 0x00018000 +#define PCIEM_SLOT_CAP_EIP 0x00020000 +#define PCIEM_SLOT_CAP_NCCS 0x00040000 +#define PCIEM_SLOT_CAP_PSN 0xfff80000 +#define PCIER_SLOT_CTL 0x18 +#define PCIEM_SLOT_CTL_ABPE 0x0001 +#define PCIEM_SLOT_CTL_PFDE 0x0002 +#define PCIEM_SLOT_CTL_MRLSCE 0x0004 +#define PCIEM_SLOT_CTL_PDCE 0x0008 +#define PCIEM_SLOT_CTL_CCIE 0x0010 +#define PCIEM_SLOT_CTL_HPIE 0x0020 +#define PCIEM_SLOT_CTL_AIC 0x00c0 +#define PCIEM_SLOT_CTL_PIC 0x0300 +#define PCIEM_SLOT_CTL_PCC 0x0400 +#define PCIEM_SLOT_CTL_EIC 0x0800 +#define PCIEM_SLOT_CTL_DLLSCE 0x1000 +#define PCIER_SLOT_STA 0x1a +#define PCIEM_SLOT_STA_ABP 0x0001 +#define PCIEM_SLOT_STA_PFD 0x0002 +#define PCIEM_SLOT_STA_MRLSC 0x0004 +#define PCIEM_SLOT_STA_PDC 0x0008 +#define PCIEM_SLOT_STA_CC 0x0010 +#define PCIEM_SLOT_STA_MRLSS 0x0020 +#define PCIEM_SLOT_STA_PDS 0x0040 +#define PCIEM_SLOT_STA_EIS 0x0080 +#define PCIEM_SLOT_STA_DLLSC 0x0100 +#define PCIER_ROOT_CTL 0x1c +#define PCIER_ROOT_CAP 0x1e +#define PCIER_ROOT_STA 0x20 +#define PCIER_DEVICE_CAP2 0x24 +#define PCIER_DEVICE_CTL2 0x28 +#define PCIEM_CTL2_COMP_TIMEOUT_VAL 0x000f +#define PCIEM_CTL2_COMP_TIMEOUT_DIS 0x0010 +#define PCIEM_CTL2_ARI 0x0020 +#define PCIEM_CTL2_ATOMIC_REQ_ENABLE 0x0040 +#define PCIEM_CTL2_ATOMIC_EGR_BLOCK 0x0080 +#define PCIEM_CTL2_ID_ORDERED_REQ_EN 0x0100 +#define PCIEM_CTL2_ID_ORDERED_CMP_EN 0x0200 +#define PCIEM_CTL2_LTR_ENABLE 0x0400 +#define PCIEM_CTL2_OBFF 0x6000 +#define PCIEM_OBFF_DISABLE 0x0000 +#define PCIEM_OBFF_MSGA_ENABLE 0x2000 +#define PCIEM_OBFF_MSGB_ENABLE 0x4000 +#define PCIEM_OBFF_WAKE_ENABLE 0x6000 +#define PCIEM_CTL2_END2END_TLP 0x8000 +#define PCIER_DEVICE_STA2 0x2a +#define PCIER_LINK_CAP2 0x2c +#define PCIER_LINK_CTL2 0x30 +#define PCIER_LINK_STA2 0x32 +#define PCIER_SLOT_CAP2 0x34 +#define PCIER_SLOT_CTL2 0x38 +#define PCIER_SLOT_STA2 0x3a /* MSI-X definitions */ #define PCIR_MSIX_CTRL 0x2 Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/dev/re/if_re.c Tue Sep 18 22:04:59 2012 (r240680) @@ -1343,14 +1343,14 @@ re_attach(device_t dev) /* Disable ASPM L0S/L1. */ if (sc->rl_expcap != 0) { cap = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CAP, 2); - if ((cap & PCIM_LINK_CAP_ASPM) != 0) { + PCIER_LINK_CAP, 2); + if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = pci_read_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, 2); + PCIER_LINK_CTL, 2); if ((ctl & 0x0003) != 0) { ctl &= ~0x0003; pci_write_config(dev, sc->rl_expcap + - PCIR_EXPRESS_LINK_CTL, ctl, 2); + PCIER_LINK_CTL, ctl, 2); device_printf(dev, "ASPM disabled\n"); } } else Modified: head/sys/ofed/include/linux/pci.h ============================================================================== --- head/sys/ofed/include/linux/pci.h Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/ofed/include/linux/pci.h Tue Sep 18 22:04:59 2012 (r240680) @@ -82,8 +82,8 @@ struct pci_device_id { #define PCI_VENDOR_ID PCIR_DEVVENDOR #define PCI_COMMAND PCIR_COMMAND -#define PCI_EXP_DEVCTL PCIR_EXPRESS_DEVICE_CTL -#define PCI_EXP_LNKCTL PCIR_EXPRESS_LINK_CTL +#define PCI_EXP_DEVCTL PCIER_DEVICE_CTL +#define PCI_EXP_LNKCTL PCIER_LINK_CTL #define IORESOURCE_MEM SYS_RES_MEMORY #define IORESOURCE_IO SYS_RES_IOPORT Modified: head/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/sys/powerpc/mpc85xx/pci_fdt.c Tue Sep 18 22:04:59 2012 (r240680) @@ -848,10 +848,10 @@ fsl_pcib_err_init(device_t dev) 0xffffffff); dsr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, 2); + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 2); if (dsr) fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_STA, + sc->sc_pcie_capreg + PCIER_DEVICE_STA, 0xffff, 2); /* Enable all errors reporting */ @@ -861,11 +861,11 @@ fsl_pcib_err_init(device_t dev) /* Enable error reporting: URR, FER, NFER */ dcr = fsl_pcib_cfgread(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, 4); - dcr |= PCIM_EXP_CTL_URR_ENABLE | PCIM_EXP_CTL_FER_ENABLE | - PCIM_EXP_CTL_NFER_ENABLE; + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, 4); + dcr |= PCIEM_CTL_URR_ENABLE | PCIEM_CTL_FER_ENABLE | + PCIEM_CTL_NFER_ENABLE; fsl_pcib_cfgwrite(sc, 0, 0, 0, - sc->sc_pcie_capreg + PCIR_EXPRESS_DEVICE_CTL, dcr, 4); + sc->sc_pcie_capreg + PCIER_DEVICE_CTL, dcr, 4); } } Modified: head/usr.sbin/pciconf/cap.c ============================================================================== --- head/usr.sbin/pciconf/cap.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/usr.sbin/pciconf/cap.c Tue Sep 18 22:04:59 2012 (r240680) @@ -369,55 +369,55 @@ cap_express(int fd, struct pci_conf *p, uint32_t val; uint16_t flags; - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_FLAGS, 2); - printf("PCI-Express %d ", flags & PCIM_EXP_FLAGS_VERSION); - switch (flags & PCIM_EXP_FLAGS_TYPE) { - case PCIM_EXP_TYPE_ENDPOINT: + flags = read_config(fd, &p->pc_sel, ptr + PCIER_FLAGS, 2); + printf("PCI-Express %d ", flags & PCIEM_FLAGS_VERSION); + switch (flags & PCIEM_FLAGS_TYPE) { + case PCIEM_TYPE_ENDPOINT: printf("endpoint"); break; - case PCIM_EXP_TYPE_LEGACY_ENDPOINT: + case PCIEM_TYPE_LEGACY_ENDPOINT: printf("legacy endpoint"); break; - case PCIM_EXP_TYPE_ROOT_PORT: + case PCIEM_TYPE_ROOT_PORT: printf("root port"); break; - case PCIM_EXP_TYPE_UPSTREAM_PORT: + case PCIEM_TYPE_UPSTREAM_PORT: printf("upstream port"); break; - case PCIM_EXP_TYPE_DOWNSTREAM_PORT: + case PCIEM_TYPE_DOWNSTREAM_PORT: printf("downstream port"); break; - case PCIM_EXP_TYPE_PCI_BRIDGE: + case PCIEM_TYPE_PCI_BRIDGE: printf("PCI bridge"); break; - case PCIM_EXP_TYPE_PCIE_BRIDGE: + case PCIEM_TYPE_PCIE_BRIDGE: printf("PCI to PCIe bridge"); break; - case PCIM_EXP_TYPE_ROOT_INT_EP: + case PCIEM_TYPE_ROOT_INT_EP: printf("root endpoint"); break; - case PCIM_EXP_TYPE_ROOT_EC: + case PCIEM_TYPE_ROOT_EC: printf("event collector"); break; default: - printf("type %d", (flags & PCIM_EXP_FLAGS_TYPE) >> 4); + printf("type %d", (flags & PCIEM_FLAGS_TYPE) >> 4); break; } - if (flags & PCIM_EXP_FLAGS_SLOT) + if (flags & PCIEM_FLAGS_SLOT) printf(" slot"); - if (flags & PCIM_EXP_FLAGS_IRQ) - printf(" IRQ %d", (flags & PCIM_EXP_FLAGS_IRQ) >> 9); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_DEVICE_CTL, 2); + if (flags & PCIEM_FLAGS_IRQ) + printf(" IRQ %d", (flags & PCIEM_FLAGS_IRQ) >> 9); + val = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr + PCIER_DEVICE_CTL, 2); printf(" max data %d(%d)", - MAX_PAYLOAD((flags & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5), - MAX_PAYLOAD(val & PCIM_EXP_CAP_MAX_PAYLOAD)); - if (val & PCIM_EXP_CAP_FLR) + MAX_PAYLOAD((flags & PCIEM_CTL_MAX_PAYLOAD) >> 5), + MAX_PAYLOAD(val & PCIEM_CAP_MAX_PAYLOAD)); + if (val & PCIEM_CAP_FLR) printf(" FLR"); - val = read_config(fd, &p->pc_sel, ptr + PCIR_EXPRESS_LINK_CAP, 4); - flags = read_config(fd, &p->pc_sel, ptr+ PCIR_EXPRESS_LINK_STA, 2); - printf(" link x%d(x%d)", (flags & PCIM_LINK_STA_WIDTH) >> 4, - (val & PCIM_LINK_CAP_MAX_WIDTH) >> 4); + val = read_config(fd, &p->pc_sel, ptr + PCIER_LINK_CAP, 4); + flags = read_config(fd, &p->pc_sel, ptr+ PCIER_LINK_STA, 2); + printf(" link x%d(x%d)", (flags & PCIEM_LINK_STA_WIDTH) >> 4, + (val & PCIEM_LINK_CAP_MAX_WIDTH) >> 4); } static void Modified: head/usr.sbin/pciconf/err.c ============================================================================== --- head/usr.sbin/pciconf/err.c Tue Sep 18 21:36:24 2012 (r240679) +++ head/usr.sbin/pciconf/err.c Tue Sep 18 22:04:59 2012 (r240680) @@ -63,18 +63,18 @@ static struct bit_table pci_status[] = { /* Error indicators in the PCI-Express device status register. */ static struct bit_table pcie_device_status[] = { - { PCIM_EXP_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, - { PCIM_EXP_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, - { PCIM_EXP_STA_FATAL_ERROR, "Fatal Error Detected" }, - { PCIM_EXP_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, + { PCIEM_STA_CORRECTABLE_ERROR, "Correctable Error Detected" }, + { PCIEM_STA_NON_FATAL_ERROR, "Non-Fatal Error Detected" }, + { PCIEM_STA_FATAL_ERROR, "Fatal Error Detected" }, + { PCIEM_STA_UNSUPPORTED_REQ, "Unsupported Request Detected" }, { 0, NULL }, }; /* Valid error indicator bits in the PCI-Express device status register. */ -#define PCIE_ERRORS (PCIM_EXP_STA_CORRECTABLE_ERROR | \ - PCIM_EXP_STA_NON_FATAL_ERROR | \ - PCIM_EXP_STA_FATAL_ERROR | \ - PCIM_EXP_STA_UNSUPPORTED_REQ) +#define PCIE_ERRORS (PCIEM_STA_CORRECTABLE_ERROR | \ + PCIEM_STA_NON_FATAL_ERROR | \ + PCIEM_STA_FATAL_ERROR | \ + PCIEM_STA_UNSUPPORTED_REQ) /* AER Uncorrected errors. */ static struct bit_table aer_uc[] = { @@ -153,7 +153,7 @@ list_errors(int fd, struct pci_conf *p) return; /* Check for PCI-e errors. */ - sta = read_config(fd, &p->pc_sel, pcie + PCIR_EXPRESS_DEVICE_STA, 2); + sta = read_config(fd, &p->pc_sel, pcie + PCIER_DEVICE_STA, 2); print_bits("PCI-e errors", pcie_device_status, sta & PCIE_ERRORS); /* See if this device supports AER. */ From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 22:09:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A959A1065780; Tue, 18 Sep 2012 22:09:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92D968FC1A; Tue, 18 Sep 2012 22:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IM9OAb071106; Tue, 18 Sep 2012 22:09:24 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IM9OfK071096; Tue, 18 Sep 2012 22:09:24 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209182209.q8IM9OfK071096@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 18 Sep 2012 22:09: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: r240682 - in head/usr.sbin/pkg_install: add create info lib version X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 22:09:24 -0000 Author: bapt Date: Tue Sep 18 22:09:23 2012 New Revision: 240682 URL: http://svn.freebsd.org/changeset/base/240682 Log: if a file in plist starts with / then do not prefix it with "prefix" [1] pkg info -g returns 1 if a file mismatch [2] flush stdout in pkg info -g [3] clean up quiet mode (-q | --quiet) output of pkg_version(1) [4] fix missing error call in uname check added to pkg_version(1) [5] fix pkg_add(1) fails to install with -C from bad path [6] only resolve path from pkg_add(1) -p if the given prefix do not start with a '/' [7] PR: bin/13128 [1] bin/139015 [2] bin/113702 [3] bin/142570 [4] bin/146857 [5] bin/157543 [6] Submitted by: cy [1] Anton Yuzhaninov [2] Ighighi [3] "N.J. Mann" [4] gcooper [5] David Naylor [6] netchild [7] MFC after: 2 weeks Modified: head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/create/perform.c head/usr.sbin/pkg_install/info/info.h head/usr.sbin/pkg_install/info/perform.c head/usr.sbin/pkg_install/info/show.c head/usr.sbin/pkg_install/lib/lib.h head/usr.sbin/pkg_install/lib/plist.c head/usr.sbin/pkg_install/version/perform.c Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/add/main.c Tue Sep 18 22:09:23 2012 (r240682) @@ -288,7 +288,9 @@ main(int argc, char **argv) } /* Perform chroot if requested */ if (Chroot != NULL) { - if (chroot(Chroot)) + if (chdir(Chroot)) + errx(1, "chdir to %s failed", Chroot); + if (chroot(".")) errx(1, "chroot to %s failed", Chroot); } /* Make sure the sub-execs we invoke get found */ Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/create/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -215,10 +215,14 @@ pkg_perform(char **pkgs) /* Prefix should add an @cwd to the packing list */ if (Prefix) { - char resolved_prefix[PATH_MAX]; - if (realpath(Prefix, resolved_prefix) == NULL) - err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); - add_plist_top(&plist, PLIST_CWD, resolved_prefix); + if (Prefix[0] != '/') { + char resolved_prefix[PATH_MAX]; + if (realpath(Prefix, resolved_prefix) == NULL) + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); + add_plist_top(&plist, PLIST_CWD, resolved_prefix); + } else { + add_plist_top(&plist, PLIST_CWD, Prefix); + } } /* Add the origin if asked, at the top */ Modified: head/usr.sbin/pkg_install/info/info.h ============================================================================== --- head/usr.sbin/pkg_install/info/info.h Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/info.h Tue Sep 18 22:09:23 2012 (r240682) @@ -77,7 +77,7 @@ extern void show_plist(const char *, Pac extern void show_files(const char *, Package *); extern void show_index(const char *, const char *); extern void show_size(const char *, Package *); -extern void show_cksum(const char *, Package *); +extern int show_cksum(const char *, Package *); extern void show_origin(const char *, Package *); extern void show_fmtrev(const char *, Package *); Modified: head/usr.sbin/pkg_install/info/perform.c ============================================================================== --- head/usr.sbin/pkg_install/info/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -221,7 +221,7 @@ pkg_do(char *pkg) if ((Flags & SHOW_SIZE) && installed) show_size("Package Size:\n", &plist); if ((Flags & SHOW_CKSUM) && installed) - show_cksum("Mismatched Checksums:\n", &plist); + code += show_cksum("Mismatched Checksums:\n", &plist); if (Flags & SHOW_ORIGIN) show_origin("Origin:\n", &plist); if (Flags & SHOW_FMTREV) @@ -234,7 +234,7 @@ pkg_do(char *pkg) leave_playpen(); if (isTMP) unlink(fname); - return code; + return (code ? 1 : 0); } void Modified: head/usr.sbin/pkg_install/info/show.c ============================================================================== --- head/usr.sbin/pkg_install/info/show.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/info/show.c Tue Sep 18 22:09:23 2012 (r240682) @@ -61,8 +61,10 @@ show_index(const char *title, const char strlcpy(line, "???\n", sizeof(line)); - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } fp = fopen(fname, "r"); if (fp == (FILE *) NULL) { warnx("show_file: can't open '%s' for reading", fname); @@ -88,8 +90,10 @@ show_plist(const char *title, Package *p Boolean ign = FALSE; char *prefix = NULL; - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } p = plist->head; while (p) { if (p->type != type && showall != TRUE) { @@ -272,8 +276,10 @@ show_size(const char *title, Package *pl char *prefix = NULL; descr = getbsize(&headerlen, &blksize); - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } for (p = plist->head; p != NULL; p = p->next) { switch (p->type) { case PLIST_FILE: @@ -316,16 +322,19 @@ show_size(const char *title, Package *pl } /* Show files that don't match the recorded checksum */ -void +int show_cksum(const char *title, Package *plist) { PackingList p; const char *dir = "."; char *prefix = NULL; char tmp[FILENAME_MAX]; + int errcode = 0; - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } for (p = plist->head; p != NULL; p = p->next) if (p->type == PLIST_CWD) { @@ -337,9 +346,10 @@ show_cksum(const char *title, Package *p dir = p->name; } else if (p->type == PLIST_FILE) { snprintf(tmp, FILENAME_MAX, "%s/%s", elide_root(dir), p->name); - if (!fexists(tmp)) + if (!fexists(tmp)) { warnx("%s doesn't exist", tmp); - else if (p->next && p->next->type == PLIST_COMMENT && + errcode = 1; + } else if (p->next && p->next->type == PLIST_COMMENT && (strncmp(p->next->name, "MD5:", 4) == 0)) { char *cp = NULL, buf[33]; @@ -366,6 +376,7 @@ show_cksum(const char *title, Package *p } } } + return (errcode); } /* Show an "origin" path (usually category/portname) */ @@ -373,8 +384,10 @@ void show_origin(const char *title, Package *plist) { - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } printf("%s\n", plist->origin != NULL ? plist->origin : ""); } @@ -383,7 +396,9 @@ void show_fmtrev(const char *title, Package *plist) { - if (!Quiet) + if (!Quiet) { printf("%s%s", InfoPrefix, title); + fflush(stdout); + } printf("%d.%d\n", plist->fmtver_maj, plist->fmtver_mnr); } Modified: head/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- head/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/lib/lib.h Tue Sep 18 22:09:23 2012 (r240682) @@ -99,7 +99,7 @@ * Version of the package tools - increase whenever you make a change * in the code that is not cosmetic only. */ -#define PKG_INSTALL_VERSION 20120913 +#define PKG_INSTALL_VERSION 20120918 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: head/usr.sbin/pkg_install/lib/plist.c ============================================================================== --- head/usr.sbin/pkg_install/lib/plist.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/lib/plist.c Tue Sep 18 22:09:23 2012 (r240682) @@ -458,7 +458,10 @@ delete_package(Boolean ign_err, Boolean case PLIST_FILE: last_file = p->name; - sprintf(tmp, "%s/%s", Where, p->name); + if (*p->name == '/') + strlcpy(tmp, p->name, FILENAME_MAX); + else + sprintf(tmp, "%s/%s", Where, p->name); if (isdir(tmp) && fexists(tmp) && !issymlink(tmp)) { warnx("cannot delete specified file '%s' - it is a directory!\n" "this packing list is incorrect - ignoring delete request", tmp); Modified: head/usr.sbin/pkg_install/version/perform.c ============================================================================== --- head/usr.sbin/pkg_install/version/perform.c Tue Sep 18 22:08:51 2012 (r240681) +++ head/usr.sbin/pkg_install/version/perform.c Tue Sep 18 22:09:23 2012 (r240682) @@ -56,10 +56,11 @@ pkg_perform(char **indexarg) struct utsname u; if (uname(&u) == -1) { - warn("%s(): failed to determine uname information", __func__); + warn("%s: failed to determine uname information", __func__); return 1; } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { - + warnx("%s: bad release version specified: %s", __func__, u.release); + return 1; } /* @@ -321,19 +322,31 @@ show_version(Package plist, const char * ver = strrchr(latest, '-'); ver = ver ? &ver[1] : latest; if (cmp < 0 && OUTPUT('<')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '<'); - if (Verbose) - printf(" needs updating (%s has %s)", source, ver); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s <", tmp); + if (Verbose) + printf(" needs updating (%s has %s)", source, ver); + } printf("\n"); } else if (cmp == 0 && OUTPUT('=')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '='); - if (Verbose) - printf(" up-to-date with %s", source); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s =", tmp); + if (Verbose) + printf(" up-to-date with %s", source); + } printf("\n"); } else if (cmp > 0 && OUTPUT('>')) { - printf("%-34s %c", tmp, Quiet ? '\0' : '>'); - if (Verbose) - printf(" succeeds %s (%s has %s)", source, source, ver); + if (Quiet) + printf("%s", tmp); + else { + printf("%-34s >", tmp); + if (Verbose) + printf(" succeeds %s (%s has %s)", source, source, ver); + } printf("\n"); } } From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 22:25:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8885106566C; Tue, 18 Sep 2012 22:25: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 A3FFE8FC0C; Tue, 18 Sep 2012 22:25:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IMPnTn073465; Tue, 18 Sep 2012 22:25:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IMPn0Q073463; Tue, 18 Sep 2012 22:25:49 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209182225.q8IMPn0Q073463@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 18 Sep 2012 22:25: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: r240683 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Sep 2012 22:25:49 -0000 Author: gavin Date: Tue Sep 18 22:25:49 2012 New Revision: 240683 URL: http://svn.freebsd.org/changeset/base/240683 Log: Add entries for two USB devices I have locally. MFC after: 1 week Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 18 22:09:23 2012 (r240682) +++ head/sys/dev/usb/usbdevs Tue Sep 18 22:25:49 2012 (r240683) @@ -407,6 +407,7 @@ vendor ALLIEDCABLE 0x07e6 Allied Cable vendor STSN 0x07ef STSN vendor CENTURY 0x07f7 Century Corp vendor NEWLINK 0x07ff NEWlink +vendor MAGTEK 0x0801 Mag-Tek vendor ZOOM 0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems vendor ALPHASMART 0x081e AlphaSmart, Inc. @@ -2493,6 +2494,9 @@ product LUWEN EASYDISK 0x0005 EasyDisc /* Macally products */ product MACALLY MOUSE1 0x0101 mouse +/* Mag-Tek products */ +product MAGTEK USBSWIPE 0x0002 USB Mag Stripe Swipe Reader + /* Marvell Technology Group, Ltd. products */ product MARVELL SHEEVAPLUG 0x9e8f SheevaPlug serial interface @@ -3446,6 +3450,7 @@ product RALINK RT3071 0x3071 RT3071 product RALINK RT3072 0x3072 RT3072 product RALINK RT3370 0x3370 RT3370 product RALINK RT3572 0x3572 RT3572 +product RALINK RT5370 0x5370 RT5370 product RALINK RT8070 0x8070 RT8070 product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter From owner-svn-src-head@FreeBSD.ORG Tue Sep 18 22:28:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B3A1065672; Tue, 18 Sep 2012 22:28:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3E448FC0A; Tue, 18 Sep 2012 22:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8IMShfA073891; Tue, 18 Sep 2012 22:28:43 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8IMShup073845; Tue, 18 Sep 2012 22:28:43 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209182228.q8IMShup073845@svn.freebsd.org> From: Devin Teske Date: Tue, 18 Sep 2012 22:28: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: r240684 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot include mouse networking networking/include networking/share password password/include password/share security s... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Sep 2012 22:28:44 -0000 Author: dteske Date: Tue Sep 18 22:28:42 2012 New Revision: 240684 URL: http://svn.freebsd.org/changeset/base/240684 Log: Move major includes into /usr/share/bsdconfig for easy external access. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Added: head/usr.sbin/bsdconfig/networking/share/ head/usr.sbin/bsdconfig/networking/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/networking/share/common.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/common.subr head/usr.sbin/bsdconfig/networking/share/device.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr - copied, changed from r240679, head/usr.sbin/bsdconfig/networking/include/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/networking/include/routing.subr head/usr.sbin/bsdconfig/password/share/ head/usr.sbin/bsdconfig/password/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/password/share/password.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/password/include/password.subr head/usr.sbin/bsdconfig/share/ head/usr.sbin/bsdconfig/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/share/common.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/include/common.subr head/usr.sbin/bsdconfig/share/dialog.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/include/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/include/sysrc.subr head/usr.sbin/bsdconfig/startup/share/ head/usr.sbin/bsdconfig/startup/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/startup/share/rcconf.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcedit.subr head/usr.sbin/bsdconfig/startup/share/rcvar.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/startup/include/rcvar.subr head/usr.sbin/bsdconfig/timezone/share/ head/usr.sbin/bsdconfig/timezone/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/timezone/share/continents.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr - copied unchanged from r239358, head/usr.sbin/bsdconfig/timezone/include/countries.subr head/usr.sbin/bsdconfig/timezone/share/iso3166.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/iso3166.subr head/usr.sbin/bsdconfig/timezone/share/menus.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/menus.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/timezone/include/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/ head/usr.sbin/bsdconfig/usermgmt/share/Makefile (contents, props changed) head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/usermgmt/include/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr - copied, changed from r239358, head/usr.sbin/bsdconfig/usermgmt/include/user_input.subr Deleted: head/usr.sbin/bsdconfig/include/common.subr head/usr.sbin/bsdconfig/include/dialog.subr head/usr.sbin/bsdconfig/include/mustberoot.subr head/usr.sbin/bsdconfig/include/strings.subr head/usr.sbin/bsdconfig/include/sysrc.subr head/usr.sbin/bsdconfig/networking/include/common.subr head/usr.sbin/bsdconfig/networking/include/device.subr head/usr.sbin/bsdconfig/networking/include/hostname.subr head/usr.sbin/bsdconfig/networking/include/ipaddr.subr head/usr.sbin/bsdconfig/networking/include/media.subr head/usr.sbin/bsdconfig/networking/include/netmask.subr head/usr.sbin/bsdconfig/networking/include/resolv.subr head/usr.sbin/bsdconfig/networking/include/routing.subr head/usr.sbin/bsdconfig/password/include/password.subr head/usr.sbin/bsdconfig/startup/include/rcconf.subr head/usr.sbin/bsdconfig/startup/include/rcedit.subr head/usr.sbin/bsdconfig/startup/include/rcvar.subr head/usr.sbin/bsdconfig/timezone/include/continents.subr head/usr.sbin/bsdconfig/timezone/include/countries.subr head/usr.sbin/bsdconfig/timezone/include/iso3166.subr head/usr.sbin/bsdconfig/timezone/include/menus.subr head/usr.sbin/bsdconfig/timezone/include/zones.subr head/usr.sbin/bsdconfig/usermgmt/include/group_input.subr head/usr.sbin/bsdconfig/usermgmt/include/user_input.subr Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/include/Makefile head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/Makefile head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/include/Makefile head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/password/Makefile head/usr.sbin/bsdconfig/password/include/Makefile head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/startup/Makefile head/usr.sbin/bsdconfig/startup/include/Makefile head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcedit head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/Makefile head/usr.sbin/bsdconfig/timezone/include/Makefile head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/Makefile head/usr.sbin/bsdconfig/usermgmt/groupadd head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/include/Makefile head/usr.sbin/bsdconfig/usermgmt/useradd head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -12,6 +12,7 @@ SUBDIR= console \ networking \ password \ security \ + share \ startup \ timezone \ ttys \ Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/bsdconfig Tue Sep 18 22:28:42 2012 (r240684) @@ -29,11 +29,13 @@ # ############################################################ INCLUDES +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/strings.subr + BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/strings.subr f_include_lang $BSDCFG_LIBE/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/console Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/font Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/keymap Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/repeat Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/saver Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/screenmap Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/console/ttys Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="080.console" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="050.diskmgmt" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="050.diskmgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="020.docsinstall" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="020.docsinstall" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/dot/dot Tue Sep 18 22:28:42 2012 (r240684) @@ -28,11 +28,11 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include_lang $BSDCFG_LIBE/include/messages.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 -APP_DIR="dot" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="dot" +f_include_lang $BSDCFG_LIBE/include/messages.subr f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,8 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/include -FILES= common.subr dialog.subr messages.subr mustberoot.subr \ - strings.subr sysrc.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/disable Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/enable Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/flags Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/mouse Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/port Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/mouse/type Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="110.mouse" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -2,7 +2,7 @@ NO_OBJ= -SUBDIR= include +SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking FILES= INDEX USAGE Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/routing.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/routing.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/devices Tue Sep 18 22:28:42 2012 (r240684) @@ -28,17 +28,17 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/device.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/media.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/netmask.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/device.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr +f_include $BSDCFG_SHARE/networking/media.subr +f_include $BSDCFG_SHARE/networking/netmask.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/hostname Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/hostname.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/hostname.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,8 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include -FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ - messages.subr netmask.subr resolv.subr routing.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/nameservers Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/networking/resolv.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/networking/networking Tue Sep 18 22:28:42 2012 (r240684) @@ -28,12 +28,12 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr -APP_DIR="120.networking" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) @@ -122,7 +122,7 @@ while :; do # Make subsequent uses of this menu faster by not performing # "ifconfig up" (limiting the pain one must endure). See also - # `$BSDCFG_LIBE/$APP_DIR/include/device.subr'. + # `$BSDCFG_SHARE/networking/device.subr'. # export DIALOG_MENU_NETDEV_KICK_INTERFACES= ;; Added: head/usr.sbin/bsdconfig/networking/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/networking/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig/networking +FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \ + netmask.subr resolv.subr routing.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied and modified: head/usr.sbin/bsdconfig/networking/share/common.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/common.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/common.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/common.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,8 +28,8 @@ if [ ! "$_NETWORKING_COMMON_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/device.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/device.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/device.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,18 +28,18 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/sysrc.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/media.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/netmask.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/routing.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr +f_include $BSDCFG_SHARE/networking/media.subr +f_include $BSDCFG_SHARE/networking/netmask.subr +f_include $BSDCFG_SHARE/networking/resolv.subr +f_include $BSDCFG_SHARE/networking/routing.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ GLOBALS Copied and modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/hostname.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/hostname.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; t # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/resolv.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/resolv.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/ipaddr.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/ipaddr.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_IPADDR_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/media.subr (from r240679, head/usr.sbin/bsdconfig/networking/include/media.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/media.subr Tue Sep 18 21:36:24 2012 (r240679, copy source) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/netmask.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/netmask.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ if [ ! "$_NETWORKING_NETMASK_SUBR" ]; th # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Copied and modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/resolv.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/resolv.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_RESOLV_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/strings.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ CONFIGURATION Copied and modified: head/usr.sbin/bsdconfig/networking/share/routing.subr (from r239358, head/usr.sbin/bsdconfig/networking/include/routing.subr) ============================================================================== --- head/usr.sbin/bsdconfig/networking/include/routing.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,14 +28,14 @@ if [ ! "$_NETWORKING_ROUTING_SUBR" ]; th # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/sysrc.subr -f_include $BSDCFG_LIBE/include/dialog.subr - -APP_DIR="120.networking" -f_include $BSDCFG_LIBE/$APP_DIR/include/common.subr -f_include $BSDCFG_LIBE/$APP_DIR/include/ipaddr.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/sysrc.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/networking/common.subr +f_include $BSDCFG_SHARE/networking/ipaddr.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/password/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -2,7 +2,7 @@ NO_OBJ= -SUBDIR= include +SUBDIR= include share FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password FILES= INDEX USAGE Modified: head/usr.sbin/bsdconfig/password/include/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/password/include/Makefile Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/include/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include -FILES= messages.subr password.subr +FILES= messages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/password/password Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/password/password.subr -APP_DIR="040.password" -f_include $BSDCFG_LIBE/$APP_DIR/include/password.subr +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password" ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" Added: head/usr.sbin/bsdconfig/password/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/password/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig/password +FILES= password.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied and modified: head/usr.sbin/bsdconfig/password/share/password.subr (from r239358, head/usr.sbin/bsdconfig/password/include/password.subr) ============================================================================== --- head/usr.sbin/bsdconfig/password/include/password.subr Fri Aug 17 16:27:11 2012 (r239358, copy source) +++ head/usr.sbin/bsdconfig/password/share/password.subr Tue Sep 18 22:28:42 2012 (r240684) @@ -28,11 +28,11 @@ if [ ! "$_PASSWORD_PASSWORD_SUBR" ]; the # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr -APP_DIR="040.password" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="130.security" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="130.security" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Tue Sep 18 22:25:49 2012 (r240683) +++ head/usr.sbin/bsdconfig/security/security Tue Sep 18 22:28:42 2012 (r240684) @@ -28,13 +28,13 @@ # ############################################################ INCLUDES -BSDCFG_LIBE="/usr/libexec/bsdconfig" -. $BSDCFG_LIBE/include/common.subr || exit 1 -f_include $BSDCFG_LIBE/include/dialog.subr -f_include $BSDCFG_LIBE/include/mustberoot.subr -f_include $BSDCFG_LIBE/include/sysrc.subr +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/sysrc.subr -APP_DIR="130.security" +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="130.security" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) Added: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/Makefile Tue Sep 18 22:28:42 2012 (r240684) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig +FILES= common.subr dialog.subr mustberoot.subr strings.subr sysrc.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Copied: head/usr.sbin/bsdconfig/share/common.subr (from r239358, head/usr.sbin/bsdconfig/include/common.subr) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/common.subr Tue Sep 18 22:28:42 2012 (r240684, copy of r239358, head/usr.sbin/bsdconfig/include/common.subr) @@ -0,0 +1,299 @@ +if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 +# +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# 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$ +# +############################################################ GLOBALS + +# +# Program name +# +pgm="${0##*/}" + +# +# Program arguments +# +ARGC="$#" +ARGV="$@" + +# +# Global exit status variables +# +SUCCESS=0 +FAILURE=1 + +############################################################ FUNCTIONS + +# +# This is an empty function by default, to use it, copy +# /usr/share/examples/bsdconfig/bsdconfigrc to $HOME/.bsdconfigrc +# +f_dprintf() +{ + : this page intentionally left blank +} + +# f_err $fmt [ $opts ... ] +# +# Print a message to stderr (fd=2). +# +f_err() +{ + printf "$@" >&2 +} + +# f_quietly $command [ $arguments ... ] +# +# run a command quietly (quell any output to stdout or stderr) +# +f_quietly() +{ + "$@" > /dev/null 2>&1 +} + +# f_have $anything ... +# +# A wrapper to the `type' built-in. Returns true if argument is a valid shell +# built-in, keyword, or externally-tracked binary, otherwise false. +# +f_have() +{ + f_quietly type "$@" +} + +# f_die [ $status [ $fmt [ $opts ... ]]] +# +# Abruptly terminate due to an error optionally displaying a message in a +# dialog box using printf(1) syntax. +# +f_die() +{ + local status=$FAILURE + + # If there is at least one argument, take it as the status + if [ $# -gt 0 ]; then + status=$1 + shift 1 # status + fi + + # If there are still arguments left, pass them to f_show_msg + [ $# -gt 0 ] && f_show_msg "$@" + + # Optionally call f_clean_up() function if it exists + f_have f_clean_up && f_clean_up + + exit $status +} + +# f_interrupt +# +# Interrupt handler. +# +f_interrupt() +{ + exec 2>&1 # fix sh(1) bug where stderr gets lost within async-trap + f_die +} + +# f_show_msg $fmt [ $opts ... ] +# +# Display a message in a dialog box using printf(1) syntax. +# +f_show_msg() *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 01:06:43 2012 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 92115106564A; Wed, 19 Sep 2012 01:06:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 448E814FF33; Wed, 19 Sep 2012 01:06:43 +0000 (UTC) Message-ID: <50591AA3.2050600@FreeBSD.org> Date: Tue, 18 Sep 2012 18:06:43 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Hiroki Sato References: <201209180233.q8I2XNs3022364@svn.freebsd.org> <5058036F.1010104@FreeBSD.org> <20120918.193650.1501104806829364201.hrs@allbsd.org> In-Reply-To: <20120918.193650.1501104806829364201.hrs@allbsd.org> X-Enigmail-Version: 1.4.4 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, bjk@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240628 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 01:06:43 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09/18/2012 03:36, Hiroki Sato wrote: > Doug Barton wrote > in <5058036F.1010104@FreeBSD.org>: > > do> On 09/17/2012 19:33, Benjamin Kaduk wrote: > do> > Whitespace cleanup for ipfw.8 -- start each sentence on a new line, > do> > do> We generally don't do this at all absent other changes. > do> > do> We definitely don't make whitespace-only changes mixed in with other > do> changes, as it makes the diff too hard to read. > > Please read docs/157452 before blaming the commit. The committer is responsible for what they finally commit. The mentor is responsible for review to make sure that final commit meets project guidelines. That said, Ben properly split his changes into 2 patches for the PR, so you should have been sure to tell him to commit it that way, and more importantly, WHY to commit it that way. > And I do not > think adding commas is not making the diff hard to read. That wasn't my point. Mixing ws changes with content changes makes it hard to pick out the content changes (as you well know). Doug - -- I am only one, but I am one. I cannot do everything, but I can do something. And I will not let what I cannot do interfere with what I can do. -- Edward Everett Hale, (1822 - 1909) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJQWRqjAAoJEFzGhvEaGryEt+cIAKQ0eCL/aftTelXyl6pbZT4X UlMECcMqpdQdEtbT91qz+6Pvl3HBO1OcrkywVX3kVt7WNsIKRcBoN/Ns+6Vnvagm G5wMY2MBoJO/v56S7JPC9E6O5YbYM03Fek6ZPNbGO9aIWAzjVhoW7ceN5J4cVErJ Xhtasz86HGXQVpbjmbhGT17iMvXRKHS3Nj+6C48rKr9DmNyqC2snXoY7HsLCmA/z x9GEtkbVOS+fR2REWP/6rseHCqn+MiqMtM5nMwyfHREp1noDNi2oqOtf/oDXDqAK TAWP/nv+m81gK0VFmnpHS6Z/YhhtGUyoNzryZmfpArXtML3+GzbId1R0Y+l6rmY= =O2Vn -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 05:11:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01B5F1065670; Wed, 19 Sep 2012 05:11:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15D28FC0C; Wed, 19 Sep 2012 05:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J5BPqJ029824; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J5BPZL029822; Wed, 19 Sep 2012 05:11:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209190511.q8J5BPZL029822@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 19 Sep 2012 05: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: r240686 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 05:11:26 -0000 Author: kib Date: Wed Sep 19 05:11:25 2012 New Revision: 240686 URL: http://svn.freebsd.org/changeset/base/240686 Log: Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD for a non-absolute path. PR: bin/171604 MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Wed Sep 19 00:27:50 2012 (r240685) +++ head/libexec/rtld-elf/rtld.c Wed Sep 19 05:11:25 2012 (r240686) @@ -1429,7 +1429,7 @@ find_library(const char *xname, const Ob { char *pathname; char *name; - bool objgiven; + bool nodeflib, objgiven; objgiven = refobj != NULL; if (strchr(xname, '/') != NULL) { /* Hard coded pathname */ @@ -1464,6 +1464,7 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) return (pathname); } else { + nodeflib = objgiven ? refobj->z_nodeflib : false; if ((objgiven && (pathname = search_library_path(name, refobj->rpath)) != NULL) || (objgiven && refobj->runpath == NULL && refobj != obj_main && @@ -1471,9 +1472,8 @@ find_library(const char *xname, const Ob (pathname = search_library_path(name, ld_library_path)) != NULL || (objgiven && (pathname = search_library_path(name, refobj->runpath)) != NULL) || - (pathname = search_library_path(name, gethints(refobj->z_nodeflib))) - != NULL || - (objgiven && !refobj->z_nodeflib && + (pathname = search_library_path(name, gethints(nodeflib))) != NULL || + (objgiven && !nodeflib && (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL)) return (pathname); } From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 09:34:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0D04106564A; Wed, 19 Sep 2012 09:34:21 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD5E8FC08; Wed, 19 Sep 2012 09:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8J9YLEW066128; Wed, 19 Sep 2012 09:34:21 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8J9YL6h066125; Wed, 19 Sep 2012 09:34:21 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209190934.q8J9YL6h066125@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 09:34: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: r240689 - in head/share/man: man4 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, 19 Sep 2012 09:34:21 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 09:34:21 2012 New Revision: 240689 URL: http://svn.freebsd.org/changeset/base/240689 Log: Do not install pf related man pages if WITHOUT_PF is set. PR: bin/171767 Submitted by: zeising Approved by: joel (mentor), glebius Modified: head/share/man/man4/Makefile head/share/man/man5/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Sep 19 06:20:25 2012 (r240688) +++ head/share/man/man4/Makefile Wed Sep 19 09:34:21 2012 (r240689) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 # $FreeBSD$ +.include + MAN= aac.4 \ acpi.4 \ ${_acpi_asus.4} \ @@ -354,9 +356,9 @@ MAN= aac.4 \ pcii.4 \ pcm.4 \ pcn.4 \ - pf.4 \ - pflog.4 \ - pfsync.4 \ + ${_pf.4} \ + ${_pflog.4} \ + ${_pfsync.4} \ pim.4 \ polling.4 \ ppbus.4 \ @@ -798,4 +800,10 @@ _nvram2env.4= nvram2env.4 SUBDIR= man4.${MACHINE_CPUARCH} .endif +.if ${MK_PF} != "no" +_pf.4= pf.4 +_pflog.4= pflog.4 +_pfsync.4= pfsync.4 +.endif + .include Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Wed Sep 19 06:20:25 2012 (r240688) +++ head/share/man/man5/Makefile Wed Sep 19 09:34:21 2012 (r240689) @@ -50,8 +50,6 @@ MAN= acct.5 \ passwd.5 \ pbm.5 \ periodic.conf.5 \ - pf.conf.5 \ - pf.os.5 \ phones.5 \ portindex.5 \ portsnap.conf.5 \ @@ -91,6 +89,11 @@ MAN+= hesiod.conf.5 MAN+= nandfs.5 .endif +.if ${MK_PF} != "no" +MAN+= pf.conf.5 \ + pf.os.5 +.endif + .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" _boot.config.5= boot.config.5 .endif From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 11:38:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6582F1065673; Wed, 19 Sep 2012 11:38:38 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5E28FC15; Wed, 19 Sep 2012 11:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBccKe083998; Wed, 19 Sep 2012 11:38:38 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBcccA083997; Wed, 19 Sep 2012 11:38:38 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209191138.q8JBcccA083997@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 11:38: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: r240690 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 11:38:38 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 11:38:37 2012 New Revision: 240690 URL: http://svn.freebsd.org/changeset/base/240690 Log: Add documentation for the WITHOUT_KDUMP switch. This swtich was introduced in r240404 Approved by: joel (mentor) Added: head/tools/build/options/WITHOUT_KDUMP (contents, props changed) Added: head/tools/build/options/WITHOUT_KDUMP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_KDUMP Wed Sep 19 11:38:37 2012 (r240690) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build +.Xr kdump 1 +and +.Xr truss 1 . From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 11:40:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DF091065670; Wed, 19 Sep 2012 11:40:18 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38F028FC0A; Wed, 19 Sep 2012 11:40:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBeIHc084229; Wed, 19 Sep 2012 11:40:18 GMT (envelope-from zeising@svn.freebsd.org) Received: (from zeising@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBeISl084227; Wed, 19 Sep 2012 11:40:18 GMT (envelope-from zeising@svn.freebsd.org) Message-Id: <201209191140.q8JBeISl084227@svn.freebsd.org> From: Niclas Zeising Date: Wed, 19 Sep 2012 11:40: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: r240691 - 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: Wed, 19 Sep 2012 11:40:18 -0000 Author: zeising (doc,ports committer) Date: Wed Sep 19 11:40:17 2012 New Revision: 240691 URL: http://svn.freebsd.org/changeset/base/240691 Log: Regen for r240690 Approved by: joel (mentor) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Sep 19 11:38:37 2012 (r240690) +++ head/share/man/man5/src.conf.5 Wed Sep 19 11:40:17 2012 (r240691) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd September 8, 2012 +.Dd September 19, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -551,6 +551,12 @@ Set to build some programs without IPX s .\" from FreeBSD: head/tools/build/options/WITHOUT_JAIL 183242 2008-09-21 22:02:26Z sam Set to not build tools for the support of jails; e.g. .Xr jail 8 . +.It Va WITHOUT_KDUMP +.\" $FreeBSD$ +Set to not build +.Xr kdump 1 +and +.Xr truss 1 . .It Va WITHOUT_KERBEROS .\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS 174549 2007-12-12 16:42:03Z ru Set this if you do not want to build Kerberos 5 (KTH Heimdal). From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 11:54:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0C1A106564A; Wed, 19 Sep 2012 11:54:33 +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 8C5F58FC16; Wed, 19 Sep 2012 11:54:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JBsXOP086017; Wed, 19 Sep 2012 11:54:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JBsXCU086015; Wed, 19 Sep 2012 11:54:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201209191154.q8JBsXCU086015@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Sep 2012 11:54: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: r240692 - head/sys/dev/amr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 11:54:33 -0000 Author: jhb Date: Wed Sep 19 11:54:32 2012 New Revision: 240692 URL: http://svn.freebsd.org/changeset/base/240692 Log: As a followup to r234501, ensure that the native ioctl path always allocates a 4kb buffer if a request uses a buffer size of 0. (The Linux ioctl path already did this.) PR: kern/155658 Submitted by: Andreas Longwitz MFC after: 1 week Modified: head/sys/dev/amr/amr.c Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Wed Sep 19 11:40:17 2012 (r240691) +++ head/sys/dev/amr/amr.c Wed Sep 19 11:54:32 2012 (r240692) @@ -846,11 +846,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, /* handle inbound data buffer */ real_length = amr_ioctl_buffer_length(au_length); + dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO); if (au_length != 0 && au_cmd[0] != 0x06) { - if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) { - error = ENOMEM; - goto out; - } if ((error = copyin(au_buffer, dp, au_length)) != 0) { free(dp, M_AMR); return (error); @@ -920,8 +917,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, error = copyout(dp, au_buffer, au_length); } debug(2, "copyout %ld bytes from %p -> %p", au_length, dp, au_buffer); - if (dp != NULL) - debug(2, "%p status 0x%x", dp, ac->ac_status); + debug(2, "%p status 0x%x", dp, ac->ac_status); *au_statusp = ac->ac_status; out: From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 12:27:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 811F91065670; Wed, 19 Sep 2012 12:27:24 +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 6BDA48FC17; Wed, 19 Sep 2012 12:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JCROhm090975; Wed, 19 Sep 2012 12:27:24 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JCRO97090969; Wed, 19 Sep 2012 12:27:24 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191227.q8JCRO97090969@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 12:27: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: r240693 - in head/sys/dev: ahci alc cxgbe e1000 re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 12:27:24 -0000 Author: gavin Date: Wed Sep 19 12:27:23 2012 New Revision: 240693 URL: http://svn.freebsd.org/changeset/base/240693 Log: Switch some PCI register reads from using magic numbers to using the names defined in pcireg.h MFC after: 1 week Modified: head/sys/dev/ahci/ahci.c head/sys/dev/alc/if_alc.c head/sys/dev/cxgbe/osdep.h head/sys/dev/e1000/if_em.c head/sys/dev/re/if_re.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/ahci/ahci.c Wed Sep 19 12:27:23 2012 (r240693) @@ -543,7 +543,7 @@ ahci_ctlr_reset(device_t dev) struct ahci_controller *ctlr = device_get_softc(dev); int timeout; - if (pci_read_config(dev, 0x00, 4) == 0x28298086 && + if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == 0x28298086 && (pci_read_config(dev, 0x92, 1) & 0xfe) == 0x04) pci_write_config(dev, 0x92, 0x01, 1); /* Enable AHCI mode */ Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/alc/if_alc.c Wed Sep 19 12:27:23 2012 (r240693) @@ -694,10 +694,10 @@ alc_aspm(struct alc_softc *sc, int media if ((sc->alc_flags & ALC_FLAG_APS) != 0) { /* Disable extended sync except AR8152 B v1.0 */ - linkcfg &= ~0x80; + linkcfg &= ~PCIEM_LINK_CTL_EXTENDED_SYNC; if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B && sc->alc_rev == ATHEROS_AR8152_B_V10) - linkcfg |= 0x80; + linkcfg |= PCIEM_LINK_CTL_EXTENDED_SYNC; CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL, linkcfg); pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB | @@ -834,15 +834,15 @@ alc_attach(device_t dev) cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); - if ((ctl & 0x08) != 0) + if ((ctl & PCIEM_LINK_CTL_RCB) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) device_printf(dev, "RCB %u bytes\n", sc->alc_rcb == DMA_CFG_RCB_64 ? 64 : 128); - state = ctl & 0x03; - if (state & 0x01) + state = ctl & PCIEM_LINK_CTL_ASPMC; + if (state & PCIEM_LINK_CTL_ASPMC_L0S) sc->alc_flags |= ALC_FLAG_L0S; - if (state & 0x02) + if (state & PCIEM_LINK_CTL_ASPMC_L1) sc->alc_flags |= ALC_FLAG_L1S; if (bootverbose) device_printf(sc->alc_dev, "ASPM %s %s\n", Modified: head/sys/dev/cxgbe/osdep.h ============================================================================== --- head/sys/dev/cxgbe/osdep.h Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/cxgbe/osdep.h Wed Sep 19 12:27:23 2012 (r240693) @@ -125,7 +125,7 @@ typedef boolean_t bool; #define PCI_EXP_LNKSTA PCIER_LINK_STA #define PCI_EXP_LNKSTA_CLS PCIEM_LINK_STA_SPEED #define PCI_EXP_LNKSTA_NLW PCIEM_LINK_STA_WIDTH -#define PCI_EXP_DEVCTL2 0x28 +#define PCI_EXP_DEVCTL2 PCIER_DEVICE_CTL2 static inline int ilog2(long x) Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/e1000/if_em.c Wed Sep 19 12:27:23 2012 (r240693) @@ -5119,7 +5119,7 @@ em_disable_aspm(struct adapter *adapter) return; reg = base + PCIER_LINK_CTL; link_ctrl = pci_read_config(dev, reg, 2); - link_ctrl &= 0xFFFC; /* turn off bit 1 and 2 */ + link_ctrl &= ~PCIEM_LINK_CTL_ASPMC; pci_write_config(dev, reg, link_ctrl, 2); return; } Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Sep 19 11:54:32 2012 (r240692) +++ head/sys/dev/re/if_re.c Wed Sep 19 12:27:23 2012 (r240693) @@ -1347,8 +1347,8 @@ re_attach(device_t dev) if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { ctl = pci_read_config(dev, sc->rl_expcap + PCIER_LINK_CTL, 2); - if ((ctl & 0x0003) != 0) { - ctl &= ~0x0003; + if ((ctl & PCIEM_LINK_CTL_ASPMC) != 0) { + ctl &= ~PCIEM_LINK_CTL_ASPMC; pci_write_config(dev, sc->rl_expcap + PCIER_LINK_CTL, ctl, 2); device_printf(dev, "ASPM disabled\n"); From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 12:54:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E3C1065677; Wed, 19 Sep 2012 12:54:26 +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 73FE88FC12; Wed, 19 Sep 2012 12:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JCsQai094401; Wed, 19 Sep 2012 12:54:26 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JCsQBh094399; Wed, 19 Sep 2012 12:54:26 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191254.q8JCsQBh094399@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 12:54: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: r240694 - head/sys/dev/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: Wed, 19 Sep 2012 12:54:26 -0000 Author: gavin Date: Wed Sep 19 12:54:25 2012 New Revision: 240694 URL: http://svn.freebsd.org/changeset/base/240694 Log: Add PCI subclass for NVM Express devices. Reference: http://www.nvmexpress.org/index.php/download_file/view/42/1/NVM_Express_1_0b.pdf section 2.1.5. MFC after: 1 week Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Sep 19 12:27:23 2012 (r240693) +++ head/sys/dev/pci/pcireg.h Wed Sep 19 12:54:25 2012 (r240694) @@ -275,6 +275,7 @@ #define PCIS_STORAGE_SATA 0x06 #define PCIP_STORAGE_SATA_AHCI_1_0 0x01 #define PCIS_STORAGE_SAS 0x07 +#define PCIS_STORAGE_NVM 0x08 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 15:43:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84CA8106566B; Wed, 19 Sep 2012 15:43:31 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7052D8FC14; Wed, 19 Sep 2012 15:43:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JFhVte019447; Wed, 19 Sep 2012 15:43:31 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JFhVJH019444; Wed, 19 Sep 2012 15:43:31 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191543.q8JFhVJH019444@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 15:43: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: r240695 - head/sys/dev/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: Wed, 19 Sep 2012 15:43:31 -0000 Author: jimharris Date: Wed Sep 19 15:43:30 2012 New Revision: 240695 URL: http://svn.freebsd.org/changeset/base/240695 Log: Add constants for programming interfaces for NVM/solid state storage controller sub-class code. Reference: PCI Code and ID Assignment Specification Rev 1.2 Sponsored by: Intel Inspired by: gavin MFC after: 1 week X-MFC-With: r240694 Modified: head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Wed Sep 19 12:54:25 2012 (r240694) +++ head/sys/dev/pci/pcireg.h Wed Sep 19 15:43:30 2012 (r240695) @@ -276,6 +276,8 @@ #define PCIP_STORAGE_SATA_AHCI_1_0 0x01 #define PCIS_STORAGE_SAS 0x07 #define PCIS_STORAGE_NVM 0x08 +#define PCIP_STORAGE_NVM_NVMHCI_1_0 0x01 +#define PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0 0x02 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 16:20:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9461D106564A; Wed, 19 Sep 2012 16:20:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661778FC0C; Wed, 19 Sep 2012 16:20:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGKoko024464; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGKorx024460; Wed, 19 Sep 2012 16:20:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209191620.q8JGKorx024460@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 16:20: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: r240696 - in head/cddl: contrib/opensolaris/cmd/zfs sbin/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: Wed, 19 Sep 2012 16:20:50 -0000 Author: bapt Date: Wed Sep 19 16:20:49 2012 New Revision: 240696 URL: http://svn.freebsd.org/changeset/base/240696 Log: Allow zfs jail and zfs unjail to use both jailnames and jailid Reviewed by: pjd MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/sbin/zfs/Makefile Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Sep 19 16:20:49 2012 (r240696) @@ -256,10 +256,10 @@ .Op Ar snapshot Ns | Ns Ar filesystem .Nm .Cm jail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Nm .Cm unjail -.Ar jailid filesystem +.Ar jailid Ns | Ns Ar jailname filesystem .Sh DESCRIPTION The .Nm Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:20:49 2012 (r240696) @@ -6300,9 +6300,9 @@ do_jail(int argc, char **argv, int attac usage(B_FALSE); } - jailid = atoi(argv[1]); - if (jailid == 0) { - (void) fprintf(stderr, gettext("invalid jailid\n")); + jailid = jail_getid(argv[1]); + if (jailid < 0) { + (void) fprintf(stderr, gettext("invalid jail id or name\n")); usage(B_FALSE); } Modified: head/cddl/sbin/zfs/Makefile ============================================================================== --- head/cddl/sbin/zfs/Makefile Wed Sep 19 15:43:30 2012 (r240695) +++ head/cddl/sbin/zfs/Makefile Wed Sep 19 16:20:49 2012 (r240696) @@ -21,8 +21,8 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -DPADD= ${LIBGEOM} ${LIBNVPAIR} ${LIBUMEM} \ +DPADD= ${LIBGEOM} ${LIBJAIL} ${LIBNVPAIR} ${LIBUMEM} \ ${LIBUTIL} ${LIBUUTIL} ${LIBZFS} -LDADD= -lgeom -lnvpair -lumem -lutil -luutil -lzfs +LDADD= -lgeom -ljail -lnvpair -lumem -lutil -luutil -lzfs .include From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 16:21:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A2C4106571F; Wed, 19 Sep 2012 16:21:24 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660148FC14; Wed, 19 Sep 2012 16:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGLOeq024648; Wed, 19 Sep 2012 16:21:24 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGLOaR024645; Wed, 19 Sep 2012 16:21:24 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191621.q8JGLOaR024645@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 16:21: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: r240697 - head/sys/dev/nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 16:21:25 -0000 Author: jimharris Date: Wed Sep 19 16:21:23 2012 New Revision: 240697 URL: http://svn.freebsd.org/changeset/base/240697 Log: Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass and programming interface codes match. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Sep 19 16:20:49 2012 (r240696) +++ head/sys/dev/nvme/nvme.c Wed Sep 19 16:21:23 2012 (r240697) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "nvme_private.h" @@ -82,17 +83,29 @@ static struct _pcsid static int nvme_probe (device_t device) { - u_int32_t type = pci_get_devid(device); - struct _pcsid *ep = pci_ids; + struct _pcsid *ep; + int probe_val = ENXIO; + u_int32_t type; + + type = pci_get_devid(device); + ep = pci_ids; + +#if defined(PCIS_STORAGE_NVM) + if (pci_get_class(device) == PCIC_STORAGE && + pci_get_subclass(device) == PCIS_STORAGE_NVM && + pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) + probe_val = BUS_PROBE_GENERIC; +#endif while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); - return (BUS_PROBE_DEFAULT); - } else - return (ENXIO); + probe_val = BUS_PROBE_DEFAULT; + } + + return (probe_val); } static void From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 16:28:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324471065672; Wed, 19 Sep 2012 16:28:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3AF8FC12; Wed, 19 Sep 2012 16:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JGScan025685; Wed, 19 Sep 2012 16:28:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JGSckQ025683; Wed, 19 Sep 2012 16:28:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209191628.q8JGSckQ025683@svn.freebsd.org> From: Baptiste Daroussin Date: Wed, 19 Sep 2012 16:28: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: r240698 - head/cddl/contrib/opensolaris/cmd/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: Wed, 19 Sep 2012 16:28:39 -0000 Author: bapt Date: Wed Sep 19 16:28:38 2012 New Revision: 240698 URL: http://svn.freebsd.org/changeset/base/240698 Log: Update usage to show the possiblity to use jail name Reported by: bdrewery MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:23 2012 (r240697) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:38 2012 (r240698) @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) return (gettext("\tupgrade [-v]\n" "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); case HELP_JAIL: - return (gettext("\tjail \n")); + return (gettext("\tjail \n")); case HELP_UNJAIL: - return (gettext("\tunjail \n")); + return (gettext("\tunjail \n")); case HELP_LIST: return (gettext("\tlist [-rH][-d max] " "[-o property[,...]] [-t type[,...]] [-s property] ...\n" From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 18:00:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 837871065670; Wed, 19 Sep 2012 18:00:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 46BF38FC08; Wed, 19 Sep 2012 18:00:06 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A9A9CB91E; Wed, 19 Sep 2012 14:00:05 -0400 (EDT) From: John Baldwin To: Jim Harris Date: Wed, 19 Sep 2012 13:52:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201209191621.q8JGLOaR024645@svn.freebsd.org> In-Reply-To: <201209191621.q8JGLOaR024645@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209191352.02814.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Sep 2012 14:00:05 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240697 - head/sys/dev/nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 18:00:10 -0000 On Wednesday, September 19, 2012 12:21:24 pm Jim Harris wrote: > Author: jimharris > Date: Wed Sep 19 16:21:23 2012 > New Revision: 240697 > URL: http://svn.freebsd.org/changeset/base/240697 > > Log: > Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass > and programming interface codes match. You need to set a description in the generic case. I would suggest doing something like: while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); return (BUS_PROBE_DEFAULT); } #ifdef PCIS_STORAGE_NVM if (pci_get_class(device) == PCIC_STORAGE && ...) { device_set_desc(device, "blah blah"); return (BUS_PROBE_GENERIC); } #endif return (ENXIO); I think that might be a bit clearer to the reader. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 18:22:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED385106564A; Wed, 19 Sep 2012 18:22:15 +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 9E7F48FC08; Wed, 19 Sep 2012 18:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIMFQx043015; Wed, 19 Sep 2012 18:22:15 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIMFEi043012; Wed, 19 Sep 2012 18:22:15 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209191822.q8JIMFEi043012@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 19 Sep 2012 18:22: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: r240699 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 18:22:16 -0000 Author: gavin Date: Wed Sep 19 18:22:14 2012 New Revision: 240699 URL: http://svn.freebsd.org/changeset/base/240699 Log: Recognise NVM Express devices and pretty-print their name. MFC after: 1 week Modified: head/sys/dev/pci/pci.c head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Sep 19 16:28:38 2012 (r240698) +++ head/sys/dev/pci/pci.c Wed Sep 19 18:22:14 2012 (r240699) @@ -3661,6 +3661,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Wed Sep 19 16:28:38 2012 (r240698) +++ head/usr.sbin/pciconf/pciconf.c Wed Sep 19 18:22:14 2012 (r240699) @@ -345,6 +345,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 18:25:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD39106564A; Wed, 19 Sep 2012 18:25:26 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 276F18FC16; Wed, 19 Sep 2012 18:25:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIPPEq043523; Wed, 19 Sep 2012 18:25:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIPPog043521; Wed, 19 Sep 2012 18:25:25 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201209191825.q8JIPPog043521@svn.freebsd.org> From: Jim Harris Date: Wed, 19 Sep 2012 18:25: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: r240700 - head/sys/dev/nvme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 18:25:26 -0000 Author: jimharris Date: Wed Sep 19 18:25:25 2012 New Revision: 240700 URL: http://svn.freebsd.org/changeset/base/240700 Log: In nvme(4), set device description for BUS_PROBE_GENERIC case. Reported by: jhb Modified: head/sys/dev/nvme/nvme.c Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Wed Sep 19 18:22:14 2012 (r240699) +++ head/sys/dev/nvme/nvme.c Wed Sep 19 18:25:25 2012 (r240700) @@ -84,28 +84,29 @@ static int nvme_probe (device_t device) { struct _pcsid *ep; - int probe_val = ENXIO; u_int32_t type; type = pci_get_devid(device); ep = pci_ids; -#if defined(PCIS_STORAGE_NVM) - if (pci_get_class(device) == PCIC_STORAGE && - pci_get_subclass(device) == PCIS_STORAGE_NVM && - pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) - probe_val = BUS_PROBE_GENERIC; -#endif - while (ep->type && ep->type != type) ++ep; if (ep->desc) { device_set_desc(device, ep->desc); - probe_val = BUS_PROBE_DEFAULT; + return (BUS_PROBE_DEFAULT); } - return (probe_val); +#if defined(PCIS_STORAGE_NVM) + if (pci_get_class(device) == PCIC_STORAGE && + pci_get_subclass(device) == PCIS_STORAGE_NVM && + pci_get_progif(device) == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) { + device_set_desc(device, "Generic NVMe Device"); + return (BUS_PROBE_GENERIC); + } +#endif + + return (ENXIO); } static void From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 18:42:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89EF1106564A; Wed, 19 Sep 2012 18:42:32 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 758788FC08; Wed, 19 Sep 2012 18:42:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JIgWBB046271; Wed, 19 Sep 2012 18:42:32 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JIgW2S046269; Wed, 19 Sep 2012 18:42:32 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201209191842.q8JIgW2S046269@svn.freebsd.org> From: Tijl Coosemans Date: Wed, 19 Sep 2012 18:42: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: r240701 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 18:42:32 -0000 Author: tijl Date: Wed Sep 19 18:42:31 2012 New Revision: 240701 URL: http://svn.freebsd.org/changeset/base/240701 Log: Fix a panic when trying to play invalid audio tracks. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Sep 19 18:25:25 2012 (r240700) +++ head/sys/cam/scsi/scsi_cd.c Wed Sep 19 18:42:31 2012 (r240701) @@ -2080,6 +2080,7 @@ cdioctl(struct disk *dp, u_long cmd, voi || (st > (softc->toc.header.ending_track - softc->toc.header.starting_track))) { error = EINVAL; + cam_periph_unlock(periph); break; } sentry = &softc->toc.entries[st].addr; From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 19:21:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF461106564A; Wed, 19 Sep 2012 19:21:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5AC8FC15; Wed, 19 Sep 2012 19:21:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JJLMop052780; Wed, 19 Sep 2012 19:21:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JJLMlE052778; Wed, 19 Sep 2012 19:21:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209191921.q8JJLMlE052778@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 19 Sep 2012 19:21: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: r240704 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 19:21:23 -0000 Author: jilles Date: Wed Sep 19 19:21:22 2012 New Revision: 240704 URL: http://svn.freebsd.org/changeset/base/240704 Log: strsignal(): Do not append signal numbers to messages for known signals. Messages for known signals looked like "Terminated: 15" instead of "Terminated". Modified: head/lib/libc/string/strsignal.c Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Wed Sep 19 19:16:08 2012 (r240703) +++ head/lib/libc/string/strsignal.c Wed Sep 19 19:21:22 2012 (r240704) @@ -120,7 +120,6 @@ strsignal(int num) UPREFIX, #endif sizeof(sig_ebuf)); - } signum = num; if (num < 0) @@ -143,6 +142,7 @@ strsignal(int num) break; } *p = '\0'; + } #if defined(NLS) catclose(catd); From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 19:22:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 746A41065673; Wed, 19 Sep 2012 19:22:25 +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 606368FC12; Wed, 19 Sep 2012 19:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JJMPEN052953; Wed, 19 Sep 2012 19:22:25 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JJMPLK052950; Wed, 19 Sep 2012 19:22:25 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209191922.q8JJMPLK052950@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 19 Sep 2012 19:22: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: r240705 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 19:22:25 -0000 Author: jilles Date: Wed Sep 19 19:22:24 2012 New Revision: 240705 URL: http://svn.freebsd.org/changeset/base/240705 Log: strsignal(): Reindent. Modified: head/lib/libc/string/strsignal.c Modified: head/lib/libc/string/strsignal.c ============================================================================== --- head/lib/libc/string/strsignal.c Wed Sep 19 19:21:22 2012 (r240704) +++ head/lib/libc/string/strsignal.c Wed Sep 19 19:22:24 2012 (r240705) @@ -121,27 +121,27 @@ strsignal(int num) #endif sizeof(sig_ebuf)); - signum = num; - if (num < 0) - signum = -signum; + signum = num; + if (num < 0) + signum = -signum; - t = tmp; - do { - *t++ = "0123456789"[signum % 10]; - } while (signum /= 10); - if (num < 0) - *t++ = '-'; + t = tmp; + do { + *t++ = "0123456789"[signum % 10]; + } while (signum /= 10); + if (num < 0) + *t++ = '-'; - p = (ebuf + n); - *p++ = ':'; - *p++ = ' '; + p = (ebuf + n); + *p++ = ':'; + *p++ = ' '; - for (;;) { - *p++ = *--t; - if (t <= tmp) - break; - } - *p = '\0'; + for (;;) { + *p++ = *--t; + if (t <= tmp) + break; + } + *p = '\0'; } #if defined(NLS) From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 19:28:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 117601065670; Wed, 19 Sep 2012 19:28:53 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7318FC12; Wed, 19 Sep 2012 19:28:52 +0000 (UTC) Received: by qcsg15 with SMTP id g15so1345943qcs.13 for ; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2UL0tZrXcMBMXVwd7crKgilemCmpIuzLinPCa7rfW6E=; b=jheLPEnoJGmBjVzOUJTLc/VWidt6U7fGqO0XgkJKnnYUi2/At3hUssd2y8yvJrWB7T DqEdZsDBt60fNs964Z5RFpLaSIgM578oT/HjXZXLVjjRmLVLzAE2mIuIxx75TRMBKqFV Vg5rWkG+92kizKcfjvBVJIin0pwI6DKlujtaHYmiJ2QTQBYZO/t5DDU6VU2rhw2uZ4O0 2484cWDYGKp+VTbf7ot6JBSf87l0BzLk+U+t7PadFnvtA5K7RKZCmc5TPCsSRqvs3L2O TgpUiLvEuvm6aQhC8F/HjEu5mTWI29t9cA5/nZI+nE2V0bk03lD/1c0g4uT3nDyBHtjB godw== MIME-Version: 1.0 Received: by 10.224.189.5 with SMTP id dc5mr9231190qab.89.1348082931748; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) Received: by 10.49.104.70 with HTTP; Wed, 19 Sep 2012 12:28:51 -0700 (PDT) In-Reply-To: <201209191822.q8JIMFEi043012@svn.freebsd.org> References: <201209191822.q8JIMFEi043012@svn.freebsd.org> Date: Wed, 19 Sep 2012 12:28:51 -0700 Message-ID: From: Jim Harris To: Gavin Atkinson 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: r240699 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Sep 2012 19:28:53 -0000 On Wed, Sep 19, 2012 at 11:22 AM, Gavin Atkinson wrote: > Author: gavin > Date: Wed Sep 19 18:22:14 2012 > New Revision: 240699 > URL: http://svn.freebsd.org/changeset/base/240699 > > Log: > Recognise NVM Express devices and pretty-print their name. > > MFC after: 1 week > > Modified: > head/sys/dev/pci/pci.c > head/usr.sbin/pciconf/pciconf.c > > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Wed Sep 19 16:28:38 2012 (r240698) > +++ head/sys/dev/pci/pci.c Wed Sep 19 18:22:14 2012 (r240699) > @@ -3661,6 +3661,7 @@ static struct > {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, > {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, > {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, > + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, Hi Gavin, This should really read "NVM", not "NVM Express". NVM Express should be reserved for NVM subclass devices with the NVM Express PI (Programming Interface). PCI SIG refers to this PI as "Enterprise NVMHCI", but it's the same thing. Regards, -Jim > {PCIC_NETWORK, -1, "network"}, > {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, > {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, > > Modified: head/usr.sbin/pciconf/pciconf.c > ============================================================================== > --- head/usr.sbin/pciconf/pciconf.c Wed Sep 19 16:28:38 2012 (r240698) > +++ head/usr.sbin/pciconf/pciconf.c Wed Sep 19 18:22:14 2012 (r240699) > @@ -345,6 +345,7 @@ static struct > {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, > {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, > {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, > + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, > {PCIC_NETWORK, -1, "network"}, > {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, > {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 20:42:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A821065677; Wed, 19 Sep 2012 20:42:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83D0B8FC1A; Wed, 19 Sep 2012 20:42:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JKgu2K066748; Wed, 19 Sep 2012 20:42:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JKguJi066746; Wed, 19 Sep 2012 20:42:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201209192042.q8JKguJi066746@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 19 Sep 2012 20:42: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: r240708 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2012 20:42:56 -0000 Author: obrien Date: Wed Sep 19 20:42:55 2012 New Revision: 240708 URL: http://svn.freebsd.org/changeset/base/240708 Log: Add Intel RdRand. Modified: head/share/man/man4/random.4 Modified: head/share/man/man4/random.4 ============================================================================== --- head/share/man/man4/random.4 Wed Sep 19 20:11:47 2012 (r240707) +++ head/share/man/man4/random.4 Wed Sep 19 20:42:55 2012 (r240708) @@ -315,11 +315,16 @@ and is an implementation of the .Em Yarrow algorithm by Bruce Schneier, .Em et al . -The only hardware implementation -currently is for the +The only hardware implementations +currently are for the .Tn VIA C3 Nehemiah (stepping 3 or greater) -CPU. +CPU +and the +.Tn Intel +.Dq Bull Mountain +.Em RdRand +instruction and underlying random number generator (RNG). More will be added in the future. .Pp The author gratefully acknowledges From owner-svn-src-head@FreeBSD.ORG Wed Sep 19 23:25:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 893E51065670; Wed, 19 Sep 2012 23:25:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCE28FC08; Wed, 19 Sep 2012 23:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8JNPPCr094369; Wed, 19 Sep 2012 23:25:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8JNPPtK094348; Wed, 19 Sep 2012 23:25:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201209192325.q8JNPPtK094348@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 19 Sep 2012 23:25: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: r240716 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/tables 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: Wed, 19 Sep 2012 23:25:25 -0000 Author: jkim Date: Wed Sep 19 23:25:24 2012 New Revision: 240716 URL: http://svn.freebsd.org/changeset/base/240716 Log: Merge ACPICA 20120913. Modified: head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/changes.txt Wed Sep 19 23:25:24 2012 (r240716) @@ -1,4 +1,75 @@ ---------------------------------------- +13 September 2012. Summary of changes for version 20120913: + +This release is available at https://www.acpica.org/downloads The ACPI 5.0 +specification is available at www.acpi.info + +1) ACPICA Kernel-resident Subsystem: + +ACPI 5.0: Added two new notify types for the Hardware Error Notification +Structure within the Hardware Error Source Table (HEST) table -- CMCI(5) and +MCE(6). + +Table Manager: Merged/removed duplicate code in the root table resize +functions. One function is external, the other is internal. Lv Zheng, ACPICA +BZ 846. + +Makefiles: Completely removed the obsolete "Linux" makefiles under +acpica/generate/linux. These makefiles are obsolete and have been replaced by +the generic unix makefiles under acpica/generate/unix. + +Makefiles: Ensure that binary files always copied properly. Minor rule change +to ensure that the final binary output files are always copied up to the +appropriate binary directory (bin32 or bin64.) + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 93.8K Code, 25.3K Data, 119.1K Total + Debug Version: 175.7K Code, 74.8K Data, 250.5K Total + Current Release: + Non-Debug Version: 93.7K Code, 25.3K Data, 119.0K Total + Debug Version: 175.0K Code, 74.4K Data, 249.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a possible fault during the disassembly of resource +descriptors when a second parse is required because of the invocation of +external control methods within the table. With assistance from +adq@lidskialf.net. ACPICA BZ 976. + +iASL: Fixed a namepath optimization problem. An error can occur if the parse +node that contains the namepath to be optimized does not have a parent node +that is a named object. This change fixes the problem. + +iASL: Fixed a regression where the AML file is not deleted on errors. The AML +output file should be deleted if there are any errors during the compiler. The +only exception is if the -f (force output) option is used. ACPICA BZ 974. + +iASL: Added a feature to automatically increase internal line buffer sizes. +Via realloc(), automatically increase the internal line buffer sizes as +necessary to support very long source code lines. The current version of the +preprocessor requires a buffer long enough to contain full source code lines. +This change increases the line buffer(s) if the input lines go beyond the +current buffer size. This eliminates errors that occurred when a source code +line was longer than the buffer. + +iASL: Fixed a problem with constant folding in method declarations. The +SyncLevel term is a ByteConstExpr, and incorrect code would be generated if a +Type3 opcode was used. + +Debugger: Improved command help support. For incorrect argument count, display +full help for the command. For help command itself, allow an argument to +specify a command. + +Test Suites: Several bug fixes for the ASLTS suite reduces the number of +errors during execution of the suite. Guan Chao. + +---------------------------------------- 16 August 2012. Summary of changes for version 20120816: This release is available at https://www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Sep 19 23:25:24 2012 (r240716) @@ -469,6 +469,11 @@ AcpiDmCheckResourceReference ( /* Get the Index term, must be an integer constant to convert */ IndexOp = BufferNameOp->Common.Next; + + /* Major cheat: The Node field is also used for the Tag ptr. Clear it now */ + + IndexOp->Common.Node = NULL; + OpInfo = AcpiPsGetOpcodeInfo (IndexOp->Common.AmlOpcode); if (OpInfo->ObjectType != ACPI_TYPE_INTEGER) { Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Sep 19 23:25:24 2012 (r240716) @@ -800,6 +800,7 @@ CmCleanupAndExit ( void) { UINT32 i; + BOOLEAN DeleteAmlFile = FALSE; AePrintErrorLog (ASL_FILE_STDERR); @@ -851,6 +852,16 @@ CmCleanupAndExit ( UtDisplaySummary (ASL_FILE_STDOUT); + /* + * We will delete the AML file if there are errors and the + * force AML output option has not been used. + */ + if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) && + Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) + { + DeleteAmlFile = TRUE; + } + /* Close all open files */ Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ @@ -862,29 +873,17 @@ CmCleanupAndExit ( /* Delete AML file if there are errors */ - if ((Gbl_ExceptionCount[ASL_ERROR] > 0) && (!Gbl_IgnoreErrors) && - Gbl_Files[ASL_FILE_AML_OUTPUT].Handle) + if (DeleteAmlFile) { - if (remove (Gbl_Files[ASL_FILE_AML_OUTPUT].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_AML_OUTPUT].Filename); - perror ("Could not delete AML file"); - } + FlDeleteFile (ASL_FILE_AML_OUTPUT); } /* Delete the preprocessor output file (.i) unless -li flag is set */ if (!Gbl_PreprocessorOutputFlag && - Gbl_PreprocessFlag && - Gbl_Files[ASL_FILE_PREPROCESSOR].Filename) + Gbl_PreprocessFlag) { - if (remove (Gbl_Files[ASL_FILE_PREPROCESSOR].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_PREPROCESSOR].Filename); - perror ("Could not delete preprocessor .i file"); - } + FlDeleteFile (ASL_FILE_PREPROCESSOR); } /* @@ -901,14 +900,9 @@ CmCleanupAndExit ( * * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ - if (!Gbl_SourceOutputFlag && Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename) + if (!Gbl_SourceOutputFlag) { - if (remove (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename)) - { - printf ("%s: ", - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - perror ("Could not delete SRC file"); - } + FlDeleteFile (ASL_FILE_SOURCE_OUTPUT); } } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Sep 19 23:25:24 2012 (r240716) @@ -661,6 +661,10 @@ FlPrintFile ( ...); void +FlDeleteFile ( + UINT32 FileId); + +void FlSetLineNumber ( UINT32 LineNumber); @@ -779,6 +783,10 @@ char * UtGetStringBuffer ( UINT32 Length); +void +UtExpandLineBuffers ( + void); + ACPI_STATUS UtInternalizeName ( char *ExternalName, Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Sep 19 23:25:24 2012 (r240716) @@ -183,6 +183,7 @@ AePrintException ( FILE *SourceFile = NULL; long FileSize; BOOLEAN PrematureEOF = FALSE; + UINT32 Total = 0; if (Gbl_NoErrors) @@ -300,11 +301,21 @@ AePrintException ( "[*** iASL: Read error on source code temp file %s ***]", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } - - else while (RActual && SourceByte && (SourceByte != '\n')) + else { - fwrite (&SourceByte, 1, 1, OutputFile); - RActual = fread (&SourceByte, 1, 1, SourceFile); + while (RActual && SourceByte && (SourceByte != '\n') && (Total < 256)) + { + fwrite (&SourceByte, 1, 1, OutputFile); + RActual = fread (&SourceByte, 1, 1, SourceFile); + Total++; + } + + if (Total >= 256) + { + fprintf (OutputFile, + "\n[*** iASL: Long input line, an error occurred at column %u ***]", + Enode->Column); + } } } } @@ -381,20 +392,28 @@ AePrintException ( if (Gbl_VerboseErrors && !PrematureEOF) { - SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; - ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; - - if ((MsgLength + ErrorColumn) < (SourceColumn - 1)) + if (Total >= 256) { - fprintf (OutputFile, "%*s%s", - (int) ((SourceColumn - 1) - ErrorColumn), - MainMessage, " ^ "); + fprintf (OutputFile, " %s", + MainMessage); } else { - fprintf (OutputFile, "%*s %s", - (int) ((SourceColumn - ErrorColumn) + 1), "^", - MainMessage); + SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; + ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; + + if ((MsgLength + ErrorColumn) < (SourceColumn - 1)) + { + fprintf (OutputFile, "%*s%s", + (int) ((SourceColumn - 1) - ErrorColumn), + MainMessage, " ^ "); + } + else + { + fprintf (OutputFile, "%*s %s", + (int) ((SourceColumn - ErrorColumn) + 1), "^", + MainMessage); + } } } else Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Sep 19 23:25:24 2012 (r240716) @@ -63,6 +63,7 @@ FlParseInputPathname ( #endif + /******************************************************************************* * * FUNCTION: AslAbort @@ -376,6 +377,42 @@ FlCloseFile ( /******************************************************************************* * + * FUNCTION: FlDeleteFile + * + * PARAMETERS: FileId - Index into file info array + * + * RETURN: None + * + * DESCRIPTION: Delete a file. + * + ******************************************************************************/ + +void +FlDeleteFile ( + UINT32 FileId) +{ + ASL_FILE_INFO *Info = &Gbl_Files[FileId]; + + + if (!Info->Filename) + { + return; + } + + if (remove (Info->Filename)) + { + printf ("%s (%s file) ", + Info->Filename, Info->Description); + perror ("Could not delete"); + } + + Info->Filename = NULL; + return; +} + + +/******************************************************************************* + * * FUNCTION: FlSetLineNumber * * PARAMETERS: Op - Parse node for the LINE asl statement Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Sep 19 23:25:24 2012 (r240716) @@ -200,6 +200,19 @@ OpcAmlCheckForConstant ( DbgPrint (ASL_PARSE_OUTPUT, "[%.4d] Opcode: %12.12s ", Op->Asl.LogicalLineNumber, Op->Asl.ParseOpName); + /* + * These opcodes do not appear in the OpcodeInfo table, but + * they represent constants, so abort the constant walk now. + */ + if ((WalkState->Opcode == AML_RAW_DATA_BYTE) || + (WalkState->Opcode == AML_RAW_DATA_WORD) || + (WalkState->Opcode == AML_RAW_DATA_DWORD) || + (WalkState->Opcode == AML_RAW_DATA_QWORD)) + { + WalkState->WalkType = ACPI_WALK_CONST_OPTIONAL; + return (AE_TYPE); + } + if (!(WalkState->OpInfo->Flags & AML_CONSTANT)) { /* The opcode is not a Type 3/4/5 opcode */ @@ -254,8 +267,8 @@ OpcAmlCheckForConstant ( { DbgPrint (ASL_PARSE_OUTPUT, " TERMARG"); } - DbgPrint (ASL_PARSE_OUTPUT, "\n"); + DbgPrint (ASL_PARSE_OUTPUT, "\n"); return (AE_OK); } Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Sep 19 23:25:24 2012 (r240716) @@ -63,6 +63,41 @@ #endif +#ifdef _DECLARE_GLOBALS +UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; +char AslHexLookup[] = +{ + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' +}; + + +/* Table below must match ASL_FILE_TYPES in asltypes.h */ + +ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES] = +{ + {NULL, NULL, "stdout: ", "Standard Output"}, + {NULL, NULL, "stderr: ", "Standard Error"}, + {NULL, NULL, "Table Input: ", "Source Input"}, + {NULL, NULL, "Binary Output:", "AML Output"}, + {NULL, NULL, "Source Output:", "Source Output"}, + {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, + {NULL, NULL, "Listing File: ", "Listing Output"}, + {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, + {NULL, NULL, "Namespace: ", "Namespace Output"}, + {NULL, NULL, "Debug File: ", "Debug Output"}, + {NULL, NULL, "ASM Source: ", "Assembly Code Output"}, + {NULL, NULL, "C Source: ", "C Code Output"}, + {NULL, NULL, "ASM Include: ", "Assembly Header Output"}, + {NULL, NULL, "C Include: ", "C Header Output"} +}; + +#else +extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; +extern char AslHexLookup[]; +extern ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; +#endif + + /* * Parser and other externals */ @@ -74,21 +109,22 @@ extern int PrPa extern const ASL_MAPPING_ENTRY AslKeywordMapping[]; extern char *AslCompilertext; -#define ASL_LINE_BUFFER_SIZE (4096 * 4) /* 16K */ -#define ASL_MSG_BUFFER_SIZE 4096 -#define HEX_TABLE_LINE_SIZE 8 -#define HEX_LISTING_LINE_SIZE 8 +#define ASL_DEFAULT_LINE_BUFFER_SIZE (1024 * 32) /* 32K */ +#define ASL_MSG_BUFFER_SIZE 4096 +#define HEX_TABLE_LINE_SIZE 8 +#define HEX_LISTING_LINE_SIZE 8 /* Source code buffers and pointers for error reporting */ -ASL_EXTERN char Gbl_CurrentLineBuffer[ASL_LINE_BUFFER_SIZE]; +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_CurrentLineBuffer, NULL); +ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); -ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer); /* Exception reporting */ @@ -135,18 +171,16 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); -#define HEX_OUTPUT_NONE 0 -#define HEX_OUTPUT_C 1 -#define HEX_OUTPUT_ASM 2 -#define HEX_OUTPUT_ASL 3 +#define HEX_OUTPUT_NONE 0 +#define HEX_OUTPUT_C 1 +#define HEX_OUTPUT_ASM 2 +#define HEX_OUTPUT_ASL 3 ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); /* Files */ -ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; - ASL_EXTERN char *Gbl_DirectoryPath; ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); @@ -203,7 +237,6 @@ ASL_EXTERN FILE *Acp ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; ASL_EXTERN ACPI_TABLE_HEADER TableHeader; -extern char AslHexLookup[]; /* Event timing */ @@ -220,11 +253,5 @@ ASL_EXTERN char Stri ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; -#ifdef _DECLARE_GLOBALS -UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; -#else -extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; -#endif - #endif /* __ASLGLOBAL_H */ Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Sep 19 23:25:24 2012 (r240716) @@ -48,6 +48,7 @@ #include #include #include +#include #ifdef _DEBUG #include @@ -70,6 +71,10 @@ static void Usage ( void); +static void ACPI_SYSTEM_XFACE +AslSignalHandler ( + int Sig); + static void AslInitialize ( void); @@ -96,7 +101,7 @@ AslDoResponseFile ( #define ASL_TOKEN_SEPARATORS " \t\n" -#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^mno|p:P^r:s|t|T:G^v^w|x:z" +#define ASL_SUPPORTED_OPTIONS "@:2b|c|d^D:e:fgh^i|I:l^m:no|p:P^r:s|t|T:G^v^w|x:z" /******************************************************************************* @@ -163,10 +168,10 @@ Options ( printf ("\nAML Disassembler:\n"); ACPI_OPTION ("-d [file]", "Disassemble or decode binary ACPI table to file (*.dsl)"); ACPI_OPTION ("-da [f1,f2]", "Disassemble multiple tables from single namespace"); + ACPI_OPTION ("-db", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-dc [file]", "Disassemble AML and immediately compile it"); ACPI_OPTION ("", "(Obtain DSDT from current system if no input file)"); ACPI_OPTION ("-e [f1,f2]", "Include ACPI table(s) for external symbol resolution"); - ACPI_OPTION ("-m", "Do not translate Buffers to Resource Templates"); ACPI_OPTION ("-2", "Emit ACPI 2.0 compatible ASL code"); ACPI_OPTION ("-g", "Get ACPI tables and write to files (*.dat)"); @@ -238,6 +243,49 @@ Usage ( } +/****************************************************************************** + * + * FUNCTION: AslSignalHandler + * + * PARAMETERS: Sig - Signal that invoked this handler + * + * RETURN: None + * + * DESCRIPTION: Control-C handler. Delete any intermediate files and any + * output files that may be left in an indeterminate state. + * + *****************************************************************************/ + +static void ACPI_SYSTEM_XFACE +AslSignalHandler ( + int Sig) +{ + UINT32 i; + + + signal (Sig, SIG_IGN); + printf ("Aborting\n\n"); + + /* Close all open files */ + + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + + for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlCloseFile (i); + } + + /* Delete any output files */ + + for (i = ASL_FILE_AML_OUTPUT; i < ASL_MAX_FILE_TYPE; i++) + { + FlDeleteFile (i); + } + + exit (0); +} + + /******************************************************************************* * * FUNCTION: AslInitialize @@ -261,7 +309,6 @@ AslInitialize ( _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CrtSetDbgFlag(0)); #endif - AcpiDbgLevel = 0; for (i = 0; i < ASL_NUM_FILES; i++) { @@ -274,6 +321,11 @@ AslInitialize ( Gbl_Files[ASL_FILE_STDERR].Handle = stderr; Gbl_Files[ASL_FILE_STDERR].Filename = "STDERR"; + + /* Allocate the line buffer(s) */ + + Gbl_LineBufferSize /= 2; + UtExpandLineBuffers (); } @@ -475,6 +527,10 @@ AslDoOptions ( Gbl_DisassembleAll = TRUE; break; + case 'b': /* Do not convert buffers to resource descriptors */ + AcpiGbl_NoResourceDisassembly = TRUE; + break; + case 'c': break; @@ -613,8 +669,13 @@ AslDoOptions ( break; - case 'm': /* Do not convert buffers to resource descriptors */ - AcpiGbl_NoResourceDisassembly = TRUE; + case 'm': /* Set line buffer size */ + Gbl_LineBufferSize = (UINT32) strtoul (AcpiGbl_Optarg, NULL, 0) * 1024; + if (Gbl_LineBufferSize < ASL_DEFAULT_LINE_BUFFER_SIZE) + { + Gbl_LineBufferSize = ASL_DEFAULT_LINE_BUFFER_SIZE; + } + printf ("Line Buffer Size: %u\n", Gbl_LineBufferSize); break; @@ -946,7 +1007,10 @@ main ( int Index2; + signal (SIGINT, AslSignalHandler); + AcpiGbl_ExternalFileList = NULL; + AcpiDbgLevel = 0; #ifdef _DEBUG _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_LEAK_CHECK_DF | @@ -955,9 +1019,10 @@ main ( /* Init and command line */ + Index1 = Index2 = AslCommandLine (argc, argv); + AslInitialize (); PrInitializePreprocessor (); - Index1 = Index2 = AslCommandLine (argc, argv); /* Options that have no additional parameters or pathnames */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Sep 19 23:25:24 2012 (r240716) @@ -198,6 +198,7 @@ typedef enum ASL_MSG_VENDOR_LIST, ASL_MSG_WRITE, ASL_MSG_RANGE, + ASL_MSG_BUFFER_ALLOCATION, /* These messages are used by the Preprocessor only */ @@ -373,6 +374,7 @@ char *AslMessages /* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", /* ASL_MSG_WRITE */ "Could not write file", /* ASL_MSG_RANGE */ "Constant out of range", +/* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* Preprocessor */ Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Sep 19 23:25:24 2012 (r240716) @@ -182,6 +182,10 @@ OpnDoMethod ( Next = Next->Asl.Next; if (Next->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG) { + /* This is a ByteConstExpr, so eval the constant now */ + + OpcAmlConstantWalk (Next, 0, NULL); + if (Next->Asl.Value.Integer > 15) { AslError (ASL_ERROR, ASL_MSG_SYNC_LEVEL, Next, NULL); Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Sep 19 23:25:24 2012 (r240716) @@ -441,7 +441,6 @@ OptOptimizeNameDeclaration ( { ACPI_STATUS Status; char *NewPathExternal; - ACPI_GENERIC_STATE ScopeInfo; ACPI_NAMESPACE_NODE *Node; @@ -473,9 +472,10 @@ OptOptimizeNameDeclaration ( * Check to make sure that the optimization finds the node we are * looking for. This is simply a sanity check on the new * path that has been created. + * + * We know that we are at the root, so NULL is used for the scope. */ - ScopeInfo.Scope.Node = CurrentNode; - Status = AcpiNsLookup (&ScopeInfo, *NewPath, + Status = AcpiNsLookup (NULL, *NewPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, WalkState, &(Node)); if (ACPI_SUCCESS (Status)) @@ -624,11 +624,21 @@ OptOptimizeNamePath ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME")); /* - * The node of interest is the parent of this node - * (the containing scope) + * The node of interest is the parent of this node (the containing + * scope). The actual namespace node may be up more than one level + * of parse op or it may not exist at all (if we traverse back + * up to the root.) */ - CurrentNode = Op->Asl.Parent->Asl.Node; - if (!CurrentNode) + NextOp = Op->Asl.Parent; + while (NextOp && (!NextOp->Asl.Node)) + { + NextOp = NextOp->Asl.Parent; + } + if (NextOp && NextOp->Asl.Node) + { + CurrentNode = NextOp->Asl.Node; + } + else { CurrentNode = AcpiGbl_RootNode; } Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Sep 19 23:25:24 2012 (r240716) @@ -239,7 +239,7 @@ AslDetectSourceFileType ( * File is ASCII. Determine if this is an ASL file or an ACPI data * table file. */ - while (fgets (Gbl_CurrentLineBuffer, ASL_LINE_BUFFER_SIZE, Info->Handle)) + while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, Info->Handle)) { /* Uppercase the buffer for caseless compare */ Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.l Wed Sep 19 23:25:24 2012 (r240716) @@ -343,14 +343,14 @@ AslInsertLineBuffer ( *Gbl_LineBufPtr = (UINT8) SourceChar; Gbl_LineBufPtr++; - if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (ASL_LINE_BUFFER_SIZE - 1))) + if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1))) { #if 0 /* * Warning if we have split a long source line. * */ - sprintf (MsgBuffer, "Max %u", ASL_LINE_BUFFER_SIZE); + sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize); AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE, Gbl_CurrentLineNumber, Gbl_LogicalLineNumber, Gbl_CurrentLineOffset, Gbl_CurrentColumn, Modified: head/sys/contrib/dev/acpica/compiler/asltypes.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Sep 19 23:25:24 2012 (r240716) @@ -133,6 +133,8 @@ typedef struct asl_file_info { FILE *Handle; char *Filename; + const char *ShortDescription; + const char *Description; } ASL_FILE_INFO; @@ -146,14 +148,14 @@ typedef struct asl_file_status /* * File types. Note: Any changes to this table must also be reflected - * in the AslFileTypeNames array. + * in the Gbl_Files array. */ typedef enum { ASL_FILE_STDOUT = 0, ASL_FILE_STDERR, - ASL_FILE_INPUT, /* Don't move these first 3 file types */ - ASL_FILE_AML_OUTPUT, + ASL_FILE_INPUT, + ASL_FILE_AML_OUTPUT, /* Don't move these first 4 file types */ ASL_FILE_SOURCE_OUTPUT, ASL_FILE_PREPROCESSOR, ASL_FILE_LISTING_OUTPUT, Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Sep 19 23:25:24 2012 (r240716) @@ -54,31 +54,6 @@ ACPI_MODULE_NAME ("aslutils") -char AslHexLookup[] = -{ - '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -}; - -/* Table below must match ASL_FILE_TYPES in asltypes.h */ - -static const char *AslFileTypeNames [ASL_NUM_FILES] = -{ - "stdout: ", - "stderr: ", - "Table Input: ", - "Binary Output:", - "Source Output:", - "Preprocessor: ", - "Listing File: ", - "Hex Dump: ", - "Namespace: ", - "Debug File: ", - "ASM Source: ", - "C Source: ", - "ASM Include: ", - "C Include: " -}; - /* Local prototypes */ @@ -547,7 +522,7 @@ UtDisplaySummary ( } FlPrintFile (FileId, "%14s %s - %u bytes\n", - AslFileTypeNames [i], + Gbl_Files[i].ShortDescription, Gbl_Files[i].Filename, FlGetFileSize (i)); } @@ -646,6 +621,79 @@ UtGetStringBuffer ( } +/****************************************************************************** + * + * FUNCTION: UtExpandLineBuffers + * + * PARAMETERS: None. Updates global line buffer pointers. + * + * RETURN: None. Reallocates the global line buffers + * + * DESCRIPTION: Called if the current line buffer becomes filled. Reallocates + * all global line buffers and updates Gbl_LineBufferSize. NOTE: + * Also used for the initial allocation of the buffers, when + * all of the buffer pointers are NULL. Initial allocations are + * of size ASL_DEFAULT_LINE_BUFFER_SIZE + * + *****************************************************************************/ + +void +UtExpandLineBuffers ( + void) +{ + UINT32 NewSize; + + + /* Attempt to double the size of all line buffers */ + + NewSize = Gbl_LineBufferSize * 2; + if (Gbl_CurrentLineBuffer) + { + DbgPrint (ASL_DEBUG_OUTPUT,"Increasing line buffer size from %u to %u\n", + Gbl_LineBufferSize, NewSize); + } + + Gbl_CurrentLineBuffer = realloc (Gbl_CurrentLineBuffer, NewSize); + Gbl_LineBufPtr = Gbl_CurrentLineBuffer; + if (!Gbl_CurrentLineBuffer) + { + goto ErrorExit; + } + + Gbl_MainTokenBuffer = realloc (Gbl_MainTokenBuffer, NewSize); + if (!Gbl_MainTokenBuffer) + { + goto ErrorExit; + } + + Gbl_MacroTokenBuffer = realloc (Gbl_MacroTokenBuffer, NewSize); + if (!Gbl_MacroTokenBuffer) + { + goto ErrorExit; + } + + Gbl_ExpressionTokenBuffer = realloc (Gbl_ExpressionTokenBuffer, NewSize); + if (!Gbl_ExpressionTokenBuffer) + { + goto ErrorExit; + } + + Gbl_LineBufferSize = NewSize; + return; + + + /* On error above, simply issue error messages and abort, cannot continue */ + +ErrorExit: + printf ("Could not increase line buffer size from %u to %u\n", + Gbl_LineBufferSize, Gbl_LineBufferSize * 2); + + AslError (ASL_ERROR, ASL_MSG_BUFFER_ALLOCATION, + NULL, NULL); + AslAbort (); +} + + /******************************************************************************* * * FUNCTION: UtInternalizeName Modified: head/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtio.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/dtio.c Wed Sep 19 23:25:24 2012 (r240716) @@ -413,13 +413,21 @@ DtGetNextLine ( BOOLEAN LineNotAllBlanks = FALSE; UINT32 State = DT_NORMAL_TEXT; UINT32 CurrentLineOffset; - UINT32 BeyondBufferCount; UINT32 i; char c; - for (i = 0; i < ASL_LINE_BUFFER_SIZE;) + for (i = 0; ;) { + /* + * If line is too long, expand the line buffers. Also increases + * Gbl_LineBufferSize. + */ + if (i >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + c = (char) getc (Handle); if (c == EOF) { @@ -491,6 +499,11 @@ DtGetNextLine ( */ if ((i != 0) && LineNotAllBlanks) { + if ((i + 1) >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + Gbl_CurrentLineBuffer[i+1] = 0; /* Terminate string */ return (CurrentLineOffset); } @@ -565,6 +578,11 @@ DtGetNextLine ( default: /* Not a comment */ i++; /* Save the preceeding slash */ + if (i >= Gbl_LineBufferSize) + { + UtExpandLineBuffers (); + } + Gbl_CurrentLineBuffer[i] = c; i++; State = DT_NORMAL_TEXT; @@ -668,21 +686,6 @@ DtGetNextLine ( return (ASL_EOF); } } - - /* Line is too long for internal buffer. Determine actual length */ - - BeyondBufferCount = 1; - c = (char) getc (Handle); - while (c != '\n') - { - c = (char) getc (Handle); - BeyondBufferCount++; - } - - printf ("ERROR - At %u: Input line (%u bytes) is too long (max %u)\n", - Gbl_CurrentLineNumber++, ASL_LINE_BUFFER_SIZE + BeyondBufferCount, - ASL_LINE_BUFFER_SIZE); - return (ASL_EOF); } Modified: head/sys/contrib/dev/acpica/compiler/preprocess.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/preprocess.h Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/compiler/preprocess.h Wed Sep 19 23:25:24 2012 (r240716) @@ -128,10 +128,13 @@ typedef struct pr_file_node /* * Globals */ -PR_EXTERN char XXXEvalBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_MainTokenBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_MacroTokenBuffer[ASL_LINE_BUFFER_SIZE]; -PR_EXTERN char Gbl_ExpressionTokenBuffer[ASL_LINE_BUFFER_SIZE]; +#if 0 /* TBD for macros */ +PR_EXTERN char PR_INIT_GLOBAL (*XXXEvalBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +#endif + +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_MainTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_MacroTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ +PR_EXTERN char PR_INIT_GLOBAL (*Gbl_ExpressionTokenBuffer, NULL); /* [ASL_LINE_BUFFER_SIZE]; */ PR_EXTERN PR_FILE_NODE *Gbl_InputFileList; PR_EXTERN PR_DEFINE_INFO PR_INIT_GLOBAL (*Gbl_DefineList, NULL); Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Sep 19 23:03:54 2012 (r240715) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Wed Sep 19 23:25:24 2012 (r240716) @@ -607,7 +607,7 @@ AcpiDbExecuteSetup ( AcpiDbPrepNamestring (Info->Pathname); AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); - AcpiOsPrintf ("Executing %s\n", Info->Pathname); + AcpiOsPrintf ("Evaluating %s\n", Info->Pathname); if (Info->Flags & EX_SINGLE_STEP) { @@ -701,7 +701,7 @@ AcpiDbExecutionWalk ( ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 02:25:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CD64106566B; Thu, 20 Sep 2012 02:25:19 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 481AD8FC0C; Thu, 20 Sep 2012 02:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K2PJDK022022; Thu, 20 Sep 2012 02:25:19 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K2PJNC022020; Thu, 20 Sep 2012 02:25:19 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200225.q8K2PJNC022020@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 02:25: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: r240719 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 02:25:19 -0000 Author: kevlo Date: Thu Sep 20 02:25:18 2012 New Revision: 240719 URL: http://svn.freebsd.org/changeset/base/240719 Log: Remove the restrict qualifier to match function prototype. Modified: head/lib/libc/sys/recv.2 Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Thu Sep 20 01:23:54 2012 (r240718) +++ head/lib/libc/sys/recv.2 Thu Sep 20 02:25:18 2012 (r240719) @@ -44,7 +44,7 @@ .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" .Ft ssize_t -.Fn recvfrom "int s" "void * restrict buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" +.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" .Ft ssize_t .Fn recvmsg "int s" "struct msghdr *msg" "int flags" .Sh DESCRIPTION From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 02:49:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FABE1065670; Thu, 20 Sep 2012 02:49:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2977E8FC0C; Thu, 20 Sep 2012 02:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K2nPNX025209; Thu, 20 Sep 2012 02:49:25 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K2nPoM025202; Thu, 20 Sep 2012 02:49:25 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201209200249.q8K2nPoM025202@svn.freebsd.org> From: Rick Macklem Date: Thu, 20 Sep 2012 02:49: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: r240720 - in head/sys/fs: nfs nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 02:49:26 -0000 Author: rmacklem Date: Thu Sep 20 02:49:25 2012 New Revision: 240720 URL: http://svn.freebsd.org/changeset/base/240720 Log: Modify the NFSv4 client so that it can handle owner and owner_group strings that consist entirely of digits, interpreting them as the uid/gid number. This change was needed since new (>= 3.3) Linux servers reply with these strings by default. This change is mandated by the rfc3530bis draft. Reported on freebsd-stable@ under the Subject heading "Problem with Linux >= 3.3 as NFSv4 server" by Norbert Aschendorff on Aug. 20, 2012. Tested by: norbert.aschendorff at yahoo.de Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs.h Thu Sep 20 02:49:25 2012 (r240720) @@ -559,6 +559,7 @@ struct nfsrv_descript { #define ND_EXGSSINTEGRITY 0x00200000 #define ND_EXGSSPRIVACY 0x00400000 #define ND_INCRSEQID 0x00800000 +#define ND_NFSCL 0x01000000 /* * ND_GSS should be the "or" of all GSS type authentications. Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_commonacl.c Thu Sep 20 02:49:25 2012 (r240720) @@ -101,12 +101,12 @@ nfsrv_dissectace(struct nfsrv_descript * if (gotid == 0) { if (flag & NFSV4ACE_IDENTIFIERGROUP) { acep->ae_tag = ACL_GROUP; - aceerr = nfsv4_strtogid(name, len, &gid, p); + aceerr = nfsv4_strtogid(nd, name, len, &gid, p); if (aceerr == 0) acep->ae_id = (uid_t)gid; } else { acep->ae_tag = ACL_USER; - aceerr = nfsv4_strtouid(name, len, &uid, p); + aceerr = nfsv4_strtouid(nd, name, len, &uid, p); if (aceerr == 0) acep->ae_id = uid; } Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Sep 20 02:49:25 2012 (r240720) @@ -1401,12 +1401,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd } if (compare) { if (!(*retcmpp)) { - if (nfsv4_strtouid(cp, j, &uid, p) || + if (nfsv4_strtouid(nd, cp, j, &uid, p) || nap->na_uid != uid) *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { - if (nfsv4_strtouid(cp, j, &uid, p)) + if (nfsv4_strtouid(nd, cp, j, &uid, p)) nap->na_uid = nfsrv_defaultuid; else nap->na_uid = uid; @@ -1434,12 +1434,12 @@ nfsv4_loadattr(struct nfsrv_descript *nd } if (compare) { if (!(*retcmpp)) { - if (nfsv4_strtogid(cp, j, &gid, p) || + if (nfsv4_strtogid(nd, cp, j, &gid, p) || nap->na_gid != gid) *retcmpp = NFSERR_NOTSAME; } } else if (nap != NULL) { - if (nfsv4_strtogid(cp, j, &gid, p)) + if (nfsv4_strtogid(nd, cp, j, &gid, p)) nap->na_gid = nfsrv_defaultgid; else nap->na_gid = gid; @@ -2594,27 +2594,41 @@ tryagain: * Convert a string to a uid. * If no conversion is possible return NFSERR_BADOWNER, otherwise * return 0. + * If this is called from a client side mount using AUTH_SYS and the + * string is made up entirely of digits, just convert the string to + * a number. */ APPLESTATIC int -nfsv4_strtouid(u_char *str, int len, uid_t *uidp, NFSPROC_T *p) +nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp, + NFSPROC_T *p) { int i; - u_char *cp; + char *cp, *endstr, *str0; struct nfsusrgrp *usrp; int cnt, ret; int error = 0; + uid_t tuid; if (len == 0) { error = NFSERR_BADOWNER; goto out; } + /* If a string of digits and an AUTH_SYS mount, just convert it. */ + str0 = str; + tuid = (uid_t)strtoul(str0, &endstr, 10); + if ((endstr - str0) == len && + (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { + *uidp = tuid; + goto out; + } /* * Look for an '@'. */ - cp = str; - for (i = 0; i < len; i++) - if (*cp++ == '@') - break; + cp = strchr(str0, '@'); + if (cp != NULL) + i = (int)(cp++ - str0); + else + i = len; cnt = 0; tryagain: @@ -2783,27 +2797,43 @@ tryagain: /* * Convert a string to a gid. + * If no conversion is possible return NFSERR_BADOWNER, otherwise + * return 0. + * If this is called from a client side mount using AUTH_SYS and the + * string is made up entirely of digits, just convert the string to + * a number. */ APPLESTATIC int -nfsv4_strtogid(u_char *str, int len, gid_t *gidp, NFSPROC_T *p) +nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp, + NFSPROC_T *p) { int i; - u_char *cp; + char *cp, *endstr, *str0; struct nfsusrgrp *usrp; int cnt, ret; int error = 0; + gid_t tgid; if (len == 0) { error = NFSERR_BADOWNER; goto out; } + /* If a string of digits and an AUTH_SYS mount, just convert it. */ + str0 = str; + tgid = (gid_t)strtoul(str0, &endstr, 10); + if ((endstr - str0) == len && + (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { + *gidp = tgid; + goto out; + } /* * Look for an '@'. */ - cp = str; - for (i = 0; i < len; i++) - if (*cp++ == '@') - break; + cp = strchr(str0, '@'); + if (cp != NULL) + i = (int)(cp++ - str0); + else + i = len; cnt = 0; tryagain: Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfs/nfs_var.h Thu Sep 20 02:49:25 2012 (r240720) @@ -295,9 +295,11 @@ void nfsrv_adj(mbuf_t, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); int nfsd_errmap(struct nfsrv_descript *); void nfsv4_uidtostr(uid_t, u_char **, int *, NFSPROC_T *); -int nfsv4_strtouid(u_char *, int, uid_t *, NFSPROC_T *); +int nfsv4_strtouid(struct nfsrv_descript *, u_char *, int, uid_t *, + NFSPROC_T *); void nfsv4_gidtostr(gid_t, u_char **, int *, NFSPROC_T *); -int nfsv4_strtogid(u_char *, int, gid_t *, NFSPROC_T *); +int nfsv4_strtogid(struct nfsrv_descript *, u_char *, int, gid_t *, + NFSPROC_T *); int nfsrv_checkuidgid(struct nfsrv_descript *, struct nfsvattr *); void nfsrv_fixattr(struct nfsrv_descript *, vnode_t, struct nfsvattr *, NFSACL_T *, NFSPROC_T *, nfsattrbit_t *, Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Thu Sep 20 02:49:25 2012 (r240720) @@ -126,11 +126,11 @@ nfscl_reqstart(struct nfsrv_descript *nd * First, fill in some of the fields of nd. */ if (NFSHASNFSV4(nmp)) - nd->nd_flag = ND_NFSV4; + nd->nd_flag = ND_NFSV4 | ND_NFSCL; else if (NFSHASNFSV3(nmp)) - nd->nd_flag = ND_NFSV3; + nd->nd_flag = ND_NFSV3 | ND_NFSCL; else - nd->nd_flag = ND_NFSV2; + nd->nd_flag = ND_NFSV2 | ND_NFSCL; nd->nd_procnum = procnum; nd->nd_repstat = 0; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Sep 20 02:25:18 2012 (r240719) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Sep 20 02:49:25 2012 (r240720) @@ -2437,7 +2437,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, s goto nfsmout; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsv4_strtouid(cp,j,&uid,p); + nd->nd_repstat = nfsv4_strtouid(nd, cp, j, &uid, + p); if (!nd->nd_repstat) nvap->na_uid = uid; } @@ -2463,7 +2464,8 @@ nfsv4_sattr(struct nfsrv_descript *nd, s goto nfsmout; } if (!nd->nd_repstat) { - nd->nd_repstat = nfsv4_strtogid(cp,j,&gid,p); + nd->nd_repstat = nfsv4_strtogid(nd, cp, j, &gid, + p); if (!nd->nd_repstat) nvap->na_gid = gid; } From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:03:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0577E1065672; Thu, 20 Sep 2012 03:03:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E48898FC0C; Thu, 20 Sep 2012 03:03:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K331KO027292; Thu, 20 Sep 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K331KZ027290; Thu, 20 Sep 2012 03:03:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200303.q8K331KZ027290@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:03: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: r240721 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:03:02 -0000 Author: adrian Date: Thu Sep 20 03:03:01 2012 New Revision: 240721 URL: http://svn.freebsd.org/changeset/base/240721 Log: Add a work-around for some strange net80211 BAR races in the wireless stack. There are unfortunately quite a few odd cases in BAR TX and BAR TX retransmission that I haven't yet fully diagnosed. So for now, add this work-around so the resume() function isn't called too often, decrementing pause to -1 (and causing things to stay paused.) Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 02:49:25 2012 (r240720) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:03:01 2012 (r240721) @@ -5043,10 +5043,19 @@ ath_bar_response(struct ieee80211_node * * XXX if this is attempt=50, the TID will be downgraded * XXX to a non-aggregate session. So we must unpause the * XXX TID here or it'll never be done. + * + * Also, don't call it if bar_tx/bar_wait are 0; something + * has beaten us to the punch? (XXX figure out what?) */ if (status == 0 || attempts == 50) { ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); - ath_tx_tid_bar_unsuspend(sc, atid); + if (atid->bar_tx == 0 || atid->bar_wait == 0) + device_printf(sc->sc_dev, + "%s: huh? bar_tx=%d, bar_wait=%d\n", + __func__, + atid->bar_tx, atid->bar_wait); + else + ath_tx_tid_bar_unsuspend(sc, atid); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } } From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:04:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED3E4106566C; Thu, 20 Sep 2012 03:04:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D967E8FC14; Thu, 20 Sep 2012 03:04:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K34J9H027511; Thu, 20 Sep 2012 03:04:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K34Jen027509; Thu, 20 Sep 2012 03:04:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200304.q8K34Jen027509@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:04: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: r240722 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:04:20 -0000 Author: adrian Date: Thu Sep 20 03:04:19 2012 New Revision: 240722 URL: http://svn.freebsd.org/changeset/base/240722 Log: Place the comment where it should be. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:03:01 2012 (r240721) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:04:19 2012 (r240722) @@ -1289,8 +1289,18 @@ ath_tx_xmit_normal(struct ath_softc *sc, ath_tx_handoff(sc, txq, bf); } - - +/* + * Do the basic frame setup stuff that's required before the frame + * is added to a software queue. + * + * All frames get mostly the same treatment and it's done once. + * Retransmits fiddle with things like the rate control setup, + * setting the retransmit bit in the packet; doing relevant DMA/bus + * syncing and relinking it (back) into the hardware TX queue. + * + * Note that this may cause the mbuf to be reallocated, so + * m0 may not be valid. + */ static int ath_tx_normal_setup(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf, struct mbuf *m0, struct ath_txq *txq) @@ -2701,20 +2711,6 @@ ath_tx_swq(struct ath_softc *sc, struct } /* - * Do the basic frame setup stuff that's required before the frame - * is added to a software queue. - * - * All frames get mostly the same treatment and it's done once. - * Retransmits fiddle with things like the rate control setup, - * setting the retransmit bit in the packet; doing relevant DMA/bus - * syncing and relinking it (back) into the hardware TX queue. - * - * Note that this may cause the mbuf to be reallocated, so - * m0 may not be valid. - */ - - -/* * Configure the per-TID node state. * * This likely belongs in if_ath_node.c but I can't think of anywhere From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:09:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9C3A1065673; Thu, 20 Sep 2012 03:09:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D61688FC0C; Thu, 20 Sep 2012 03:09:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K39wCS028294; Thu, 20 Sep 2012 03:09:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K39w3E028291; Thu, 20 Sep 2012 03:09:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200309.q8K39w3E028291@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 03:09: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: r240723 - 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: Thu, 20 Sep 2012 03:09:59 -0000 Author: glebius Date: Thu Sep 20 03:09:58 2012 New Revision: 240723 URL: http://svn.freebsd.org/changeset/base/240723 Log: Add missing break. Pointy hat to: glebius Modified: head/sys/net/pfvar.h Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Sep 20 03:04:19 2012 (r240722) +++ head/sys/net/pfvar.h Thu Sep 20 03:09:58 2012 (r240723) @@ -1743,6 +1743,7 @@ pf_hashsrc(struct pf_addr *addr, sa_fami break; case AF_INET6: h = ADDR_HASH(addr->v6.__u6_addr.__u6_addr32[3]); + break; default: panic("%s: unknown address family %u", __func__, af); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:13:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF9EF106566C; Thu, 20 Sep 2012 03:13:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9D748FC0C; Thu, 20 Sep 2012 03:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3DKuK028961; Thu, 20 Sep 2012 03:13:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3DKlO028959; Thu, 20 Sep 2012 03:13:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209200313.q8K3DKlO028959@svn.freebsd.org> From: Adrian Chadd Date: Thu, 20 Sep 2012 03:13: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: r240724 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 03:13:21 -0000 Author: adrian Date: Thu Sep 20 03:13:20 2012 New Revision: 240724 URL: http://svn.freebsd.org/changeset/base/240724 Log: Introduce the CLRDMASK gating based on tid->clrdmask, enabling filtered frames to occur. * Create a new function which will set the bf_flags CLRDMASK bit if required. * For raw frames, always set CLRDMASK. * For BAR, ADDBA frames, always set CLRDMASK. * For everything else, check if CLRDMASK needs to be set before calling tx_setds() or tx_setds11n(). * When unpausing a queue or drain/resetting it, set tid->clrdmask=1 just to ensure traffic starts flowing. What I need to do: * Modify that function to _clear_ the CLRDMASK if it's not required, or retried frames may have CLRDMASK set when they don't need to. (Which isn't a huge deal, but..) Whilst I'm here: * ath_tx_normal_xmit() should really act like the AMPDU session TX functions - any incomplete frames will end up being assigned ath_tx_normal_comp() which will decrement tid->hwq_depth - but that won't have been incremented. So whilst I'm here, add a comment to do that. * Fix the debug print function to be slightly clearer about things; it's not a good sign when I can't interpret my own debugging output. I've done some testing on AR9280/AR5416/AR9160 STA and AP modes. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:09:58 2012 (r240723) +++ head/sys/dev/ath/if_ath_tx.c Thu Sep 20 03:13:20 2012 (r240724) @@ -1285,6 +1285,9 @@ ath_tx_xmit_normal(struct ath_softc *sc, ath_tx_rate_fill_rcflags(sc, bf); ath_tx_setds(sc, bf); + /* XXX Bump TID HWQ counter */ + /* XXX Assign a completion handler */ + /* Hand off to hardware */ ath_tx_handoff(sc, txq, bf); } @@ -1384,7 +1387,8 @@ ath_tx_normal_setup(struct ath_softc *sc } an = ATH_NODE(ni); - flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + //flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ + flags = 0; ismrr = 0; /* default no multi-rate retry*/ pri = M_WME_GETAC(m0); /* honor classification */ /* XXX use txparams instead of fixed values */ @@ -1598,12 +1602,15 @@ ath_tx_normal_setup(struct ath_softc *sc } /* - * Direct-dispatch the current frame to the hardware. + * Queue a frame to the hardware or software queue. * * This can be called by the net80211 code. * * XXX what about locking? Or, push the seqno assign into the * XXX aggregate scheduler so its serialised? + * + * XXX When sending management frames via ath_raw_xmit(), + * should CLRDMASK be set unconditionally? */ int ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, @@ -1774,11 +1781,13 @@ ath_tx_start(struct ath_softc *sc, struc if (txq == &avp->av_mcastq) { DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: mcastq: TX'ing\n", __func__, bf); + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); } else if (type == IEEE80211_FC0_TYPE_CTL && subtype == IEEE80211_FC0_SUBTYPE_BAR) { DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: BAR: TX'ing direct\n", __func__); + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); } else { /* add to software queue */ @@ -1791,6 +1800,7 @@ ath_tx_start(struct ath_softc *sc, struc * For now, since there's no software queue, * direct-dispatch to the hardware. */ + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, txq, bf); #endif done: @@ -1874,6 +1884,7 @@ ath_tx_raw_start(struct ath_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); bf->bf_node = ni; /* NB: held reference */ + /* Always enable CLRDMASK for raw frames for now.. */ flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ flags |= HAL_TXDESC_INTREQ; /* force interrupt */ if (params->ibp_flags & IEEE80211_BPF_RTS) @@ -2002,6 +2013,7 @@ ath_tx_raw_start(struct ath_softc *sc, s __func__, do_override); if (do_override) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; ath_tx_xmit_normal(sc, sc->sc_ac2q[pri], bf); } else { /* Queue to software queue */ @@ -2467,6 +2479,22 @@ ath_tx_tid_unsched(struct ath_softc *sc, } /* + * Update the CLRDMASK bit in the ath_buf if it needs to be set. + */ +static void +ath_tx_update_clrdmask(struct ath_softc *sc, struct ath_tid *tid, + struct ath_buf *bf) +{ + + ATH_TID_LOCK_ASSERT(sc, tid); + + if (tid->clrdmask == 1) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; + tid->clrdmask = 0; + } +} + +/* * Assign a sequence number manually to the given frame. * * This should only be called for A-MPDU TX frames. @@ -2582,6 +2610,9 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s bf->bf_state.bfs_nframes = 1; } + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* Direct dispatch to hardware */ ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); @@ -2701,6 +2732,7 @@ ath_tx_swq(struct ath_softc *sc, struct } else if (txq->axq_depth < sc->sc_hwq_limit) { /* AMPDU not running, attempt direct dispatch */ DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__); + ath_tx_update_clrdmask(sc, atid, bf); ath_tx_xmit_normal(sc, txq, bf); } else { /* Busy; queue */ @@ -2789,6 +2821,12 @@ ath_tx_tid_resume(struct ath_softc *sc, return; } + /* + * Override the clrdmask configuration for the next frame, + * just to get the ball rolling. + */ + tid->clrdmask = 1; + ath_tx_tid_sched(sc, tid); /* Punt some frames to the hardware if needed */ //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); @@ -3109,6 +3147,12 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, tid->bar_tx = 1; /* + * Override the clrdmask configuration for the next frame, + * just to get the ball rolling. + */ + tid->clrdmask = 1; + + /* * Calculate new BAW left edge, now that all frames have either * succeeded or failed. * @@ -3189,6 +3233,12 @@ ath_tx_tid_drain_print(struct ath_softc SEQNO(bf->bf_state.bfs_seqno), bf->bf_state.bfs_retries); device_printf(sc->sc_dev, + "%s: node %p: bf=%p: txq axq_depth=%d, axq_aggr_depth=%d\n", + __func__, ni, bf, + txq->axq_depth, + txq->axq_aggr_depth); + + device_printf(sc->sc_dev, "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, isfiltered=%d\n", __func__, ni, bf, tid->axq_depth, @@ -3196,13 +3246,13 @@ ath_tx_tid_drain_print(struct ath_softc tid->bar_wait, tid->isfiltered); device_printf(sc->sc_dev, - "%s: node %p: tid %d: txq_depth=%d, " - "txq_aggr_depth=%d, sched=%d, paused=%d, " - "hwq_depth=%d, incomp=%d, baw_head=%d, " + "%s: node %p: tid %d: " + "sched=%d, paused=%d, " + "incomp=%d, baw_head=%d, " "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", - __func__, ni, tid->tid, txq->axq_depth, - txq->axq_aggr_depth, tid->sched, tid->paused, - tid->hwq_depth, tid->incomp, tid->baw_head, + __func__, ni, tid->tid, + tid->sched, tid->paused, + tid->incomp, tid->baw_head, tid->baw_tail, tap == NULL ? -1 : tap->txa_start, ni->ni_txseqs[tid->tid]); @@ -3274,6 +3324,15 @@ ath_tx_tid_drain(struct ath_softc *sc, s } /* + * Override the clrdmask configuration for the next frame + * in case there is some future transmission, just to get + * the ball rolling. + * + * This won't hurt things if the TID is about to be freed. + */ + tid->clrdmask = 1; + + /* * Now that it's completed, grab the TID lock and update * the sequence number and BAW window. * Because sequence numbers have been assigned to frames @@ -4511,6 +4570,9 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft bf->bf_state.bfs_aggr = 0; bf->bf_state.bfs_nframes = 1; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); @@ -4573,6 +4635,10 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft if (bf->bf_state.bfs_nframes == 1) { DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: single-frame aggregate\n", __func__); + + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + bf->bf_state.bfs_aggr = 0; bf->bf_state.bfs_ndelim = 0; ath_tx_setds(sc, bf); @@ -4591,6 +4657,9 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft sc->sc_aggr_stats.aggr_pkts[bf->bf_state.bfs_nframes]++; sc->sc_aggr_stats.aggr_aggr_pkt++; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* * Calculate the duration/protection as required. */ @@ -4654,7 +4723,7 @@ ath_tx_tid_hw_queue_norm(struct ath_soft DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: node %p: TID %d: called\n", __func__, an, tid->tid); - ATH_TXQ_LOCK_ASSERT(txq); + ATH_TID_LOCK_ASSERT(sc, tid); /* Check - is AMPDU pending or running? then print out something */ if (ath_tx_ampdu_pending(sc, an, tid->tid)) @@ -4691,6 +4760,9 @@ ath_tx_tid_hw_queue_norm(struct ath_soft /* Normal completion handler */ bf->bf_comp = ath_tx_normal_comp; + /* Update CLRDMASK just before this frame is queued */ + ath_tx_update_clrdmask(sc, tid, bf); + /* Program descriptors + rate control */ ath_tx_do_ratelookup(sc, bf); ath_tx_calc_duration(sc, bf); From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:29:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55FDB106566C; Thu, 20 Sep 2012 03:29:44 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F468FC0A; Thu, 20 Sep 2012 03:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3Ti9n031277; Thu, 20 Sep 2012 03:29:44 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3ThNc031273; Thu, 20 Sep 2012 03:29:43 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200329.q8K3ThNc031273@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 03:29: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: r240725 - in head: contrib/libpcap sys/contrib/ipfilter/netinet sys/netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 03:29:44 -0000 Author: kevlo Date: Thu Sep 20 03:29:43 2012 New Revision: 240725 URL: http://svn.freebsd.org/changeset/base/240725 Log: Fix typo: s/pakcet/packet Modified: head/contrib/libpcap/pcap-snoop.c head/sys/contrib/ipfilter/netinet/ip_auth.c head/sys/netinet/libalias/alias_skinny.c Modified: head/contrib/libpcap/pcap-snoop.c ============================================================================== --- head/contrib/libpcap/pcap-snoop.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/contrib/libpcap/pcap-snoop.c Thu Sep 20 03:29:43 2012 (r240725) @@ -100,7 +100,7 @@ again: /* * XXX - Sigh, snoop_packetlen is a 16 bit quantity. If we - * got a short length, but read a full sized snoop pakcet, + * got a short length, but read a full sized snoop packet, * assume we overflowed and add back the 64K... */ if (cc == (p->snapshot + sizeof(struct snoopheader)) && Modified: head/sys/contrib/ipfilter/netinet/ip_auth.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/sys/contrib/ipfilter/netinet/ip_auth.c Thu Sep 20 03:29:43 2012 (r240725) @@ -712,7 +712,7 @@ int fr_authflush() /* ------------------------------------------------------------------------ */ /* Function: fr_auth_waiting */ -/* Returns: int - 0 = no pakcets wiating, 1 = packets waiting. */ +/* Returns: int - 0 = no packets waiting, 1 = packets waiting. */ /* Parameters: None */ /* */ /* Simple truth check to see if there are any packets waiting in the auth */ Modified: head/sys/netinet/libalias/alias_skinny.c ============================================================================== --- head/sys/netinet/libalias/alias_skinny.c Thu Sep 20 03:13:20 2012 (r240724) +++ head/sys/netinet/libalias/alias_skinny.c Thu Sep 20 03:29:43 2012 (r240725) @@ -340,7 +340,7 @@ AliasHandleSkinny(struct libalias *la, s * through the packet using len to determine message boundaries. * This comes into play big time with port messages being in the * same packet as register messages. Also, open receive channel - * acks are usually buried in a pakcet some 400 bytes long. + * acks are usually buried in a packet some 400 bytes long. */ while (dlen >= skinny_hdr_len) { len = (sd->len); From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 03:48:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0777106567C; Thu, 20 Sep 2012 03:48:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA66A8FC08; Thu, 20 Sep 2012 03:48:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K3maPc034113; Thu, 20 Sep 2012 03:48:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K3maMO034111; Thu, 20 Sep 2012 03:48:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209200348.q8K3maMO034111@svn.freebsd.org> From: Eitan Adler Date: Thu, 20 Sep 2012 03:48: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: r240728 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 03:48:37 -0000 Author: eadler Date: Thu Sep 20 03:48:36 2012 New Revision: 240728 URL: http://svn.freebsd.org/changeset/base/240728 Log: Rewrite portions of development.7 to make sense in the world of subversion. Approved by: gjb MFC after: 2 weeks Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Sep 20 03:42:14 2012 (r240727) +++ head/share/man/man7/development.7 Thu Sep 20 03:48:36 2012 (r240728) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 2, 2012 +.Dd September 19, 2012 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -48,7 +48,7 @@ kernel. The methods described here are as applicable to production installations as it is to development environments. -You need a good 12-17GB of disk space on one machine to make this work +You need approximately 10GB of disk space on one machine to make this work conveniently. .Sh SETTING UP THE ENVIRONMENT ON THE MASTER SERVER Your master server should always run a stable, production version of the @@ -62,9 +62,9 @@ where you lose the environment and/or ca .Pp Create a huge partition called .Pa /FreeBSD . -8-12GB is recommended. +Approximately 7GB is recommended. This partition will contain nearly all the development environment, -including the CVS tree, broken-out source, and possibly even object files. +including the subversion tree, broken-out source, and possibly even object files. You are going to export this partition to your other machines via a READ-ONLY NFS export so do not mix it with other more security-sensitive partitions. @@ -89,70 +89,19 @@ I recommend a partition of at least 5GB. .Pp On the master server, use -.Xr csup 1 -to automatically pull down and maintain +.Xr svn 1 +to pull down and maintain the .Fx -CVS archive once a day. +source. The first pull will take a long time, it is several gigabytes, but once you have it, -the daily synchronizations will be quite small. -.Bd -literal -offset 4n -mkdir /FreeBSD/FreeBSD-CVS -rm -rf /home/ncvs -ln -s /FreeBSD/FreeBSD-CVS /home/ncvs -.Ed -.Pp -The -.Xr cron 8 -job should look something like this (please randomize the time of -day!). -Note that you can use the -.Xr csup 1 -configuration file example directly from -.Pa /usr/share/examples -without modification by supplying appropriate arguments -to -.Xr csup 1 . -.Bd -literal -offset 4n -33 6 * * * /usr/bin/csup -r 20 -L 2 -h cvsup.freebsd.org /usr/share/examples/cvsup/cvs-supfile -.Ed -.Pp -Run the -.Xr csup 1 -manually the first time to pull down the archive. -It could take -all day depending on how fast your connection is! -You will run all -.Xr csup 1 -and -.Xr cvs 1 +the updates will be quite small. +Run all +.Xr svn 1 operations as .Dq Li root -and you need to set up a -.Pa ~/.cvsrc -.Pq Pa /root/.cvsrc -file, as shown below, for proper -.Xr cvs 1 -operation. -Using -.Pa ~/.cvsrc -to specify -.Xr cvs 1 -defaults is an excellent way to -.Dq "file and forget" , -but you should never forget that you put them in there. -.Bd -literal -offset 4n -# cvs -q -diff -u -update -Pd -checkout -P -.Ed -.Pp -Now use -.Xr cvs 1 -to check out a -STABLE source tree and a -CURRENT source tree, -as well as ports and docs, to create your initial source environment. +.Pp Keeping the broken-out source and ports in .Pa /FreeBSD allows you to export @@ -160,71 +109,16 @@ it to other machines via read-only NFS. This also means you only need to edit/maintain files in one place and all your clients automatically pick up the changes. .Bd -literal -offset 4n -mkdir /FreeBSD/FreeBSD-4.x -mkdir /FreeBSD/FreeBSD-current - -cd /FreeBSD/FreeBSD-4.x -cvs -d /home/ncvs checkout -rRELENG_4 src - -cd /FreeBSD/FreeBSD-current -cvs -d /home/ncvs checkout src -cvs -d /home/ncvs checkout ports -cvs -d /home/ncvs checkout doc -.Ed -.Pp -Now create a softlink for -.Pa /usr/src -and -.Pa /usr/src2 . -On the main server I always point -.Pa /usr/src -at -STABLE and -.Pa /usr/src2 -at -CURRENT. -On client machines I usually do not have a -.Pa /usr/src2 -and I make -.Pa /usr/src -point at whatever version of -.Fx -the client box is intended to -run. -.Bd -literal -offset 4n +mkdir /FreeBSD +cd /FreeBSD +svn co svn://svn.freebsd.org/ports/head ports +svn co svn://svn.freebsd.org/doc/head doc +svn co svn://svn.freebsd.org/base/head src cd /usr -rm -rf src src2 -ln -s /FreeBSD/FreeBSD-4.x/src src (could be -CURRENT on a client) -ln -s /FreeBSD/FreeBSD-current/src src2 (MASTER SERVER ONLY) +rm -rf src +ln -s /FreeBSD/src src .Ed .Pp -Now you have to make a choice for -.Pa /usr/obj . -Well, hopefully you made it already and chose the partition method. -If you -chose poorly you probably intend to put it in -.Pa /FreeBSD -and, if so, this is -what you want to do: -.Bd -literal -offset 4n -(ONLY IF YOU MADE A POOR CHOICE AND PUT /usr/obj in /FreeBSD!) -mkdir /FreeBSD/obj -cd /usr -rm -rf obj -ln -s /FreeBSD/obj obj -.Ed -.Pp -Alternatively you may chose simply to leave -.Pa /usr/obj -in -.Pa /usr . -If your -.Pa /usr -is large enough this will work, but I do not recommend it for -safety reasons -.Pa ( /usr/obj -is constantly being modified, -.Pa /usr -is not). -.Pp Note that exporting .Pa /usr/obj via read-only NFS to your other boxes will @@ -240,19 +134,17 @@ problems and issues down the line and pr It is far easier to do builds on the master server and then only do installs on the clients. .Pp -I usually maintain my ports tree via CVS. -It is sitting right there in the master CVS archive and I have even told you -to check it out (see above). +I usually maintain my ports tree via svn or portsnap. With some fancy softlinks you can make the ports tree available both on your master server and on all of your other machines. -Note that the ports tree exists only on the HEAD CVS branch, so its always --CURRENT even on a -STABLE box. +Note that the ports tree exists only on the HEAD ports branch, so its always +usable even on a -STABLE box. This is what you do: .Bd -literal -offset 4n (THESE COMMANDS ON THE MASTER SERVER AND ON ALL CLIENTS) cd /usr rm -rf ports -ln -s /FreeBSD/FreeBSD-current/ports ports +ln -s /FreeBSD/ports ports cd /usr/ports (this pushes into the softlink) rm -rf distfiles (ON MASTER SERVER ONLY) @@ -344,7 +236,7 @@ into the NFS-mounted environment. If a particular client is running -CURRENT, .Pa /usr/src should be a softlink to -.Pa /FreeBSD/FreeBSD-current/src . +.Pa /FreeBSD/src . If it is running -STABLE, .Pa /usr/src should be a softlink to @@ -359,8 +251,8 @@ human variety) on a client. (ON EACH CLIENT) cd /usr rm -rf ports src -ln -s /FreeBSD/FreeBSD-current/ports ports -ln -s /FreeBSD/FreeBSD-XXX/src src +ln -s /FreeBSD/ports ports +ln -s /FreeBSD/src src .Ed .Pp Do not forget to create the working directories so you can build ports, as @@ -521,11 +413,6 @@ subdirectory in which is typically local to the client. You can then do builds to your heart's content! .Sh MAINTAINING A LOCAL BRANCH -I have described how to maintain two versions of the source tree, a stable -version in -.Pa /FreeBSD/FreeBSD-4.x -and a current version in -.Pa /FreeBSD/FreeBSD-current . There is absolutely nothing preventing you from breaking out other versions of the source tree into @@ -548,135 +435,33 @@ which can build those other operating sy Many developers choose to maintain a local branch of .Fx to test patches or build a custom distribution. -This can be done with CVS or another source code management system -(SubVersion, Perforce, BitKeeper) with its own repository. -Since the main -.Fx -tree is based on CVS, the former is convenient. +This can be done with svn or another source code management system +(git, mercurial, Perforce, BitKeeper) with its own repository. .Pp -First, you need to modify your -.Xr csup 1 -environment to avoid it modifying -the local changes you have committed to the repository. -It is important to remove the -.Ic delete -keyword from your -.Pa supfile -and to add the -.Pa CVSROOT -subdirectory to your -.Pa refuse -file. -For more information, see -.Xr csup 1 . -.Pp -The -.Fx -version of -.Xr cvs 1 -examines a custom environmental variable, -.Ev CVS_LOCAL_BRANCH_NUM , -which specifies an integer to use when doing a -.Xr cvs 1 -.Cm tag Ns / Ns Cm rtag . -Set this number to something high (say 1000) to avoid colliding -with potential future branches of the main repository. -For example, -branching a file with version 1.4 produces 1.4.1000. -Future commits to this branch will produce revisions 1.4.1000.1, -1.4.1000.2, etc. -.Pp -To fork your local branch, do: -.Bd -literal -offset 4n -cvs rtag -r RELENG_4 -b LOCAL_RELENG_4 src -.Ed -.Pp -After this, you can check out a copy from your local repository using the -new tag and begin making changes and committing them. -For more information on using CVS, see -.Xr cvs 1 . -.Pp -.Sy WARNING! -The -.Xr csup 1 -utility may blow away changes made on a local branch in -some situations. -This has been reported to occur when the master CVS repository is -directly manipulated or an RCS file is changed. -At this point, -.Xr csup 1 -notices that the client and server have entirely -different RCS files, so it does a full replace instead of trying to -send just deltas. -Ideally this situation should never arise, but in the real world it -happens all the time. -.Pp -While this is the only scenario where the problem should crop up, -there have been some suspicious-sounding reports of -.Ev CVS_LOCAL_BRANCH_NUM -lossage that cannot be explained by this alone. -Bottom line is, if you value your local branch then you -should back it up before every update. -.Sh UPDATING VIA CVS -The advantage of using -.Xr csup 1 -to maintain an updated copy of the CVS -repository instead of using it to maintain source trees directly is that you -can then pick and choose when you bring your source tree (or pieces of your -source tree) up to date. +.Sh "UPDATING VIA SVN" By using a .Xr cron 8 -job to maintain an updated CVS repository, you can update -your source tree at any time without any network cost as follows: +job to maintain an updated svn repository, +the source tree can be +updated at any time as follows: .Bd -literal -offset 4n (on the main development server) -cd /usr/src -cvs -d /home/ncvs update -cd /usr/src2 -cvs -d /home/ncvs update -cd /usr/ports -cvs -d /home/ncvs update +cd /usr +svn update src doc ports .Ed .Pp It is that simple, and since you are exporting the whole lot to your clients, your clients have immediate visibility into the updated source. This is a good time to also remind you that most of the -.Xr cvs 1 +.Xr svn 1 operations you do will be done as -.Dq Li root , -and that certain options are -required for CVS to operate properly on the -.Fx -repository. -For example, -.Fl Pd -is necessary when running -.Nm cvs Cm update . -These options are typically placed in your -.Pa ~/.cvsrc -(as already described) -so you do not have to re-specify them every time you run a -.Xr cvs 1 -command. -Maintaining the CVS repository also gives you far more flexibility -in regards to breaking out multiple versions of the source tree. +.Dq Li root . It is a good idea to give your .Pa /FreeBSD partition a lot of space (I recommend -8-12GB) precisely for that reason. -If you can make it 15GB I would do it. +10-15GB) precisely for that reason. .Pp -I generally do not -.Nm cvs Cm update -via a -.Xr cron 8 -job. -This is because I generally want the source to not change out from under me -when I am developing code. -Instead I manually update the source every so often...\& when I feel it is -a good time. -My recommendation is to only keep the CVS repository synchronized via .Xr cron 8 . .Sh SEE ALSO .Xr crontab 1 , @@ -696,3 +481,9 @@ and first appeared in .Fx 5.0 , December 2002. +It was since extensively modified by +.An Eitan Adler Aq eadler@FreeBSD.org +to reflect the repository conversion from +.Xr cvs +to +.Xr svn . From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 04:12:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72A6106566C; Thu, 20 Sep 2012 04:12:09 +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 D2E498FC14; Thu, 20 Sep 2012 04:12:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4C9LN037895; Thu, 20 Sep 2012 04:12:09 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4C9NC037888; Thu, 20 Sep 2012 04:12:09 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201209200412.q8K4C9NC037888@svn.freebsd.org> From: Doug Barton Date: Thu, 20 Sep 2012 04:12: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: r240729 - in head/contrib/bind9: . lib/dns lib/dns/include/dns X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 04:12:10 -0000 Author: dougb Date: Thu Sep 20 04:12:09 2012 New Revision: 240729 URL: http://svn.freebsd.org/changeset/base/240729 Log: Upgrade to 9.8.3-P3: Prevents a crash when queried for a record whose RDATA exceeds 65535 bytes. Prevents a crash when validating caused by using "Bad cache" data before it has been initialized. ISC_QUEUE handling for recursive clients was updated to address a race condition that could cause a memory leak. This rarely occurred with UDP clients, but could be a significant problem for a server handling a steady rate of TCP queries. A condition has been corrected where improper handling of zero-length RDATA could cause undesirable behavior, including termination of the named process. For more information: https://kb.isc.org/article/AA-00788 Modified: head/contrib/bind9/CHANGES head/contrib/bind9/lib/dns/include/dns/rdata.h head/contrib/bind9/lib/dns/master.c head/contrib/bind9/lib/dns/rdata.c head/contrib/bind9/lib/dns/rdataslab.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/CHANGES Thu Sep 20 04:12:09 2012 (r240729) @@ -1,3 +1,8 @@ + --- 9.8.3-P3 released --- + +3364. [security] Named could die on specially crafted record. + [RT #30416] + --- 9.8.3-P2 released --- 3346. [security] Bad-cache data could be used before it was Modified: head/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/include/dns/rdata.h Thu Sep 20 04:12:09 2012 (r240729) @@ -147,6 +147,17 @@ struct dns_rdata { (((rdata)->flags & ~(DNS_RDATA_UPDATE|DNS_RDATA_OFFLINE)) == 0) /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: head/contrib/bind9/lib/dns/master.c ============================================================================== --- head/contrib/bind9/lib/dns/master.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/master.c Thu Sep 20 04:12:09 2012 (r240729) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: head/contrib/bind9/lib/dns/rdata.c ============================================================================== --- head/contrib/bind9/lib/dns/rdata.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/rdata.c Thu Sep 20 04:12:09 2012 (r240729) @@ -429,6 +429,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -459,6 +460,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -466,8 +475,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -602,6 +610,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -673,10 +682,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -804,6 +816,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -818,10 +831,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: head/contrib/bind9/lib/dns/rdataslab.c ============================================================================== --- head/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/lib/dns/rdataslab.c Thu Sep 20 04:12:09 2012 (r240729) @@ -305,6 +305,7 @@ dns_rdataslab_fromrdataset(dns_rdataset_ length = x[i].rdata.length; if (rdataset->type == dns_rdatatype_rrsig) length++; + INSIST(length <= 0xffff); *rawbuf++ = (length & 0xff00) >> 8; *rawbuf++ = (length & 0x00ff); #if DNS_RDATASET_FIXED Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Thu Sep 20 03:48:36 2012 (r240728) +++ head/contrib/bind9/version Thu Sep 20 04:12:09 2012 (r240729) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=2 +RELEASEVER=3 From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 04:53:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8355B106564A; Thu, 20 Sep 2012 04:53:13 +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 6FF798FC12; Thu, 20 Sep 2012 04:53:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K4rDQE043955; Thu, 20 Sep 2012 04:53:13 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K4rDmZ043953; Thu, 20 Sep 2012 04:53:13 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201209200453.q8K4rDmZ043953@svn.freebsd.org> From: Joel Dahl Date: Thu, 20 Sep 2012 04:53: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: r240733 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 04:53:13 -0000 Author: joel (doc committer) Date: Thu Sep 20 04:53:12 2012 New Revision: 240733 URL: http://svn.freebsd.org/changeset/base/240733 Log: mdoc: remove superfluous paragraph macro. Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Sep 20 04:35:20 2012 (r240732) +++ head/share/man/man7/development.7 Thu Sep 20 04:53:12 2012 (r240733) @@ -437,7 +437,6 @@ Many developers choose to maintain a loc to test patches or build a custom distribution. This can be done with svn or another source code management system (git, mercurial, Perforce, BitKeeper) with its own repository. -.Pp .Sh "UPDATING VIA SVN" By using a .Xr cron 8 From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 05:41:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC028106566B; Thu, 20 Sep 2012 05:41:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8356E8FC08; Thu, 20 Sep 2012 05:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K5fLIk051472; Thu, 20 Sep 2012 05:41:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K5fL7j051469; Thu, 20 Sep 2012 05:41:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200541.q8K5fL7j051469@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 05:41: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: r240734 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 05:41:22 -0000 Author: glebius Date: Thu Sep 20 05:41:20 2012 New Revision: 240734 URL: http://svn.freebsd.org/changeset/base/240734 Log: Re-do r240271: - Set IP_RECVDSTADDR sockopt on the socket only in case if it is INADDR_ANY bound. - Supply IP_SENDSRCADDR control message only if we did receive IP_RECVDSTADDR control message. This fixes operation of snmpd bound to a specific local IP address. PR: bin/171279 Modified: head/contrib/bsnmp/snmpd/main.c head/contrib/bsnmp/snmpd/trans_udp.c Modified: head/contrib/bsnmp/snmpd/main.c ============================================================================== --- head/contrib/bsnmp/snmpd/main.c Thu Sep 20 04:53:12 2012 (r240733) +++ head/contrib/bsnmp/snmpd/main.c Thu Sep 20 05:41:20 2012 (r240734) @@ -1203,6 +1203,8 @@ snmpd_input(struct port_input *pi, struc ret = recv_stream(pi); } else { + struct in_addr *laddr; + memset(cbuf, 0, CMSG_SPACE(sizeof(struct in_addr))); msg.msg_control = cbuf; msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); @@ -1210,8 +1212,14 @@ snmpd_input(struct port_input *pi, struc cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; + laddr = (struct in_addr *)CMSG_DATA(cmsgp); - ret = recv_dgram(pi, (struct in_addr *)CMSG_DATA(cmsgp)); + ret = recv_dgram(pi, laddr); + + if (laddr->s_addr == 0) { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } } if (ret == -1) Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Thu Sep 20 04:53:12 2012 (r240733) +++ head/contrib/bsnmp/snmpd/trans_udp.c Thu Sep 20 05:41:20 2012 (r240734) @@ -109,13 +109,6 @@ udp_init_port(struct tport *tp) syslog(LOG_ERR, "creating UDP socket: %m"); return (SNMP_ERR_RES_UNAVAIL); } - if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); - } ip = (p->addr[0] << 24) | (p->addr[1] << 16) | (p->addr[2] << 8) | p->addr[3]; memset(&addr, 0, sizeof(addr)); @@ -123,6 +116,14 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); + if (addr.sin_addr.s_addr == INADDR_ANY && + setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { close(p->input.fd); From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 05:49:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C40A106566C; Thu, 20 Sep 2012 05:49:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7A08FC08; Thu, 20 Sep 2012 05:49:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K5nVGO052747; Thu, 20 Sep 2012 05:49:31 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K5nVHs052745; Thu, 20 Sep 2012 05:49:31 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200549.q8K5nVHs052745@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 05:49: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: r240735 - 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, 20 Sep 2012 05:49:32 -0000 Author: glebius Date: Thu Sep 20 05:49:31 2012 New Revision: 240735 URL: http://svn.freebsd.org/changeset/base/240735 Log: Redo r240386 providing more correct information. Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Thu Sep 20 05:41:20 2012 (r240734) +++ head/share/man/man4/ip.4 Thu Sep 20 05:49:31 2012 (r240735) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd September 12, 2012 +.Dd September 20, 2012 .Dt IP 4 .Os .Sh NAME @@ -187,21 +187,19 @@ cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed .Pp -The socket should be bound to a local port. -The socket may be bound or not bound to a local address. -In the former case address supplied with -.Dv IP_SENDSRCADDR -overrides bound address. -If the socket is bound to a local address and the address supplied with +The socket should be either bound to +.Dv INADDR_ANY +and a local port, and the address supplied with .Dv IP_SENDSRCADDR -is +should't be .Dv INADDR_ANY , -then bound address is overriden via generic source address selection logic, -which would choose IP address of interface closest to destination. -If the socket is not bound to a local address, then address supplied with +or the socket should be bound to a local address and the address supplied with .Dv IP_SENDSRCADDR -can't be +should be .Dv INADDR_ANY . +In the latter case bound address is overriden via generic source address +selection logic, which would choose IP address of interface closest to +destination. .Pp For convenience, .Dv IP_SENDSRCADDR From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 06:52:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB1AB1065670; Thu, 20 Sep 2012 06:52:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7DB8FC0C; Thu, 20 Sep 2012 06:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K6q6KC061852; Thu, 20 Sep 2012 06:52:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K6q6Eq061849; Thu, 20 Sep 2012 06:52:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200652.q8K6q6Eq061849@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 06:52: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: r240736 - in head/sys: net netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 06:52:06 -0000 Author: glebius Date: Thu Sep 20 06:52:05 2012 New Revision: 240736 URL: http://svn.freebsd.org/changeset/base/240736 Log: Utilize Jenkins hash with random seed for source nodes storage. Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Sep 20 05:49:31 2012 (r240735) +++ head/sys/net/pfvar.h Thu Sep 20 06:52:05 2012 (r240736) @@ -1730,28 +1730,6 @@ extern int pf_state_insert(struct pfi struct pf_state *); extern void pf_free_state(struct pf_state *); -static __inline u_int -pf_hashsrc(struct pf_addr *addr, sa_family_t af) -{ - u_int h; - -#define ADDR_HASH(a) ((a) ^ ((a) >> 16)) - - switch (af) { - case AF_INET: - h = ADDR_HASH(addr->v4.s_addr); - break; - case AF_INET6: - h = ADDR_HASH(addr->v6.__u6_addr.__u6_addr32[3]); - break; - default: - panic("%s: unknown address family %u", __func__, af); - } -#undef ADDR_HASH - - return (h & V_pf_srchashmask); -} - static __inline void pf_ref_state(struct pf_state *s) { Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Sep 20 05:49:31 2012 (r240735) +++ head/sys/netpfil/pf/pf.c Thu Sep 20 06:52:05 2012 (r240736) @@ -387,6 +387,27 @@ pf_hashkey(struct pf_state_key *sk) return (h & V_pf_hashmask); } +static __inline uint32_t +pf_hashsrc(struct pf_addr *addr, sa_family_t af) +{ + uint32_t h; + + switch (af) { + case AF_INET: + h = jenkins_hash32((uint32_t *)&addr->v4, + sizeof(addr->v4)/sizeof(uint32_t), V_pf_hashseed); + break; + case AF_INET6: + h = jenkins_hash32((uint32_t *)&addr->v6, + sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); + break; + default: + panic("%s: unknown address family %u", __func__, af); + } + + return (h & V_pf_srchashmask); +} + #ifdef INET6 void pf_addrcpy(struct pf_addr *dst, struct pf_addr *src, sa_family_t af) From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 07:04:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA0F91065674; Thu, 20 Sep 2012 07:04:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D54998FC15; Thu, 20 Sep 2012 07:04:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K748Ai063824; Thu, 20 Sep 2012 07:04:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K748Kg063822; Thu, 20 Sep 2012 07:04:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209200704.q8K748Kg063822@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 07: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: r240737 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 07:04:09 -0000 Author: glebius Date: Thu Sep 20 07:04:08 2012 New Revision: 240737 URL: http://svn.freebsd.org/changeset/base/240737 Log: Reduce copy/paste when freeing an source node. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Sep 20 06:52:05 2012 (r240736) +++ head/sys/netpfil/pf/pf.c Thu Sep 20 07:04:08 2012 (r240737) @@ -673,6 +673,11 @@ pf_remove_src_node(struct pf_src_node *s PF_HASHROW_LOCK(sh); LIST_REMOVE(src, entry); PF_HASHROW_UNLOCK(sh); + + V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; + V_pf_status.src_nodes--; + + uma_zfree(V_pf_sources_z, src); } /* Data storage structures initialization. */ @@ -3547,18 +3552,12 @@ csfailed: if (nk != NULL) uma_zfree(V_pf_state_key_z, nk); - if (sn != NULL && sn->states == 0 && sn->expire == 0) { + if (sn != NULL && sn->states == 0 && sn->expire == 0) pf_remove_src_node(sn); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; - uma_zfree(V_pf_sources_z, sn); - } - if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) { + + if (nsn != sn && nsn != NULL && nsn->states == 0 && nsn->expire == 0) pf_remove_src_node(nsn); - V_pf_status.scounters[SCNT_SRC_NODE_REMOVALS]++; - V_pf_status.src_nodes--; - uma_zfree(V_pf_sources_z, nsn); - } + return (PF_DROP); } From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 07:07:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BBD106566C; Thu, 20 Sep 2012 07:07:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5E318FC19; Thu, 20 Sep 2012 07:07:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K77ZaS064386; Thu, 20 Sep 2012 07:07:35 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K77Zlj064384; Thu, 20 Sep 2012 07:07:35 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209200707.q8K77Zlj064384@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 07:07: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: r240738 - 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, 20 Sep 2012 07:07:35 -0000 Author: kevlo Date: Thu Sep 20 07:07:35 2012 New Revision: 240738 URL: http://svn.freebsd.org/changeset/base/240738 Log: Remove references to brelse and bremfree, which don't actually exist. Modified: head/share/man/man9/vinvalbuf.9 Modified: head/share/man/man9/vinvalbuf.9 ============================================================================== --- head/share/man/man9/vinvalbuf.9 Thu Sep 20 07:04:08 2012 (r240737) +++ head/share/man/man9/vinvalbuf.9 Thu Sep 20 07:07:35 2012 (r240738) @@ -110,8 +110,6 @@ set in .Fa slpflag ) .El .Sh SEE ALSO -.Xr brelse 9 , -.Xr bremfree 9 , .Xr tsleep 9 , .Xr VOP_FSYNC 9 .Sh AUTHORS From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 08:30:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E81D7106566B; Thu, 20 Sep 2012 08:30:17 +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 D3BDA8FC1A; Thu, 20 Sep 2012 08:30:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K8UHdr077800; Thu, 20 Sep 2012 08:30:17 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K8UHJk077797; Thu, 20 Sep 2012 08:30:17 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201209200830.q8K8UHJk077797@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 20 Sep 2012 08:30: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: r240739 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 08:30:18 -0000 Author: gavin Date: Thu Sep 20 08:30:17 2012 New Revision: 240739 URL: http://svn.freebsd.org/changeset/base/240739 Log: The correct generic term for PCIS_STORAGE_NVM is "NVM" not "NVM Express". Submitted by: jimharris MFC after: 6 days Modified: head/sys/dev/pci/pci.c head/usr.sbin/pciconf/pciconf.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Sep 20 07:07:35 2012 (r240738) +++ head/sys/dev/pci/pci.c Thu Sep 20 08:30:17 2012 (r240739) @@ -3661,7 +3661,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Thu Sep 20 07:07:35 2012 (r240738) +++ head/usr.sbin/pciconf/pciconf.c Thu Sep 20 08:30:17 2012 (r240739) @@ -345,7 +345,7 @@ static struct {PCIC_STORAGE, PCIS_STORAGE_ATA_ADMA, "ATA (ADMA)"}, {PCIC_STORAGE, PCIS_STORAGE_SATA, "SATA"}, {PCIC_STORAGE, PCIS_STORAGE_SAS, "SAS"}, - {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM Express"}, + {PCIC_STORAGE, PCIS_STORAGE_NVM, "NVM"}, {PCIC_NETWORK, -1, "network"}, {PCIC_NETWORK, PCIS_NETWORK_ETHERNET, "ethernet"}, {PCIC_NETWORK, PCIS_NETWORK_TOKENRING, "token ring"}, From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 08:50:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA80B106566C; Thu, 20 Sep 2012 08:50:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C60E48FC0C; Thu, 20 Sep 2012 08:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K8odXO081348; Thu, 20 Sep 2012 08:50:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K8odbp081346; Thu, 20 Sep 2012 08:50:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201209200850.q8K8odbp081346@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 20 Sep 2012 08:50: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: r240740 - head/rescue/rescue X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 08:50:40 -0000 Author: bapt Date: Thu Sep 20 08:50:39 2012 New Revision: 240740 URL: http://svn.freebsd.org/changeset/base/240740 Log: unbreak build: rescue now needs -ljail if MK_ZFS is on Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Sep 20 08:30:17 2012 (r240739) +++ head/rescue/rescue/Makefile Thu Sep 20 08:50:39 2012 (r240740) @@ -123,7 +123,7 @@ CRUNCH_LIBS+= -lalias -lcam -lcurses -ld CRUNCH_LIBS+= -lipx .endif .if ${MK_ZFS} != "no" -CRUNCH_LIBS+= -lavl -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lavl -ljail -lzfs -lnvpair -lpthread -luutil -lumem .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 09:52:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B26F106564A; Thu, 20 Sep 2012 09:52:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA4A58FC12; Thu, 20 Sep 2012 09:52:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8K9qvXN092285; Thu, 20 Sep 2012 09:52:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8K9qvDX092283; Thu, 20 Sep 2012 09:52:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209200952.q8K9qvDX092283@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 20 Sep 2012 09:52: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: r240741 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 09:52:58 -0000 Author: kib Date: Thu Sep 20 09:52:57 2012 New Revision: 240741 URL: http://svn.freebsd.org/changeset/base/240741 Log: Plug the accounting leak for the wired pages when msync(MS_INVALIDATE) is performed on the vnode mapping which is wired in other address space. While there, explicitely assert that the page is unwired and zero the wire_count instead of substract. The condition is rechecked later in vm_page_free(_toq) already. Reported and tested by: zont Reviewed by: alc (previous version) MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Sep 20 08:50:39 2012 (r240740) +++ head/sys/vm/vm_object.c Thu Sep 20 09:52:57 2012 (r240741) @@ -1918,8 +1918,13 @@ again: if ((options & OBJPR_NOTMAPPED) == 0) { pmap_remove_all(p); /* Account for removal of wired mappings. */ - if (wirings != 0) - p->wire_count -= wirings; + if (wirings != 0) { + KASSERT(p->wire_count == wirings, + ("inconsistent wire count %d %d %p", + p->wire_count, wirings, p)); + p->wire_count = 0; + atomic_subtract_int(&cnt.v_wire_count, 1); + } } vm_page_free(p); vm_page_unlock(p); From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 10:05:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93DB1106566C; Thu, 20 Sep 2012 10:05:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658548FC1F; Thu, 20 Sep 2012 10:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KA5BiJ094416; Thu, 20 Sep 2012 10:05:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KA5BqZ094414; Thu, 20 Sep 2012 10:05:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209201005.q8KA5BqZ094414@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 20 Sep 2012 10:05: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: r240742 - 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: Thu, 20 Sep 2012 10:05:11 -0000 Author: glebius Date: Thu Sep 20 10:05:10 2012 New Revision: 240742 URL: http://svn.freebsd.org/changeset/base/240742 Log: Convert lagg(4) to use if_transmit instead of if_start. In collaboration with: thompsa, sbruno, fabient Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Thu Sep 20 09:52:57 2012 (r240741) +++ head/sys/net/if_lagg.c Thu Sep 20 10:05:10 2012 (r240742) @@ -110,7 +110,8 @@ static int lagg_ether_cmdmulti(struct la static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); -static void lagg_start(struct ifnet *); +static int lagg_transmit(struct ifnet *, struct mbuf *); +static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); static void lagg_media_status(struct ifnet *, struct ifmediareq *); static struct lagg_port *lagg_link_active(struct lagg_softc *, @@ -312,15 +313,12 @@ lagg_clone_create(struct if_clone *ifc, if_initname(ifp, ifc->ifc_name, unit); ifp->if_softc = sc; - ifp->if_start = lagg_start; + ifp->if_transmit = lagg_transmit; + ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - /* * Attach as an ordinary ethernet device, children will be attached * as special device IFT_IEEE8023ADLAG. @@ -1222,35 +1220,45 @@ lagg_setflags(struct lagg_port *lp, int return (0); } -static void -lagg_start(struct ifnet *ifp) +static int +lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - struct mbuf *m; - int error = 0; + int error, len, mcast; + + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; LAGG_RLOCK(sc); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - IF_DRAIN(&ifp->if_snd); LAGG_RUNLOCK(sc); - return; + m_freem(m); + ifp->if_oerrors++; + return (ENXIO); } - for (;; error = 0) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; + ETHER_BPF_MTAP(ifp, m); - ETHER_BPF_MTAP(ifp, m); - - error = (*sc->sc_start)(sc, m); - if (error == 0) - ifp->if_opackets++; - else - ifp->if_oerrors++; - } + error = (*sc->sc_start)(sc, m); LAGG_RUNLOCK(sc); + + if (error == 0) { + ifp->if_opackets++; + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else + ifp->if_oerrors++; + + return (error); +} + +/* + * The ifp->if_qflush entry point for lagg(4) is no-op. + */ +static void +lagg_qflush(struct ifnet *ifp __unused) +{ } static struct mbuf * From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 10:07:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28C7106566B; Thu, 20 Sep 2012 10:07:31 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2FEC8FC18; Thu, 20 Sep 2012 10:07:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KA7Vpd094893; Thu, 20 Sep 2012 10:07:31 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KA7VmI094889; Thu, 20 Sep 2012 10:07:31 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201209201007.q8KA7VmI094889@svn.freebsd.org> From: Kevin Lo Date: Thu, 20 Sep 2012 10:07: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: r240743 - in head/sys/dev: atkbdc isci/scil usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 10:07:32 -0000 Author: kevlo Date: Thu Sep 20 10:07:31 2012 New Revision: 240743 URL: http://svn.freebsd.org/changeset/base/240743 Log: Fix typo: s/protocl/protocol Modified: head/sys/dev/atkbdc/psm.c head/sys/dev/isci/scil/scic_sds_phy.c head/sys/dev/usb/serial/uftdi_reg.h Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/atkbdc/psm.c Thu Sep 20 10:07:31 2012 (r240743) @@ -2456,7 +2456,7 @@ proc_mmanplus(struct psm_softc *sc, pack { /* - * PS2++ protocl packet + * PS2++ protocol packet * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * @@ -3740,7 +3740,7 @@ enable_mmanplus(KBDC kbdc, struct psm_so return (FALSE); /* - * PS2++ protocl, packet type 0 + * PS2++ protocol, packet type 0 * * b7 b6 b5 b4 b3 b2 b1 b0 * byte 1: * 1 p3 p2 1 * * * Modified: head/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_phy.c Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/isci/scil/scic_sds_phy.c Thu Sep 20 10:07:31 2012 (r240743) @@ -2317,7 +2317,7 @@ void scic_sds_phy_stopped_state_enter( * entering the SCI_BASE_PHY_STATE_STARTING. * - This function sets the state handlers for the phy object base state * machine starting state. - * - The SCU hardware is requested to start OOB/SN on this protocl engine. + * - The SCU hardware is requested to start OOB/SN on this protocol engine. * - The phy starting substate machine is started. * - If the previous state was the ready state then the * SCIC_SDS_CONTROLLER is informed that the phy has gone link down. Modified: head/sys/dev/usb/serial/uftdi_reg.h ============================================================================== --- head/sys/dev/usb/serial/uftdi_reg.h Thu Sep 20 10:05:10 2012 (r240742) +++ head/sys/dev/usb/serial/uftdi_reg.h Thu Sep 20 10:07:31 2012 (r240743) @@ -176,7 +176,7 @@ enum { * BmRequestType: 0100 0000b * bRequest: FTDI_SIO_SET_FLOW_CTRL * wValue: Xoff/Xon - * wIndex: Protocol/Port - hIndex is protocl / lIndex is port + * wIndex: Protocol/Port - hIndex is protocol / lIndex is port * wLength: 0 * Data: None * From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 15:12:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DED1106566B; Thu, 20 Sep 2012 15:12:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EAD8FC0A; Thu, 20 Sep 2012 15:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KFC0ix041108; Thu, 20 Sep 2012 15:12:00 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KFC0Ib041105; Thu, 20 Sep 2012 15:12:00 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209201512.q8KFC0Ib041105@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 20 Sep 2012 15:12: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: r240750 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 15:12:00 -0000 Author: hselasky Date: Thu Sep 20 15:11:59 2012 New Revision: 240750 URL: http://svn.freebsd.org/changeset/base/240750 Log: Fix typo. Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Sep 20 15:05:57 2012 (r240749) +++ head/sys/dev/usb/usb_request.c Thu Sep 20 15:11:59 2012 (r240750) @@ -87,7 +87,7 @@ struct usb_ctrl_debug { int bus_index; /* target bus */ int dev_index; /* target address */ int ds_fail; /* fail data stage */ - int ss_fail; /* fail data stage */ + int ss_fail; /* fail status stage */ int ds_delay; /* data stage delay in ms */ int ss_delay; /* status stage delay in ms */ int bmRequestType_value; From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 18:56:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87B2106564A; Thu, 20 Sep 2012 18:56:27 +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 A2F518FC0C; Thu, 20 Sep 2012 18:56:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KIuRRE075063; Thu, 20 Sep 2012 18:56:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KIuRIY075059; Thu, 20 Sep 2012 18:56:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209201856.q8KIuRIY075059@svn.freebsd.org> From: Alexander Motin Date: Thu, 20 Sep 2012 18:56: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: r240762 - head/lib/libusbhid X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 18:56:27 -0000 Author: mav Date: Thu Sep 20 18:56:27 2012 New Revision: 240762 URL: http://svn.freebsd.org/changeset/base/240762 Log: Restore handling of the third argument (id) of hid_start_parse(), same as it is done in NetBSD/OpenBSD, and as it was here before r205728. I personally think this API or its implementation is incorrect, as it is not correct to filter collections based on report ID, as they are orthogonal in general case, but I see no harm from supporting this feature. PR: usb/171810 Submitted by: Vitaly Magerya MFC after: 1 month Modified: head/lib/libusbhid/descr.c head/lib/libusbhid/parse.c head/lib/libusbhid/usbhid.3 Modified: head/lib/libusbhid/descr.c ============================================================================== --- head/lib/libusbhid/descr.c Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/descr.c Thu Sep 20 18:56:27 2012 (r240762) @@ -68,7 +68,7 @@ hid_get_report_id(int fd) if ((rep = hid_get_report_desc(fd)) == NULL) goto use_ioctl; kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature; - for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) { + for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) { /* Return the first report ID we met. */ if (h.report_ID != 0) { temp = h.report_ID; Modified: head/lib/libusbhid/parse.c ============================================================================== --- head/lib/libusbhid/parse.c Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/parse.c Thu Sep 20 18:56:27 2012 (r240762) @@ -70,6 +70,7 @@ struct hid_data { uint8_t iusage; /* current "usages_min/max" index */ uint8_t ousage; /* current "usages_min/max" offset */ uint8_t susage; /* usage set flags */ + int32_t reportid; /* requested report ID */ }; /*------------------------------------------------------------------------* @@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc * hid_start_parse *------------------------------------------------------------------------*/ hid_data_t -hid_start_parse(report_desc_t d, int kindset, int id __unused) +hid_start_parse(report_desc_t d, int kindset, int id) { struct hid_data *s; @@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin s->start = s->p = d->data; s->end = d->data + d->size; s->kindset = kindset; + s->reportid = id; return (s); } @@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u /*------------------------------------------------------------------------* * hid_get_item *------------------------------------------------------------------------*/ -int -hid_get_item(hid_data_t s, hid_item_t *h) +static int +hid_get_item_raw(hid_data_t s, hid_item_t *h) { hid_item_t *c; unsigned int bTag, bType, bSize; @@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h } int +hid_get_item(hid_data_t s, hid_item_t *h) +{ + int r; + + for (;;) { + r = hid_get_item_raw(s, h); + if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid) + break; + } + return (r); +} + +int hid_report_size(report_desc_t r, enum hid_kind k, int id) { struct hid_data *d; @@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if ((h.report_ID == id || id < 0) && h.kind == k) { + if (h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; Modified: head/lib/libusbhid/usbhid.3 ============================================================================== --- head/lib/libusbhid/usbhid.3 Thu Sep 20 18:42:00 2012 (r240761) +++ head/lib/libusbhid/usbhid.3 Thu Sep 20 18:56:27 2012 (r240762) @@ -144,16 +144,15 @@ fails it will return .Ss Descriptor Parsing Functions To parse the report descriptor the .Fn hid_start_parse -function should be called with a report descriptor and a set that -describes which items that are interesting. +function should be called with a report descriptor, a set that +describes which items that are interesting, and the desired report +ID (or -1 to obtain items of all report IDs). The set is obtained by OR-ing together values .Fa "(1 << k)" where .Fa k is an item of type .Vt hid_kind_t . -The report ID (if present) is given by -.Fa id . The function returns .Dv NULL if the initialization fails, otherwise an opaque value to be used From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 21:16:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B14C5106566B; Thu, 20 Sep 2012 21:16:41 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADA98FC0C; Thu, 20 Sep 2012 21:16:41 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id EFB3F806; Thu, 20 Sep 2012 23:15:44 +0200 (CEST) Date: Thu, 20 Sep 2012 23:17:01 +0200 From: Pawel Jakub Dawidek To: Baptiste Daroussin Message-ID: <20120920211701.GD1407@garage.freebsd.pl> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IDYEmSnFhs3mNXr+" Content-Disposition: inline In-Reply-To: <201209191628.q8JGSckQ025683@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/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: Thu, 20 Sep 2012 21:16:41 -0000 --IDYEmSnFhs3mNXr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Wed Sep 19 16:28:38 2012 > New Revision: 240698 > URL: http://svn.freebsd.org/changeset/base/240698 >=20 > Log: > Update usage to show the possiblity to use jail name > =20 > Reported by: bdrewery > MFC after: 1 month >=20 > Modified: > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c >=20 > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:23 = 2012 (r240697) > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:38 = 2012 (r240698) > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > return (gettext("\tupgrade [-v]\n" > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > case HELP_JAIL: > - return (gettext("\tjail \n")); > + return (gettext("\tjail \n")); Please keep the style consistent. As you can see two lines above there are spaces around |. > case HELP_UNJAIL: > - return (gettext("\tunjail \n")); > + return (gettext("\tunjail \n")); > case HELP_LIST: > return (gettext("\tlist [-rH][-d max] " > "[-o property[,...]] [-t type[,...]] [-s property] ...\n" --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --IDYEmSnFhs3mNXr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBbh80ACgkQForvXbEpPzQZIwCff7+muhxlJ/w+VtwsZpo6k7x1 QzwAnRsiZpGW7Lsf2Zy2V+DVVGmTVGP1 =w65W -----END PGP SIGNATURE----- --IDYEmSnFhs3mNXr+-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 21:38:46 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5430A1065670; Thu, 20 Sep 2012 21:38:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFC58FC12; Thu, 20 Sep 2012 21:38:46 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q8KLckKN040307; Thu, 20 Sep 2012 21:38:46 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q8KLcjxH040306; Thu, 20 Sep 2012 21:38:45 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Thu, 20 Sep 2012 23:38:43 +0200 From: Baptiste Daroussin To: Pawel Jakub Dawidek Message-ID: <20120920213843.GQ26107@ithaqua.etoilebsd.net> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> <20120920211701.GD1407@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y9o+fgG4MNl0mnzl" Content-Disposition: inline In-Reply-To: <20120920211701.GD1407@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/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: Thu, 20 Sep 2012 21:38:46 -0000 --Y9o+fgG4MNl0mnzl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 20, 2012 at 11:17:01PM +0200, Pawel Jakub Dawidek wrote: > On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > > Author: bapt > > Date: Wed Sep 19 16:28:38 2012 > > New Revision: 240698 > > URL: http://svn.freebsd.org/changeset/base/240698 > >=20 > > Log: > > Update usage to show the possiblity to use jail name > > =20 > > Reported by: bdrewery > > MFC after: 1 month > >=20 > > Modified: > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > >=20 > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21:2= 3 2012 (r240697) > > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28:3= 8 2012 (r240698) > > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > > return (gettext("\tupgrade [-v]\n" > > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > > case HELP_JAIL: > > - return (gettext("\tjail \n")); > > + return (gettext("\tjail \n")); >=20 > Please keep the style consistent. As you can see two lines above there > are spaces around |. >=20 Sure but both syntax are present in the usage: = in fact the only one with space around | is the line above you are showing, al= l the rest of the usage is without space, That is why I did it without spaces. If you tell me it is better with spaces, I'll add space. regards, Bapt --Y9o+fgG4MNl0mnzl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBbjOMACgkQ8kTtMUmk6EyUTwCeI7gGybplsOsDYFs6a51Ce38X cdAAnAkoiZqCF/NBYJ+pnuBCbspxHmEP =uzqg -----END PGP SIGNATURE----- --Y9o+fgG4MNl0mnzl-- From owner-svn-src-head@FreeBSD.ORG Thu Sep 20 23:44:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2BA0106566C; Thu, 20 Sep 2012 23:44:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D97AC8FC0A; Thu, 20 Sep 2012 23:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8KNiEt0015444; Thu, 20 Sep 2012 23:44:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8KNiEmn015410; Thu, 20 Sep 2012 23:44:14 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209202344.q8KNiEmn015410@svn.freebsd.org> From: Devin Teske Date: Thu, 20 Sep 2012 23:44: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: r240768 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share password/share security share startup startup/share timezone usermgmt usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 20 Sep 2012 23:44:15 -0000 Author: dteske Date: Thu Sep 20 23:44:13 2012 New Revision: 240768 URL: http://svn.freebsd.org/changeset/base/240768 Log: Change all invocations of dialog(1) to no-longer require temporary files. This allows bsdconfig to -- like bsdinstall -- operate from read-only media. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/password/share/password.subr head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcedit.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/share/group_input.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/bsdconfig Thu Sep 20 23:44:13 2012 (r240768) @@ -177,7 +177,8 @@ dialog_menu_main() \"\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear \ --title \"\$title\" \ --backtitle \"\$btitle\" \ @@ -185,7 +186,11 @@ dialog_menu_main() --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_exit_bsdconfig\" \ --menu \"\$prompt\" $size $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/console Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/font Thu Sep 20 23:44:13 2012 (r240768) @@ -76,7 +76,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,7 +85,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/keymap Thu Sep 20 23:44:13 2012 (r240768) @@ -116,7 +116,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -124,7 +125,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/repeat Thu Sep 20 23:44:13 2012 (r240768) @@ -66,7 +66,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -74,7 +75,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/saver Thu Sep 20 23:44:13 2012 (r240768) @@ -76,7 +76,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -84,7 +85,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN @@ -174,7 +179,7 @@ while :; do "$prompt" \ "$blanktime" \ "$hline" ) - $DIALOG \ + dialog_inputbox=$( $DIALOG \ --title "$title" \ --backtitle "$btitle" \ --hline "$hline" \ @@ -182,8 +187,10 @@ while :; do --cancel-label "$msg_cancel" \ --inputbox "$prompt" $size \ "$blanktime" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" blanktime=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] && f_sysrc_set blanktime "$blanktime" Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/screenmap Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/console/ttys Thu Sep 20 23:44:13 2012 (r240768) @@ -82,7 +82,8 @@ dialog_menu_main() \"\$hline\" \ $TTY_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -90,7 +91,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $TTY_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # ttys_set_type $consterm Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/flags Thu Sep 20 23:44:13 2012 (r240768) @@ -90,7 +90,7 @@ size=$( f_dialog_inputbox_size \ "$prompt" \ "$flags" \ "$hline" ) -eval $DIALOG \ +dialog_inputbox=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -98,8 +98,10 @@ eval $DIALOG \ --cancel-label \"\$msg_cancel\" \ --inputbox \"\$prompt\" $size \ \"\$flags\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD +) retval=$? +setvar MENU_INPUTBOX_$$ "$dialog_inputbox" flags=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || f_die Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/mouse Thu Sep 20 23:44:13 2012 (r240768) @@ -67,7 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -75,7 +76,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/port Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/mouse/type Thu Sep 20 23:44:13 2012 (r240768) @@ -72,7 +72,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -80,7 +81,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/networking Thu Sep 20 23:44:13 2012 (r240768) @@ -65,14 +65,19 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ --ok-label \"\$msg_ok\" \ --cancel-label \"\$msg_cancel\" \ --menu \"\" $size $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -265,7 +265,8 @@ f_dialog_menu_netdev() \"\$prompt\" \ \"\$hline\" \ $interfaces ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -273,7 +274,11 @@ f_dialog_menu_netdev() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $interfaces \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # f_dialog_menu_netdev_edit $interface $ipaddr $netmask $options $dhcp @@ -330,7 +335,8 @@ f_dialog_menu_netdev_edit() \"\$prompt\" \ \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -338,9 +344,11 @@ f_dialog_menu_netdev_edit() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" local tag="$( f_dialog_menutag )" # Return if "Cancel" was chosen (-1) or ESC was pressed (255) Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -146,7 +146,8 @@ f_dialog_input_hostname() "$msg" \ "$hostname" \ "$hline" ) - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -154,9 +155,11 @@ f_dialog_input_hostname() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$hostname\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" hostname=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || return $retval Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -167,7 +167,8 @@ f_dialog_input_ipaddr() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -175,9 +176,11 @@ f_dialog_input_ipaddr() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$_ipaddr\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) # Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -123,7 +123,8 @@ f_dialog_input_options() local msg="$( printf "$msg_please_enter_mediaopts" "$interface" )" local hline="$hline_alnum_punc_tab_enter" - $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --hline "$hline" \ @@ -131,9 +132,11 @@ f_dialog_input_options() --cancel-label "$msg_cancel" \ --inputbox "$msg" 9 70 \ "$options" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" local _options="$( f_dialog_inputstr )" [ $retval -eq $SUCCESS ] && options="$_options" @@ -205,7 +208,8 @@ f_dialog_menu_media_options() local hline="$hline_arrows_tab_enter" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -213,9 +217,11 @@ f_dialog_menu_media_options() --cancel-label \"\$msg_cancel\" \ --menu \"\$msg\" 21 60 12 \ $supported_media \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" if [ $retval -eq $SUCCESS ]; then local tag="$( f_dialog_menutag )" options=$( eval f_dialog_menutag2item \"\$tag\" \ Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -177,7 +177,8 @@ f_dialog_input_netmask() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -185,9 +186,11 @@ f_dialog_input_netmask() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$_netmask\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) # Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -342,7 +342,8 @@ f_dialog_input_nameserver() # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -350,9 +351,11 @@ f_dialog_input_nameserver() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$ns\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" new_ns=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || return $retval @@ -476,7 +479,8 @@ f_dialog_menu_nameservers() \"\$prompt\" \ \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -484,9 +488,11 @@ f_dialog_menu_nameservers() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" local tag="$( f_dialog_menutag )" ns="" # Return if "Cancel" was chosen (-1) or ESC was pressed (255) Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -110,7 +110,8 @@ f_dialog_input_defaultrouter() # Loop until the user provides taint-free input. # while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -118,9 +119,11 @@ f_dialog_input_defaultrouter() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$msg\" $size \ \"\$defaultrouter\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) local retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" defaultrouter=$( f_dialog_inputstr ) [ "$defaultrouter" ] || return $SUCCESS Modified: head/usr.sbin/bsdconfig/password/share/password.subr ============================================================================== --- head/usr.sbin/bsdconfig/password/share/password.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/password/share/password.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -68,7 +68,8 @@ f_dialog_input_password() # local retval _password1 _password2 while :; do - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,15 +77,17 @@ f_dialog_input_password() --cancel-label \"\$msg_cancel\" \ --insecure \ --passwordbox \"\$msg\" $size \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _password1=$( f_dialog_inputstr ) # Return if user has either pressed ESC or chosen Cancel/No [ $retval -eq $SUCCESS ] || return $retval - eval $DIALOG \ + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -92,9 +95,11 @@ f_dialog_input_password() --cancel-label \"\$msg_cancel\" \ --insecure \ --passwordbox \"\$rmsg\" $rsize \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _password2=$( f_dialog_inputstr ) # Return if user has either pressed ESC or chosen Cancel/No Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Thu Sep 20 23:44:13 2012 (r240768) @@ -67,7 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -75,7 +76,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/security/security Thu Sep 20 23:44:13 2012 (r240768) @@ -86,7 +86,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -94,7 +95,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/share/dialog.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -38,9 +38,11 @@ f_include_lang $BSDCFG_LIBE/include/mess ############################################################ CONFIGURATION # -# Default directory to store dialog(1) temporary files +# Default file descriptor to link to stdout for dialog(1) passthru allowing +# execution of dialog from within a sub-shell (so-long as its standard output +# is explicitly redirected to this file descriptor). # -: ${DIALOG_TMPDIR:="/tmp"} +: ${DIALOG_TERMINAL_PASSTHRU_FD:=3} ############################################################ GLOBALS @@ -1108,12 +1110,8 @@ f_dialog_noyes() # f_dialog_inputstr() { - local tmpfile="$DIALOG_TMPDIR/dialog.inputbox.$$" - - [ -f "$tmpfile" ] || return $FAILURE - # Skip warnings and trim leading/trailing whitespace from user input - awk ' + eval echo \"\$DIALOG_INPUTBOX_$$\" | awk ' BEGIN { found = 0 } { if ( ! found ) @@ -1126,9 +1124,8 @@ f_dialog_inputstr() sub(/[[:space:]]*$/, "") print } - ' "$tmpfile" 2> /dev/null - f_quietly rm -f "$tmpfile" - + ' + setvar DIALOG_INPUTBOX_$$ "" # scrub memory in case data was sensitive return $SUCCESS } @@ -1141,11 +1138,8 @@ f_dialog_inputstr() # f_dialog_menutag() { - local tmpfile="$DIALOG_TMPDIR/dialog.menu.$$" - - [ -f "$tmpfile" ] || return $FAILURE - - awk ' + # Skip warnings + eval echo \"\$DIALOG_MENU_$$\" | awk ' BEGIN { found = 0 } { if ( found ) # ... just spew @@ -1158,9 +1152,8 @@ f_dialog_menutag() found = 1 print } - ' "$tmpfile" 2> /dev/null - f_quietly rm -f "$tmpfile" - + ' + setvar DIALOG_MENU_$$ "" # scrub memory in case data was sensitive return $SUCCESS } @@ -1320,6 +1313,11 @@ f_dialog_init() DIALOG_SELF_INITIALIZE= # + # Clone terminal stdout so we can redirect to it from within sub-shells + # + eval exec $DIALOG_TERMINAL_PASSTHRU_FD\>\&1 + + # # Process stored command-line arguments # SECURE=$( set -- "$ARGV" @@ -1422,22 +1420,4 @@ f_dialog_init() fi } -############################################################ CLEAN-UP FUNCTIONS - -# f_clean_up -# -# Clean-up routines (run when script exits or is killed). -# -f_clean_up() -{ - f_quietly rm -f "$DIALOG_TMPDIR"/dialog.*.$$ -} - -############################################################ MAIN - -# -# Trap signals so we can recover gracefully -# -trap 'f_clean_up' EXIT - fi # ! $_DIALOG_SUBR Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -119,7 +119,8 @@ f_become_root_via_sudo() [ $retval -eq 255 ] && f_die $retval "$password" else - $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( $DIALOG \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --hline "$hline" \ @@ -127,8 +128,10 @@ f_become_root_via_sudo() --cancel-label "$msg_cancel" \ --insecure \ --passwordbox "$msg" $size \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" password=$( f_dialog_inputstr ) fi Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/misc Thu Sep 20 23:44:13 2012 (r240768) @@ -230,7 +230,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -238,7 +239,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # dialog_input_value [ $prompt [ $init ] ] @@ -260,7 +265,8 @@ dialog_input_value() "$_input" \ "$hline" ) - eval $DIALOG \ + local dialog_inputbox + dialog_inputbox=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -268,9 +274,11 @@ dialog_input_value() --cancel-label \"\$msg_cancel\" \ --inputbox \"\$prompt\" $size \ \"\$_input\" \ - 2> $DIALOG_TMPDIR/dialog.inputbox.$$ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) retval=$? + setvar DIALOG_INPUTBOX_$$ "$dialog_inputbox" _input=$( f_dialog_inputstr ) f_dialog_title_restore Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcadd Thu Sep 20 23:44:13 2012 (r240768) @@ -72,7 +72,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -80,7 +81,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcconf Thu Sep 20 23:44:13 2012 (r240768) @@ -168,7 +168,8 @@ dialog_menu_main() \"\$hline\" \ $RCCONF_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -179,7 +180,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCCONF_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcdelete Thu Sep 20 23:44:13 2012 (r240768) @@ -175,7 +175,8 @@ dialog_menu_main() \"\$hline\" \ $RCCONF_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -186,7 +187,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCCONF_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } # dialog_menu_delete $var1 [$var2 ...] @@ -240,7 +245,8 @@ dialog_menu_delete() local defaultno="defaultno" [ "$USE_XDIALOG" ] && defaultno="default-no" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -249,7 +255,11 @@ dialog_menu_delete() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/rcvar Thu Sep 20 23:44:13 2012 (r240768) @@ -132,7 +132,8 @@ dialog_menu_main() \"\$hline\" \ $RCVAR_MENU_LIST ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -141,7 +142,11 @@ dialog_menu_main() ${SHOW_DESC:+--item-help} \ --menu \"\$prompt\" $size \ $RCVAR_MENU_LIST \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Thu Sep 20 23:00:01 2012 (r240767) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Thu Sep 20 23:44:13 2012 (r240768) @@ -282,7 +282,8 @@ f_dialog_input_view_details() f_dialog_title "$msg_choose_view_details" - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -290,9 +291,11 @@ f_dialog_input_view_details() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 01:36:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F9E106564A; Fri, 21 Sep 2012 01:36:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F139E8FC0A; Fri, 21 Sep 2012 01:36:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8L1aKHU032014; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8L1aKiF031991; Fri, 21 Sep 2012 01:36:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209210136.q8L1aKiF031991@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Sep 2012 01:36: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: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 01:36:21 -0000 Author: dteske Date: Fri Sep 21 01:36:20 2012 New Revision: 240770 URL: http://svn.freebsd.org/changeset/base/240770 Log: Replace redirections to /dev/null with "close file-descriptor" syntax (>&-). Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) @@ -73,7 +73,7 @@ usage() # Determine the maximum width of terminal/console # local max_size max_width - max_size=$( stty size 2> /dev/null ) + max_size=$( stty size 2>&- ) : ${max_size:="24 80"} max_width="${max_size#*[$IFS]}" f_dprintf "max_width=[$max_width]" @@ -242,8 +242,8 @@ if [ "$1" ]; then # lang="${LANG:-$LC_ALL}" if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ - 2> /dev/null | tail -1 ) + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang 2>&- | + tail -1 ) # Fall-back to non-i18n sources if nothing was found [ "$sel" ] || Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 01:36:20 2012 (r240770) @@ -117,8 +117,8 @@ ttys_set_type() # with 0600 permissions -- change the permissions and ownership to # match ttys(5) before we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2>&- )" + local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 01:36:20 2012 (r240770) @@ -86,7 +86,7 @@ flags=$( f_sysrc_get moused_flags ) # f_dialog_info "$msg_trying_to_start_the_mouse_daemon" [ -r "$MOUSED_PIDFILE" ] && - f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )" + f_quietly kill "$( cat "$MOUSED_PIDFILE" 2>&- )" f_quietly vidcontrol -m on f_quietly moused -t "$type" -p "$port" $flags Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 01:36:20 2012 (r240770) @@ -112,7 +112,7 @@ while :; do # configuration # dhcp= - eval "$( exec 2> /dev/null + eval "$( exec 2>&- set -- $_ifconfig while [ $# -gt 0 ]; do case "$1" in Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_device_desc() devname="${device%%$d*}" devunit="${device#$devname}" devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && + sysctl -n "dev.$devname.$devunit.%desc" 2>&- && return $SUCCESS fi Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_inet() { local interface="$1" - ifconfig "$interface" 2> /dev/null | awk \ + ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -83,7 +83,7 @@ f_ifconfig_options() f_ifconfig_media() { local interface="$1" - ifconfig -m "$interface" 2> /dev/null | awk \ + ifconfig -m "$interface" 2>&- | awk \ ' BEGIN { media_found = 0 } { Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_netmask() { local interface="$1" octets - octets=$( ifconfig "$interface" 2> /dev/null | awk \ + octets=$( ifconfig "$interface" 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_resolv_conf_domain() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } ( tolower($1) == "domain" ) \ @@ -84,7 +84,7 @@ f_resolv_conf_domain() # f_resolv_conf_search() { - tail -r "$RESOLV_CONF" 2> /dev/null | awk \ + tail -r "$RESOLV_CONF" 2>&- | awk \ ' BEGIN { found = 0 } { @@ -118,7 +118,7 @@ f_resolv_conf_nameservers() } END { exit ! found } ' \ - "$RESOLV_CONF" 2> /dev/null + "$RESOLV_CONF" 2>&- } # f_dialog_resolv_conf_update $hostname @@ -225,8 +225,8 @@ f_dialog_resolv_conf_update() # permissions and ownership to match resolv.conf(5) before # we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )" - local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )" + local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- )" + local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" @@ -246,7 +246,7 @@ f_dialog_resolv_conf_update() # local domain="${hostname#*.}" new_contents [ "$domain" = "$hostname" ] && domain= - new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null ) + new_contents=$( tail -r "$RESOLV_CONF" 2>&- ) new_contents=$( echo "$new_contents" | awk \ -v domain="$domain" \ -v search_all="${RESOLVER_SEARCH_DOMAINS_ALL:-1}" \ @@ -397,8 +397,8 @@ f_dialog_input_nameserver() # Quietly fixup permissions and ownership # local mode owner - mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- ) + owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_route_get_default() { - route -n get default 2> /dev/null | awk \ + route -n get default 2>&- | awk \ ' BEGIN { found = 0 } ( $1 == "gateway:" ) \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -72,7 +72,7 @@ f_err() # f_quietly() { - "$@" > /dev/null 2>&1 + "$@" >&- 2>&- } # f_have $anything ... Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -1321,7 +1321,7 @@ f_dialog_init() # Process stored command-line arguments # SECURE=$( set -- "$ARGV" - while getopts S flag > /dev/null; do + while getopts S flag >&-; do case "$flag" in S) echo 1;; \?) continue;; @@ -1329,7 +1329,7 @@ f_dialog_init() done ) USE_XDIALOG=$( set -- "$ARGV" - while getopts SX flag > /dev/null; do + while getopts SX flag >&-; do case "$flag" in S|X) echo 1;; \?) continue;; @@ -1372,7 +1372,7 @@ f_dialog_init() eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -85,7 +85,7 @@ f_become_root_via_sudo() # # Check sudo(8) access before prompting for password. # - :| sudo -S -v 2> /dev/null + :| sudo -S -v 2>&- if [ $? -ne $SUCCESS ]; then # # sudo(8) access denied. Prompt for their password. @@ -112,7 +112,7 @@ f_become_root_via_sudo() --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --password --inputbox "$msg" $size \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -141,7 +141,7 @@ f_become_root_via_sudo() # # Validate sudo(8) credentials # - sudo -S -v 2> /dev/null <<-EOF + sudo -S -v 2>&- <<-EOF $password EOF retval=$? @@ -186,7 +186,7 @@ f_become_root_via_sudo() displaynum="${DISPLAY#*:}" xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \ $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - > /dev/null 2>&1' + ~root/.Xauthority merge - >&- 2>&-' fi # Re-execute ourselves with sudo(8) @@ -254,7 +254,7 @@ f_authenticate_some_user() $height $width \ "$field_username" "" \ "$field_password" "" \ - 2>&1 > /dev/null ) + 2>&1 >&- ) retval=$? # Catch X11-related errors @@ -302,7 +302,7 @@ f_authenticate_some_user() su -m "$user" <<-EOF sh < /dev/null <&- < /dev/null 2>&1 + ( : $((0/$arg)) ) >&- 2>&- } fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -134,7 +134,7 @@ f_sysrc_get() # f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -153,7 +153,7 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 + ( : ${RC_CONFS?} ) >&- 2>&- if [ $? -eq ${SUCCESS:-0} ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 @@ -162,7 +162,7 @@ f_sysrc_get() unset SUCCESS # no longer needed - source_rc_confs > /dev/null 2>&1 + source_rc_confs >&- 2>&- # # If the query was for `rc_conf_files' AND after calling @@ -190,7 +190,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -221,7 +221,7 @@ f_sysrc_get_default() # f_clean_env --except RC_DEFAULTS - . "$RC_DEFAULTS" > /dev/null 2>&1 + . "$RC_DEFAULTS" >&- 2>&- unset RC_DEFAULTS # no longer needed @@ -232,7 +232,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval echo '"${'"$1"'}"' 2>&- ) } @@ -477,7 +477,7 @@ f_sysrc_set() # permissions from the temporary file). # local mode - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" # @@ -486,14 +486,14 @@ f_sysrc_set() # permissions (so we throw stderr into the bit-bucket). # local owner - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chown "${owner:-root:wheel}" "$tmpfile" # # Operate on the matching file, replacing only the last occurrence. # local new_contents retval - new_contents=$( tail -r $file 2> /dev/null ) + new_contents=$( tail -r $file 2>&- ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? @@ -572,8 +572,8 @@ f_sysrc_delete() # permissions) to instead match the destination file. # local mode owner - mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) - owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) + mode=$( stat -f '%#Lp' "$file" 2>&- ) + owner=$( stat -f '%u:%g' "$file" 2>&- ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 01:36:20 2012 (r240770) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -110,8 +110,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -112,8 +112,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if ( eval : \${_${var}_delete?} ) >&- 2>&-; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 01:36:20 2012 (r240770) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 ############################################################ FUNCTIONS @@ -82,8 +82,8 @@ dialog_menu_main() fi RCVAR_MENU_LIST="$RCVAR_MENU_LIST $( - . "$RC_DEFAULTS" > /dev/null - source_rc_confs > /dev/null + . "$RC_DEFAULTS" >&- + source_rc_confs >&- for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do eval export $rcvar done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/b f_startup_rcconf_list() { ( # Operate within a sub-shell to protect the parent environment - . "$RC_DEFAULTS" > /dev/null + . "$RC_DEFAULTS" >&- f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files - source_rc_confs > /dev/null + source_rc_confs >&- export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )" export RC_DEFAULTS set | awk -F= " Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if : 2>&- > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 00:36:35 2012 (r240769) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 01:36:20 2012 (r240770) @@ -627,7 +627,7 @@ f_dialog_input_change() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -654,7 +654,7 @@ f_dialog_input_change() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -682,7 +682,7 @@ f_dialog_input_change() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;; @@ -852,7 +852,7 @@ f_dialog_input_expire() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2> /dev/null ) + "+%d %m %Y" 2>&- ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -879,7 +879,7 @@ f_dialog_input_expire() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) + -f %s -- "$_input" "+%H %M %S" 2>&- ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -906,7 +906,7 @@ f_dialog_input_expire() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2> /dev/null ) + +%s 2>&- ) f_dprintf "_input=[$_input]" break ;; From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 05:30:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D2F11065670; Fri, 21 Sep 2012 05:30:24 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA148FC12; Fri, 21 Sep 2012 05:30:24 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 85F808CA; Fri, 21 Sep 2012 07:29:27 +0200 (CEST) Date: Fri, 21 Sep 2012 07:30:43 +0200 From: Pawel Jakub Dawidek To: Baptiste Daroussin Message-ID: <20120921053043.GE1407@garage.freebsd.pl> References: <201209191628.q8JGSckQ025683@svn.freebsd.org> <20120920211701.GD1407@garage.freebsd.pl> <20120920213843.GQ26107@ithaqua.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XuV1QlJbYrcVoo+x" Content-Disposition: inline In-Reply-To: <20120920213843.GQ26107@ithaqua.etoilebsd.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r240698 - head/cddl/contrib/opensolaris/cmd/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: Fri, 21 Sep 2012 05:30:24 -0000 --XuV1QlJbYrcVoo+x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 20, 2012 at 11:38:43PM +0200, Baptiste Daroussin wrote: > On Thu, Sep 20, 2012 at 11:17:01PM +0200, Pawel Jakub Dawidek wrote: > > On Wed, Sep 19, 2012 at 04:28:38PM +0000, Baptiste Daroussin wrote: > > > Author: bapt > > > Date: Wed Sep 19 16:28:38 2012 > > > New Revision: 240698 > > > URL: http://svn.freebsd.org/changeset/base/240698 > > >=20 > > > Log: > > > Update usage to show the possiblity to use jail name > > > =20 > > > Reported by: bdrewery > > > MFC after: 1 month > > >=20 > > > Modified: > > > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > >=20 > > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:21= :23 2012 (r240697) > > > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Sep 19 16:28= :38 2012 (r240698) > > > @@ -240,9 +240,9 @@ get_usage(zfs_help_t idx) > > > return (gettext("\tupgrade [-v]\n" > > > "\tupgrade [-r] [-V version] <-a | filesystem ...>\n")); > > > case HELP_JAIL: > > > - return (gettext("\tjail \n")); > > > + return (gettext("\tjail \n")); > >=20 > > Please keep the style consistent. As you can see two lines above there > > are spaces around |. > >=20 >=20 > Sure but both syntax are present in the usage: in > fact the only one with space around | is the line above you are showing, = all the > rest of the usage is without space, That is why I did it without spaces. >=20 > If you tell me it is better with spaces, I'll add space. It is probably better to leave it as-is then, I only looked at the diff context. Sorry for the noise. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --XuV1QlJbYrcVoo+x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBb+4IACgkQForvXbEpPzQEMgCg1tY+3lZ1bJW3Pkad7xY8T6y8 qmEAoPPfoDOkRKwX+nKLdaTGPeUc0Tty =4aL0 -----END PGP SIGNATURE----- --XuV1QlJbYrcVoo+x-- From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 10:31:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B91A106566B; Fri, 21 Sep 2012 10:31:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66CDC8FC1C; Fri, 21 Sep 2012 10:31:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LAVKJ8014605; Fri, 21 Sep 2012 10:31:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LAVKVC014601; Fri, 21 Sep 2012 10:31:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201209211031.q8LAVKVC014601@svn.freebsd.org> From: Dimitry Andric Date: Fri, 21 Sep 2012 10:31: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: r240773 - 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: Fri, 21 Sep 2012 10:31:20 -0000 Author: dim Date: Fri Sep 21 10:31:19 2012 New Revision: 240773 URL: http://svn.freebsd.org/changeset/base/240773 Log: After r205013, amd64 and i386 CPU family and model IDs were printed out in hexadecimal, but without any 0x prefix, which can be very misleading. MFC after: 3 days Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Fri Sep 21 03:09:23 2012 (r240772) +++ head/sys/amd64/amd64/identcpu.c Fri Sep 21 10:31:19 2012 (r240773) @@ -213,8 +213,8 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { - printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); - printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Family = 0x%x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = 0x%x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); /* Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Fri Sep 21 03:09:23 2012 (r240772) +++ head/sys/i386/i386/identcpu.c Fri Sep 21 10:31:19 2012 (r240773) @@ -688,8 +688,8 @@ printcpuinfo(void) cpu_vendor_id == CPU_VENDOR_NSC || (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500))) { - printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); - printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Family = 0x%x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = 0x%x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) printf("\n DIR=0x%04x", cyrix_did); From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 11:36:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 503E01065677; Fri, 21 Sep 2012 11:36:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id D953C8FC26; Fri, 21 Sep 2012 11:36:58 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id D8B7D12013D; Fri, 21 Sep 2012 13:36:54 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id B53E72847B; Fri, 21 Sep 2012 13:36:54 +0200 (CEST) Date: Fri, 21 Sep 2012 13:36:54 +0200 From: Jilles Tjoelker To: Devin Teske Message-ID: <20120921113654.GA7865@stack.nl> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201209210136.q8L1aKiF031991@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 11:36:59 -0000 On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: > Author: dteske > Date: Fri Sep 21 01:36:20 2012 > New Revision: 240770 > URL: http://svn.freebsd.org/changeset/base/240770 > Log: > Replace redirections to /dev/null with "close file-descriptor" syntax (>&-). > Reviewed by: adrian (co-mentor) > Approved by: adrian (co-mentor) > [snip] > Modified: head/usr.sbin/bsdconfig/bsdconfig > ============================================================================== > --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) > +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) > @@ -73,7 +73,7 @@ usage() > # Determine the maximum width of terminal/console > # > local max_size max_width > - max_size=$( stty size 2> /dev/null ) > + max_size=$( stty size 2>&- ) > : ${max_size:="24 80"} > max_width="${max_size#*[$IFS]}" > f_dprintf "max_width=[$max_width]" > [snip] This change is risky because it may cause error messages to be written to unexpected files. The first file the utility opens will be fd 2, and if something decides to write an error message to fd 2 it will try to write to that file. For this reason, the kernel will automatically open /dev/null if you execute suid/sgid binaries with fd 0, 1 and/or 2 closed. Particularly with fd 1 (>&-) there is another danger in that the output may fail with [EBADF] rather than being silently discarded. This may cause unexpected failures. If the reason is that there may be no /dev/null, then you will have to change the environment such that there will be a /dev/null. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 12:19:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA59F106566C; Fri, 21 Sep 2012 12:19:37 +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 CB5508FC14; Fri, 21 Sep 2012 12:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LCJbVc031960; Fri, 21 Sep 2012 12:19:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LCJb3o031958; Fri, 21 Sep 2012 12:19:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209211219.q8LCJb3o031958@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Sep 2012 12:19: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: r240774 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 12:19:38 -0000 Author: mav Date: Fri Sep 21 12:19:36 2012 New Revision: 240774 URL: http://svn.freebsd.org/changeset/base/240774 Log: Don't use global nfs_root_node variable as per-file storage. There are fields that should be file-specific. Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Fri Sep 21 10:31:19 2012 (r240773) +++ head/lib/libstand/nfs.c Fri Sep 21 12:19:36 2012 (r240774) @@ -486,6 +486,9 @@ nfs_open(const char *upath, struct open_ desc->destip = rootip; if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -498,14 +501,15 @@ nfs_open(const char *upath, struct open_ setenv("boot.nfsroot.path", rootpath, 1); setenv("boot.nfsroot.nfshandle", buf, 1); -#ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } - currfd = &nfs_root_node; +#ifndef NFS_NOSYMLINK + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -533,7 +537,6 @@ nfs_open(const char *upath, struct open_ /* allocate file system specific data structure */ newfd = malloc(sizeof(*newfd)); newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -585,11 +588,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -597,8 +597,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -611,14 +610,12 @@ out: if (path) free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); currfd->iodesc = desc; - currfd->off = 0; error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -628,10 +625,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -646,7 +640,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; @@ -1133,6 +1127,9 @@ nfs_open(const char *upath, struct open_ if ((error = nfs_getrootfh(desc, rootpath, &nfs_root_node.fhsize, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -1147,14 +1144,14 @@ nfs_open(const char *upath, struct open_ sprintf(buf, "%d", nfs_root_node.fhsize); setenv("boot.nfsroot.nfshandlelen", buf, 1); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } #ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); - - currfd = &nfs_root_node; + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -1186,7 +1183,6 @@ nfs_open(const char *upath, struct open_ goto out; } newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -1238,11 +1234,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -1250,8 +1243,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -1262,17 +1254,12 @@ out: free(newfd); free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); - if (currfd != NULL) { - currfd->iodesc = desc; - currfd->off = 0; + currfd->iodesc = desc; - error = nfs_lookupfh(&nfs_root_node, upath, currfd); - } else - error = ENOMEM; + error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1282,10 +1269,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -1300,7 +1284,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 13:25:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7DAD106564A; Fri, 21 Sep 2012 13:25:50 +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 D31498FC0C; Fri, 21 Sep 2012 13:25:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LDPoUB041431; Fri, 21 Sep 2012 13:25:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LDPoFw041429; Fri, 21 Sep 2012 13:25:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201209211325.q8LDPoFw041429@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Sep 2012 13:25: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: r240780 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 13:25:51 -0000 Author: mav Date: Fri Sep 21 13:25:50 2012 New Revision: 240780 URL: http://svn.freebsd.org/changeset/base/240780 Log: Make nfs_readdir() more careful about using response data, cached in global buffer. For now it fixes bug when following `ls` command will return data from previous one aborted by pager. Also it should allow to read several directories same time, for example, for recursive tracerse. Modified: head/lib/libstand/nfs.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Fri Sep 21 12:40:31 2012 (r240779) +++ head/lib/libstand/nfs.c Fri Sep 21 13:25:50 2012 (r240780) @@ -181,6 +181,7 @@ struct nfs_iodesc { uint32_t fhsize; u_char fh[NFS_V3MAXFHSIZE]; struct nfsv3_fattrs fa; /* all in network order */ + uint64_t cookie; }; #endif /* OLD_NFSV2 */ @@ -755,6 +756,7 @@ nfs_readdir(struct open_file *f, struct struct nfs_readdir_data *rd; struct nfs_readdir_off *roff = NULL; static char *buf; + static struct nfs_iodesc *pfp = NULL; static n_long cookie = 0; size_t cc; n_long eof; @@ -768,13 +770,14 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(cookie); + args->cookie = htonl(fp->off); args->count = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, @@ -784,6 +787,8 @@ nfs_readdir(struct open_file *f, struct roff = (struct nfs_readdir_off *)buf; if (ntohl(roff->cookie) != 0) return EIO; + pfp = fp; + cookie = fp->off; } roff = (struct nfs_readdir_off *)buf; @@ -804,7 +809,7 @@ nfs_readdir(struct open_file *f, struct buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); roff = (struct nfs_readdir_off *)buf; - cookie = ntohl(roff->cookie); + fp->off = cookie = ntohl(roff->cookie); return 0; } #else /* !OLD_NFSV2 */ @@ -1260,6 +1265,7 @@ out: #endif if (!error) { currfd->off = 0; + currfd->cookie = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1398,11 +1404,9 @@ nfs_readdir(struct open_file *f, struct struct nfsv3_readdir_repl *repl; struct nfsv3_readdir_entry *rent; static char *buf; - static uint32_t cookie0 = 0; - static uint32_t cookie1 = 0; + static struct nfs_iodesc *pfp = NULL; + static uint64_t cookie = 0; size_t cc; - static uint32_t cookieverf0 = 0; - static uint32_t cookieverf1 = 0; int pos; struct args { @@ -1418,7 +1422,8 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie0 == 0 && cookie1 == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); @@ -1426,10 +1431,10 @@ nfs_readdir(struct open_file *f, struct args->fhsize = htonl(fp->fhsize); bcopy(fp->fh, args->fhpluscookie, fp->fhsize); pos = roundup(fp->fhsize, sizeof(uint32_t)) / sizeof(uint32_t); - args->fhpluscookie[pos++] = cookie0; - args->fhpluscookie[pos++] = cookie1; - args->fhpluscookie[pos++] = cookieverf0; - args->fhpluscookie[pos++] = cookieverf1; + args->fhpluscookie[pos++] = htonl(fp->off >> 32); + args->fhpluscookie[pos++] = htonl(fp->off); + args->fhpluscookie[pos++] = htonl(fp->cookie >> 32); + args->fhpluscookie[pos++] = htonl(fp->cookie); args->fhpluscookie[pos] = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER3, NFSPROCV3_READDIR, @@ -1440,8 +1445,10 @@ nfs_readdir(struct open_file *f, struct repl = (struct nfsv3_readdir_repl *)buf; if (repl->errno != 0) return (ntohl(repl->errno)); - cookieverf0 = repl->cookiev0; - cookieverf1 = repl->cookiev1; + pfp = fp; + cookie = fp->off; + fp->cookie = ((uint64_t)ntohl(repl->cookiev0) << 32) | + ntohl(repl->cookiev1); buf += sizeof (struct nfsv3_readdir_repl); } rent = (struct nfsv3_readdir_entry *)buf; @@ -1449,10 +1456,7 @@ nfs_readdir(struct open_file *f, struct if (rent->follows == 0) { /* fid0 is actually eof */ if (rent->fid0 != 0) { - cookie0 = 0; - cookie1 = 0; - cookieverf0 = 0; - cookieverf1 = 0; + cookie = 0; return (ENOENT); } goto refill; @@ -1463,8 +1467,8 @@ nfs_readdir(struct open_file *f, struct d->d_name[d->d_namlen] = '\0'; pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t); - cookie0 = rent->nameplus[pos++]; - cookie1 = rent->nameplus[pos++]; + fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos++]) << 32) | + ntohl(rent->nameplus[pos++]); buf = (u_char *)&rent->nameplus[pos]; return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 16:20:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FDF5106566B; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 603EB8FC0A; Fri, 21 Sep 2012 16:20:55 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa06.fnfis.com (8.14.4/8.14.4) with ESMTP id q8LGKps1014464 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 21 Sep 2012 11:20:53 -0500 Received: from [10.0.0.100] (10.14.152.61) by smtp.fisglobal.com (10.132.206.15) with Microsoft SMTP Server (TLS) id 14.2.309.2; Fri, 21 Sep 2012 11:20:05 -0500 MIME-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="us-ascii" From: Devin Teske In-Reply-To: <20120921113654.GA7865@stack.nl> Date: Fri, 21 Sep 2012 09:19:58 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1278) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-09-21_01:2012-09-20, 2012-09-21, 1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Devin Teske , src-committers@freebsd.org Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Devin Teske List-Id: 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, 21 Sep 2012 16:20:55 -0000 On Sep 21, 2012, at 4:36 AM, Jilles Tjoelker wrote: > On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: >> Author: dteske >> Date: Fri Sep 21 01:36:20 2012 >> New Revision: 240770 >> URL: http://svn.freebsd.org/changeset/base/240770 >=20 >> Log: >> Replace redirections to /dev/null with "close file-descriptor" syntax (= >&-). >=20 >> Reviewed by: adrian (co-mentor) >> Approved by: adrian (co-mentor) >=20 >> [snip] >=20 >> Modified: head/usr.sbin/bsdconfig/bsdconfig >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 (r240769) >> +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 (r240770) >> @@ -73,7 +73,7 @@ usage() >> # Determine the maximum width of terminal/console >> # >> local max_size max_width >> - max_size=3D$( stty size 2> /dev/null ) >> + max_size=3D$( stty size 2>&- ) >> : ${max_size:=3D"24 80"} >> max_width=3D"${max_size#*[$IFS]}" >> f_dprintf "max_width=3D[$max_width]" >> [snip] >=20 > This change is risky because it may cause error messages to be written > to unexpected files. The first file the utility opens will be fd 2, and > if something decides to write an error message to fd 2 it will try to > write to that file. >=20 > For this reason, the kernel will automatically open /dev/null if you > execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >=20 > Particularly with fd 1 (>&-) there is another danger in that the output > may fail with [EBADF] rather than being silently discarded. This may > cause unexpected failures. >=20 > If the reason is that there may be no /dev/null, then you will have to > change the environment such that there will be a /dev/null. >=20 Jilles and I discussed in IRC and he showed me how I can make /dev/null ava= ilable in the embedded environment that this was needed for. I'm going to make another revision that reverses the changes in SVN r240770= (this change). Thanks Jilles! --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 16:33:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07DD106564A; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 79AB18FC08; Fri, 21 Sep 2012 16:33:30 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so8730569pbb.13 for ; Fri, 21 Sep 2012 09:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3vHi9X2aIfxXG4lJnSHbz3PQV5Xz8jSmdtMzoOgEAVc=; b=SK5/4Nt1ErWsfxfp+l4X6fD4BOt/fqYPnBvc3hB+h6ipTksvbj+QFvELDCNHR6HUMW wiyIOTWQbu0eP0TnkTaGiuBFB+d39UuY98xXv5Rj11DPFepMYVCnd06kXhDWQD0Vu2ua MT1G25VpGD062ES6NfwTR0LjKTW+yZZ3KJqUKhchx8x8hh8pSEW3VrZrLlq2PuIjWjs6 nsc2/tVWR5V3oY5pWJD90wU/cFr1GS91TfUWDH6oJRkEHGbhByty8GGEnl7ztwkQDOtD jtTNrgtBnBu3ElFLp2QBwfGihgwPlwigjRTbv9Zvcvzoo5sKAVMED3jpiKCjOgVNtKtl NXAQ== MIME-Version: 1.0 Received: by 10.68.189.164 with SMTP id gj4mr17039810pbc.48.1348245209928; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.36.106 with HTTP; Fri, 21 Sep 2012 09:33:29 -0700 (PDT) In-Reply-To: <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> References: <201209210136.q8L1aKiF031991@svn.freebsd.org> <20120921113654.GA7865@stack.nl> <7D546F33-EECC-4940-BDC6-FA73F330882A@fisglobal.com> Date: Fri, 21 Sep 2012 09:33:29 -0700 X-Google-Sender-Auth: h5A7qsp3HUtSwkPoaZOe8kkdI3o Message-ID: From: Adrian Chadd To: Devin Teske 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, Jilles Tjoelker Subject: Re: svn commit: r240770 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 16:33:31 -0000 Sweet. The reversal is approved. Let's rope some sh script people in on the next few commits, just for some feedback? Adrian On 21 September 2012 09:19, Devin Teske wrote: > > On Sep 21, 2012, at 4:36 AM, Jilles Tjoelker wrote: > >> On Fri, Sep 21, 2012 at 01:36:20AM +0000, Devin Teske wrote: >>> Author: dteske >>> Date: Fri Sep 21 01:36:20 2012 >>> New Revision: 240770 >>> URL: http://svn.freebsd.org/changeset/base/240770 >> >>> Log: >>> Replace redirections to /dev/null with "close file-descriptor" syntax = (>&-). >> >>> Reviewed by: adrian (co-mentor) >>> Approved by: adrian (co-mentor) >> >>> [snip] >> >>> Modified: head/usr.sbin/bsdconfig/bsdconfig >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 00:36:35 2012 = (r240769) >>> +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 01:36:20 2012 = (r240770) >>> @@ -73,7 +73,7 @@ usage() >>> # Determine the maximum width of terminal/console >>> # >>> local max_size max_width >>> - max_size=3D$( stty size 2> /dev/null ) >>> + max_size=3D$( stty size 2>&- ) >>> : ${max_size:=3D"24 80"} >>> max_width=3D"${max_size#*[$IFS]}" >>> f_dprintf "max_width=3D[$max_width]" >>> [snip] >> >> This change is risky because it may cause error messages to be written >> to unexpected files. The first file the utility opens will be fd 2, and >> if something decides to write an error message to fd 2 it will try to >> write to that file. >> >> For this reason, the kernel will automatically open /dev/null if you >> execute suid/sgid binaries with fd 0, 1 and/or 2 closed. >> >> Particularly with fd 1 (>&-) there is another danger in that the output >> may fail with [EBADF] rather than being silently discarded. This may >> cause unexpected failures. >> >> If the reason is that there may be no /dev/null, then you will have to >> change the environment such that there will be a /dev/null. >> > > Jilles and I discussed in IRC and he showed me how I can make /dev/null a= vailable in the embedded environment that this was needed for. > > I'm going to make another revision that reverses the changes in SVN r2407= 70 (this change). > > Thanks Jilles! > -- > Devin > > _____________ > The information contained in this message is proprietary and/or confident= ial. If you are not the intended recipient, please: (i) delete the message = and all copies; (ii) do not disclose, distribute or use the message in any = manner; and (iii) notify the sender immediately. In addition, please be awa= re that any message addressed to our domain is subject to archiving and rev= iew by persons other than the intended recipient. Thank you. From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 18:21:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67DE1106566B; Fri, 21 Sep 2012 18:21:32 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 530C28FC08; Fri, 21 Sep 2012 18:21:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LILW3S081480; Fri, 21 Sep 2012 18:21:32 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LILWiD081478; Fri, 21 Sep 2012 18:21:32 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201209211821.q8LILWiD081478@svn.freebsd.org> From: Andreas Tobler Date: Fri, 21 Sep 2012 18:21: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: r240782 - head/sys/boot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 18:21:32 -0000 Author: andreast Date: Fri Sep 21 18:21:31 2012 New Revision: 240782 URL: http://svn.freebsd.org/changeset/base/240782 Log: Implement elfN(reloc) for powerpc. With this change the kernel is now able to resolve dependencies of modules at boot time and load additional modules when needed. MFC after: 1 week Modified: head/sys/boot/common/reloc_elf.c Modified: head/sys/boot/common/reloc_elf.c ============================================================================== --- head/sys/boot/common/reloc_elf.c Fri Sep 21 13:42:30 2012 (r240781) +++ head/sys/boot/common/reloc_elf.c Fri Sep 21 18:21:31 2012 (r240782) @@ -193,6 +193,31 @@ __elfN(reloc)(struct elf_file *ef, symad } return (0); +#elif defined(__powerpc__) + Elf_Size w; + const Elf_Rela *rela; + + switch (reltype) { + case ELF_RELOC_RELA: + rela = reldata; + if (relbase + rela->r_offset >= dataaddr && + relbase + rela->r_offset < dataaddr + len) { + switch (ELF_R_TYPE(rela->r_info)) { + case R_PPC_RELATIVE: + w = relbase + rela->r_addend; + bcopy(&w, (u_char *)data + (relbase + + rela->r_offset - dataaddr), sizeof(w)); + break; + default: + printf("\nunhandled relocation type %u\n", + (u_int)ELF_R_TYPE(rela->r_info)); + return (EFTYPE); + } + } + break; + } + + return (0); #else return (EOPNOTSUPP); #endif From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 19:03:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E490106564A; Fri, 21 Sep 2012 19:03:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473B48FC0A; Fri, 21 Sep 2012 19:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LJ3QlB088041; Fri, 21 Sep 2012 19:03:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LJ3PIe088018; Fri, 21 Sep 2012 19:03:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209211903.q8LJ3PIe088018@svn.freebsd.org> From: Devin Teske Date: Fri, 21 Sep 2012 19:03: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: r240783 - in head/usr.sbin/bsdconfig: . console mouse networking networking/share share startup startup/share timezone/share usermgmt/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 19:03:26 -0000 Author: dteske Date: Fri Sep 21 19:03:25 2012 New Revision: 240783 URL: http://svn.freebsd.org/changeset/base/240783 Log: Reverse SVN r240770 -- jilles@ made a suggestion that allowed us to redesign our embedded rescue environment to support /dev/null making r240770 obsolete. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Sep 21 19:03:25 2012 (r240783) @@ -73,7 +73,7 @@ usage() # Determine the maximum width of terminal/console # local max_size max_width - max_size=$( stty size 2>&- ) + max_size=$( stty size 2> /dev/null ) : ${max_size:="24 80"} max_width="${max_size#*[$IFS]}" f_dprintf "max_width=[$max_width]" @@ -242,8 +242,8 @@ if [ "$1" ]; then # lang="${LANG:-$LC_ALL}" if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang 2>&- | - tail -1 ) + sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ + 2> /dev/null | tail -1 ) # Fall-back to non-i18n sources if nothing was found [ "$sel" ] || Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/console/ttys Fri Sep 21 19:03:25 2012 (r240783) @@ -117,8 +117,8 @@ ttys_set_type() # with 0600 permissions -- change the permissions and ownership to # match ttys(5) before we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2>&- )" - local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2>&- )" + local mode="$( stat -f '%#Lp' "$ETC_TTYS" 2> /dev/null )" + local owner="$( stat -f '%u:%g' "$ETC_TTYS" 2> /dev/null )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Sep 21 19:03:25 2012 (r240783) @@ -86,7 +86,7 @@ flags=$( f_sysrc_get moused_flags ) # f_dialog_info "$msg_trying_to_start_the_mouse_daemon" [ -r "$MOUSED_PIDFILE" ] && - f_quietly kill "$( cat "$MOUSED_PIDFILE" 2>&- )" + f_quietly kill "$( cat "$MOUSED_PIDFILE" 2> /dev/null )" f_quietly vidcontrol -m on f_quietly moused -t "$type" -p "$port" $flags Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/devices Fri Sep 21 19:03:25 2012 (r240783) @@ -112,7 +112,7 @@ while :; do # configuration # dhcp= - eval "$( exec 2>&- + eval "$( exec 2> /dev/null set -- $_ifconfig while [ $# -gt 0 ]; do case "$1" in Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -72,7 +72,7 @@ f_device_desc() devname="${device%%$d*}" devunit="${device#$devname}" devunit="${devunit%%[a-zA-Z_]*}" - sysctl -n "dev.$devname.$devunit.%desc" 2>&- && + sysctl -n "dev.$devname.$devunit.%desc" 2> /dev/null && return $SUCCESS fi Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -47,7 +47,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_inet() { local interface="$1" - ifconfig "$interface" 2>&- | awk \ + ifconfig "$interface" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -83,7 +83,7 @@ f_ifconfig_options() f_ifconfig_media() { local interface="$1" - ifconfig -m "$interface" 2>&- | awk \ + ifconfig -m "$interface" 2> /dev/null | awk \ ' BEGIN { media_found = 0 } { Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc f_ifconfig_netmask() { local interface="$1" octets - octets=$( ifconfig "$interface" 2>&- | awk \ + octets=$( ifconfig "$interface" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "inet" ) \ Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -65,7 +65,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_resolv_conf_domain() { - tail -r "$RESOLV_CONF" 2>&- | awk \ + tail -r "$RESOLV_CONF" 2> /dev/null | awk \ ' BEGIN { found = 0 } ( tolower($1) == "domain" ) \ @@ -84,7 +84,7 @@ f_resolv_conf_domain() # f_resolv_conf_search() { - tail -r "$RESOLV_CONF" 2>&- | awk \ + tail -r "$RESOLV_CONF" 2> /dev/null | awk \ ' BEGIN { found = 0 } { @@ -118,7 +118,7 @@ f_resolv_conf_nameservers() } END { exit ! found } ' \ - "$RESOLV_CONF" 2>&- + "$RESOLV_CONF" 2> /dev/null } # f_dialog_resolv_conf_update $hostname @@ -225,8 +225,8 @@ f_dialog_resolv_conf_update() # permissions and ownership to match resolv.conf(5) before # we write it out and mv(1) it into place). # - local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- )" - local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- )" + local mode="$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null )" + local owner="$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null )" f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" @@ -246,7 +246,7 @@ f_dialog_resolv_conf_update() # local domain="${hostname#*.}" new_contents [ "$domain" = "$hostname" ] && domain= - new_contents=$( tail -r "$RESOLV_CONF" 2>&- ) + new_contents=$( tail -r "$RESOLV_CONF" 2> /dev/null ) new_contents=$( echo "$new_contents" | awk \ -v domain="$domain" \ -v search_all="${RESOLVER_SEARCH_DOMAINS_ALL:-1}" \ @@ -397,8 +397,8 @@ f_dialog_input_nameserver() # Quietly fixup permissions and ownership # local mode owner - mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2>&- ) - owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2>&- ) + mode=$( stat -f '%#Lp' "$RESOLV_CONF" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$RESOLV_CONF" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc # f_route_get_default() { - route -n get default 2>&- | awk \ + route -n get default 2> /dev/null | awk \ ' BEGIN { found = 0 } ( $1 == "gateway:" ) \ Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -72,7 +72,7 @@ f_err() # f_quietly() { - "$@" >&- 2>&- + "$@" > /dev/null 2>&1 } # f_have $anything ... Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/dialog.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -1321,7 +1321,7 @@ f_dialog_init() # Process stored command-line arguments # SECURE=$( set -- "$ARGV" - while getopts S flag >&-; do + while getopts S flag > /dev/null; do case "$flag" in S) echo 1;; \?) continue;; @@ -1329,7 +1329,7 @@ f_dialog_init() done ) USE_XDIALOG=$( set -- "$ARGV" - while getopts SX flag >&-; do + while getopts SX flag > /dev/null; do case "$flag" in S|X) echo 1;; \?) continue;; @@ -1372,7 +1372,7 @@ f_dialog_init() eval xauth -if \~$SUDO_USER/.Xauthority extract - \ \"\$HOSTNAME/unix:\$displaynum\" \ \"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - >&- 2>&-' + ~root/.Xauthority merge - > /dev/null 2>&1' fi # Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -85,7 +85,7 @@ f_become_root_via_sudo() # # Check sudo(8) access before prompting for password. # - :| sudo -S -v 2>&- + :| sudo -S -v 2> /dev/null if [ $? -ne $SUCCESS ]; then # # sudo(8) access denied. Prompt for their password. @@ -112,7 +112,7 @@ f_become_root_via_sudo() --ok-label "$msg_ok" \ --cancel-label "$msg_cancel" \ --password --inputbox "$msg" $size \ - 2>&1 >&- ) + 2>&1 > /dev/null ) retval=$? # Catch X11-related errors @@ -141,7 +141,7 @@ f_become_root_via_sudo() # # Validate sudo(8) credentials # - sudo -S -v 2>&- <<-EOF + sudo -S -v 2> /dev/null <<-EOF $password EOF retval=$? @@ -186,7 +186,7 @@ f_become_root_via_sudo() displaynum="${DISPLAY#*:}" xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \ $HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \ - ~root/.Xauthority merge - >&- 2>&-' + ~root/.Xauthority merge - > /dev/null 2>&1' fi # Re-execute ourselves with sudo(8) @@ -254,7 +254,7 @@ f_authenticate_some_user() $height $width \ "$field_username" "" \ "$field_password" "" \ - 2>&1 >&- ) + 2>&1 > /dev/null ) retval=$? # Catch X11-related errors @@ -302,7 +302,7 @@ f_authenticate_some_user() su -m "$user" <<-EOF sh <&- < /dev/null <&- 2>&- + ( : $((0/$arg)) ) > /dev/null 2>&1 } fi # ! $_STRINGS_SUBR Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -134,7 +134,7 @@ f_sysrc_get() # f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS - . "$RC_DEFAULTS" >&- 2>&- + . "$RC_DEFAULTS" > /dev/null 2>&1 unset RC_DEFAULTS # no longer needed @@ -153,7 +153,7 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) >&- 2>&- + ( : ${RC_CONFS?} ) > /dev/null 2>&1 if [ $? -eq ${SUCCESS:-0} ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 @@ -162,7 +162,7 @@ f_sysrc_get() unset SUCCESS # no longer needed - source_rc_confs >&- 2>&- + source_rc_confs > /dev/null 2>&1 # # If the query was for `rc_conf_files' AND after calling @@ -190,7 +190,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2>&- + eval echo '"${'"$1"'}"' 2> /dev/null ) } @@ -221,7 +221,7 @@ f_sysrc_get_default() # f_clean_env --except RC_DEFAULTS - . "$RC_DEFAULTS" >&- 2>&- + . "$RC_DEFAULTS" > /dev/null 2>&1 unset RC_DEFAULTS # no longer needed @@ -232,7 +232,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2>&- + eval echo '"${'"$1"'}"' 2> /dev/null ) } @@ -477,7 +477,7 @@ f_sysrc_set() # permissions from the temporary file). # local mode - mode=$( stat -f '%#Lp' "$file" 2>&- ) + mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" # @@ -486,14 +486,14 @@ f_sysrc_set() # permissions (so we throw stderr into the bit-bucket). # local owner - owner=$( stat -f '%u:%g' "$file" 2>&- ) + owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) f_quietly chown "${owner:-root:wheel}" "$tmpfile" # # Operate on the matching file, replacing only the last occurrence. # local new_contents retval - new_contents=$( tail -r $file 2>&- ) + new_contents=$( tail -r $file 2> /dev/null ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? @@ -572,8 +572,8 @@ f_sysrc_delete() # permissions) to instead match the destination file. # local mode owner - mode=$( stat -f '%#Lp' "$file" 2>&- ) - owner=$( stat -f '%u:%g' "$file" 2>&- ) + mode=$( stat -f '%#Lp' "$file" 2> /dev/null ) + owner=$( stat -f '%u:%g' "$file" 2> /dev/null ) f_quietly chmod "${mode:-0644}" "$tmpfile" f_quietly chown "${owner:-root:wheel}" "$tmpfile" Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Sep 21 19:03:25 2012 (r240783) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -110,8 +110,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -112,8 +112,8 @@ dialog_menu_main() f_dialog_info "$msg_creating_menu_list" RCCONF_MENU_LIST="$RCCONF_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null var_list=$( f_startup_rcconf_list ) for var in $var_list; do eval export $var @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) >&- 2>&-; then + if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Sep 21 19:03:25 2012 (r240783) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) >&- 2>&- || SHOW_DESC=1 +( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 ############################################################ FUNCTIONS @@ -82,8 +82,8 @@ dialog_menu_main() fi RCVAR_MENU_LIST="$RCVAR_MENU_LIST $( - . "$RC_DEFAULTS" >&- - source_rc_confs >&- + . "$RC_DEFAULTS" > /dev/null + source_rc_confs > /dev/null for rcvar in $( echo "$RCVAR_MAP" | awk '{print $1}' ); do eval export $rcvar done Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -63,9 +63,9 @@ STARTUP_RCCONF_MAP_CACHEFILE="/var/run/b f_startup_rcconf_list() { ( # Operate within a sub-shell to protect the parent environment - . "$RC_DEFAULTS" >&- + . "$RC_DEFAULTS" > /dev/null f_clean_env --except PATH STARTUP_RCCONF_REGEX rc_conf_files - source_rc_confs >&- + source_rc_confs > /dev/null export _rc_conf_files_file="$( f_sysrc_find rc_conf_files )" export RC_DEFAULTS set | awk -F= " Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2>&- > "$_PATH_DB"; then + if : 2> /dev/null > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 18:21:31 2012 (r240782) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Fri Sep 21 19:03:25 2012 (r240783) @@ -627,7 +627,7 @@ f_dialog_input_change() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2>&- ) + "+%d %m %Y" 2> /dev/null ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -654,7 +654,7 @@ f_dialog_input_change() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2>&- ) + -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -682,7 +682,7 @@ f_dialog_input_change() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2>&- ) + +%s 2> /dev/null ) f_dprintf "_input=[$_input]" break ;; @@ -852,7 +852,7 @@ f_dialog_input_expire() local secs="$_input" { f_isinteger "$secs" && [ $secs -gt 0 ]; } || secs= _input_date=$( date -j -f "%s" -- "$secs" \ - "+%d %m %Y" 2>&- ) + "+%d %m %Y" 2> /dev/null ) calendar_size=$( f_dialog_calendar_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -879,7 +879,7 @@ f_dialog_input_expire() _input_time= [ "$secs" ] && _input_time=$( date -j \ - -f %s -- "$_input" "+%H %M %S" 2>&- ) + -f %s -- "$_input" "+%H %M %S" 2> /dev/null ) timebox_size=$( f_dialog_timebox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -906,7 +906,7 @@ f_dialog_input_expire() _input=$( date \ -j -f "%d/%m/%Y %T" \ -- "$ret_date $ret_time" \ - +%s 2>&- ) + +%s 2> /dev/null ) f_dprintf "_input=[$_input]" break ;; From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 19:18:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33B34106564A; Fri, 21 Sep 2012 19:18:40 +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 1F3068FC0A; Fri, 21 Sep 2012 19:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LJIddF090450; Fri, 21 Sep 2012 19:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LJIdwG090448; Fri, 21 Sep 2012 19:18:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209211918.q8LJIdwG090448@svn.freebsd.org> From: Rui Paulo Date: Fri, 21 Sep 2012 19:18: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: r240784 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 19:18:40 -0000 Author: rpaulo Date: Fri Sep 21 19:18:39 2012 New Revision: 240784 URL: http://svn.freebsd.org/changeset/base/240784 Log: Remove #ident macro. -This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. M altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_rmclass.c Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Fri Sep 21 19:03:25 2012 (r240783) +++ head/sys/contrib/altq/altq/altq_rmclass.c Fri Sep 21 19:18:39 2012 (r240784) @@ -35,10 +35,9 @@ * * LBL code modified by speer@eng.sun.com, May 1977. * For questions and/or comments, please send mail to cbq@ee.lbl.gov + * + * @(#)rm_class.c 1.48 97/12/05 SMI */ - -#ident "@(#)rm_class.c 1.48 97/12/05 SMI" - #if defined(__FreeBSD__) || defined(__NetBSD__) #include "opt_altq.h" #include "opt_inet.h" From owner-svn-src-head@FreeBSD.ORG Fri Sep 21 21:27:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE831065672; Fri, 21 Sep 2012 21:27:58 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A7AC8FC17; Fri, 21 Sep 2012 21:27:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8LLRvCi012192; Fri, 21 Sep 2012 21:27:58 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8LLRvXP012190; Fri, 21 Sep 2012 21:27:57 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201209212127.q8LLRvXP012190@svn.freebsd.org> From: Andreas Tobler Date: Fri, 21 Sep 2012 21:27: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: r240793 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 21 Sep 2012 21:27:58 -0000 Author: andreast Date: Fri Sep 21 21:27:57 2012 New Revision: 240793 URL: http://svn.freebsd.org/changeset/base/240793 Log: Remove leftover from r215163. Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Fri Sep 21 20:59:22 2012 (r240792) +++ head/sys/powerpc/ofw/ofw_real.c Fri Sep 21 21:27:57 2012 (r240793) @@ -170,7 +170,6 @@ static size_t of_bounce_size; static struct mtx of_bounce_mtx; extern int ofw_real_mode; -extern struct pmap ofw_pmap; /* * After the VM is up, allocate a wired, low memory bounce page. From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 03:11:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D812D106564A; Sat, 22 Sep 2012 03:11:35 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C242B8FC08; Sat, 22 Sep 2012 03:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M3BZWk071126; Sat, 22 Sep 2012 03:11:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M3BZn5071121; Sat, 22 Sep 2012 03:11:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209220311.q8M3BZn5071121@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 03:11: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: r240797 - in head/usr.sbin/bsdconfig: include share startup/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 03:11:36 -0000 Author: dteske Date: Sat Sep 22 03:11:35 2012 New Revision: 240797 URL: http://svn.freebsd.org/changeset/base/240797 Log: Spelling and whitespace corrections. Reviewed by: adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/share/rcconf.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/include/messages.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -44,7 +44,7 @@ msg_no_such_file_or_directory="%s: %s: N msg_no_username="No username provided!" msg_not_found="not found" msg_ok="OK" -msg_permission_denied="%s: %s: permission denied" +msg_permission_denied="%s: %s: Permission denied" msg_please_enter_password="Please enter your password for sudo(8):" msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/share/common.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -63,12 +63,12 @@ f_dprintf() # f_err() { - printf "$@" >&2 + printf "$@" >&2 } # f_quietly $command [ $arguments ... ] # -# run a command quietly (quell any output to stdout or stderr) +# Run a command quietly (quell any output to stdout or stderr) # f_quietly() { @@ -76,7 +76,7 @@ f_quietly() } # f_have $anything ... -# +# # A wrapper to the `type' built-in. Returns true if argument is a valid shell # built-in, keyword, or externally-tracked binary, otherwise false. # Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -17,7 +17,7 @@ if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUB # 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 @@ -166,7 +166,7 @@ f_sysrc_get() # # If the query was for `rc_conf_files' AND after calling - # source_rc_confs the vaue has not changed, then we should + # source_rc_confs the value has not changed, then we should # restore the value to the one inherited from RC_DEFAULTS # before performing the final query (preventing us from # returning what was set via RC_CONFS when the intent was Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Fri Sep 21 22:07:46 2012 (r240796) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sat Sep 22 03:11:35 2012 (r240797) @@ -113,8 +113,8 @@ f_startup_rcconf_map() # # Calculate digest used to determine if the on-disk global persistant - # cache file (containg this digest on the first line) is valid and can - # be used to quickly populate the cache value for immediate return. + # cache file (containing this digest on the first line) is valid and + # can be used to quickly populate the cache value for immediate return. # local rc_defaults_digest rc_defaults_digest=$( md5 < "$RC_DEFAULTS" ) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 04:04:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B171106564A; Sat, 22 Sep 2012 04:04:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 156BA8FC0A; Sat, 22 Sep 2012 04:04:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M442MT080309; Sat, 22 Sep 2012 04:04:02 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M442gF080303; Sat, 22 Sep 2012 04:04:02 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209220404.q8M442gF080303@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 04:04: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: r240798 - in head/usr.sbin/bsdconfig: share startup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 04:04:03 -0000 Author: dteske Date: Sat Sep 22 04:04:02 2012 New Revision: 240798 URL: http://svn.freebsd.org/changeset/base/240798 Log: Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sat Sep 22 04:04:02 2012 (r240798) @@ -132,7 +132,7 @@ f_sysrc_get() # Clear the environment of all variables, preventing the # expansion of normals such as `PS1', `TERM', etc. # - f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS + f_clean_env --except RC_CONFS RC_DEFAULTS . "$RC_DEFAULTS" > /dev/null 2>&1 @@ -153,15 +153,11 @@ f_sysrc_get() # If RC_CONFS is defined, set $rc_conf_files to an explicit # value, modifying the default behavior of source_rc_confs(). # - ( : ${RC_CONFS?} ) > /dev/null 2>&1 - if [ $? -eq ${SUCCESS:-0} ]; then + if [ "${RC_CONFS+set}" ]; then rc_conf_files="$RC_CONFS" _rc_confs_set=1 fi - unset SUCCESS - # no longer needed - source_rc_confs > /dev/null 2>&1 # Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcadd Sat Sep 22 04:04:02 2012 (r240798) @@ -46,7 +46,7 @@ ipgm=$( f_index_menu_selection $BSDCFG_L # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcconf Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcdelete Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCCONF_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( : ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 # Selectively inherit SHOW_* value (in order of preference) if [ "$SHOW_DEFAULT_VALUE" ]; then SHOW_DEFAULT_VALUE=1 @@ -348,7 +348,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if ( eval : \${_${var}_delete?} ) > /dev/null 2>&1; then + if eval [ \"\${_${var}_delete+set}\" ]; then unset _${var}_delete else setvar _${var}_delete 1 Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Sat Sep 22 03:11:35 2012 (r240797) +++ head/usr.sbin/bsdconfig/startup/rcvar Sat Sep 22 04:04:02 2012 (r240798) @@ -54,7 +54,7 @@ RCVAR_MENU_LIST= # Options # # Inherit SHOW_DESC value if set, otherwise default to 1 -( ${SHOW_DESC?} ) > /dev/null 2>&1 || SHOW_DESC=1 +[ "${SHOW_DESC+set}" ] || SHOW_DESC=1 ############################################################ FUNCTIONS From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 06:41:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABD0E106564A; Sat, 22 Sep 2012 06:41:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9335F8FC15; Sat, 22 Sep 2012 06:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M6fvtB007301; Sat, 22 Sep 2012 06:41:57 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M6fvrh007283; Sat, 22 Sep 2012 06:41:57 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209220641.q8M6fvrh007283@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Sep 2012 06:41: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: r240802 - in head/sys/arm: arm at91 broadcom/bcm2835 econa include lpc mv s3c2xx0 sa11x0 tegra ti xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 06:41:57 -0000 Author: andrew Date: Sat Sep 22 06:41:56 2012 New Revision: 240802 URL: http://svn.freebsd.org/changeset/base/240802 Log: Create a common set_stackptrs in sys/arm/machdep.c. On single core devices set_stackptrs is only ever called with cpu = 0 in initarm and will be identical to the existing function. On SMP this needs to be implemented for sys/arm/mp_machdep.c, but the implementations are identical for each SoC. Modified: head/sys/arm/arm/machdep.c head/sys/arm/at91/at91_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/econa/econa_machdep.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/s3c2xx0/s3c24x0_machdep.c head/sys/arm/sa11x0/assabet_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/arm/xscale/i80321/ep80219_machdep.c head/sys/arm/xscale/i80321/iq31244_machdep.c head/sys/arm/xscale/i8134x/crb_machdep.c head/sys/arm/xscale/ixp425/avila_machdep.c head/sys/arm/xscale/pxa/pxa_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/arm/machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -948,3 +948,16 @@ init_proc0(vm_offset_t kstack) thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; } + +void +set_stackptrs(int cpu) +{ + + set_stackptr(PSR_IRQ32_MODE, + irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_ABT32_MODE, + abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); + set_stackptr(PSR_UND32_MODE, + undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); +} + Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/at91/at91_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -597,12 +592,8 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -108,11 +108,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -147,8 +142,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -544,18 +537,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define FDT_DEVMAP_MAX (2) // FIXME static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/econa/econa_machdep.c ============================================================================== --- head/sys/arm/econa/econa_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/econa/econa_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -92,11 +92,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -303,12 +298,7 @@ initarm(struct arm_boot_params *abp) */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/include/machdep.h Sat Sep 22 06:41:56 2012 (r240802) @@ -4,12 +4,23 @@ #ifndef _MACHDEP_BOOT_MACHDEP_H_ #define _MACHDEP_BOOT_MACHDEP_H_ +/* Structs that need to be initialised by initarm */ +extern struct pv_addr irqstack; +extern struct pv_addr undstack; +extern struct pv_addr abtstack; + +/* Define various stack sizes in pages */ +#define IRQ_STACK_SIZE 1 +#define ABT_STACK_SIZE 1 +#define UND_STACK_SIZE 1 + /* misc prototypes used by the many arm machdeps */ void arm_lock_cache_line(vm_offset_t); void init_proc0(vm_offset_t kstack); void halt(void); void data_abort_handler(trapframe_t *); void prefetch_abort_handler(trapframe_t *); +void set_stackptrs(int cpu); void undefinedinstruction_bounce(trapframe_t *); /* Early boot related helper functions */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -109,11 +109,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -504,12 +499,8 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/mv/mv_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -137,8 +132,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -565,18 +558,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define MPP_PIN_MAX 68 #define MPP_PIN_CELLS 2 #define MPP_PINS_PER_REG 8 Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -105,11 +105,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern int s3c2410_pclk; extern u_int data_abort_handler_address; @@ -349,12 +344,7 @@ initarm(struct arm_boot_params *abp) */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- head/sys/arm/sa11x0/assabet_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/sa11x0/assabet_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -105,11 +105,6 @@ __FBSDID("$FreeBSD$"); #define KERNEL_PT_VMDATA_NUM 7 /* start with 16MB of KVM */ #define NUM_KERNEL_PTS (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - #define KERNEL_VM_BASE (KERNBASE + 0x00100000) #define KERNEL_VM_SIZE 0x05000000 @@ -352,12 +347,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -92,10 +92,6 @@ __FBSDID("$FreeBSD$"); #define KERNEL_PT_MAX 78 -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 -#define FIQ_STACK_SIZE 1 #define debugf(fmt, args...) printf(fmt, ##args) @@ -140,13 +136,11 @@ vm_paddr_t pmap_pa; const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; -static struct pv_addr irqstack; -static struct pv_addr undstack; -static struct pv_addr abtstack; +struct pv_addr irqstack; +struct pv_addr undstack; +struct pv_addr abtstack; static struct pv_addr kernelstack; -static void set_stackptrs(int cpu); - static int platform_devmap_init(void); static char * @@ -580,19 +574,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -static void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - - #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/ti/ti_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); */ #define KERNEL_PT_MAX 78 -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -146,8 +141,6 @@ struct pv_addr undstack; struct pv_addr abtstack; struct pv_addr kernelstack; -void set_stackptrs(int cpu); - static struct mem_region availmem_regions[FDT_MEM_REGIONS]; static int availmem_regions_sz; @@ -541,18 +534,6 @@ initarm(struct arm_boot_params *abp) sizeof(struct pcb))); } -void -set_stackptrs(int cpu) -{ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + ((IRQ_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ((ABT_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); -} - #define FDT_DEVMAP_MAX (2) // FIXME static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i80321/ep80219_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -329,16 +324,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i80321/iq31244_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -328,16 +323,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- head/sys/arm/xscale/i8134x/crb_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/i8134x/crb_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -107,11 +107,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -314,15 +309,7 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ - - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/ixp425/avila_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -108,11 +108,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -399,9 +394,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, irqstack.pv_va + IRQ_STACK_SIZE*PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, abtstack.pv_va + ABT_STACK_SIZE*PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, undstack.pv_va + UND_STACK_SIZE*PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... Modified: head/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_machdep.c Sat Sep 22 05:27:47 2012 (r240801) +++ head/sys/arm/xscale/pxa/pxa_machdep.c Sat Sep 22 06:41:56 2012 (r240802) @@ -104,11 +104,6 @@ __FBSDID("$FreeBSD$"); /* this should be evenly divisable by PAGE_SIZE / L2_TABLE_SIZE_REAL (or 4) */ #define NUM_KERNEL_PTS (KERNEL_PT_AFKERNEL + KERNEL_PT_AFKERNEL_NUM) -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -311,12 +306,7 @@ initarm(struct arm_boot_params *abp) * Since the ARM stacks use STMFD etc. we must set r13 to the top end * of the stack memory. */ - set_stackptr(PSR_IRQ32_MODE, - irqstack.pv_va + IRQ_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_ABT32_MODE, - abtstack.pv_va + ABT_STACK_SIZE * PAGE_SIZE); - set_stackptr(PSR_UND32_MODE, - undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); + set_stackptrs(0); /* * We must now clean the cache again.... From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 06:54:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9086106566C; Sat, 22 Sep 2012 06:54:03 +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 B363F8FC0C; Sat, 22 Sep 2012 06:54:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M6s3wZ009331; Sat, 22 Sep 2012 06:54:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M6s3Fx009328; Sat, 22 Sep 2012 06:54:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201209220654.q8M6s3Fx009328@svn.freebsd.org> From: Alan Cox Date: Sat, 22 Sep 2012 06:54: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: r240803 - 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: Sat, 22 Sep 2012 06:54:03 -0000 Author: alc Date: Sat Sep 22 06:54:03 2012 New Revision: 240803 URL: http://svn.freebsd.org/changeset/base/240803 Log: Since UMA_ZONE_NOFREE is specified when l2zone and l2table_zone are created, there is no need to release and reacquire the pmap and pvh global locks around calls to uma_zfree(). Recursion into the pmap simply won't occur. Eliminate the use of M_USE_RESERVE. It is deprecated and, in fact, counter- productive, meaning that it actually makes the memory allocation request more likely to fail. Eliminate the macros pmap_{alloc,free}_l2_dtable(). They are of limited utility, and pmap_free_l2_dtable() was inconsistently used. Tidy up pmap_init(). In particular, change the initialization of the PV zone so that it doesn't span the initialization of the l2 and l2table zones. Tested by: jmg Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sat Sep 22 06:41:56 2012 (r240802) +++ head/sys/arm/arm/pmap-v6.c Sat Sep 22 06:54:03 2012 (r240803) @@ -357,14 +357,6 @@ struct l2_dtable { #define L2_NEXT_BUCKET(va) (((va) & L1_S_FRAME) + L1_S_SIZE) /* - * L2 allocation. - */ -#define pmap_alloc_l2_dtable() \ - (void*)uma_zalloc(l2table_zone, M_NOWAIT|M_USE_RESERVE) -#define pmap_free_l2_dtable(l2) \ - uma_zfree(l2table_zone, l2) - -/* * We try to map the page tables write-through, if possible. However, not * all CPUs have a write-through cache mode, so on those we have to sync * the cache when we frob page tables. @@ -621,10 +613,9 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * no entry in the L1 table. * Need to allocate a new l2_dtable. */ -again_l2table: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - if ((l2 = pmap_alloc_l2_dtable()) == NULL) { + if ((l2 = uma_zalloc(l2table_zone, M_NOWAIT)) == NULL) { rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); @@ -632,18 +623,12 @@ again_l2table: rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); - uma_zfree(l2table_zone, l2); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - l2 = pm->pm_l2[L2_IDX(l1idx)]; - if (l2 == NULL) - goto again_l2table; /* * Someone already allocated the l2_dtable while * we were doing the same. */ + uma_zfree(l2table_zone, l2); + l2 = pm->pm_l2[L2_IDX(l1idx)]; } else { bzero(l2, sizeof(*l2)); /* @@ -665,21 +650,14 @@ again_l2table: * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ -again_ptep: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); + ptep = uma_zalloc(l2zone, M_NOWAIT); rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - if (l2b->l2b_kva == 0) - goto again_ptep; return (l2b); } l2b->l2b_phys = vtophys(ptep); @@ -691,7 +669,7 @@ again_ptep: */ if (l2->l2_occupancy == 0) { pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } return (NULL); } @@ -789,7 +767,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * the pointer in the parent pmap and free the l2_dtable. */ pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } /* @@ -1175,28 +1153,25 @@ pmap_init(void) PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); + l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + /* - * init the pv free list + * Initialize the PV entry allocator. */ pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - /* - * Now it is safe to enable pv_table recording. - */ - PDEBUG(1, printf("pmap_init: done!\n")); - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - pv_entry_high_water = 9 * (pv_entry_max / 10); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + /* + * Now it is safe to enable pv_table recording. + */ + PDEBUG(1, printf("pmap_init: done!\n")); } int @@ -2544,7 +2519,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } /* - * The page queues and pmap must be locked. + * The pvh global and pmap locks must be held. */ static void pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Sat Sep 22 06:41:56 2012 (r240802) +++ head/sys/arm/arm/pmap.c Sat Sep 22 06:54:03 2012 (r240803) @@ -366,14 +366,6 @@ struct l2_dtable { #define L2_NEXT_BUCKET(va) (((va) & L1_S_FRAME) + L1_S_SIZE) /* - * L2 allocation. - */ -#define pmap_alloc_l2_dtable() \ - (void*)uma_zalloc(l2table_zone, M_NOWAIT|M_USE_RESERVE) -#define pmap_free_l2_dtable(l2) \ - uma_zfree(l2table_zone, l2) - -/* * We try to map the page tables write-through, if possible. However, not * all CPUs have a write-through cache mode, so on those we have to sync * the cache when we frob page tables. @@ -875,10 +867,9 @@ pmap_alloc_l2_bucket(pmap_t pm, vm_offse * no entry in the L1 table. * Need to allocate a new l2_dtable. */ -again_l2table: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - if ((l2 = pmap_alloc_l2_dtable()) == NULL) { + if ((l2 = uma_zalloc(l2table_zone, M_NOWAIT)) == NULL) { rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); return (NULL); @@ -886,18 +877,12 @@ again_l2table: rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); - uma_zfree(l2table_zone, l2); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - l2 = pm->pm_l2[L2_IDX(l1idx)]; - if (l2 == NULL) - goto again_l2table; /* * Someone already allocated the l2_dtable while * we were doing the same. */ + uma_zfree(l2table_zone, l2); + l2 = pm->pm_l2[L2_IDX(l1idx)]; } else { bzero(l2, sizeof(*l2)); /* @@ -919,21 +904,14 @@ again_l2table: * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ -again_ptep: PMAP_UNLOCK(pm); rw_wunlock(&pvh_global_lock); - ptep = (void*)uma_zalloc(l2zone, M_NOWAIT|M_USE_RESERVE); + ptep = uma_zalloc(l2zone, M_NOWAIT); rw_wlock(&pvh_global_lock); PMAP_LOCK(pm); if (l2b->l2b_kva != 0) { /* We lost the race. */ - PMAP_UNLOCK(pm); - rw_wunlock(&pvh_global_lock); uma_zfree(l2zone, ptep); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pm); - if (l2b->l2b_kva == 0) - goto again_ptep; return (l2b); } l2b->l2b_phys = vtophys(ptep); @@ -945,7 +923,7 @@ again_ptep: */ if (l2->l2_occupancy == 0) { pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } return (NULL); } @@ -1066,7 +1044,7 @@ pmap_free_l2_bucket(pmap_t pm, struct l2 * the pointer in the parent pmap and free the l2_dtable. */ pm->pm_l2[L2_IDX(l1idx)] = NULL; - pmap_free_l2_dtable(l2); + uma_zfree(l2table_zone, l2); } /* @@ -1834,28 +1812,25 @@ pmap_init(void) PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); + l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), NULL, + NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); + /* - * init the pv free list + * Initialize the PV entry allocator. */ pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - /* - * Now it is safe to enable pv_table recording. - */ - PDEBUG(1, printf("pmap_init: done!\n")); - TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc); - pv_entry_max = shpgperproc * maxproc + cnt.v_page_count; - pv_entry_high_water = 9 * (pv_entry_max / 10); - l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - l2table_zone = uma_zcreate("L2 Table", sizeof(struct l2_dtable), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, - UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); + pv_entry_high_water = 9 * (pv_entry_max / 10); + /* + * Now it is safe to enable pv_table recording. + */ + PDEBUG(1, printf("pmap_init: done!\n")); } int @@ -3302,7 +3277,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, } /* - * The page queues and pmap must be locked. + * The pvh global and pmap locks must be held. */ static void pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 07:27:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E604B106564A; Sat, 22 Sep 2012 07:27:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16678FC12; Sat, 22 Sep 2012 07:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M7ROZ3015492; Sat, 22 Sep 2012 07:27:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M7ROT7015490; Sat, 22 Sep 2012 07:27:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209220727.q8M7ROT7015490@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Sep 2012 07:27: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: r240804 - head/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: Sat, 22 Sep 2012 07:27:25 -0000 Author: hselasky Date: Sat Sep 22 07:27:24 2012 New Revision: 240804 URL: http://svn.freebsd.org/changeset/base/240804 Log: Apply correct casting. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sat Sep 22 06:54:03 2012 (r240803) +++ head/sys/dev/usb/net/if_smsc.c Sat Sep 22 07:27:24 2012 (r240804) @@ -296,7 +296,7 @@ static int smsc_wait_for_bits(struct smsc_softc *sc, uint32_t reg, uint32_t bits) { usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); uint32_t val; int err; @@ -310,7 +310,7 @@ smsc_wait_for_bits(struct smsc_softc *sc return (0); uether_pause(&sc->sc_ue, hz / 100); - } while ((ticks - start_ticks) < max_ticks); + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); return (USB_ERR_TIMEOUT); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 07:44:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58FD6106564A; Sat, 22 Sep 2012 07:44:37 +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 439A58FC12; Sat, 22 Sep 2012 07:44:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M7ibR0018903; Sat, 22 Sep 2012 07:44:37 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M7ibqS018901; Sat, 22 Sep 2012 07:44:37 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201209220744.q8M7ibqS018901@svn.freebsd.org> From: Rui Paulo Date: Sat, 22 Sep 2012 07:44: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: r240805 - 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, 22 Sep 2012 07:44:37 -0000 Author: rpaulo Date: Sat Sep 22 07:44:36 2012 New Revision: 240805 URL: http://svn.freebsd.org/changeset/base/240805 Log: Improve the check for p4 opened files. Now we only search for opened files in ${SYSDIR}, which makes it possible to use multiple source trees. Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sat Sep 22 07:27:24 2012 (r240804) +++ head/sys/conf/newvers.sh Sat Sep 22 07:44:36 2012 (r240805) @@ -140,10 +140,10 @@ if [ -n "$p4_cmd" ] ; then case "$p4version" in [0-9]*) p4version=" ${p4version}" - p4opened=`$p4_cmd opened 2>&1` + p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` case "$p4opened" in File*) ;; - *) p4version="${p4version}+pending" ;; + //*) p4version="${p4version}+edit" ;; esac ;; *) unset p4version ;; From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 08:02:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C36D5106566C; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE7C08FC0A; Sat, 22 Sep 2012 08:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8M82got022037; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8M82guR022035; Sat, 22 Sep 2012 08:02:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209220802.q8M82guR022035@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 22 Sep 2012 08:02: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: r240806 - head/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: Sat, 22 Sep 2012 08:02:42 -0000 Author: hselasky Date: Sat Sep 22 08:02:42 2012 New Revision: 240806 URL: http://svn.freebsd.org/changeset/base/240806 Log: Apply some more casting. Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Sat Sep 22 07:44:36 2012 (r240805) +++ head/sys/dev/usb/net/if_smsc.c Sat Sep 22 08:02:42 2012 (r240806) @@ -334,7 +334,7 @@ static int smsc_eeprom_read(struct smsc_softc *sc, uint16_t off, uint8_t *buf, uint16_t buflen) { usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); int err; int locked; uint32_t val; @@ -365,8 +365,8 @@ smsc_eeprom_read(struct smsc_softc *sc, break; uether_pause(&sc->sc_ue, hz / 100); - } while ((ticks - start_ticks) < max_ticks); - + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); + if (val & (SMSC_EEPROM_CMD_BUSY | SMSC_EEPROM_CMD_TIMEOUT)) { smsc_warn_printf(sc, "eeprom command failed\n"); err = USB_ERR_IOERROR; @@ -1247,7 +1247,7 @@ smsc_phy_init(struct smsc_softc *sc) { int bmcr; usb_ticks_t start_ticks; - usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); SMSC_LOCK_ASSERT(sc, MA_OWNED); @@ -1260,7 +1260,7 @@ smsc_phy_init(struct smsc_softc *sc) bmcr = smsc_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); } while ((bmcr & MII_BMCR) && ((ticks - start_ticks) < max_ticks)); - if ((ticks - start_ticks) >= max_ticks) { + if (((usb_ticks_t)(ticks - start_ticks)) >= max_ticks) { smsc_err_printf(sc, "PHY reset timed-out"); return (EIO); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 10:02:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D97E0106564A; Sat, 22 Sep 2012 10:02:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C50C08FC08; Sat, 22 Sep 2012 10:02:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MA2iNA042618; Sat, 22 Sep 2012 10:02:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MA2iAM042616; Sat, 22 Sep 2012 10:02:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221002.q8MA2iAM042616@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:02: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: r240809 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 10:02:45 -0000 Author: glebius Date: Sat Sep 22 10:02:44 2012 New Revision: 240809 URL: http://svn.freebsd.org/changeset/base/240809 Log: Fix fallout from r236397 in pfr_update_stats(), that was missed later in r237155. We need to zero sockaddr before lookup. While here, make pfr_update_stats() panic on unknown af. Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 08:48:26 2012 (r240808) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:02:44 2012 (r240809) @@ -1954,6 +1954,7 @@ pfr_update_stats(struct pfr_ktable *kt, { struct sockaddr_in sin; + bzero(&sin, sizeof(sin)); sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_addr.s_addr = a->addr32[0]; @@ -1968,6 +1969,7 @@ pfr_update_stats(struct pfr_ktable *kt, { struct sockaddr_in6 sin6; + bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; bcopy(a, &sin6.sin6_addr, sizeof(sin6.sin6_addr)); @@ -1978,7 +1980,7 @@ pfr_update_stats(struct pfr_ktable *kt, } #endif /* INET6 */ default: - ; + panic("%s: unknown address family %u", __func__, af); } if ((ke == NULL || ke->pfrke_not) != notrule) { if (op_pass != PFR_OP_PASS) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 10:04:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75854106564A; Sat, 22 Sep 2012 10:04:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611778FC08; Sat, 22 Sep 2012 10:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MA4n0P043081; Sat, 22 Sep 2012 10:04:49 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MA4nVB043079; Sat, 22 Sep 2012 10:04:49 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221004.q8MA4nVB043079@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:04: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: r240810 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 10:04:49 -0000 Author: glebius Date: Sat Sep 22 10:04:48 2012 New Revision: 240810 URL: http://svn.freebsd.org/changeset/base/240810 Log: In pfr_insert_kentry() return ENOMEM if memory allocation failed. Modified: head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:02:44 2012 (r240809) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:04:48 2012 (r240810) @@ -834,7 +834,7 @@ pfr_insert_kentry(struct pfr_ktable *kt, return (0); p = pfr_create_kentry(ad); if (p == NULL) - return (EINVAL); + return (ENOMEM); rv = pfr_route_kentry(kt, p); if (rv) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 10:14:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F057106564A; Sat, 22 Sep 2012 10:14:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED2258FC14; Sat, 22 Sep 2012 10:14:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MAEln6045074; Sat, 22 Sep 2012 10:14:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MAEldK045071; Sat, 22 Sep 2012 10:14:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221014.q8MAEldK045071@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 10:14: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: r240811 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 10:14:48 -0000 Author: glebius Date: Sat Sep 22 10:14:47 2012 New Revision: 240811 URL: http://svn.freebsd.org/changeset/base/240811 Log: When connection rate hits and we overload a source to a table, we are actually editing table, which means editing rules, thus we need writer access to 'em. Fix this by offloading the update of table to the same taskqueue, we already use for flushing. Since taskqueues major task is now overloading, and flushing is optional, do mechanical rename s/flush/overload/ in the code related to the taskqueue. Since overloading tasks do unsafe referencing of rules, provide a bandaid in pf_purge_unlinked_rules(). If the latter sees any queued tasks, then it skips purging for this run. In table code: - Assert any lock in pfr_lookup_addr(). - Assert writer lock in pfr_route_kentry(). Modified: head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Sep 22 10:04:48 2012 (r240810) +++ head/sys/netpfil/pf/pf.c Sat Sep 22 10:14:47 2012 (r240811) @@ -163,25 +163,25 @@ static struct mtx pf_sendqueue_mtx; #define PF_SENDQ_UNLOCK() mtx_unlock(&pf_sendqueue_mtx) /* - * Queue for pf_flush_task() tasks. + * Queue for pf_overload_task() tasks. */ -struct pf_flush_entry { - SLIST_ENTRY(pf_flush_entry) next; +struct pf_overload_entry { + SLIST_ENTRY(pf_overload_entry) next; struct pf_addr addr; sa_family_t af; uint8_t dir; - struct pf_rule *rule; /* never dereferenced */ + struct pf_rule *rule; }; -SLIST_HEAD(pf_flush_head, pf_flush_entry); -static VNET_DEFINE(struct pf_flush_head, pf_flushqueue); -#define V_pf_flushqueue VNET(pf_flushqueue) -static VNET_DEFINE(struct task, pf_flushtask); -#define V_pf_flushtask VNET(pf_flushtask) - -static struct mtx pf_flushqueue_mtx; -#define PF_FLUSHQ_LOCK() mtx_lock(&pf_flushqueue_mtx) -#define PF_FLUSHQ_UNLOCK() mtx_unlock(&pf_flushqueue_mtx) +SLIST_HEAD(pf_overload_head, pf_overload_entry); +static VNET_DEFINE(struct pf_overload_head, pf_overloadqueue); +#define V_pf_overloadqueue VNET(pf_overloadqueue) +static VNET_DEFINE(struct task, pf_overloadtask); +#define V_pf_overloadtask VNET(pf_overloadtask) + +static struct mtx pf_overloadqueue_mtx; +#define PF_OVERLOADQ_LOCK() mtx_lock(&pf_overloadqueue_mtx) +#define PF_OVERLOADQ_UNLOCK() mtx_unlock(&pf_overloadqueue_mtx) VNET_DEFINE(struct pf_rulequeue, pf_unlinked_rules); struct mtx pf_unlnkdrules_mtx; @@ -279,7 +279,7 @@ static int pf_addr_wrap_neq(struct pf_ static struct pf_state *pf_find_state(struct pfi_kif *, struct pf_state_key_cmp *, u_int); static int pf_src_connlimit(struct pf_state **); -static void pf_flush_task(void *c, int pending); +static void pf_overload_task(void *c, int pending); static int pf_insert_src_node(struct pf_src_node **, struct pf_rule *, struct pf_addr *, sa_family_t); static int pf_purge_expired_states(int); @@ -461,8 +461,7 @@ pf_check_threshold(struct pf_threshold * static int pf_src_connlimit(struct pf_state **state) { - struct pfr_addr p; - struct pf_flush_entry *pffe; + struct pf_overload_entry *pfoe; int bad = 0; PF_STATE_LOCK_ASSERT(*state); @@ -494,69 +493,79 @@ pf_src_connlimit(struct pf_state **state if ((*state)->rule.ptr->overload_tbl == NULL) return (1); - V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; - if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("%s: blocking address ", __func__); - pf_print_host(&(*state)->src_node->addr, 0, - (*state)->key[PF_SK_WIRE]->af); - printf("\n"); - } - - bzero(&p, sizeof(p)); - p.pfra_af = (*state)->key[PF_SK_WIRE]->af; - switch ((*state)->key[PF_SK_WIRE]->af) { -#ifdef INET - case AF_INET: - p.pfra_net = 32; - p.pfra_ip4addr = (*state)->src_node->addr.v4; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - p.pfra_net = 128; - p.pfra_ip6addr = (*state)->src_node->addr.v6; - break; -#endif /* INET6 */ - } - - pfr_insert_kentry((*state)->rule.ptr->overload_tbl, &p, time_second); - - if ((*state)->rule.ptr->flush == 0) - return (1); - - /* Schedule flushing task. */ - pffe = malloc(sizeof(*pffe), M_PFTEMP, M_NOWAIT); - if (pffe == NULL) + /* Schedule overloading and flushing task. */ + pfoe = malloc(sizeof(*pfoe), M_PFTEMP, M_NOWAIT); + if (pfoe == NULL) return (1); /* too bad :( */ - bcopy(&(*state)->src_node->addr, &pffe->addr, sizeof(pffe->addr)); - pffe->af = (*state)->key[PF_SK_WIRE]->af; - pffe->dir = (*state)->direction; - if ((*state)->rule.ptr->flush & PF_FLUSH_GLOBAL) - pffe->rule = NULL; - else - pffe->rule = (*state)->rule.ptr; - PF_FLUSHQ_LOCK(); - SLIST_INSERT_HEAD(&V_pf_flushqueue, pffe, next); - PF_FLUSHQ_UNLOCK(); - taskqueue_enqueue(taskqueue_swi, &V_pf_flushtask); + bcopy(&(*state)->src_node->addr, &pfoe->addr, sizeof(pfoe->addr)); + pfoe->af = (*state)->key[PF_SK_WIRE]->af; + pfoe->rule = (*state)->rule.ptr; + pfoe->dir = (*state)->direction; + PF_OVERLOADQ_LOCK(); + SLIST_INSERT_HEAD(&V_pf_overloadqueue, pfoe, next); + PF_OVERLOADQ_UNLOCK(); + taskqueue_enqueue(taskqueue_swi, &V_pf_overloadtask); return (1); } static void -pf_flush_task(void *c, int pending) +pf_overload_task(void *c, int pending) { - struct pf_flush_head queue; - struct pf_flush_entry *pffe, *pffe1; + struct pf_overload_head queue; + struct pfr_addr p; + struct pf_overload_entry *pfoe, *pfoe1; uint32_t killed = 0; - PF_FLUSHQ_LOCK(); - queue = *(struct pf_flush_head *)c; - SLIST_INIT((struct pf_flush_head *)c); - PF_FLUSHQ_UNLOCK(); + PF_OVERLOADQ_LOCK(); + queue = *(struct pf_overload_head *)c; + SLIST_INIT((struct pf_overload_head *)c); + PF_OVERLOADQ_UNLOCK(); + + bzero(&p, sizeof(p)); + SLIST_FOREACH(pfoe, &queue, next) { + V_pf_status.lcounters[LCNT_OVERLOAD_TABLE]++; + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("%s: blocking address ", __func__); + pf_print_host(&pfoe->addr, 0, pfoe->af); + printf("\n"); + } + + p.pfra_af = pfoe->af; + switch (pfoe->af) { +#ifdef INET + case AF_INET: + p.pfra_net = 32; + p.pfra_ip4addr = pfoe->addr.v4; + break; +#endif +#ifdef INET6 + case AF_INET6: + p.pfra_net = 128; + p.pfra_ip6addr = pfoe->addr.v6; + break; +#endif + } + + PF_RULES_WLOCK(); + pfr_insert_kentry(pfoe->rule->overload_tbl, &p, time_second); + PF_RULES_WUNLOCK(); + } + + /* + * Remove those entries, that don't need flushing. + */ + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + if (pfoe->rule->flush == 0) { + SLIST_REMOVE(&queue, pfoe, pf_overload_entry, next); + free(pfoe, M_PFTEMP); + } else + V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; - V_pf_status.lcounters[LCNT_OVERLOAD_FLUSH]++; + /* If nothing to flush, return. */ + if (SLIST_EMPTY(&queue)) + return; for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; @@ -566,13 +575,14 @@ pf_flush_task(void *c, int pending) PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) { sk = s->key[PF_SK_WIRE]; - SLIST_FOREACH(pffe, &queue, next) - if (sk->af == pffe->af && (pffe->rule == NULL || - pffe->rule == s->rule.ptr) && - ((pffe->dir == PF_OUT && - PF_AEQ(&pffe->addr, &sk->addr[1], sk->af)) || - (pffe->dir == PF_IN && - PF_AEQ(&pffe->addr, &sk->addr[0], sk->af)))) { + SLIST_FOREACH(pfoe, &queue, next) + if (sk->af == pfoe->af && + ((pfoe->rule->flush & PF_FLUSH_GLOBAL) || + pfoe->rule == s->rule.ptr) && + ((pfoe->dir == PF_OUT && + PF_AEQ(&pfoe->addr, &sk->addr[1], sk->af)) || + (pfoe->dir == PF_IN && + PF_AEQ(&pfoe->addr, &sk->addr[0], sk->af)))) { s->timeout = PFTM_PURGE; s->src.state = s->dst.state = TCPS_CLOSED; killed++; @@ -580,8 +590,8 @@ pf_flush_task(void *c, int pending) } PF_HASHROW_UNLOCK(ih); } - SLIST_FOREACH_SAFE(pffe, &queue, next, pffe1) - free(pffe, M_PFTEMP); + SLIST_FOREACH_SAFE(pfoe, &queue, next, pfoe1) + free(pfoe, M_PFTEMP); if (V_pf_status.debug >= PF_DEBUG_MISC) printf("%s: %u states killed", __func__, killed); } @@ -742,12 +752,13 @@ pf_initialize() sizeof(struct pf_mtag), NULL, NULL, pf_mtag_init, NULL, UMA_ALIGN_PTR, 0); - /* Send & flush queues. */ + /* Send & overload+flush queues. */ STAILQ_INIT(&V_pf_sendqueue); - SLIST_INIT(&V_pf_flushqueue); - TASK_INIT(&V_pf_flushtask, 0, pf_flush_task, &V_pf_flushqueue); + SLIST_INIT(&V_pf_overloadqueue); + TASK_INIT(&V_pf_overloadtask, 0, pf_overload_task, &V_pf_overloadqueue); mtx_init(&pf_sendqueue_mtx, "pf send queue", NULL, MTX_DEF); - mtx_init(&pf_flushqueue_mtx, "pf flush queue", NULL, MTX_DEF); + mtx_init(&pf_overloadqueue_mtx, "pf overload/flush queue", NULL, + MTX_DEF); /* Unlinked, but may be referenced rules. */ TAILQ_INIT(&V_pf_unlinked_rules); @@ -788,7 +799,7 @@ pf_cleanup() } mtx_destroy(&pf_sendqueue_mtx); - mtx_destroy(&pf_flushqueue_mtx); + mtx_destroy(&pf_overloadqueue_mtx); mtx_destroy(&pf_unlnkdrules_mtx); uma_zdestroy(V_pf_mtag_z); @@ -1579,6 +1590,19 @@ pf_purge_unlinked_rules() struct pf_rule *r, *r1; /* + * If we have overloading task pending, then we'd + * better skip purging this time. There is a tiny + * probability that overloading task references + * an already unlinked rule. + */ + PF_OVERLOADQ_LOCK(); + if (!SLIST_EMPTY(&V_pf_overloadqueue)) { + PF_OVERLOADQ_UNLOCK(); + return; + } + PF_OVERLOADQ_UNLOCK(); + + /* * Do naive mark-and-sweep garbage collecting of old rules. * Reference flag is raised by pf_purge_expired_states() * and pf_purge_expired_src_nodes(). Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:04:48 2012 (r240810) +++ head/sys/netpfil/pf/pf_table.c Sat Sep 22 10:14:47 2012 (r240811) @@ -742,6 +742,8 @@ pfr_lookup_addr(struct pfr_ktable *kt, s struct radix_node_head *head = NULL; struct pfr_kentry *ke; + PF_RULES_ASSERT(); + bzero(&sa, sizeof(sa)); if (ad->pfra_af == AF_INET) { FILLIN_SIN(sa.sin, ad->pfra_ip4addr); @@ -929,6 +931,8 @@ pfr_route_kentry(struct pfr_ktable *kt, struct radix_node *rn; struct radix_node_head *head = NULL; + PF_RULES_WASSERT(); + bzero(ke->pfrke_node, sizeof(ke->pfrke_node)); if (ke->pfrke_af == AF_INET) head = kt->pfrkt_ip4; From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:17:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CFD20106564A; Sat, 22 Sep 2012 12:17:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4108FC15; Sat, 22 Sep 2012 12:17:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCH9ob064473; Sat, 22 Sep 2012 12:17:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCH9Ip064471; Sat, 22 Sep 2012 12:17:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201209221217.q8MCH9Ip064471@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 22 Sep 2012 12:17: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: r240813 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:17:09 -0000 Author: kib Date: Sat Sep 22 12:17:09 2012 New Revision: 240813 URL: http://svn.freebsd.org/changeset/base/240813 Log: Do not skip two elements of the tid_buffer when reusing the buffer slot. This eventually results in exhaustion of the tid space, causing new threads get tid -1 as identifier. The bad effect of having the thread id equal to -1 is that UMTX_OP_UMUTEX_WAIT returns EFAULT for a lock owned by such thread, because casuword cannot distinguish between literal value -1 read from the address and -1 returned as an indication of faulted access. _thr_umutex_lock() helper from libthr does not check for errors from _umtx_op_err(2), causing an infinite loop in mutex_lock_sleep(). We observed the JVM processes hanging and consuming enormous amount of system time on machines with approximately 100 days uptime. Reported by: Mykola Dzham MFC after: 1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Sep 22 12:12:39 2012 (r240812) +++ head/sys/kern/kern_thread.c Sat Sep 22 12:17:09 2012 (r240813) @@ -116,7 +116,7 @@ tid_free(lwpid_t tid) mtx_lock(&tid_lock); if ((tid_tail + 1) % TID_BUFFER_SIZE == tid_head) { tmp_tid = tid_buffer[tid_head++]; - tid_head = (tid_head + 1) % TID_BUFFER_SIZE; + tid_head %= TID_BUFFER_SIZE; } tid_buffer[tid_tail++] = tid; tid_tail %= TID_BUFFER_SIZE; From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:40:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBED71065680; Sat, 22 Sep 2012 12:40:00 +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 9846A8FC16; Sat, 22 Sep 2012 12:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCe0Yv067644; Sat, 22 Sep 2012 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCe059067641; Sat, 22 Sep 2012 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209221240.q8MCe059067641@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 22 Sep 2012 12:40: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: r240820 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:40:01 -0000 Author: jilles Date: Sat Sep 22 12:40:00 2012 New Revision: 240820 URL: http://svn.freebsd.org/changeset/base/240820 Log: kdump: Pretty-print signal codes. MFC after: 1 week Modified: head/usr.bin/kdump/kdump.c head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Sep 22 12:38:19 2012 (r240819) +++ head/usr.bin/kdump/kdump.c Sat Sep 22 12:40:00 2012 (r240820) @@ -1242,11 +1242,15 @@ ktrpsig(struct ktr_psig *psig) printf("SIG%s ", signames[psig->signo]); else printf("SIG %d ", psig->signo); - if (psig->action == SIG_DFL) - printf("SIG_DFL code=0x%x\n", psig->code); - else { - printf("caught handler=0x%lx mask=0x%x code=0x%x\n", - (u_long)psig->action, psig->mask.__bits[0], psig->code); + if (psig->action == SIG_DFL) { + printf("SIG_DFL code="); + sigcodename(psig->signo, psig->code); + putchar('\n'); + } else { + printf("caught handler=0x%lx mask=0x%x code=", + (u_long)psig->action, psig->mask.__bits[0]); + sigcodename(psig->signo, psig->code); + putchar('\n'); } } Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Sat Sep 22 12:38:19 2012 (r240819) +++ head/usr.bin/kdump/mksubr Sat Sep 22 12:40:00 2012 (r240820) @@ -388,7 +388,13 @@ auto_switch_type "schedpolicyname" " auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h" auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h" +auto_switch_type "sigbuscodename" "BUS_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigchldcodename" "CLD_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigfpecodename" "FPE_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigillcodename" "ILL_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigsegvcodename" "SEGV_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" +auto_switch_type "sigtrapcodename" "TRAP_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h" auto_if_type "sockdomainname" "PF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" auto_if_type "sockfamilyname" "AF_[[:alnum:]]+[[:space:]]+" "sys/socket.h" auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h" @@ -501,4 +507,46 @@ cat <<_EOF_ printf(">"); } +/* + * AUTO - Special + * + * Check general codes first, then defer to signal-specific codes. + */ +void +sigcodename(int sig, int code) +{ + switch (code) { _EOF_ +egrep "^#[[:space:]]*define[[:space:]]+SI_[A-Z]+[[:space:]]+0(x[0-9abcdef]+)?[[:space:]]*" \ + $include_dir/sys/signal.h | grep -v SI_UNDEFINED | \ + awk '{ for (i = 1; i <= NF; i++) \ + if ($i ~ /define/) \ + break; \ + ++i; \ + printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }' +cat <<_EOF_ + default: + switch (sig) { + case SIGILL: + sigillcodename(code); + break; + case SIGBUS: + sigbuscodename(code); + break; + case SIGSEGV: + sigsegvcodename(code); + break; + case SIGFPE: + sigfpecodename(code); + break; + case SIGTRAP: + sigtrapcodename(code); + break; + case SIGCHLD: + sigchldcodename(code); + break; + default: + printf("", code); + } + } +} From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:41:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F1421065672; Sat, 22 Sep 2012 12:41:50 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D17688FC14; Sat, 22 Sep 2012 12:41:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCfn87067939; Sat, 22 Sep 2012 12:41:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCfnhJ067937; Sat, 22 Sep 2012 12:41:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221241.q8MCfnhJ067937@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 12:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240822 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 12:41:50 -0000 Author: pjd Date: Sat Sep 22 12:41:49 2012 New Revision: 240822 URL: http://svn.freebsd.org/changeset/base/240822 Log: Use the topology lock to protect list of providers while withering them. It is possible that provider is destroyed while we are iterating over the list. Reported by: Brian Parkison Discussed with: phk MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Sep 22 12:40:52 2012 (r240821) +++ head/sys/geom/geom_disk.c Sat Sep 22 12:41:49 2012 (r240822) @@ -635,10 +635,13 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; + g_topology_lock(); gp = dp->d_geom; - if (gp != NULL) + if (gp != NULL) { LIST_FOREACH(pp, &gp->provider, provider) g_wither_provider(pp, ENXIO); + } + g_topology_unlock(); } void From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:42:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A0D106564A; Sat, 22 Sep 2012 12:42:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0409D8FC12; Sat, 22 Sep 2012 12:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCgpxU068112; Sat, 22 Sep 2012 12:42:51 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCgpGp068110; Sat, 22 Sep 2012 12:42:51 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221242.q8MCgpGp068110@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 12:42: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: r240823 - head/sbin/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 12:42:52 -0000 Author: pjd Date: Sat Sep 22 12:42:51 2012 New Revision: 240823 URL: http://svn.freebsd.org/changeset/base/240823 Log: Use O_CLOEXEC for open instead of separate fcntl(2) call. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Sat Sep 22 12:41:49 2012 (r240822) +++ head/sbin/devd/devd.cc Sat Sep 22 12:42:51 2012 (r240823) @@ -855,11 +855,9 @@ event_loop(void) timeval tv; fd_set fds; - fd = open(PATH_DEVCTL, O_RDONLY); + fd = open(PATH_DEVCTL, O_RDONLY | O_CLOEXEC); if (fd == -1) err(1, "Can't open devctl device %s", PATH_DEVCTL); - if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) - err(1, "Can't set close-on-exec flag on devctl"); server_fd = create_socket(PIPE); max_fd = max(fd, server_fd) + 1; while (1) { From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:49:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A283106566C; Sat, 22 Sep 2012 12:49:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F006D8FC14; Sat, 22 Sep 2012 12:49:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCnaCC069163; Sat, 22 Sep 2012 12:49:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCna84069158; Sat, 22 Sep 2012 12:49:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221249.q8MCna84069158@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 12:49: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: r240824 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 12:49:37 -0000 Author: glebius Date: Sat Sep 22 12:49:36 2012 New Revision: 240824 URL: http://svn.freebsd.org/changeset/base/240824 Log: Convert more M_WAITOK malloc() to M_NOWAIT. Reported by: Kim Culhan Modified: head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_red.c head/sys/contrib/altq/altq/altq_rio.c Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_priq.c Sat Sep 22 12:49:36 2012 (r240824) @@ -362,8 +362,9 @@ priq_class_create(struct priq_if *pif, i if (flags & PRCF_RIO) { cl->cl_red = (red_t *)rio_alloc(0, NULL, red_flags, red_pkttime); - if (cl->cl_red != NULL) - qtype(cl->cl_q) = Q_RIO; + if (cl->cl_red == NULL) + goto err_ret; + qtype(cl->cl_q) = Q_RIO; } else #endif if (flags & PRCF_RED) { @@ -371,8 +372,9 @@ priq_class_create(struct priq_if *pif, i qlimit(cl->cl_q) * 10/100, qlimit(cl->cl_q) * 30/100, red_flags, red_pkttime); - if (cl->cl_red != NULL) - qtype(cl->cl_q) = Q_RED; + if (cl->cl_red == NULL) + goto err_ret; + qtype(cl->cl_q) = Q_RED; } } #endif /* ALTQ_RED */ Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 12:49:36 2012 (r240824) @@ -231,10 +231,9 @@ red_alloc(int weight, int inv_pmax, int int w, i; int npkts_per_sec; - rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(red_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (rp == NULL) return (NULL); - bzero(rp, sizeof(red_t)); rp->red_avg = 0; rp->red_idle = 1; Modified: head/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Sat Sep 22 12:42:51 2012 (r240823) +++ head/sys/contrib/altq/altq/altq_rio.c Sat Sep 22 12:49:36 2012 (r240824) @@ -204,10 +204,9 @@ rio_alloc(int weight, struct redparams * int w, i; int npkts_per_sec; - rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(rio_t), M_DEVBUF, M_NOWAIT | M_ZERO); if (rp == NULL) return (NULL); - bzero(rp, sizeof(rio_t)); rp->rio_flags = flags; if (pkttime == 0) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 12:52:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 282F11065670; Sat, 22 Sep 2012 12:52:42 +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 13DF88FC0A; Sat, 22 Sep 2012 12:52:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MCqfnA069586; Sat, 22 Sep 2012 12:52:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MCqftL069584; Sat, 22 Sep 2012 12:52:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201209221252.q8MCqftL069584@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 22 Sep 2012 12:52: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: r240825 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 12:52:42 -0000 Author: jilles Date: Sat Sep 22 12:52:41 2012 New Revision: 240825 URL: http://svn.freebsd.org/changeset/base/240825 Log: sh: Add some tests for aliasing a utility to itself. Added: head/tools/regression/bin/sh/parser/alias7.0 (contents, props changed) head/tools/regression/bin/sh/parser/alias8.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/alias7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias7.0 Sat Sep 22 12:52:41 2012 (r240825) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +alias echo='echo a' +[ "`eval echo b`" = "a b" ] Added: head/tools/regression/bin/sh/parser/alias8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/alias8.0 Sat Sep 22 12:52:41 2012 (r240825) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +alias echo='echo' +[ "`eval echo b`" = b ] From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 14:39:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2F7106566B; Sat, 22 Sep 2012 14:39:21 +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 8AD4C8FC0C; Sat, 22 Sep 2012 14:39:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MEdLe9084342; Sat, 22 Sep 2012 14:39:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MEdLPg084339; Sat, 22 Sep 2012 14:39:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209221439.q8MEdLPg084339@svn.freebsd.org> From: Michael Tuexen Date: Sat, 22 Sep 2012 14:39: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: r240826 - 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, 22 Sep 2012 14:39:21 -0000 Author: tuexen Date: Sat Sep 22 14:39:20 2012 New Revision: 240826 URL: http://svn.freebsd.org/changeset/base/240826 Log: Small cleanups. No functional change. MFC after: 10 days Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Sep 22 12:52:41 2012 (r240825) +++ head/sys/netinet/sctp_output.c Sat Sep 22 14:39:20 2012 (r240826) @@ -11394,11 +11394,11 @@ sctp_send_cwr(struct sctp_tcb *stcb, str struct sctp_cwr_chunk *cwr; struct sctp_tmit_chunk *chk; - asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); if (net == NULL) { return; } + asoc = &stcb->asoc; TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { /* @@ -11453,13 +11453,11 @@ sctp_add_stream_reset_out(struct sctp_tm int number_entries, uint16_t * list, uint32_t seq, uint32_t resp_seq, uint32_t last_sent) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_out_request *req_out; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11493,19 +11491,16 @@ sctp_add_stream_reset_out(struct sctp_tm return; } - -void +static void sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, int number_entries, uint16_t * list, uint32_t seq) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_in_request *req_in; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11537,18 +11532,15 @@ sctp_add_stream_reset_in(struct sctp_tmi return; } - -void +static void sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, uint32_t seq) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_tsn_request *req_tsn; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11572,13 +11564,11 @@ void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11597,22 +11587,18 @@ sctp_add_stream_reset_result(struct sctp chk->send_size = SCTP_SIZE32(chk->book_size); SCTP_BUF_LEN(chk->data) = chk->send_size; return; - } - void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response_tsn *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11640,7 +11626,7 @@ sctp_add_an_out_stream(struct sctp_tmit_ uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11673,7 +11659,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11700,8 +11686,6 @@ sctp_add_an_in_stream(struct sctp_tmit_c return; } - - int sctp_send_str_reset_req(struct sctp_tcb *stcb, int number_entries, uint16_t * list, @@ -11710,8 +11694,7 @@ sctp_send_str_reset_req(struct sctp_tcb uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, - uint16_t adding_i, uint8_t peer_asked -) + uint16_t adding_i, uint8_t peer_asked) { struct sctp_association *asoc; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Sep 22 12:52:41 2012 (r240825) +++ head/sys/netinet/sctp_output.h Sat Sep 22 14:39:20 2012 (r240826) @@ -173,37 +173,19 @@ void sctp_send_cwr(struct sctp_tcb *, st void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq, uint32_t resp_seq, uint32_t last_sent); +sctp_add_stream_reset_out(struct sctp_tmit_chunk *, + int, uint16_t *, uint32_t, uint32_t, uint32_t); void -sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq); + sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); void -sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, - uint32_t seq); - -void -sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result); - -void -sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result, - uint32_t send_una, uint32_t recv_next); +sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, + uint32_t, uint32_t, uint32_t, uint32_t); int -sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, - uint8_t send_out_req, - uint8_t send_in_req, - uint8_t send_tsn_req, - uint8_t add_stream, - uint16_t adding_o, - uint16_t adding_i, uint8_t from_peer); +sctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, + uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 15:19:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0271065674; Sat, 22 Sep 2012 15:19:11 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88EF78FC25; Sat, 22 Sep 2012 15:19:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MFJBXQ089694; Sat, 22 Sep 2012 15:19:11 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MFJBNu089692; Sat, 22 Sep 2012 15:19:11 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209221519.q8MFJBNu089692@svn.freebsd.org> From: Steve Kargl Date: Sat, 22 Sep 2012 15:19: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: r240827 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 15:19:11 -0000 Author: kargl Date: Sat Sep 22 15:19:11 2012 New Revision: 240827 URL: http://svn.freebsd.org/changeset/base/240827 Log: * Make STRICT_ALIGN() work for doubles as well as for floats. This only affects i386. The double case was intentionally left broken as an optimization, but we are getting closer to supporting applications and/or kernels that change the (FreeBSD i386) default rounding precision from FP_PD to FP_PE and never change it back, and this requires the STRICT_ALIGN()s that were added to support FP_PE to actually work in all precisions. * Remove an extraneous semicolon at the end of a macro that was supposed to be function-like. Submitted by: bde Approved by: das (mentor) Modified: head/lib/msun/src/math_private.h Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sat Sep 22 14:39:20 2012 (r240826) +++ head/lib/msun/src/math_private.h Sat Sep 22 15:19:11 2012 (r240827) @@ -224,7 +224,7 @@ do { \ #define STRICT_ASSIGN(type, lval, rval) do { \ volatile type __lval; \ \ - if (sizeof(type) >= sizeof(double)) \ + if (sizeof(type) >= sizeof(long double)) \ (lval) = (rval); \ else { \ __lval = (rval); \ @@ -241,7 +241,7 @@ do { \ fp_prec_t __oprec; \ \ if ((__oprec = fpgetprec()) != FP_PE) \ - fpsetprec(FP_PE); + fpsetprec(FP_PE) #define RETURNI(x) do { \ __retval = (x); \ if (__oprec != FP_PE) \ From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 15:38:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D765C106566B; Sat, 22 Sep 2012 15:38:30 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A98DD8FC0C; Sat, 22 Sep 2012 15:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MFcUe2092627; Sat, 22 Sep 2012 15:38:30 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MFcUwM092623; Sat, 22 Sep 2012 15:38:30 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201209221538.q8MFcUwM092623@svn.freebsd.org> From: Steve Kargl Date: Sat, 22 Sep 2012 15:38: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: r240828 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 15:38:31 -0000 Author: kargl Date: Sat Sep 22 15:38:29 2012 New Revision: 240828 URL: http://svn.freebsd.org/changeset/base/240828 Log: * Use ENTERI() and RETURNI() to toggle the rounding precision if necessary, so that cosl(), sinl() and tanl() work on i386 even for naive callers. Suggested by: bde Reviewed by: bde Approved by: das (mentor) Modified: head/lib/msun/src/s_cosl.c head/lib/msun/src/s_sinl.c head/lib/msun/src/s_tanl.c Modified: head/lib/msun/src/s_cosl.c ============================================================================== --- head/lib/msun/src/s_cosl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_cosl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); */ #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -63,9 +66,11 @@ cosl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) - return (__kernel_cosl(z.e, 0)); + RETURNI(__kernel_cosl(z.e, 0)); e0 = __ieee754_rem_pio2l(x, y); hi = y[0]; @@ -86,5 +91,5 @@ cosl(long double x) break; } - return (hi); + RETURNI(hi); } Modified: head/lib/msun/src/s_sinl.c ============================================================================== --- head/lib/msun/src/s_sinl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_sinl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD$"); #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -59,10 +62,12 @@ sinl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) { hi = __kernel_sinl(z.e, 0, 0); - return (s ? -hi : hi); + RETURNI(s ? -hi : hi); } e0 = __ieee754_rem_pio2l(x, y); @@ -84,5 +89,5 @@ sinl(long double x) break; } - return (hi); + RETURNI(hi); } Modified: head/lib/msun/src/s_tanl.c ============================================================================== --- head/lib/msun/src/s_tanl.c Sat Sep 22 15:19:11 2012 (r240827) +++ head/lib/msun/src/s_tanl.c Sat Sep 22 15:38:29 2012 (r240828) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); */ #include +#ifdef __i386__ +#include +#endif #include "math.h" #include "math_private.h" @@ -65,10 +68,12 @@ tanl(long double x) if (z.bits.exp == 32767) return ((x - x) / (x - x)); + ENTERI(); + /* Optimize the case where x is already within range. */ if (z.e < M_PI_4) { hi = __kernel_tanl(z.e, 0, 0); - return (s ? -hi : hi); + RETURNI(s ? -hi : hi); } e0 = __ieee754_rem_pio2l(x, y); @@ -86,5 +91,5 @@ tanl(long double x) break; } - return (hi); + RETURNI(hi); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:32:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0DE9106566C; Sat, 22 Sep 2012 17:32:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC1628FC15; Sat, 22 Sep 2012 17:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHWeMm009505; Sat, 22 Sep 2012 17:32:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHWecd009503; Sat, 22 Sep 2012 17:32:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221732.q8MHWecd009503@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:32: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: r240829 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:32:40 -0000 Author: pjd Date: Sat Sep 22 17:32:40 2012 New Revision: 240829 URL: http://svn.freebsd.org/changeset/base/240829 Log: As in r226967, r226987 and r232401 changes to UFS and TMPFS remove cache entries associated with the source and the target of rename(). MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 22 15:38:29 2012 (r240828) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Sep 22 17:32:40 2012 (r240829) @@ -3931,6 +3931,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:41:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF2B41065670; Sat, 22 Sep 2012 17:41:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B0448FC08; Sat, 22 Sep 2012 17:41:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHfuSX011071; Sat, 22 Sep 2012 17:41:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHfuoZ011069; Sat, 22 Sep 2012 17:41:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221741.q8MHfuoZ011069@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:41: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: r240830 - head/sys/contrib/rdma X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 17:41:56 -0000 Author: pjd Date: Sat Sep 22 17:41:56 2012 New Revision: 240830 URL: http://svn.freebsd.org/changeset/base/240830 Log: Fix an obvious typo. Modified: head/sys/contrib/rdma/rdma_addr.c Modified: head/sys/contrib/rdma/rdma_addr.c ============================================================================== --- head/sys/contrib/rdma/rdma_addr.c Sat Sep 22 17:32:40 2012 (r240829) +++ head/sys/contrib/rdma/rdma_addr.c Sat Sep 22 17:41:56 2012 (r240830) @@ -173,7 +173,7 @@ static void addr_send_arp(struct sockadd *dst = *dst_in; rtalloc(&iproute); - if (iproute.ro_rt == NULL); + if (iproute.ro_rt == NULL) return; arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:42:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047FA106567E; Sat, 22 Sep 2012 17:42:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB208FC0A; Sat, 22 Sep 2012 17:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHgs10011232; Sat, 22 Sep 2012 17:42:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHgsAQ011229; Sat, 22 Sep 2012 17:42:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201209221742.q8MHgsAQ011229@svn.freebsd.org> From: Andriy Gapon Date: Sat, 22 Sep 2012 17:42: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: r240831 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 17:42:55 -0000 Author: avg Date: Sat Sep 22 17:42:53 2012 New Revision: 240831 URL: http://svn.freebsd.org/changeset/base/240831 Log: zfs: allow a zvol to be used as a pool vdev, again Do this by checking if spa_namespace_lock is already held and not taking it again in that case. Add a comment explaining why that is done and why it is safe. Reviewed by: pjd MFC after: 24 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 22 17:41:56 2012 (r240830) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Sep 22 17:42:53 2012 (r240831) @@ -878,27 +878,36 @@ zvol_open(struct g_provider *pp, int fla { zvol_state_t *zv; int err = 0; + boolean_t locked = B_FALSE; - if (MUTEX_HELD(&spa_namespace_lock)) { - /* - * If the spa_namespace_lock is being held, it means that ZFS - * is trying to open ZVOL as its VDEV. This is not supported. - */ - return (EOPNOTSUPP); + /* + * Protect against recursively entering spa_namespace_lock + * when spa_open() is used for a pool on a (local) ZVOL(s). + * This is needed since we replaced upstream zfsdev_state_lock + * with spa_namespace_lock in the ZVOL code. + * We are using the same trick as spa_open(). + * Note that calls in zvol_first_open which need to resolve + * pool name to a spa object will enter spa_open() + * recursively, but that function already has all the + * necessary protection. + */ + if (!MUTEX_HELD(&spa_namespace_lock)) { + mutex_enter(&spa_namespace_lock); + locked = B_TRUE; } - mutex_enter(&spa_namespace_lock); - zv = pp->private; if (zv == NULL) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (ENXIO); } if (zv->zv_total_opens == 0) err = zvol_first_open(zv); if (err) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); } if ((flag & FWRITE) && (zv->zv_flags & ZVOL_RDONLY)) { @@ -920,13 +929,15 @@ zvol_open(struct g_provider *pp, int fla #endif zv->zv_total_opens += count; - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); out: if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (err); } @@ -936,12 +947,18 @@ zvol_close(struct g_provider *pp, int fl { zvol_state_t *zv; int error = 0; + boolean_t locked = B_FALSE; - mutex_enter(&spa_namespace_lock); + /* See comment in zvol_open(). */ + if (!MUTEX_HELD(&spa_namespace_lock)) { + mutex_enter(&spa_namespace_lock); + locked = B_TRUE; + } zv = pp->private; if (zv == NULL) { - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (ENXIO); } @@ -964,7 +981,8 @@ zvol_close(struct g_provider *pp, int fl if (zv->zv_total_opens == 0) zvol_last_close(zv); - mutex_exit(&spa_namespace_lock); + if (locked) + mutex_exit(&spa_namespace_lock); return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:46:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32DE0106566B; Sat, 22 Sep 2012 17:46:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FD5A8FC08; Sat, 22 Sep 2012 17:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHkrAe011730; Sat, 22 Sep 2012 17:46:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHkrCh011728; Sat, 22 Sep 2012 17:46:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221746.q8MHkrCh011728@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:46: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: r240832 - 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, 22 Sep 2012 17:46:54 -0000 Author: pjd Date: Sat Sep 22 17:46:53 2012 New Revision: 240832 URL: http://svn.freebsd.org/changeset/base/240832 Log: Make the example a bit more pretty. Modified: head/share/man/man4/ip6.4 Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sat Sep 22 17:42:53 2012 (r240831) +++ head/share/man/man4/ip6.4 Sat Sep 22 17:46:53 2012 (r240832) @@ -570,7 +570,8 @@ struct iovec iov[2]; u_char buf[BUFSIZ]; struct cmsghdr *cm; struct msghdr m; -int found, optval; +int optval; +bool found; u_char data[2048]; /* Create socket. */ @@ -597,8 +598,8 @@ if (setsockopt(s, IPPROTO_IPV6, IPV6_HOP sizeof(optval)) == -1) err(1, "setsockopt"); -found = 0; -while (!found) { +found = false; +do { if (recvmsg(s, &m, 0) == -1) err(1, "recvmsg"); for (cm = CMSG_FIRSTHDR(&m); cm != NULL; @@ -606,13 +607,13 @@ while (!found) { if (cm->cmsg_level == IPPROTO_IPV6 && cm->cmsg_type == IPV6_HOPLIMIT && cm->cmsg_len == CMSG_LEN(sizeof(int))) { - found = 1; + found = true; (void)printf("hop limit: %d\en", *(int *)CMSG_DATA(cm)); break; } } -} +} while (!found); .Ed .Sh DIAGNOSTICS A socket operation may fail with one of the following errors returned: From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:47:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F7D1065672; Sat, 22 Sep 2012 17:47:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F448FC12; Sat, 22 Sep 2012 17:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHlcsY011852; Sat, 22 Sep 2012 17:47:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHlcsq011850; Sat, 22 Sep 2012 17:47:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221747.q8MHlcsq011850@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:47: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: r240833 - 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: Sat, 22 Sep 2012 17:47:38 -0000 Author: pjd Date: Sat Sep 22 17:47:37 2012 New Revision: 240833 URL: http://svn.freebsd.org/changeset/base/240833 Log: Add libsbuf. Modified: head/contrib/groff/tmac/doc-syms Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Sat Sep 22 17:46:53 2012 (r240832) +++ head/contrib/groff/tmac/doc-syms Sat Sep 22 17:47:37 2012 (r240833) @@ -812,6 +812,7 @@ .ds doc-str-Lb-librpcsec_gss RPC GSS-API Authentication Library (librpcsec_gss, \-lrpcsec_gss) .ds doc-str-Lb-librpcsvc RPC Service Library (librpcsvc, \-lrpcsvc) .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) +.ds doc-str-Lb-libsbuf Safe String Composition Library (libsbuf, \-lsbuf) .ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) .ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) .ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 17:49:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C088106566B; Sat, 22 Sep 2012 17:49:26 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480A68FC21; Sat, 22 Sep 2012 17:49:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MHnQjK012105; Sat, 22 Sep 2012 17:49:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MHnQgx012102; Sat, 22 Sep 2012 17:49:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201209221749.q8MHnQgx012102@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 22 Sep 2012 17:49: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: r240834 - 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: Sat, 22 Sep 2012 17:49:26 -0000 Author: pjd Date: Sat Sep 22 17:49:25 2012 New Revision: 240834 URL: http://svn.freebsd.org/changeset/base/240834 Log: Add rounddown2() macro similar to the roundup2() macro. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Sep 22 17:47:37 2012 (r240833) +++ head/sys/sys/param.h Sat Sep 22 17:49:25 2012 (r240834) @@ -275,6 +275,7 @@ #endif #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define rounddown(x, y) (((x)/(y))*(y)) +#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 18:47:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE0B106566C; Sat, 22 Sep 2012 18:47:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF3BD8FC1D; Sat, 22 Sep 2012 18:47:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MIlEOY019459; Sat, 22 Sep 2012 18:47:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MIlEwo019457; Sat, 22 Sep 2012 18:47:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221847.q8MIlEwo019457@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 18:47: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: r240835 - head/sys/contrib/altq/altq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 18:47:15 -0000 Author: glebius Date: Sat Sep 22 18:47:14 2012 New Revision: 240835 URL: http://svn.freebsd.org/changeset/base/240835 Log: Use M_NOWAIT in wtab_alloc(), too. Convert panic() to a soft failure here. wtab_alloc() is used by red_alloc(), which can fail. Reported by: Kim Culhan Modified: head/sys/contrib/altq/altq/altq_red.c Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 17:49:25 2012 (r240834) +++ head/sys/contrib/altq/altq/altq_red.c Sat Sep 22 18:47:14 2012 (r240835) @@ -235,6 +235,13 @@ red_alloc(int weight, int inv_pmax, int if (rp == NULL) return (NULL); + /* allocate weight table */ + rp->red_wtab = wtab_alloc(rp->red_weight); + if (rp->red_wtab == NULL) { + free(rp, M_DEVBUF); + return (NULL); + } + rp->red_avg = 0; rp->red_idle = 1; @@ -301,9 +308,6 @@ red_alloc(int weight, int inv_pmax, int rp->red_probd = (2 * (rp->red_thmax - rp->red_thmin) * rp->red_inv_pmax) << FP_SHIFT; - /* allocate weight table */ - rp->red_wtab = wtab_alloc(rp->red_weight); - microtime(&rp->red_last); return (rp); } @@ -638,10 +642,9 @@ wtab_alloc(int weight) return (w); } - w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK); + w = malloc(sizeof(struct wtab), M_DEVBUF, M_NOWAIT | M_ZERO); if (w == NULL) - panic("wtab_alloc: malloc failed!"); - bzero(w, sizeof(struct wtab)); + return (NULL); w->w_weight = weight; w->w_refcount = 1; w->w_next = wtab_list; From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 19:03:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2776A106564A; Sat, 22 Sep 2012 19:03:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13BED8FC12; Sat, 22 Sep 2012 19:03:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MJ3BL6022254; Sat, 22 Sep 2012 19:03:11 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MJ3BuC022250; Sat, 22 Sep 2012 19:03:11 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201209221903.q8MJ3BuC022250@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 22 Sep 2012 19:03: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: r240836 - head/sys/netpfil/pf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 19:03:12 -0000 Author: glebius Date: Sat Sep 22 19:03:11 2012 New Revision: 240836 URL: http://svn.freebsd.org/changeset/base/240836 Log: EBUSY is a better reply for refusing to unload pf(4) or pfsync(4). Submitted by: pluknet Modified: head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Sat Sep 22 18:47:14 2012 (r240835) +++ head/sys/netpfil/pf/if_pfsync.c Sat Sep 22 19:03:11 2012 (r240836) @@ -2371,7 +2371,7 @@ pfsync_modevent(module_t mod, int type, /* * Module should not be unloaded due to race conditions. */ - error = EPERM; + error = EBUSY; break; case MOD_UNLOAD: pfsync_uninit(); Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Sep 22 18:47:14 2012 (r240835) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Sep 22 19:03:11 2012 (r240836) @@ -3756,7 +3756,7 @@ pf_modevent(module_t mod, int type, void /* * Module should not be unloaded due to race conditions. */ - error = EPERM; + error = EBUSY; break; case MOD_UNLOAD: error = pf_unload(); From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 21:26:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33CAE106564A; Sat, 22 Sep 2012 21:26:35 +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 A74848FC08; Sat, 22 Sep 2012 21:26:34 +0000 (UTC) Received: from c122-106-157-84.carlnfd1.nsw.optusnet.com.au (c122-106-157-84.carlnfd1.nsw.optusnet.com.au [122.106.157.84]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q8MLQQl0022051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 07:26:26 +1000 Date: Sun, 23 Sep 2012 07:26:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Steve Kargl In-Reply-To: <201209221519.q8MFJBNu089692@svn.freebsd.org> Message-ID: <20120923072608.J1963@besplex.bde.org> References: <201209221519.q8MFJBNu089692@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: r240827 - head/lib/msun/src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Sep 2012 21:26:35 -0000 On Sat, 22 Sep 2012, Steve Kargl wrote: > Log: > * Make STRICT_ALIGN() work for doubles as well as for floats. This > only affects i386. The double case was intentionally left broken > as an optimization, but we are getting closer to supporting > applications and/or kernels that change the (FreeBSD i386) default > rounding precision from FP_PD to FP_PE and never change it back, > and this requires the STRICT_ALIGN()s that were added to support > FP_PE to actually work in all precisions. > > * Remove an extraneous semicolon at the end of a macro that was > supposed to be function-like. > > Submitted by: bde > Approved by: das (mentor) Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 21:34:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB51B106566B; Sat, 22 Sep 2012 21:34:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D84D8FC15; Sat, 22 Sep 2012 21:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MLYmaE047525; Sat, 22 Sep 2012 21:34:48 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MLYmkK047523; Sat, 22 Sep 2012 21:34:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201209222134.q8MLYmkK047523@svn.freebsd.org> From: Eitan Adler Date: Sat, 22 Sep 2012 21:34: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: r240841 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 21:34:48 -0000 Author: eadler Date: Sat Sep 22 21:34:46 2012 New Revision: 240841 URL: http://svn.freebsd.org/changeset/base/240841 Log: Remove some duplicated advice. While here increase the suggested sizes for the partition as "make universe" takes a lot more space than mentioned. Reviewed by: gavin Approved by: gjb MFC after: 3 days X-MFC-With: r240728 Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Sat Sep 22 21:19:49 2012 (r240840) +++ head/share/man/man7/development.7 Sat Sep 22 21:34:46 2012 (r240841) @@ -48,8 +48,6 @@ kernel. The methods described here are as applicable to production installations as it is to development environments. -You need approximately 10GB of disk space on one machine to make this work -conveniently. .Sh SETTING UP THE ENVIRONMENT ON THE MASTER SERVER Your master server should always run a stable, production version of the .Fx @@ -60,9 +58,9 @@ The last thing you want to do is to run unstable environment on your master server which could lead to a situation where you lose the environment and/or cannot recover from a mistake. .Pp -Create a huge partition called +Create a partition called .Pa /FreeBSD . -Approximately 7GB is recommended. +Approximately 20GB is recommended. This partition will contain nearly all the development environment, including the subversion tree, broken-out source, and possibly even object files. You are going to export this partition to your other machines via a @@ -86,7 +84,7 @@ Third, because it makes it far easier to environments which are described later in this document. I recommend a .Pa /usr/obj -partition of at least 5GB. +partition of at least 12GB. .Pp On the master server, use .Xr svn 1 @@ -456,10 +454,6 @@ This is a good time to also remind you t .Xr svn 1 operations you do will be done as .Dq Li root . -It is a good idea to give your -.Pa /FreeBSD -partition a lot of space (I recommend -10-15GB) precisely for that reason. .Pp .Xr cron 8 . .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 22:04:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAF26106564A; Sat, 22 Sep 2012 22: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 A6BCA8FC18; Sat, 22 Sep 2012 22:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MM4HK4051826; Sat, 22 Sep 2012 22:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MM4HY9051824; Sat, 22 Sep 2012 22:04:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201209222204.q8MM4HY9051824@svn.freebsd.org> From: Michael Tuexen Date: Sat, 22 Sep 2012 22: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: r240842 - 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, 22 Sep 2012 22:04:17 -0000 Author: tuexen Date: Sat Sep 22 22:04:17 2012 New Revision: 240842 URL: http://svn.freebsd.org/changeset/base/240842 Log: Fix a bug related to handling Re-config chunks. It is not true that the association can be removed if the socket is gone. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Sep 22 21:34:46 2012 (r240841) +++ head/sys/netinet/sctp_input.c Sat Sep 22 22:04:17 2012 (r240842) @@ -5387,23 +5387,6 @@ process_control_chunks: *offset = length; return (NULL); } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif - *offset = length; - return (NULL); - } if (stcb->asoc.peer_supports_strreset == 0) { /* * hmm, peer should have announced this, but From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 22:16:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5CD106564A; Sat, 22 Sep 2012 22:16:08 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC5468FC08; Sat, 22 Sep 2012 22:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MMG7ke053951; Sat, 22 Sep 2012 22:16:07 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MMG7w2053948; Sat, 22 Sep 2012 22:16:07 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201209222216.q8MMG7w2053948@svn.freebsd.org> From: Devin Teske Date: Sat, 22 Sep 2012 22:16: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: r240843 - head/usr.sbin/bsdconfig/timezone/share X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 22:16:08 -0000 Author: dteske Date: Sat Sep 22 22:16:07 2012 New Revision: 240843 URL: http://svn.freebsd.org/changeset/base/240843 Log: jilles accurately advises that, in the context of shell redirection, the `:' builtin is processed specially and thus the `: > file' syntax for example will cause premature termination of the current shell on redirection-error. The `true' builtin on the other-hand is not included in this special processing (for compatibility reasons to satisfy legacy scripts programmed for systems where `true' is not a builtin). Change bare `: > file' syntax into `true > file' syntax to prevent premature shell termination in the event of redirection-error. NOTE: Instances of `: > file' that appear within a sub-shell have been left unmodified as these will not cause premature termination of the main script. Reviewed by: jilles, adrian (co-mentor) Approved by: adrian (co-mentor) Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Sep 22 22:04:17 2012 (r240842) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Sat Sep 22 22:16:07 2012 (r240843) @@ -610,7 +610,7 @@ f_install_zoneinfo() # Save knowledge for later if [ "$REALLYDOIT" -a $rv -eq $SUCCESS ]; then - if : 2> /dev/null > "$_PATH_DB"; then + if true 2> /dev/null > "$_PATH_DB"; then cat <<-EOF > "$_PATH_DB" $zoneinfo EOF From owner-svn-src-head@FreeBSD.ORG Sat Sep 22 22:41:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3987106564A; Sat, 22 Sep 2012 22:41:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE3308FC0A; Sat, 22 Sep 2012 22:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8MMfcAv057948; Sat, 22 Sep 2012 22:41:38 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8MMfcFX057941; Sat, 22 Sep 2012 22:41:38 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201209222241.q8MMfcFX057941@svn.freebsd.org> From: Andrew Turner Date: Sat, 22 Sep 2012 22:41: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: r240844 - in head/sys/arm: broadcom/bcm2835 lpc mv tegra ti X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 22 Sep 2012 22:41:38 -0000 Author: andrew Date: Sat Sep 22 22:41:38 2012 New Revision: 240844 URL: http://svn.freebsd.org/changeset/base/240844 Log: Reduce the diff between the FDT implementations of initarm. This only touches whitespace and comments. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -304,6 +304,9 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); @@ -460,9 +463,7 @@ initarm(struct arm_boot_params *abp) cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); - pmap_pa = kernel_l1pt.pv_pa; - setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); @@ -517,7 +518,6 @@ initarm(struct arm_boot_params *abp) init_proc0(kernelstack.pv_va); arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/lpc/lpc_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -306,7 +306,7 @@ initarm(struct arm_boot_params *abp) set_cpufuncs(); kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) + if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; @@ -318,7 +318,6 @@ initarm(struct arm_boot_params *abp) */ if (dtbp == (vm_offset_t)NULL) dtbp = (vm_offset_t)&fdt_static_dtb; - #endif if (OF_install(OFW_FDT, 0) == FALSE) @@ -427,7 +426,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -480,7 +479,7 @@ initarm(struct arm_boot_params *abp) #endif cninit(); - + physmem = memsize / PAGE_SIZE; debugf("initarm: console initialized\n"); @@ -547,6 +546,7 @@ initarm(struct arm_boot_params *abp) /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/mv/mv_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -301,19 +301,18 @@ initarm(struct arm_boot_params *abp) u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; - lastaddr = parse_boot_param(abp); + lastaddr = parse_boot_param(abp); memsize = 0; set_cpufuncs(); /* * Find the dtb passed in by the boot loader. */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; - #if defined(FDT_DTB_STATIC) /* @@ -429,7 +428,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -493,7 +492,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Re-initialise decode windows @@ -554,6 +553,7 @@ initarm(struct arm_boot_params *abp) /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); } Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/tegra/tegra2_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -344,6 +344,9 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); @@ -520,7 +523,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Pages were allocated during the secondary bootstrap for the @@ -553,8 +556,8 @@ initarm(struct arm_boot_params *abp) undefined_init(); init_proc0(kernelstack.pv_va); - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Sep 22 22:16:07 2012 (r240843) +++ head/sys/arm/ti/ti_machdep.c Sat Sep 22 22:41:38 2012 (r240844) @@ -305,13 +305,15 @@ initarm(struct arm_boot_params *abp) memsize = 0; set_cpufuncs(); - + /* + * Find the dtb passed in by the boot loader. + */ kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); else dtbp = (vm_offset_t)NULL; - + #if defined(FDT_DTB_STATIC) /* * In case the device tree blob was not retrieved (from metadata) try @@ -423,7 +425,7 @@ initarm(struct arm_boot_params *abp) &kernel_pt_table[i]); pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - + /* Map kernel code and data */ pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, @@ -480,7 +482,7 @@ initarm(struct arm_boot_params *abp) if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); + err_devmap); /* * Pages were allocated during the secondary bootstrap for the @@ -513,8 +515,8 @@ initarm(struct arm_boot_params *abp) undefined_init(); init_proc0(kernelstack.pv_va); - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va;