svn commit: r228526 - in head/sys: dev/bxe dev/esp dev/twa xen/xenstore
Author: kevlo Date: Thu Dec 15 06:29:13 2011 New Revision: 228526 URL: http://svn.freebsd.org/changeset/base/228526 Log: s/timout/timeout Modified: head/sys/dev/bxe/bxe_reg.h head/sys/dev/esp/ncr53c9x.c head/sys/dev/twa/tw_osl.h head/sys/xen/xenstore/xenstore.c Modified: head/sys/dev/bxe/bxe_reg.h == --- head/sys/dev/bxe/bxe_reg.h Thu Dec 15 06:25:19 2011(r228525) +++ head/sys/dev/bxe/bxe_reg.h Thu Dec 15 06:29:13 2011(r228526) @@ -1594,7 +1594,7 @@ /* * [RW 1] Setting this bit enables a timer in the GRC block to timeout an * access that does not finish within - * ~misc_registers_grc_timout_val.grc_timeout_val cycles. When this bit is + * ~misc_registers_grc_timeout_val.grc_timeout_val cycles. When this bit is * cleared; this timeout is disabled. If this timeout occurs; the GRC shall * assert it attention output. */ Modified: head/sys/dev/esp/ncr53c9x.c == --- head/sys/dev/esp/ncr53c9x.c Thu Dec 15 06:25:19 2011(r228525) +++ head/sys/dev/esp/ncr53c9x.c Thu Dec 15 06:29:13 2011(r228526) @@ -316,7 +316,7 @@ ncr53c9x_attach(struct ncr53c9x_softc *s * The recommended timeout is 250ms. This register is loaded * with a value calculated as follows, from the docs: * -* (timout period) x (CLK frequency) +* (timeout period) x (CLK frequency) * reg = - * 8192 x (Clock Conversion Factor) * Modified: head/sys/dev/twa/tw_osl.h == --- head/sys/dev/twa/tw_osl.h Thu Dec 15 06:25:19 2011(r228525) +++ head/sys/dev/twa/tw_osl.h Thu Dec 15 06:29:13 2011(r228526) @@ -153,7 +153,7 @@ struct twa_softc { struct mtx sim_lock_handle;/* sim lock shared with cam */ struct mtx *sim_lock;/* ptr to sim lock */ - struct callout watchdog_callout[2]; /* For command timout */ + struct callout watchdog_callout[2]; /* For command timeout */ TW_UINT32 watchdog_index; #ifdef TW_OSL_DEBUG Modified: head/sys/xen/xenstore/xenstore.c == --- head/sys/xen/xenstore/xenstore.cThu Dec 15 06:25:19 2011 (r228525) +++ head/sys/xen/xenstore/xenstore.cThu Dec 15 06:29:13 2011 (r228526) @@ -559,7 +559,7 @@ xs_read_store(void *tdata, unsigned len) * when msleep returns. */ error = msleep(xen_store, &xs.ring_lock, PCATCH|PDROP, - "xbread", /*timout*/0); + "xbread", /*timeout*/0); if (error && error != EWOULDBLOCK) return (error); continue; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228525 - head/usr.bin/make
Author: fjoe Date: Thu Dec 15 06:25:19 2011 New Revision: 228525 URL: http://svn.freebsd.org/changeset/base/228525 Log: Revert r228521: sometimes job output is lost (see tools/regression/usr.bin/make/execution/joberr test). openpty(fd + 0, fd + 1,...) version does not have this problem but it sometimes enters an infinite sleep in "ttywait" state in tty_drain() when make(1) closes slave pty. Modified: head/usr.bin/make/Makefile head/usr.bin/make/job.c Modified: head/usr.bin/make/Makefile == --- head/usr.bin/make/Makefile Thu Dec 15 06:12:43 2011(r228524) +++ head/usr.bin/make/Makefile Thu Dec 15 06:25:19 2011(r228525) @@ -7,8 +7,6 @@ CFLAGS+=-I${.CURDIR} SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \ lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \ util.c var.c -DPADD= ${LIBUTIL} -LDADD= -lutil NO_SHARED?=YES Modified: head/usr.bin/make/job.c == --- head/usr.bin/make/job.c Thu Dec 15 06:12:43 2011(r228524) +++ head/usr.bin/make/job.c Thu Dec 15 06:25:19 2011(r228525) @@ -115,7 +115,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1799,13 +1798,8 @@ JobStart(GNode *gn, int flags, Job *prev if (usePipes) { int fd[2]; - if (isatty(1)) { - if (openpty(fd + 1, fd + 0, NULL, NULL, NULL) == -1) - Punt("Cannot open pty: %s", strerror(errno)); - } else { - if (pipe(fd) == -1) - Punt("Cannot create pipe: %s", strerror(errno)); - } + if (pipe(fd) == -1) + Punt("Cannot create pipe: %s", strerror(errno)); job->inPipe = fd[0]; job->outPipe = fd[1]; fcntl(job->inPipe, F_SETFD, 1); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228524 - head/tools/regression/usr.bin/make/execution/joberr
Author: fjoe Date: Thu Dec 15 06:12:43 2011 New Revision: 228524 URL: http://svn.freebsd.org/changeset/base/228524 Log: Fix last-minute typo. Modified: head/tools/regression/usr.bin/make/execution/joberr/Makefile Modified: head/tools/regression/usr.bin/make/execution/joberr/Makefile == --- head/tools/regression/usr.bin/make/execution/joberr/MakefileThu Dec 15 06:01:06 2011(r228523) +++ head/tools/regression/usr.bin/make/execution/joberr/MakefileThu Dec 15 06:12:43 2011(r228524) @@ -1,6 +1,6 @@ # $FreeBSD$ -check-jobherr: +check-joberr: .for _t in 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 @-${MAKE} -f ${MAKEFILE} -j2 do-$@ .endfor ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228523 - head/tools/regression/usr.bin/make/execution/joberr
Author: fjoe Date: Thu Dec 15 06:01:06 2011 New Revision: 228523 URL: http://svn.freebsd.org/changeset/base/228523 Log: Add job error output test. make(1) with openpty() currently fails this test: there's a race condition and error output is sometimes lost. Added: head/tools/regression/usr.bin/make/execution/joberr/ head/tools/regression/usr.bin/make/execution/joberr/Makefile (contents, props changed) head/tools/regression/usr.bin/make/execution/joberr/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/execution/joberr/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/execution/joberr/test.t (contents, props changed) Added: head/tools/regression/usr.bin/make/execution/joberr/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/execution/joberr/MakefileThu Dec 15 06:01:06 2011(r228523) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +check-jobherr: +.for _t in 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 + @-${MAKE} -f ${MAKEFILE} -j2 do-$@ +.endfor + +do-check-joberr: + @echo "Error: build failed" + @exit 1 Added: head/tools/regression/usr.bin/make/execution/joberr/expected.status.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/execution/joberr/expected.status.1 Thu Dec 15 06:01:06 2011(r228523) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/execution/joberr/expected.stderr.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/execution/joberr/expected.stderr.1 Thu Dec 15 06:01:06 2011(r228523) @@ -0,0 +1,30 @@ +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error +1 error Added: head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 Thu Dec 15 06:01:06 2011(r228523) @@ -0,0 +1,90 @@ +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +Error: build failed +*** Error code 1 +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) +*** Error code 2 (ignored) Added: head/tools/regression/usr.bin/make/execution/joberr/test.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools
svn commit: r228522 - in head/sys: arm/arm dev/ti i386/xen ia64/ia64 powerpc/aim sparc64/sparc64
Author: alc Date: Thu Dec 15 05:07:16 2011 New Revision: 228522 URL: http://svn.freebsd.org/changeset/base/228522 Log: Eliminate vestiges of page coloring. Modified: head/sys/arm/arm/vm_machdep.c head/sys/dev/ti/if_ti.c head/sys/i386/xen/mp_machdep.c head/sys/ia64/ia64/uma_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/uma_machdep.c head/sys/sparc64/sparc64/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c == --- head/sys/arm/arm/vm_machdep.c Thu Dec 15 03:13:23 2011 (r228521) +++ head/sys/arm/arm/vm_machdep.c Thu Dec 15 05:07:16 2011 (r228522) @@ -617,7 +617,6 @@ uma_small_alloc(uma_zone_t zone, int byt void *ret; struct arm_small_page *sp; TAILQ_HEAD(,arm_small_page) *head; - static vm_pindex_t color; vm_page_t m; *flags = UMA_SLAB_PRIV; @@ -650,8 +649,7 @@ uma_small_alloc(uma_zone_t zone, int byt if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { - m = vm_page_alloc(NULL, color++, - pflags | VM_ALLOC_NOOBJ); + m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); if (m == NULL) { if (wait & M_NOWAIT) return (NULL); Modified: head/sys/dev/ti/if_ti.c == --- head/sys/dev/ti/if_ti.c Thu Dec 15 03:13:23 2011(r228521) +++ head/sys/dev/ti/if_ti.c Thu Dec 15 05:07:16 2011(r228522) @@ -1562,7 +1562,6 @@ ti_newbuf_jumbo(struct ti_softc *sc, int struct mbuf *m[3] = {NULL, NULL, NULL}; struct ti_rx_desc_ext *r; vm_page_t frame; - static int color; /* 1 extra buf to make nobufs easy*/ struct sf_buf *sf[3] = {NULL, NULL, NULL}; int i; @@ -1605,7 +1604,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int "failed -- packet dropped!\n"); goto nobufs; } - frame = vm_page_alloc(NULL, color++, + frame = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (frame == NULL) { Modified: head/sys/i386/xen/mp_machdep.c == --- head/sys/i386/xen/mp_machdep.c Thu Dec 15 03:13:23 2011 (r228521) +++ head/sys/i386/xen/mp_machdep.c Thu Dec 15 05:07:16 2011 (r228522) @@ -815,7 +815,6 @@ cpu_initialize_context(unsigned int cpu) vm_offset_t boot_stack; vm_offset_t newPTD; vm_paddr_t ma[NPGPTD]; - static int color; int i; /* @@ -825,7 +824,7 @@ cpu_initialize_context(unsigned int cpu) * */ for (i = 0; i < NPGPTD + 2; i++) { - m[i] = vm_page_alloc(NULL, color++, + m[i] = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); Modified: head/sys/ia64/ia64/uma_machdep.c == --- head/sys/ia64/ia64/uma_machdep.cThu Dec 15 03:13:23 2011 (r228521) +++ head/sys/ia64/ia64/uma_machdep.cThu Dec 15 05:07:16 2011 (r228522) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); void * uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) { - static vm_pindex_t color; void *va; vm_page_t m; int pflags; @@ -55,7 +54,7 @@ uma_small_alloc(uma_zone_t zone, int byt pflags |= VM_ALLOC_ZERO; for (;;) { - m = vm_page_alloc(NULL, color++, pflags | VM_ALLOC_NOOBJ); + m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); if (m == NULL) { if (wait & M_NOWAIT) return (NULL); Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cThu Dec 15 03:13:23 2011 (r228521) +++ head/sys/powerpc/aim/mmu_oea64.cThu Dec 15 05:07:16 2011 (r228522) @@ -1402,7 +1402,6 @@ moea64_uma_page_alloc(uma_zone_t zone, i * kmem allocation routines, calling kmem for a new address here * can lead to multiply locking non-recursive mutexes. */ - static vm_pindex_t color; vm_offset_t va; vm_page_t m; @@ -1422,7 +1421,7 @@ moea64_uma_page_alloc(uma_zone_t zone, i pflags |= VM_ALLOC_ZERO; for (;;) { -m = vm_page_alloc(NULL, color++, pflags | VM_ALLOC_NOO
svn commit: r228521 - head/usr.bin/make
Author: fjoe Date: Thu Dec 15 03:13:23 2011 New Revision: 228521 URL: http://svn.freebsd.org/changeset/base/228521 Log: job make: if stdout is a tty create a pty when running a command. Modified: head/usr.bin/make/Makefile head/usr.bin/make/job.c Modified: head/usr.bin/make/Makefile == --- head/usr.bin/make/Makefile Thu Dec 15 02:26:53 2011(r228520) +++ head/usr.bin/make/Makefile Thu Dec 15 03:13:23 2011(r228521) @@ -7,6 +7,8 @@ CFLAGS+=-I${.CURDIR} SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \ lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \ util.c var.c +DPADD= ${LIBUTIL} +LDADD= -lutil NO_SHARED?=YES Modified: head/usr.bin/make/job.c == --- head/usr.bin/make/job.c Thu Dec 15 02:26:53 2011(r228520) +++ head/usr.bin/make/job.c Thu Dec 15 03:13:23 2011(r228521) @@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1798,8 +1799,13 @@ JobStart(GNode *gn, int flags, Job *prev if (usePipes) { int fd[2]; - if (pipe(fd) == -1) - Punt("Cannot create pipe: %s", strerror(errno)); + if (isatty(1)) { + if (openpty(fd + 1, fd + 0, NULL, NULL, NULL) == -1) + Punt("Cannot open pty: %s", strerror(errno)); + } else { + if (pipe(fd) == -1) + Punt("Cannot create pipe: %s", strerror(errno)); + } job->inPipe = fd[0]; job->outPipe = fd[1]; fcntl(job->inPipe, F_SETFD, 1); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228520 - head/sys/nfsserver
Author: delphij Date: Thu Dec 15 02:26:53 2011 New Revision: 228520 URL: http://svn.freebsd.org/changeset/base/228520 Log: Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0, the full length from offset is being flushed. Note that for now VOP_FSYNC does not support offset and length parameters so we still do the same full VOP_FSYNC. This issue was reported at FreeNAS support site as FreeNAS ticket #1096. Submitted by: "ceckerle" Prodded by: gcooper Reviewed by: rmacklem MFC after:2 weeks Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c == --- head/sys/nfsserver/nfs_serv.c Thu Dec 15 01:05:38 2011 (r228519) +++ head/sys/nfsserver/nfs_serv.c Thu Dec 15 02:26:53 2011 (r228520) @@ -3454,7 +3454,12 @@ nfsrv_commit(struct nfsrv_descript *nfsd } for_ret = VOP_GETATTR(vp, &bfor, cred); - if (cnt > MAX_COMMIT_COUNT) { + /* +* RFC 1813 3.3.21: if count is 0, a flush from offset to the end of file +* is done. At this time VOP_FSYNC does not accept offset and byte count +* parameters so call VOP_FSYNC the whole file for now. +*/ + if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { /* * Give up and do the whole thing */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228519 - head/sys/mips/conf
Author: adrian Date: Thu Dec 15 01:05:38 2011 New Revision: 228519 URL: http://svn.freebsd.org/changeset/base/228519 Log: * Add in the gpio/gpioled drivers into AR91XX_BASE. * Add in a default GPIO section for AR91XX_BASE.hints, which doesn't define the GPIO function masks or any GPIO pines. * Add in the GPIO line definitions for LEDs and GPIO pins for the TP-WR1043nd. I've verified the LEDs work fine using gpioset. Modified: head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/AR91XX_BASE.hints head/sys/mips/conf/TP-WN1043ND.hints Modified: head/sys/mips/conf/AR91XX_BASE == --- head/sys/mips/conf/AR91XX_BASE Thu Dec 15 01:03:49 2011 (r228518) +++ head/sys/mips/conf/AR91XX_BASE Thu Dec 15 01:05:38 2011 (r228519) @@ -109,3 +109,5 @@ device md device bpf device random device if_bridge +device gpio +device gpioled Modified: head/sys/mips/conf/AR91XX_BASE.hints == --- head/sys/mips/conf/AR91XX_BASE.hintsThu Dec 15 01:03:49 2011 (r228518) +++ head/sys/mips/conf/AR91XX_BASE.hintsThu Dec 15 01:05:38 2011 (r228519) @@ -51,3 +51,9 @@ hint.mx25l.0.cs=0 # Watchdog hint.ar71xx_wdog.0.at="nexus0" + +# The GPIO function and pin mask is configured per-board +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x1804 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 Modified: head/sys/mips/conf/TP-WN1043ND.hints == --- head/sys/mips/conf/TP-WN1043ND.hintsThu Dec 15 01:03:49 2011 (r228518) +++ head/sys/mips/conf/TP-WN1043ND.hintsThu Dec 15 01:05:38 2011 (r228519) @@ -75,3 +75,44 @@ hint.map.4.start=0x007f hint.map.4.end=0x0080 hint.map.4.name="art" hint.map.4.readonly=1 + +# GPIO specific configuration block + +# Don't flip on anything that isn't already enabled. +# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're +# not used here. +hint.gpio.0.function_set=0x +hint.gpio.0.function_clear=0x + +# These are the GPIO LEDs and buttons which can be software controlled. +hint.gpio.0.pinmask=0x001c02ae + +# pin 1 - USB (LED) +# pin 2 - System (LED) +# Pin 3 - Reset (input) +# Pin 5 - QSS (LED) +# Pin 7 - QSS Button (input) +# Pin 8 - wired into the chip reset line +# Pin 9 - WLAN +# Pin 10 - UART TX (not GPIO) +# Pin 13 - UART RX (not GPIO) +# Pin 18 - RTL8366RB switch data line +# Pin 19 - RTL8366RB switch clock line +# Pin 20 - "GPIO20" + +# LEDs are configured separately and driven by the LED device +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="usb" +hint.gpioled.0.pins=0x0002 + +hint.gpioled.1.at="gpiobus0" +hint.gpioled.1.name="system" +hint.gpioled.1.pins=0x0004 + +hint.gpioled.2.at="gpiobus0" +hint.gpioled.2.name="qss" +hint.gpioled.2.pins=0x0020 + +hint.gpioled.3.at="gpiobus0" +hint.gpioled.3.name="wlan" +hint.gpioled.3.pins=0x0200 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228518 - head/sys/mips/atheros
Author: adrian Date: Thu Dec 15 01:03:49 2011 New Revision: 228518 URL: http://svn.freebsd.org/changeset/base/228518 Log: Re-jiggle the GPIO code a little to remove the hard-coded AR71xx GPIO config and function mask setup. * "gpiomask" now specifies which GPIO pins to enable, for devices to bind to. * "function_set" allows bits in the function register to be set at GPIO setup. * "function_clear" allows bits in the function register to be cleared at GPIO setup. The function_set/function_clear bits allow for individual GPIO pins to either drive a GPIO line or an alternate function - eg USB, JTAG, etc. This allows for things like CS1/CS2 be enabled for those boards w/ >1 SPI device connected, or disabling JTAG for the AR7240 (which is apparently needed ..) I've verified this on the AR71xx. Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c == --- head/sys/mips/atheros/ar71xx_gpio.c Thu Dec 15 00:59:11 2011 (r228517) +++ head/sys/mips/atheros/ar71xx_gpio.c Thu Dec 15 01:03:49 2011 (r228518) @@ -54,18 +54,6 @@ __FBSDID("$FreeBSD$"); #defineDEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) -struct ar71xx_gpio_pin { - const char *name; - int pin; - int flags; -}; - -static struct ar71xx_gpio_pin ar71xx_gpio_pins[] = { - { "RFled", 2, GPIO_PIN_OUTPUT}, - { "SW4", 8, GPIO_PIN_INPUT}, - { NULL, 0, 0}, -}; - /* * Helpers */ @@ -353,8 +341,9 @@ ar71xx_gpio_attach(device_t dev) { struct ar71xx_gpio_softc *sc = device_get_softc(dev); int error = 0; - struct ar71xx_gpio_pin *pinp; - int i; + int i, j, maxpin; + int mask; + int old = 0; KASSERT((device_get_unit(dev) == 0), ("ar71xx_gpio: Only one gpio module supported")); @@ -388,25 +377,49 @@ ar71xx_gpio_attach(device_t dev) } sc->dev = dev; - ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN); - ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN); + + /* Enable function bits that are required */ + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "function_set", &mask) == 0) { + device_printf(dev, "function_set: 0x%x\n", mask); + ar71xx_gpio_function_enable(sc, mask); + old = 1; + } + /* Disable function bits that are required */ + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "function_clear", &mask) == 0) { + device_printf(dev, "function_clear: 0x%x\n", mask); + ar71xx_gpio_function_disable(sc, mask); + old = 1; + } + /* Handle previous behaviour */ + if (old == 0) { + ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN); + ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN); + } + /* Configure all pins as input */ /* disable interrupts for all pins */ GPIO_WRITE(sc, AR71XX_GPIO_INT_MASK, 0); - pinp = ar71xx_gpio_pins; - i = 0; - while (pinp->name) { - strncpy(sc->gpio_pins[i].gp_name, pinp->name, GPIOMAXNAME); - sc->gpio_pins[i].gp_pin = pinp->pin; + + /* Initialise all pins specified in the mask, up to the pin count */ + (void) ar71xx_gpio_pin_max(dev, &maxpin); + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "pinmask", &mask) != 0) + mask = 0; + device_printf(dev, "gpio pinmask=0x%x\n", mask); + for (i = 0, j = 0; j < maxpin; j++) { + if ((mask & (1 << j)) == 0) + continue; + snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", j); + sc->gpio_pins[i].gp_pin = j; sc->gpio_pins[i].gp_caps = DEFAULT_CAPS; sc->gpio_pins[i].gp_flags = 0; - ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], pinp->flags); - pinp++; + ar71xx_gpio_pin_configure(sc, &sc->gpio_pins[i], DEFAULT_CAPS); i++; } - sc->gpio_npins = i; - device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); return (bus_generic_attach(dev)); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228517 - in head/sys/dev/ath/ath_hal: ar5416 ar9002
Author: adrian Date: Thu Dec 15 00:59:11 2011 New Revision: 228517 URL: http://svn.freebsd.org/changeset/base/228517 Log: Add the 11n chipset RF frontends to the linker set, even though they're not attached this way. The AR5212 based NICs have a variety of RF frontends, so there's a linker set which the AR5212 attach routine calls. The same framework is used for the AR5416 and later but as there's a fixed RF frontend for each 11n NIC, it is just directly attached. However in the case of compiling a cut down HAL (eg _just_ AR9130 WMAC support), the linker set ends up being empty and this causes the compile to fail. So this is just a workaround for that - it means those users who wish an 11n only HAL can compile the 11n chipsets and RF frontend they need, and just "ath_ar5212" for the AR5212/AR5416 common code, and it'll just work. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar9002/ar9280.c head/sys/dev/ath/ath_hal/ar9002/ar9285.c head/sys/dev/ath/ath_hal/ar9002/ar9287.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c == --- head/sys/dev/ath/ath_hal/ar5416/ar2133.cThu Dec 15 00:55:27 2011 (r228516) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.cThu Dec 15 00:59:11 2011 (r228517) @@ -549,3 +549,11 @@ ar2133RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } + +static HAL_BOOL +ar2133Probe(struct ath_hal *ah) +{ + return (AR_SREV_OWL(ah) || AR_SREV_HOWL(ah) || AR_SREV_SOWL(ah)); +} + +AH_RF(RF2133, ar2133Probe, ar2133RfAttach); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.c == --- head/sys/dev/ath/ath_hal/ar9002/ar9280.cThu Dec 15 00:55:27 2011 (r228516) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.cThu Dec 15 00:59:11 2011 (r228517) @@ -384,3 +384,11 @@ ar9280RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } + +static HAL_BOOL +ar9280RfProbe(struct ath_hal *ah) +{ + return (AR_SREV_MERLIN(ah)); +} + +AH_RF(RF9280, ar9280RfProbe, ar9280RfAttach); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.c == --- head/sys/dev/ath/ath_hal/ar9002/ar9285.cThu Dec 15 00:55:27 2011 (r228516) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.cThu Dec 15 00:59:11 2011 (r228517) @@ -77,3 +77,11 @@ ar9285RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } + +static HAL_BOOL +ar9285RfProbe(struct ath_hal *ah) +{ + return (AR_SREV_KITE(ah)); +} + +AH_RF(RF9285, ar9285RfProbe, ar9285RfAttach); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287.c == --- head/sys/dev/ath/ath_hal/ar9002/ar9287.cThu Dec 15 00:55:27 2011 (r228516) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287.cThu Dec 15 00:59:11 2011 (r228517) @@ -390,3 +390,11 @@ ar9287RfAttach(struct ath_hal *ah, HAL_S return AH_TRUE; } + +static HAL_BOOL +ar9287RfProbe(struct ath_hal *ah) +{ + return (AR_SREV_KIWI(ah)); +} + +AH_RF(RF9287, ar9287RfProbe, ar9287RfAttach); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228516 - head/sys/dev/ath
Author: adrian Date: Thu Dec 15 00:55:27 2011 New Revision: 228516 URL: http://svn.freebsd.org/changeset/base/228516 Log: Print out the radio RF version at startup, so I can better see which RF frontend versions people have when they submit problem reports. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Thu Dec 15 00:54:11 2011(r228515) +++ head/sys/dev/ath/if_ath.c Thu Dec 15 00:55:27 2011(r228516) @@ -6218,6 +6218,8 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "AR%s mac %d.%d RF%s phy %d.%d\n", ath_hal_mac_name(ah), ah->ah_macVersion, ah->ah_macRev, ath_hal_rf_name(ah), ah->ah_phyRev >> 4, ah->ah_phyRev & 0xf); + if_printf(ifp, "2GHz radio: 0x%.4x; 5GHz radio: 0x%.4x\n", + ah->ah_analog2GhzRev, ah->ah_analog5GhzRev); if (bootverbose) { int i; for (i = 0; i <= WME_AC_VO; i++) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228515 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Thu Dec 15 00:54:11 2011 New Revision: 228515 URL: http://svn.freebsd.org/changeset/base/228515 Log: Use the correct RF version probe routine. Obtained from:Atheros Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Dec 15 00:52:30 2011(r228514) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu Dec 15 00:54:11 2011(r228515) @@ -339,7 +339,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_PHY(0), 0x0007); /* Read Radio Chip Rev Extract */ - AH_PRIVATE(ah)->ah_analog5GhzRev = ar5212GetRadioRev(ah); + AH_PRIVATE(ah)->ah_analog5GhzRev = ar5416GetRadioRev(ah); switch (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) { case AR_RAD5122_SREV_MAJOR:/* Fowl: 5G/2x2 */ case AR_RAD2122_SREV_MAJOR:/* Fowl: 2+5G/2x2 */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228514 - head/sys/net80211
Author: adrian Date: Thu Dec 15 00:52:30 2011 New Revision: 228514 URL: http://svn.freebsd.org/changeset/base/228514 Log: Modify the ACL code slightly to support a few nifty things: * Call it before sending probe responses, so the ACL code has the chance to reject sending them. * Pass the whole frame to the ACL code now, rather than just the destination MAC - that way the ACL module can look at the frame contents to determine what the response should be. This is part of some uncommitted work to support band steering. Sponsored by: Hobnob, Inc. Modified: head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_acl.c == --- head/sys/net80211/ieee80211_acl.c Wed Dec 14 23:57:47 2011 (r228513) +++ head/sys/net80211/ieee80211_acl.c Thu Dec 15 00:52:30 2011 (r228514) @@ -152,7 +152,8 @@ _acl_free(struct aclstate *as, struct ac } static int -acl_check(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) +acl_check(struct ieee80211vap *vap, const struct ieee80211_frame *wh, +const uint8_t mac[IEEE80211_ADDR_LEN]) { struct aclstate *as = vap->iv_as; Modified: head/sys/net80211/ieee80211_hostap.c == --- head/sys/net80211/ieee80211_hostap.cWed Dec 14 23:57:47 2011 (r228513) +++ head/sys/net80211/ieee80211_hostap.cThu Dec 15 00:52:30 2011 (r228514) @@ -1795,6 +1795,16 @@ hostap_recv_mgmt(struct ieee80211_node * return; } /* +* Consult the ACL policy module if setup. +*/ + if (vap->iv_acl != NULL && + !vap->iv_acl->iac_check(vap, wh, wh->i_addr2)) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_ACL, + wh, NULL, "%s", "disallowed by ACL"); + vap->iv_stats.is_rx_acl++; + return; + } + /* * prreq frame format * [tlv] ssid * [tlv] supported rates @@ -1874,7 +1884,7 @@ hostap_recv_mgmt(struct ieee80211_node * * Consult the ACL policy module if setup. */ if (vap->iv_acl != NULL && - !vap->iv_acl->iac_check(vap, wh->i_addr2)) { + !vap->iv_acl->iac_check(vap, wh, wh->i_addr2)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ACL, wh, NULL, "%s", "disallowed by ACL"); vap->iv_stats.is_rx_acl++; Modified: head/sys/net80211/ieee80211_mesh.c == --- head/sys/net80211/ieee80211_mesh.c Wed Dec 14 23:57:47 2011 (r228513) +++ head/sys/net80211/ieee80211_mesh.c Thu Dec 15 00:52:30 2011 (r228514) @@ -1120,7 +1120,8 @@ mesh_input(struct ieee80211_node *ni, st * * NB: this check is also done upon peering link initiation. */ - if (vap->iv_acl != NULL && !vap->iv_acl->iac_check(vap, wh->i_addr2)) { + if (vap->iv_acl != NULL && + !vap->iv_acl->iac_check(vap, wh, wh->i_addr2)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ACL, wh, NULL, "%s", "disallowed by ACL"); vap->iv_stats.is_rx_acl++; @@ -1379,7 +1380,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni * Peer only based on the current ACL policy. */ if (vap->iv_acl != NULL && - !vap->iv_acl->iac_check(vap, wh->i_addr2)) { + !vap->iv_acl->iac_check(vap, wh, wh->i_addr2)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ACL, wh, NULL, "%s", "disallowed by ACL"); vap->iv_stats.is_rx_acl++; Modified: head/sys/net80211/ieee80211_proto.h == --- head/sys/net80211/ieee80211_proto.h Wed Dec 14 23:57:47 2011 (r228513) +++ head/sys/net80211/ieee80211_proto.h Thu Dec 15 00:52:30 2011 (r228514) @@ -215,6 +215,7 @@ struct ieee80211_aclator { int (*iac_attach)(struct ieee80211vap *); void(*iac_detach)(struct ieee80211vap *); int (*iac_check)(struct ieee80211vap *, + const struct ieee80211_frame *wh, const uint8_t mac[IEEE80211_ADDR_LEN]); int (*iac_add)(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/l
svn commit: r228513 - head/sys/i386/i386
Author: alc Date: Wed Dec 14 23:57:47 2011 New Revision: 228513 URL: http://svn.freebsd.org/changeset/base/228513 Log: Create large page mappings in pmap_map(). MFC after:6 weeks Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Wed Dec 14 23:26:48 2011(r228512) +++ head/sys/i386/i386/pmap.c Wed Dec 14 23:57:47 2011(r228513) @@ -1450,12 +1450,40 @@ vm_offset_t pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) { vm_offset_t va, sva; + vm_paddr_t superpage_offset; + pd_entry_t newpde; - va = sva = *virt; + va = *virt; + /* +* Does the physical address range's size and alignment permit at +* least one superpage mapping to be created? +*/ + superpage_offset = start & PDRMASK; + if ((end - start) - ((NBPDR - superpage_offset) & PDRMASK) >= NBPDR) { + /* +* Increase the starting virtual address so that its alignment +* does not preclude the use of superpage mappings. +*/ + if ((va & PDRMASK) < superpage_offset) + va = (va & ~PDRMASK) + superpage_offset; + else if ((va & PDRMASK) > superpage_offset) + va = ((va + PDRMASK) & ~PDRMASK) + superpage_offset; + } + sva = va; while (start < end) { - pmap_kenter(va, start); - va += PAGE_SIZE; - start += PAGE_SIZE; + if ((start & PDRMASK) == 0 && end - start >= NBPDR && + pseflag) { + KASSERT((va & PDRMASK) == 0, + ("pmap_map: misaligned va %#x", va)); + newpde = start | PG_PS | pgeflag | PG_RW | PG_V; + pmap_kenter_pde(va, newpde); + va += NBPDR; + start += NBPDR; + } else { + pmap_kenter(va, start); + va += PAGE_SIZE; + start += PAGE_SIZE; + } } pmap_invalidate_range(kernel_pmap, sva, va); *virt = va; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228512 - head/tools/regression/pipe
Author: jilles Date: Wed Dec 14 23:26:48 2011 New Revision: 228512 URL: http://svn.freebsd.org/changeset/base/228512 Log: Add a test for r228510. Added: head/tools/regression/pipe/pipe-reverse2.c (contents, props changed) Added: head/tools/regression/pipe/pipe-reverse2.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/pipe/pipe-reverse2.c Wed Dec 14 23:26:48 2011 (r228512) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2010 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include + +/* + * Check that pipes can be selected for writing in the reverse direction. + */ +int +main(int argc, char *argv[]) +{ + int pip[2]; + fd_set set; + int n; + + if (pipe(pip) == -1) + err(1, "FAIL: pipe"); + + FD_ZERO(&set); + FD_SET(pip[0], &set); + n = select(pip[1] + 1, NULL, &set, NULL, &(struct timeval){ 0, 0 }); + if (n != 1) + errx(1, "FAIL: select initial reverse direction"); + + n = write(pip[0], "x", 1); + if (n != 1) + err(1, "FAIL: write reverse direction"); + + FD_ZERO(&set); + FD_SET(pip[0], &set); + n = select(pip[1] + 1, NULL, &set, NULL, &(struct timeval){ 0, 0 }); + if (n != 1) + errx(1, "FAIL: select reverse direction after write"); + + printf("PASS\n"); + + return (0); +} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228511 - head
Author: delphij Date: Wed Dec 14 23:22:40 2011 New Revision: 228511 URL: http://svn.freebsd.org/changeset/base/228511 Log: Reflect the move of eventtimers(7) to eventtimers(4). Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Dec 14 22:26:39 2011(r228510) +++ head/ObsoleteFiles.inc Wed Dec 14 23:22:40 2011(r228511) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20111214: eventtimers(7) moved to eventtimers(4) +OLD_FILES+=usr/share/man/man7/eventtimers.7.gz # 2025: amd(4) removed OLD_FILES+=usr/share/man/man4/amd.4.gz # 2025: libodialog removed ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
R: svn commit: r228507 - head/sys/fs/ext2fs
--- Mer 14/12/11, Pedro F. Giffuni ha scritto: > Author: pfg > Date: Wed Dec 14 22:04:14 2011 > New Revision: 228507 > URL: http://svn.freebsd.org/changeset/base/228507 > > Log: > Merge ext2_readwrite.c into ext2_vnops.c as done in > UFS in r101729. > Actually I meant Revision 101720, but I doubt anyone cares much ;). cheers, Pedro. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228510 - head/sys/kern
Author: jilles Date: Wed Dec 14 22:26:39 2011 New Revision: 228510 URL: http://svn.freebsd.org/changeset/base/228510 Log: Fix select/poll/kqueue for write on reverse direction before first write. The reverse direction of a pipe is lazily allocated on the first write in that direction (because pipes are usually used in one direction only). A special case is needed to ensure the pipe appears writable before the first write because there are 0 bytes of pending data in 0 bytes of buffer space at that point, leaving 0 bytes of data that can be written with the normal code. Note that the first write returns [ENOMEM] if kern.ipc.maxpipekva is exceeded and does not block or return [EAGAIN], so selecting true for write is correct even in that case. PR: kern/93685 Submitted by: gianni MFC after:2 weeks Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cWed Dec 14 22:22:19 2011(r228509) +++ head/sys/kern/sys_pipe.cWed Dec 14 22:26:39 2011(r228510) @@ -1349,7 +1349,8 @@ pipe_poll(fp, events, active_cred, td) if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF) || (((wpipe->pipe_state & PIPE_DIRECTW) == 0) && -(wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF)) +((wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) >= PIPE_BUF || +wpipe->pipe_buffer.size == 0))) revents |= events & (POLLOUT | POLLWRNORM); if ((events & POLLINIGNEOF) == 0) { @@ -1660,7 +1661,8 @@ filt_pipewrite(struct knote *kn, long hi PIPE_UNLOCK(rpipe); return (1); } - kn->kn_data = wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt; + kn->kn_data = (wpipe->pipe_buffer.size > 0) ? + (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; if (wpipe->pipe_state & PIPE_DIRECTW) kn->kn_data = 0; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228509 - in head: share/man/man9 sys/kern sys/sys
Author: jhb Date: Wed Dec 14 22:22:19 2011 New Revision: 228509 URL: http://svn.freebsd.org/changeset/base/228509 Log: Add a helper API to allow in-kernel code to map portions of shared memory objects created by shm_open(2) into the kernel's address space. This provides a convenient way for creating shared memory buffers between userland and the kernel without requiring custom character devices. Added: head/share/man/man9/shm_map.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/sys/kern/uipc_shm.c head/sys/sys/mman.h Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileWed Dec 14 22:14:05 2011 (r228508) +++ head/share/man/man9/MakefileWed Dec 14 22:22:19 2011 (r228509) @@ -234,6 +234,7 @@ MAN=accept_filter.9 \ sema.9 \ sf_buf.9 \ sglist.9 \ + shm_map.9 \ signal.9 \ sleep.9 \ sleepqueue.9 \ @@ -,6 +1112,7 @@ MLINKS+=sglist.9 sglist_alloc.9 \ sglist.9 sglist_reset.9 \ sglist.9 sglist_slice.9 \ sglist.9 sglist_split.9 +MLINKS+=shm_map.9 shm_unmap.9 MLINKS+=signal.9 cursig.9 \ signal.9 execsigs.9 \ signal.9 issignal.9 \ Added: head/share/man/man9/shm_map.9 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/shm_map.9 Wed Dec 14 22:22:19 2011 (r228509) @@ -0,0 +1,187 @@ +.\" +.\" Copyright (c) 2011 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 14, 2011 +.Dt SHM_MAP 9 +.Os +.Sh NAME +.Nm shm_map , +.Nm shm_unmap +.Nd map shared memory objects into the kernel's address space +.Sh SYNOPSIS +.In sys/types.h +.In sys/mman.h +.Ft int +.Fn shm_map "struct file *fp" "size_t size" "off_t offset" "void **memp" +.Ft int +.Fn shm_unmap "struct file *fp" "void *mem" "size_t size" +.Sh DESCRIPTION +The +.Nm shm_map +and +.Nm shm_unmap +functions provide an API for mapping shared memory objects into the kernel. +Shared memory objects are created by +.Xr shm_open 2 . +These objects can then be passed into the kernel via file descriptors. +.Pp +A shared memory object cannot be shrunk while it is mapped into the kernel. +This is to avoid invalidating any pages that may be wired into the kernel's +address space. +Shared memory objects can still be grown while mapped into the kernel. +.Pp +To simplify the accounting needed to enforce the above requirement, +callers of this API are required to unmap the entire region mapped by +.Nm shm_map +when calling +.Nm shm_unmap . +Unmapping only a portion of the region is not permitted. +.Pp +The +.Nm shm_map +function locates the shared memory object associated with the open file +.Fa fp . +It maps the region of that object described by +.Fa offset +and +.Fa size +into the kernel's address space. +If it succeeds, +.Fa *memp +will be set to the start of the mapping. +All pages for the range will be wired into memory upon successful return. +.Pp +The +.Nm shm_unmap +function unmaps a region previously mapped by +.Nm shm_map . +The +.Fa mem +argument should match the value previously returned in +.Fa *memp , +and the +.Fa size +argument should match the value passed to +.Nm shm_map . +.Pp +Note that +.Nm shm_map +will not hold an extra reference on the open file +.Fa fp +for the lifetime of the mapping. +Instead, +the calling code is required to do this if it wishes to use +.Nm shm_unmap +on the
svn commit: r228508 - head/sys/dev/usb/wlan
Author: hselasky Date: Wed Dec 14 22:14:05 2011 New Revision: 228508 URL: http://svn.freebsd.org/changeset/base/228508 Log: Improve fix for random USB transfer time out. Suggested by: YougHyeon MFC after:3 days Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c == --- head/sys/dev/usb/wlan/if_run.c Wed Dec 14 22:04:14 2011 (r228507) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 14 22:14:05 2011 (r228508) @@ -2749,7 +2749,8 @@ tr_setup: STAILQ_REMOVE_HEAD(&pq->tx_qh, next); m = data->m; - if (m->m_pkthdr.len > RUN_MAX_TXSZ) { + if ((m->m_pkthdr.len + + sizeof(data->desc) + 3 + 8) > RUN_MAX_TXSZ) { DPRINTF("data overflow, %u bytes\n", m->m_pkthdr.len); @@ -2764,6 +2765,14 @@ tr_setup: size = sizeof(data->desc); usbd_copy_in(pc, 0, &data->desc, size); usbd_m_copy_in(pc, size, m, 0, m->m_pkthdr.len); + size += m->m_pkthdr.len; + /* +* Align end on a 4-byte boundary, pad 8 bytes (CRC + +* 4-byte padding), and be sure to zero those trailing +* bytes: +*/ + usbd_frame_zero(pc, size, ((-size) & 3) + 8); + size += ((-size) & 3) + 8; vap = data->ni->ni_vap; if (ieee80211_radiotap_active_vap(vap)) { @@ -2782,10 +2791,10 @@ tr_setup: ieee80211_radiotap_tx(vap, m); } - DPRINTFN(11, "sending frame len=%u @ index %d\n", - m->m_pkthdr.len, index); + DPRINTFN(11, "sending frame len=%u/%u @ index %d\n", + m->m_pkthdr.len, size, index); - usbd_xfer_set_frame_len(xfer, 0, size + m->m_pkthdr.len); + usbd_xfer_set_frame_len(xfer, 0, size); usbd_xfer_set_priv(xfer, data); usbd_transfer_submit(xfer); @@ -2874,7 +2883,6 @@ run_bulk_tx_callback5(struct usb_xfer *x static void run_set_tx_desc(struct run_softc *sc, struct run_tx_data *data) { - static const uint8_t ztail[16]; struct mbuf *m = data->m; struct ieee80211com *ic = sc->sc_ifp->if_l2com; struct ieee80211vap *vap = data->ni->ni_vap; @@ -2931,13 +2939,6 @@ run_set_tx_desc(struct run_softc *sc, st if (vap->iv_opmode != IEEE80211_M_STA && !IEEE80211_QOS_HAS_SEQ(wh)) txwi->xflags |= RT2860_TX_NSEQ; - - /* -* Align end on a 4-byte boundary, pad 8 bytes (CRC + 4-byte padding), -* and be sure to zero those trailing bytes. -*/ - m_append(m, ((m->m_pkthdr.len + 3) & ~3) - m->m_pkthdr.len + 8, - (c_caddr_t)ztail); } /* This function must be called locked */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228507 - head/sys/fs/ext2fs
Author: pfg Date: Wed Dec 14 22:04:14 2011 New Revision: 228507 URL: http://svn.freebsd.org/changeset/base/228507 Log: Merge ext2_readwrite.c into ext2_vnops.c as done in UFS in r101729. This removes the obfuscations mentioned in ext2_readwrite and places the clustering funtion in a location similar to other UFS-based implementations. No performance or functional changeses are expected from this move. PR: kern/159232 Suggested by: bde Approved by: jhb (mentor) MFC after:2 weeks Deleted: head/sys/fs/ext2fs/ext2_readwrite.c Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c == --- head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 14 20:57:41 2011 (r228506) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Dec 14 22:04:14 2011 (r228507) @@ -64,9 +64,13 @@ #include #include +#include +#include #include #include +#include "opt_directio.h" + #include #include @@ -159,8 +163,6 @@ struct vop_vector ext2_fifoops = { .vop_vptofh = ext2_vptofh, }; -#include - /* * A virgin directory (no blushing please). * Note that the type and namlen fields are reversed relative to ext2. @@ -1675,3 +1677,328 @@ bad: vput(tvp); return (error); } + +/* + * Vnode op for reading. + */ +static int +ext2_read(ap) + struct vop_read_args /* { + struct vnode *a_vp; + struct uio *a_uio; + int a_ioflag; + struct ucred *a_cred; + } */ *ap; +{ + struct vnode *vp; + struct inode *ip; + struct uio *uio; + struct m_ext2fs *fs; + struct buf *bp; + daddr_t lbn, nextlbn; + off_t bytesinfile; + long size, xfersize, blkoffset; + int error, orig_resid, seqcount; + int ioflag; + + vp = ap->a_vp; + uio = ap->a_uio; + ioflag = ap->a_ioflag; + + seqcount = ap->a_ioflag >> IO_SEQSHIFT; + ip = VTOI(vp); + +#ifdef INVARIANTS + if (uio->uio_rw != UIO_READ) + panic("%s: mode", "ext2_read"); + + if (vp->v_type == VLNK) { + if ((int)ip->i_size < vp->v_mount->mnt_maxsymlinklen) + panic("%s: short symlink", "ext2_read"); + } else if (vp->v_type != VREG && vp->v_type != VDIR) + panic("%s: type %d", "ext2_read", vp->v_type); +#endif + orig_resid = uio->uio_resid; + KASSERT(orig_resid >= 0, ("ext2_read: uio->uio_resid < 0")); + if (orig_resid == 0) + return (0); + KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0")); + fs = ip->i_e2fs; + if (uio->uio_offset < ip->i_size && + uio->uio_offset >= fs->e2fs_maxfilesize) + return (EOVERFLOW); + + for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) { + if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0) + break; + lbn = lblkno(fs, uio->uio_offset); + nextlbn = lbn + 1; + size = blksize(fs, ip, lbn); + blkoffset = blkoff(fs, uio->uio_offset); + + xfersize = fs->e2fs_fsize - blkoffset; + if (uio->uio_resid < xfersize) + xfersize = uio->uio_resid; + if (bytesinfile < xfersize) + xfersize = bytesinfile; + + if (lblktosize(fs, nextlbn) >= ip->i_size) + error = bread(vp, lbn, size, NOCRED, &bp); + else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) + error = cluster_read(vp, ip->i_size, lbn, size, + NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); + else if (seqcount > 1) { + int nextsize = blksize(fs, ip, nextlbn); + error = breadn(vp, lbn, + size, &nextlbn, &nextsize, 1, NOCRED, &bp); + } else + error = bread(vp, lbn, size, NOCRED, &bp); + if (error) { + brelse(bp); + bp = NULL; + break; + } + + /* +* If IO_DIRECT then set B_DIRECT for the buffer. This +* will cause us to attempt to release the buffer later on +* and will cause the buffer cache to attempt to free the +* underlying pages. +*/ + if (ioflag & IO_DIRECT) + bp->b_flags |= B_DIRECT; + + /* +* We should only get non-zero b_resid when an I/O error +* has occurred, which should cause us to break above. +* However, if the short read did not cause an error, +* then we want to ensure that we do not uiomove bad +
svn commit: r228505 - head/share/man/man8
Author: joel (doc committer) Date: Wed Dec 14 19:48:21 2011 New Revision: 228505 URL: http://svn.freebsd.org/changeset/base/228505 Log: Add SEE ALSO. Modified: head/share/man/man8/yp.8 Modified: head/share/man/man8/yp.8 == --- head/share/man/man8/yp.8Wed Dec 14 17:12:59 2011(r228504) +++ head/share/man/man8/yp.8Wed Dec 14 19:48:21 2011(r228505) @@ -28,7 +28,7 @@ .\" from: @(#)yp.8 1.0 (deraadt) 4/26/93 .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 14, 2011 .Dt YP 8 .Os .Sh NAME @@ -519,6 +519,20 @@ a v1 and v2 server. .Xr ypserv 8 manual page for a detailed description of these special features and flags.) +.Sh SEE ALSO +.Xr domainname 1 , +.Xr ypcat 1 , +.Xr ypmatch 1 , +.Xr ypwhich 1 , +.Xr nsswitch.conf 5 , +.Xr yp_mkdb 8 , +.Xr ypbind 8 , +.Xr ypinit 8 , +.Xr yppoll 8 , +.Xr yppush 8 , +.Xr ypserv 8 , +.Xr ypset 8 , +.Xr ypxfr 8 .Sh HISTORY The .Nm YP ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228504 - head/sys/arm/arm
Author: raj Date: Wed Dec 14 17:12:59 2011 New Revision: 228504 URL: http://svn.freebsd.org/changeset/base/228504 Log: Make *intr{cnt,names} on ARM reside in data section, similar to other arches. sintrnames and sintrcnt are initialized with non-zero values, which were discarded by the .bss directive, so consumers like "vmstat -i" were not getting correct data. Submitted by: Lukasz Plachno Obtained from:Semihalf MFC after:1 month Modified: head/sys/arm/arm/irq_dispatch.S Modified: head/sys/arm/arm/irq_dispatch.S == --- head/sys/arm/arm/irq_dispatch.S Wed Dec 14 16:47:53 2011 (r228503) +++ head/sys/arm/arm/irq_dispatch.S Wed Dec 14 17:12:59 2011 (r228504) @@ -98,10 +98,9 @@ ASENTRY_NP(irq_entry) PULLFRAMEFROMSVCANDEXIT movspc, lr /* Exit */ - .bss + .data .align 0 - .global _C_LABEL(intrnames), _C_LABEL(sintrnames) .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt) _C_LABEL(intrnames): ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r228498 - head/sys/vm
В Wed, 14 Dec 2011 13:25:00 + (UTC) Eitan Adler пишет: > Author: eadler (ports committer) > Date: Wed Dec 14 13:25:00 2011 > New Revision: 228498 > URL: http://svn.freebsd.org/changeset/base/228498 > > Log: > - The previous commit (r228449) accidentally moved the > vm.stats.vm.* sysctls to vm.stats.sys. Move them back. > > Noticed by: pho > Reviewed by:bde (earlier version) > Approved by:bz > MFC after: 1 week > Pointy hat to: me > > Modified: > head/sys/vm/vm_meter.c > > Modified: head/sys/vm/vm_meter.c > == > --- head/sys/vm/vm_meter.cWed Dec 14 13:12:55 2011 > (r228497) +++ head/sys/vm/vm_meter.c Wed Dec 14 13:25:00 > 2011 (r228498) @@ -270,59 +270,62 @@ static > SYSCTL_NODE(_vm_stats, OID_AUTO, "VM meter vm stats"); > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc > stats"); > -#define VM_STATS_SYS(var, descr) SYSCTL_PROC(_vm_stats_sys, > OID_AUTO, var, \ > -(CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE), &cnt.v_swtch, 0, > vcnt, \ > -"IU", descr); > +#define VM_STATS(parent, var, descr) \ > + SYSCTL_PROC(parent, OID_AUTO, var, \ > + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &cnt.var, 0, > vcnt, \ > + "IU", descr) > +#define VM_STATS_VM(var, descr) > VM_STATS(_vm_stats_vm, var, descr) +#define VM_STATS_SYS(var, > descr)VM_STATS(_vm_stats_sys, var, descr) > VM_STATS_SYS(v_swtch, "Context switches"); > VM_STATS_SYS(v_trap, "Traps"); > VM_STATS_SYS(v_syscall, "System calls"); > VM_STATS_SYS(v_intr, "Device interrupts"); > VM_STATS_SYS(v_soft, "Software interrupts"); > -VM_STATS_SYS(v_vm_faults, "Address memory faults"); > -VM_STATS_SYS(v_cow_faults, "Copy-on-write faults"); > -VM_STATS_SYS(v_cow_optim, "Optimized COW faults") > -VM_STATS_SYS(v_zfod, "Pages zero-filled on demand") > -VM_STATS_SYS(v_ozfod, "Optimized zero fill pages") > -VM_STATS_SYS(v_swapin, "Swap pager pageins") > -VM_STATS_SYS(v_swapout, "Swap pager pageouts") > -VM_STATS_SYS(v_swappgsin, "Swap pages swapped in") > -VM_STATS_SYS(v_swappgsout, "Swap pages swapped out") > -VM_STATS_SYS(v_vnodein, "Vnode pager pageins") > -VM_STATS_SYS(v_vnodeout, "Vnode pager pageouts") > -VM_STATS_SYS(v_vnodepgsin, "Vnode pages paged in") > -VM_STATS_SYS(v_vnodepgsout, "Vnode pages paged out") > -VM_STATS_SYS(v_intrans, "In transit page faults") > -VM_STATS_SYS(v_reactivated, "Pages reactivated from free list") > -VM_STATS_SYS(v_pdwakeups, "Pagedaemon wakeups") > -VM_STATS_SYS(v_pdpages, "Pages analyzed by pagedaemon") > -VM_STATS_SYS(v_tcached, "Total pages cached") > -VM_STATS_SYS(v_dfree, "Pages freed by pagedaemon") > -VM_STATS_SYS(v_pfree, "Pages freed by exiting processes") > -VM_STATS_SYS(v_tfree, "Total pages freed") > -VM_STATS_SYS(v_page_size, "Page size in bytes") > -VM_STATS_SYS(v_page_count, "Total number of pages in system") > -VM_STATS_SYS(v_free_reserved, "Pages reserved for deadlock") > -VM_STATS_SYS(v_free_target, "Pages desired free") > -VM_STATS_SYS(v_free_min, "Minimum low-free-pages threshold") > -VM_STATS_SYS(v_free_count, "Free pages") > -VM_STATS_SYS(v_wire_count, "Wired pages") > -VM_STATS_SYS(v_active_count, "Active pages") > -VM_STATS_SYS(v_inactive_target, "Desired inactive pages") > -VM_STATS_SYS(v_inactive_count, "Inactive pages") > -VM_STATS_SYS(v_cache_count, "Pages on cache queue") > -VM_STATS_SYS(v_cache_min, "Min pages on cache queue") > -VM_STATS_SYS(v_cache_max, "Max pages on cached queue") > -VM_STATS_SYS(v_pageout_free_min, "Min pages reserved for kernel") > -VM_STATS_SYS(v_interrupt_free_min, "Reserved pages for interrupt > code") -VM_STATS_SYS(v_forks, "Number of fork() calls") > -VM_STATS_SYS(v_vforks, "Number of vfork() calls") > -VM_STATS_SYS(v_rforks, "Number of rfork() calls") > -VM_STATS_SYS(v_kthreads, "Number of fork() calls by kernel") > -VM_STATS_SYS(v_forkpages, "VM pages affected by fork()") > -VM_STATS_SYS(v_vforkpages, "VM pages affected by vfork()") > -VM_STATS_SYS(v_rforkpages, "VM pages affected by rfork()") > -VM_STATS_SYS(v_kthreadpages, "VM pages affected by fork() by kernel") > +VM_STATS_VM(v_vm_faults, "Address memory faults"); > +VM_STATS_VM(v_cow_faults, "Copy-on-write faults"); > +VM_STATS_VM(v_cow_optim, "Optimized COW faults"); > +VM_STATS_VM(v_zfod, "Pages zero-filled on demand"); > +VM_STATS_VM(v_ozfod, "Optimized zero fill pages"); > +VM_STATS_VM(v_swapin, "Swap pager pageins"); > +VM_STATS_VM(v_swapout, "Swap pager pageouts"); > +VM_STATS_VM(v_swappgsin, "Swap pages swapped in"); > +VM_STATS_VM(v_swappgsout, "Swap pages swapped out"); > +VM_STATS_VM(v_vnodein, "Vnode pager pageins"); > +VM_STATS_VM(v_vnodeout, "Vnode pager pageouts"); > +VM_STATS_VM(v_vnodepgsin, "Vnode pages paged in"); > +VM_STATS_VM(v_vnodepgsout, "Vnode pages paged out"); > +VM_STATS_VM(v_intrans, "In transit page faults"); > +VM_STATS_VM(v_reactivated, "Pages reactivated from free list"); >
Re: r228377 to r228473 top not working
В Wed, 14 Dec 2011 08:29:39 -0500 Eitan Adler пишет: > On Tue, Dec 13, 2011 at 2:43 PM, Eitan Adler > wrote: > > On Tue, Dec 13, 2011 at 2:34 PM, Ivan Klymenko > > wrote: > >> Hi all! > >> I have uname -a > >> FreeBSD nonamehost 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r228473M: > >> Tue Dec 13 20:09:45 EET 2011 > >> ivan@nonamehost:/usr/obj/usr/src/sys/mk9 amd64 After update > >> source code from r228377 to r228473 "top" stopped working > >> > >> # top > >> top: sysctl(vm.stats.vm.v_active_count...) failed: No such file or > >> directory # > >> > >> There are some ideas? > > > > Mea Culpa. I am currently testing a patch to fix this. > > Fixed in r228498 - sorry for taking so long. > > Thank you! It works! ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228503 - in head/libexec/rtld-elf: . amd64 i386
Author: kib Date: Wed Dec 14 16:47:53 2011 New Revision: 228503 URL: http://svn.freebsd.org/changeset/base/228503 Log: _rtld_bind() read-locks the bind lock, and possible plt resolution from the dispatcher would also acquire bind lock in read mode, which is the supported operation. plt is explicitely designed to allow safe multithreaded updates, so the shared lock do not cause problems. The error in r228435 is that it allows read lock acquisition after the write lock for the bind block. If we dlopened the shared object that contains IRELATIVE or jump slot which target is STT_GNU_IFUNC, then possible recursive plt resolve from the dispatcher would cause it. Postpone the resolution for irelative/ifunc right before initializers are called, and drop bind lock around calls to dispatcher. Use initlist to iterate over the objects instead of the ->next, due to drop of the bind lock in iteration. For i386/reloc.c:reloc_iresolve(), fix calculation of the dispatch function address for dso, by taking into account possible non-zero relocbase. MFC after:3 weeks Modified: head/libexec/rtld-elf/amd64/reloc.c head/libexec/rtld-elf/i386/reloc.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/amd64/reloc.c == --- head/libexec/rtld-elf/amd64/reloc.c Wed Dec 14 15:39:51 2011 (r228502) +++ head/libexec/rtld-elf/amd64/reloc.c Wed Dec 14 16:47:53 2011 (r228503) @@ -413,6 +413,8 @@ reloc_iresolve(Obj_Entry *obj, RtldLockS const Elf_Rela *relalim; const Elf_Rela *rela; +if (!obj->irelative) + return (0); relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { Elf_Addr *where, target, *ptr; @@ -424,11 +426,14 @@ reloc_iresolve(Obj_Entry *obj, RtldLockS case R_X86_64_IRELATIVE: ptr = (Elf_Addr *)(obj->relocbase + rela->r_addend); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + lock_release(rtld_bind_lock, lockstate); target = ((Elf_Addr (*)(void))ptr)(); + wlock_acquire(rtld_bind_lock, lockstate); *where = target; break; } } +obj->irelative = false; return (0); } @@ -455,13 +460,15 @@ reloc_gnu_ifunc(Obj_Entry *obj, RtldLock return (-1); if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) continue; + lock_release(rtld_bind_lock, lockstate); target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); reloc_jmpslot(where, target, defobj, obj, (const Elf_Rel *)rela); break; } } obj->gnu_ifunc = false; -return 0; +return (0); } void Modified: head/libexec/rtld-elf/i386/reloc.c == --- head/libexec/rtld-elf/i386/reloc.c Wed Dec 14 15:39:51 2011 (r228502) +++ head/libexec/rtld-elf/i386/reloc.c Wed Dec 14 16:47:53 2011 (r228503) @@ -371,16 +371,21 @@ reloc_iresolve(Obj_Entry *obj, RtldLockS const Elf_Rel *rel; Elf_Addr *where, target; +if (!obj->irelative) + return (0); rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); for (rel = obj->pltrel; rel < rellim; rel++) { switch (ELF_R_TYPE(rel->r_info)) { case R_386_IRELATIVE: where = (Elf_Addr *)(obj->relocbase + rel->r_offset); - target = ((Elf_Addr (*)(void))(*where))(); + lock_release(rtld_bind_lock, lockstate); + target = ((Elf_Addr (*)(void))(obj->relocbase + *where))(); + wlock_acquire(rtld_bind_lock, lockstate); *where = target; break; } } +obj->irelative = false; return (0); } @@ -407,7 +412,9 @@ reloc_gnu_ifunc(Obj_Entry *obj, RtldLock return (-1); if (ELF_ST_TYPE(def->st_info) != STT_GNU_IFUNC) continue; + lock_release(rtld_bind_lock, lockstate); target = (Elf_Addr)rtld_resolve_ifunc(defobj, def); + wlock_acquire(rtld_bind_lock, lockstate); reloc_jmpslot(where, target, defobj, obj, rel); break; } Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cWed Dec 14 15:39:51 2011 (r228502) +++ head/libexec/rtld-elf/rtld.cWed Dec 14 16:47:53 2011 (r228503) @@ -116,6 +116,8 @@ static void objlist_push_tail(Objlist *, static void objlist_remove(Objlist *, Obj_Entry *); static void *path_enumerate(const char *, path_enum_proc, void *); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *, RtldLockState *); +static int resolve_objects_ifunc(Obj_Entry *first, bool bind_now, +RtldLockState *lockstate); stati
Re: svn commit: r228502 - head/sys/dev/viawd
On Wednesday, December 14, 2011 10:39:51 am Fabien Thomas wrote: > Author: fabient > Date: Wed Dec 14 15:39:51 2011 > New Revision: 228502 > URL: http://svn.freebsd.org/changeset/base/228502 > > Log: > Rework the attachement to probe directly on isab(4). > Depend on r228496. > > Requested by: jhb > MFC after: 1 month Thanks! -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228502 - head/sys/dev/viawd
Author: fabient Date: Wed Dec 14 15:39:51 2011 New Revision: 228502 URL: http://svn.freebsd.org/changeset/base/228502 Log: Rework the attachement to probe directly on isab(4). Depend on r228496. Requested by: jhb MFC after:1 month Modified: head/sys/dev/viawd/viawd.c head/sys/dev/viawd/viawd.h Modified: head/sys/dev/viawd/viawd.c == --- head/sys/dev/viawd/viawd.c Wed Dec 14 15:19:40 2011(r228501) +++ head/sys/dev/viawd/viawd.c Wed Dec 14 15:39:51 2011(r228502) @@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$"); #include "viawd.h" -#define viawd_read_wd_4(sc, off) \ - bus_space_read_4((sc)->wd_bst, (sc)->wd_bsh, (off)) -#define viawd_write_wd_4(sc, off, val) \ - bus_space_write_4((sc)->wd_bst, (sc)->wd_bsh, (off), (val)) +#defineviawd_read_4(sc, off) bus_read_4((sc)->wd_res, (off)) +#defineviawd_write_4(sc, off, val) \ + bus_write_4((sc)->wd_res, (off), (val)) static struct viawd_device viawd_devices[] = { { DEVICEID_VT8251, "VIA VT8251 watchdog timer" }, @@ -58,37 +57,17 @@ static struct viawd_device viawd_devices static devclass_t viawd_devclass; -static device_t -viawd_find(struct viawd_device **id_p) -{ - struct viawd_device *id; - device_t sb_dev = NULL; - - /* Look for a supported VIA south bridge. */ - for (id = viawd_devices; id->desc != NULL; ++id) - if ((sb_dev = pci_find_device(VENDORID_VIA, id->device)) != NULL) - break; - - if (sb_dev == NULL) - return (NULL); - - if (id_p != NULL) - *id_p = id; - - return (sb_dev); -} - static void viawd_tmr_state(struct viawd_softc *sc, int enable) { uint32_t reg; - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (enable) reg |= VIAWD_MEM_CTRL_TRIGGER | VIAWD_MEM_CTRL_ENABLE; else reg &= ~VIAWD_MEM_CTRL_ENABLE; - viawd_write_wd_4(sc, VIAWD_MEM_CTRL, reg); + viawd_write_4(sc, VIAWD_MEM_CTRL, reg); } static void @@ -101,7 +80,7 @@ viawd_tmr_set(struct viawd_softc *sc, un else if (timeout > VIAWD_MEM_COUNT_MAX) timeout = VIAWD_MEM_COUNT_MAX; - viawd_write_wd_4(sc, VIAWD_MEM_COUNT, timeout); + viawd_write_4(sc, VIAWD_MEM_COUNT, timeout); sc->timeout = timeout; } @@ -127,35 +106,40 @@ viawd_event(void *arg, unsigned int cmd, viawd_tmr_state(sc, 0); } -static void -viawd_identify(driver_t *driver, device_t parent) +/* Look for a supported VIA south bridge. */ +static struct viawd_device * +viawd_find(device_t dev) { - device_t dev; - device_t sb_dev; - struct viawd_device *id_p; + struct viawd_device *id; - sb_dev = viawd_find(&id_p); - if (sb_dev == NULL) - return; + if (pci_get_vendor(dev) != VENDORID_VIA) + return (NULL); + for (id = viawd_devices; id->desc != NULL; id++) + if (pci_get_device(dev) == id->device) + return (id); + return (NULL); +} - /* Good, add child to bus. */ - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); +static void +viawd_identify(driver_t *driver, device_t parent) +{ - if (dev == NULL) + if (viawd_find(parent) == NULL) return; - device_set_desc_copy(dev, id_p->desc); + if (device_find_child(parent, driver->name, -1) == NULL) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } static int viawd_probe(device_t dev) { + struct viawd_device *id; - /* Do not claim some ISA PnP device by accident. */ - if (isa_get_logicalid(dev) != 0) - return (ENXIO); - return (0); + id = viawd_find(device_get_parent(dev)); + KASSERT(id != NULL, ("parent should be a valid VIA SB")); + device_set_desc(dev, id->desc); + return (BUS_PROBE_GENERIC); } static int @@ -163,13 +147,12 @@ viawd_attach(device_t dev) { device_t sb_dev; struct viawd_softc *sc; - struct viawd_device *id_p; uint32_t pmbase, reg; sc = device_get_softc(dev); sc->dev = dev; - sb_dev = viawd_find(&id_p); + sb_dev = device_get_parent(dev); if (sb_dev == NULL) { device_printf(dev, "Can not find watchdog device.\n"); goto fail; @@ -193,16 +176,14 @@ viawd_attach(device_t dev) device_printf(dev, "Unable to map watchdog memory\n"); goto fail; } - sc->wd_bst = rman_get_bustag(sc->wd_res); - sc->wd_bsh = rman_get_bushandle(sc->wd_res); /* Check if watchdog fired last boot. */ - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg =
svn commit: r228501 - in head/share/man: man4 man7
Author: mav Date: Wed Dec 14 15:19:40 2011 New Revision: 228501 URL: http://svn.freebsd.org/changeset/base/228501 Log: After several suggestions from people, move eventtimers page from 7 to 4. Added: head/share/man/man4/eventtimers.4 - copied unchanged from r228500, head/share/man/man7/eventtimers.7 Deleted: head/share/man/man7/eventtimers.7 Modified: head/share/man/man4/Makefile head/share/man/man4/atrtc.4 head/share/man/man4/attimer.4 head/share/man/man4/hpet.4 head/share/man/man7/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileWed Dec 14 14:55:19 2011 (r228500) +++ head/share/man/man4/MakefileWed Dec 14 15:19:40 2011 (r228501) @@ -116,6 +116,7 @@ MAN=aac.4 \ epair.4 \ esp.4 \ et.4 \ + eventtimers.4 \ exca.4 \ faith.4 \ fatm.4 \ Modified: head/share/man/man4/atrtc.4 == --- head/share/man/man4/atrtc.4 Wed Dec 14 14:55:19 2011(r228500) +++ head/share/man/man4/atrtc.4 Wed Dec 14 15:19:40 2011(r228501) @@ -53,4 +53,4 @@ Event timer provided by the driver is ir .Sh SEE ALSO .Xr attimer 4 , .Xr hpet 4 , -.Xr eventtimers 7 +.Xr eventtimers 4 Modified: head/share/man/man4/attimer.4 == --- head/share/man/man4/attimer.4 Wed Dec 14 14:55:19 2011 (r228500) +++ head/share/man/man4/attimer.4 Wed Dec 14 15:19:40 2011 (r228501) @@ -72,4 +72,4 @@ Event timer provided by the driver is ir .Sh SEE ALSO .Xr atrtc 4 , .Xr hpet 4 , -.Xr eventtimers 7 +.Xr eventtimers 4 Copied: head/share/man/man4/eventtimers.4 (from r228500, head/share/man/man7/eventtimers.7) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/eventtimers.4 Wed Dec 14 15:19:40 2011 (r228501, copy of r228500, head/share/man/man7/eventtimers.7) @@ -0,0 +1,133 @@ +.\" Copyright (c) 2010 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 15, 2010 +.Dt EVENTTIMERS 4 +.Os +.Sh NAME +.Nm eventtimers +.Nd kernel event timers subsystem +.Sh SYNOPSIS +Kernel uses several types of time-related devices, such as: real time clocks, +time counters and event timers. +Real time clocks responsible for tracking real world time, mostly when system +is down. +Time counters are responsible for generation of monotonically increasing +timestamps for precise uptime tracking purposes, when system is running. +Event timers are responsible for generating interrupts at specified time or +periodically, to run different time-based events. +This page is about the last. +.Sh DESCRIPTION +Kernel uses time-based events for many different purposes: scheduling, +statistics, time keeping, profiling and many other things, based on +.Xr callout 9 +mechanism. +These purposes now grouped into three main callbacks: +.Bl -tag +.It hardclock() +.Xr callout 9 +and timekeeping events entry. Called with frequency defined by hz variable, +usually 1000Hz. +.It statclock() +statistics and scheduler events entry. Called with frequency about 128Hz. +.It profclock() +profiler events entry. When enabled, called with frequency about 8KHz. +.El +Different platforms provide different kinds of timer hardware. +The goal of the event timers subsystem is to provide unified way to control +that hardware, and to use it, supplying kern
Re: svn commit: r228495 - head/sys/sys
On Wed, 14 Dec 2011, Ed Schouten wrote: Log: Slightly alter the C1X definitions in in cdefs.h: - Add _Alignas(). Unfortunately this macro is only partially functional. The C1X standard will allow both an integer and a type name to be passed to this macro, while this macro only allows an integer. To be portable, one must use _Alignas(_Alignof(double)) to use type names. This is still quite broken. - Don't do _Static_assert() when __COUNTER__ is not supported. We'd better keep this implementation robust and allow it to be used in header files, without mysteriously breaking older compilers. Not sure about this. Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hWed Dec 14 08:52:27 2011(r228494) +++ head/sys/sys/cdefs.hWed Dec 14 09:09:37 2011(r228495) @@ -222,6 +222,7 @@ * Keywords added in C1X. */ #if defined(__cplusplus) && __cplusplus >= 201103L +#define_Alignas(e) alignas(e) #define _Alignof(e) alignof(e) #define _Noreturn [[noreturn]] #define _Static_assert(e, s)static_assert(e, s) @@ -231,21 +232,23 @@ #else /* Not supported. Implement them manually. */ #ifdef __GNUC__ +#define_Alignas(e) __attribute__((__aligned__(e))) This breaks versions of gcc that don't have __attribute__ or __aligned__. Elsewhere in the same file, use of __attribute__ is restricted starting with the condition: #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && \ !defined(__INTEL_COMPILER) (this actually gives the starting point for 2 attributes, with many necessary and unnecessary convolutions -- see below). and use of __aligned__ is carefully restricted by the condition #if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER) (now it starts with gcc-2.7 where the above starts with gcc-2.5, since __aligned__ apparently wasn't in the original set of attributes). The other places give a definition of __aligned() that can almost be used here. There is a bogus one for lint and a duplicate one for __INTEL_COMPILER. But there is none for !__GNUC_PREREQ__(2, 7) && !__INTEL_COMPILER. That is, all cases where the compiler is either gcc-before-2.6, or non-gcc other than lint and icc, are already broken. #define _Alignof(e) __alignof__(e) This one mainly has a style bug. __alignof__ would be be spelled __alignof if this were FreeBSD code. gcc has accepted all of alignof(), __alignof() and __alignof__() for a long time. I checked this for some gccs back to gcc-2.95.4. It might even work for gcc-1. FreeBSD uses the extra trailing underscores for __attribute__(()) and individual attributes because unlike for __alignof() and __typeof(), gcc used to require them and changing this now would give style bugs. gcc-4.2.1 accepts the __aligned__ attribute, but gcc-3.3.3 doesn't. I don't know when __attribute(()) started working. I checked it for some gccs back to gcc-2.95.4, and all accepted it. #define _Noreturn __attribute__((__noreturn__)) Elsewhere in this file, the __noreturn__ attribute is handled like the __aligned__ attribute, but more carefully, with many style bugs but no bugs as far as I can see: - For lint, the macro that uses it (__dead2) is bogusly defined as nothing. I thought that lint bogusly defines __GNUC__, but can't find this now. Lint should not define __GNUC__ since it only supports a tiny subsets of gcc features like __attribute__(), even with -g. If lint defined __GNUC__, then the extra ifdef for it would be be justified for some of the macros including __dead2/_Noreturn, since __dead2 has no semantic effect so it is safe to make it null for compilers that don't support it. If lint doesn't define __GNUC__ then for __dead2 and now hopefully for _Noreturn, an extra ifdef is not needed since lint is given a null definition in the section for nondescript non-gcc compilers. - For non-gcc, or gcc < 2.5, and not icc, __dead2 is defined as nothing under the condition: #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) - For gcc-2.5 and gcc-2.6, and icc, __attribute__((__noreturn__)) is used to define __dead2 under the condition: #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && \ !defined(__INTEL_COMPILER) Note the style bug in this condition (it doesn't use GNUC_PREREQ()). - For gcc >= 2.7, the definition of __dead2 is duplicated under the condition: #if __GNUC_PREREQ(2, 7) - For icc, the definition of __dead2 is duplicated yet again, under the condition: #if defined(__INTEL_COMPILER) Note the style bug in this (defined() when ifdef would do). There are 2 other definitions under the gcc-2.5, gcc-2.6, or icc ifdef. Only the one for __unused belongs there, since its attribute is new in gcc-2.7. The others should be defin
svn commit: r228500 - head/share/man/man9
Author: glebius Date: Wed Dec 14 14:55:19 2011 New Revision: 228500 URL: http://svn.freebsd.org/changeset/base/228500 Log: More MLINKS for rtalloc.9 Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileWed Dec 14 14:52:50 2011 (r228499) +++ head/share/man/man9/MakefileWed Dec 14 14:55:19 2011 (r228500) @@ -1023,8 +1023,12 @@ MLINKS+=rmlock.9 rm_destroy.9 \ rmlock.9 rm_wunlock.9 MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ + rtalloc.9 RTFREE_LOCKED.9 \ rtalloc.9 RTFREE.9 \ - rtalloc.9 rtfree.9 + rtalloc.9 rtfree.9 \ + rtalloc.9 rtalloc1_fib.9 \ + rtalloc.9 rtalloc_ign_fib.9 \ + rtalloc.9 rtalloc_fib.9 MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228499 - head/share/man/man9
Author: glebius Date: Wed Dec 14 14:52:50 2011 New Revision: 228499 URL: http://svn.freebsd.org/changeset/base/228499 Log: Update this page to describe modern interfaces. Modified: head/share/man/man9/rtalloc.9 Modified: head/share/man/man9/rtalloc.9 == --- head/share/man/man9/rtalloc.9 Wed Dec 14 13:25:00 2011 (r228498) +++ head/share/man/man9/rtalloc.9 Wed Dec 14 14:52:50 2011 (r228499) @@ -28,160 +28,163 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2008 +.Dd December 14, 2011 .Dt RTALLOC 9 .Os .Sh NAME -.Nm rtalloc , -.Nm rtalloc_ign , -.Nm rtalloc1 , -.Nm rtfree +.Nm rtalloc1_fib , +.Nm rtalloc_ign_fib , +.Nm rtalloc_fib .Nd look up a route in the kernel routing table .Sh SYNOPSIS .In sys/types.h .In sys/socket.h .In net/route.h -.Ft void -.Fn rtalloc "struct route *ro" -.Ft void -.Fn rtalloc_ign "struct route *ro" "u_long flags" .Ft "struct rtentry *" -.Fn rtalloc1 "struct sockaddr *sa" "int report" "u_long flags" +.Fn rtalloc1_fib "struct sockaddr *dst" "int report" "u_long flags" "u_int fibnum" .Ft void -.Fn rtfree "struct rt_entry *rt" +.Fn rtalloc_fib "struct route *ro" "u_int fibnum" +.Ft void +.Fn rtalloc_ign_fib "struct route *ro" "u_long flags" "u_int fibnum" +.Fn RTFREE_LOCKED "struct rt_entry *rt" .Fn RTFREE "struct rt_entry *rt" .Fn RT_LOCK "struct rt_entry *rt" .Fn RT_UNLOCK "struct rt_entry *rt" .Fn RT_ADDREF "struct rt_entry *rt" .Fn RT_REMREF "struct rt_entry *rt" +.Ft void +.Fn rtfree "struct rt_entry *rt" +.Ft "struct rtentry *" +.Fn rtalloc1 "struct sockaddr *dst" "int report" "u_long flags" +.Ft void +.Fn rtalloc "struct route *ro" +.Ft void +.Fn rtalloc_ign "struct route *ro" "u_long flags" +.Pp +.Cd options RADIX_MPATH .Sh DESCRIPTION The kernel uses a radix tree structure to manage routes for the networking subsystem. +If compiled with +.Cd options RADIX_MPATH +kernel may maintain several independent forwarding information databases (FIBs). The .Fn rtalloc -family of routines is used by protocols to query this structure for a +family of routines is used by protocols to query these structures for a route corresponding to a particular end-node address, and to cause certain protocol\- and interface-specific actions to take place. -.\" XXX - -mdoc should contain a standard request for getting em and -.\" en dashes. .Pp -.Dv RTF_PRCLONING -flag is obsolete and thus ignored by facility. -If the -.Dv RTF_XRESOLVE -flag is set, then the -.Dv RTM_RESOLVE -message is sent instead on the -.Xr route 4 -socket interface, requesting that an external program resolve the -address in question and modify the route appropriately. -.Pp -The default interface is -.Fn rtalloc . -Its only argument is +The +.Fn rtalloc1_fib +function is the most general form of +.Fn rtalloc , +and all of the other forms are implemented as calls to it. +It takes a +.Fa "struct sockaddr *" +directly as the +.Fa dst +argument. +The second argument, +.Fa report , +controls whether the routing sockets are notified when a lookup fails. +The third argument, +.Fa flags , +is a combination of +the following values: +.Bl -item -offset indent +.It +.Dv RTF_RNH_LOCKED +indicates that the radix tree lock is already held +.El +.Pp +The last argument +.Fa fibnum +specifies number of forwarding information database (FIB) on which +the lookup should be performed. +In case of success the +.Fn rtalloc1_fib +function returns a pointer to a locked +.Vt "struct rtentry" +with an additional reference. +.Pp +The +.Fn rtalloc_fib +is the most simple variant. +Its main argument is .Fa ro , a pointer to a -.Dq Li "struct route" , +.Fa "struct route" , which is defined as follows: .Bd -literal -offset indent struct route { - struct sockaddr ro_dst; struct rtentry *ro_rt; + struct llentry *ro_lle; + struct sockaddr ro_dst; }; .Ed .Pp Thus, this function can only be used for address families which are smaller than the default -.Dq Li "struct sockaddr" . +.Ft "struct sockaddr" . Before calling -.Fn rtalloc +.Fn rtalloc_fib for the first time, callers should ensure that unused bits of the structure are set to zero. +The second argument +.Fa fibnum +is FIB number. +In case of success of the +.Fn rtalloc_fib +the +.Fa ro_rt +points to a valid and unlocked +.Xr rtentry 9 , +which has an additional reference put on it, freeing which is +responsibility of the caller. On subsequent calls, -.Fn rtalloc +.Fn rtalloc_fib returns without performing a lookup if .Fa ro->ro_rt is non-null and the .Dv RTF_UP -flag is set in the route's -.Li rt_flags +flag is set in the rtentry's +.Fa rt_flags field. .Pp The -.Fn rtalloc_ign -interface can be used when the caller does not want to receive -the returned -.Fa rtentry -locked. -The -.Fa ro -argument is the same as -.Fn rtalloc , -but there is additionally a +.Fn rtalloc_ign_fib +function is the same as the +.Fn rtalloc_fib , +but there is
Re: svn commit: r227778 - head/sys/net
On 04/12/2011, at 11:31 PM, Lawrence Stewart wrote: > On 12/03/11 12:02, Jung-uk Kim wrote: >> On Friday 02 December 2011 07:27 pm, Jung-uk Kim wrote: >>> On Thursday 01 December 2011 11:43 pm, Lawrence Stewart wrote: On 12/02/11 03:43, Jung-uk Kim wrote: > On Thursday 01 December 2011 10:11 am, Lawrence Stewart wrote: >> On 11/30/11 05:09, Jung-uk Kim wrote: >>> On Tuesday 29 November 2011 11:13 am, Lawrence Stewart wrote: > [snip] Here's the first of the patches: http://people.freebsd.org/~lstewart/patches/misc/ffclock_bpf _i nt act abi_10.x.r228130.patch >>> >>> I only glanced at it but it looks very close to what I wanted >>> to suggest. >> >> Final candidate patch is at: >> >> http://people.freebsd.org/~lstewart/patches/misc/ffclock_bpf_i >> nt act abi_10.x.r228180.patch >> >> Assuming it passes the "make tinderbox" build I'm currently >> running and no further input is received from interested >> parties, I plan to commit it in ~10 hours. >> >> Changes since the r228130 patch I sent previously: >> >> - The new flags in bpf.h are added unconditionally so that >> they can always be referenced at compile time and a decision >> made at runtime as to whether a flag will be set or not. Using >> one of the new flags when the kernel doesn't have FFCLOCK >> compiled in results in the flag being ignored. An app should >> check for the existence of the "ffclock" kernel feature or the >> "kern.sysclock" sysctl tree before attempting to use the >> flags. >> >> - This patch will hopefully be MFCed at some point, so I added >> a CTASSERT to bpf.c to ensure that the ABI of structs >> bpf_hdr32, bpf_hdr and bpf_xhdr remains intact when FFCLOCK is >> enabled and the union of a ffcounter and struct >> timeval32/timeval/bpf_ts is switched in. >> >> - bpf_gettime() more comprehensively covers all the possible >> cases of flag combination and does sensible things for each >> case (even though some cases are rather silly). >> >> - The snippet of code at the beginning of catchpacket() that >> was manipulating the struct bintime derived from bpf_gettime() >> was gross and has been removed in favour of selecting the >> right {get}bin{up}time() function call in bpf_gettime(). > > I did that to reduce branching. Since you are introducing more > branches, it warrants a function pointer now. >>> >>> There's another reason, BTW. If mbufs are tagged with timestamps >>> (where only monotonic timestamps are allowed), they must be >>> converted within the bpf.c. I forgot all the details. :-( > > We should document this knowledge in some code comments. > I see, thanks for the explanation. Could you elaborate a bit more about how you would implement the function pointer idea? I'm also curious in the !FFCLOCK case just how much overhead having the 2-layer nested if/else adds. I'm not an very optimisation savvy person, but I'm wondering if it's actually worth micro-optimising this code. My initial thoughts about your function pointer idea lead to adding a function pointer in the bpf_d and setting it to the appropriate function to get the timestamp from at bpf_d creation or ioctl time. Whilst I like this idea, I can't see how it would work given that the various functions involved in time/ffcounter stamp generation all have different signatures. We could have multiple variants of bpf_gettime() which each call the appropriate underlying functions to generate the appropriate stamp. Would add quite a lot of code but would reduce the overhead of calling bpf_gettime() to an indirect function call + the underlying stamp generation function call. This also solves the problem of multiple function signatures. >>> >>> Please see my patch: >>> >>> http://people.freebsd.org/~jkim/bpf_ffclock.diff >> >> I booted up the kernel and found it just crashes because of stupid >> typos. Now a new patch is uploaded in place. Sorry. >> >> Anyway, I see no regression nor ABI breakage. :-) > > struct bpf_d being part of the ABI was the main thing I was concerned about, > so given that it isn't I like your approach a lot. > > As noted by Julien, this approach does introduce problems with respect to the > follow up patch that adds a permanent bh_ffcounter member to the bpf header. > I thought the fromclock() API would sufficiently meet the needs of consumers > like BPF, but if we were to proceed with something like Jung-uk's proposed > patch I don't think that's true anymore. > > We decided to bite the bullet and devise an API that is more compact and can > return all appropriate time information from all underlying sysclocks in an > efficient manner - something like a more generic version of > ffclock_abstime(). Juli
Re: svn commit: r228435 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64
On 2011-12-14 13:24, Gerald Pfeifer wrote: > On Mon, 12 Dec 2011, Kostik Belousov wrote: >> Does anybody on toolchain@ know how to submit the gas change to >> maintainers for inclusion into mainline, or better, can submit it >> himself ? I assume that no copyright assignment is required for this >> trivial flip of settings. > > I would just send to binut...@sourceware.org. And indeed, the > patch is sufficiently small not to require copyright assignment > or disclaimer or the like from what I can tell. See the thread starting here: http://cygwin.com/ml/binutils/2011-12/msg00144.html ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: r228377 to r228473 top not working
On Tue, Dec 13, 2011 at 2:43 PM, Eitan Adler wrote: > On Tue, Dec 13, 2011 at 2:34 PM, Ivan Klymenko wrote: >> Hi all! >> I have uname -a >> FreeBSD nonamehost 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r228473M: Tue Dec 13 >> 20:09:45 EET 2011 ivan@nonamehost:/usr/obj/usr/src/sys/mk9 amd64 >> After update source code from r228377 to r228473 "top" stopped working >> >> # top >> top: sysctl(vm.stats.vm.v_active_count...) failed: No such file or directory >> # >> >> There are some ideas? > > Mea Culpa. I am currently testing a patch to fix this. Fixed in r228498 - sorry for taking so long. -- Eitan Adler ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228498 - head/sys/vm
Author: eadler (ports committer) Date: Wed Dec 14 13:25:00 2011 New Revision: 228498 URL: http://svn.freebsd.org/changeset/base/228498 Log: - The previous commit (r228449) accidentally moved the vm.stats.vm.* sysctls to vm.stats.sys. Move them back. Noticed by: pho Reviewed by: bde (earlier version) Approved by: bz MFC after:1 week Pointy hat to:me Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c == --- head/sys/vm/vm_meter.c Wed Dec 14 13:12:55 2011(r228497) +++ head/sys/vm/vm_meter.c Wed Dec 14 13:25:00 2011(r228498) @@ -270,59 +270,62 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, "VM meter vm stats"); SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); -#define VM_STATS_SYS(var, descr) SYSCTL_PROC(_vm_stats_sys, OID_AUTO, var, \ -(CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE), &cnt.v_swtch, 0, vcnt, \ -"IU", descr); +#defineVM_STATS(parent, var, descr) \ + SYSCTL_PROC(parent, OID_AUTO, var, \ + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, &cnt.var, 0, vcnt, \ + "IU", descr) +#defineVM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) +#defineVM_STATS_SYS(var, descr)VM_STATS(_vm_stats_sys, var, descr) VM_STATS_SYS(v_swtch, "Context switches"); VM_STATS_SYS(v_trap, "Traps"); VM_STATS_SYS(v_syscall, "System calls"); VM_STATS_SYS(v_intr, "Device interrupts"); VM_STATS_SYS(v_soft, "Software interrupts"); -VM_STATS_SYS(v_vm_faults, "Address memory faults"); -VM_STATS_SYS(v_cow_faults, "Copy-on-write faults"); -VM_STATS_SYS(v_cow_optim, "Optimized COW faults") -VM_STATS_SYS(v_zfod, "Pages zero-filled on demand") -VM_STATS_SYS(v_ozfod, "Optimized zero fill pages") -VM_STATS_SYS(v_swapin, "Swap pager pageins") -VM_STATS_SYS(v_swapout, "Swap pager pageouts") -VM_STATS_SYS(v_swappgsin, "Swap pages swapped in") -VM_STATS_SYS(v_swappgsout, "Swap pages swapped out") -VM_STATS_SYS(v_vnodein, "Vnode pager pageins") -VM_STATS_SYS(v_vnodeout, "Vnode pager pageouts") -VM_STATS_SYS(v_vnodepgsin, "Vnode pages paged in") -VM_STATS_SYS(v_vnodepgsout, "Vnode pages paged out") -VM_STATS_SYS(v_intrans, "In transit page faults") -VM_STATS_SYS(v_reactivated, "Pages reactivated from free list") -VM_STATS_SYS(v_pdwakeups, "Pagedaemon wakeups") -VM_STATS_SYS(v_pdpages, "Pages analyzed by pagedaemon") -VM_STATS_SYS(v_tcached, "Total pages cached") -VM_STATS_SYS(v_dfree, "Pages freed by pagedaemon") -VM_STATS_SYS(v_pfree, "Pages freed by exiting processes") -VM_STATS_SYS(v_tfree, "Total pages freed") -VM_STATS_SYS(v_page_size, "Page size in bytes") -VM_STATS_SYS(v_page_count, "Total number of pages in system") -VM_STATS_SYS(v_free_reserved, "Pages reserved for deadlock") -VM_STATS_SYS(v_free_target, "Pages desired free") -VM_STATS_SYS(v_free_min, "Minimum low-free-pages threshold") -VM_STATS_SYS(v_free_count, "Free pages") -VM_STATS_SYS(v_wire_count, "Wired pages") -VM_STATS_SYS(v_active_count, "Active pages") -VM_STATS_SYS(v_inactive_target, "Desired inactive pages") -VM_STATS_SYS(v_inactive_count, "Inactive pages") -VM_STATS_SYS(v_cache_count, "Pages on cache queue") -VM_STATS_SYS(v_cache_min, "Min pages on cache queue") -VM_STATS_SYS(v_cache_max, "Max pages on cached queue") -VM_STATS_SYS(v_pageout_free_min, "Min pages reserved for kernel") -VM_STATS_SYS(v_interrupt_free_min, "Reserved pages for interrupt code") -VM_STATS_SYS(v_forks, "Number of fork() calls") -VM_STATS_SYS(v_vforks, "Number of vfork() calls") -VM_STATS_SYS(v_rforks, "Number of rfork() calls") -VM_STATS_SYS(v_kthreads, "Number of fork() calls by kernel") -VM_STATS_SYS(v_forkpages, "VM pages affected by fork()") -VM_STATS_SYS(v_vforkpages, "VM pages affected by vfork()") -VM_STATS_SYS(v_rforkpages, "VM pages affected by rfork()") -VM_STATS_SYS(v_kthreadpages, "VM pages affected by fork() by kernel") +VM_STATS_VM(v_vm_faults, "Address memory faults"); +VM_STATS_VM(v_cow_faults, "Copy-on-write faults"); +VM_STATS_VM(v_cow_optim, "Optimized COW faults"); +VM_STATS_VM(v_zfod, "Pages zero-filled on demand"); +VM_STATS_VM(v_ozfod, "Optimized zero fill pages"); +VM_STATS_VM(v_swapin, "Swap pager pageins"); +VM_STATS_VM(v_swapout, "Swap pager pageouts"); +VM_STATS_VM(v_swappgsin, "Swap pages swapped in"); +VM_STATS_VM(v_swappgsout, "Swap pages swapped out"); +VM_STATS_VM(v_vnodein, "Vnode pager pageins"); +VM_STATS_VM(v_vnodeout, "Vnode pager pageouts"); +VM_STATS_VM(v_vnodepgsin, "Vnode pages paged in"); +VM_STATS_VM(v_vnodepgsout, "Vnode pages paged out"); +VM_STATS_VM(v_intrans, "In transit page faults"); +VM_STATS_VM(v_reactivated, "Pages reactivated from free list"); +VM_STATS_VM(v_pdwakeups, "Pagedaemon wakeups"); +VM_STATS_VM(v_pdpages, "Pages analyzed by pagedaemon"); +VM_STATS_VM(v_tcached, "Total pages cached"); +VM_STATS_VM(v_dfree, "Pages freed by pagedaemon"); +VM_STATS_
svn commit: r228497 - in head/sys/dev/ata: . chipsets
Author: mav Date: Wed Dec 14 13:12:55 2011 New Revision: 228497 URL: http://svn.freebsd.org/changeset/base/228497 Log: Add PCI IDs for the Intel ICH9M SATA controllers. MFC after:2 weeks Modified: head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/ata-pci.h == --- head/sys/dev/ata/ata-pci.h Wed Dec 14 12:34:02 2011(r228496) +++ head/sys/dev/ata/ata-pci.h Wed Dec 14 13:12:55 2011(r228497) @@ -193,6 +193,10 @@ struct ata_pci_controller { #define ATA_I82801IB_AH40x29238086 #define ATA_I82801IB_R1 0x29258086 #define ATA_I82801IB_S2 0x29268086 +#define ATA_I82801IBM_S10x29288086 +#define ATA_I82801IBM_AH0x29298086 +#define ATA_I82801IBM_R10x292a8086 +#define ATA_I82801IBM_S20x292d8086 #define ATA_I82801JIB_S10x3a208086 #define ATA_I82801JIB_AH0x3a228086 #define ATA_I82801JIB_R10x3a258086 Modified: head/sys/dev/ata/chipsets/ata-intel.c == --- head/sys/dev/ata/chipsets/ata-intel.c Wed Dec 14 12:34:02 2011 (r228496) +++ head/sys/dev/ata/chipsets/ata-intel.c Wed Dec 14 13:12:55 2011 (r228497) @@ -157,6 +157,10 @@ ata_intel_probe(device_t dev) { ATA_I82801IB_AH4, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, { ATA_I82801IB_AH6, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, { ATA_I82801IB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9" }, + { ATA_I82801IBM_S1, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9M" }, + { ATA_I82801IBM_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9M" }, + { ATA_I82801IBM_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH9M" }, + { ATA_I82801IBM_S2, 0, INTEL_6CH2, 0, ATA_SA300, "ICH9M" }, { ATA_I82801JIB_S1, 0, INTEL_6CH, 0, ATA_SA300, "ICH10" }, { ATA_I82801JIB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, { ATA_I82801JIB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH10" }, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r228435 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64
On Mon, 12 Dec 2011, Kostik Belousov wrote: > Does anybody on toolchain@ know how to submit the gas change to > maintainers for inclusion into mainline, or better, can submit it > himself ? I assume that no copyright assignment is required for this > trivial flip of settings. I would just send to binut...@sourceware.org. And indeed, the patch is sufficiently small not to require copyright assignment or disclaimer or the like from what I can tell. Gerald ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228496 - head/sys/dev/pci
Author: jhb Date: Wed Dec 14 12:34:02 2011 New Revision: 228496 URL: http://svn.freebsd.org/changeset/base/228496 Log: Implement BUS_ADD_CHILD() for the isab(4) driver. It already calls bus_generic_probe() and bus_generic_attach() to handle drivers that add new children via identify methods. MFC after:1 week Modified: head/sys/dev/pci/isa_pci.c Modified: head/sys/dev/pci/isa_pci.c == --- head/sys/dev/pci/isa_pci.c Wed Dec 14 09:09:37 2011(r228495) +++ head/sys/dev/pci/isa_pci.c Wed Dec 14 12:34:02 2011(r228496) @@ -67,6 +67,7 @@ static device_method_t isab_methods[] = DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ +DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_alloc_resource, isab_pci_alloc_resource), DEVMETHOD(bus_release_resource,isab_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228495 - head/sys/sys
Author: ed Date: Wed Dec 14 09:09:37 2011 New Revision: 228495 URL: http://svn.freebsd.org/changeset/base/228495 Log: Slightly alter the C1X definitions in in cdefs.h: - Add _Alignas(). Unfortunately this macro is only partially functional. The C1X standard will allow both an integer and a type name to be passed to this macro, while this macro only allows an integer. To be portable, one must use _Alignas(_Alignof(double)) to use type names. - Don't do _Static_assert() when __COUNTER__ is not supported. We'd better keep this implementation robust and allow it to be used in header files, without mysteriously breaking older compilers. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hWed Dec 14 08:52:27 2011(r228494) +++ head/sys/sys/cdefs.hWed Dec 14 09:09:37 2011(r228495) @@ -222,6 +222,7 @@ * Keywords added in C1X. */ #if defined(__cplusplus) && __cplusplus >= 201103L +#define_Alignas(e) alignas(e) #define_Alignof(e) alignof(e) #define_Noreturn [[noreturn]] #define_Static_assert(e, s)static_assert(e, s) @@ -231,21 +232,23 @@ #else /* Not supported. Implement them manually. */ #ifdef __GNUC__ +#define_Alignas(e) __attribute__((__aligned__(e))) #define_Alignof(e) __alignof__(e) #define_Noreturn __attribute__((__noreturn__)) #define_Thread_local __thread #else +#define_Alignas(e) #define_Alignof(e) __offsetof(struct { char __a; e __b; }, __b) #define_Noreturn #define_Thread_local #endif #ifdef __COUNTER__ #define_Static_assert(e, s)__Static_assert(e, __COUNTER__) -#else -#define_Static_assert(e, s)__Static_assert(e, __LINE__) -#endif #define__Static_assert(e, c) ___Static_assert(e, c) #define___Static_assert(e, c) typedef char __assert ## c[(e) ? 1 : -1] +#else +#define_Static_assert(e, s) +#endif #endif #if __GNUC_PREREQ__(2, 96) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228494 - head/sys/dev/usb/wlan
Author: hselasky Date: Wed Dec 14 08:52:27 2011 New Revision: 228494 URL: http://svn.freebsd.org/changeset/base/228494 Log: Fix for random USB transfer time out. Submitted by: PseudoCylon MFC after:3 days Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c == --- head/sys/dev/usb/wlan/if_run.c Wed Dec 14 08:44:16 2011 (r228493) +++ head/sys/dev/usb/wlan/if_run.c Wed Dec 14 08:52:27 2011 (r228494) @@ -2720,7 +2720,6 @@ run_bulk_tx_callbackN(struct usb_xfer *x struct run_endpoint_queue *pq = &sc->sc_epq[index]; struct mbuf *m; usb_frlength_t size; - unsigned int len; int actlen; int sumlen; @@ -2783,13 +2782,10 @@ tr_setup: ieee80211_radiotap_tx(vap, m); } - /* align end on a 4-bytes boundary */ - len = (size + IEEE80211_CRC_LEN + m->m_pkthdr.len + 3) & ~3; + DPRINTFN(11, "sending frame len=%u @ index %d\n", + m->m_pkthdr.len, index); - DPRINTFN(11, "sending frame len=%u xferlen=%u @ index %d\n", - m->m_pkthdr.len, len, index); - - usbd_xfer_set_frame_len(xfer, 0, len); + usbd_xfer_set_frame_len(xfer, 0, size + m->m_pkthdr.len); usbd_xfer_set_priv(xfer, data); usbd_transfer_submit(xfer); @@ -2878,6 +2874,7 @@ run_bulk_tx_callback5(struct usb_xfer *x static void run_set_tx_desc(struct run_softc *sc, struct run_tx_data *data) { + static const uint8_t ztail[16]; struct mbuf *m = data->m; struct ieee80211com *ic = sc->sc_ifp->if_l2com; struct ieee80211vap *vap = data->ni->ni_vap; @@ -2934,6 +2931,13 @@ run_set_tx_desc(struct run_softc *sc, st if (vap->iv_opmode != IEEE80211_M_STA && !IEEE80211_QOS_HAS_SEQ(wh)) txwi->xflags |= RT2860_TX_NSEQ; + + /* +* Align end on a 4-byte boundary, pad 8 bytes (CRC + 4-byte padding), +* and be sure to zero those trailing bytes. +*/ + m_append(m, ((m->m_pkthdr.len + 3) & ~3) - m->m_pkthdr.len + 8, + (c_caddr_t)ztail); } /* This function must be called locked */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228493 - head/sys/dev/usb/controller
Author: hselasky Date: Wed Dec 14 08:44:16 2011 New Revision: 228493 URL: http://svn.freebsd.org/changeset/base/228493 Log: Fix definition of XHCI port power bit. Reported by: Kohji Okuno MFC after:3 days Modified: head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/usb/controller/xhcireg.h == --- head/sys/dev/usb/controller/xhcireg.h Wed Dec 14 08:35:08 2011 (r228492) +++ head/sys/dev/usb/controller/xhcireg.h Wed Dec 14 08:44:16 2011 (r228493) @@ -115,7 +115,7 @@ #defineXHCI_PS_PR 0x0010 /* RW - port reset */ #defineXHCI_PS_PLS_GET(x) (((x) >> 5) & 0xF) /* RW - port link state */ #defineXHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ -#defineXHCI_PS_PP 0x0100 /* RW - port power */ +#defineXHCI_PS_PP 0x0200 /* RW - port power */ #defineXHCI_PS_SPEED_GET(x)(((x) >> 10) & 0xF) /* RO - port speed */ #defineXHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ #defineXHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r228492 - head/lib/libc/gen
Author: ru Date: Wed Dec 14 08:35:08 2011 New Revision: 228492 URL: http://svn.freebsd.org/changeset/base/228492 Log: Clean up includes; the prototype for getosreldate() has moved to in r183390. Modified: head/lib/libc/gen/getosreldate.c Modified: head/lib/libc/gen/getosreldate.c == --- head/lib/libc/gen/getosreldate.cWed Dec 14 05:34:23 2011 (r228491) +++ head/lib/libc/gen/getosreldate.cWed Dec 14 08:35:08 2011 (r228492) @@ -33,12 +33,11 @@ static char sccsid[] = "@(#)gethostid.c #include __FBSDID("$FreeBSD$"); -#include +#include #include -#include -#include -#include +#include +#include int getosreldate(void) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"