From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 00:07:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B45A5106564A; Sun, 12 Dec 2010 00:07:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29D48FC14; Sun, 12 Dec 2010 00:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBC07R6t021966; Sun, 12 Dec 2010 00:07:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBC07R7L021962; Sun, 12 Dec 2010 00:07:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012120007.oBC07R7L021962@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Dec 2010 00:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216387 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 00:07:27 -0000 Author: jilles Date: Sun Dec 12 00:07:27 2010 New Revision: 216387 URL: http://svn.freebsd.org/changeset/base/216387 Log: sh: Remove the herefd hack. The herefd hack wrote out partial here documents while expanding them. It seems unnecessary complication given that other expansions just allocate memory. It causes bugs because the stack is also used for intermediate results such as arithmetic expressions. Such places should disable herefd for the duration but not all of them do, and I prefer removing the need for disabling herefd to disabling it everywhere needed. Here documents larger than 1024 bytes will use a bit more CPU time and memory. Additionally this allows a later change to expand here documents in the current shell environment. (This is faster for small here documents but also changes behaviour.) Obtained from: dash Modified: head/bin/sh/expand.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Dec 11 23:48:10 2010 (r216386) +++ head/bin/sh/expand.c Sun Dec 12 00:07:27 2010 (r216387) @@ -132,7 +132,6 @@ collate_range_cmp(int c1, int c2) void expandhere(union node *arg, int fd) { - herefd = fd; expandarg(arg, (struct arglist *)NULL, 0); xwrite(fd, stackblock(), expdest - stackblock()); } @@ -469,7 +468,6 @@ expbackq(union node *cmd, int quoted, in char lastc; int startloc = dest - stackblock(); char const *syntax = quoted? DQSYNTAX : BASESYNTAX; - int saveherefd; int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR); int nnl; @@ -477,15 +475,12 @@ expbackq(union node *cmd, int quoted, in saveifs = ifsfirst; savelastp = ifslastp; saveargbackq = argbackq; - saveherefd = herefd; - herefd = -1; p = grabstackstr(dest); evalbackcmd(cmd, &in); ungrabstackstr(p, dest); ifsfirst = saveifs; ifslastp = savelastp; argbackq = saveargbackq; - herefd = saveherefd; p = in.buf; lastc = '\0'; @@ -544,16 +539,13 @@ subevalvar(char *p, char *str, int strlo char *loc = NULL; char *q; int c = 0; - int saveherefd = herefd; struct nodelist *saveargbackq = argbackq; int amount; - herefd = -1; argstr(p, (subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX || subtype == VSTRIMRIGHT || subtype == VSTRIMRIGHTMAX ? EXP_CASE : 0) | EXP_TILDE); STACKSTRNUL(expdest); - herefd = saveherefd; argbackq = saveargbackq; startp = stackblock() + startloc; if (str == NULL) Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Sat Dec 11 23:48:10 2010 (r216386) +++ head/bin/sh/memalloc.c Sun Dec 12 00:07:27 2010 (r216387) @@ -128,7 +128,6 @@ static struct stackmark *markp; char *stacknxt; int stacknleft; int sstrnleft; -int herefd = -1; static void @@ -309,11 +308,6 @@ growstackstr(void) int len; len = stackblocksize(); - if (herefd >= 0 && len >= 1024) { - xwrite(herefd, stackblock(), len); - sstrnleft = len; - return stackblock(); - } return growstrstackblock(len); } Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Sat Dec 11 23:48:10 2010 (r216386) +++ head/bin/sh/memalloc.h Sun Dec 12 00:07:27 2010 (r216387) @@ -46,7 +46,6 @@ struct stackmark { extern char *stacknxt; extern int stacknleft; extern int sstrnleft; -extern int herefd; pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 06:00:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1E6106564A; Sun, 12 Dec 2010 06:00:26 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78B848FC16; Sun, 12 Dec 2010 06:00:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBC60Qnn035634; Sun, 12 Dec 2010 06:00:26 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBC60Q2E035623; Sun, 12 Dec 2010 06:00:26 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012120600.oBC60Q2E035623@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 12 Dec 2010 06:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216390 - in head/sys/mips: conf rmi rmi/dev/iic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 06:00:26 -0000 Author: jchandra Date: Sun Dec 12 06:00:26 2010 New Revision: 216390 URL: http://svn.freebsd.org/changeset/base/216390 Log: I2C drivers for XLR/XLS processors. - Major update to xlr_i2c.c: do multi-byte ops correctly, remove unnecessary code, add mutex to protect bus operations, style(9) fixes. - Drivers for I2C devices on XLR/XLS engineering boards, ds1374u RTC, max6657 temparature sensor and at24co2n EEPROM. Submitted by: Sreekanth M. S. (kanthms at netlogicmicro com) Added: head/sys/mips/rmi/dev/iic/ head/sys/mips/rmi/dev/iic/at24co2n.c (contents, props changed) head/sys/mips/rmi/dev/iic/ds1374u.c (contents, props changed) head/sys/mips/rmi/dev/iic/max6657.c (contents, props changed) Modified: head/sys/mips/conf/XLR head/sys/mips/rmi/board.c head/sys/mips/rmi/board.h head/sys/mips/rmi/files.xlr head/sys/mips/rmi/iodi.c head/sys/mips/rmi/xlr_i2c.c Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/conf/XLR Sun Dec 12 06:00:26 2010 (r216390) @@ -143,13 +143,13 @@ device umass # Disks/ #i2c # Not yet -#device ic -#device iic -#device iicbb -#device iicbus -#device xlr_rtc -#device xlr_temperature -#device xlr_eeprom +device ic +device iic +device iicbb +device iicbus +device ds1374u # RTC on XLR boards +device max6657 # Temparature sensor on XLR boards +device at24co2n # EEPROM on XLR boards #crypto # Not yet Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/rmi/board.c Sun Dec 12 06:00:26 2010 (r216390) @@ -42,6 +42,11 @@ __FBSDID("$FreeBSD$"); #include #include +#define XLR_I2C_RTC_ADDR 0xd0 +#define XLR_I2C_EEPROM_ADDR 0xa0 +#define XLR_I2C_TEMPSENSOR_ADDR 0x98 +#define XLR_I2C_ATX8_TEMPSENSOR_ADDR 0x9a + struct stn_cc *xlr_core_cc_configs[] = { &cc_table_cpu_0, &cc_table_cpu_1, &cc_table_cpu_2, &cc_table_cpu_3, &cc_table_cpu_4, &cc_table_cpu_5, &cc_table_cpu_6, &cc_table_cpu_7}; @@ -231,6 +236,7 @@ xls_board_specific_overrides(struct xlr_ { struct xlr_gmac_block_t *blk0, *blk1; int i; + struct xlr_i2c_dev_t* iic_blk; blk0 = &board->gmac_block[0]; blk1 = &board->gmac_block[1]; @@ -283,7 +289,11 @@ xls_board_specific_overrides(struct xlr_ break; case RMI_XLR_BOARD_ARIZONA_VIII: - if (blk1->enabled) { + iic_blk = &xlr_board_info.xlr_i2c_device[I2C_THERMAL]; + if (iic_blk->enabled) { + iic_blk->addr = XLR_I2C_ATX8_TEMPSENSOR_ADDR; + } + if (blk1->enabled) { /* There is just one Octal PHY on the board and it is * connected to the MII interface for NA Quad 0. */ for (i = 0; i < 4; i++) { @@ -358,6 +368,7 @@ int xlr_board_info_setup() { struct xlr_gmac_block_t *blk0, *blk1, *blk2; + struct xlr_i2c_dev_t* iic_blk; int i; /* This setup code is long'ish because the same base driver @@ -412,6 +423,14 @@ xlr_board_info_setup() blk0 = &xlr_board_info.gmac_block[0]; blk1 = &xlr_board_info.gmac_block[1]; blk2 = &xlr_board_info.gmac_block[2]; + + iic_blk = xlr_board_info.xlr_i2c_device; + iic_blk[I2C_RTC].enabled = 1; + iic_blk[I2C_RTC].addr = XLR_I2C_RTC_ADDR; + iic_blk[I2C_THERMAL].enabled = 1; + iic_blk[I2C_THERMAL].addr = XLR_I2C_TEMPSENSOR_ADDR; + iic_blk[I2C_EEPROM].enabled = 1; + iic_blk[I2C_EEPROM].addr = XLR_I2C_EEPROM_ADDR; if (xlr_is_xls()) { xlr_board_info.is_xls = 1; Modified: head/sys/mips/rmi/board.h ============================================================================== --- head/sys/mips/rmi/board.h Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/rmi/board.h Sun Dec 12 06:00:26 2010 (r216390) @@ -195,6 +195,7 @@ xlr_is_xls_b0(void) /* all our knowledge of chip and board that cannot be detected run-time goes here */ enum gmac_block_types { XLR_GMAC, XLR_XGMAC, XLR_SPI4}; enum gmac_port_types { XLR_RGMII, XLR_SGMII, XLR_PORT0_RGMII, XLR_XGMII, XLR_XAUI }; +enum i2c_dev_types { I2C_RTC, I2C_THERMAL, I2C_EEPROM }; struct xlr_board_info { int is_xls; @@ -207,6 +208,13 @@ struct xlr_board_info { struct bucket_size *bucket_sizes; /* pointer to Core station bucket */ int *msgmap; /* mapping of message station to devices */ int gmacports; /* number of gmac ports on the board */ + struct xlr_i2c_dev_t { + uint32_t addr; + unsigned int enabled; /* mask of devs enabled */ + int type; + int unit; + char *dev_name; + } xlr_i2c_device[3]; struct xlr_gmac_block_t { /* refers to the set of GMACs controlled by a network accelarator */ int type; /* see enum gmac_block_types */ Added: head/sys/mips/rmi/dev/iic/at24co2n.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/dev/iic/at24co2n.c Sun Dec 12 06:00:26 2010 (r216390) @@ -0,0 +1,145 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * RMI_BSD */ + +#include +__FBSDID("$FreeBSD$"); +/* + * reading eeprom for the mac address . + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "iicbus_if.h" + +#define AT24CO_EEPROM_ETH_MACADDR 0x20 + +struct at24co2n_softc { + uint32_t sc_addr; + device_t sc_dev; + struct mtx sc_mtx; + uint8_t sc_mac_addr[6]; +}; + +static void at24co2n_read_mac(struct at24co2n_softc *); + +static int +at24co2n_probe(device_t dev) +{ + device_set_desc(dev, "AT24Co2N-10SE-2.7 EEPROM for mac address"); + return (0); +} + +static int +at24co2n_mac_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct at24co2n_softc *sc = arg1; + char buf[24]; + int len; + uint8_t *p; + + at24co2n_read_mac(sc); + p = sc->sc_mac_addr; + len = snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x", + p[0], p[1], p[2], p[3], p[4], p[5]); + return SYSCTL_OUT(req, buf, len); +} + + +static int +at24co2n_attach(device_t dev) +{ + struct at24co2n_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + + if(sc == NULL) { + printf("at24co2n_attach device_get_softc failed\n"); + return (0); + } + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + mtx_init(&sc->sc_mtx, "eeprom", "eeprom", MTX_DEF); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "eeprom-mac", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + at24co2n_mac_sysctl, "A", "mac address"); + + return (0); +} + +static void +at24co2n_read_mac(struct at24co2n_softc *sc) +{ + uint8_t addr = AT24CO_EEPROM_ETH_MACADDR; + struct iic_msg msgs[2] = { + { sc->sc_addr, IIC_M_WR, 1, &addr }, + { sc->sc_addr, IIC_M_RD, 6, sc->sc_mac_addr}, + }; + + mtx_lock(&sc->sc_mtx); + iicbus_transfer(sc->sc_dev, msgs, 2); + mtx_unlock(&sc->sc_mtx); +} + +static device_method_t at24co2n_methods[] = { + DEVMETHOD(device_probe, at24co2n_probe), + DEVMETHOD(device_attach, at24co2n_attach), + + {0, 0}, +}; + +static driver_t at24co2n_driver = { + "at24co2n", + at24co2n_methods, + sizeof(struct at24co2n_softc), +}; +static devclass_t at24co2n_devclass; + +DRIVER_MODULE(at24co2n, iicbus, at24co2n_driver, at24co2n_devclass, 0, 0); +MODULE_VERSION(at24co2n, 1); +MODULE_DEPEND(at24co2n, iicbus, 1, 1, 1); Added: head/sys/mips/rmi/dev/iic/ds1374u.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/dev/iic/ds1374u.c Sun Dec 12 06:00:26 2010 (r216390) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * RMI_BSD */ + +#include +__FBSDID("$FreeBSD$"); +/* + * RTC chip sitting on the I2C bus. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "iicbus_if.h" +#include "clock_if.h" + +#define DS1374_RTC_COUNTER 0 /* counter (bytes 0-3) */ + +struct ds1374u_softc { + uint32_t sc_addr; + device_t sc_dev; +}; + +static int +ds1374u_probe(device_t dev) +{ + device_set_desc(dev, "DS1374U-33 RTC"); + return (0); +} + +static int +ds1374u_attach(device_t dev) +{ + struct ds1374u_softc *sc = device_get_softc(dev); + + if(sc==NULL) { + printf("ds1374u_attach device_get_softc failed\n"); + return (0); + } + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + clock_register(dev, 1000); + return (0); +} + + +static int +ds1374u_write(device_t dev, int reg, uint8_t val) +{ + uint8_t data[2]; + struct ds1374u_softc *sc = device_get_softc(dev); + struct iic_msg msgs[1] = { + { sc->sc_addr, IIC_M_WR, 2, data }, + }; + + data[0] = reg; + data[1] = val; + if (iicbus_transfer(dev, msgs, 1) == 0) + return (0); + else + return (-1); +} + +static int +ds1374u_settime(device_t dev, struct timespec *ts) +{ + int i; + int temp = 0; + + for (i = 0; i < 4; i++) { + temp = (ts->tv_sec >> (8*i)) & 0xff; + if (ds1374u_write(dev, DS1374_RTC_COUNTER+i, temp)!=0) + return (-1); + } + return 0; +} + +static int +ds1374u_gettime(device_t dev, struct timespec *ts) +{ + struct ds1374u_softc *sc = device_get_softc(dev); + uint8_t addr[1] = { DS1374_RTC_COUNTER }; + uint8_t secs[4]; + struct iic_msg msgs[2] = { + { sc->sc_addr, IIC_M_WR, 1, addr }, + { sc->sc_addr, IIC_M_RD, 4, secs }, + }; + int error; + + error = iicbus_transfer(dev, msgs, 2); + if (error == 0) { + /* counter has seconds since epoch */ + ts->tv_sec = (secs[3] << 24) | (secs[2] << 16) + | (secs[1] << 8) | (secs[0] << 0); + ts->tv_nsec = 0; + } + return error; + return 0; +} + +static device_method_t ds1374u_methods[] = { + DEVMETHOD(device_probe, ds1374u_probe), + DEVMETHOD(device_attach, ds1374u_attach), + + DEVMETHOD(clock_gettime, ds1374u_gettime), + DEVMETHOD(clock_settime, ds1374u_settime), + + {0, 0}, +}; + +static driver_t ds1374u_driver = { + "ds1374u", + ds1374u_methods, + sizeof(struct ds1374u_softc), +}; +static devclass_t ds1374u_devclass; + +DRIVER_MODULE(ds1374u, iicbus, ds1374u_driver, ds1374u_devclass, 0, 0); +MODULE_VERSION(ds1374u, 1); +MODULE_DEPEND(ds1374u, iicbus, 1, 1, 1); Added: head/sys/mips/rmi/dev/iic/max6657.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/dev/iic/max6657.c Sun Dec 12 06:00:26 2010 (r216390) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2003-2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of RMI Corporation, nor the names of its contributors, + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * RMI_BSD */ + +#include +__FBSDID("$FreeBSD$"); +/* + * temperature sensor chip sitting on the I2C bus. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "iicbus_if.h" + +#define MAX6657_EXT_TEMP 1 + +struct max6657_softc { + uint32_t sc_addr; + device_t sc_dev; + struct mtx sc_mtx; + int sc_curtemp; + int sc_lastupdate; /* in ticks */ +}; + +static void max6657_update(struct max6657_softc *); +static int max6657_read(device_t dev, uint32_t addr, int reg) ; + +static int +max6657_probe(device_t dev) +{ + device_set_desc(dev, "MAX6657MSA Temperature Sensor"); + return (0); +} + +static int +max6657_sysctl_temp(SYSCTL_HANDLER_ARGS) +{ + struct max6657_softc *sc = arg1; + int temp; + + max6657_update(sc); + temp = sc->sc_curtemp ; + return sysctl_handle_int(oidp, &temp, 0, req); +} + +static int +max6657_attach(device_t dev) +{ + struct max6657_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + + if(sc==NULL) { + printf("max6657_attach device_get_softc failed\n"); + return (0); + } + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + mtx_init(&sc->sc_mtx, "max6657", "max6657", MTX_DEF); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + max6657_sysctl_temp, "I", "operating temperature"); + + device_printf(dev, "Chip temperature {%d} Degree Celsius\n", + max6657_read(sc->sc_dev, sc->sc_addr, MAX6657_EXT_TEMP)); + + return (0); +} + +static int +max6657_read(device_t dev, uint32_t slave_addr, int reg) +{ + uint8_t addr = reg; + uint8_t data[1]; + struct iic_msg msgs[2] = { + { slave_addr, IIC_M_WR, 1, &addr }, + { slave_addr, IIC_M_RD, 1, data }, + }; + + return iicbus_transfer(dev, msgs, 2) != 0 ? -1 : data[0]; +} + + +static void +max6657_update(struct max6657_softc *sc) +{ + int v; + + mtx_lock(&sc->sc_mtx); + /* NB: no point in updating any faster than the chip */ + if (ticks - sc->sc_lastupdate > hz) { + v = max6657_read(sc->sc_dev, sc->sc_addr, MAX6657_EXT_TEMP); + if (v >= 0) + sc->sc_curtemp = v; + sc->sc_lastupdate = ticks; + } + mtx_unlock(&sc->sc_mtx); +} + +static device_method_t max6657_methods[] = { + DEVMETHOD(device_probe, max6657_probe), + DEVMETHOD(device_attach, max6657_attach), + + {0, 0}, +}; + +static driver_t max6657_driver = { + "max6657", + max6657_methods, + sizeof(struct max6657_softc), +}; +static devclass_t max6657_devclass; + +DRIVER_MODULE(max6657, iicbus, max6657_driver, max6657_devclass, 0, 0); +MODULE_VERSION(max6657, 1); +MODULE_DEPEND(max6657, iicbus, 1, 1, 1); Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/rmi/files.xlr Sun Dec 12 06:00:26 2010 (r216390) @@ -22,6 +22,6 @@ mips/rmi/dev/sec/rmisec.c optional rmi mips/rmi/dev/sec/rmilib.c optional rmisec mips/rmi/dev/xlr/rge.c optional rge mips/rmi/dev/nlge/if_nlge.c optional nlge -dev/iicbus/xlr_rtc.c optional xlr_rtc -dev/iicbus/xlr_temperature.c optional xlr_temperature -dev/iicbus/xlr_eeprom.c optional xlr_eeprom +mips/rmi/dev/iic/ds1374u.c optional ds1374u +mips/rmi/dev/iic/max6657.c optional max6657 +mips/rmi/dev/iic/at24co2n.c optional at24co2n Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/rmi/iodi.c Sun Dec 12 06:00:26 2010 (r216390) @@ -212,6 +212,7 @@ iodi_attach(device_t dev) */ device_add_child(dev, "uart", 0); device_add_child(dev, "xlr_i2c", 0); + device_add_child(dev, "xlr_i2c", 1); device_add_child(dev, "pcib", 0); device_add_child(dev, "rmisec", -1); Modified: head/sys/mips/rmi/xlr_i2c.c ============================================================================== --- head/sys/mips/rmi/xlr_i2c.c Sun Dec 12 01:26:14 2010 (r216389) +++ head/sys/mips/rmi/xlr_i2c.c Sun Dec 12 06:00:26 2010 (r216390) @@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -46,44 +48,42 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include "iicbus_if.h" -#define DEVTOIICBUS(dev) ((struct iicbus_device*)device_get_ivars(dev)) +/* XLR I2C REGISTERS */ +#define XLR_I2C_CFG 0x00 +#define XLR_I2C_CLKDIV 0x01 +#define XLR_I2C_DEVADDR 0x02 +#define XLR_I2C_ADDR 0x03 +#define XLR_I2C_DATAOUT 0x04 +#define XLR_I2C_DATAIN 0x05 +#define XLR_I2C_STATUS 0x06 +#define XLR_I2C_STARTXFR 0x07 +#define XLR_I2C_BYTECNT 0x08 +#define XLR_I2C_HDSTATIM 0x09 + +/* XLR I2C REGISTERS FLAGS */ +#define XLR_I2C_BUS_BUSY 0x01 +#define XLR_I2C_SDOEMPTY 0x02 +#define XLR_I2C_RXRDY 0x04 +#define XLR_I2C_ACK_ERR 0x08 +#define XLR_I2C_ARB_STARTERR 0x30 + +/* Register Programming Values!! Change as required */ +#define XLR_I2C_CFG_ADDR 0xF8 /* 8-Bit dev Addr + POR Values */ +#define XLR_I2C_CFG_NOADDR 0xFA /* 8-Bit reg Addr + POR Values : No dev addr */ +#define XLR_I2C_STARTXFR_ND 0x02 /* No data , only addr */ +#define XLR_I2C_STARTXFR_RD 0x01 /* Read */ +#define XLR_I2C_STARTXFR_WR 0x00 /* Write */ +#define XLR_I2C_CLKDIV_DEF 0x14A /* 0x00000052 */ +#define XLR_I2C_HDSTATIM_DEF 0x107 /* 0x00000000 */ -#define I2C_PALM_CFG 0x00 -#define I2C_PALM_CLKDIV 0x01 -#define I2C_PALM_DEVADDR 0x02 -#define I2C_PALM_ADDR 0x03 -#define I2C_PALM_DATAOUT 0x04 -#define I2C_PALM_DATAIN 0x05 -#define I2C_PALM_STATUS 0x06 -#define I2C_PALM_STARTXFR 0x07 -#define I2C_PALM_BYTECNT 0x08 -#define I2C_PALM_HDSTATIM 0x09 - -/* TEST Values!! Change as required */ -#define I2C_PALM_CFG_DEF 0x000000F8 /* 8-Bit Addr + POR Values */ -#define I2C_PALM_CLKDIV_DEF 0x14A //0x00000052 -#define I2C_PALM_HDSTATIM_DEF 0x107 //0x00000000 - -#define I2C_PALM_STARTXFR_RD 0x00000001 -#define I2C_PALM_STARTXFR_WR 0x00000000 - - -#define PHOENIX_IO_I2C_0_OFFSET 0x16000 -#define PHOENIX_IO_I2C_1_OFFSET 0x17000 - -#define ARIZONA_I2c_BUS 1 - -int bus = 1; - - -uint8_t current_slave; -uint8_t read_address; -static xlr_reg_t *iobase_i2c_regs; +#define MAXTIME 0x10000 +#define ARIZONA_I2C_BUS 1 static devclass_t xlr_i2c_devclass; @@ -97,206 +97,61 @@ static int xlr_i2c_detach(device_t); static int xlr_i2c_start(device_t dev, u_char slave, int timeout); static int xlr_i2c_stop(device_t dev); static int xlr_i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay); -static int xlr_i2c_write(device_t dev, char *buf, int len, int *sent, int timeout); - +static int xlr_i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout); +static int xlr_i2c_callback(device_t dev, int index, caddr_t data); +static int xlr_i2c_repeated_start(device_t dev, u_char slave, int timeout); +static int xlr_i2c_transfer(device_t bus, struct iic_msg *msgs, uint32_t nmsgs); struct xlr_i2c_softc { - device_t dev; /* Myself */ + device_t dev; /* Self */ struct resource *mem_res; /* Memory resource */ volatile int flags; -#define RXRDY 4 -#define TXRDY 0x10 int sc_started; - int twi_addr; + uint8_t i2cdev_addr; + xlr_reg_t *iobase_i2c_regs; device_t iicbus; + struct mtx sc_mtx; }; - -#define MDELAY(a){ \ - unsigned long local_loop = 0xfffff; \ - while(local_loop--); \ -}\ - -static void -get_i2c_base(void) +static void +set_i2c_base(device_t dev) { - if (bus == 0) - iobase_i2c_regs = xlr_io_mmio(PHOENIX_IO_I2C_0_OFFSET); + struct xlr_i2c_softc *sc; + + sc = device_get_softc(dev); + if (device_get_unit(dev) == 0) + sc->iobase_i2c_regs = xlr_io_mmio(XLR_IO_I2C_0_OFFSET); else - iobase_i2c_regs = xlr_io_mmio(PHOENIX_IO_I2C_1_OFFSET); - return; + sc->iobase_i2c_regs = xlr_io_mmio(XLR_IO_I2C_1_OFFSET); } static void -palm_write(int reg, int value) +xlr_i2c_dev_write(device_t dev, int reg, int value) { - get_i2c_base(); - xlr_write_reg(iobase_i2c_regs, reg, value); + struct xlr_i2c_softc *sc; + + sc = device_get_softc(dev); + xlr_write_reg(sc->iobase_i2c_regs, reg, value); return; } static int -palm_read(int reg) +xlr_i2c_dev_read(device_t dev, int reg) { uint32_t val; + struct xlr_i2c_softc *sc; - get_i2c_base(); - val = xlr_read_reg(iobase_i2c_regs, reg); + sc = device_get_softc(dev); + val = xlr_read_reg(sc->iobase_i2c_regs, reg); return ((int)val); } -static int -palm_addr_only(uint8_t addr, uint8_t offset) -{ - volatile uint32_t regVal = 0x00; - - palm_write(I2C_PALM_ADDR, offset); - palm_write(I2C_PALM_DEVADDR, addr); - palm_write(I2C_PALM_CFG, 0xfa); - palm_write(I2C_PALM_STARTXFR, 0x02); - regVal = palm_read(I2C_PALM_STATUS); - if (regVal & 0x0008) { - printf("palm_addr_only: ACKERR. Aborting...\n"); - return -1; - } - return 0; -} - - -static int -palm_rx(uint8_t addr, uint8_t offset, uint8_t len, - uint8_t * buf) -{ - volatile uint32_t regVal = 0x00, ctr = 0x00; - int timeOut, numBytes = 0x00; - - palm_write(I2C_PALM_CFG, 0xfa); - palm_write(I2C_PALM_BYTECNT, len); - palm_write(I2C_PALM_DEVADDR, addr); - //DEVADDR = 0x4c, 0x68 - MDELAY(1); - - for (numBytes = 0x00; numBytes < len; numBytes++) { - palm_write(I2C_PALM_ADDR, offset + numBytes); -//I2C_PALM_ADDR:offset - MDELAY(1); - if (!ctr) { - /* Trigger a READ Transaction */ - palm_write(I2C_PALM_STARTXFR, I2C_PALM_STARTXFR_RD); - ctr++; - } - /* Error Conditions [Begin] */ - regVal = palm_read(I2C_PALM_STATUS); - MDELAY(1); - if (regVal & 0x0008) { - printf("palm_rx: ACKERR. Aborting...\n"); - return -1; - } - timeOut = 10; - while ((regVal & 0x0030) && timeOut--) { - palm_write(I2C_PALM_STARTXFR, I2C_PALM_STARTXFR_RD); - regVal = palm_read(I2C_PALM_STATUS); - } - if (timeOut == 0x00) { - printf("palm_rx: TimedOut on Valid STARTXFR/Arbitration\n"); - return -1; - } - timeOut = 10; - /* Do we have valid data from the device yet..? */ - regVal &= 0x0004; - while (!regVal && timeOut--) { - regVal = palm_read(I2C_PALM_STATUS) & 0x0004; - } - if (timeOut == 0x00) { - printf("palm_rx: TimedOut Waiting for Valid Data\n"); - return -1; - } - /* Error Conditions [End] */ - /* Read the data */ - buf[numBytes] = (uint8_t) palm_read(I2C_PALM_DATAIN); - } - return 0; -} - - - -static int -wait_for_idle(void) -{ - int timeOut = 0x1000; - volatile uint32_t regVal = 0x00; - - regVal = palm_read(I2C_PALM_STATUS) & 0x0001; - while (regVal && timeOut--) { - regVal = palm_read(I2C_PALM_STATUS) & 0x0001; - } - if (timeOut == 0x00) - return -1; /* Timed Out */ - else - return 0; -} - - -static int -palm_tx(uint8_t addr, uint8_t offset, uint8_t * buf, uint8_t len) -{ - volatile uint32_t regVal = 0x00; - int timeOut, ctr = 0x00, numBytes = len; - - for (ctr = 0x00; ctr < len; ctr++) { - if (wait_for_idle() < 0) { - printf("TimedOut on Waiting for I2C Bus Idle.\n"); - return -EIO; - } - palm_write(I2C_PALM_CFG, 0xF8); - palm_write(I2C_PALM_BYTECNT, 0x00); - palm_write(I2C_PALM_DEVADDR, addr); - //0x4c, 0x68 - palm_write(I2C_PALM_ADDR, offset + numBytes - 1); - //offset - palm_write(I2C_PALM_DATAOUT, buf[ctr]); - palm_write(I2C_PALM_STARTXFR, I2C_PALM_STARTXFR_WR); - MDELAY(1); - - regVal = palm_read(I2C_PALM_STATUS); - MDELAY(1); - if (regVal & 0x0008) { - printf("palm_tx: ACKERR. Aborting...\n"); - return -1; - } - timeOut = 0x1000; - while (!(regVal & 0x0002) && timeOut) { - regVal = palm_read(I2C_PALM_STATUS); - timeOut--; - } - if (timeOut == 0x00) { - printf("palm_tx: [TimeOut] SDOEMPTY Not Set\n"); - return -1; - } - timeOut = 1000; - while ((regVal & 0x0030) && timeOut) { - palm_write(I2C_PALM_STARTXFR, I2C_PALM_STARTXFR_WR); - regVal = palm_read(I2C_PALM_STATUS); - timeOut--; - } - if (timeOut == 0x00) { - printf("palm_rx: TimedOut on Valid STARTXFR/Arbitration\n"); - return -1; - } - numBytes--; - } - return 0; -} - - - - static int xlr_i2c_probe(device_t dev) { - device_set_desc(dev, "I2C bus controller"); + device_set_desc(dev, "XLR/XLS I2C bus controller"); return (0); } @@ -309,17 +164,40 @@ xlr_i2c_probe(device_t dev) static int xlr_i2c_attach(device_t dev) { - struct xlr_i2c_softc *sc; int rid; + struct xlr_i2c_softc *sc; + device_t tmpd; + + if(device_get_unit(dev)!=ARIZONA_I2C_BUS) { + device_printf(dev, "unused iicbus instance\n"); + return 0; + } sc = device_get_softc(dev); - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); + set_i2c_base(dev); + + mtx_init(&sc->sc_mtx, "xlr_i2c", "xlr_i2c", MTX_DEF); + + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res == NULL) { printf("not able to allocate the bus resource\n"); } - if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) + if ((sc->iicbus = device_add_child(dev, "iicbus", -1)) == NULL) { printf("could not allocate iicbus instance\n"); + return -1; + } + if(xlr_board_info.xlr_i2c_device[I2C_RTC].enabled == 1) { + tmpd = device_add_child(sc->iicbus, "ds1374u", 0); + device_set_ivars(tmpd, &xlr_board_info.xlr_i2c_device[I2C_RTC]); + } + if(xlr_board_info.xlr_i2c_device[I2C_THERMAL].enabled == 1) { + tmpd = device_add_child(sc->iicbus, "max6657", 0); + device_set_ivars(tmpd, &xlr_board_info.xlr_i2c_device[I2C_THERMAL]); + } + if(xlr_board_info.xlr_i2c_device[I2C_EEPROM].enabled == 1) { + tmpd = device_add_child(sc->iicbus, "at24co2n", 0); + device_set_ivars(tmpd, &xlr_board_info.xlr_i2c_device[I2C_EEPROM]); + } bus_generic_attach(dev); @@ -334,19 +212,6 @@ xlr_i2c_detach(device_t dev) return (0); } -/* -static int -xlr_i2c_add_child(device_t dev, int order, const char *name, int unit) -{ - printf("********* %s ******** \n", __FUNCTION__); - device_add_child_ordered(dev, order, name, unit); - - bus_generic_attach(dev); - - return (0); -} -*/ - static int xlr_i2c_start(device_t dev, u_char slave, int timeout) { @@ -354,9 +219,9 @@ xlr_i2c_start(device_t dev, u_char slave struct xlr_i2c_softc *sc; sc = device_get_softc(dev); + mtx_lock(&sc->sc_mtx); sc->sc_started = 1; - - current_slave = (slave >> 1); + sc->i2cdev_addr = (slave >> 1); return error; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 08:52:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 739AF106566C; Sun, 12 Dec 2010 08:52:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62D5C8FC21; Sun, 12 Dec 2010 08:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBC8qDXE038949; Sun, 12 Dec 2010 08:52:13 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBC8qDm8038947; Sun, 12 Dec 2010 08:52:13 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012120852.oBC8qDm8038947@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 12 Dec 2010 08:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216391 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 08:52:13 -0000 Author: jh Date: Sun Dec 12 08:52:13 2010 New Revision: 216391 URL: http://svn.freebsd.org/changeset/base/216391 Log: Handle the special ruleset 0 in devfs_ruleset_use(). An attempt set the current ruleset to 0 with command "devfs ruleset 0" triggered a KASSERT in devfs_ruleset_create(). PR: kern/125030 Submitted by: Mateusz Guzik Modified: head/sys/fs/devfs/devfs_rule.c Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Sun Dec 12 06:00:26 2010 (r216390) +++ head/sys/fs/devfs/devfs_rule.c Sun Dec 12 08:52:13 2010 (r216391) @@ -742,6 +742,11 @@ devfs_ruleset_use(devfs_rsnum rsnum, str devfs_ruleset_reap(cds); } + if (rsnum == 0) { + dm->dm_ruleset = 0; + return (0); + } + ds = devfs_ruleset_bynum(rsnum); if (ds == NULL) ds = devfs_ruleset_create(rsnum); From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 11:12:31 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE36A106566C; Sun, 12 Dec 2010 11:12:31 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 7932B8FC12; Sun, 12 Dec 2010 11:12:30 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 68DA29CB0E9; Sun, 12 Dec 2010 12:12:29 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dK0D-bgL8sAK; Sun, 12 Dec 2010 12:12:28 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 874639CB166; Sun, 12 Dec 2010 12:12:28 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id oBCBCSRY053500; Sun, 12 Dec 2010 12:12:28 +0100 (CET) (envelope-from rdivacky) Date: Sun, 12 Dec 2010 12:12:28 +0100 From: Roman Divacky To: Shteryana Shopova Message-ID: <20101212111228.GA52492@freebsd.org> References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: src-committers@FreeBSD.org, Pawel Worach , ed@FreeBSD.org, Garrett Cooper , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 11:12:31 -0000 On Sat, Dec 11, 2010 at 05:42:23PM +0200, Shteryana Shopova wrote: > Hi, > > This is now fixed. However I wouldn't expect bsnmpd(1) compiled with > clang to work - it didn't run last time I checked several months ago, > and I still get the same error - > > udo /usr/sbin/bsnmpd -d -c /root/snmpd.config > snmpd[80050]: lm_load: open /usr/lib/snmp_mibII.so: Undefined symbol > "oid_zeroDotZero" > snmpd[80050]: init dep failed: 13 1.3.6.1.4.1.12325.1.1.1.6 5.109.105.98.73.73 > snmpd[80050]: error in config file I see the symbol being defined in snmpd/main.c but I fail to find it in any (gcc) compiled library - where should it be? could you show me "readelf -a main.o" for gcc and clang compiled snmp lib? or at least show me where in the source I can issue "make" to get it :) thank you! roman From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 13:04:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0391D1065672; Sun, 12 Dec 2010 13:04:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E58C58FC0A; Sun, 12 Dec 2010 13:04:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCD4UBc047377; Sun, 12 Dec 2010 13:04:30 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCD4UX4047375; Sun, 12 Dec 2010 13:04:30 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012121304.oBCD4UX4047375@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 12 Dec 2010 13:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216393 - head/tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 13:04:31 -0000 Author: trasz Date: Sun Dec 12 13:04:30 2010 New Revision: 216393 URL: http://svn.freebsd.org/changeset/base/216393 Log: Add regression test for new NFSv4 ACL semantics, verified with ZFSv28. Note that to run it, you need not only ZFSv28, but also a modified setfacl(1), which is not in the tree yet. Added: head/tools/regression/acltools/tools-nfs4-psarc.test - copied, changed from r214369, head/tools/regression/acltools/tools-nfs4.test Copied and modified: head/tools/regression/acltools/tools-nfs4-psarc.test (from r214369, head/tools/regression/acltools/tools-nfs4.test) ============================================================================== --- head/tools/regression/acltools/tools-nfs4.test Tue Oct 26 02:34:47 2010 (r214369, copy source) +++ head/tools/regression/acltools/tools-nfs4-psarc.test Sun Dec 12 13:04:30 2010 (r216393) @@ -25,10 +25,10 @@ # $FreeBSD$ # -# This is a tools-level test for NFSv4 ACL functionality. Run it as root -# using ACL-enabled kernel: +# This is a tools-level test for NFSv4 ACL functionality with PSARC/2010/029 +# semantics. Run it as root using ACL-enabled kernel: # -# /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-nfs4.test +# /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-nfs4-psarc.test # # WARNING: Creates files in unsafe way. @@ -42,19 +42,13 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ getfacl -q xxx -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow # Check verbose mode formatting. @@ -62,11 +56,8 @@ $ getfacl -v xxx > # file: xxx > # owner: root > # group: wheel -> owner@:execute::deny -> owner@:read_data/write_data/append_data/write_attributes/write_xattr/write_acl/write_owner::allow -> group@:write_data/execute/append_data::deny -> group@:read_data::allow -> everyone@:write_data/execute/append_data/write_attributes/write_xattr/write_acl/write_owner::deny +> owner@:read_data/write_data/append_data/read_attributes/write_attributes/read_xattr/write_xattr/read_acl/write_acl/write_owner/synchronize::allow +> group@:read_data/read_attributes/read_xattr/read_acl/synchronize::allow > everyone@:read_data/read_attributes/read_xattr/read_acl/synchronize::allow # Test setfacl -a. @@ -75,13 +66,10 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > user:0:-----------C--:------:allow > group:1:----------c---:------:deny -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny > everyone@:r-----a-R-c--s:------:allow # Test user and group name resolving. @@ -92,13 +80,10 @@ $ getfacl xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > user:root:-----------C--:------:allow > group:daemon:----------c---:------:deny -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny > everyone@:r-----a-R-c--s:------:allow # Check whether ls correctly marks files with "+". @@ -106,17 +91,14 @@ $ ls -l xxx | cut -d' ' -f1 > -rw-r--r--+ # Test removing entries by number. -$ setfacl -x 4 xxx -$ setfacl -x 4 xxx +$ setfacl -x 1 xxx $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow > user:0:-----------C--:------:allow > group:1:----------c---:------:deny -> everyone@:-wxp---A-W-Co-:------:deny > everyone@:r-----a-R-c--s:------:allow # Test setfacl -m. @@ -131,11 +113,9 @@ $ getfacl -n xxx > everyone@:--------------:------:deny > everyone@:--------------:------:deny > everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow > user:0:-----------C--:------:allow > group:1:----------c---:------:deny -> everyone@:--------------:------:deny > everyone@:r-----a-R-c--s:------:allow # Test getfacl -i. @@ -146,11 +126,9 @@ $ getfacl -i xxx > everyone@:--------------:------:deny > everyone@:--------------:------:deny > everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow > user:root:-----------C--:------:allow:0 > group:daemon:----------c---:------:deny:1 -> everyone@:--------------:------:deny > everyone@:r-----a-R-c--s:------:allow # Make sure cp without any flags does not copy copy the ACL. @@ -168,11 +146,9 @@ $ getfacl -n yyy > everyone@:--------------:------:deny > everyone@:--------------:------:deny > everyone@:--------------:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow > user:0:-----------C--:------:allow > group:1:----------c---:------:deny -> everyone@:--------------:------:deny > everyone@:r-----a-R-c--s:------:allow $ rm yyy @@ -183,8 +159,7 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow +> owner@:rw-p--aARWcCos:------:allow > user:0:-----------C--:------:allow > group:1:----------c---:------:deny > everyone@:r-----a-R-c--s:------:allow @@ -195,11 +170,8 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ ls -l xxx | cut -d' ' -f1 @@ -226,29 +198,20 @@ $ getfacl -nq nnn xxx yyy zzz > getfacl: nnn: stat() failed: No such file or directory > user:42:--x-----------:------:allow > group:43:-w------------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow > > user:42:--x-----------:------:allow > group:43:-w------------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow > > user:42:--x-----------:------:allow > group:43:-w------------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ setfacl -b nnn xxx yyy zzz @@ -270,25 +233,12 @@ $ getfacl -n xxx > # file: xxx > # owner: root > # group: wheel -> user:42:r-------------:------:deny -> user:42:r-------------:------:allow -> user:43:-w------------:------:deny -> user:43:-w------------:------:allow -> user:44:--x-----------:------:deny -> user:44:--x-----------:------:allow -> owner@:--------------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow + $ ls -l xxx | cut -d' ' -f1 -> -rw-------+ +> -rw------- $ rm xxx $ touch xxx @@ -299,20 +249,11 @@ $ getfacl -n xxx > # file: xxx > # owner: 42 > # group: wheel -> user:42:--------------:------:deny -> user:42:r-------------:------:allow -> user:43:-w------------:------:deny -> user:43:-w------------:------:allow -> user:44:--x-----------:------:deny -> user:44:--x-----------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow $ ls -l xxx | cut -d' ' -f1 -> -rw-------+ +> -rw------- $ rm xxx $ touch xxx @@ -323,20 +264,13 @@ $ getfacl -n xxx > # file: xxx > # owner: 43 > # group: wheel -> user:42:r-------------:------:deny -> user:42:r-------------:------:allow -> user:43:-w------------:------:deny -> user:43:-w------------:------:allow -> user:44:--x-----------:------:deny -> user:44:--x-----------:------:allow > owner@:rw-p----------:------:deny -> owner@:--x----A-W-Co-:------:allow -> group@:r-x-----------:------:deny -> group@:-w-p----------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> group@:r-------------:------:deny +> owner@:--x---aARWcCos:------:allow +> group@:-w-p--a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ ls -l xxx | cut -d' ' -f1 -> ---x-w-r--+ +> ---x-w-r-- $ rm xxx $ touch xxx @@ -347,20 +281,13 @@ $ getfacl -n xxx > # file: xxx > # owner: 43 > # group: wheel -> user:42:r-------------:------:deny -> user:42:r-------------:------:allow -> user:43:-w------------:------:deny -> user:43:-w------------:------:allow -> user:44:--------------:------:deny -> user:44:--x-----------:------:allow > owner@:-wxp----------:------:deny -> owner@:r------A-W-Co-:------:allow -> group@:rw-p----------:------:deny -> group@:--x-----------:------:allow -> everyone@:r-x----A-W-Co-:------:deny +> group@:-w-p----------:------:deny +> owner@:r-----aARWcCos:------:allow +> group@:--x---a-R-c--s:------:allow > everyone@:-w-p--a-R-c--s:------:allow $ ls -l xxx | cut -d' ' -f1 -> -r----x-w-+ +> -r----x-w- $ mkdir ddd $ setfacl -a0 group:44:rwapd:allow ddd @@ -376,143 +303,19 @@ $ getfacl -n ddd > group:43:-w--D---------:-d----:deny > group@:-----da-------:------:allow > group:44:rw-p-da-------:------:allow -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:-w-p----------:------:deny -> group@:r-x-----------:------:allow -> everyone@:-w-p---A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:r-x---a-R-c--s:------:allow > everyone@:-w-p--a-R-c--s:f-i---:allow + $ chmod 777 ddd $ getfacl -n ddd > # file: ddd > # owner: root > # group: wheel -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-di---:allow -> group:42:--------------:------:deny -> group:42:-w--D---------:------:allow -> group:43:-w--D---------:-di---:deny -> group:43:-w--D---------:------:deny -> group@:-----da-------:------:allow -> group:44:--------------:------:deny -> group:44:rw-p-da-------:------:allow -> owner@:--------------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:f-i---:allow -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:rwxp----------:------:allow -> everyone@:-------A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:rwxp--a-R-c--s:------:allow > everyone@:rwxp--a-R-c--s:------:allow -$ rmdir ddd -$ mkdir ddd -$ setfacl -a0 group:44:rwapd:allow ddd -$ setfacl -a0 group:43:write_data/delete_child:d:deny,group@:ad:allow ddd -$ setfacl -a0 user:42:rx:fi:allow,group:42:write_data/delete_child:d:allow ddd -$ setfacl -m everyone@:-w-p--a-R-c--s:fi:allow ddd -$ chmod 124 ddd -$ getfacl -n ddd -> # file: ddd -> # owner: root -> # group: wheel -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-di---:allow -> group:42:--------------:------:deny -> group:42:----D---------:------:allow -> group:43:-w--D---------:-di---:deny -> group:43:-w--D---------:------:deny -> group@:-----da-------:------:allow -> group:44:r-------------:------:deny -> group:44:r----da-------:------:allow -> owner@:--------------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:f-i---:allow -> owner@:rw-p----------:------:deny -> owner@:--x----A-W-Co-:------:allow -> group@:r-x-----------:------:deny -> group@:-w-p----------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny -> everyone@:r-----a-R-c--s:------:allow - -$ rmdir ddd -$ mkdir ddd -$ setfacl -a0 group:44:rwapd:allow ddd -$ setfacl -a0 group:43:write_data/delete_child:d:deny,group@:ad:allow ddd -$ setfacl -a0 user:42:rx:allow,user:42:rx:fi:allow,group:42:write_data/delete_child:d:allow ddd -$ setfacl -m everyone@:-w-p--a-R-c--s:fi:allow ddd -$ chmod 412 ddd -$ getfacl -n ddd -> # file: ddd -> # owner: root -> # group: wheel -> user:42:r-------------:------:deny -> user:42:r-x-----------:------:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-di---:allow -> group:42:-w------------:------:deny -> group:42:-w--D---------:------:allow -> group:43:-w--D---------:-di---:deny -> group:43:-w--D---------:------:deny -> group@:-----da-------:------:allow -> group:44:rw-p----------:------:deny -> group:44:rw-p-da-------:------:allow -> owner@:--------------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:f-i---:allow -> owner@:-wxp----------:------:deny -> owner@:r------A-W-Co-:------:allow -> group@:rw-p----------:------:deny -> group@:--x-----------:------:allow -> everyone@:r-x----A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:------:allow - -$ rmdir ddd -$ mkdir ddd -$ setfacl -a0 group:44:rwapd:allow ddd -$ setfacl -a0 group:43:write_data/delete_child:d:deny,group@:ad:allow ddd -$ setfacl -a0 user:42:rx:allow,user:42:rx:fi:allow,group:42:write_data/delete_child:d:allow ddd -$ setfacl -m everyone@:-w-p--a-R-c--s:fi:allow ddd -$ chown 42 ddd -$ chmod 412 ddd -$ getfacl -n ddd -> # file: ddd -> # owner: 42 -> # group: wheel -> user:42:--x-----------:------:deny -> user:42:r-x-----------:------:allow -> user:42:r-x-----------:f-i---:allow -> group:42:-w--D---------:-di---:allow -> group:42:-w------------:------:deny -> group:42:-w--D---------:------:allow -> group:43:-w--D---------:-di---:deny -> group:43:-w--D---------:------:deny -> group@:-----da-------:------:allow -> group:44:rw-p----------:------:deny -> group:44:rw-p-da-------:------:allow -> owner@:--------------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:f-i---:allow -> owner@:-wxp----------:------:deny -> owner@:r------A-W-Co-:------:allow -> group@:rw-p----------:------:deny -> group@:--x-----------:------:allow -> everyone@:r-x----A-W-Co-:------:deny -> everyone@:-w-p--a-R-c--s:------:allow - # Test applying ACL to mode. $ rmdir ddd $ mkdir ddd @@ -527,7 +330,6 @@ $ setfacl -a0 owner@:r:allow,group@:w:de $ ls -ld ddd | cut -d' ' -f1 > dr----x---+ -# XXX: This one is fishy. Shouldn't it be "dr---wx---+"? $ rmdir ddd $ mkdir ddd $ chmod 0 ddd @@ -565,129 +367,96 @@ $ getfacl -qn ddd > group:42:-w--D---------:-d-n--:deny > group:43:-w---------C--:f-in--:deny > user:43:rwxp----------:------:allow -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:-w-p----------:------:deny -> group@:r-x-----------:------:allow -> everyone@:-w-p---A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:r-x---a-R-c--s:------:allow > everyone@:r-x---a-R-c--s:------:allow $ cd ddd $ touch xxx $ getfacl -qn xxx -> user:41:-w------------:------:deny -> user:41:-w-----A------:------:allow -> user:42:--------------:------:deny +> user:41:--------------:------:allow > user:42:--------------:------:allow -> user:42:--x-----------:------:deny -> user:42:r-x-----------:------:allow +> user:42:r-------------:------:allow > group:43:-w---------C--:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ rm xxx $ umask 077 $ touch xxx $ getfacl -qn xxx -> user:41:-w------------:------:deny -> user:41:-w-----A------:------:allow -> user:42:--------------:------:deny +> user:41:--------------:------:allow +> user:42:--------------:------:allow > user:42:--------------:------:allow -> user:42:r-x-----------:------:deny -> user:42:r-x-----------:------:allow > group:43:-w---------C--:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow $ rm xxx $ umask 770 $ touch xxx $ getfacl -qn xxx -> user:41:-w------------:------:deny -> user:41:-w-----A------:------:allow -> user:42:--------------:------:deny +> owner@:rw-p----------:------:deny +> group@:rw-p----------:------:deny +> user:41:--------------:------:allow +> user:42:--------------:------:allow > user:42:--------------:------:allow -> user:42:r-x-----------:------:deny -> user:42:r-x-----------:------:allow > group:43:-w---------C--:------:deny -> owner@:rwxp----------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:--x----A-W-Co-:------:deny +> owner@:------aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:rw-p--a-R-c--s:------:allow $ rm xxx $ umask 707 $ touch xxx $ getfacl -qn xxx -> user:41:--------------:------:deny -> user:41:-w-----A------:------:allow -> user:42:--------------:------:deny +> owner@:rw-p----------:------:deny +> user:41:-w------------:------:allow > user:42:--------------:------:allow -> user:42:--x-----------:------:deny -> user:42:r-x-----------:------:allow +> user:42:r-------------:------:allow > group:43:-w---------C--:------:deny -> owner@:rwxp----------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--x-----------:------:deny -> group@:rw-p----------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:------aARWcCos:------:allow +> group@:rw-p--a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow $ umask 077 $ mkdir yyy $ getfacl -qn yyy -> group:41:r-------------:------:deny -> group:41:r-----a-------:------:allow +> group:41:------a-------:------:allow > user:42:-----------Co-:f-i---:allow > user:42:r-x-----------:f-i---:allow > group:42:-w--D---------:------:deny -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow $ rmdir yyy $ umask 770 $ mkdir yyy $ getfacl -qn yyy -> group:41:r-------------:------:deny -> group:41:r-----a-------:------:allow +> owner@:rwxp----------:------:deny +> group@:rwxp----------:------:deny +> group:41:------a-------:------:allow > user:42:-----------Co-:f-i---:allow > user:42:r-x-----------:f-i---:allow > group:42:-w--D---------:------:deny -> owner@:rwxp----------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:rwxp----------:------:deny -> group@:--------------:------:allow -> everyone@:-------A-W-Co-:------:deny +> owner@:------aARWcCos:------:allow +> group@:------a-R-c--s:------:allow > everyone@:rwxp--a-R-c--s:------:allow $ rmdir yyy $ umask 707 $ mkdir yyy $ getfacl -qn yyy -> group:41:--------------:------:deny -> group:41:------a-------:------:allow +> owner@:rwxp----------:------:deny +> group:41:r-----a-------:------:allow > user:42:-----------Co-:f-i---:allow > user:42:r-x-----------:f-i---:allow > group:42:-w--D---------:------:deny -> owner@:rwxp----------:------:deny -> owner@:-------A-W-Co-:------:allow -> group@:--------------:------:deny -> group@:rwxp----------:------:allow -> everyone@:rwxp---A-W-Co-:------:deny +> owner@:------aARWcCos:------:allow +> group@:rwxp--a-R-c--s:------:allow > everyone@:------a-R-c--s:------:allow # There is some complication regarding how write_acl and write_owner flags @@ -709,59 +478,33 @@ $ umask 022 $ rm xxx $ touch xxx $ getfacl -nq xxx -> user:53:--------------:------:deny > user:53:--------------:------:allow -> user:51:--------------:------:deny > user:51:--------------:------:allow -> user:50:--------------:------:deny > user:50:--------------:------:allow -> user:48:--------------:------:deny > user:48:--------------:------:allow -> user:47:--------------:------:deny > user:47:--------------:------:allow -> user:45:--------------:------:deny > user:45:--------------:------:allow -> user:44:--------------:------:deny > user:44:--------------:------:allow -> user:42:--------------:------:deny > user:42:--------------:------:allow -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ rmdir yyy $ mkdir yyy $ getfacl -nq yyy -> user:53:--------------:------:deny > user:53:--------------:------:allow -> user:52:--------------:------:deny > user:52:--------------:------:allow -> user:50:--------------:------:deny > user:50:--------------:------:allow -> user:49:--------------:------:deny > user:49:--------------:------:allow -> user:47:-----------Co-:fdi---:allow -> user:47:--------------:------:deny -> user:47:--------------:------:allow -> user:46:-----------Co-:-di---:allow -> user:46:--------------:------:deny -> user:46:--------------:------:allow +> user:47:--------------:fd----:allow +> user:46:--------------:-d----:allow > user:45:-----------Co-:f-i---:allow -> user:44:-----------Co-:fdi---:allow -> user:44:--------------:------:deny -> user:44:--------------:------:allow -> user:43:-----------Co-:-di---:allow -> user:43:--------------:------:deny -> user:43:--------------:------:allow +> user:44:--------------:fd----:allow +> user:43:--------------:-d----:allow > user:42:-----------Co-:f-i---:allow -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:-w-p----------:------:deny -> group@:r-x-----------:------:allow -> everyone@:-w-p---A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:r-x---a-R-c--s:------:allow > everyone@:r-x---a-R-c--s:------:allow $ setfacl -b . @@ -789,11 +532,8 @@ $ getfacl -nq xxx > user:45:-----------Co-:------:deny > user:44:-----------Co-:------:deny > user:42:-----------Co-:------:deny -> owner@:--x-----------:------:deny -> owner@:rw-p---A-W-Co-:------:allow -> group@:-wxp----------:------:deny -> group@:r-------------:------:allow -> everyone@:-wxp---A-W-Co-:------:deny +> owner@:rw-p--aARWcCos:------:allow +> group@:r-----a-R-c--s:------:allow > everyone@:r-----a-R-c--s:------:allow $ rmdir yyy @@ -803,21 +543,14 @@ $ getfacl -nq yyy > user:52:-----------Co-:------:deny > user:50:-----------Co-:------:deny > user:49:-----------Co-:------:deny -> user:47:-----------Co-:fdi---:deny -> user:47:-----------Co-:------:deny -> user:46:-----------Co-:-di---:deny -> user:46:-----------Co-:------:deny +> user:47:-----------Co-:fd----:deny +> user:46:-----------Co-:-d----:deny > user:45:-----------Co-:f-i---:deny -> user:44:-----------Co-:fdi---:deny -> user:44:-----------Co-:------:deny -> user:43:-----------Co-:-di---:deny -> user:43:-----------Co-:------:deny +> user:44:-----------Co-:fd----:deny +> user:43:-----------Co-:-d----:deny > user:42:-----------Co-:f-i---:deny -> owner@:--------------:------:deny -> owner@:rwxp---A-W-Co-:------:allow -> group@:-w-p----------:------:deny -> group@:r-x-----------:------:allow -> everyone@:-w-p---A-W-Co-:------:deny +> owner@:rwxp--aARWcCos:------:allow +> group@:r-x---a-R-c--s:------:allow > everyone@:r-x---a-R-c--s:------:allow $ rmdir yyy From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 15:18:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 380C5106564A; Sun, 12 Dec 2010 15:18:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id E21C58FC1B; Sun, 12 Dec 2010 15:18:37 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76] (unknown [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 761D65C43; Sun, 12 Dec 2010 16:18:35 +0100 (CET) Message-ID: <4D04E7D3.3060308@FreeBSD.org> Date: Sun, 12 Dec 2010 16:18:43 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101211 Lanikai/3.1.8pre MIME-Version: 1.0 To: syrinx@FreeBSD.org References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020203020906050501060306" Cc: src-committers@freebsd.org, Pawel Worach , ed@freebsd.org, Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, rdivacky@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 15:18:38 -0000 This is a multi-part message in MIME format. --------------020203020906050501060306 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2010-12-11 16:42, Shteryana Shopova wrote: > This is now fixed. However I wouldn't expect bsnmpd(1) compiled with > clang to work - it didn't run last time I checked several months ago, > and I still get the same error - > > udo /usr/sbin/bsnmpd -d -c /root/snmpd.config > snmpd[80050]: lm_load: open /usr/lib/snmp_mibII.so: Undefined symbol > "oid_zeroDotZero" > snmpd[80050]: init dep failed: 13 1.3.6.1.4.1.12325.1.1.1.6 5.109.105.98.73.73 > snmpd[80050]: error in config file > > bsnmpd(1) uses export-dynamic flag Can you please try the attached patch, which makes clang pass the -export-dynamic flag to the linker properly? --------------020203020906050501060306 Content-Type: text/plain; name="bsnmpd-export-dynamic.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bsnmpd-export-dynamic.diff" ZGlmZiAtLWdpdCBhL3Vzci5zYmluL2Jzbm1wZC9ic25tcGQvTWFrZWZpbGUgYi91c3Iuc2Jp bi9ic25tcGQvYnNubXBkL01ha2VmaWxlCmluZGV4IGY3ZTliMjMuLjgwYjE0ZTIgMTAwNjQ0 Ci0tLSBhL3Vzci5zYmluL2Jzbm1wZC9ic25tcGQvTWFrZWZpbGUKKysrIGIvdXNyLnNiaW4v YnNubXBkL2Jzbm1wZC9NYWtlZmlsZQpAQCAtMzEsNyArMzEsNyBAQCBDRkxBR1MrPSAtREhB VkVfU1RESU5UX0ggLURIQVZFX0lOVFRZUEVTX0ggLURIQVZFX0VSUl9IIC1ESEFWRV9TVFJM Q1BZCiBEUEFERD0JJHtMSUJCRUdFTU9UfSAke0xJQkJTTk1QfSAke0xJQldSQVB9CiBMREFE RD0JLWxiZWdlbW90IC1sYnNubXAgLWx3cmFwCiAKLUxERkxBR1M9IC1leHBvcnQtZHluYW1p YworTERGTEFHUz0gLVdsLC1leHBvcnQtZHluYW1pYwogCiAuaWYgJHtNS19PUEVOU1NMfSAh PSAibm8iCiBDRkxBR1MrPSAtREhBVkVfTElCQ1JZUFRPCg== --------------020203020906050501060306-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 16:16:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DAA9106564A; Sun, 12 Dec 2010 16:16:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2258FC08; Sun, 12 Dec 2010 16:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCGGddM051076; Sun, 12 Dec 2010 16:16:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCGGdta051073; Sun, 12 Dec 2010 16:16:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012121616.oBCGGdta051073@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 12 Dec 2010 16:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216394 - in head/sys: amd64/amd64 i386/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 16:16:39 -0000 Author: kib Date: Sun Dec 12 16:16:39 2010 New Revision: 216394 URL: http://svn.freebsd.org/changeset/base/216394 Log: In fpudna()/npxdna(), mark FPU context initialized and optionally mark user FPU context initialized, if current context is user context. It was reversed in r215865, by inadequate change of this code fragment to a call to fpuuserinited()/npxuserinited(). The issue is only relevant for in-kernel users of FPU. Reported by: Jan Henrik Sylvester , Mike Tancsa Tested by: Mike Tancsa MFC after: 3 days Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/isa/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Sun Dec 12 13:04:30 2010 (r216393) +++ head/sys/amd64/amd64/fpu.c Sun Dec 12 16:16:39 2010 (r216394) @@ -426,7 +426,9 @@ fpudna(void) fxrstor(&fpu_initialstate); if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) fldcw(pcb->pcb_initial_fpucw); - fpuuserinited(curthread); + pcb->pcb_flags |= PCB_FPUINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_USERFPUINITDONE; } else fxrstor(pcb->pcb_save); critical_exit(); Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Sun Dec 12 13:04:30 2010 (r216393) +++ head/sys/i386/isa/npx.c Sun Dec 12 16:16:39 2010 (r216394) @@ -684,7 +684,9 @@ npxdna(void) fpurstor(&npx_initialstate); if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) fldcw(pcb->pcb_initial_npxcw); - npxuserinited(curthread); + pcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_NPXUSERINITDONE; } else { /* * The following fpurstor() may cause an IRQ13 when the From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 16:56:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F36F106566C; Sun, 12 Dec 2010 16:56:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DB728FC08; Sun, 12 Dec 2010 16:56:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCGuHHo051911; Sun, 12 Dec 2010 16:56:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCGuHVQ051909; Sun, 12 Dec 2010 16:56:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012121656.oBCGuHVQ051909@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Dec 2010 16:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216395 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 16:56:17 -0000 Author: jilles Date: Sun Dec 12 16:56:16 2010 New Revision: 216395 URL: http://svn.freebsd.org/changeset/base/216395 Log: sh: Add a test for r216387 (long arithmetic expression in here document). Added: head/tools/regression/bin/sh/expansion/arith7.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/arith7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith7.0 Sun Dec 12 16:56:16 2010 (r216395) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +v=1+ +v=$v$v$v$v +v=$v$v$v$v +v=$v$v$v$v +v=$v$v$v$v +v=$v$v$v$v +[ "$(cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C27781065672; Sun, 12 Dec 2010 18:43:50 +0000 (UTC) (envelope-from shteryana@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id CA3B08FC15; Sun, 12 Dec 2010 18:43:49 +0000 (UTC) Received: by qyk8 with SMTP id 8so2368257qyk.13 for ; Sun, 12 Dec 2010 10:43:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=GmHtm/6mrR2Pfm/yG9ASn6tKoH2GBmHuiiv60vIuA4M=; b=dZUCrDSFITLVfkdRgZK/08HCHNM4Y5Q+g40p+wzwz0sQGkKRtw+k6z7kPJ/o3x/vs8 6xSvh620CyQxwrpWQvWMRJblRS5+gdFi97f9hBxDOVGPnRqqPT5thMINm4q53KpFTmzA LoPPOnhdzcQy53D20cVMkZn0pUzc5HuJ8N6Is= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=qUAX7SXnUb8GRtMRS/z+CCKOGiV0knR1ciU0mnRnodW88v6IS7cGWdJXv0KPDvympx FV/rvyeBNxef+skyVI3WeOp28FaXwjg53k32IJ+nWoghC1GBdJwpdieIRSgIGAhLGT65 BnyyiQTGOn+KeER8GzG2e/5pQGCEZzNs98sUQ= MIME-Version: 1.0 Received: by 10.229.185.7 with SMTP id cm7mr2995419qcb.89.1292179428105; Sun, 12 Dec 2010 10:43:48 -0800 (PST) Sender: shteryana@gmail.com Received: by 10.229.105.68 with HTTP; Sun, 12 Dec 2010 10:43:48 -0800 (PST) In-Reply-To: <4D04E7D3.3060308@FreeBSD.org> References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> <4D04E7D3.3060308@FreeBSD.org> Date: Sun, 12 Dec 2010 20:43:48 +0200 X-Google-Sender-Auth: WNiwV0bATEh3u6hXA__TvlxigH0 Message-ID: From: Shteryana Shopova To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Cc: src-committers@freebsd.org, Pawel Worach , ed@freebsd.org, Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, rdivacky@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 18:43:50 -0000 Hi, The attached patch worked. The output of readelf with the patch is in the http://people.freebsd.org/~syrinx/readelf.txt, the file also contains the output of readelf main.o without the patch and with gcc. The output of readelf bsnmpd compiled with clang and gcc is in http://people.freebsd.org/~syrinx/readelf-bsnmpd.txt . I hope this helps. cheers, Shteryana On 12/12/10, Dimitry Andric wrote: > On 2010-12-11 16:42, Shteryana Shopova wrote: >> This is now fixed. However I wouldn't expect bsnmpd(1) compiled with >> clang to work - it didn't run last time I checked several months ago, >> and I still get the same error - >> >> udo /usr/sbin/bsnmpd -d -c /root/snmpd.config >> snmpd[80050]: lm_load: open /usr/lib/snmp_mibII.so: Undefined symbol >> "oid_zeroDotZero" >> snmpd[80050]: init dep failed: 13 1.3.6.1.4.1.12325.1.1.1.6 >> 5.109.105.98.73.73 >> snmpd[80050]: error in config file >> >> bsnmpd(1) uses export-dynamic flag > > Can you please try the attached patch, which makes clang pass the > -export-dynamic flag to the linker properly? > From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 20:06:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E401065670; Sun, 12 Dec 2010 20:06:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 16A638FC18; Sun, 12 Dec 2010 20:06:45 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oBCK6elU058676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Dec 2010 22:06:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oBCK6eNu065911; Sun, 12 Dec 2010 22:06:40 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oBCK6eWj065910; Sun, 12 Dec 2010 22:06:40 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 12 Dec 2010 22:06:40 +0200 From: Kostik Belousov To: Dimitry Andric Message-ID: <20101212200640.GY33073@deviant.kiev.zoral.com.ua> References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> <4D04E7D3.3060308@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GOnUD/NgUx2c77Ud" Content-Disposition: inline In-Reply-To: <4D04E7D3.3060308@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, ed@freebsd.org, Garrett Cooper , syrinx@freebsd.org, svn-src-head@freebsd.org, Pawel Worach , rdivacky@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 20:06:46 -0000 --GOnUD/NgUx2c77Ud Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 12, 2010 at 04:18:43PM +0100, Dimitry Andric wrote: > On 2010-12-11 16:42, Shteryana Shopova wrote: > >This is now fixed. However I wouldn't expect bsnmpd(1) compiled with > >clang to work - it didn't run last time I checked several months ago, > >and I still get the same error - > > > >udo /usr/sbin/bsnmpd -d -c /root/snmpd.config > >snmpd[80050]: lm_load: open /usr/lib/snmp_mibII.so: Undefined symbol > >"oid_zeroDotZero" > >snmpd[80050]: init dep failed: 13 1.3.6.1.4.1.12325.1.1.1.6=20 > >5.109.105.98.73.73 > >snmpd[80050]: error in config file > > > >bsnmpd(1) uses export-dynamic flag >=20 > Can you please try the attached patch, which makes clang pass the > -export-dynamic flag to the linker properly? > diff --git a/usr.sbin/bsnmpd/bsnmpd/Makefile b/usr.sbin/bsnmpd/bsnmpd/Mak= efile > index f7e9b23..80b14e2 100644 > --- a/usr.sbin/bsnmpd/bsnmpd/Makefile > +++ b/usr.sbin/bsnmpd/bsnmpd/Makefile > @@ -31,7 +31,7 @@ CFLAGS+=3D -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_ERR= _H -DHAVE_STRLCPY > DPADD=3D ${LIBBEGEMOT} ${LIBBSNMP} ${LIBWRAP} > LDADD=3D -lbegemot -lbsnmp -lwrap > =20 > -LDFLAGS=3D -export-dynamic > +LDFLAGS=3D -Wl,-export-dynamic > =20 > .if ${MK_OPENSSL} !=3D "no" > CFLAGS+=3D -DHAVE_LIBCRYPTO I believe this was already discussed ? Traditional cc driver behaviour is to pass all unparsed flags and potential file names to the linker as is. --GOnUD/NgUx2c77Ud Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0FK1AACgkQC3+MBN1Mb4hbJgCffg7jy+wzP/44yF8rDsVVPN66 Kh8AoLENdJmyKFzS2UTl970/77PCmllH =4R9v -----END PGP SIGNATURE----- --GOnUD/NgUx2c77Ud-- From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 20:38:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3339106564A; Sun, 12 Dec 2010 20:38:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 751758FC14; Sun, 12 Dec 2010 20:38:45 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76] (unknown [IPv6:2001:7b8:3a7:0:6456:15d6:3f8:ec76]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A5F6B5C43; Sun, 12 Dec 2010 21:38:44 +0100 (CET) Message-ID: <4D0532DC.4040506@FreeBSD.org> Date: Sun, 12 Dec 2010 21:38:52 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101211 Lanikai/3.1.8pre MIME-Version: 1.0 To: Kostik Belousov References: <201012081430.oB8EUP8J006067@svn.freebsd.org> <5A7A3A47-18EF-4634-AA83-1501EF433A57@gmail.com> <4D04E7D3.3060308@FreeBSD.org> <20101212200640.GY33073@deviant.kiev.zoral.com.ua> In-Reply-To: <20101212200640.GY33073@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, ed@freebsd.org, Garrett Cooper , syrinx@freebsd.org, svn-src-head@freebsd.org, Pawel Worach , rdivacky@freebsd.org Subject: Re: svn commit: r216295 - in head/usr.sbin/bsnmpd: . tools tools/bsnmptools tools/libbsnmptools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 20:38:45 -0000 On 2010-12-12 21:06, Kostik Belousov wrote: >> -LDFLAGS= -export-dynamic >> +LDFLAGS= -Wl,-export-dynamic >> >> .if ${MK_OPENSSL} != "no" >> CFLAGS+= -DHAVE_LIBCRYPTO > > I believe this was already discussed ? Traditional cc driver behaviour > is to pass all unparsed flags and potential file names to the linker > as is. That may be the case, but at least for unknown flags, that behaviour itself is rather braindead, in my opinion. How would you ever be able to add support for a new flag using this model? You would never know whether the flag is 'silently' ignored and passed to the linker, or used by the driver itself. Another problem is flag shadowing. For example, the ld flag in question, '--export-dynamic', has a much easier short equivalent, '-E'. However, you cannot use that equivalent directly on gcc's command line, since it conflicts with gcc's own interpretation of that flag. (I guess this is the original reason for using the long option name instead of the short one.) The -Wl flag is specified to pass ld-specific flags to ld, so what is the harm in using it for its intended purpose? It is used in GNU's own autoconf scripts, and throughout the FreeBSD tree, even before clang's introduction. In fact, I think you could argue to replace all such ambiguous flags with unambiguous ones. From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 20:50:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0625106564A; Sun, 12 Dec 2010 20:50:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3798FC19; Sun, 12 Dec 2010 20:50:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCKoiFq057041; Sun, 12 Dec 2010 20:50:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCKoiW3057039; Sun, 12 Dec 2010 20:50:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012122050.oBCKoiW3057039@svn.freebsd.org> From: Michael Tuexen Date: Sun, 12 Dec 2010 20:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216397 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 20:50:44 -0000 Author: tuexen Date: Sun Dec 12 20:50:44 2010 New Revision: 216397 URL: http://svn.freebsd.org/changeset/base/216397 Log: Bugfix: Do correct accounting using the MIB counters when an association is aborted via sctp_abort_association(). MFC after: 3 days. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Dec 12 20:48:08 2010 (r216396) +++ head/sys/netinet/sctputil.c Sun Dec 12 20:50:44 2010 (r216397) @@ -3847,6 +3847,11 @@ sctp_abort_association(struct sctp_inpcb SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif + SCTP_STAT_INCR_COUNTER32(sctps_aborted); + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { + SCTP_STAT_DECR_GAUGE32(sctps_currestab); + } (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 21:18:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1571065670; Sun, 12 Dec 2010 21:18:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB5CC8FC0A; Sun, 12 Dec 2010 21:18:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCLIGrZ060066; Sun, 12 Dec 2010 21:18:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCLIGYd060063; Sun, 12 Dec 2010 21:18:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012122118.oBCLIGYd060063@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Dec 2010 21:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216398 - in head/tools/regression/bin/sh: errors execution X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 21:18:16 -0000 Author: jilles Date: Sun Dec 12 21:18:16 2010 New Revision: 216398 URL: http://svn.freebsd.org/changeset/base/216398 Log: sh: Fix some tests that used sh instead of ${SH} so they tested the wrong sh. This was caused because these tests were committed after the sh -> ${SH} change but were created before. Modified: head/tools/regression/bin/sh/errors/bad-keyword1.0 head/tools/regression/bin/sh/execution/func3.0 Modified: head/tools/regression/bin/sh/errors/bad-keyword1.0 ============================================================================== --- head/tools/regression/bin/sh/errors/bad-keyword1.0 Sun Dec 12 20:50:44 2010 (r216397) +++ head/tools/regression/bin/sh/errors/bad-keyword1.0 Sun Dec 12 21:18:16 2010 (r216398) @@ -1,4 +1,4 @@ # $FreeBSD$ -echo ':; fi' | sh -n 2>/dev/null && exit 1 +echo ':; fi' | ${SH} -n 2>/dev/null && exit 1 exit 0 Modified: head/tools/regression/bin/sh/execution/func3.0 ============================================================================== --- head/tools/regression/bin/sh/execution/func3.0 Sun Dec 12 20:50:44 2010 (r216397) +++ head/tools/regression/bin/sh/execution/func3.0 Sun Dec 12 21:18:16 2010 (r216398) @@ -3,5 +3,5 @@ # This may fail when parsing or when defining the function, or the definition # may silently do nothing. In no event may the function be executed. -sh -c 'unset() { echo overriding function executed, bad; }; v=1; unset v; exit "${v-0}"' 2>/dev/null +${SH} -c 'unset() { echo overriding function executed, bad; }; v=1; unset v; exit "${v-0}"' 2>/dev/null : From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 21:26:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70872106566B; Sun, 12 Dec 2010 21:26:12 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E88F8FC17; Sun, 12 Dec 2010 21:26:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCLQCai060264; Sun, 12 Dec 2010 21:26:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCLQCvS060259; Sun, 12 Dec 2010 21:26:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201012122126.oBCLQCvS060259@svn.freebsd.org> From: Joel Dahl Date: Sun, 12 Dec 2010 21:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216399 - in head/sbin: ifconfig mount ping6 savecore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 21:26:12 -0000 Author: joel (doc committer) Date: Sun Dec 12 21:26:12 2010 New Revision: 216399 URL: http://svn.freebsd.org/changeset/base/216399 Log: Remove the advertising clause from UCB copyrighted files in sbin. This is in accordance with the information at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Modified: head/sbin/ifconfig/ifmedia.c head/sbin/mount/mount_fs.c head/sbin/ping6/ping6.c head/sbin/savecore/savecore.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Sun Dec 12 21:18:16 2010 (r216398) +++ head/sbin/ifconfig/ifmedia.c Sun Dec 12 21:26:12 2010 (r216399) @@ -45,10 +45,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Sun Dec 12 21:18:16 2010 (r216398) +++ head/sbin/mount/mount_fs.c Sun Dec 12 21:26:12 2010 (r216399) @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Sun Dec 12 21:18:16 2010 (r216398) +++ head/sbin/ping6/ping6.c Sun Dec 12 21:26:12 2010 (r216399) @@ -46,10 +46,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Sun Dec 12 21:18:16 2010 (r216398) +++ head/sbin/savecore/savecore.c Sun Dec 12 21:26:12 2010 (r216399) @@ -43,10 +43,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. From owner-svn-src-head@FreeBSD.ORG Sun Dec 12 22:59:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AF11065670; Sun, 12 Dec 2010 22:59:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3679B8FC13; Sun, 12 Dec 2010 22:59:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBCMxZCM062106; Sun, 12 Dec 2010 22:59:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBCMxZA8062104; Sun, 12 Dec 2010 22:59:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012122259.oBCMxZA8062104@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Dec 2010 22:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216400 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2010 22:59:35 -0000 Author: jilles Date: Sun Dec 12 22:59:34 2010 New Revision: 216400 URL: http://svn.freebsd.org/changeset/base/216400 Log: sh: Various simplifications to jobs.c: * Prefer kill(-X) to killpg(X). * Remove some dead code. * No additional SIGINT is needed if int_pending() is already true. No functional change is intended. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Dec 12 21:26:12 2010 (r216399) +++ head/bin/sh/jobs.c Sun Dec 12 22:59:34 2010 (r216400) @@ -153,10 +153,8 @@ out: out2fmt_flush("sh: can't access mflag = 0; return; } - if (initialpgrp == -1) - initialpgrp = getpgrp(); - else if (initialpgrp != getpgrp()) { - killpg(0, SIGTTIN); + if (initialpgrp != getpgrp()) { + kill(0, SIGTTIN); continue; } } while (0); @@ -222,7 +220,6 @@ fgcmd(int argc __unused, char **argv) int bgcmd(int argc, char **argv) { - char s[64]; struct job *jp; do { @@ -233,8 +230,7 @@ bgcmd(int argc, char **argv) continue; restartjob(jp); jp->foreground = 0; - fmtstr(s, 64, "[%td] ", jp - jobtab + 1); - out1str(s); + out1fmt("[%td] ", jp - jobtab + 1); printjobcmd(jp); } while (--argc > 1); return 0; @@ -251,7 +247,7 @@ restartjob(struct job *jp) return; setcurjob(jp); INTOFF; - killpg(jp->ps[0].pid, SIGCONT); + kill(-jp->ps[0].pid, SIGCONT); for (ps = jp->ps, i = jp->nprocs ; --i >= 0 ; ps++) { if (WIFSTOPPED(ps->status)) { ps->status = -1; @@ -951,9 +947,7 @@ waitforjob(struct job *jp, int *origstat if (! JOBS || jp->state == JOBDONE) freejob(jp); if (int_pending()) { - if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) - kill(getpid(), SIGINT); - else + if (!WIFSIGNALED(status) || WTERMSIG(status) != SIGINT) CLEAR_PENDING_INT; } #if JOBS From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 08:56:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8429106564A; Mon, 13 Dec 2010 08:56:30 +0000 (UTC) (envelope-from wen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 981328FC1B; Mon, 13 Dec 2010 08:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBD8uU4E073809; Mon, 13 Dec 2010 08:56:30 GMT (envelope-from wen@svn.freebsd.org) Received: (from wen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBD8uUhS073807; Mon, 13 Dec 2010 08:56:30 GMT (envelope-from wen@svn.freebsd.org) Message-Id: <201012130856.oBD8uUhS073807@svn.freebsd.org> From: Wen Heping Date: Mon, 13 Dec 2010 08:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216401 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 08:56:30 -0000 Author: wen (ports committer) Date: Mon Dec 13 08:56:30 2010 New Revision: 216401 URL: http://svn.freebsd.org/changeset/base/216401 Log: - Add myself to committers-ports.dot Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Dec 12 22:59:34 2010 (r216400) +++ head/share/misc/committers-ports.dot Mon Dec 13 08:56:30 2010 (r216401) @@ -167,6 +167,7 @@ trhodes [label="Tom Rhodes\ntrhodes@Free thierry [label="Thierry Thomas\nthierry@FreeBSD.org\n2004/03/15"] tmclaugh [label="Tom McLaughlin\ntmclaugh@FreeBSD.org\n2005/09/15"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] +wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] xride [label="Soeren Straarup\nxride@FreeBSD.org\n2006/09/27"] yzlin [label="Yi-Jheng Lin\nyzlin@FreeBSD.org\n2009/07/19"] @@ -265,6 +266,7 @@ itetcu -> sahil jadawin -> bapt jadawin -> flo +jadawin -> wen joerg -> netchild @@ -315,6 +317,7 @@ miwi -> mva miwi -> nox miwi -> tabthorpe miwi -> trasz +miwi -> wen mnag -> jmelo From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 10:48:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AE2C106566B; Mon, 13 Dec 2010 10:48:50 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A5E18FC1C; Mon, 13 Dec 2010 10:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDAmnJZ077107; Mon, 13 Dec 2010 10:48:49 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDAmn72077105; Mon, 13 Dec 2010 10:48:49 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012131048.oBDAmn72077105@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 13 Dec 2010 10:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216404 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 10:48:50 -0000 Author: uqs Date: Mon Dec 13 10:48:49 2010 New Revision: 216404 URL: http://svn.freebsd.org/changeset/base/216404 Log: Remove duplicate check, turning dead code into live code. Coverity CID: 5114 Reviewed by: jilles Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Mon Dec 13 10:40:16 2010 (r216403) +++ head/bin/sh/parser.c Mon Dec 13 10:48:49 2010 (r216404) @@ -887,8 +887,6 @@ xxreadtoken(void) startlinno = plinno; for (;;) { /* until token or start of word found */ c = pgetc_macro(); - if (c == ' ' || c == '\t') - continue; /* quick check for white space first */ switch (c) { case ' ': case '\t': continue; From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 12:15:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 765021065670; Mon, 13 Dec 2010 12:15:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64FA48FC14; Mon, 13 Dec 2010 12:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDCFkbg082027; Mon, 13 Dec 2010 12:15:46 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDCFkhk082025; Mon, 13 Dec 2010 12:15:46 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012131215.oBDCFkhk082025@svn.freebsd.org> From: Robert Watson Date: Mon, 13 Dec 2010 12:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216405 - head/sys/amd64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 12:15:46 -0000 Author: rwatson Date: Mon Dec 13 12:15:46 2010 New Revision: 216405 URL: http://svn.freebsd.org/changeset/base/216405 Log: Add options NO_ADAPTIVE_SX to the XENHVM kernel configuration, matching its similar disabling of adaptive mutexes and rwlocks. The existing comment on why this is the case also applies to sx locks. MFC after: 3 days Discussed with: attilio Modified: head/sys/amd64/conf/XENHVM Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Mon Dec 13 10:48:49 2010 (r216404) +++ head/sys/amd64/conf/XENHVM Mon Dec 13 12:15:46 2010 (r216405) @@ -17,6 +17,7 @@ makeoptions MODULES_OVERRIDE="" # options NO_ADAPTIVE_MUTEXES options NO_ADAPTIVE_RWLOCKS +options NO_ADAPTIVE_SX # Xen HVM support options XENHVM From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 13:26:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6C4B1065674; Mon, 13 Dec 2010 13:26:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 757CB8FC0C; Mon, 13 Dec 2010 13:26:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 204D346B1A; Mon, 13 Dec 2010 08:26:19 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3623F8A009; Mon, 13 Dec 2010 08:26:18 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Mon, 13 Dec 2010 07:47:52 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012111021.oBBALcrV004450@svn.freebsd.org> In-Reply-To: <201012111021.oBBALcrV004450@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012130747.52865.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 13 Dec 2010 08:26:18 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 13:26:19 -0000 On Saturday, December 11, 2010 5:21:38 am Andriy Gapon wrote: > Author: avg > Date: Sat Dec 11 10:21:38 2010 > New Revision: 216375 > URL: http://svn.freebsd.org/changeset/base/216375 > > Log: > fix atomic_set_xxx misuse in rge > > It seems that atomic_set_xxx and atomic_store_xxx were confused. > > Reviewed by: jhb (general issue) > MFC after: 3 weeks > > Modified: > head/sys/mips/rmi/dev/xlr/rge.c > > Modified: head/sys/mips/rmi/dev/xlr/rge.c > ============================================================================== > --- head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:18:05 2010 (r216374) > +++ head/sys/mips/rmi/dev/xlr/rge.c Sat Dec 11 10:21:38 2010 (r216375) > @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32]; > static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE); > > #define port_inc_counter(port, counter) atomic_add_int(&port_counters[port][(counter)], 1) > -#define port_set_counter(port, counter, value) atomic_set_int(&port_counters[port][(counter)], (value)) > +#define port_set_counter(port, counter, value) atomic_store_int(&port_counters[port][(counter)], (value)) > #else > #define port_inc_counter(port, counter) /* Nothing */ > #define port_set_counter(port, counter, value) /* Nothing */ > @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc) > mtx_unlock_spin(&priv->lock); > > for (i = 0; i < 8; i++) { > - atomic_set_int(&(priv->frin_to_be_sent[i]), 0); > + atomic_store_int(&(priv->frin_to_be_sent[i]), 0); Err, there is no such op for this. If you don't need a memory barrier then a simple assignment to 0 should suffice. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 13:52:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00B8106566B; Mon, 13 Dec 2010 13:52:03 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E53C8FC0C; Mon, 13 Dec 2010 13:52:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDDq3Kt084111; Mon, 13 Dec 2010 13:52:03 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDDq3JT084109; Mon, 13 Dec 2010 13:52:03 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012131352.oBDDq3JT084109@svn.freebsd.org> From: Bruce Cran Date: Mon, 13 Dec 2010 13:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216407 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 13:52:03 -0000 Author: brucec Date: Mon Dec 13 13:52:03 2010 New Revision: 216407 URL: http://svn.freebsd.org/changeset/base/216407 Log: USB probing often takes a long time and finishes finding devices after init has started. In the case of sysinstall, this means that it has already built its list of devices before probing finishes. Add a hint for users who have booted from a USB stick only to find that sysinstall can't find it. MFC after: 3 days Modified: head/usr.sbin/sysinstall/media.c Modified: head/usr.sbin/sysinstall/media.c ============================================================================== --- head/usr.sbin/sysinstall/media.c Mon Dec 13 12:34:35 2010 (r216406) +++ head/usr.sbin/sysinstall/media.c Mon Dec 13 13:52:03 2010 (r216407) @@ -239,7 +239,7 @@ mediaSetUSB(dialogMenuItem *self) cnt = deviceCount(devs); if (!cnt) { - msgConfirm("No USB devices found!"); + msgConfirm("No USB devices found (try Options/Re-scan Devices)"); return DITEM_FAILURE | DITEM_CONTINUE; } else if (cnt > 1) { From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 14:30:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF0AD106566B; Mon, 13 Dec 2010 14:30:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD7788FC0C; Mon, 13 Dec 2010 14:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDEUZXN084948; Mon, 13 Dec 2010 14:30:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDEUZFZ084946; Mon, 13 Dec 2010 14:30:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012131430.oBDEUZFZ084946@svn.freebsd.org> From: Andriy Gapon Date: Mon, 13 Dec 2010 14:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216408 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 14:30:35 -0000 Author: avg Date: Mon Dec 13 14:30:35 2010 New Revision: 216408 URL: http://svn.freebsd.org/changeset/base/216408 Log: fix mips build breakage introduced in r216375: atomic_store_int doesn't exists 1) 32-bit assignment are expected to always be atomic. 2) Release/acquire memory barrier semantics doesn't seem to be needed here. So a simple assignment can be used. Remove unused port_set_counter() while here, it also used to mis-use atomic_set_int(). Reported by: jhb Pointyhat to: avg MFC after: 3 weeks Modified: head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Mon Dec 13 13:52:03 2010 (r216407) +++ head/sys/mips/rmi/dev/xlr/rge.c Mon Dec 13 14:30:35 2010 (r216408) @@ -170,10 +170,8 @@ extern uint32_t cpu_ltop_map[32]; static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE); #define port_inc_counter(port, counter) atomic_add_int(&port_counters[port][(counter)], 1) -#define port_set_counter(port, counter, value) atomic_store_int(&port_counters[port][(counter)], (value)) #else #define port_inc_counter(port, counter) /* Nothing */ -#define port_set_counter(port, counter, value) /* Nothing */ #endif int xlr_rge_tx_prepend[MAXCPU]; @@ -2281,7 +2279,7 @@ rmi_xlr_mac_open(struct rge_softc *sc) mtx_unlock_spin(&priv->lock); for (i = 0; i < 8; i++) { - atomic_store_int(&(priv->frin_to_be_sent[i]), 0); + priv->frin_to_be_sent[i] = 0; } return 0; From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 16:23:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05BEB1065670; Mon, 13 Dec 2010 16:23:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E82E58FC0A; Mon, 13 Dec 2010 16:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDGN2JS087506; Mon, 13 Dec 2010 16:23:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDGN2Nb087504; Mon, 13 Dec 2010 16:23:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012131623.oBDGN2Nb087504@svn.freebsd.org> From: Warner Losh Date: Mon, 13 Dec 2010 16:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216409 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 16:23:03 -0000 Author: imp Date: Mon Dec 13 16:23:02 2010 New Revision: 216409 URL: http://svn.freebsd.org/changeset/base/216409 Log: FreeBSD committer Dan Moschuk has passed away. Here is his death notice: http://www.lifenews.ca/thespec/profile/98251--moschuk-daniel PR: 147479 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Dec 13 14:30:35 2010 (r216408) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Dec 13 16:23:02 2010 (r216409) @@ -149,6 +149,7 @@ 05/17 Thomas Abthorpe born in Port Arthur, Ontario, Canada, 1968 05/19 Philippe Charnier born in Fontainebleau, France, 1966 05/19 Ian Dowse born in Dublin, Ireland, 1975 +05/20 Dan Moschuk died in Burlington, Ontario, Canada, 2010 05/21 Kris Kennaway born in Winnipeg, Manitoba, Canada, 1978 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 05/22 Michael Bushkov born in Rostov-on-Don, Russian Federation, 1985 @@ -284,7 +285,6 @@ 10/19 Nick Barkas born in Longview, Washington, United States, 1981 10/20 Joel Dahl born in Lidkoping, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 -10/21 Dan Moschuk born in Halifax, Nova Scotia, Canada, 1980 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 17:05:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20CAC1065674; Mon, 13 Dec 2010 17:05:07 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ew0-f51.google.com (mail-ew0-f51.google.com [209.85.215.51]) by mx1.freebsd.org (Postfix) with ESMTP id 86CD68FC1A; Mon, 13 Dec 2010 17:05:05 +0000 (UTC) Received: by ewy19 with SMTP id 19so4223786ewy.10 for ; Mon, 13 Dec 2010 09:05:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=KpWcbJT8oTzg2XK13LoHd7vd0puX7Ve3VQlpESSNoM4=; b=DvoWwLQpQkEhJq0b2dhqnfE71pSAA2cjQnMYQqTkr6AlL6nfRanLoXzQJndL+oY9is L7kYB11Y7XHWC7GXRMg0fwGEY2mzd5wJJ4wvHZ1whwBPhpUpIXb80KyTJHVB0vAI7W2L 5TwE96aysU4R+Nhy+o9jVqgZ8zBkcobhOrhNI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XiBO3p8i/92hjAyunx8uSt9yrYTX/LGseZfs6czlB58hq8rMTfLd6D5iqAcJJLjgj7 gGP09Qu9PNe/gPYTSi108sayc7O5/YGLAFmVfth5JvBv+qZKQCx72inRFCvecXy9FkjU ghiWlqCBe3cqYNuWbYHiEZCz/2HKqm8jqPzTU= MIME-Version: 1.0 Received: by 10.213.28.144 with SMTP id m16mr4091590ebc.95.1292254253570; Mon, 13 Dec 2010 07:30:53 -0800 (PST) Sender: c.jayachandran@gmail.com Received: by 10.213.14.147 with HTTP; Mon, 13 Dec 2010 07:30:53 -0800 (PST) In-Reply-To: <201012130747.52865.jhb@freebsd.org> References: <201012111021.oBBALcrV004450@svn.freebsd.org> <201012130747.52865.jhb@freebsd.org> Date: Mon, 13 Dec 2010 21:00:53 +0530 X-Google-Sender-Auth: t2I4q-Nkd9IrPzbYB8dKcEtftjs Message-ID: From: "Jayachandran C." To: John Baldwin , Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 17:05:07 -0000 On Mon, Dec 13, 2010 at 6:17 PM, John Baldwin wrote: > On Saturday, December 11, 2010 5:21:38 am Andriy Gapon wrote: >> Author: avg >> Date: Sat Dec 11 10:21:38 2010 >> New Revision: 216375 >> URL: http://svn.freebsd.org/changeset/base/216375 >> >> Log: >> =A0 fix atomic_set_xxx misuse in rge >> >> =A0 It seems that atomic_set_xxx and atomic_store_xxx were confused. >> >> =A0 Reviewed by: =A0 =A0 =A0 =A0jhb (general issue) >> =A0 MFC after: =A03 weeks >> >> Modified: >> =A0 head/sys/mips/rmi/dev/xlr/rge.c >> >> Modified: head/sys/mips/rmi/dev/xlr/rge.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/mips/rmi/dev/xlr/rge.c =A0 Sat Dec 11 10:18:05 2010 =A0 =A0= =A0 =A0(r216374) >> +++ head/sys/mips/rmi/dev/xlr/rge.c =A0 Sat Dec 11 10:21:38 2010 =A0 =A0= =A0 =A0(r216375) >> @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32]; >> =A0static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE); >> >> =A0#define port_inc_counter(port, counter) =A0 =A0 =A0atomic_add_int(&po= rt_counters[port][(counter)], 1) >> -#define port_set_counter(port, counter, value) =A0 =A0 =A0 atomic_set_i= nt(&port_counters[port][(counter)], (value)) >> +#define port_set_counter(port, counter, value) =A0 =A0 =A0 atomic_store= _int(&port_counters[port][(counter)], (value)) >> =A0#else >> =A0#define port_inc_counter(port, counter) =A0 =A0 =A0/* Nothing */ >> =A0#define port_set_counter(port, counter, value) =A0 =A0 =A0 /* Nothing= */ >> @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc) >> =A0 =A0 =A0 mtx_unlock_spin(&priv->lock); >> >> =A0 =A0 =A0 for (i =3D 0; i < 8; i++) { >> - =A0 =A0 =A0 =A0 =A0 =A0 atomic_set_int(&(priv->frin_to_be_sent[i]), 0)= ; >> + =A0 =A0 =A0 =A0 =A0 =A0 atomic_store_int(&(priv->frin_to_be_sent[i]), = 0); > > Err, there is no such op for this. =A0If you don't need a memory barrier = then a > simple assignment to 0 should suffice. This is the deprecated driver for the XLR's on-chip network interface. There is a new driver for this, so you can ignore problems in this file - it should be removed soon. Thanks, JC From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 17:53:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2347D106566B; Mon, 13 Dec 2010 17:53:39 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1158A8FC16; Mon, 13 Dec 2010 17:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDHrcpK089436; Mon, 13 Dec 2010 17:53:38 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDHrcCZ089432; Mon, 13 Dec 2010 17:53:38 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012131753.oBDHrcCZ089432@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 13 Dec 2010 17:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216410 - head/sys/mips/rmi/dev/iic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 17:53:39 -0000 Author: jchandra Date: Mon Dec 13 17:53:38 2010 New Revision: 216410 URL: http://svn.freebsd.org/changeset/base/216410 Log: Updates for I2C devices on XLR engg boards. - ds1374u : use multi-byte write. - at24co2n, max6657: remove mutex, iicbus has the necessary locking. Submitted by: Sreekanth M. S. (kanthms at netlogicmicro com) Modified: head/sys/mips/rmi/dev/iic/at24co2n.c head/sys/mips/rmi/dev/iic/ds1374u.c head/sys/mips/rmi/dev/iic/max6657.c Modified: head/sys/mips/rmi/dev/iic/at24co2n.c ============================================================================== --- head/sys/mips/rmi/dev/iic/at24co2n.c Mon Dec 13 16:23:02 2010 (r216409) +++ head/sys/mips/rmi/dev/iic/at24co2n.c Mon Dec 13 17:53:38 2010 (r216410) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); struct at24co2n_softc { uint32_t sc_addr; device_t sc_dev; - struct mtx sc_mtx; uint8_t sc_mac_addr[6]; }; @@ -103,8 +102,6 @@ at24co2n_attach(device_t dev) sc->sc_dev = dev; sc->sc_addr = iicbus_get_addr(dev); - mtx_init(&sc->sc_mtx, "eeprom", "eeprom", MTX_DEF); - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "eeprom-mac", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, at24co2n_mac_sysctl, "A", "mac address"); @@ -121,9 +118,7 @@ at24co2n_read_mac(struct at24co2n_softc { sc->sc_addr, IIC_M_RD, 6, sc->sc_mac_addr}, }; - mtx_lock(&sc->sc_mtx); iicbus_transfer(sc->sc_dev, msgs, 2); - mtx_unlock(&sc->sc_mtx); } static device_method_t at24co2n_methods[] = { Modified: head/sys/mips/rmi/dev/iic/ds1374u.c ============================================================================== --- head/sys/mips/rmi/dev/iic/ds1374u.c Mon Dec 13 16:23:02 2010 (r216409) +++ head/sys/mips/rmi/dev/iic/ds1374u.c Mon Dec 13 17:53:38 2010 (r216410) @@ -85,36 +85,22 @@ ds1374u_attach(device_t dev) return (0); } - -static int -ds1374u_write(device_t dev, int reg, uint8_t val) +static int +ds1374u_settime(device_t dev, struct timespec *ts) { - uint8_t data[2]; + /* NB: register pointer precedes actual data */ + uint8_t data[5] = { DS1374_RTC_COUNTER }; struct ds1374u_softc *sc = device_get_softc(dev); struct iic_msg msgs[1] = { - { sc->sc_addr, IIC_M_WR, 2, data }, + { sc->sc_addr, IIC_M_WR, 5, data }, }; - data[0] = reg; - data[1] = val; - if (iicbus_transfer(dev, msgs, 1) == 0) - return (0); - else - return (-1); -} - -static int -ds1374u_settime(device_t dev, struct timespec *ts) -{ - int i; - int temp = 0; + data[1] = (ts->tv_sec >> 0) & 0xff; + data[2] = (ts->tv_sec >> 8) & 0xff; + data[3] = (ts->tv_sec >> 16) & 0xff; + data[4] = (ts->tv_sec >> 24) & 0xff; - for (i = 0; i < 4; i++) { - temp = (ts->tv_sec >> (8*i)) & 0xff; - if (ds1374u_write(dev, DS1374_RTC_COUNTER+i, temp)!=0) - return (-1); - } - return 0; + return iicbus_transfer(dev, msgs, 1); } static int @@ -137,7 +123,6 @@ ds1374u_gettime(device_t dev, struct tim ts->tv_nsec = 0; } return error; - return 0; } static device_method_t ds1374u_methods[] = { Modified: head/sys/mips/rmi/dev/iic/max6657.c ============================================================================== --- head/sys/mips/rmi/dev/iic/max6657.c Mon Dec 13 16:23:02 2010 (r216409) +++ head/sys/mips/rmi/dev/iic/max6657.c Mon Dec 13 17:53:38 2010 (r216410) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); struct max6657_softc { uint32_t sc_addr; device_t sc_dev; - struct mtx sc_mtx; int sc_curtemp; int sc_lastupdate; /* in ticks */ }; @@ -101,7 +100,6 @@ max6657_attach(device_t dev) } sc->sc_dev = dev; sc->sc_addr = iicbus_get_addr(dev); - mtx_init(&sc->sc_mtx, "max6657", "max6657", MTX_DEF); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, @@ -132,7 +130,6 @@ max6657_update(struct max6657_softc *sc) { int v; - mtx_lock(&sc->sc_mtx); /* NB: no point in updating any faster than the chip */ if (ticks - sc->sc_lastupdate > hz) { v = max6657_read(sc->sc_dev, sc->sc_addr, MAX6657_EXT_TEMP); @@ -140,7 +137,6 @@ max6657_update(struct max6657_softc *sc) sc->sc_curtemp = v; sc->sc_lastupdate = ticks; } - mtx_unlock(&sc->sc_mtx); } static device_method_t max6657_methods[] = { From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 18:56:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4DDE1065694; Mon, 13 Dec 2010 18:56:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92A738FC19; Mon, 13 Dec 2010 18:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDIu4DQ090952; Mon, 13 Dec 2010 18:56:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDIu451090950; Mon, 13 Dec 2010 18:56:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012131856.oBDIu451090950@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 13 Dec 2010 18:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216413 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 18:56:04 -0000 Author: trasz Date: Mon Dec 13 18:56:04 2010 New Revision: 216413 URL: http://svn.freebsd.org/changeset/base/216413 Log: Adapt filesystem-independent NFSv4 ACL code (used by UFS, but not by ZFS) to PSARC/2010/029. In short, the semantics is simplified - "weird stuff" no longer happens after chmod, entries don't get duplicated during inheritance, and trivial ACLs no longer contain three "DENY" entries, which is also more friendly to MS Windows. By default, UFS keeps using old semantics. To change it, set sysctl vfs.acl_nfs4_old_semantics to 0. I'll flip the switch when ZFSv28 hits the tree, to keep these two in sync - ZFS v28 uses PSARC semantics, and ZFS v15 uses the old one. Modified: head/sys/kern/subr_acl_nfs4.c Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Mon Dec 13 17:56:31 2010 (r216412) +++ head/sys/kern/subr_acl_nfs4.c Mon Dec 13 18:56:04 2010 (r216413) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2008-2009 Edward Tomasz Napierała + * Copyright (c) 2008-2010 Edward Tomasz Napierała * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #else #include @@ -49,10 +50,18 @@ __FBSDID("$FreeBSD$"); #include #define KASSERT(a, b) assert(a) #define CTASSERT(a) -#endif /* _KERNEL */ + +void acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode); + +#endif /* !_KERNEL */ + +static int acl_nfs4_old_semantics = 1; #ifdef _KERNEL +SYSCTL_INT(_vfs, OID_AUTO, acl_nfs4_old_semantics, CTLFLAG_RW, + &acl_nfs4_old_semantics, 1, "Use pre-PSARC/2010/029 NFSv4 ACL semantics"); + static struct { accmode_t accmode; int mask; @@ -349,63 +358,9 @@ _acl_duplicate_entry(struct acl *aclp, i return (&(aclp->acl_entry[entry_index + 1])); } -/* - * Calculate trivial ACL in a manner compatible with PSARC/2010/029. - * Note that this results in an ACL different from (but semantically - * equal to) the "canonical six" trivial ACL computed using algorithm - * described in draft-ietf-nfsv4-minorversion1-03.txt, 3.16.6.2. - */ -void -acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode) -{ - acl_perm_t user_allow_first = 0, user_deny = 0, group_deny = 0; - acl_perm_t user_allow, group_allow, everyone_allow; - - KASSERT(aclp->acl_cnt == 0, ("aclp->acl_cnt == 0")); - - user_allow = group_allow = everyone_allow = ACL_READ_ACL | - ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS | ACL_SYNCHRONIZE; - user_allow |= ACL_WRITE_ACL | ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES | - ACL_WRITE_NAMED_ATTRS; - - if (mode & S_IRUSR) - user_allow |= ACL_READ_DATA; - if (mode & S_IWUSR) - user_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); - if (mode & S_IXUSR) - user_allow |= ACL_EXECUTE; - - if (mode & S_IRGRP) - group_allow |= ACL_READ_DATA; - if (mode & S_IWGRP) - group_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); - if (mode & S_IXGRP) - group_allow |= ACL_EXECUTE; - - if (mode & S_IROTH) - everyone_allow |= ACL_READ_DATA; - if (mode & S_IWOTH) - everyone_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); - if (mode & S_IXOTH) - everyone_allow |= ACL_EXECUTE; - - user_deny = ((group_allow | everyone_allow) & ~user_allow); - group_deny = everyone_allow & ~group_allow; - user_allow_first = group_deny & ~user_deny; - - if (user_allow_first != 0) - _acl_append(aclp, ACL_USER_OBJ, user_allow_first, ACL_ENTRY_TYPE_ALLOW); - if (user_deny != 0) - _acl_append(aclp, ACL_USER_OBJ, user_deny, ACL_ENTRY_TYPE_DENY); - if (group_deny != 0) - _acl_append(aclp, ACL_GROUP_OBJ, group_deny, ACL_ENTRY_TYPE_DENY); - _acl_append(aclp, ACL_USER_OBJ, user_allow, ACL_ENTRY_TYPE_ALLOW); - _acl_append(aclp, ACL_GROUP_OBJ, group_allow, ACL_ENTRY_TYPE_ALLOW); - _acl_append(aclp, ACL_EVERYONE, everyone_allow, ACL_ENTRY_TYPE_ALLOW); -} - -void -acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, int file_owner_id) +static void +acl_nfs4_sync_acl_from_mode_draft(struct acl *aclp, mode_t mode, + int file_owner_id) { int i, meets, must_append; struct acl_entry *entry, *copy, *previous, @@ -749,6 +704,17 @@ acl_nfs4_sync_acl_from_mode(struct acl * } void +acl_nfs4_sync_acl_from_mode(struct acl *aclp, mode_t mode, + int file_owner_id) +{ + + if (acl_nfs4_old_semantics) + acl_nfs4_sync_acl_from_mode_draft(aclp, mode, file_owner_id); + else + acl_nfs4_trivial_from_mode(aclp, mode); +} + +void acl_nfs4_sync_mode_from_acl(mode_t *_mode, const struct acl *aclp) { int i; @@ -871,8 +837,12 @@ acl_nfs4_sync_mode_from_acl(mode_t *_mod *_mode = mode | (old_mode & ACL_PRESERVE_MASK); } -void -acl_nfs4_compute_inherited_acl(const struct acl *parent_aclp, +/* + * Calculate inherited ACL in a manner compatible with NFSv4 Minor Version 1, + * draft-ietf-nfsv4-minorversion1-03.txt. + */ +static void +acl_nfs4_compute_inherited_acl_draft(const struct acl *parent_aclp, struct acl *child_aclp, mode_t mode, int file_owner_id, int is_directory) { @@ -1031,6 +1001,218 @@ acl_nfs4_compute_inherited_acl(const str acl_nfs4_sync_acl_from_mode(child_aclp, mode, file_owner_id); } +/* + * Populate the ACL with entries inherited from parent_aclp. + */ +static void +acl_nfs4_inherit_entries(const struct acl *parent_aclp, + struct acl *child_aclp, mode_t mode, int file_owner_id, + int is_directory) +{ + int i, flags, tag; + const struct acl_entry *parent_entry; + struct acl_entry *entry; + + KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); + KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, + ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); + + for (i = 0; i < parent_aclp->acl_cnt; i++) { + parent_entry = &(parent_aclp->acl_entry[i]); + flags = parent_entry->ae_flags; + tag = parent_entry->ae_tag; + + /* + * Don't inherit owner@, group@, or everyone@ entries. + */ + if (tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ || + tag == ACL_EVERYONE) + continue; + + /* + * Entry is not inheritable at all. + */ + if ((flags & (ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_FILE_INHERIT)) == 0) + continue; + + /* + * We're creating a file, but entry is not inheritable + * by files. + */ + if (!is_directory && (flags & ACL_ENTRY_FILE_INHERIT) == 0) + continue; + + /* + * Entry is inheritable only by files, but has NO_PROPAGATE + * flag set, and we're creating a directory, so it wouldn't + * propagate to any file in that directory anyway. + */ + if (is_directory && + (flags & ACL_ENTRY_DIRECTORY_INHERIT) == 0 && + (flags & ACL_ENTRY_NO_PROPAGATE_INHERIT)) + continue; + + /* + * Entry qualifies for being inherited. + */ + KASSERT(child_aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES, + ("child_aclp->acl_cnt + 1 <= ACL_MAX_ENTRIES")); + entry = &(child_aclp->acl_entry[child_aclp->acl_cnt]); + *entry = *parent_entry; + child_aclp->acl_cnt++; + + entry->ae_flags &= ~ACL_ENTRY_INHERIT_ONLY; + + /* + * If the type of the ACE is neither ALLOW nor DENY, + * then leave it as it is and proceed to the next one. + */ + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) + continue; + + /* + * If the ACL_ENTRY_NO_PROPAGATE_INHERIT is set, or if + * the object being created is not a directory, then clear + * the following flags: ACL_ENTRY_NO_PROPAGATE_INHERIT, + * ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT, + * ACL_ENTRY_INHERIT_ONLY. + */ + if (entry->ae_flags & ACL_ENTRY_NO_PROPAGATE_INHERIT || + !is_directory) { + entry->ae_flags &= ~(ACL_ENTRY_NO_PROPAGATE_INHERIT | + ACL_ENTRY_FILE_INHERIT | ACL_ENTRY_DIRECTORY_INHERIT | + ACL_ENTRY_INHERIT_ONLY); + } + + /* + * If the object is a directory and ACL_ENTRY_FILE_INHERIT + * is set, but ACL_ENTRY_DIRECTORY_INHERIT is not set, ensure + * that ACL_ENTRY_INHERIT_ONLY is set. + */ + if (is_directory && + (entry->ae_flags & ACL_ENTRY_FILE_INHERIT) && + ((entry->ae_flags & ACL_ENTRY_DIRECTORY_INHERIT) == 0)) { + entry->ae_flags |= ACL_ENTRY_INHERIT_ONLY; + } + + if (entry->ae_entry_type == ACL_ENTRY_TYPE_ALLOW && + (entry->ae_flags & ACL_ENTRY_INHERIT_ONLY) == 0) { + /* + * Some permissions must never be inherited. + */ + entry->ae_perm &= ~(ACL_WRITE_ACL | ACL_WRITE_OWNER | + ACL_WRITE_NAMED_ATTRS | ACL_WRITE_ATTRIBUTES); + + /* + * Others must be masked according to the file mode. + */ + if ((mode & S_IRGRP) == 0) + entry->ae_perm &= ~ACL_READ_DATA; + if ((mode & S_IWGRP) == 0) + entry->ae_perm &= + ~(ACL_WRITE_DATA | ACL_APPEND_DATA); + if ((mode & S_IXGRP) == 0) + entry->ae_perm &= ~ACL_EXECUTE; + } + } +} + +/* + * Calculate inherited ACL in a manner compatible with PSARC/2010/029. + * It's also being used to calculate a trivial ACL, by inheriting from + * a NULL ACL. + */ +static void +acl_nfs4_compute_inherited_acl_psarc(const struct acl *parent_aclp, + struct acl *aclp, mode_t mode, int file_owner_id, int is_directory) +{ + acl_perm_t user_allow_first = 0, user_deny = 0, group_deny = 0; + acl_perm_t user_allow, group_allow, everyone_allow; + + KASSERT(aclp->acl_cnt == 0, ("aclp->acl_cnt == 0")); + + user_allow = group_allow = everyone_allow = ACL_READ_ACL | + ACL_READ_ATTRIBUTES | ACL_READ_NAMED_ATTRS | ACL_SYNCHRONIZE; + user_allow |= ACL_WRITE_ACL | ACL_WRITE_OWNER | ACL_WRITE_ATTRIBUTES | + ACL_WRITE_NAMED_ATTRS; + + if (mode & S_IRUSR) + user_allow |= ACL_READ_DATA; + if (mode & S_IWUSR) + user_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXUSR) + user_allow |= ACL_EXECUTE; + + if (mode & S_IRGRP) + group_allow |= ACL_READ_DATA; + if (mode & S_IWGRP) + group_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXGRP) + group_allow |= ACL_EXECUTE; + + if (mode & S_IROTH) + everyone_allow |= ACL_READ_DATA; + if (mode & S_IWOTH) + everyone_allow |= (ACL_WRITE_DATA | ACL_APPEND_DATA); + if (mode & S_IXOTH) + everyone_allow |= ACL_EXECUTE; + + user_deny = ((group_allow | everyone_allow) & ~user_allow); + group_deny = everyone_allow & ~group_allow; + user_allow_first = group_deny & ~user_deny; + + if (user_allow_first != 0) + _acl_append(aclp, ACL_USER_OBJ, user_allow_first, + ACL_ENTRY_TYPE_ALLOW); + if (user_deny != 0) + _acl_append(aclp, ACL_USER_OBJ, user_deny, + ACL_ENTRY_TYPE_DENY); + if (group_deny != 0) + _acl_append(aclp, ACL_GROUP_OBJ, group_deny, + ACL_ENTRY_TYPE_DENY); + + if (parent_aclp != NULL) + acl_nfs4_inherit_entries(parent_aclp, aclp, mode, + file_owner_id, is_directory); + + _acl_append(aclp, ACL_USER_OBJ, user_allow, ACL_ENTRY_TYPE_ALLOW); + _acl_append(aclp, ACL_GROUP_OBJ, group_allow, ACL_ENTRY_TYPE_ALLOW); + _acl_append(aclp, ACL_EVERYONE, everyone_allow, ACL_ENTRY_TYPE_ALLOW); +} + +void +acl_nfs4_compute_inherited_acl(const struct acl *parent_aclp, + struct acl *child_aclp, mode_t mode, int file_owner_id, + int is_directory) +{ + + if (acl_nfs4_old_semantics) + acl_nfs4_compute_inherited_acl_draft(parent_aclp, child_aclp, + mode, file_owner_id, is_directory); + else + acl_nfs4_compute_inherited_acl_psarc(parent_aclp, child_aclp, + mode, file_owner_id, is_directory); +} + +/* + * Calculate trivial ACL in a manner compatible with PSARC/2010/029. + * Note that this results in an ACL different from (but semantically + * equal to) the "canonical six" trivial ACL computed using algorithm + * described in draft-ietf-nfsv4-minorversion1-03.txt, 3.16.6.2. + * + * This routine is not static only because the code is being used in libc. + * Kernel code should call acl_nfs4_sync_acl_from_mode() instead. + */ +void +acl_nfs4_trivial_from_mode(struct acl *aclp, mode_t mode) +{ + + aclp->acl_cnt = 0; + acl_nfs4_compute_inherited_acl_psarc(NULL, aclp, mode, -1, -1); +} + #ifdef _KERNEL static int _acls_are_equal(const struct acl *a, const struct acl *b) @@ -1067,7 +1249,7 @@ acl_nfs4_is_trivial(const struct acl *ac mode_t tmpmode = 0; struct acl *tmpaclp; - if (aclp->acl_cnt != 6) + if (aclp->acl_cnt > 6) return (0); /* @@ -1078,10 +1260,23 @@ acl_nfs4_is_trivial(const struct acl *ac * this slow implementation significantly speeds things up * for files that don't have non-trivial ACLs - it's critical * for performance to not use EA when they are not needed. + * + * First try the PSARC/2010/029 semantics. */ tmpaclp = acl_alloc(M_WAITOK | M_ZERO); acl_nfs4_sync_mode_from_acl(&tmpmode, aclp); - acl_nfs4_sync_acl_from_mode(tmpaclp, tmpmode, file_owner_id); + acl_nfs4_trivial_from_mode(tmpaclp, tmpmode); + trivial = _acls_are_equal(aclp, tmpaclp); + if (trivial) { + acl_free(tmpaclp); + return (trivial); + } + + /* + * Check if it's a draft-ietf-nfsv4-minorversion1-03.txt trivial ACL. + */ + tmpaclp->acl_cnt = 0; + acl_nfs4_sync_acl_from_mode_draft(tmpaclp, tmpmode, file_owner_id); trivial = _acls_are_equal(aclp, tmpaclp); acl_free(tmpaclp); From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 18:59:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4A50106564A; Mon, 13 Dec 2010 18:59:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D384F8FC17; Mon, 13 Dec 2010 18:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDIxtR6091051; Mon, 13 Dec 2010 18:59:55 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDIxtWu091049; Mon, 13 Dec 2010 18:59:55 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012131859.oBDIxtWu091049@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 13 Dec 2010 18:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216414 - head/tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 18:59:56 -0000 Author: trasz Date: Mon Dec 13 18:59:55 2010 New Revision: 216414 URL: http://svn.freebsd.org/changeset/base/216414 Log: Recognize NFSv4 ACL semantics and run proper regression test. Modified: head/tools/regression/acltools/02.t Modified: head/tools/regression/acltools/02.t ============================================================================== --- head/tools/regression/acltools/02.t Mon Dec 13 18:56:04 2010 (r216413) +++ head/tools/regression/acltools/02.t Mon Dec 13 18:59:55 2010 (r216414) @@ -69,7 +69,11 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null +if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then + perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null +else + perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null +fi if [ $? -eq 0 ]; then echo "ok 3" From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 19:01:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33FA7106564A; Mon, 13 Dec 2010 19:01:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22ABD8FC13; Mon, 13 Dec 2010 19:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDJ1NWT091143; Mon, 13 Dec 2010 19:01:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDJ1NdQ091141; Mon, 13 Dec 2010 19:01:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012131901.oBDJ1NdQ091141@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 13 Dec 2010 19:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216415 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 19:01:24 -0000 Author: trasz Date: Mon Dec 13 19:01:23 2010 New Revision: 216415 URL: http://svn.freebsd.org/changeset/base/216415 Log: After PSARC/2010/029, "canonical six" no longer exists. Modified: head/lib/libc/posix1e/acl_is_trivial_np.3 Modified: head/lib/libc/posix1e/acl_is_trivial_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_is_trivial_np.3 Mon Dec 13 18:59:55 2010 (r216414) +++ head/lib/libc/posix1e/acl_is_trivial_np.3 Mon Dec 13 19:01:23 2010 (r216415) @@ -56,7 +56,9 @@ ACL is trivial if it can be fully expres any access rules. For POSIX.1e ACLs, ACL is trivial if it has the three required entries, one for owner, one for owning group, and one for other. -For NFSv4 ACLs, ACL is trivial if it has the "canonical six" entries. +For NFSv4 ACLs, ACL is trivial if is identical to the ACL generated by +.Fn acl_strip_np 3 +from the file mode. Files that have non-trivial ACL have a plus sign appended after mode bits in "ls -l" output. .Sh RETURN VALUES From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 19:03:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF66106564A; Mon, 13 Dec 2010 19:03:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 739BB8FC14; Mon, 13 Dec 2010 19:03:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDJ3AL9091211; Mon, 13 Dec 2010 19:03:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDJ3Alq091209; Mon, 13 Dec 2010 19:03:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201012131903.oBDJ3Alq091209@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 13 Dec 2010 19:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216416 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 19:03:10 -0000 Author: trasz Date: Mon Dec 13 19:03:10 2010 New Revision: 216416 URL: http://svn.freebsd.org/changeset/base/216416 Log: Bump manual page date. Modified: head/lib/libc/posix1e/acl_is_trivial_np.3 Modified: head/lib/libc/posix1e/acl_is_trivial_np.3 ============================================================================== --- head/lib/libc/posix1e/acl_is_trivial_np.3 Mon Dec 13 19:01:23 2010 (r216415) +++ head/lib/libc/posix1e/acl_is_trivial_np.3 Mon Dec 13 19:03:10 2010 (r216416) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2009 +.Dd December 13, 2010 .Dt ACL_STRIP_NP 3 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 19:50:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D069F106564A; Mon, 13 Dec 2010 19:50:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEAA78FC0C; Mon, 13 Dec 2010 19:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDJoCGt092155; Mon, 13 Dec 2010 19:50:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDJoCrE092153; Mon, 13 Dec 2010 19:50:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012131950.oBDJoCrE092153@svn.freebsd.org> From: Xin LI Date: Mon, 13 Dec 2010 19:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216417 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 19:50:12 -0000 Author: delphij Date: Mon Dec 13 19:50:12 2010 New Revision: 216417 URL: http://svn.freebsd.org/changeset/base/216417 Log: Move locale.h include to the beginning header section as pointed out by style(9) Submitted by: Pedro F. Giffuni Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Mon Dec 13 19:03:10 2010 (r216416) +++ head/usr.bin/printf/printf.c Mon Dec 13 19:50:12 2010 (r216417) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -49,6 +49,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -65,8 +66,6 @@ static const char rcsid[] = #define warnx3(a, b, c) warnx(a, b, c) #endif -#include - #define PF(f, func) do { \ char *b = NULL; \ if (havewidth) \ From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 19:54:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECE09106564A; Mon, 13 Dec 2010 19:54:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC13D8FC1C; Mon, 13 Dec 2010 19:54:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDJsg5h092271; Mon, 13 Dec 2010 19:54:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDJsgrH092269; Mon, 13 Dec 2010 19:54:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012131954.oBDJsgrH092269@svn.freebsd.org> From: Xin LI Date: Mon, 13 Dec 2010 19:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216418 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 19:54:43 -0000 Author: delphij Date: Mon Dec 13 19:54:42 2010 New Revision: 216418 URL: http://svn.freebsd.org/changeset/base/216418 Log: The only caller of mknum() provides a char instead of an int, so make it match the definition. PR: bin/152934 Submitted by: Pedro F. Giffuni Obtained from: Illumos Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Mon Dec 13 19:50:12 2010 (r216417) +++ head/usr.bin/printf/printf.c Mon Dec 13 19:54:42 2010 (r216418) @@ -92,7 +92,7 @@ static int getint(int *); static int getnum(intmax_t *, uintmax_t *, int); static const char *getstr(void); -static char *mknum(char *, int); +static char *mknum(char *, char); static void usage(void); static char **gargv; @@ -336,7 +336,7 @@ printf_doformat(char *start, int *rval) } static char * -mknum(char *str, int ch) +mknum(char *str, char ch) { static char *copy; static size_t copy_size; From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 23:26:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71F1A1065670; Mon, 13 Dec 2010 23:26:31 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 605A18FC0A; Mon, 13 Dec 2010 23:26:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDNQVOM096846; Mon, 13 Dec 2010 23:26:31 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDNQV7h096844; Mon, 13 Dec 2010 23:26:31 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012132326.oBDNQV7h096844@svn.freebsd.org> From: Robert Watson Date: Mon, 13 Dec 2010 23:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216419 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 23:26:31 -0000 Author: rwatson Date: Mon Dec 13 23:26:31 2010 New Revision: 216419 URL: http://svn.freebsd.org/changeset/base/216419 Log: Add a rudimentary Xen man page summarising the state of Xen on amd64 and i386, how to configure the kernel, and some known issues. Further refinement almost certainly required. This is not a Xen installation manual. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Dec 13 19:54:42 2010 (r216418) +++ head/share/man/man4/Makefile Mon Dec 13 23:26:31 2010 (r216419) @@ -495,6 +495,7 @@ MAN= aac.4 \ wlan_xauth.4 \ ${_wpi.4} \ xe.4 \ + ${_xen.4} \ xl.4 \ xpt.4 \ zero.4 \ @@ -687,6 +688,7 @@ _spkr.4= spkr.4 _tpm.4= tpm.4 _urtw.4= urtw.4 _wpi.4= wpi.4 +_xen.4= xen.4 MLINKS+=lindev.4 full.4 .endif From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 23:30:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4A41106566B; Mon, 13 Dec 2010 23:30:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D21AF8FC13; Mon, 13 Dec 2010 23:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDNUu7j096953; Mon, 13 Dec 2010 23:30:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDNUuW5096951; Mon, 13 Dec 2010 23:30:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012132330.oBDNUuW5096951@svn.freebsd.org> From: Robert Watson Date: Mon, 13 Dec 2010 23:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216420 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 23:30:57 -0000 Author: rwatson Date: Mon Dec 13 23:30:56 2010 New Revision: 216420 URL: http://svn.freebsd.org/changeset/base/216420 Log: Add a rudimentary Xen man page summarising the state of Xen on amd64 and i386, how to configure the kernel, and some known issues. Further refinement almost certainly required. This is not a Xen installation manual. MFC after: 3 days Sponsored by: DARPA, AFRL Added: head/share/man/man4/xen.4 (contents, props changed) Added: head/share/man/man4/xen.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/xen.4 Mon Dec 13 23:30:56 2010 (r216420) @@ -0,0 +1,115 @@ +.\" Copyright (c) 2010 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 +.\" ("CTSRD"), as part of the DARPA CRASH research program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 13, 2010 +.Dt XEN 4 +.Os +.Sh NAME +.Nm xen +.Nd Xen Hypervisor Guest (DomU) Support +.Sh SYNOPSIS +To compile para-virtualized (PV) Xen guest support into the i386 kernel, place +the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options PAE" +.Cd "options XEN" +.Ed +.Pp +To compile hardware-assisted virtualization (HVM) Xen guest support into the +amd64 kernel, place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "options XENHVM" +.Ed +.Pp +To compile the Xen PCI bus and para-virtualized (PV) drivers into an amd64 +or i386 kernel, place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device xenpci" +.Ed +.Sh DESCRIPTION +The Xen Hypervisor allows multiple virtual machines to be run on a single +computer system. +When first released, Xen required that i386 kernels be compiled +"para-virtualized" as the x86 instruction set was not fully virtualizable. +With later instruction set extensions from AMD and Intel to support fully +virtualizable instructions, unmodified kernels could also be supported, +referred to as hardware-assisted virtualization (HVM). +HVM systems may still use para-virtualized drivers, which are aware of +virtualization and able to optimize certain behaviours to improve +performance or semantics. +.Pp +.Fx +supports a fully para-virtualized (PV) kernel on the i386 architecture using +.Cd "options XEN" ; +currently, this requires use of a PAE kernel, enabled via +.Cd "options PAE" . +.Fx +supports hardware-assited virtualization (HVM) on both the i386 and amd64 +kernels; however, PV device drivers with an HVM kernel are only supported on +the amd64 architecture. +.Pp +Para-virtualized device drivers are required in order to support certain +functionality, such as the dynamic addition of new virtual devices, and the +"balloon driver" (returning physical memory to the Hypervisor on demand), +and VM suspend/resume. +.Sh SEE ALSO +.Xr pae 4 +.Sh HISTORY +Support for +.Nm +first appeared in +.Fx 8.1 . +.Sh AUTHORS +.An -nosplit +.Fx +support for Xen was first added by +.An Kip Mac Aq kmacy@FreeBSD.org +and +.An Doug Rabson Aq dfr@FreeBSD.org . +Further refinements were made by +.An Justin Gibbs Aq gibbs@FreeBSD.org , +.An Adrian Chadd Aq adrian@FreeBSD.org , +and +.An Colin Percival Aq cperciva@FreeBSD.org . +This manual page was written by +.An Robert Watson Aq rwatson@FreeBSD.org . +.Sh BUGS +.Fx +is only able to run as a Xen guest (DomU) and not as a Xen host (Dom0). +.Pp +A fully para-virtualized (PV) kernel is only supported on i386, and not +amd64. +.Pp +Para-virtualized drivers under hardware-assisted virtualization (HVM) kernel +are only supported on amd64, not i386. +.P +As of this release, Xen DomU support is not heavily tested; instability has +been reported during VM migration of PV kernels, and certain PV driver +features, such as the balloon driver, are under-exercised. From owner-svn-src-head@FreeBSD.ORG Mon Dec 13 23:53:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B68C106566C; Mon, 13 Dec 2010 23:53:56 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3974B8FC17; Mon, 13 Dec 2010 23:53:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBDNruHL097419; Mon, 13 Dec 2010 23:53:56 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBDNruQX097416; Mon, 13 Dec 2010 23:53:56 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201012132353.oBDNruQX097416@svn.freebsd.org> From: Kirk McKusick Date: Mon, 13 Dec 2010 23:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216421 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2010 23:53:56 -0000 Author: mckusick Date: Mon Dec 13 23:53:55 2010 New Revision: 216421 URL: http://svn.freebsd.org/changeset/base/216421 Log: Tighten up some of the comments describing turnstiles and sleepqueues. No code changes. Reviewed by: John Baldwin Modified: head/sys/sys/sleepqueue.h head/sys/sys/turnstile.h Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Mon Dec 13 23:30:56 2010 (r216420) +++ head/sys/sys/sleepqueue.h Mon Dec 13 23:53:55 2010 (r216421) @@ -49,7 +49,7 @@ * call sleepq_set_timeout() after sleepq_add() to setup a timeout. It * should then use one of the sleepq_timedwait() functions to block. * - * If the thread wants to the sleep to be interruptible by signals, it can + * If the thread wants the sleep to be interruptible by signals, it can * call sleepq_catch_signals() after sleepq_add(). It should then use * one of the sleepq_wait_sig() functions to block. After the thread has * been resumed, it should call sleepq_calc_signal_retval() to determine @@ -68,7 +68,7 @@ * sleepq_signal(). These routines each return a boolean that will be true * if at least one swapped-out thread was resumed. In that case, the caller * is responsible for waking up the swapper by calling kick_proc0() after - * releasing the sleep queeu chain lock. + * releasing the sleep queue chain lock. * * Each thread allocates a sleep queue at thread creation via sleepq_alloc() * and releases it at thread destruction via sleepq_free(). Note that Modified: head/sys/sys/turnstile.h ============================================================================== --- head/sys/sys/turnstile.h Mon Dec 13 23:30:56 2010 (r216420) +++ head/sys/sys/turnstile.h Mon Dec 13 23:53:55 2010 (r216421) @@ -39,13 +39,14 @@ * shared, or eread, lock, and one for threads waiting for an * exclusive, or write, lock. * - * A thread calls turnstile_lock() to lock the turnstile chain associated - * with a given lock. A thread calls turnstile_wait() when the lock is - * contested to be put on the queue and block. If a thread needs to retry - * a lock operation instead of blocking, it should call turnstile_release() - * to unlock the associated turnstile chain lock. + * A thread calls turnstile_chain_lock() to lock the turnstile chain + * associated with a given lock. A thread calls turnstile_wait() when + * the lock is contested to be put on the queue and block. If a thread + * calls turnstile_trywait() and decides to retry a lock operation instead + * of blocking, it should call turnstile_cancel() to unlock the associated + * turnstile chain lock. * - * When a lock is released, the thread calls turnstile_lookup() to loop + * When a lock is released, the thread calls turnstile_lookup() to look * up the turnstile associated with the given lock in the hash table. Then * it calls either turnstile_signal() or turnstile_broadcast() to mark * blocked threads for a pending wakeup. turnstile_signal() marks the @@ -55,7 +56,7 @@ * releasing the lock, turnstile_unpend() must be called to wake up the * pending thread(s) and give up ownership of the turnstile. * - * Alternatively, if a thread wishes to relinquish ownership of a thread + * Alternatively, if a thread wishes to relinquish ownership of a lock * without waking up any waiters, it may call turnstile_disown(). * * When a lock is acquired that already has at least one thread contested From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 00:21:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 534E4106564A; Tue, 14 Dec 2010 00:21:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 422D28FC08; Tue, 14 Dec 2010 00:21:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE0LZ3i098001; Tue, 14 Dec 2010 00:21:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE0LZI9097999; Tue, 14 Dec 2010 00:21:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012140021.oBE0LZI9097999@svn.freebsd.org> From: Xin LI Date: Tue, 14 Dec 2010 00:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 00:21:35 -0000 Author: delphij Date: Tue Dec 14 00:21:34 2010 New Revision: 216422 URL: http://svn.freebsd.org/changeset/base/216422 Log: Make use of EX_USAGE for usage(). Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Mon Dec 13 23:53:55 2010 (r216421) +++ head/usr.bin/printf/printf.c Tue Dec 14 00:21:34 2010 (r216422) @@ -53,6 +53,7 @@ static const char rcsid[] = #include #include #include +#include #include #ifdef SHELL @@ -115,14 +116,14 @@ main(int argc, char *argv[]) case '?': default: usage(); - return (1); + /* NOTREACHED */ } argc -= optind; argv += optind; if (argc < 1) { usage(); - return (1); + /* NOTREACHED */ } #ifdef SHELL @@ -562,4 +563,5 @@ static void usage(void) { (void)fprintf(stderr, "usage: printf format [arguments ...]\n"); + exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 01:16:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 840C2106564A; Tue, 14 Dec 2010 01:16:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72B348FC1A; Tue, 14 Dec 2010 01:16:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE1GuPZ099145; Tue, 14 Dec 2010 01:16:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE1GuSk099143; Tue, 14 Dec 2010 01:16:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012140116.oBE1GuSk099143@svn.freebsd.org> From: Xin LI Date: Tue, 14 Dec 2010 01:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216423 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 01:16:56 -0000 Author: delphij Date: Tue Dec 14 01:16:56 2010 New Revision: 216423 URL: http://svn.freebsd.org/changeset/base/216423 Log: IEEE Std 1003.1-2008, Section 1.4, Utility Description Defaults says that when the options section is listed as "None", utility shall recognize "--" as a first argument to be discarded. This implementation is largely based on OpenBSD implementation but we do slightly differently: a) We skip argv[0] as the first step; b) We test whether the next argument is "--" and ignore it. With this change one will get: %printf usage: printf format [arguments ...] %printf -v -v%printf -- -v -v% %printf -- usage: printf format [arguments ...] Which matches the behavior observed on a Debian system but different from the Illumos change. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Dec 14 00:21:34 2010 (r216422) +++ head/usr.bin/printf/printf.c Tue Dec 14 01:16:56 2010 (r216423) @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) { size_t len; - int ch, chopped, end, rval; + int chopped, end, rval; char *format, *fmt, *start; #ifndef SHELL @@ -111,15 +111,15 @@ main(int argc, char *argv[]) #ifdef SHELL optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ #endif - while ((ch = getopt(argc, argv, "")) != -1) - switch (ch) { - case '?': - default: - usage(); - /* NOTREACHED */ - } - argc -= optind; - argv += optind; + /* Skip argv[0] which is the process name */ + argv++; + argc--; + + /* Need to accept/ignore "--" option. */ + if (argc >= 1 && strcmp(*argv, "--") == 0) { + argc--; + argv++; + } if (argc < 1) { usage(); From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 01:28:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CD551065675; Tue, 14 Dec 2010 01:28:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB5E8FC2B; Tue, 14 Dec 2010 01:28:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE1SYFO099414; Tue, 14 Dec 2010 01:28:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE1SYKd099412; Tue, 14 Dec 2010 01:28:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012140128.oBE1SYKd099412@svn.freebsd.org> From: Xin LI Date: Tue, 14 Dec 2010 01:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216424 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 01:28:34 -0000 Author: delphij Date: Tue Dec 14 01:28:33 2010 New Revision: 216424 URL: http://svn.freebsd.org/changeset/base/216424 Log: We work on ctype's and not only on numbers so set LC_ALL instead of LC_NUMERIC. PR: bin/152934 Submitted by: Pedro F. Giffuni Obtained from: Illumos Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Dec 14 01:16:56 2010 (r216423) +++ head/usr.bin/printf/printf.c Tue Dec 14 01:28:33 2010 (r216424) @@ -106,7 +106,7 @@ main(int argc, char *argv[]) char *format, *fmt, *start; #ifndef SHELL - (void) setlocale(LC_NUMERIC, ""); + (void) setlocale(LC_ALL, ""); #endif #ifdef SHELL optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 05:47:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E01F106564A; Tue, 14 Dec 2010 05:47:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F176C8FC14; Tue, 14 Dec 2010 05:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE5lZc0005040; Tue, 14 Dec 2010 05:47:35 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE5lZ4K005038; Tue, 14 Dec 2010 05:47:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012140547.oBE5lZ4K005038@svn.freebsd.org> From: Alan Cox Date: Tue, 14 Dec 2010 05:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216425 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 05:47:36 -0000 Author: alc Date: Tue Dec 14 05:47:35 2010 New Revision: 216425 URL: http://svn.freebsd.org/changeset/base/216425 Log: Change memguard_fudge() so that it can handle km_max being zero. Not every platform defines VM_KMEM_SIZE_MAX, and on those platforms km_max will be zero. Reviewed by: mdf Tested by: marius Modified: head/sys/vm/memguard.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Tue Dec 14 01:28:33 2010 (r216424) +++ head/sys/vm/memguard.c Tue Dec 14 05:47:35 2010 (r216425) @@ -184,9 +184,10 @@ memguard_fudge(unsigned long km_size, un memguard_mapsize = km_max / vm_memguard_divisor; /* size must be multiple of PAGE_SIZE */ memguard_mapsize = round_page(memguard_mapsize); - if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) + if (memguard_mapsize == 0 || + memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs) memguard_mapsize = mem_pgs * 2 * PAGE_SIZE; - if (km_size + memguard_mapsize > km_max) + if (km_max > 0 && km_size + memguard_mapsize > km_max) return (km_max); return (km_size + memguard_mapsize); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 06:07:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43B11106566B; Tue, 14 Dec 2010 06:07:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 329E68FC08; Tue, 14 Dec 2010 06:07:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE67J3g005480; Tue, 14 Dec 2010 06:07:19 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE67Jhj005478; Tue, 14 Dec 2010 06:07:19 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201012140607.oBE67Jhj005478@svn.freebsd.org> From: Gordon Tetlow Date: Tue, 14 Dec 2010 06:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216426 - head/usr.bin/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 06:07:19 -0000 Author: gordon Date: Tue Dec 14 06:07:18 2010 New Revision: 216426 URL: http://svn.freebsd.org/changeset/base/216426 Log: Move sysctl invocation to using a variable that's fully pathed. This prevents errors for users that don't have /sbin in their PATH. Submitted by: Max Boyarov Approved by: mentor (wes@ implicit) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Tue Dec 14 05:47:35 2010 (r216425) +++ head/usr.bin/man/man.sh Tue Dec 14 06:07:18 2010 (r216426) @@ -535,10 +535,10 @@ man_setup() { MACHINE=${mflag##*:} fi if [ -z "$MACHINE_ARCH" ]; then - MACHINE_ARCH=$(sysctl -n hw.machine_arch) + MACHINE_ARCH=$($SYSCTL -n hw.machine_arch) fi if [ -z "$MACHINE" ]; then - MACHINE=$(sysctl -n hw.machine) + MACHINE=$($SYSCTL -n hw.machine) fi decho "Using architecture: $MACHINE_ARCH:$MACHINE" @@ -895,6 +895,7 @@ EQN=/usr/bin/eqn COL=/usr/bin/col NROFF='/usr/bin/groff -S -Wall -mtty-char -man' PIC=/usr/bin/pic +SYSCTL=/sbin/sysctl TBL=/usr/bin/tbl TROFF='/usr/bin/groff -S -man' REFER=/usr/bin/refer From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 06:19:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED55E1065672; Tue, 14 Dec 2010 06:19:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4DDD8FC19; Tue, 14 Dec 2010 06:19:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE6JD5N005824; Tue, 14 Dec 2010 06:19:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE6JDBq005822; Tue, 14 Dec 2010 06:19:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012140619.oBE6JDBq005822@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 14 Dec 2010 06:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216427 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 06:19:14 -0000 Author: pjd Date: Tue Dec 14 06:19:13 2010 New Revision: 216427 URL: http://svn.freebsd.org/changeset/base/216427 Log: Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Tue Dec 14 06:07:18 2010 (r216426) +++ head/sys/kern/uipc_syscalls.c Tue Dec 14 06:19:13 2010 (r216427) @@ -1888,8 +1888,7 @@ kern_sendfile(struct thread *td, struct mnw = 1; if (uap->flags & SF_SYNC) { - sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK); - memset(sfs, 0, sizeof *sfs); + sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 06:35:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34501065672; Tue, 14 Dec 2010 06:35:07 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4958FC19; Tue, 14 Dec 2010 06:35:04 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 4628F28F80B; Tue, 14 Dec 2010 00:35:04 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 9BW-udByKdeB; Tue, 14 Dec 2010 00:35:04 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id 0E75C28F808; Tue, 14 Dec 2010 00:35:02 -0600 (CST) Message-ID: <4D071016.2040909@rice.edu> Date: Tue, 14 Dec 2010 00:35:02 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Marius Strobl References: <201011281926.oASJQKiE040689@svn.freebsd.org> <20101128194542.GF9966@alchemy.franken.de> <20101129192308.GX80343@alchemy.franken.de> <20101129192417.GA18893@alchemy.franken.de> <4CF691A5.8070608@rice.edu> <20101202164727.GB38282@alchemy.franken.de> <4CF7D711.9040505@rice.edu> <20101206220733.GG38282@alchemy.franken.de> <20101207134109.GI38282@alchemy.franken.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@FreeBSD.org, src-committers@freebsd.org, alc@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Max Khon Subject: Re: svn commit: r216016 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 06:35:07 -0000 mdf@FreeBSD.org wrote: > On Tue, Dec 7, 2010 at 5:41 AM, Marius Strobl wrote: > >> On Mon, Dec 06, 2010 at 02:30:01PM -0800, mdf@FreeBSD.org wrote: >> >>> On Mon, Dec 6, 2010 at 2:07 PM, Marius Strobl wrote: >>> [lots of snip] >>> >>> >>>> With that one the kernel now survies memguard_init() but then panics >>>> right afterwards when kmeminit() calls kmem_suballoc(): >>>> KDB: debugger backends: ddb >>>> KDB: current backend: ddb >>>> Copyright (c) 1992-2010 The FreeBSD Project. >>>> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 >>>> ? ? ? ?The Regents of the University of California. All rights reserved. >>>> FreeBSD is a registered trademark of The FreeBSD Foundation. >>>> FreeBSD 9.0-CURRENT #18 r215249:216120M: Mon Dec ?6 13:27:57 CET 2010 >>>> ? ?marius@v20z.zeist.de:/home/marius/co/build/head2/sparc64.sparc64/usr/home/m4 >>>> WARNING: WITNESS option enabled, expect reduced performance. >>>> panic: kmem_suballoc: bad status return of 3 >>>> >>> [more snip] >>> >>> Shooting in the dark a little... >>> >>> The bad status of 3 is presumably KERN_NO_SPACE because we attempted >>> to allocate too much space from the kernel_map. What are the actual >>> values of vm_kmem_size, kernel_map->min_offset, kernel_map->max_offset >>> at panic time? >>> >> vm_kmem_size=5610405888 min_offset=3221225472 max_offset=13958643712 >> This is on a US3i machine with 16GB RAM. >> > > So kernel_map is from 0xC000_0000 to 0x3_4000_0000, or 0x2_8000_0000 > bytes large. Double the vm_kmem_size is 0x2_9CD0_0000, which is why > this is failing. > > This to me says that, for the moment, you need the > VM_MAX_KERNEL_ADDRESS define so that memguard does not take up too > much virtual space; at the moment this hardware is somewhat > constrained on virtual space. > Yes, I had thought that sparc64 had a much larger kernel address space. Marius, I would suggest that you revert back to Max's original commit that caps the kmem_map at 3/5 of the kernel address space. Right now, you are allowing the kmem_map to consume the entire kernel address space, and given the relatively modest size of the kernel address space, a machine with more physical memory may try to create a kmem_map that leaves no space for the buffer cache, pipes, thread stacks, etc. Alan From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 08:26:19 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC601065A1F; Tue, 14 Dec 2010 08:26:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4B28FC1E; Tue, 14 Dec 2010 08:26:17 +0000 (UTC) Received: from c122-106-172-0.carlnfd1.nsw.optusnet.com.au (c122-106-172-0.carlnfd1.nsw.optusnet.com.au [122.106.172.0]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBE8QEf7010464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Dec 2010 19:26:15 +1100 Date: Tue, 14 Dec 2010 19:26:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI In-Reply-To: <201012140021.oBE0LZI9097999@svn.freebsd.org> Message-ID: <20101214183752.L870@besplex.bde.org> References: <201012140021.oBE0LZI9097999@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 08:26:19 -0000 On Tue, 14 Dec 2010, Xin LI wrote: > Log: > Make use of EX_USAGE for usage(). Most uses of sysexits are styyle bugs. This one is no exception, since printf is not sendmail. > Modified: head/usr.bin/printf/printf.c > ============================================================================== > --- head/usr.bin/printf/printf.c Mon Dec 13 23:53:55 2010 (r216421) > +++ head/usr.bin/printf/printf.c Tue Dec 14 00:21:34 2010 (r216422) > @@ -115,14 +116,14 @@ main(int argc, char *argv[]) > case '?': > default: > usage(); > - return (1); > + /* NOTREACHED */ Most uses of NOTREACHED are style bugs. This one is no exception, since usage() obviously doesn't return. Even lint(1) can see this. It used to be necessary to declare usage() as __dead2 so that compilers see this, but now -funit-at-a-time is a default so this ugliness is no longer useful either (except if usage() in a separate file. exit(3) is in a separate file, but it is declared as __dead2. style(9) still has the bugs of saying to use sysexits and using EX_USAGE in its usage(). It has a bad recommendation for NOTREACHED too. It gives one example of using NOTREACHED. This is after one of its calls to usage(). This is a particularly bad example, since NOTREACHED is not needed there, and it is not used after the other example of usage() where it is equally [not] needed. style(9) doesn't use NOTREACHED after its calls to exit(), where it is almost equally [not] needed -- everyone knows that exit() doesn't return, and everyone should know that usage() doesn't return too. You fixed the style bug that printf(1)'s usage did return. Everyone knows that the err() family doesn't return, and of course style(9) doesn't use NOTREACHED after its examples of calls to err*() either. These examples show that style(9)'s recomendation that NOTREACHED should be used for [all] code that cannot be reached is so wrong that even style(9) knows not to follow it. style(9) still hasn't caught up with the early 1990's development of using __dead2 to give an active declaration of functions that don't return, so that the 1970-1980's method of using NOTREACHED can be avoided in most cases, in particular after exit(), err*() and usage(), except as an example of what not to do like one of calls to exit() (*). NOTREACHED remains useful for avoiding some lint and compiler lifetime analysis deficiencies, and for telling human readers that although the code is tangled this part of it really is not reached. Using it for code that is obviously not reached reduces its force in these cases. (*) Reading between the lines, I wilfully misinterpret this example of being a bad example of everthing it does: % Exits should be 0 on success, or according to the predefined values in % sysexits(3). % % exit(EX_OK); /* % * Avoid obvious comments such as % * "Exit 0 on success." % */ Things not to do that are done in this example include: - use EX_OK, not 0 on success - place comments to the right of the code and extend them across multiple lines for maximal waste of space - when changing code to use EX_OK (or anything, be sure to neglect to change the comments, so that the comments don't match the code). [Here this was originally just a bad example of an obvious comment. The code said exit(0) and the comment said 0 too. Now it doesn't say EX_OK, so it is not so obvious that this is an obvious comment (in fact, EX_OK does equal 0, but this is of no interest here).] This example could be further improved by adding an obvious NOTREACHED comment to it. style(9) still hasn't caught up with the late 1990's development of using EXIT_SUCCESS. This C90 macro for spelling 0 is about as popular as POSIX's STDIN_FILENO, but at least it is Standard, unlike EX_OK. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 09:16:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87E4E1066293; Tue, 14 Dec 2010 09:16:43 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id D38C18FC15; Tue, 14 Dec 2010 09:16:42 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 05316E63D3; Tue, 14 Dec 2010 09:16:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=rFpL0gdlOMYC 6f8HVhh0pW5gGD8=; b=IC4+dLWi/LA3FM3XBuhMWzGVCBbLXNSdX8aTVD4NSSG0 MKIwHCTZ5eeKfjGYw+lc4O2SGicG7009vIkkRwkEu7bdopw1lYX3diVPP7wyfWMH IBNSnGWZlGYdDMUiaeSqgVMqwVe1RzTsq5oJ48WSiS37n8MqIEIfgifvqeoIa/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=rat/tv ood5AR7SikYI9keEaDJPI4JjQMyzioCNYOuzxYDOWIM9moYV9K4jJ7iH9skYJZoE ZjyoZhku2dnZl3Qx2ItueFOu+wg4QDLMlVaJq2L0DF2O8RWLYOWkUISbILXLTYCB UuK7Sre27erjTX1ciT5DZGY3cbqe/k4NZbS4o= Received: from unknown (client-86-27-21-134.glfd.adsl.virginmedia.com [86.27.21.134]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id A1A08E62CD; Tue, 14 Dec 2010 09:16:41 +0000 (GMT) Date: Tue, 14 Dec 2010 09:16:11 +0000 From: Bruce Cran To: Xin LI Message-ID: <20101214091611.00001467@unknown> In-Reply-To: <201012140021.oBE0LZI9097999@svn.freebsd.org> References: <201012140021.oBE0LZI9097999@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 09:16:43 -0000 On Tue, 14 Dec 2010 00:21:35 +0000 (UTC) Xin LI wrote: > Author: delphij > Date: Tue Dec 14 00:21:34 2010 > New Revision: 216422 > URL: http://svn.freebsd.org/changeset/base/216422 > > Log: > Make use of EX_USAGE for usage(). I think returning 1 is actually preferred - sysexits was removed from style(9) a while ago: http://svn.freebsd.org/viewvc/base?view=revision&revision=185362 -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 09:32:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC4710677DF; Tue, 14 Dec 2010 09:32:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D83938FC18; Tue, 14 Dec 2010 09:32:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBE9WbBj009821; Tue, 14 Dec 2010 09:32:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBE9WbsZ009819; Tue, 14 Dec 2010 09:32:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012140932.oBE9WbsZ009819@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Dec 2010 09:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216428 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 09:32:38 -0000 Author: rwatson Date: Tue Dec 14 09:32:37 2010 New Revision: 216428 URL: http://svn.freebsd.org/changeset/base/216428 Log: Further refinements to the xen.4 man page: fix typos, add material on para-virtualized drivers, clarify how to configure XENHVM on amd64. MFC after: 3 days Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Tue Dec 14 06:19:13 2010 (r216427) +++ head/share/man/man4/xen.4 Tue Dec 14 09:32:37 2010 (r216428) @@ -35,21 +35,21 @@ .Nm xen .Nd Xen Hypervisor Guest (DomU) Support .Sh SYNOPSIS -To compile para-virtualized (PV) Xen guest support into the i386 kernel, place -the following line in your kernel configuration file: +To compile para-virtualized (PV) Xen guest support into an i386 kernel, place +the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "options PAE" .Cd "options XEN" .Ed .Pp -To compile hardware-assisted virtualization (HVM) Xen guest support into the +To compile hardware-assisted virtualization (HVM) Xen guest support into an amd64 kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options XENHVM" .Ed .Pp -To compile the Xen PCI bus and para-virtualized (PV) drivers into an amd64 -or i386 kernel, place the following line in your kernel configuration file: +To compile support for Xenbux and Xen PV drivers into an amd64 or i386 +kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device xenpci" .Ed @@ -58,27 +58,86 @@ The Xen Hypervisor allows multiple virtu computer system. When first released, Xen required that i386 kernels be compiled "para-virtualized" as the x86 instruction set was not fully virtualizable. +Primarily, para-virtualization modifies the virtual memory system to use +hypervisor calls (hypercalls) rather than direct hardware instructions to +modify the TLB, although para-virtualized device drivers were also required +to access resources such as virtual network interfaces and disk devices. +.Pp With later instruction set extensions from AMD and Intel to support fully -virtualizable instructions, unmodified kernels could also be supported, -referred to as hardware-assisted virtualization (HVM). -HVM systems may still use para-virtualized drivers, which are aware of -virtualization and able to optimize certain behaviours to improve -performance or semantics. +virtualizable instructions, unmodified virtual memory systems can also be +supported; this is referred to as hardware-assisted virtualization (HVM). +HVM configurations may either rely on transparently emulated hardware +peripherals, or para-virtualized drivers, which are aware of virtualization, +and hence able to optimize certain behaviors to improve performance or +semantics. .Pp .Fx supports a fully para-virtualized (PV) kernel on the i386 architecture using .Cd "options XEN" ; currently, this requires use of a PAE kernel, enabled via .Cd "options PAE" . +.Pp .Fx -supports hardware-assited virtualization (HVM) on both the i386 and amd64 +supports hardware-assisted virtualization (HVM) on both the i386 and amd64 kernels; however, PV device drivers with an HVM kernel are only supported on -the amd64 architecture. +the amd64 architecture, and require +.Cd "options XENHVM" . .Pp Para-virtualized device drivers are required in order to support certain -functionality, such as the dynamic addition of new virtual devices, and the -"balloon driver" (returning physical memory to the Hypervisor on demand), -and VM suspend/resume. +functionality, such as processing management requests, returning idle +physical memory pages to the hypevisor, etc. +.Ss Para-virtualized drivers +Adding +.Cd "options xenpci" +to the kernel configuration enables the Xen para-virtualized drivers: +.Bl -hang -offset indent -width blkfront +.It Nm balloon +Allow physical memory pages to be returned to the hypervisor as a result of +manual tuning or automatic policy. +.It Nm blkback +Exports local block devices to other Xen domains where they can then be +imported via +.Nm blkfront . +.It Nm blkfront +Import block devices from other Xen domains as local block devices, to be +used for file systems, swap, etc. +.It Nm console +Export the low-level system console via the Xen console service. +.It Nm control +Process management operations from Domain 0, including power off, reboot, +suspend, crash, and halt requests. +.It Nm evtchn +Expose Xen events via the +.Pa /dev/xen/evtchn +special device. +.It Nm netback +Export local network interfacest to other Xen domains where they can be +imported via +.Nm netfront . +.It Nm netfront +Import network interfaces from other Xen domains as local network interfaces, +which may be used for IPv4, IPv6, etc. +.It Nm pcifront +No description. +.It Nm xenpci +No description. +.El +.Ss Performance +In general, PV drivers will perform better than emulated hardware, and are +the recommended configuration. +.Pp +Using a hypervisor introduces a second layer of scheduling that may limit the +effectiveness of certain +.Fx +scheduling optimisations. +Among these is adaptive locking, which is no longer able to determine whether +a thread holding a lock is in execution. +It is recommended that adaptive locking be disabled when using Xen: +.Bd -ragged -offset indent +.Cd "options NO_ADAPTIVE_MUTEXES" +.Cd "options NO_ADAPTIVE_RWLOCKS" +.Cd "options NO_ADAPTIVE_SX" +.Ed .Sh SEE ALSO .Xr pae 4 .Sh HISTORY @@ -90,7 +149,7 @@ first appeared in .An -nosplit .Fx support for Xen was first added by -.An Kip Mac Aq kmacy@FreeBSD.org +.An Kip Macy Aq kmacy@FreeBSD.org and .An Doug Rabson Aq dfr@FreeBSD.org . Further refinements were made by From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 10:06:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3659D1066D56; Tue, 14 Dec 2010 10:06:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24E3C8FC08; Tue, 14 Dec 2010 10:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEA6T7u010542; Tue, 14 Dec 2010 10:06:29 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEA6T8J010540; Tue, 14 Dec 2010 10:06:29 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012141006.oBEA6T8J010540@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Dec 2010 10:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216429 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 10:06:29 -0000 Author: rwatson Date: Tue Dec 14 10:06:28 2010 New Revision: 216429 URL: http://svn.freebsd.org/changeset/base/216429 Log: Slightly different formatting for options list. MFC after: 3 days Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Tue Dec 14 09:32:37 2010 (r216428) +++ head/share/man/man4/xen.4 Tue Dec 14 10:06:28 2010 (r216429) @@ -133,7 +133,7 @@ scheduling optimisations. Among these is adaptive locking, which is no longer able to determine whether a thread holding a lock is in execution. It is recommended that adaptive locking be disabled when using Xen: -.Bd -ragged -offset indent +.Bd -unfilled -offset indent .Cd "options NO_ADAPTIVE_MUTEXES" .Cd "options NO_ADAPTIVE_RWLOCKS" .Cd "options NO_ADAPTIVE_SX" From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 15:11:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A0C1106564A; Tue, 14 Dec 2010 15:11:49 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 588698FC1B; Tue, 14 Dec 2010 15:11:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEFBnDO021948; Tue, 14 Dec 2010 15:11:49 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEFBnEc021946; Tue, 14 Dec 2010 15:11:49 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012141511.oBEFBnEc021946@svn.freebsd.org> From: Kevin Lo Date: Tue, 14 Dec 2010 15:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216431 - head/lib/libusb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 15:11:49 -0000 Author: kevlo Date: Tue Dec 14 15:11:49 2010 New Revision: 216431 URL: http://svn.freebsd.org/changeset/base/216431 Log: Check the return value of malloc(). Reviewed by: hselasky MFC after: 3 days Modified: head/lib/libusb/libusb20_compat01.c Modified: head/lib/libusb/libusb20_compat01.c ============================================================================== --- head/lib/libusb/libusb20_compat01.c Tue Dec 14 13:45:57 2010 (r216430) +++ head/lib/libusb/libusb20_compat01.c Tue Dec 14 15:11:49 2010 (r216431) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr); From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 15:14:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A58106566C; Tue, 14 Dec 2010 15:14:09 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1A98FC14; Tue, 14 Dec 2010 15:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEFE80T022046; Tue, 14 Dec 2010 15:14:08 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEFE8VH022044; Tue, 14 Dec 2010 15:14:08 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012141514.oBEFE8VH022044@svn.freebsd.org> From: Kevin Lo Date: Tue, 14 Dec 2010 15:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216432 - head/lib/libproc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 15:14:09 -0000 Author: kevlo Date: Tue Dec 14 15:14:08 2010 New Revision: 216432 URL: http://svn.freebsd.org/changeset/base/216432 Log: Fix a memory leak on the error condition Reviewed by: rpaulo Modified: head/lib/libproc/proc_create.c Modified: head/lib/libproc/proc_create.c ============================================================================== --- head/lib/libproc/proc_create.c Tue Dec 14 15:11:49 2010 (r216431) +++ head/lib/libproc/proc_create.c Tue Dec 14 15:14:08 2010 (r216432) @@ -84,7 +84,7 @@ proc_attach(pid_t pid, int flags, struct else *pphdl = phdl; out: - + proc_free(phdl); return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 16:04:49 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4607D1065672; Tue, 14 Dec 2010 16:04:49 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 991088FC08; Tue, 14 Dec 2010 16:04:48 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6378045C9B; Tue, 14 Dec 2010 17:04:47 +0100 (CET) Received: from localhost (pdawidek.whl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E9AC0456B1; Tue, 14 Dec 2010 17:04:41 +0100 (CET) Date: Tue, 14 Dec 2010 17:04:38 +0100 From: Pawel Jakub Dawidek To: Bruce Evans Message-ID: <20101214160438.GF1715@garage.freebsd.pl> References: <201012140021.oBE0LZI9097999@svn.freebsd.org> <20101214183752.L870@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FeAIMMcddNRN4P4/" Content-Disposition: inline In-Reply-To: <20101214183752.L870@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 16:04:49 -0000 --FeAIMMcddNRN4P4/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 14, 2010 at 07:26:13PM +1100, Bruce Evans wrote: > (*) Reading between the lines, I wilfully misinterpret this example of > being a bad example of everthing it does: >=20 > % Exits should be 0 on success, or according to the predefined value= s=20 > in > % sysexits(3). > %=20 > % exit(EX_OK); /* > % * Avoid obvious comments such as > % * "Exit 0 on success." > % */ >=20 > Things not to do that are done in this example include: > - use EX_OK, not 0 on success > - place comments to the right of the code and extend them across multiple > lines for maximal waste of space > - when changing code to use EX_OK (or anything, be sure to neglect to cha= nge > the comments, so that the comments don't match the code). [Here this w= as > originally just a bad example of an obvious comment. The code said=20 > exit(0) > and the comment said 0 too. Now it doesn't say EX_OK, so it is not so > obvious that this is an obvious comment (in fact, EX_OK does equal 0, > but this is of no interest here).] > This example could be further improved by adding an obvious NOTREACHED > comment to it. I think I've a fix for this. Could you please review the patch below? Index: share/man/man9/style.9 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- share/man/man9/style.9 (wersja 215409) +++ share/man/man9/style.9 (kopia robocza) @@ -1,5 +1,6 @@ .\"- .\" Copyright (c) 1995-2005 The FreeBSD Project +.\" Copyright (c) 2010 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,7 +27,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd December 17, 2008 +.Dd December 14, 2010 .Dt STYLE 9 .Os .Sh NAME @@ -611,6 +612,9 @@ * Avoid obvious comments such as * "Exit 0 on success." */ + /* + * NOTREACHED + */ } .Ed .Pp --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --FeAIMMcddNRN4P4/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0HlZYACgkQForvXbEpPzQrqQCguSFffaJ5c3eDg75bsgPDk3N0 i68AoKYF/3sen3h/cDMQu1ohoLft8DPa =bfxp -----END PGP SIGNATURE----- --FeAIMMcddNRN4P4/-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 17:23:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED23106564A; Tue, 14 Dec 2010 17:23:49 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC9858FC13; Tue, 14 Dec 2010 17:23:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEHNni0024986; Tue, 14 Dec 2010 17:23:49 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEHNnhD024984; Tue, 14 Dec 2010 17:23:49 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201012141723.oBEHNnhD024984@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Dec 2010 17:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216437 - head/sys/xen/xenstore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 17:23:50 -0000 Author: gibbs Date: Tue Dec 14 17:23:49 2010 New Revision: 216437 URL: http://svn.freebsd.org/changeset/base/216437 Log: Remove spurious printf left over from debugging our XenStore support. Modified: head/sys/xen/xenstore/xenstore.c Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Tue Dec 14 15:36:47 2010 (r216436) +++ head/sys/xen/xenstore/xenstore.c Tue Dec 14 17:23:49 2010 (r216437) @@ -1102,7 +1102,6 @@ xs_probe(device_t dev) * Uncontitionally return success. */ device_set_desc(dev, "XenStore"); -printf("xs_probe: Probe retuns 0\n"); return (0); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 17:39:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED4E3106566B; Tue, 14 Dec 2010 17:39:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB0298FC1A; Tue, 14 Dec 2010 17:39:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEHdAwa025361; Tue, 14 Dec 2010 17:39:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEHdAnv025359; Tue, 14 Dec 2010 17:39:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012141739.oBEHdAnv025359@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 14 Dec 2010 17:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216438 - head/sys/dev/ale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 17:39:11 -0000 Author: yongari Date: Tue Dec 14 17:39:10 2010 New Revision: 216438 URL: http://svn.freebsd.org/changeset/base/216438 Log: Remove unecessary and clearly wrong usage of atomic(9). Reported by: avg Modified: head/sys/dev/ale/if_ale.c Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Tue Dec 14 17:23:49 2010 (r216437) +++ head/sys/dev/ale/if_ale.c Tue Dec 14 17:39:10 2010 (r216438) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2284,8 +2283,7 @@ ale_int_task(void *arg, int pending) sc = (struct ale_softc *)arg; status = CSR_READ_4(sc, ALE_INTR_STATUS); - more = atomic_readandclear_int(&sc->ale_morework); - if (more != 0) + if (sc->ale_morework != 0) status |= INTR_RX_PKT; if ((status & ALE_INTRS) == 0) goto done; @@ -2298,7 +2296,7 @@ ale_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { more = ale_rxeof(sc, sc->ale_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->ale_morework, 1); + sc->ale_morework = 1; else if (more == EIO) { ALE_LOCK(sc); sc->ale_stats.reset_brk_seq++; @@ -3002,7 +3000,7 @@ ale_init_rx_pages(struct ale_softc *sc) ALE_LOCK_ASSERT(sc); - atomic_set_int(&sc->ale_morework, 0); + sc->ale_morework = 0; sc->ale_cdata.ale_rx_seqno = 0; sc->ale_cdata.ale_rx_curp = 0; From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 18:09:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BBA106564A; Tue, 14 Dec 2010 18:09:59 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 178C28FC0A; Tue, 14 Dec 2010 18:09:59 +0000 (UTC) Received: by mx1.stack.nl (Postfix, from userid 65534) id 730B31DD9F1; Tue, 14 Dec 2010 19:09:58 +0100 (CET) X-Spam-DCC: : scanner01.stack.nl 1282; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00, DNS_FROM_OPENWHOIS,NO_RELAYS autolearn=no version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 587501DD62C; Tue, 14 Dec 2010 19:09:56 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 4475C170FB; Tue, 14 Dec 2010 19:08:56 +0100 (CET) Date: Tue, 14 Dec 2010 19:08:56 +0100 From: Jilles Tjoelker To: Xin LI Message-ID: <20101214180856.GA67294@stack.nl> References: <201012140021.oBE0LZI9097999@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012140021.oBE0LZI9097999@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 18:09:59 -0000 On Tue, Dec 14, 2010 at 12:21:35AM +0000, Xin LI wrote: > Author: delphij > Date: Tue Dec 14 00:21:34 2010 > New Revision: 216422 > URL: http://svn.freebsd.org/changeset/base/216422 > Log: > Make use of EX_USAGE for usage(). > Modified: > head/usr.bin/printf/printf.c > Modified: head/usr.bin/printf/printf.c > ============================================================================== > --- head/usr.bin/printf/printf.c Mon Dec 13 23:53:55 2010 (r216421) > +++ head/usr.bin/printf/printf.c Tue Dec 14 00:21:34 2010 (r216422) [...] > + exit(EX_USAGE); > } This does not work properly when printf is an sh builtin. The exit() call causes sh to exit entirely, rather than the builtin to return to the shell. The bug can be noticed easily because the test errors/option-error.0 (from tools/regression/bin/sh) fails. Please revert to returning the exit status from main(). Although I plan to clean up usr.bin/printf slightly after the n$ stuff is committed, I do not plan on adding things to sh that will allow exit() emulation in builtins. Other people have already said things about . -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 18:23:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3959D10656D8; Tue, 14 Dec 2010 18:23:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27A398FC1B; Tue, 14 Dec 2010 18:23:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEING02026370; Tue, 14 Dec 2010 18:23:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEINGUZ026368; Tue, 14 Dec 2010 18:23:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012141823.oBEINGUZ026368@svn.freebsd.org> From: Xin LI Date: Tue, 14 Dec 2010 18:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216439 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 18:23:16 -0000 Author: delphij Date: Tue Dec 14 18:23:15 2010 New Revision: 216439 URL: http://svn.freebsd.org/changeset/base/216439 Log: When printf is being used as a sh(1) builtin, it can not call exit(3) as pointed out by jilles@ so revert to using return(), also change the return value back to 1 as requested by bde@. This is logically a revert of revision 216422. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Dec 14 17:39:10 2010 (r216438) +++ head/usr.bin/printf/printf.c Tue Dec 14 18:23:15 2010 (r216439) @@ -53,7 +53,6 @@ static const char rcsid[] = #include #include #include -#include #include #ifdef SHELL @@ -123,7 +122,7 @@ main(int argc, char *argv[]) if (argc < 1) { usage(); - /* NOTREACHED */ + return (1); } #ifdef SHELL @@ -563,5 +562,4 @@ static void usage(void) { (void)fprintf(stderr, "usage: printf format [arguments ...]\n"); - exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 20:07:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC1BD106566C; Tue, 14 Dec 2010 20:07:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97608FC08; Tue, 14 Dec 2010 20:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEK7pSi029000; Tue, 14 Dec 2010 20:07:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEK7pLd028994; Tue, 14 Dec 2010 20:07:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012142007.oBEK7pLd028994@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 14 Dec 2010 20:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216443 - in head/sys: amd64/amd64 dev/acpica i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:07:51 -0000 Author: jkim Date: Tue Dec 14 20:07:51 2010 New Revision: 216443 URL: http://svn.freebsd.org/changeset/base/216443 Log: Stop lying about supporting cpu_est_clockrate() when TSC is invariant. This function always returned the nominal frequency instead of current frequency because we use RDTSC instruction to calculate difference in CPU ticks, which is supposedly constant for the case. Now we support cpu_get_nominal_mhz() for the case, instead. Note it should be just enough for most usage cases because cpu_est_clockrate() is often times abused to find maximum frequency of the processor. Modified: head/sys/amd64/amd64/legacy.c head/sys/amd64/amd64/machdep.c head/sys/dev/acpica/acpi_cpu.c head/sys/i386/i386/legacy.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/legacy.c ============================================================================== --- head/sys/amd64/amd64/legacy.c Tue Dec 14 20:06:55 2010 (r216442) +++ head/sys/amd64/amd64/legacy.c Tue Dec 14 20:07:51 2010 (r216443) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -313,9 +314,19 @@ cpu_read_ivar(device_t dev, device_t chi { struct cpu_device *cpdev; - if (index != CPU_IVAR_PCPU) + switch (index) { + case CPU_IVAR_PCPU: + cpdev = device_get_ivars(child); + *result = (uintptr_t)cpdev->cd_pcpu; + break; + case CPU_IVAR_NOMINAL_MHZ: + if (tsc_is_invariant) { + *result = (uintptr_t)(tsc_freq / 1000000); + break; + } + /* FALLTHROUGH */ + default: return (ENOENT); - cpdev = device_get_ivars(child); - *result = (uintptr_t)cpdev->cd_pcpu; + } return (0); } Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Dec 14 20:06:55 2010 (r216442) +++ head/sys/amd64/amd64/machdep.c Tue Dec 14 20:07:51 2010 (r216443) @@ -537,6 +537,10 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); + /* If TSC is P-state invariant, DELAY(9) based logic fails. */ + if (tsc_is_invariant) + return (EOPNOTSUPP); + /* If we're booting, trust the rate calibrated moments ago. */ if (cold) { *rate = tsc_freq; Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Dec 14 20:06:55 2010 (r216442) +++ head/sys/dev/acpica/acpi_cpu.c Tue Dec 14 20:07:51 2010 (r216443) @@ -44,6 +44,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#if defined(__amd64__) || defined(__i386__) +#include +#endif #include #include @@ -510,6 +513,14 @@ acpi_cpu_read_ivar(device_t dev, device_ case CPU_IVAR_PCPU: *result = (uintptr_t)sc->cpu_pcpu; break; +#if defined(__amd64__) || defined(__i386__) + case CPU_IVAR_NOMINAL_MHZ: + if (tsc_is_invariant) { + *result = (uintptr_t)(tsc_freq / 1000000); + break; + } + /* FALLTHROUGH */ +#endif default: return (ENOENT); } Modified: head/sys/i386/i386/legacy.c ============================================================================== --- head/sys/i386/i386/legacy.c Tue Dec 14 20:06:55 2010 (r216442) +++ head/sys/i386/i386/legacy.c Tue Dec 14 20:07:51 2010 (r216443) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include @@ -334,9 +335,19 @@ cpu_read_ivar(device_t dev, device_t chi { struct cpu_device *cpdev; - if (index != CPU_IVAR_PCPU) + switch (index) { + case CPU_IVAR_PCPU: + cpdev = device_get_ivars(child); + *result = (uintptr_t)cpdev->cd_pcpu; + break; + case CPU_IVAR_NOMINAL_MHZ: + if (tsc_is_invariant) { + *result = (uintptr_t)(tsc_freq / 1000000); + break; + } + /* FALLTHROUGH */ + default: return (ENOENT); - cpdev = device_get_ivars(child); - *result = (uintptr_t)cpdev->cd_pcpu; + } return (0); } Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Dec 14 20:06:55 2010 (r216442) +++ head/sys/i386/i386/machdep.c Tue Dec 14 20:07:51 2010 (r216443) @@ -1131,6 +1131,10 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (!tsc_present) return (EOPNOTSUPP); + /* If TSC is P-state invariant, DELAY(9) based logic fails. */ + if (tsc_is_invariant) + return (EOPNOTSUPP); + /* If we're booting, trust the rate calibrated moments ago. */ if (cold) { *rate = tsc_freq; From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 20:30:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id EA73C106566B; Tue, 14 Dec 2010 20:30:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Tue, 14 Dec 2010 15:30:33 -0500 User-Agent: KMail/1.6.2 References: <201012142007.oBEK7pLd028994@svn.freebsd.org> In-Reply-To: <201012142007.oBEK7pLd028994@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012141530.40603.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216443 - in head/sys: amd64/amd64 dev/acpica i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:30:49 -0000 On Tuesday 14 December 2010 03:07 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Dec 14 20:07:51 2010 > New Revision: 216443 > URL: http://svn.freebsd.org/changeset/base/216443 > > Log: > Stop lying about supporting cpu_est_clockrate() when TSC is > invariant. This function always returned the nominal frequency > instead of current frequency because we use RDTSC instruction to > calculate difference in CPU ticks, which is supposedly constant for > the case. Now we support cpu_get_nominal_mhz() for the case, > instead. Note it should be just enough for most usage cases > because cpu_est_clockrate() is often times abused to find maximum > frequency of the processor. Actually, I wanted to support cpu_est_clockrate() as well and the following was my naive attempt: http://people.freebsd.org/~jkim/tsc.diff Unfortunately, it only worked for AMD64 Family 0Fh and below where we don't need this hack at all. I tried everything I could (e.g., fooling around with branch prediction) but it constantly gave me better MHz for under-clocked cases. :-/ Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 20:35:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E99106564A; Tue, 14 Dec 2010 20:35:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 534428FC1B; Tue, 14 Dec 2010 20:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEKZ8vY029870; Tue, 14 Dec 2010 20:35:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEKZ8L9029868; Tue, 14 Dec 2010 20:35:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201012142035.oBEKZ8L9029868@svn.freebsd.org> From: Xin LI Date: Tue, 14 Dec 2010 20:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216447 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:35:08 -0000 Author: delphij Date: Tue Dec 14 20:35:08 2010 New Revision: 216447 URL: http://svn.freebsd.org/changeset/base/216447 Log: Revert r216423 per request from Jilles. The new behavior prevents us from being able to bail out explicitly on unknown options that we have not implemented. BASH for instance have introduced a '-v' for printf(1) builtin and it seems to be bad to pretend that we supported it and have a script break silently. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Tue Dec 14 20:19:41 2010 (r216446) +++ head/usr.bin/printf/printf.c Tue Dec 14 20:35:08 2010 (r216447) @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) { size_t len; - int chopped, end, rval; + int ch, chopped, end, rval; char *format, *fmt, *start; #ifndef SHELL @@ -110,15 +110,15 @@ main(int argc, char *argv[]) #ifdef SHELL optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ #endif - /* Skip argv[0] which is the process name */ - argv++; - argc--; - - /* Need to accept/ignore "--" option. */ - if (argc >= 1 && strcmp(*argv, "--") == 0) { - argc--; - argv++; - } + while ((ch = getopt(argc, argv, "")) != -1) + switch (ch) { + case '?': + default: + usage(); + return (1); + } + argc -= optind; + argv += optind; if (argc < 1) { usage(); From owner-svn-src-head@FreeBSD.ORG Tue Dec 14 20:57:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 809B010656A6; Tue, 14 Dec 2010 20:57:40 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF278FC2B; Tue, 14 Dec 2010 20:57:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBEKvebg030451; Tue, 14 Dec 2010 20:57:40 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBEKveo5030449; Tue, 14 Dec 2010 20:57:40 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201012142057.oBEKveo5030449@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Dec 2010 20:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216448 - head/sys/xen/xenstore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2010 20:57:40 -0000 Author: gibbs Date: Tue Dec 14 20:57:40 2010 New Revision: 216448 URL: http://svn.freebsd.org/changeset/base/216448 Log: Fix a typo in a comment. Noticed by: Attila Nagy Modified: head/sys/xen/xenstore/xenstore.c Modified: head/sys/xen/xenstore/xenstore.c ============================================================================== --- head/sys/xen/xenstore/xenstore.c Tue Dec 14 20:35:08 2010 (r216447) +++ head/sys/xen/xenstore/xenstore.c Tue Dec 14 20:57:40 2010 (r216448) @@ -1099,7 +1099,7 @@ xs_probe(device_t dev) * We are either operating within a PV kernel or being probed * as the child of the successfully attached xenpci device. * Thus we are in a Xen environment and there will be a XenStore. - * Uncontitionally return success. + * Unconditionally return success. */ device_set_desc(dev, "XenStore"); return (0); From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 11:52:40 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39B11106564A; Wed, 15 Dec 2010 11:52:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id AC3438FC15; Wed, 15 Dec 2010 11:52:39 +0000 (UTC) Received: from c211-30-187-99.carlnfd1.nsw.optusnet.com.au (c211-30-187-99.carlnfd1.nsw.optusnet.com.au [211.30.187.99]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBFBqaDm021030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Dec 2010 22:52:37 +1100 Date: Wed, 15 Dec 2010 22:52:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI In-Reply-To: <201012141823.oBEINGUZ026368@svn.freebsd.org> Message-ID: <20101215225214.O1124@besplex.bde.org> References: <201012141823.oBEINGUZ026368@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216439 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 11:52:40 -0000 On Tue, 14 Dec 2010, Xin LI wrote: > Log: > When printf is being used as a sh(1) builtin, it can not call > exit(3) as pointed out by jilles@ so revert to using return(), > also change the return value back to 1 as requested by bde@. > > This is logically a revert of revision 216422. Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 12:18:06 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A3BD106564A; Wed, 15 Dec 2010 12:18:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 237A48FC12; Wed, 15 Dec 2010 12:18:05 +0000 (UTC) Received: from c211-30-187-99.carlnfd1.nsw.optusnet.com.au (c211-30-187-99.carlnfd1.nsw.optusnet.com.au [211.30.187.99]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBFCI16x032034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Dec 2010 23:18:02 +1100 Date: Wed, 15 Dec 2010 23:18:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20101214160438.GF1715@garage.freebsd.pl> Message-ID: <20101215231704.K1360@besplex.bde.org> References: <201012140021.oBE0LZI9097999@svn.freebsd.org> <20101214183752.L870@besplex.bde.org> <20101214160438.GF1715@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI , Bruce Evans Subject: Re: svn commit: r216422 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 12:18:06 -0000 On Tue, 14 Dec 2010, Pawel Jakub Dawidek wrote: > On Tue, Dec 14, 2010 at 07:26:13PM +1100, Bruce Evans wrote: >> (*) Reading between the lines, I wilfully misinterpret this example of >> being a bad example of everthing it does: >> >> % Exits should be 0 on success, or according to the predefined values >> in >> % sysexits(3). >> % >> % exit(EX_OK); /* >> % * Avoid obvious comments such as >> % * "Exit 0 on success." >> % */ >> >> Things not to do that are done in this example include: >> - use EX_OK, not 0 on success >> - place comments to the right of the code and extend them across multiple >> lines for maximal waste of space >> - when changing code to use EX_OK (or anything, be sure to neglect to change >> the comments, so that the comments don't match the code). [Here this was >> originally just a bad example of an obvious comment. The code said >> exit(0) >> and the comment said 0 too. Now it doesn't say EX_OK, so it is not so >> obvious that this is an obvious comment (in fact, EX_OK does equal 0, >> but this is of no interest here).] >> This example could be further improved by adding an obvious NOTREACHED >> comment to it. > > I think I've a fix for this. Could you please review the patch below? > > Index: share/man/man9/style.9 > =================================================================== > --- share/man/man9/style.9 (wersja 215409) > +++ share/man/man9/style.9 (kopia robocza) > @@ -1,5 +1,6 @@ > .\"- > .\" Copyright (c) 1995-2005 The FreeBSD Project > +.\" Copyright (c) 2010 Pawel Jakub Dawidek > .\" All rights reserved. > .\" > .\" Redistribution and use in source and binary forms, with or without > @@ -26,7 +27,7 @@ > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > .\" $FreeBSD$ > .\" > -.Dd December 17, 2008 > +.Dd December 14, 2010 > .Dt STYLE 9 > .Os > .Sh NAME > @@ -611,6 +612,9 @@ > * Avoid obvious comments such as > * "Exit 0 on success." > */ > + /* > + * NOTREACHED > + */ > } > .Ed > .Pp I think it is not so obviosly wrong as to be an example of what not to do. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 12:45:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2A981065679; Wed, 15 Dec 2010 12:45:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0E468FC1A; Wed, 15 Dec 2010 12:45:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFCjSS6052603; Wed, 15 Dec 2010 12:45:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFCjSiG052601; Wed, 15 Dec 2010 12:45:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012151245.oBFCjSiG052601@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 15 Dec 2010 12:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216453 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 12:45:29 -0000 Author: kib Date: Wed Dec 15 12:45:28 2010 New Revision: 216453 URL: http://svn.freebsd.org/changeset/base/216453 Log: Add the missed 'p' flag to getopt() optstring argument. MFC after: 1 week Modified: head/sbin/newfs/newfs.c Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Wed Dec 15 08:27:17 2010 (r216452) +++ head/sbin/newfs/newfs.c Wed Dec 15 12:45:28 2010 (r216453) @@ -139,7 +139,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) switch (ch) { case 'E': Eflag = 1; From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 12:46:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A17106566B; Wed, 15 Dec 2010 12:46:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7AC98FC15; Wed, 15 Dec 2010 12:46:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFCkrDh052670; Wed, 15 Dec 2010 12:46:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFCkrdR052668; Wed, 15 Dec 2010 12:46:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012151246.oBFCkrdR052668@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 15 Dec 2010 12:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216454 - head/sys/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 12:46:54 -0000 Author: kib Date: Wed Dec 15 12:46:53 2010 New Revision: 216454 URL: http://svn.freebsd.org/changeset/base/216454 Log: VOP_ISLOCKED() should not be used to determine if the vnode is locked. Explicitely track the locked status of the vnode. Reviewed by: pjd Tested by: avg MFC after: 1 week Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Wed Dec 15 12:45:28 2010 (r216453) +++ head/sys/nfsserver/nfs_serv.c Wed Dec 15 12:46:53 2010 (r216454) @@ -3037,6 +3037,7 @@ nfsrv_readdirplus(struct nfsrv_descript struct vattr va, at, *vap = &va; struct nfs_fattr *fp; int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1; + int vp_locked; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ @@ -3067,10 +3068,12 @@ nfsrv_readdirplus(struct nfsrv_descript fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, &rdonly, TRUE); + vp_locked = 1; if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); vp = NULL; + vp_locked = 0; } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3090,6 +3093,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = nfsrv_access(vp, VEXEC, cred, rdonly, 0); if (error) { vput(vp); + vp_locked = 0; vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR); nfsm_srvpostop_attr(getret, &at); @@ -3097,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript goto nfsmout; } VOP_UNLOCK(vp, 0); + vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3110,6 +3115,7 @@ again: io.uio_td = NULL; eofflag = 0; vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3118,6 +3124,7 @@ again: off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); VOP_UNLOCK(vp, 0); + vp_locked = 0; if (!cookies && !error) error = NFSERR_PERM; if (!error) @@ -3238,8 +3245,10 @@ again: } else { cn.cn_flags &= ~ISDOTDOT; } - if (!VOP_ISLOCKED(vp)) + if (!vp_locked) { vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; + } if ((vp->v_vflag & VV_ROOT) != 0 && (cn.cn_flags & ISDOTDOT) != 0) { vref(vp); @@ -3342,7 +3351,7 @@ invalid: cookiep++; ncookies--; } - if (!usevget && VOP_ISLOCKED(vp)) + if (!usevget && vp_locked) vput(vp); else vrele(vp); From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 16:42:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EA8106564A; Wed, 15 Dec 2010 16:42:45 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 381988FC15; Wed, 15 Dec 2010 16:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFGgj7x064791; Wed, 15 Dec 2010 16:42:45 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFGgjLc064787; Wed, 15 Dec 2010 16:42:45 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012151642.oBFGgjLc064787@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 15 Dec 2010 16:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216461 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 16:42:45 -0000 Author: jh Date: Wed Dec 15 16:42:44 2010 New Revision: 216461 URL: http://svn.freebsd.org/changeset/base/216461 Log: - Assert that dm_lock is exclusively held in devfs_rules_apply() and in devfs_vmkdir() while adding the entry to de_list of the parent. - Apply devfs rules to newly created directories and symbolic links. PR: kern/125034 Submitted by: Mateusz Guzik (original version) Modified: head/sys/fs/devfs/devfs_devs.c head/sys/fs/devfs/devfs_rule.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Wed Dec 15 16:21:59 2010 (r216460) +++ head/sys/fs/devfs/devfs_devs.c Wed Dec 15 16:42:44 2010 (r216461) @@ -281,8 +281,10 @@ devfs_vmkdir(struct devfs_mount *dmp, ch de->de_dir = dd; } else { de->de_dir = dotdot; + sx_assert(&dmp->dm_lock, SX_XLOCKED); TAILQ_INSERT_TAIL(&dotdot->de_dlist, dd, de_list); dotdot->de_links++; + devfs_rules_apply(dmp, dd); } #ifdef MAC Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Wed Dec 15 16:21:59 2010 (r216460) +++ head/sys/fs/devfs/devfs_rule.c Wed Dec 15 16:42:44 2010 (r216461) @@ -139,6 +139,8 @@ devfs_rules_apply(struct devfs_mount *dm { struct devfs_ruleset *ds; + sx_assert(&dm->dm_lock, SX_XLOCKED); + if (dm->dm_ruleset == 0) return; sx_slock(&sx_rules); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Dec 15 16:21:59 2010 (r216460) +++ head/sys/fs/devfs/devfs_vnops.c Wed Dec 15 16:42:44 2010 (r216461) @@ -1589,6 +1589,7 @@ devfs_symlink(struct vop_symlink_args *a de_dotdot = TAILQ_NEXT(de_dotdot, de_list); /* ".." */ TAILQ_INSERT_AFTER(&dd->de_dlist, de_dotdot, de, de_list); devfs_dir_ref_de(dmp, dd); + devfs_rules_apply(dmp, de); return (devfs_allocv(de, ap->a_dvp->v_mount, LK_EXCLUSIVE, ap->a_vpp)); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 16:49:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A32C11065679; Wed, 15 Dec 2010 16:49:47 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 921908FC14; Wed, 15 Dec 2010 16:49:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFGnlDw066050; Wed, 15 Dec 2010 16:49:47 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFGnldp066048; Wed, 15 Dec 2010 16:49:47 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012151649.oBFGnldp066048@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 15 Dec 2010 16:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216462 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 16:49:47 -0000 Author: jh Date: Wed Dec 15 16:49:47 2010 New Revision: 216462 URL: http://svn.freebsd.org/changeset/base/216462 Log: Don't allow user created symbolic links to cover another entries marked with DE_USER. If a devfs rule hid such entry, it was possible to create infinite number of symbolic links with the same name. Reviewed by: kib Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Dec 15 16:42:44 2010 (r216461) +++ head/sys/fs/devfs/devfs_vnops.c Wed Dec 15 16:49:47 2010 (r216462) @@ -1580,6 +1580,11 @@ devfs_symlink(struct vop_symlink_args *a de_covered = devfs_find(dd, de->de_dirent->d_name, de->de_dirent->d_namlen, 0); if (de_covered != NULL) { + if ((de_covered->de_flags & DE_USER) != 0) { + devfs_delete(dmp, de, DEVFS_DEL_NORECURSE); + sx_xunlock(&dmp->dm_lock); + return (EEXIST); + } KASSERT((de_covered->de_flags & DE_COVERED) == 0, ("devfs_symlink: entry %p already covered", de_covered)); de_covered->de_flags |= DE_COVERED; From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 17:05:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8222106564A; Wed, 15 Dec 2010 17:05:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 8959C8FC15; Wed, 15 Dec 2010 17:05:03 +0000 (UTC) Received: from a91-153-123-205.elisa-laajakaista.fi (a91-153-123-205.elisa-laajakaista.fi [91.153.123.205]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 1DCA8216AAC; Wed, 15 Dec 2010 18:46:05 +0200 (EET) Date: Wed, 15 Dec 2010 18:46:05 +0200 From: Jaakko Heinonen To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20101215164604.GA2255@a91-153-123-205.elisa-laajakaista.fi> References: <201012151642.oBFGgjLc064787@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012151642.oBFGgjLc064787@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r216461 - head/sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 17:05:04 -0000 On 2010-12-15, Jaakko Heinonen wrote: > - Assert that dm_lock is exclusively held in devfs_rules_apply() and > in devfs_vmkdir() while adding the entry to de_list of the parent. > - Apply devfs rules to newly created directories and symbolic links. > > PR: kern/125034 > Submitted by: Mateusz Guzik (original version) Reviewed by: kib -- Jaakko From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 19:30:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5DA1065670; Wed, 15 Dec 2010 19:30:45 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38DCA8FC12; Wed, 15 Dec 2010 19:30:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFJUjv0080672; Wed, 15 Dec 2010 19:30:45 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFJUjw2080670; Wed, 15 Dec 2010 19:30:45 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201012151930.oBFJUjw2080670@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 15 Dec 2010 19:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216463 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 19:30:45 -0000 Author: mdf Date: Wed Dec 15 19:30:44 2010 New Revision: 216463 URL: http://svn.freebsd.org/changeset/base/216463 Log: One of the compat32 functions was copying in a raw timespec, instead of a 32-bit one. This can cause weird timeout issues, as the copying reads garbage from the user. Code by: Deepak Veliath MFC after: 1 week Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Dec 15 16:49:47 2010 (r216462) +++ head/sys/kern/kern_umtx.c Wed Dec 15 19:30:44 2010 (r216463) @@ -3411,8 +3411,7 @@ __umtx_op_rw_rdlock_compat32(struct thre if (uap->uaddr2 == NULL) { error = do_rw_rdlock(td, uap->obj, uap->val, 0); } else { - error = copyin(uap->uaddr2, &timeout, - sizeof(timeout)); + error = copyin_timeout32(uap->uaddr2, &timeout); if (error != 0) return (error); if (timeout.tv_nsec >= 1000000000 || From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 22:58:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AA831065675; Wed, 15 Dec 2010 22:58:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 893778FC08; Wed, 15 Dec 2010 22:58:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFMwjtb098287; Wed, 15 Dec 2010 22:58:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFMwjTW098284; Wed, 15 Dec 2010 22:58:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012152258.oBFMwjTW098284@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 15 Dec 2010 22:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216466 - in head/sys: conf netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 22:58:45 -0000 Author: bz Date: Wed Dec 15 22:58:45 2010 New Revision: 216466 URL: http://svn.freebsd.org/changeset/base/216466 Log: Bring back (most of) NATM to avoid further bitrot after r186119. Keep three lines disabled which I am unsure if they had been used at all. This will allow us to seek testers and possibly bring it all back. Discussed with: rwatson MFC after: 7 weeks Modified: head/sys/conf/NOTES head/sys/netinet/if_atm.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Dec 15 22:48:44 2010 (r216465) +++ head/sys/conf/NOTES Wed Dec 15 22:58:45 2010 (r216466) @@ -2174,7 +2174,7 @@ device fatm #Fore PCA200E device hatm #Fore/Marconi HE155/622 device patm #IDT77252 cards (ProATM and IDT) device utopia #ATM PHY driver -#options NATM #native ATM +options NATM #native ATM options LIBMBPOOL #needed by patm, iatm Modified: head/sys/netinet/if_atm.c ============================================================================== --- head/sys/netinet/if_atm.c Wed Dec 15 22:48:44 2010 (r216465) +++ head/sys/netinet/if_atm.c Wed Dec 15 22:58:45 2010 (r216466) @@ -229,7 +229,9 @@ atm_rtrequest(int req, struct rtentry *r npcb->npcb_flags |= NPCB_IP; npcb->ipaddr.s_addr = sin->sin_addr.s_addr; /* XXX: move npcb to llinfo when ATM ARP is ready */ +#ifdef __notyet_restored__ rt->rt_llinfo = (caddr_t) npcb; +#endif rt->rt_flags |= RTF_LLINFO; #endif /* @@ -255,7 +257,9 @@ failed: #ifdef NATM if (npcb) { npcb_free(npcb, NPCB_DESTROY); +#ifdef __notyet_restored__ rt->rt_llinfo = NULL; +#endif rt->rt_flags &= ~RTF_LLINFO; } NATM_UNLOCK(); @@ -273,9 +277,11 @@ failed: */ if (rt->rt_flags & RTF_LLINFO) { NATM_LOCK(); +#ifdef __notyet_restored__ npcb_free((struct natmpcb *)rt->rt_llinfo, NPCB_DESTROY); rt->rt_llinfo = NULL; +#endif rt->rt_flags &= ~RTF_LLINFO; NATM_UNLOCK(); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 23:02:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999161065675; Wed, 15 Dec 2010 23:02:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 538A38FC0A; Wed, 15 Dec 2010 23:02:42 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id B094141C48B; Thu, 16 Dec 2010 00:02:41 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id M7E1pA0XPJgB; Thu, 16 Dec 2010 00:02:40 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 00EC441C759; Thu, 16 Dec 2010 00:02:39 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id BFD1044490B; Wed, 15 Dec 2010 23:00:31 +0000 (UTC) Date: Wed, 15 Dec 2010 23:00:31 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201012152258.oBFMwjTW098284@svn.freebsd.org> Message-ID: <20101215225913.C6126@maildrop.int.zabbadoz.net> References: <201012152258.oBFMwjTW098284@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r216466 - in head/sys: conf netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 23:02:42 -0000 On Wed, 15 Dec 2010, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Dec 15 22:58:45 2010 > New Revision: 216466 > URL: http://svn.freebsd.org/changeset/base/216466 > > Log: > Bring back (most of) NATM to avoid further bitrot after r186119. > Keep three lines disabled which I am unsure if they had been used at all. > This will allow us to seek testers and possibly bring it all back. If you have the ability to test (on 8.x or HEAD) or are using NATM, please get in contact with me. > Discussed with: rwatson > MFC after: 7 weeks > > Modified: > head/sys/conf/NOTES > head/sys/netinet/if_atm.c > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Wed Dec 15 22:48:44 2010 (r216465) > +++ head/sys/conf/NOTES Wed Dec 15 22:58:45 2010 (r216466) > @@ -2174,7 +2174,7 @@ device fatm #Fore PCA200E > device hatm #Fore/Marconi HE155/622 > device patm #IDT77252 cards (ProATM and IDT) > device utopia #ATM PHY driver > -#options NATM #native ATM > +options NATM #native ATM > > options LIBMBPOOL #needed by patm, iatm > > > Modified: head/sys/netinet/if_atm.c > ============================================================================== > --- head/sys/netinet/if_atm.c Wed Dec 15 22:48:44 2010 (r216465) > +++ head/sys/netinet/if_atm.c Wed Dec 15 22:58:45 2010 (r216466) > @@ -229,7 +229,9 @@ atm_rtrequest(int req, struct rtentry *r > npcb->npcb_flags |= NPCB_IP; > npcb->ipaddr.s_addr = sin->sin_addr.s_addr; > /* XXX: move npcb to llinfo when ATM ARP is ready */ > +#ifdef __notyet_restored__ > rt->rt_llinfo = (caddr_t) npcb; > +#endif > rt->rt_flags |= RTF_LLINFO; > #endif > /* > @@ -255,7 +257,9 @@ failed: > #ifdef NATM > if (npcb) { > npcb_free(npcb, NPCB_DESTROY); > +#ifdef __notyet_restored__ > rt->rt_llinfo = NULL; > +#endif > rt->rt_flags &= ~RTF_LLINFO; > } > NATM_UNLOCK(); > @@ -273,9 +277,11 @@ failed: > */ > if (rt->rt_flags & RTF_LLINFO) { > NATM_LOCK(); > +#ifdef __notyet_restored__ > npcb_free((struct natmpcb *)rt->rt_llinfo, > NPCB_DESTROY); > rt->rt_llinfo = NULL; > +#endif > rt->rt_flags &= ~RTF_LLINFO; > NATM_UNLOCK(); > } > -- Bjoern A. Zeeb Welcome a new stage of life. Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 23:24:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22D501065679; Wed, 15 Dec 2010 23:24:35 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4048FC0C; Wed, 15 Dec 2010 23:24:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFNOYsD099865; Wed, 15 Dec 2010 23:24:34 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFNOYoi099848; Wed, 15 Dec 2010 23:24:34 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201012152324.oBFNOYoi099848@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 15 Dec 2010 23:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216468 - in head/sbin/geom/class: . cache concat eli journal label mirror mountver multipath nop part raid3 sched shsec stripe virstor X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 23:24:35 -0000 Author: obrien Date: Wed Dec 15 23:24:34 2010 New Revision: 216468 URL: http://svn.freebsd.org/changeset/base/216468 Log: Rename the generic "CLASS" to the more specific "GEOM_CLASS". While I'm here remove redundancy and inconsistencies. Obtained from: Juniper Networks Modified: head/sbin/geom/class/Makefile.inc head/sbin/geom/class/cache/Makefile head/sbin/geom/class/concat/Makefile head/sbin/geom/class/eli/Makefile head/sbin/geom/class/journal/Makefile head/sbin/geom/class/label/Makefile head/sbin/geom/class/mirror/Makefile head/sbin/geom/class/mountver/Makefile head/sbin/geom/class/multipath/Makefile head/sbin/geom/class/nop/Makefile head/sbin/geom/class/part/Makefile head/sbin/geom/class/raid3/Makefile head/sbin/geom/class/sched/Makefile head/sbin/geom/class/shsec/Makefile head/sbin/geom/class/stripe/Makefile head/sbin/geom/class/virstor/Makefile Modified: head/sbin/geom/class/Makefile.inc ============================================================================== --- head/sbin/geom/class/Makefile.inc Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/Makefile.inc Wed Dec 15 23:24:34 2010 (r216468) @@ -1,10 +1,10 @@ # $FreeBSD$ -SHLIBDIR?=${CLASS_DIR} -SHLIB_NAME?=geom_${CLASS}.so -LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} -MAN= g${CLASS}.8 -SRCS+= geom_${CLASS}.c subr.c +SHLIBDIR?=${GEOM_CLASS_DIR} +SHLIB_NAME?=geom_${GEOM_CLASS}.so +LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_CLASS} +MAN= g${GEOM_CLASS}.8 +SRCS+= geom_${GEOM_CLASS}.c subr.c CFLAGS+= -I${.CURDIR}/../.. Modified: head/sbin/geom/class/cache/Makefile ============================================================================== --- head/sbin/geom/class/cache/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/cache/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= cache +GEOM_CLASS= cache .include Modified: head/sbin/geom/class/concat/Makefile ============================================================================== --- head/sbin/geom/class/concat/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/concat/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= concat +GEOM_CLASS= concat .include Modified: head/sbin/geom/class/eli/Makefile ============================================================================== --- head/sbin/geom/class/eli/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/eli/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../misc ${.CURDIR}/../../../../sys/geom/eli ${.CURDIR}/../../../../sys/crypto/sha2 -CLASS= eli +GEOM_CLASS= eli SRCS= g_eli_crypto.c SRCS+= g_eli_key.c SRCS+= pkcs5v2.c Modified: head/sbin/geom/class/journal/Makefile ============================================================================== --- head/sbin/geom/class/journal/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/journal/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../misc +.PATH: ${.CURDIR}/../../misc -CLASS= journal +GEOM_CLASS= journal SRCS+= geom_journal_ufs.c DPADD= ${LIBMD} ${LIBUFS} Modified: head/sbin/geom/class/label/Makefile ============================================================================== --- head/sbin/geom/class/label/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/label/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= label +GEOM_CLASS= label .include Modified: head/sbin/geom/class/mirror/Makefile ============================================================================== --- head/sbin/geom/class/mirror/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/mirror/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../misc +.PATH: ${.CURDIR}/../../misc -CLASS= mirror +GEOM_CLASS= mirror DPADD= ${LIBMD} LDADD= -lmd Modified: head/sbin/geom/class/mountver/Makefile ============================================================================== --- head/sbin/geom/class/mountver/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/mountver/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= mountver +GEOM_CLASS= mountver .include Modified: head/sbin/geom/class/multipath/Makefile ============================================================================== --- head/sbin/geom/class/multipath/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/multipath/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -1,8 +1,9 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../misc -CLASS= multipath -.include +GEOM_CLASS= multipath CFLAGS+= -I${.CURDIR}/../../../../sys + +.include Modified: head/sbin/geom/class/nop/Makefile ============================================================================== --- head/sbin/geom/class/nop/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/nop/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= nop +GEOM_CLASS= nop .include Modified: head/sbin/geom/class/part/Makefile ============================================================================== --- head/sbin/geom/class/part/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/part/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../misc -CLASS= part +GEOM_CLASS= part DPADD= ${LIBUTIL} LDADD= -lutil Modified: head/sbin/geom/class/raid3/Makefile ============================================================================== --- head/sbin/geom/class/raid3/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/raid3/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../misc -CLASS= raid3 +GEOM_CLASS= raid3 DPADD= ${LIBMD} LDADD= -lmd Modified: head/sbin/geom/class/sched/Makefile ============================================================================== --- head/sbin/geom/class/sched/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/sched/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,17 +2,10 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../misc -#CFLAGS += -I/usr/src/sbin/geom -CLASS=sched +GEOM_CLASS= sched -WARNS?= 6 +WARNS?= 6 CLASS_DIR?=/lib/geom -SHLIBDIR?=${CLASS_DIR} -SHLIB_NAME?=geom_${CLASS}.so -LINKS= ${BINDIR}/geom ${BINDIR}/g${CLASS} -MAN= g${CLASS}.8 -SRCS+= geom_${CLASS}.c subr.c - .include Modified: head/sbin/geom/class/shsec/Makefile ============================================================================== --- head/sbin/geom/class/shsec/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/shsec/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= shsec +GEOM_CLASS= shsec .include Modified: head/sbin/geom/class/stripe/Makefile ============================================================================== --- head/sbin/geom/class/stripe/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/stripe/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../misc -CLASS= stripe +GEOM_CLASS= stripe .include Modified: head/sbin/geom/class/virstor/Makefile ============================================================================== --- head/sbin/geom/class/virstor/Makefile Wed Dec 15 22:59:50 2010 (r216467) +++ head/sbin/geom/class/virstor/Makefile Wed Dec 15 23:24:34 2010 (r216468) @@ -1,8 +1,8 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../misc ${.CURDIR}/../../../../sys/geom/virstor +.PATH: ${.CURDIR}/../../misc ${.CURDIR}/../../../../sys/geom/virstor -CLASS= virstor +GEOM_CLASS= virstor SRCS+= binstream.c SRCS+= g_virstor_md.c From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 23:43:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CF00106566C; Wed, 15 Dec 2010 23:43:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2B08FC15; Wed, 15 Dec 2010 23:43:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFNhQrW000516; Wed, 15 Dec 2010 23:43:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFNhQ9R000514; Wed, 15 Dec 2010 23:43:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012152343.oBFNhQ9R000514@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 15 Dec 2010 23:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216469 - head/release/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 23:43:26 -0000 Author: nwhitehorn Date: Wed Dec 15 23:43:25 2010 New Revision: 216469 URL: http://svn.freebsd.org/changeset/base/216469 Log: Fix the overflowing livefs ISO by removing man pages from the HFS part of the hybrid disk. This is a stopgap until a better solution can be found, but lets the powerpc release build complete for the time being. MFC after: 1 week Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Wed Dec 15 23:24:34 2010 (r216468) +++ head/release/powerpc/mkisoimages.sh Wed Dec 15 23:43:25 2010 (r216469) @@ -25,7 +25,7 @@ if [ "x$1" = "x-b" ]; then cp /usr/src/release/powerpc/boot.tbxi ${4}/boot - bootable="-hfs-bless ${4}/boot -map /usr/src/release/powerpc/hfs.map" + bootable="-hfs -hfs-bless ${4}/boot -map /usr/src/release/powerpc/hfs.map -hide-hfs ${4}/usr/share/man" shift else bootable="" @@ -54,4 +54,4 @@ fi LABEL=$1; shift NAME=$1; shift -mkisofs $bootable -r -hfs -part -no-desktop -hfs-volid $LABEL -l -J -allow-leading-dots -o $NAME $* +mkisofs $bootable -l -r -part -no-desktop -V $LABEL -o $NAME $* From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 23:45:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04FC1065673; Wed, 15 Dec 2010 23:45:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46AC8FC14; Wed, 15 Dec 2010 23:45:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFNjDPp000616; Wed, 15 Dec 2010 23:45:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFNjDZK000611; Wed, 15 Dec 2010 23:45:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201012152345.oBFNjDZK000611@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 15 Dec 2010 23:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216470 - in head/sbin/geom: . class/sched core X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 23:45:13 -0000 Author: obrien Date: Wed Dec 15 23:45:12 2010 New Revision: 216470 URL: http://svn.freebsd.org/changeset/base/216470 Log: Rename the generic "CLASS" to the more specific "GEOM_CLASS". While I'm here remove redundancy and inconsistencies. Obtained from: Juniper Networks Modified: head/sbin/geom/Makefile.inc head/sbin/geom/class/sched/Makefile head/sbin/geom/core/Makefile head/sbin/geom/core/geom.c Modified: head/sbin/geom/Makefile.inc ============================================================================== --- head/sbin/geom/Makefile.inc Wed Dec 15 23:43:25 2010 (r216469) +++ head/sbin/geom/Makefile.inc Wed Dec 15 23:45:12 2010 (r216470) @@ -1,5 +1,5 @@ # $FreeBSD$ -CLASS_DIR?=/lib/geom +GEOM_CLASS_DIR?=/lib/geom .include "../Makefile.inc" Modified: head/sbin/geom/class/sched/Makefile ============================================================================== --- head/sbin/geom/class/sched/Makefile Wed Dec 15 23:43:25 2010 (r216469) +++ head/sbin/geom/class/sched/Makefile Wed Dec 15 23:45:12 2010 (r216470) @@ -6,6 +6,5 @@ GEOM_CLASS= sched WARNS?= 6 -CLASS_DIR?=/lib/geom .include Modified: head/sbin/geom/core/Makefile ============================================================================== --- head/sbin/geom/core/Makefile Wed Dec 15 23:43:25 2010 (r216469) +++ head/sbin/geom/core/Makefile Wed Dec 15 23:45:12 2010 (r216470) @@ -8,7 +8,7 @@ SRCS= geom.c subr.c NO_SHARED=NO -CFLAGS+= -DCLASS_DIR=\"${CLASS_DIR}\" +CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\" CFLAGS+= -I${.CURDIR}/../../../sys -I${.CURDIR} -I${.CURDIR}/.. DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Wed Dec 15 23:43:25 2010 (r216469) +++ head/sbin/geom/core/geom.c Wed Dec 15 23:45:12 2010 (r216470) @@ -500,7 +500,7 @@ library_path(void) path = getenv("GEOM_LIBRARY_PATH"); if (path == NULL) - path = CLASS_DIR; + path = GEOM_CLASS_DIR; return (path); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 15 23:48:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C78E106566C; Wed, 15 Dec 2010 23:48:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46DDD8FC0A; Wed, 15 Dec 2010 23:48:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBFNmkMw000782; Wed, 15 Dec 2010 23:48:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBFNmjsu000761; Wed, 15 Dec 2010 23:48:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201012152348.oBFNmjsu000761@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 15 Dec 2010 23:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216471 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/dispatcher sys/co... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2010 23:48:46 -0000 Author: jkim Date: Wed Dec 15 23:48:45 2010 New Revision: 216471 URL: http://svn.freebsd.org/changeset/base/216471 Log: Merge ACPICA 20101209. Added: head/sys/contrib/dev/acpica/events/evxfgpe.c - copied, changed from r216468, vendor-sys/acpica/dist/events/evxfgpe.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbdisply.c head/sys/contrib/dev/acpica/debugger/dbexec.c head/sys/contrib/dev/acpica/dispatcher/dswexec.c head/sys/contrib/dev/acpica/events/evevent.c head/sys/contrib/dev/acpica/events/evgpe.c head/sys/contrib/dev/acpica/events/evgpeblk.c head/sys/contrib/dev/acpica/events/evgpeinit.c head/sys/contrib/dev/acpica/events/evgpeutil.c head/sys/contrib/dev/acpica/events/evxface.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/executer/exconfig.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/tools/acpiexec/aecommon.h head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utxface.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_button.c head/sys/dev/acpica/acpi_ec.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/conf/files Wed Dec 15 23:48:45 2010 (r216471) @@ -195,6 +195,7 @@ contrib/dev/acpica/events/evrgnini.c op contrib/dev/acpica/events/evsci.c optional acpi contrib/dev/acpica/events/evxface.c optional acpi contrib/dev/acpica/events/evxfevnt.c optional acpi +contrib/dev/acpica/events/evxfgpe.c optional acpi contrib/dev/acpica/events/evxfregn.c optional acpi contrib/dev/acpica/executer/exconfig.c optional acpi contrib/dev/acpica/executer/exconvrt.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/changes.txt Wed Dec 15 23:48:45 2010 (r216471) @@ -1,4 +1,76 @@ ---------------------------------------- +09 December 2010. Summary of changes for version 20101209: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Completed the major overhaul of the GPE support code that was begun in July +2010. Major features include: removal of _PRW execution in ACPICA (host +executes _PRWs anyway), cleanup of "wake" GPE interfaces and processing, +changes to existing interfaces, simplification of GPE handler operation, and +a handful of new interfaces: + + AcpiUpdateAllGpes + AcpiFinishGpe + AcpiSetupGpeForWake + AcpiSetGpeWakeMask + One new file, evxfgpe.c to consolidate all external GPE interfaces. + +See the ACPICA Programmer Reference for full details and programming +information. See the new section 4.4 "General Purpose Event (GPE) Support" +for a full overview, and section 8.7 "ACPI General Purpose Event Management" +for programming details. ACPICA BZ 858,870,877. Matthew Garrett, Lin Ming, +Bob Moore, Rafael Wysocki. + +Implemented a new GPE feature for Windows compatibility, the "Implicit Wake +GPE Notify". This feature will automatically issue a Notify(2) on a device +when a Wake GPE is received if there is no corresponding GPE method or +handler. ACPICA BZ 870. + +Fixed a problem with the Scope() operator during table parse and load phase. +During load phase (table load or method execution), the scope operator should +not enter the target into the namespace. Instead, it should open a new scope +at the target location. Linux BZ 19462, ACPICA BZ 882. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 89.8K Code, 18.9K Data, 108.7K Total + Debug Version: 166.6K Code, 52.1K Data, 218.7K Total + Current Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Relax the alphanumeric restriction on _CID strings. These strings are +"bus-specific" per the ACPI specification, and therefore any characters are +acceptable. The only checks that can be performed are for a null string and +perhaps for a leading asterisk. ACPICA BZ 886. + +iASL: Fixed a problem where a syntax error that caused a premature EOF +condition on the source file emitted a very confusing error message. The +premature EOF is now detected correctly. ACPICA BZ 891. + +Disassembler: Decode the AccessSize within a Generic Address Structure (byte +access, word access, etc.) Note, this field does not allow arbitrary bit +access, the size is encoded as 1=byte, 2=word, 3=dword, and 4=qword. + +New: AcpiNames utility - Example namespace dump utility. Shows an example of +ACPICA configuration for a minimal namespace dump utility. Uses table and +namespace managers, but no AML interpreter. Does not add any functionality +over AcpiExec, it is a subset of AcpiExec. The purpose is to show how to +partition and configure ACPICA. ACPICA BZ 883. + +AML Debugger: Increased the debugger buffer size for method return objects. +Was 4K, increased to 16K. Also enhanced error messages for debugger method +execution, including the buffer overflow case. + +---------------------------------------- 13 October 2010. Summary of changes for version 20101013: This release is available at www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Dec 15 23:48:45 2010 (r216471) @@ -295,6 +295,19 @@ static const char *AcpiDmFadtP "Unknown Profile Type" }; +#define ACPI_GAS_WIDTH_RESERVED 5 + +static const char *AcpiDmGasAccessWidth[] = +{ + "Undefined/Legacy", + "Byte Access:8", + "Word Access:16", + "DWord Access:32", + "QWord Access:64", + "Unknown Width Encoding" +}; + + /******************************************************************************* * * ACPI Table Data, indexed by signature. @@ -669,6 +682,7 @@ AcpiDmDumpTable ( case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: @@ -884,6 +898,19 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiUtGetRegionName (*Target)); break; + case ACPI_DMT_ACCWIDTH: + + /* Encoded Access Width */ + + Temp8 = *Target; + if (Temp8 > ACPI_GAS_WIDTH_RESERVED) + { + Temp8 = ACPI_GAS_WIDTH_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", Temp8, AcpiDmGasAccessWidth[Temp8]); + break; + case ACPI_DMT_GAS: /* Generic Address Structure */ Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Dec 15 23:48:45 2010 (r216471) @@ -282,7 +282,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID", 0}, {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width", 0}, {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset", 0}, - {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width", 0}, + {ACPI_DMT_ACCWIDTH, ACPI_GAS_OFFSET (AccessWidth), "Encoded Access Width", 0}, {ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Dec 15 23:48:45 2010 (r216471) @@ -684,19 +684,45 @@ AnCheckId ( UINT32 AlphaPrefixLength; + /* Only care about string versions of _HID/_CID (integers are legal) */ + if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL) { return; } + /* For both _HID and _CID, the string must be non-null */ + Length = strlen (Op->Asl.Value.String); + if (!Length) + { + AslError (ASL_ERROR, ASL_MSG_NULL_STRING, + Op, NULL); + return; + } /* - * If _HID/_CID is a string, all characters must be alphanumeric. - * One of the things we want to catch here is the use of - * a leading asterisk in the string -- an odd construct - * that certain platform manufacturers are fond of. + * One of the things we want to catch here is the use of a leading + * asterisk in the string -- an odd construct that certain platform + * manufacturers are fond of. Technically, a leading asterisk is OK + * for _CID, but a valid use of this has not been seen. */ + if (*Op->Asl.Value.String == '*') + { + AslError (ASL_ERROR, ASL_MSG_LEADING_ASTERISK, + Op, Op->Asl.Value.String); + return; + } + + /* _CID strings are bus-specific, no more checks can be performed */ + + if (Type == ASL_TYPE_CID) + { + return; + } + + /* For _HID, all characters must be alphanumeric */ + for (i = 0; Op->Asl.Value.String[i]; i++) { if (!isalnum ((int) Op->Asl.Value.String[i])) @@ -707,13 +733,6 @@ AnCheckId ( } } - if (Type == ASL_TYPE_CID) - { - /* _CID strings are bus-specific, no more checks can be performed */ - - return; - } - /* _HID String must be of the form "XXX####" or "ACPI####" */ if ((Length < 7) || (Length > 8)) Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Dec 15 23:48:45 2010 (r216471) @@ -241,6 +241,8 @@ AePrintException ( UINT32 ErrorColumn; FILE *OutputFile; FILE *SourceFile; + long FileSize; + BOOLEAN PrematureEOF = FALSE; if (Gbl_NoErrors) @@ -289,6 +291,19 @@ AePrintException ( SourceFile = Gbl_Files[ASL_FILE_INPUT].Handle; } + if (SourceFile) + { + /* Determine if the error occurred at source file EOF */ + + fseek (SourceFile, 0, SEEK_END); + FileSize = ftell (SourceFile); + + if ((long) Enode->LogicalByteOffset >= FileSize) + { + PrematureEOF = TRUE; + } + } + if (Header) { fprintf (OutputFile, "%s", Header); @@ -307,33 +322,42 @@ AePrintException ( fprintf (OutputFile, " %6u: ", Enode->LineNumber); /* - * Seek to the offset in the combined source file, read the source - * line, and write it to the output. + * If not at EOF, get the corresponding source code line and + * display it. Don't attempt this if we have a premature EOF + * condition. */ - Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, - (int) SEEK_SET); - if (Actual) - { - fprintf (OutputFile, - "[*** iASL: Seek error on source code temp file %s ***]", - Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); - } - else + if (!PrematureEOF) { - RActual = fread (&SourceByte, 1, 1, SourceFile); - if (!RActual) + /* + * Seek to the offset in the combined source file, read + * the source line, and write it to the output. + */ + Actual = fseek (SourceFile, (long) Enode->LogicalByteOffset, + (int) SEEK_SET); + if (Actual) { fprintf (OutputFile, - "[*** iASL: Read error on source code temp file %s ***]", + "[*** iASL: Seek error on source code temp file %s ***]", Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); } - - else while (RActual && SourceByte && (SourceByte != '\n')) + else { - fwrite (&SourceByte, 1, 1, OutputFile); RActual = fread (&SourceByte, 1, 1, SourceFile); + if (!RActual) + { + fprintf (OutputFile, + "[*** iASL: Read error on source code temp file %s ***]", + Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Filename); + } + + else while (RActual && SourceByte && (SourceByte != '\n')) + { + fwrite (&SourceByte, 1, 1, OutputFile); + RActual = fread (&SourceByte, 1, 1, SourceFile); + } } } + fprintf (OutputFile, "\n"); } } @@ -376,7 +400,7 @@ AePrintException ( ExtraMessage = NULL; } - if (Gbl_VerboseErrors) + if (Gbl_VerboseErrors && !PrematureEOF) { SourceColumn = Enode->Column + Enode->FilenameLength + 6 + 2; ErrorColumn = ASL_ERROR_LEVEL_LENGTH + 5 + 2 + 1; @@ -406,6 +430,11 @@ AePrintException ( fprintf (OutputFile, " (%s)", ExtraMessage); } + if (PrematureEOF) + { + fprintf (OutputFile, " and premature End-Of-File"); + } + fprintf (OutputFile, "\n"); if (Gbl_VerboseErrors) { Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Dec 15 23:48:45 2010 (r216471) @@ -258,6 +258,9 @@ typedef enum ASL_MSG_NULL_DESCRIPTOR, ASL_MSG_UPPER_CASE, ASL_MSG_HID_LENGTH, + ASL_MSG_NULL_STRING, + ASL_MSG_LEADING_ASTERISK, + ASL_MSG_INVALID_FIELD_NAME, ASL_MSG_INTEGER_SIZE, ASL_MSG_INVALID_HEX_INTEGER, @@ -382,7 +385,7 @@ char *AslMessages /* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", /* ASL_MSG_WRITE */ "Could not write file", /* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct", -/* ASL_MSG_TIMEOUT */ "Possible operator timeout is ignored", +/* ASL_MSG_TIMEOUT */ "Result is not used, possible operator timeout will be missed", /* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", /* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", /* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", @@ -403,6 +406,8 @@ char *AslMessages /* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", /* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case", /* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters", +/* ASL_MSG_NULL_STRING */ "Invalid zero-length (null) string", +/* ASL_MSG_LEADING_ASTERISK */ "Invalid leading asterisk", /* These messages are used by the data table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/dtutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dtutils.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/compiler/dtutils.c Wed Dec 15 23:48:45 2010 (r216471) @@ -573,6 +573,7 @@ DtGetFieldLength ( case ACPI_DMT_UINT8: case ACPI_DMT_CHKSUM: case ACPI_DMT_SPACEID: + case ACPI_DMT_ACCWIDTH: case ACPI_DMT_IVRS: case ACPI_DMT_MADT: case ACPI_DMT_SRAT: Modified: head/sys/contrib/dev/acpica/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbcmds.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/debugger/dbcmds.c Wed Dec 15 23:48:45 2010 (r216471) @@ -2075,7 +2075,7 @@ AcpiDbGenerateGpe ( return; } - (void) AcpiEvGpeDispatch (GpeEventInfo, GpeNumber); + (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } Modified: head/sys/contrib/dev/acpica/debugger/dbdisply.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbdisply.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/debugger/dbdisply.c Wed Dec 15 23:48:45 2010 (r216471) @@ -896,7 +896,8 @@ AcpiDbDisplayGpes ( GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j; GpeEventInfo = &GpeBlock->EventInfo[GpeIndex]; - if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)) + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NONE) { /* This GPE is not used (no method or handler), ignore it */ @@ -906,8 +907,7 @@ AcpiDbDisplayGpes ( AcpiOsPrintf ( " GPE %.2X: %p RunRefs %2.2X Flags %2.2X (", GpeBlock->BlockBaseNumber + GpeIndex, GpeEventInfo, - GpeEventInfo->RuntimeCount, - GpeEventInfo->Flags); + GpeEventInfo->RuntimeCount, GpeEventInfo->Flags); /* Decode the flags byte */ @@ -931,14 +931,17 @@ AcpiDbDisplayGpes ( switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { - case ACPI_GPE_DISPATCH_NOT_USED: + case ACPI_GPE_DISPATCH_NONE: AcpiOsPrintf ("NotUsed"); break; + case ACPI_GPE_DISPATCH_METHOD: + AcpiOsPrintf ("Method"); + break; case ACPI_GPE_DISPATCH_HANDLER: AcpiOsPrintf ("Handler"); break; - case ACPI_GPE_DISPATCH_METHOD: - AcpiOsPrintf ("Method"); + case ACPI_GPE_DISPATCH_NOTIFY: + AcpiOsPrintf ("Notify"); break; default: AcpiOsPrintf ("UNKNOWN: %X", Modified: head/sys/contrib/dev/acpica/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbexec.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/debugger/dbexec.c Wed Dec 15 23:48:45 2010 (r216471) @@ -180,6 +180,9 @@ AcpiDbExecuteMethod ( ACPI_DEVICE_INFO *ObjInfo; + ACPI_FUNCTION_TRACE (DbExecuteMethod); + + if (AcpiGbl_DbOutputToFile && !AcpiDbgLevel) { AcpiOsPrintf ("Warning: debug output is not enabled!\n"); @@ -190,7 +193,7 @@ AcpiDbExecuteMethod ( Status = AcpiGetHandle (NULL, Info->Pathname, &Handle); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Get the object info for number of method parameters */ @@ -198,7 +201,7 @@ AcpiDbExecuteMethod ( Status = AcpiGetObjectInfo (Handle, &ObjInfo); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ParamObjects.Pointer = NULL; @@ -269,7 +272,20 @@ AcpiDbExecuteMethod ( AcpiGbl_CmSingleStep = FALSE; AcpiGbl_MethodExecuting = FALSE; - return (Status); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "while executing %s from debugger", Info->Pathname)); + + if (Status == AE_BUFFER_OVERFLOW) + { + ACPI_ERROR ((AE_INFO, + "Possible overflow of internal debugger buffer (size 0x%X needed 0x%X)", + ACPI_DEBUG_BUFFER_SIZE, (UINT32) ReturnObj->Length)); + } + } + + return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/dispatcher/dswexec.c ============================================================================== --- head/sys/contrib/dev/acpica/dispatcher/dswexec.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/dispatcher/dswexec.c Wed Dec 15 23:48:45 2010 (r216471) @@ -400,10 +400,26 @@ AcpiDsExecBeginOp ( * we must enter this object into the namespace. The created * object is temporary and will be deleted upon completion of * the execution of this method. + * + * Note 10/2010: Except for the Scope() op. This opcode does + * not actually create a new object, it refers to an existing + * object. However, for Scope(), we want to indeed open a + * new scope. */ - Status = AcpiDsLoad2BeginOp (WalkState, NULL); + if (Op->Common.AmlOpcode != AML_SCOPE_OP) + { + Status = AcpiDsLoad2BeginOp (WalkState, NULL); + } + else + { + Status = AcpiDsScopeStackPush (Op->Named.Node, + Op->Named.Node->Type, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } } - break; Modified: head/sys/contrib/dev/acpica/events/evevent.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evevent.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/events/evevent.c Wed Dec 15 23:48:45 2010 (r216471) @@ -180,54 +180,6 @@ AcpiEvInitializeEvents ( /******************************************************************************* * - * FUNCTION: AcpiEvInstallFadtGpes - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Completes initialization of the FADT-defined GPE blocks - * (0 and 1). This causes the _PRW methods to be run, so the HW - * must be fully initialized at this point, including global lock - * support. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEvInstallFadtGpes ( - void) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (EvInstallFadtGpes); - - - /* Namespace must be locked */ - - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - /* FADT GPE Block 0 */ - - (void) AcpiEvInitializeGpeBlock ( - AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[0]); - - /* FADT GPE Block 1 */ - - (void) AcpiEvInitializeGpeBlock ( - AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[1]); - - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - return_ACPI_STATUS (AE_OK); -} - - -/******************************************************************************* - * * FUNCTION: AcpiEvInstallXruptHandlers * * PARAMETERS: None @@ -366,9 +318,17 @@ AcpiEvFixedEventDetect ( if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) && (FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask)) { - /* Found an active (signalled) event */ - + /* + * Found an active (signalled) event. Invoke global event + * handler if present. + */ AcpiFixedEventCount[i]++; + if (AcpiGbl_GlobalEventHandler) + { + AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL, + i, AcpiGbl_GlobalEventHandlerContext); + } + IntStatus |= AcpiEvFixedEventDispatch (i); } } Modified: head/sys/contrib/dev/acpica/events/evgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evgpe.c Wed Dec 15 23:45:12 2010 (r216470) +++ head/sys/contrib/dev/acpica/events/evgpe.c Wed Dec 15 23:48:45 2010 (r216471) @@ -202,12 +202,13 @@ AcpiEvEnableGpe ( /* - * We will only allow a GPE to be enabled if it has either an - * associated method (_Lxx/_Exx) or a handler. Otherwise, the - * GPE will be immediately disabled by AcpiEvGpeDispatch the - * first time it fires. + * We will only allow a GPE to be enabled if it has either an associated + * method (_Lxx/_Exx) or a handler, or is using the implicit notify + * feature. Otherwise, the GPE will be immediately disabled by + * AcpiEvGpeDispatch the first time it fires. */ - if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)) + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NONE) { return_ACPI_STATUS (AE_NO_HANDLER); } @@ -229,6 +230,104 @@ AcpiEvEnableGpe ( /******************************************************************************* * + * FUNCTION: AcpiEvAddGpeReference + * + * PARAMETERS: GpeEventInfo - Add a reference to this GPE + * + * RETURN: Status + * + * DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is + * hardware-enabled. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEvAddGpeReference ( + ACPI_GPE_EVENT_INFO *GpeEventInfo) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (EvAddGpeReference); + + + if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX) + { + return_ACPI_STATUS (AE_LIMIT); + } + + GpeEventInfo->RuntimeCount++; + if (GpeEventInfo->RuntimeCount == 1) + { + /* Enable on first reference */ + + Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo); + if (ACPI_SUCCESS (Status)) + { + Status = AcpiEvEnableGpe (GpeEventInfo); + } + + if (ACPI_FAILURE (Status)) + { + GpeEventInfo->RuntimeCount--; + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEvRemoveGpeReference + * + * PARAMETERS: GpeEventInfo - Remove a reference to this GPE + * + * RETURN: Status + * + * DESCRIPTION: Remove a reference to a GPE. When the last reference is + * removed, the GPE is hardware-disabled. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEvRemoveGpeReference ( + ACPI_GPE_EVENT_INFO *GpeEventInfo) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (EvRemoveGpeReference); + + + if (!GpeEventInfo->RuntimeCount) + { + return_ACPI_STATUS (AE_LIMIT); + } + + GpeEventInfo->RuntimeCount--; + if (!GpeEventInfo->RuntimeCount) + { + /* Disable on last reference */ + + Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo); + if (ACPI_SUCCESS (Status)) + { + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); + } + + if (ACPI_FAILURE (Status)) + { + GpeEventInfo->RuntimeCount++; + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiEvLowGetGpeInfo * * PARAMETERS: GpeNumber - Raw GPE number @@ -412,7 +511,7 @@ AcpiEvGpeDetect ( } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, - "Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n", + "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n", GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg)); /* Check if there is anything active at all in this register */ @@ -437,7 +536,7 @@ AcpiEvGpeDetect ( * Found an active GPE. Dispatch the event to a handler * or method. */ - IntStatus |= AcpiEvGpeDispatch ( + IntStatus |= AcpiEvGpeDispatch (GpeBlock->Node, &GpeBlock->EventInfo[((ACPI_SIZE) i * ACPI_GPE_REGISTER_WIDTH) + j], j + GpeRegisterInfo->BaseGpeNumber); @@ -521,13 +620,27 @@ AcpiEvAsynchExecuteGpeMethod ( return_VOID; } - /* - * Must check for control method type dispatch one more time to avoid a - * race with EvGpeInstallHandler - */ - if ((LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_METHOD) + /* Do the correct dispatch - normal method or implicit notify */ + + switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { + case ACPI_GPE_DISPATCH_NOTIFY: + + /* + * Implicit notify. + * Dispatch a DEVICE_WAKE notify to the appropriate handler. + * NOTE: the request is queued for execution after this method + * completes. The notify handlers are NOT invoked synchronously + * from this thread -- because handlers may in turn run other + * control methods. + */ + Status = AcpiEvQueueNotifyRequest ( + LocalGpeEventInfo->Dispatch.DeviceNode, + ACPI_NOTIFY_DEVICE_WAKE); + break; + + case ACPI_GPE_DISPATCH_METHOD: + /* Allocate the evaluation information block */ Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO)); @@ -538,8 +651,8 @@ AcpiEvAsynchExecuteGpeMethod ( else { /* - * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx - * control method that corresponds to this GPE + * Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the + * _Lxx/_Exx control method that corresponds to this GPE */ Info->PrefixNode = LocalGpeEventInfo->Dispatch.MethodNode; Info->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -554,6 +667,11 @@ AcpiEvAsynchExecuteGpeMethod ( "while evaluating GPE method [%4.4s]", AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode))); } + + break; + + default: + return_VOID; /* Should never happen */ } /* Defer enabling of GPE until all notify handlers are done */ @@ -573,6 +691,7 @@ AcpiEvAsynchExecuteGpeMethod ( * FUNCTION: AcpiEvAsynchEnableGpe * * PARAMETERS: Context (GpeEventInfo) - Info for this GPE + * Callback from AcpiOsExecute * * RETURN: None * @@ -586,6 +705,32 @@ AcpiEvAsynchEnableGpe ( void *Context) { ACPI_GPE_EVENT_INFO *GpeEventInfo = Context; + + + (void) AcpiEvFinishGpe (GpeEventInfo); + + ACPI_FREE (GpeEventInfo); + return; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEvFinishGpe + * + * PARAMETERS: GpeEventInfo - Info for this GPE + * + * RETURN: Status + * + * DESCRIPTION: Clear/Enable a GPE. Common code that is used after execution + * of a GPE method or a synchronous or asynchronous GPE handler. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEvFinishGpe ( + ACPI_GPE_EVENT_INFO *GpeEventInfo) +{ ACPI_STATUS Status; @@ -593,25 +738,23 @@ AcpiEvAsynchEnableGpe ( ACPI_GPE_LEVEL_TRIGGERED) { /* - * GPE is level-triggered, we clear the GPE status bit after handling - * the event. + * GPE is level-triggered, we clear the GPE status bit after + * handling the event. */ Status = AcpiHwClearGpe (GpeEventInfo); if (ACPI_FAILURE (Status)) { - goto Exit; + return (Status); } } /* - * Enable this GPE, conditionally. This means that the GPE will only be - * physically enabled if the EnableForRun bit is set in the EventInfo + * Enable this GPE, conditionally. This means that the GPE will + * only be physically enabled if the EnableForRun bit is set + * in the EventInfo. */ (void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE); - -Exit: - ACPI_FREE (GpeEventInfo); - return; + return (AE_OK); } @@ -619,8 +762,9 @@ Exit: * * FUNCTION: AcpiEvGpeDispatch * - * PARAMETERS: GpeEventInfo - Info for this GPE - * GpeNumber - Number relative to the parent GPE block + * PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1 + * GpeEventInfo - Info for this GPE + * GpeNumber - Number relative to the parent GPE block * * RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED * @@ -633,16 +777,25 @@ Exit: UINT32 AcpiEvGpeDispatch ( + ACPI_NAMESPACE_NODE *GpeDevice, ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber) { ACPI_STATUS Status; + UINT32 ReturnValue; ACPI_FUNCTION_TRACE (EvGpeDispatch); + /* Invoke global event handler if present */ + AcpiGpeCount++; + if (AcpiGbl_GlobalEventHandler) + { + AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, GpeDevice, + GpeNumber, AcpiGbl_GlobalEventHandlerContext); + } /* * If edge-triggered, clear the GPE status bit now. Note that @@ -655,58 +808,55 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to clear GPE[0x%2X]", GpeNumber)); + "Unable to clear GPE%02X", GpeNumber)); return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); } } /* - * Dispatch the GPE to either an installed handler, or the control method - * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke - * it and do not attempt to run the method. If there is neither a handler - * nor a method, we disable this GPE to prevent further such pointless - * events from firing. + * Always disable the GPE so that it does not keep firing before + * any asynchronous activity completes (either from the execution + * of a GPE method or an asynchronous GPE handler.) + * + * If there is no handler or method to run, just disable the + * GPE and leave it disabled permanently to prevent further such + * pointless events from firing. + */ + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "Unable to disable GPE%02X", GpeNumber)); + return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); + } + + /* + * Dispatch the GPE to either an installed handler or the control + * method associated with this GPE (_Lxx or _Exx). If a handler + * exists, we invoke it and do not attempt to run the method. + * If there is neither a handler nor a method, leave the GPE + * disabled. */ switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { case ACPI_GPE_DISPATCH_HANDLER: - /* - * Invoke the installed handler (at interrupt level) - * Ignore return status for now. - * TBD: leave GPE disabled on error? - */ - (void) GpeEventInfo->Dispatch.Handler->Address ( - GpeEventInfo->Dispatch.Handler->Context); + /* Invoke the installed handler (at interrupt level) */ + + ReturnValue = GpeEventInfo->Dispatch.Handler->Address ( + GpeDevice, GpeNumber, + GpeEventInfo->Dispatch.Handler->Context); - /* It is now safe to clear level-triggered events. */ + /* If requested, clear (if level-triggered) and reenable the GPE */ - if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == - ACPI_GPE_LEVEL_TRIGGERED) + if (ReturnValue & ACPI_REENABLE_GPE) { - Status = AcpiHwClearGpe (GpeEventInfo); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to clear GPE[0x%2X]", GpeNumber)); - return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); - } + (void) AcpiEvFinishGpe (GpeEventInfo); } break; case ACPI_GPE_DISPATCH_METHOD: - - /* - * Disable the GPE, so it doesn't keep firing before the method has a - * chance to run (it runs asynchronously with interrupts enabled). - */ - Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to disable GPE[0x%2X]", GpeNumber)); - return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED); - } + case ACPI_GPE_DISPATCH_NOTIFY: /* * Execute the method associated with the GPE @@ -717,7 +867,7 @@ AcpiEvGpeDispatch ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Unable to queue handler for GPE[0x%2X] - event disabled", + "Unable to queue handler for GPE%02X - event disabled", GpeNumber)); } break; @@ -730,20 +880,8 @@ AcpiEvGpeDispatch ( * a GPE to be enabled if it has no handler or method. */ ACPI_ERROR ((AE_INFO, - "No handler or method for GPE[0x%2X], disabling event", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 00:00:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00FC106566B; Thu, 16 Dec 2010 00:00:28 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE8808FC12; Thu, 16 Dec 2010 00:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG00SQi001220; Thu, 16 Dec 2010 00:00:28 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG00SJK001218; Thu, 16 Dec 2010 00:00:28 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201012160000.oBG00SJK001218@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 16 Dec 2010 00:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216472 - head/sbin/geom/class/virstor X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 00:00:28 -0000 Author: obrien Date: Thu Dec 16 00:00:28 2010 New Revision: 216472 URL: http://svn.freebsd.org/changeset/base/216472 Log: GEOM virstor .so does not need libmd. Modified: head/sbin/geom/class/virstor/Makefile Modified: head/sbin/geom/class/virstor/Makefile ============================================================================== --- head/sbin/geom/class/virstor/Makefile Wed Dec 15 23:48:45 2010 (r216471) +++ head/sbin/geom/class/virstor/Makefile Thu Dec 16 00:00:28 2010 (r216472) @@ -7,7 +7,4 @@ GEOM_CLASS= virstor SRCS+= binstream.c SRCS+= g_virstor_md.c -DPADD= ${LIBMD} -LDADD= -lmd - .include From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 00:36:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 241B0106566B; Thu, 16 Dec 2010 00:36:11 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECA7D8FC0C; Thu, 16 Dec 2010 00:36:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG0aAtl003540; Thu, 16 Dec 2010 00:36:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG0aAEh003539; Thu, 16 Dec 2010 00:36:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201012160036.oBG0aAEh003539@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 16 Dec 2010 00:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 00:36:11 -0000 Author: obrien Date: Thu Dec 16 00:36:10 2010 New Revision: 216473 URL: http://svn.freebsd.org/changeset/base/216473 Log: Bump WARNS to 6. Modified: head/sbin/geom/class/eli/Makefile Modified: head/sbin/geom/class/eli/Makefile ============================================================================== --- head/sbin/geom/class/eli/Makefile Thu Dec 16 00:00:28 2010 (r216472) +++ head/sbin/geom/class/eli/Makefile Thu Dec 16 00:36:10 2010 (r216473) @@ -11,7 +11,7 @@ SRCS+= sha2.c DPADD= ${LIBMD} ${LIBCRYPTO} LDADD= -lmd -lcrypto -WARNS?= 3 +WARNS?= 6 CFLAGS+=-I${.CURDIR}/../../../../sys From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 04:56:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B99106564A; Thu, 16 Dec 2010 04:56:04 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22B688FC19; Thu, 16 Dec 2010 04:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG4u4XT023105; Thu, 16 Dec 2010 04:56:04 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG4u4Ac023102; Thu, 16 Dec 2010 04:56:04 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012160456.oBG4u4Ac023102@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 16 Dec 2010 04:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216474 - in head/sys: conf mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 04:56:04 -0000 Author: jchandra Date: Thu Dec 16 04:56:03 2010 New Revision: 216474 URL: http://svn.freebsd.org/changeset/base/216474 Log: Make the ELF trampoline binary ELF executable (and do some cleanup). - Remove the -shared flag for the trampoline binary, generate an ELF executable instead of a shared object. - No need to generate tmphack.S, move the code to sys/mips/mips/inckern.S - No need generate opt_kernname.h, KERNNAME can be passed with -D Reviewed by: gonzo, imp Modified: head/sys/conf/Makefile.mips head/sys/mips/mips/elf_trampoline.c head/sys/mips/mips/inckern.S Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Thu Dec 16 00:36:10 2010 (r216473) +++ head/sys/conf/Makefile.mips Thu Dec 16 04:56:03 2010 (r216474) @@ -50,6 +50,7 @@ HACK_EXTRA_FLAGS=-shared # is extremely poor, as well as -mno-abicalls to force no ABI usage. CFLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) HACK_EXTRA_FLAGS+=${EXTRA_FLAGS} $(ARCH_FLAGS) +TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} $(ARCH_FLAGS) # XXX hardcoded kernel entry point ASM_CFLAGS+=${CFLAGS} -D_LOCORE -DLOCORE @@ -62,21 +63,10 @@ ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/ -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp sed s/${KERNLOADADDR}/${TRAMPLOADADDR}/ ${LDSCRIPT_NAME} | \ sed s/" + SIZEOF_HEADERS"// > ${LDSCRIPT_NAME}.tramp.noheader - # Generate .S file that setups stack and jumps to trampoline - echo "#include " >tmphack.S - echo "ENTRY(_start)" >>tmphack.S - echo "PTR_LA t0, kernel_end" >>tmphack.S - echo "move sp, t0" >>tmphack.S - echo "add sp, 0x2000" >>tmphack.S - echo "and sp, ~0x7" >>tmphack.S - echo "PTR_LA t0, _startC" >>tmphack.S - echo "j t0" >>tmphack.S - echo "END(_start)" >>tmphack.S - echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h - ${CC} -O -nostdlib -I. -I$S ${HACK_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ - -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader tmphack.S \ - $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \ - -o ${KERNEL_KO}.tramp.noheader + ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ + -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \ + -DKERNNAME="\"${KERNEL_KO}.tmp\"" $S/$M/$M/elf_trampoline.c \ + $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp.noheader ${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \ ${KERNEL_KO}.tramp.bin \ Modified: head/sys/mips/mips/elf_trampoline.c ============================================================================== --- head/sys/mips/mips/elf_trampoline.c Thu Dec 16 00:36:10 2010 (r216473) +++ head/sys/mips/mips/elf_trampoline.c Thu Dec 16 04:56:03 2010 (r216474) @@ -42,7 +42,10 @@ __FBSDID("$FreeBSD$"); * need to include opt_global.h manually. */ #include "opt_global.h" -#include "opt_kernname.h" + +#ifndef KERNNAME +#error Kernel name not provided +#endif extern char kernel_start[]; extern char kernel_end[]; Modified: head/sys/mips/mips/inckern.S ============================================================================== --- head/sys/mips/mips/inckern.S Thu Dec 16 00:36:10 2010 (r216473) +++ head/sys/mips/mips/inckern.S Thu Dec 16 04:56:03 2010 (r216474) @@ -22,10 +22,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "opt_kernname.h" - #include __FBSDID("$FreeBSD$") + +ENTRY(_start) + PTR_LA t0, kernel_end + move sp, t0 + add sp, 0x2000 + and sp, ~0x7 + PTR_LA t0, _startC + j t0 + nop +END(_start) + +#ifndef KERNNAME +#error Need a kernel name here +#endif + .section ".real_kernel","aw" .globl kernel_start; kernel_start: From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 05:13:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B845106564A; Thu, 16 Dec 2010 05:13:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6018FC16; Thu, 16 Dec 2010 05:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG5DfKx024086; Thu, 16 Dec 2010 05:13:41 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG5Dfhd024081; Thu, 16 Dec 2010 05:13:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201012160513.oBG5Dfhd024081@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 16 Dec 2010 05:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216475 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 05:13:41 -0000 Author: gonzo Date: Thu Dec 16 05:13:41 2010 New Revision: 216475 URL: http://svn.freebsd.org/changeset/base/216475 Log: - include argument should be in quotes Modified: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Thu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM Thu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include std.SWARM +include "std.SWARM" ident SWARM Modified: head/sys/mips/conf/SWARM64 ============================================================================== --- head/sys/mips/conf/SWARM64 Thu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM64 Thu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include std.SWARM +include "std.SWARM" ident SWARM64 Modified: head/sys/mips/conf/SWARM64_SMP ============================================================================== --- head/sys/mips/conf/SWARM64_SMP Thu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM64_SMP Thu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include std.SWARM +include "std.SWARM" ident SWARM64_SMP Modified: head/sys/mips/conf/SWARM_SMP ============================================================================== --- head/sys/mips/conf/SWARM_SMP Thu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM_SMP Thu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -include std.SWARM +include "std.SWARM" ident SWARM_SMP From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 07:20:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53019106566C; Thu, 16 Dec 2010 07:20:39 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 409EC8FC0A; Thu, 16 Dec 2010 07:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG7KdhE029619; Thu, 16 Dec 2010 07:20:39 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG7Kdhm029613; Thu, 16 Dec 2010 07:20:39 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201012160720.oBG7Kdhm029613@svn.freebsd.org> From: Juli Mallett Date: Thu, 16 Dec 2010 07:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216476 - in head/sys: contrib/octeon-sdk mips/cavium/octe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 07:20:39 -0000 Author: jmallett Date: Thu Dec 16 07:20:38 2010 New Revision: 216476 URL: http://svn.freebsd.org/changeset/base/216476 Log: o) Add support for the Lanner MR-321X/MR-325, which is just a modified MR-320. o) On the Lanner MR-730, disable PCIe lane swap, per vendor. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c head/sys/contrib/octeon-sdk/cvmx-pcie.c head/sys/mips/cavium/octe/ethernet-common.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Thu Dec 16 07:20:38 2010 (r216476) @@ -223,6 +223,7 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, #if defined(OCTEON_VENDOR_LANNER) CVMX_BOARD_TYPE_CUST_LANNER_MR320= 20002, + CVMX_BOARD_TYPE_CUST_LANNER_MR321X=20007, #endif CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, @@ -336,6 +337,7 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) #if defined(OCTEON_VENDOR_LANNER) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR320) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_LANNER_MR321X) #endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Dec 16 07:20:38 2010 (r216476) @@ -276,6 +276,7 @@ int cvmx_helper_board_get_mii_address(in return ipd_port; return -1; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: /* Port 0 is a Marvell 88E6161 switch, ports 1 and 2 are Marvell 88E1111 interfaces. */ switch (ipd_port) { @@ -417,6 +418,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo is_broadcom_phy = 1; break; case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: /* Port 0 connects to the switch */ if (ipd_port == 0) { @@ -860,6 +862,7 @@ cvmx_helper_board_usb_clock_types_t __cv case CVMX_BOARD_TYPE_LANAI2_G: #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: #endif return USB_CLOCK_TYPE_CRYSTAL_12; } Modified: head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-helper-rgmii.c Thu Dec 16 07:20:38 2010 (r216476) @@ -239,6 +239,7 @@ int __cvmx_helper_rgmii_enable(int inter #if defined(OCTEON_VENDOR_LANNER) switch (cvmx_sysinfo_get()->board_type) { case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: if (port == 0) { cvmx_write_csr(CVMX_ASXX_TX_CLK_SETX(port, interface), 4); } else { Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Thu Dec 16 07:20:38 2010 (r216476) @@ -392,7 +392,16 @@ static int __cvmx_pcie_rc_initialize_lin /* Lane swap needs to be manually enabled for CN52XX */ if (OCTEON_IS_MODEL(OCTEON_CN52XX) && (pcie_port == 1)) { - pescx_ctl_status.s.lane_swp = 1; + switch (cvmx_sysinfo_get()->board_type) + { +#if defined(OCTEON_VENDOR_LANNER) + case CVMX_BOARD_TYPE_CUST_LANNER_MR730: + break; +#endif + default: + pescx_ctl_status.s.lane_swp = 1; + break; + } cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port),pescx_ctl_status.u64); } Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Thu Dec 16 05:13:41 2010 (r216475) +++ head/sys/mips/cavium/octe/ethernet-common.c Thu Dec 16 07:20:38 2010 (r216476) @@ -294,6 +294,7 @@ int cvm_oct_common_init(struct ifnet *if switch (cvmx_sysinfo_get()->board_type) { #if defined(OCTEON_VENDOR_LANNER) case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: if (priv->phy_id == 16) cvm_oct_mv88e61xx_setup_device(ifp); break; From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 07:28:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636EC106566B; Thu, 16 Dec 2010 07:28:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5222B8FC0A; Thu, 16 Dec 2010 07:28:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG7SeMd029810; Thu, 16 Dec 2010 07:28:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG7SehW029808; Thu, 16 Dec 2010 07:28:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012160728.oBG7SehW029808@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 16 Dec 2010 07:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216477 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 07:28:40 -0000 Author: pjd Date: Thu Dec 16 07:28:40 2010 New Revision: 216477 URL: http://svn.freebsd.org/changeset/base/216477 Log: Log the fact of launching and include protocol version number. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Dec 16 07:20:38 2010 (r216476) +++ head/sbin/hastd/hastd.c Thu Dec 16 07:28:40 2010 (r216477) @@ -619,6 +619,9 @@ main_loop(void) PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGCHLD) == 0); + pjdlog_info("Started successfully, running protocol version %d.", + HAST_PROTO_VERSION); + for (;;) { while ((signo = sigtimedwait(&mask, NULL, &sigtimeout)) != -1) { switch (signo) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 07:29:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8486106566C; Thu, 16 Dec 2010 07:29:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D563D8FC16; Thu, 16 Dec 2010 07:29:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG7TwE5029876; Thu, 16 Dec 2010 07:29:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG7TwLB029874; Thu, 16 Dec 2010 07:29:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012160729.oBG7TwLB029874@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 16 Dec 2010 07:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216478 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 07:29:59 -0000 Author: pjd Date: Thu Dec 16 07:29:58 2010 New Revision: 216478 URL: http://svn.freebsd.org/changeset/base/216478 Log: Don't ignore errors from remote requests. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Dec 16 07:28:40 2010 (r216477) +++ head/sbin/hastd/primary.c Thu Dec 16 07:29:58 2010 (r216478) @@ -1445,7 +1445,7 @@ remote_recv_thread(void *arg) error = nv_get_int16(nv, "error"); if (error != 0) { /* Request failed on remote side. */ - hio->hio_errors[ncomp] = 0; + hio->hio_errors[ncomp] = error; nv_free(nv); goto done_queue; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 07:30:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB06D106566B; Thu, 16 Dec 2010 07:30:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F36D8FC17; Thu, 16 Dec 2010 07:30:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG7Ul7b029933; Thu, 16 Dec 2010 07:30:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG7UlfF029931; Thu, 16 Dec 2010 07:30:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012160730.oBG7UlfF029931@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 16 Dec 2010 07:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216479 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 07:30:47 -0000 Author: pjd Date: Thu Dec 16 07:30:47 2010 New Revision: 216479 URL: http://svn.freebsd.org/changeset/base/216479 Log: Improve problems logging. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Dec 16 07:29:58 2010 (r216478) +++ head/sbin/hastd/primary.c Thu Dec 16 07:30:47 2010 (r216479) @@ -1135,6 +1135,16 @@ local_send_thread(void *arg) /* * If READ failed, try to read from remote node. */ + if (ret < 0) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s), trying remote node. ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd), trying remote node. ", + (intmax_t)ret, + (intmax_t)ggio->gctl_length); + } QUEUE_INSERT1(hio, send, rncomp); continue; } @@ -1143,28 +1153,43 @@ local_send_thread(void *arg) ret = pwrite(res->hr_localfd, ggio->gctl_data, ggio->gctl_length, ggio->gctl_offset + res->hr_localoff); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else if (ret != ggio->gctl_length) + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { hio->hio_errors[ncomp] = EIO; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd): ", + (intmax_t)ret, (intmax_t)ggio->gctl_length); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_DELETE: ret = g_delete(res->hr_localfd, ggio->gctl_offset + res->hr_localoff, ggio->gctl_length); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_FLUSH: ret = g_flush(res->hr_localfd); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; } if (refcount_release(&hio->hio_countdown)) { @@ -1446,6 +1471,8 @@ remote_recv_thread(void *arg) if (error != 0) { /* Request failed on remote side. */ hio->hio_errors[ncomp] = error; + reqlog(LOG_WARNING, 0, &hio->hio_ggio, + "Remote request failed (%s): ", strerror(error)); nv_free(nv); goto done_queue; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 09:49:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3BD106566C; Thu, 16 Dec 2010 09:49:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DFB48FC19; Thu, 16 Dec 2010 09:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBG9nGGp032991; Thu, 16 Dec 2010 09:49:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBG9nGki032989; Thu, 16 Dec 2010 09:49:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012160949.oBG9nGki032989@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Dec 2010 09:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216480 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 09:49:16 -0000 Author: tuexen Date: Thu Dec 16 09:49:16 2010 New Revision: 216480 URL: http://svn.freebsd.org/changeset/base/216480 Log: Add a missing cast. Reported by blade_ly at yahoo.com.cn. MFC after: 1 day. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 16 07:30:47 2010 (r216479) +++ head/sys/netinet/sctp_indata.c Thu Dec 16 09:49:16 2010 (r216480) @@ -1754,7 +1754,7 @@ sctp_process_a_data_chunk(struct sctp_tc asoc->fragmented_delivery_inprogress == 0 && TAILQ_EMPTY(&asoc->resetHead) && ((ordered == 0) || - ((asoc->strmin[strmno].last_sequence_delivered + 1) == strmseq && + ((uint16_t) (asoc->strmin[strmno].last_sequence_delivered + 1) == strmseq && TAILQ_EMPTY(&asoc->strmin[strmno].inqueue)))) { /* Candidate for express delivery */ /* From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 11:20:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B20C9106566B; Thu, 16 Dec 2010 11:20:37 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A005D8FC16; Thu, 16 Dec 2010 11:20:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGBKbGQ047363; Thu, 16 Dec 2010 11:20:37 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGBKbSa047358; Thu, 16 Dec 2010 11:20:37 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012161120.oBGBKbSa047358@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 16 Dec 2010 11:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216482 - head/contrib/bsnmp/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 11:20:37 -0000 Author: syrinx Date: Thu Dec 16 11:20:37 2010 New Revision: 216482 URL: http://svn.freebsd.org/changeset/base/216482 Log: Silence the compiler warnings in libbsnmp by removing several (now) unsed parameters. Sponsored by: The FreeBSD Foundation Reviewed by: philip@ Modified: head/contrib/bsnmp/lib/snmp.c head/contrib/bsnmp/lib/snmpcrypto.c head/contrib/bsnmp/lib/snmppriv.h Modified: head/contrib/bsnmp/lib/snmp.c ============================================================================== --- head/contrib/bsnmp/lib/snmp.c Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmp.c Thu Dec 16 11:20:37 2010 (r216482) @@ -640,7 +640,7 @@ snmp_pdu_decode_secmode(struct asn_buf * (pdu->flags & SNMP_MSG_AUTH_FLAG) == 0) return (SNMP_CODE_BADSECLEVEL); - if ((code = snmp_pdu_calc_digest(b, pdu, digest)) != + if ((code = snmp_pdu_calc_digest(pdu, digest)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); @@ -659,7 +659,7 @@ snmp_pdu_decode_secmode(struct asn_buf * (pdu->flags & SNMP_MSG_PRIV_FLAG) == 0) return (SNMP_CODE_BADSECLEVEL); - if ((code = snmp_pdu_decrypt(b, pdu)) != SNMP_CODE_OK) + if ((code = snmp_pdu_decrypt(pdu)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); return (code); @@ -869,7 +869,7 @@ snmp_fix_encoding(struct asn_buf *b, str if (pdu->security_model != SNMP_SECMODEL_USM) return (SNMP_CODE_FAILED); - if (snmp_pdu_encrypt(b, pdu) != SNMP_CODE_OK) + if (snmp_pdu_encrypt(pdu) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV && @@ -884,7 +884,7 @@ snmp_fix_encoding(struct asn_buf *b, str pdu->digest_ptr -= moved; if (pdu->version == SNMP_V3) { - if ((code = snmp_pdu_calc_digest(b, pdu, pdu->msg_digest)) != + if ((code = snmp_pdu_calc_digest(pdu, pdu->msg_digest)) != SNMP_CODE_OK) return (SNMP_CODE_FAILED); Modified: head/contrib/bsnmp/lib/snmpcrypto.c ============================================================================== --- head/contrib/bsnmp/lib/snmpcrypto.c Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmpcrypto.c Thu Dec 16 11:20:37 2010 (r216482) @@ -87,8 +87,7 @@ snmp_digest_init(const struct snmp_user } enum snmp_code -snmp_pdu_calc_digest(struct asn_buf *b, const struct snmp_pdu *pdu, - uint8_t *digest) +snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest) { uint8_t md[EVP_MAX_MD_SIZE], extkey[SNMP_EXTENDED_KEY_SIZ]; uint8_t key1[SNMP_EXTENDED_KEY_SIZ], key2[SNMP_EXTENDED_KEY_SIZ]; @@ -140,7 +139,7 @@ failed: static int32_t snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len, - EVP_CIPHER_CTX *ctx, const EVP_CIPHER **ctype, uint8_t *piv) + const EVP_CIPHER **ctype, uint8_t *piv) { int i; uint32_t netint; @@ -172,14 +171,14 @@ snmp_pdu_cipher_init(const struct snmp_p } enum snmp_code -snmp_pdu_encrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +snmp_pdu_encrypt(const struct snmp_pdu *pdu) { int32_t err, olen; uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; const EVP_CIPHER *ctype; EVP_CIPHER_CTX ctx; - err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv); if (err < 0) return (SNMP_CODE_EDECRYPT); else if (err == 0) @@ -200,14 +199,14 @@ snmp_pdu_encrypt(struct asn_buf *b, cons } enum snmp_code -snmp_pdu_decrypt(struct asn_buf *b, const struct snmp_pdu *pdu) +snmp_pdu_decrypt(const struct snmp_pdu *pdu) { int32_t err, olen; uint8_t iv[SNMP_PRIV_AES_IV_SIZ]; const EVP_CIPHER *ctype; EVP_CIPHER_CTX ctx; - err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctx, &ctype, iv); + err = snmp_pdu_cipher_init(pdu, pdu->scoped_len, &ctype, iv); if (err < 0) return (SNMP_CODE_EDECRYPT); else if (err == 0) @@ -310,8 +309,8 @@ snmp_get_local_keys(struct snmp_user *us enum snmp_code snmp_calc_keychange(struct snmp_user *user, uint8_t *keychange) { - int32_t i, err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4]; - uint32_t keylen, olen; + int32_t err, rvalue[SNMP_AUTH_HMACSHA_KEY_SIZ / 4]; + uint32_t i, keylen, olen; const EVP_MD *dtype; EVP_MD_CTX ctx; @@ -340,8 +339,7 @@ snmp_calc_keychange(struct snmp_user *us #else /* !HAVE_LIBCRYPTO */ enum snmp_code -snmp_pdu_calc_digest(struct asn_buf *b __unused, const struct snmp_pdu *pdu, - uint8_t *digest __unused) +snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest __unused) { if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH) return (SNMP_CODE_BADSECLEVEL); @@ -351,7 +349,7 @@ snmp_pdu_calc_digest(struct asn_buf *b _ } enum snmp_code -snmp_pdu_encrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +snmp_pdu_encrypt(const struct snmp_pdu *pdu) { if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) return (SNMP_CODE_BADSECLEVEL); @@ -360,7 +358,7 @@ snmp_pdu_encrypt(struct asn_buf *b __unu } enum snmp_code -snmp_pdu_decrypt(struct asn_buf *b __unused, const struct snmp_pdu *pdu) +snmp_pdu_decrypt(const struct snmp_pdu *pdu) { if (pdu->user.priv_proto != SNMP_PRIV_NOPRIV) return (SNMP_CODE_BADSECLEVEL); Modified: head/contrib/bsnmp/lib/snmppriv.h ============================================================================== --- head/contrib/bsnmp/lib/snmppriv.h Thu Dec 16 10:58:45 2010 (r216481) +++ head/contrib/bsnmp/lib/snmppriv.h Thu Dec 16 11:20:37 2010 (r216482) @@ -41,10 +41,9 @@ enum asn_err snmp_parse_pdus_hdr(struct void snmp_pdu_init_secparams(struct snmp_pdu *, struct snmp_engine *, struct snmp_user *); -enum snmp_code snmp_pdu_calc_digest(struct asn_buf *, const struct snmp_pdu *, - uint8_t *); -enum snmp_code snmp_pdu_encrypt(struct asn_buf *, const struct snmp_pdu *); -enum snmp_code snmp_pdu_decrypt(struct asn_buf *, const struct snmp_pdu *); +enum snmp_code snmp_pdu_calc_digest(const struct snmp_pdu *, uint8_t *); +enum snmp_code snmp_pdu_encrypt(const struct snmp_pdu *); +enum snmp_code snmp_pdu_decrypt(const struct snmp_pdu *); #define DEFAULT_HOST "localhost" #define DEFAULT_PORT "snmp" From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 11:58:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F4C31065675; Thu, 16 Dec 2010 11:58:51 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7D08FC0C; Thu, 16 Dec 2010 11:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGBwoxl051711; Thu, 16 Dec 2010 11:58:50 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGBwoep051709; Thu, 16 Dec 2010 11:58:50 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012161158.oBGBwoep051709@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 16 Dec 2010 11:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216483 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 11:58:51 -0000 Author: syrinx Date: Thu Dec 16 11:58:50 2010 New Revision: 216483 URL: http://svn.freebsd.org/changeset/base/216483 Log: libbsnmp was moved to usr/lib Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Dec 16 11:20:37 2010 (r216482) +++ head/ObsoleteFiles.inc Thu Dec 16 11:58:50 2010 (r216483) @@ -284,6 +284,8 @@ OLD_FILES+=usr/share/man/man9/ieee80211_ OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz # 20090801: vimage.h removed in favour of vnet.h OLD_FILES+=usr/include/sys/vimage.h +# 20101208: libbsnmp was moved to usr/lib +OLD_LIBS+=lib/libbsnmp.so.5 # 20090719: library version bump for 8.0 OLD_LIBS+=lib/libalias.so.6 OLD_LIBS+=lib/libavl.so.1 From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 14:25:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372B3106575B; Thu, 16 Dec 2010 14:25:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB7E8FC0A; Thu, 16 Dec 2010 14:25:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 0B26D41C6B4; Thu, 16 Dec 2010 15:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ypKUzdRJkd9W; Thu, 16 Dec 2010 15:25:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 8AC0C41C6A7; Thu, 16 Dec 2010 15:25:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 232304448F3; Thu, 16 Dec 2010 14:22:30 +0000 (UTC) Date: Thu, 16 Dec 2010 14:22:30 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org In-Reply-To: <201012161158.oBGBwoep051709@svn.freebsd.org> Message-ID: <20101216135547.B6126@maildrop.int.zabbadoz.net> References: <201012161158.oBGBwoep051709@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216483 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 14:25:08 -0000 On Thu, 16 Dec 2010, Shteryana Shopova wrote: Hi, this is not directly related to this commit but I admit I looked at it before the commit and hadn't spotted it from just the diff and am hell of confused now that I look at the final result basically because I hadn;t realy looked at the file in a while. The file says: # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. but it seems since 2007 only few people actually followed this (and I guess I didn't either allways) and the best we try is: 1. order by date 2. if lucky go by the above rules for the entry under a given date. This probably is because everyone stopped reading after the 2nd sentence which says "Recently removed entries first (with the date as a comment).". You can check http://svn.freebsd.org/viewvc/base/head/ObsoleteFiles.inc?annotate=148330&pathrev=216483 to see how it was originally designed to be. So this commit actually tried to do it right, kind of and was just trapped on the intermediate breakage, not making it better or worse. I am happy people have lately started to care about duplicates etc. but can we fix the description or enforce a proper ordering as well to avoid further confusion like this. I think grouping by date and then by file/lib/dir is actually better as it'll keep things logically together rather than possibly splitting it over 3 sections? I would suggest if we'd formerlly switch, that we will create a bar line for everything below the current one with a comment along the lines of: ######################################################################## # # Everything below was supposed to be in 3 different sections with all # OLD_FILES first, followed by all OLD_LIBS and all OLD_DIRS last (which # didn't work out well). Do not touch it unless you really need to. # And adopting the comment at the top to say something along the lines: # The file is chronologically sorted with newest entries at the top. # For a certain date one may add multiple different entries in which # case they should be sorted in order of commits with the latest one # first, e.g. # # 20101216 remove baz # ... # # 20101216 remove bar # ... # # 20101216 remove foo # ... # Each such entry should list OLD_FILES first, OLD_LIBS second and # OLD_DIRS last, e.g. # # 20101216 remove baz # OLD_LIBS+= /lib/libkvm.so.5 # # 20101216 remove bar # OLD_FILES+= /bin/sh # OLD_DIRS+= /dev # # 20101216 remove foo # OLD_FILES+= /boot/kernel/kernel # OLD_FIELS+= /boot/loader # OLD_FILES+= /sbin/init # OLD_FILES+= /usr/lib/libc.a # OLD_LIBS+= /lib/libc.so.7 # OLD_DIRS+= /root You get the idea. Any takers? > Author: syrinx > Date: Thu Dec 16 11:58:50 2010 > New Revision: 216483 > URL: http://svn.freebsd.org/changeset/base/216483 > > Log: > libbsnmp was moved to usr/lib > > Modified: > head/ObsoleteFiles.inc > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Thu Dec 16 11:20:37 2010 (r216482) > +++ head/ObsoleteFiles.inc Thu Dec 16 11:58:50 2010 (r216483) > @@ -284,6 +284,8 @@ OLD_FILES+=usr/share/man/man9/ieee80211_ > OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz > # 20090801: vimage.h removed in favour of vnet.h > OLD_FILES+=usr/include/sys/vimage.h > +# 20101208: libbsnmp was moved to usr/lib > +OLD_LIBS+=lib/libbsnmp.so.5 > # 20090719: library version bump for 8.0 > OLD_LIBS+=lib/libalias.so.6 > OLD_LIBS+=lib/libavl.so.1 > -- Bjoern A. Zeeb Welcome a new stage of life. Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 15:18:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 837CA106567A; Thu, 16 Dec 2010 15:18:53 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7233A8FC08; Thu, 16 Dec 2010 15:18:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGFIr5f063751; Thu, 16 Dec 2010 15:18:53 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGFIrkX063749; Thu, 16 Dec 2010 15:18:53 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201012161518.oBGFIrkX063749@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 16 Dec 2010 15:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216485 - head/usr.sbin/bsnmpd/bsnmpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 15:18:53 -0000 Author: syrinx Date: Thu Dec 16 15:18:53 2010 New Revision: 216485 URL: http://svn.freebsd.org/changeset/base/216485 Log: Pass proper -Wl,-export-dynamic to ld. Thus bsnmpd(1) compiled with clang properly exports its symbols to the modules. Submitted by: dim Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile Modified: head/usr.sbin/bsnmpd/bsnmpd/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/bsnmpd/Makefile Thu Dec 16 14:57:06 2010 (r216484) +++ head/usr.sbin/bsnmpd/bsnmpd/Makefile Thu Dec 16 15:18:53 2010 (r216485) @@ -31,7 +31,7 @@ CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES DPADD= ${LIBBEGEMOT} ${LIBBSNMP} ${LIBWRAP} LDADD= -lbegemot -lbsnmp -lwrap -LDFLAGS= -export-dynamic +LDFLAGS= -Wl,-export-dynamic .if ${MK_OPENSSL} != "no" CFLAGS+= -DHAVE_LIBCRYPTO From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 15:19:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5B11065674; Thu, 16 Dec 2010 15:19:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7999C8FC16; Thu, 16 Dec 2010 15:19:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGFJWME063817; Thu, 16 Dec 2010 15:19:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGFJWC8063814; Thu, 16 Dec 2010 15:19:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161519.oBGFJWC8063814@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 15:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216486 - head/sys/dev/if_ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 15:19:32 -0000 Author: jhb Date: Thu Dec 16 15:19:32 2010 New Revision: 216486 URL: http://svn.freebsd.org/changeset/base/216486 Log: Use bus_alloc_resource_any() instead of bus_alloc_resource(). Besides being cleaner, this fixes problems where the code was using ~0 instead of ~0ul for the upper bound on "any" resources. MFC after: 1 month Modified: head/sys/dev/if_ndis/if_ndis_pccard.c head/sys/dev/if_ndis/if_ndis_pci.c Modified: head/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pccard.c Thu Dec 16 15:18:53 2010 (r216485) +++ head/sys/dev/if_ndis/if_ndis_pccard.c Thu Dec 16 15:19:32 2010 (r216486) @@ -198,9 +198,8 @@ ndis_attach_pccard(dev) resource_list_init(&sc->ndis_rl); sc->ndis_io_rid = 0; - sc->ndis_res_io = bus_alloc_resource(dev, - SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->ndis_io_rid, RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -213,8 +212,7 @@ ndis_attach_pccard(dev) rman_get_size(sc->ndis_res_io)); rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 16 15:18:53 2010 (r216485) +++ head/sys/dev/if_ndis/if_ndis_pci.c Thu Dec 16 15:19:32 2010 (r216486) @@ -192,9 +192,9 @@ ndis_attach_pci(dev) switch (rle->type) { case SYS_RES_IOPORT: sc->ndis_io_rid = rle->rid; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -214,10 +214,10 @@ ndis_attach_pci(dev) if (sc->ndis_res_mem) { sc->ndis_altmem_rid = rle->rid; sc->ndis_res_altmem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_altmem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_altmem == NULL) { device_printf(dev, "couldn't map alt " @@ -228,10 +228,10 @@ ndis_attach_pci(dev) } else { sc->ndis_mem_rid = rle->rid; sc->ndis_res_mem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_mem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_mem == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -243,9 +243,9 @@ ndis_attach_pci(dev) break; case SYS_RES_IRQ: rid = rle->rid; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); @@ -270,8 +270,8 @@ ndis_attach_pci(dev) */ if (sc->ndis_irq == NULL) { rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't route interrupt\n"); error = ENXIO; From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 15:27:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAFA2106564A; Thu, 16 Dec 2010 15:27:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A2958FC12; Thu, 16 Dec 2010 15:27:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGFRDWu064212; Thu, 16 Dec 2010 15:27:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGFRDWw064210; Thu, 16 Dec 2010 15:27:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161527.oBGFRDWw064210@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 15:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216487 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 15:27:13 -0000 Author: jhb Date: Thu Dec 16 15:27:13 2010 New Revision: 216487 URL: http://svn.freebsd.org/changeset/base/216487 Log: Pass JFLAG as JFLAG from tinderbox to universe. This gives the same semantics for JFLAG with tinderbox as for universe. Previously doing 'make JFLAG=-j4 tinderbox' was equivalent to 'make -j4 universe' (i.e. 4 worlds in parallel) rather than 'make JFLAG=-j4 universe' (i.e. worlds in sequence, each built with -j4). MFC after: 1 month Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Dec 16 15:19:32 2010 (r216486) +++ head/Makefile Thu Dec 16 15:27:13 2010 (r216487) @@ -271,7 +271,7 @@ make: .PHONY tinderbox: cd ${.CURDIR} && \ - DOING_TINDERBOX=YES ${MAKE} ${JFLAG} universe + DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # # universe From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 16:55:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB84106564A; Thu, 16 Dec 2010 16:55:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8E08FC08; Thu, 16 Dec 2010 16:55:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGGtMtP068478; Thu, 16 Dec 2010 16:55:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGGtMjB068476; Thu, 16 Dec 2010 16:55:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161655.oBGGtMjB068476@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 16:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216488 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 16:55:23 -0000 Author: jhb Date: Thu Dec 16 16:55:22 2010 New Revision: 216488 URL: http://svn.freebsd.org/changeset/base/216488 Log: Spelling fix. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Thu Dec 16 15:27:13 2010 (r216487) +++ head/sys/dev/acpica/acpi.c Thu Dec 16 16:55:22 2010 (r216488) @@ -1633,7 +1633,7 @@ acpi_probe_children(device_t bus) ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n")); bus_generic_probe(bus); - /* Probe/attach all children, created staticly and from the namespace. */ + /* Probe/attach all children, created statically and from the namespace. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n")); bus_generic_attach(bus); From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 16:56:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C4271065673; Thu, 16 Dec 2010 16:56:44 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A7D88FC1F; Thu, 16 Dec 2010 16:56:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGGuiUD068584; Thu, 16 Dec 2010 16:56:44 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGGuig4068582; Thu, 16 Dec 2010 16:56:44 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201012161656.oBGGuig4068582@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 16 Dec 2010 16:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216489 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 16:56:44 -0000 Author: jh Date: Thu Dec 16 16:56:44 2010 New Revision: 216489 URL: http://svn.freebsd.org/changeset/base/216489 Log: If dlclose() is called recursively from a _fini() function, the inner dlclose() call may unload the object of the outer call prematurely because objects are unreferenced before _fini() calls. Fix this by unreferencing objects after calling objlist_call_fini() in dlclose(). Therefore objlist_call_fini() now calls the fini function if the reference count of an object is 1. In addition we must restart the list_fini traversal after every _fini() call because another dlclose() call might have modified the reference counts. Add an XXX comment to objlist_call_fini() about possible race with dlopen(). PR: 133246, 149464 Reviewed by: kan, kib Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Thu Dec 16 16:55:22 2010 (r216488) +++ head/libexec/rtld-elf/rtld.c Thu Dec 16 16:56:44 2010 (r216489) @@ -110,7 +110,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, const Obj_Entry *, int); static Obj_Entry *obj_from_addr(const void *); -static void objlist_call_fini(Objlist *, bool, int *); +static void objlist_call_fini(Objlist *, Obj_Entry *, int *); static void objlist_call_init(Objlist *, int *); static void objlist_clear(Objlist *); static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *); @@ -1609,36 +1609,56 @@ obj_from_addr(const void *addr) /* * Call the finalization functions for each of the objects in "list" - * which are unreferenced. All of the objects are expected to have - * non-NULL fini functions. + * belonging to the DAG of "root" and referenced once. If NULL "root" + * is specified, every finalization function will be called regardless + * of the reference count and the list elements won't be freed. All of + * the objects are expected to have non-NULL fini functions. */ static void -objlist_call_fini(Objlist *list, bool force, int *lockstate) +objlist_call_fini(Objlist *list, Obj_Entry *root, int *lockstate) { - Objlist_Entry *elm, *elm_tmp; + Objlist_Entry *elm; char *saved_msg; + assert(root == NULL || root->refcount == 1); + /* * Preserve the current error message since a fini function might * call into the dynamic linker and overwrite it. */ saved_msg = errmsg_save(); - STAILQ_FOREACH_SAFE(elm, list, link, elm_tmp) { - if (elm->obj->refcount == 0 || force) { + do { + STAILQ_FOREACH(elm, list, link) { + if (root != NULL && (elm->obj->refcount != 1 || + objlist_find(&root->dagmembers, elm->obj) == NULL)) + continue; dbg("calling fini function for %s at %p", elm->obj->path, (void *)elm->obj->fini); LD_UTRACE(UTRACE_FINI_CALL, elm->obj, (void *)elm->obj->fini, 0, 0, elm->obj->path); /* Remove object from fini list to prevent recursive invocation. */ STAILQ_REMOVE(list, elm, Struct_Objlist_Entry, link); + /* + * XXX: If a dlopen() call references an object while the + * fini function is in progress, we might end up trying to + * unload the referenced object in dlclose() or the object + * won't be unloaded although its fini function has been + * called. + */ wlock_release(rtld_bind_lock, *lockstate); call_initfini_pointer(elm->obj, elm->obj->fini); *lockstate = wlock_acquire(rtld_bind_lock); /* No need to free anything if process is going down. */ - if (!force) + if (root != NULL) free(elm); + /* + * We must restart the list traversal after every fini call + * because a dlclose() call from the fini function or from + * another thread might have modified the reference counts. + */ + break; } - } + } while (elm != NULL); errmsg_restore(saved_msg); } @@ -1826,7 +1846,7 @@ rtld_exit(void) lockstate = wlock_acquire(rtld_bind_lock); dbg("rtld_exit()"); - objlist_call_fini(&list_fini, true, &lockstate); + objlist_call_fini(&list_fini, NULL, &lockstate); /* No need to remove the items from the list, since we are exiting. */ if (!libmap_disable) lm_fini(); @@ -1939,20 +1959,22 @@ dlclose(void *handle) /* Unreference the object and its dependencies. */ root->dl_refcount--; - unref_dag(root); - - if (root->refcount == 0) { + if (root->refcount == 1) { /* - * The object is no longer referenced, so we must unload it. + * The object will be no longer referenced, so we must unload it. * First, call the fini functions. */ - objlist_call_fini(&list_fini, false, &lockstate); + objlist_call_fini(&list_fini, root, &lockstate); + + unref_dag(root); /* Finish cleaning up the newly-unreferenced objects. */ GDB_STATE(RT_DELETE,&root->linkmap); unload_object(root); GDB_STATE(RT_CONSISTENT,NULL); - } + } else + unref_dag(root); + LD_UTRACE(UTRACE_DLCLOSE_STOP, handle, NULL, 0, 0, NULL); wlock_release(rtld_bind_lock, lockstate); return 0; From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 17:05:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DEC8106566C; Thu, 16 Dec 2010 17:05:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF6D8FC0A; Thu, 16 Dec 2010 17:05:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGH5Skt069036; Thu, 16 Dec 2010 17:05:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGH5SdC069032; Thu, 16 Dec 2010 17:05:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161705.oBGH5SdC069032@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 17:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216490 - in head/sys: dev/acpica x86/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:05:28 -0000 Author: jhb Date: Thu Dec 16 17:05:28 2010 New Revision: 216490 URL: http://svn.freebsd.org/changeset/base/216490 Log: Small style fixes: - Avoid side-effect assignments in if statements when possible. - Don't use ! to check for NULL pointers, explicitly check against NULL. - Explicitly check error return values against 0. - Don't use INTR_MPSAFE for interrupt handlers with only filters as it is meaningless. - Remove unneeded function casts. Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/x86/isa/atrtc.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Thu Dec 16 16:56:44 2010 (r216489) +++ head/sys/dev/acpica/acpi_hpet.c Thu Dec 16 17:05:28 2010 (r216490) @@ -558,16 +558,15 @@ hpet_attach(device_t dev) } if (t->irq >= 0) { t->intr_rid = hpet_find_irq_rid(dev, t->irq, t->irq); - if (!(t->intr_res = - bus_alloc_resource(dev, SYS_RES_IRQ, &t->intr_rid, - t->irq, t->irq, 1, RF_ACTIVE))) { + t->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &t->intr_rid, t->irq, t->irq, 1, RF_ACTIVE); + if (t->intr_res == NULL) { t->irq = -1; device_printf(dev, "Can't map interrupt for t%d.\n", i); - } else if ((bus_setup_intr(dev, t->intr_res, - INTR_MPSAFE | INTR_TYPE_CLK, - (driver_filter_t *)hpet_intr_single, NULL, - t, &t->intr_handle))) { + } else if (bus_setup_intr(dev, t->intr_res, + INTR_TYPE_CLK, hpet_intr_single, NULL, t, + &t->intr_handle) != 0) { t->irq = -1; device_printf(dev, "Can't setup interrupt for t%d.\n", i); @@ -614,13 +613,12 @@ hpet_attach(device_t dev) while (j > 0 && (cvectors & (1 << (j - 1))) != 0) j--; sc->intr_rid = hpet_find_irq_rid(dev, j, i); - if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->intr_rid, j, i, 1, RF_SHAREABLE | RF_ACTIVE))) - device_printf(dev,"Can't map interrupt.\n"); - else if ((bus_setup_intr(dev, sc->intr_res, - INTR_MPSAFE | INTR_TYPE_CLK, - (driver_filter_t *)hpet_intr, NULL, - sc, &sc->intr_handle))) { + sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, j, i, 1, RF_SHAREABLE | RF_ACTIVE); + if (sc->intr_res == NULL) + device_printf(dev, "Can't map interrupt.\n"); + else if (bus_setup_intr(dev, sc->intr_res, INTR_TYPE_CLK, + hpet_intr, NULL, sc, &sc->intr_handle) != 0) { device_printf(dev, "Can't setup interrupt.\n"); } else { sc->irq = rman_get_start(sc->intr_res); Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Thu Dec 16 16:56:44 2010 (r216489) +++ head/sys/x86/isa/atrtc.c Thu Dec 16 17:05:28 2010 (r216490) @@ -245,9 +245,10 @@ atrtc_attach(device_t dev) int i; sc = device_get_softc(dev); - if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->port_rid, IO_RTC, IO_RTC + 1, 2, RF_ACTIVE))) - device_printf(dev,"Warning: Couldn't map I/O.\n"); + sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, + IO_RTC, IO_RTC + 1, 2, RF_ACTIVE); + if (sc->port_res == NULL) + device_printf(dev, "Warning: Couldn't map I/O.\n"); atrtc_start(); clock_register(dev, 1000000); bzero(&sc->et, sizeof(struct eventtimer)); @@ -258,14 +259,13 @@ atrtc_attach(device_t dev) while (bus_get_resource(dev, SYS_RES_IRQ, sc->intr_rid, &s, NULL) == 0 && s != 8) sc->intr_rid++; - if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { - device_printf(dev,"Can't map interrupt.\n"); + sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, 8, 8, 1, RF_ACTIVE); + if (sc->intr_res == NULL) { + device_printf(dev, "Can't map interrupt.\n"); return (0); - } else if ((bus_setup_intr(dev, sc->intr_res, - INTR_MPSAFE | INTR_TYPE_CLK, - (driver_filter_t *)rtc_intr, NULL, - sc, &sc->intr_handler))) { + } else if ((bus_setup_intr(dev, sc->intr_res, INTR_TYPE_CLK, + rtc_intr, NULL, sc, &sc->intr_handler))) { device_printf(dev, "Can't setup interrupt.\n"); return (0); } else { From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 17:08:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E11E10656B2; Thu, 16 Dec 2010 17:08:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626C28FC16; Thu, 16 Dec 2010 17:08:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGH8hqP069228; Thu, 16 Dec 2010 17:08:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGH8hoN069226; Thu, 16 Dec 2010 17:08:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161708.oBGH8hoN069226@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 17:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216491 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:08:43 -0000 Author: jhb Date: Thu Dec 16 17:08:43 2010 New Revision: 216491 URL: http://svn.freebsd.org/changeset/base/216491 Log: - When moving the IRQ resource from the psmcpnp device to the psm device, delete the IRQ resource from the psmcpnp device completely. - Don't allocate the IRQ resource shared. It is not a shareable interrupt on ISA. The bus driver can set RF_SHAREABLE if the IRQ is actually shareable on a non-ISA bus. Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Dec 16 17:05:28 2010 (r216490) +++ head/sys/dev/atkbdc/psm.c Thu Dec 16 17:08:43 2010 (r216491) @@ -1105,6 +1105,7 @@ psmidentify(driver_t *driver, device_t p irq = bus_get_resource_start(psmc, SYS_RES_IRQ, 0); if (irq <= 0) return; + bus_delete_resource(psmc, SYS_RES_IRQ, 0); bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1); } @@ -1133,8 +1134,7 @@ psmprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intr == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -1438,8 +1438,7 @@ psmattach(device_t dev) /* Setup our interrupt handler */ rid = KBDC_RID_AUX; - sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intr == NULL) return (ENXIO); error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, psmintr, sc, @@ -4628,6 +4627,7 @@ create_a_copy(device_t atkbdc, device_t /* move our resource to the found device */ irq = bus_get_resource_start(me, SYS_RES_IRQ, 0); + bus_delete_resource(me, SYS_RES_IRQ, 0); bus_set_resource(psm, SYS_RES_IRQ, KBDC_RID_AUX, irq, 1); /* ...then probe and attach it */ @@ -4661,7 +4661,7 @@ psmcpnp_probe(device_t dev) "assuming irq %ld\n", irq); bus_set_resource(dev, SYS_RES_IRQ, rid, irq, 1); } - res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* keep quiet */ @@ -4675,22 +4675,12 @@ static int psmcpnp_attach(device_t dev) { device_t atkbdc; - int rid; /* find the keyboard controller, which may be on acpi* or isa* bus */ atkbdc = devclass_get_device(devclass_find(ATKBDC_DRIVER_NAME), device_get_unit(dev)); if ((atkbdc != NULL) && (device_get_state(atkbdc) == DS_ATTACHED)) create_a_copy(atkbdc, dev); - else { - /* - * If we don't have the AT keyboard controller yet, - * just reserve the IRQ for later use... - * (See psmidentify() above.) - */ - rid = 0; - bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE); - } return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 17:14:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7FE01065673; Thu, 16 Dec 2010 17:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D60CF8FC21; Thu, 16 Dec 2010 17:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGHEbSr069557; Thu, 16 Dec 2010 17:14:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGHEbLk069553; Thu, 16 Dec 2010 17:14:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012161714.oBGHEbLk069553@svn.freebsd.org> From: John Baldwin Date: Thu, 16 Dec 2010 17:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216492 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:14:38 -0000 Author: jhb Date: Thu Dec 16 17:14:37 2010 New Revision: 216492 URL: http://svn.freebsd.org/changeset/base/216492 Log: - If the atkbdc device is assigned an IRQ resource by ACPI or the PnPBIOS, allow the child atkbd device to reuse that IRQ resource instead of reallocating the same IRQ from the parent bus inside the atkbd driver. - Don't allocate a shared IRQ for the atkbd driver. For AT keyboard devices on an ISA bus the IRQ is not shareable. Instead, the bus driver should mark the IRQ shareable if the bus supports shared IRQs. - Don't identify child devices until after the atkbdc device itself has attached. Modified: head/sys/dev/atkbdc/atkbd_atkbdc.c head/sys/dev/atkbdc/atkbdc_isa.c head/sys/dev/atkbdc/atkbdcreg.h Modified: head/sys/dev/atkbdc/atkbd_atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbd_atkbdc.c Thu Dec 16 17:08:43 2010 (r216491) +++ head/sys/dev/atkbdc/atkbd_atkbdc.c Thu Dec 16 17:14:37 2010 (r216492) @@ -94,8 +94,7 @@ atkbdprobe(device_t dev) /* see if IRQ is available */ rid = KBDC_RID_KBD; - res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (res == NULL) { if (bootverbose) device_printf(dev, "unable to allocate IRQ\n"); @@ -132,8 +131,7 @@ atkbdattach(device_t dev) return error; /* declare our interrupt handler */ - sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + sc->intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (sc->intr == NULL) return ENXIO; error = bus_setup_intr(dev, sc->intr, INTR_TYPE_TTY, NULL, atkbdintr, Modified: head/sys/dev/atkbdc/atkbdc_isa.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_isa.c Thu Dec 16 17:08:43 2010 (r216491) +++ head/sys/dev/atkbdc/atkbdc_isa.c Thu Dec 16 17:14:37 2010 (r216492) @@ -49,6 +49,11 @@ static int atkbdc_isa_probe(device_t dev static int atkbdc_isa_attach(device_t dev); static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit); +static struct resource *atkbdc_isa_alloc_resource(device_t dev, device_t child, + int type, int *rid, u_long start, u_long end, + u_long count, u_int flags); +static int atkbdc_isa_release_resource(device_t dev, device_t child, + int type, int rid, struct resource *r); static device_method_t atkbdc_isa_methods[] = { DEVMETHOD(device_probe, atkbdc_isa_probe), @@ -61,8 +66,8 @@ static device_method_t atkbdc_isa_method DEVMETHOD(bus_read_ivar, atkbdc_read_ivar), DEVMETHOD(bus_write_ivar, atkbdc_write_ivar), DEVMETHOD(bus_get_resource_list,atkbdc_get_resource_list), - DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), + DEVMETHOD(bus_alloc_resource, atkbdc_isa_alloc_resource), + DEVMETHOD(bus_release_resource, atkbdc_isa_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), @@ -170,8 +175,6 @@ atkbdc_isa_probe(device_t dev) device_verbose(dev); error = atkbdc_probe_unit(device_get_unit(dev), port0, port1); - if (error == 0) - bus_generic_probe(dev); bus_release_resource(dev, SYS_RES_IOPORT, 0, port0); bus_release_resource(dev, SYS_RES_IOPORT, 1, port1); @@ -216,14 +219,25 @@ atkbdc_isa_attach(device_t dev) return ENXIO; } + /* + * If the device is not created by the PnP BIOS or ACPI, then + * the hint for the IRQ is on the child atkbd device, not the + * keyboard controller, so this can fail. + */ + rid = 0; + sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + error = atkbdc_attach_unit(unit, sc, sc->port0, sc->port1); if (error) { bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->port0); bus_release_resource(dev, SYS_RES_IOPORT, 1, sc->port1); + if (sc->irq != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq); return error; } *(atkbdc_softc_t **)device_get_softc(dev) = sc; + bus_generic_probe(dev); bus_generic_attach(dev); return 0; @@ -233,9 +247,11 @@ static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit) { atkbdc_device_t *ivar; + atkbdc_softc_t *sc; device_t child; int t; + sc = *(atkbdc_softc_t **)device_get_softc(bus); ivar = malloc(sizeof(struct atkbdc_device), M_ATKBDDEV, M_NOWAIT | M_ZERO); if (!ivar) @@ -251,15 +267,16 @@ atkbdc_isa_add_child(device_t bus, u_int ivar->rid = order; /* - * If the device is not created by the PnP BIOS or ACPI, - * refer to device hints for IRQ. + * If the device is not created by the PnP BIOS or ACPI, refer + * to device hints for IRQ. We always populate the resource + * list entry so we can use a standard bus_get_resource() + * method. */ - if (ISA_PNP_PROBE(device_get_parent(bus), bus, atkbdc_ids) != 0) { + if (sc->irq == NULL) { if (resource_int_value(name, unit, "irq", &t) != 0) t = -1; - } else { - t = bus_get_resource_start(bus, SYS_RES_IRQ, ivar->rid); - } + } else + t = rman_get_start(sc->irq); if (t > 0) resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid, t, t, 1); @@ -272,5 +289,30 @@ atkbdc_isa_add_child(device_t bus, u_int return child; } +struct resource * +atkbdc_isa_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + atkbdc_softc_t *sc; + + sc = *(atkbdc_softc_t **)device_get_softc(dev); + if (type == SYS_RES_IRQ && *rid == KBDC_RID_KBD && sc->irq != NULL) + return (sc->irq); + return (bus_generic_rl_alloc_resource(dev, child, type, rid, start, + end, count, flags)); +} + +static int +atkbdc_isa_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + atkbdc_softc_t *sc; + + sc = *(atkbdc_softc_t **)device_get_softc(dev); + if (type == SYS_RES_IRQ && rid == KBDC_RID_KBD && r == sc->irq) + return (0); + return (bus_generic_rl_release_resource(dev, child, type, rid, r)); +} + DRIVER_MODULE(atkbdc, isa, atkbdc_isa_driver, atkbdc_devclass, 0, 0); DRIVER_MODULE(atkbdc, acpi, atkbdc_isa_driver, atkbdc_devclass, 0, 0); Modified: head/sys/dev/atkbdc/atkbdcreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdcreg.h Thu Dec 16 17:08:43 2010 (r216491) +++ head/sys/dev/atkbdc/atkbdcreg.h Thu Dec 16 17:14:37 2010 (r216492) @@ -192,6 +192,7 @@ struct resource; typedef struct atkbdc_softc { struct resource *port0; /* data port */ struct resource *port1; /* status port */ + struct resource *irq; bus_space_tag_t iot; bus_space_handle_t ioh0; bus_space_handle_t ioh1; From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 17:25:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1439C1065697; Thu, 16 Dec 2010 17:25:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9EFE18FC0A; Thu, 16 Dec 2010 17:25:33 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3775746B2E; Thu, 16 Dec 2010 12:25:33 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5C8DC8A009; Thu, 16 Dec 2010 12:25:32 -0500 (EST) From: John Baldwin To: "David E. O'Brien" Date: Thu, 16 Dec 2010 12:25:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012160036.oBG0aAEh003539@svn.freebsd.org> In-Reply-To: <201012160036.oBG0aAEh003539@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012161225.31459.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 16 Dec 2010 12:25:32 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:25:34 -0000 On Wednesday, December 15, 2010 7:36:10 pm David E. O'Brien wrote: > Author: obrien > Date: Thu Dec 16 00:36:10 2010 > New Revision: 216473 > URL: http://svn.freebsd.org/changeset/base/216473 > > Log: > Bump WARNS to 6. > > Modified: > head/sbin/geom/class/eli/Makefile FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >>> stage 4.4: building everything [...] /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:898: warning: cast increases required alignment of target type /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:911: warning: cast increases required alignment of target type /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:912: warning: cast increases required alignment of target type /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:915: warning: cast increases required alignment of target type /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c: In function 'SHA512_Final': /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:919: warning: cast increases required alignment of target type /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c: In function 'SHA384_Final': /src/sbin/geom/class/eli/../../../../sys/crypto/sha2/sha2.c:994: warning: cast increases required alignment of target type -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 17:54:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69B3F106566B; Thu, 16 Dec 2010 17:54:56 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 586338FC12; Thu, 16 Dec 2010 17:54:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGHsuUj071654; Thu, 16 Dec 2010 17:54:56 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGHsu5d071652; Thu, 16 Dec 2010 17:54:56 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201012161754.oBGHsu5d071652@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 16 Dec 2010 17:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216493 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 17:54:56 -0000 Author: obrien Date: Thu Dec 16 17:54:56 2010 New Revision: 216493 URL: http://svn.freebsd.org/changeset/base/216493 Log: Revert r216473. WARNS=6 causes "warning: cast increases required alignment of target type" on arm, ia64, mips, and sparc64. Modified: head/sbin/geom/class/eli/Makefile Modified: head/sbin/geom/class/eli/Makefile ============================================================================== --- head/sbin/geom/class/eli/Makefile Thu Dec 16 17:14:37 2010 (r216492) +++ head/sbin/geom/class/eli/Makefile Thu Dec 16 17:54:56 2010 (r216493) @@ -11,7 +11,7 @@ SRCS+= sha2.c DPADD= ${LIBMD} ${LIBCRYPTO} LDADD= -lmd -lcrypto -WARNS?= 6 +WARNS?= 3 CFLAGS+=-I${.CURDIR}/../../../../sys From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 18:31:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F2D6106564A; Thu, 16 Dec 2010 18:31:07 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id F266B8FC13; Thu, 16 Dec 2010 18:31:06 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id oBGHtbWS052541; Thu, 16 Dec 2010 09:55:37 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id oBGHtaVk052540; Thu, 16 Dec 2010 09:55:36 -0800 (PST) (envelope-from obrien) Date: Thu, 16 Dec 2010 09:55:36 -0800 From: "David O'Brien" To: John Baldwin Message-ID: <20101216175536.GA52462@dragon.NUXI.org> References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012161225.31459.jhb@freebsd.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 18:31:07 -0000 On Thu, Dec 16, 2010 at 12:25:31PM -0500, John Baldwin wrote: > On Wednesday, December 15, 2010 7:36:10 pm David E. O'Brien wrote: > > Author: obrien > > Date: Thu Dec 16 00:36:10 2010 > > New Revision: 216473 > > URL: http://svn.freebsd.org/changeset/base/216473 > > > > Log: > > Bump WARNS to 6. > > > > Modified: > > head/sbin/geom/class/eli/Makefile > > FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. Errr. Reverted. I built it on the architectures I had access to... -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 18:54:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76C3E106564A; Thu, 16 Dec 2010 18:54:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 89BF78FC16; Thu, 16 Dec 2010 18:54:39 +0000 (UTC) Received: by wwf26 with SMTP id 26so2566113wwf.31 for ; Thu, 16 Dec 2010 10:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=L19pxa9f7wSX8i7kPMQkrlCFy6y8HQZwUlqOjSIrZDw=; b=mkLBXRJbjgoHw+iyE464kLyR5Vgu8BLpT+UixMDGiEwYyS6zr8HCJ1sGBvb0OqB5TN qtIRxGAK+6PZPZJYBKmiKONtyZe+6soJX+j5jc9MHCLMrfssa7TEgXoQNK7cqgqdrUv/ 4lV9Rv3YglxrstFVJDJsMJK3ta8j8UB5COIW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=QouqEe08/p6flYaOFwb95VTxZxundgLdQSCYbZsBnhxptr2q4FHUOucEl0c+gxNrNX Y8eqGEzYRrX36Y8qvNQEonuCscED+HtcqUw24YWtl1r4xDAtqmVDUekrzYJWt2PF/llg C8c4E+xV1mxT5jaskrvytPT4s+BuL/6rdukwk= MIME-Version: 1.0 Received: by 10.216.168.78 with SMTP id j56mr24587wel.45.1292525678439; Thu, 16 Dec 2010 10:54:38 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Thu, 16 Dec 2010 10:54:38 -0800 (PST) In-Reply-To: <201012161754.oBGHsu5d071652@svn.freebsd.org> References: <201012161754.oBGHsu5d071652@svn.freebsd.org> Date: Thu, 16 Dec 2010 10:54:38 -0800 X-Google-Sender-Auth: 4-wSstD1GwuGoMK3M5XQo5w-vtA Message-ID: From: Garrett Cooper To: "David E. O'Brien" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216493 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 18:54:40 -0000 On Thu, Dec 16, 2010 at 9:54 AM, David E. O'Brien wrot= e: > Author: obrien > Date: Thu Dec 16 17:54:56 2010 > New Revision: 216493 > URL: http://svn.freebsd.org/changeset/base/216493 > > Log: > =A0Revert r216473. > =A0WARNS=3D6 causes "warning: cast increases required alignment of target= type" > =A0on arm, ia64, mips, and sparc64. > > Modified: > =A0head/sbin/geom/class/eli/Makefile > > Modified: head/sbin/geom/class/eli/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/class/eli/Makefile =A0 Thu Dec 16 17:14:37 2010 =A0 = =A0 =A0 =A0(r216492) > +++ head/sbin/geom/class/eli/Makefile =A0 Thu Dec 16 17:54:56 2010 =A0 = =A0 =A0 =A0(r216493) > @@ -11,7 +11,7 @@ SRCS+=3D =A0 =A0 =A0 =A0sha2.c > =A0DPADD=3D ${LIBMD} ${LIBCRYPTO} > =A0LDADD=3D -lmd -lcrypto > > -WARNS?=3D =A0 =A0 =A0 =A06 > +WARNS?=3D =A0 =A0 =A0 =A03 > > =A0CFLAGS+=3D-I${.CURDIR}/../../../../sys I think it's actually safe to bump it to WARNS =3D 6 if you define NO_WCAST_ALIGN =3D 1, but that would need to be tested. Cheers, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 19:04:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 081EE106566C; Thu, 16 Dec 2010 19:04:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D76C08FC13; Thu, 16 Dec 2010 19:04:08 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 66EC346B2C; Thu, 16 Dec 2010 14:04:08 -0500 (EST) Date: Thu, 16 Dec 2010 19:04:08 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David O'Brien In-Reply-To: <20101216175536.GA52462@dragon.NUXI.org> Message-ID: References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 19:04:09 -0000 On Thu, 16 Dec 2010, David O'Brien wrote: >>> Log: >>> Bump WARNS to 6. >>> >>> Modified: >>> head/sbin/geom/class/eli/Makefile >> >> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. > > Errr. Reverted. I built it on the architectures I had access to... For WARNS-related changes, I generally use "make universe" to test across architectures. This builds all of our architectures world + all available kernels, and seems the most effective way to avoid the above situations. (I've fallen into exactly the same trap...) The one thing to be cautious about is that make universe won't fail if an individual build fails, so you need to check the logs to make sure everything actually succeeded. Robert From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 19:23:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F2D106566B; Thu, 16 Dec 2010 19:23:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 80B628FC12; Thu, 16 Dec 2010 19:23:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 347BE46B2C; Thu, 16 Dec 2010 14:23:05 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5D3038A01D; Thu, 16 Dec 2010 14:23:04 -0500 (EST) From: John Baldwin To: Robert Watson Date: Thu, 16 Dec 2010 14:22:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201012161422.48209.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 16 Dec 2010 14:23:04 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 19:23:05 -0000 On Thursday, December 16, 2010 2:04:08 pm Robert Watson wrote: > On Thu, 16 Dec 2010, David O'Brien wrote: > > >>> Log: > >>> Bump WARNS to 6. > >>> > >>> Modified: > >>> head/sbin/geom/class/eli/Makefile > >> > >> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. > > > > Errr. Reverted. I built it on the architectures I had access to... > > For WARNS-related changes, I generally use "make universe" to test across > architectures. This builds all of our architectures world + all available > kernels, and seems the most effective way to avoid the above situations. (I've > fallen into exactly the same trap...) > > The one thing to be cautious about is that make universe won't fail if an > individual build fails, so you need to check the logs to make sure everything > actually succeeded. Which is why I prefer 'make tinderbox' since it tells you what fails. :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 19:48:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF6C310656EA; Thu, 16 Dec 2010 19:48:03 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE7358FC1D; Thu, 16 Dec 2010 19:48:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGJm3Xs080159; Thu, 16 Dec 2010 19:48:03 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGJm3A5080157; Thu, 16 Dec 2010 19:48:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012161948.oBGJm3A5080157@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 16 Dec 2010 19:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216494 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 19:48:03 -0000 Author: pjd Date: Thu Dec 16 19:48:03 2010 New Revision: 216494 URL: http://svn.freebsd.org/changeset/base/216494 Log: The 'ret' variable is of type ssize_t and we use proper format for it (%zd), so no (bogus) cast is needed. MFC after: 3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Thu Dec 16 17:54:56 2010 (r216493) +++ head/sbin/hastd/primary.c Thu Dec 16 19:48:03 2010 (r216494) @@ -1142,8 +1142,7 @@ local_send_thread(void *arg) } else if (ret != ggio->gctl_length) { reqlog(LOG_WARNING, 0, ggio, "Local request failed (%zd != %jd), trying remote node. ", - (intmax_t)ret, - (intmax_t)ggio->gctl_length); + ret, (intmax_t)ggio->gctl_length); } QUEUE_INSERT1(hio, send, rncomp); continue; @@ -1162,7 +1161,7 @@ local_send_thread(void *arg) hio->hio_errors[ncomp] = EIO; reqlog(LOG_WARNING, 0, ggio, "Local request failed (%zd != %jd): ", - (intmax_t)ret, (intmax_t)ggio->gctl_length); + ret, (intmax_t)ggio->gctl_length); } else { hio->hio_errors[ncomp] = 0; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 20:23:21 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2DD5106564A; Thu, 16 Dec 2010 20:23:21 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 5E13C8FC13; Thu, 16 Dec 2010 20:23:21 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oBGKNJuT001916 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Dec 2010 21:23:20 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Thu, 16 Dec 2010 21:23:19 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: John Baldwin Message-ID: <20101216202319.GS23098@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , John Baldwin , Robert Watson , David O'Brien , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <201012161422.48209.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <201012161422.48209.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson , David O'Brien Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 20:23:22 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, 16.12.2010 at 14:22:47 -0500, John Baldwin wrote: > On Thursday, December 16, 2010 2:04:08 pm Robert Watson wrote: > > On Thu, 16 Dec 2010, David O'Brien wrote: > > > > >>> Log: > > >>> Bump WARNS to 6. > > >>> > > >>> Modified: > > >>> head/sbin/geom/class/eli/Makefile > > >> > > >> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. > > > > > > Errr. Reverted. I built it on the architectures I had access to... > > > > For WARNS-related changes, I generally use "make universe" to test across > > architectures. This builds all of our architectures world + all available > > kernels, and seems the most effective way to avoid the above situations. (I've > > fallen into exactly the same trap...) > > > > The one thing to be cautious about is that make universe won't fail if an > > individual build fails, so you need to check the logs to make sure everything > > actually succeeded. > > Which is why I prefer 'make tinderbox' since it tells you what fails. :) Shamless plug: the attached, crude expect(1) script allows you to do $ cd /usr/src && universe-build sbin/geom WARNS=6 with the minimal amount of compilation (you have to build the toolchain once, though). I found it invaluable. Regards, Uli --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=universe-build #!/usr/local/bin/expect # Does the following for variable subdirs and a given set of target archs, # exits upon first failure. # % cd /usr/src # % make toolchain TARGET=powerpc # % make buildenv TARGET=powerpc # %% cd usr.sbin/rwhod # %% make set timeout -1 set toolchain 0 proc usage {argv0} { send_user "usage: $argv0 -t \[target1 target2 ...\]\n" send_user " $argv0 subdir \[make-args\] \[target1 target2 ...\]\n" send_user "available targets: amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v\n" exit } while {[llength $argv]>0} { set flag [lindex $argv 0] switch -- $flag \ "-t" { set toolchain 1 set argv [lrange $argv 1 end] set argc [expr ($argc - 1)] } default { break } } if {$toolchain!=1} { if {$argc<1} { usage $argv0 exit 1 } set subdir [lindex $argv 0] set argv [lrange $argv 1 end] set argc [expr ($argc - 1)] # if something is present, use it as make args if {$argc>=1} { set margs [lindex $argv 0] set argv [lrange $argv 1 end] set argc [expr ($argc - 1)] } else { set margs {} } } # if there is still something, use it as target list, # else default to everything if {$argc>=1} { set targets [lrange $argv 0 end] } else { set input [open "|make universe -V TARGETS" r] set targets [split [string trimright [read $input]] " "] close $input } if {$toolchain==1} { foreach target $targets { spawn /bin/sh expect "$ " send "env MAKEOBJDIRPREFIX=/usr/obj/$target make toolchain __MAKE_CONF=/dev/null TARGET=$target\n" expect "$ " send "exit \$?\n" expect eof } puts "\n" exit } foreach target $targets { spawn /bin/sh set sid($target) $spawn_id expect "$ " send "env MAKEOBJDIRPREFIX=/usr/obj/$target make buildenv __MAKE_CONF=/dev/null TARGET=$target\n" expect "$ " send "make -C $subdir obj clean; make -C $subdir $margs\n" expect "$ " # 'make buildenv' is doing sh || true, so we cannot propagate by doing exit $rc # grab echo output instead send "echo rc=\$?; exit \$?\n" # this sucks, but we cant do (.*) and also not ([0-9]*) as these are special expect -re "rc=(0|1|2|3|4|5|6|7|8|9)\r" # TODO: save rc per target, don't exit below but print rcs for all archs on exit set rc $expect_out(1,string) expect "$ " send "exit \$?\n" expect eof if {$rc!=0} { puts "Build failed in ``$subdir'' for arch ``$target'' and flags: ``$margs''" exit $rc } ## if we expect eof, the wait below will not return, wtf? ## XXX sid($target) wont work here?? #catch {close -i $spawn_id} ## wait returns PID, TYPE, CODE, grab code #set rc [lindex [wait sid($target)] 3] } puts "\n" --1UWUbFP1cBYEclgG-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 20:26:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FB01065675; Thu, 16 Dec 2010 20:26:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 0E14D8FC13; Thu, 16 Dec 2010 20:26:17 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e841:2285:6770:a10c] (unknown [IPv6:2001:7b8:3a7:0:e841:2285:6770:a10c]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 17E875C43; Thu, 16 Dec 2010 21:26:16 +0100 (CET) Message-ID: <4D0A75EB.2080505@FreeBSD.org> Date: Thu, 16 Dec 2010 21:26:19 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.14pre) Gecko/20101211 Lanikai/3.1.8pre MIME-Version: 1.0 To: Garrett Cooper References: <201012161754.oBGHsu5d071652@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r216493 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 20:26:17 -0000 On 2010-12-16 19:54, Garrett Cooper wrote: >> -WARNS?= 6 >> +WARNS?= 3 >> >> CFLAGS+=-I${.CURDIR}/../../../../sys > > I think it's actually safe to bump it to WARNS = 6 if you define > NO_WCAST_ALIGN = 1, but that would need to be tested. I'm not sure if this SHA2 stuff is contributed code, but those warnings might actually indicate a problem, that needs to be fixed? From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 20:27:19 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CF3A106564A; Thu, 16 Dec 2010 20:27:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id CEDC88FC1C; Thu, 16 Dec 2010 20:27:17 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 35EEAA59D51; Fri, 17 Dec 2010 04:27:16 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id iNltITYPCKUg; Fri, 17 Dec 2010 04:27:10 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 4622FA59ABB; Fri, 17 Dec 2010 04:27:08 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:references:in-reply-to:x-enigmail-version:openpgp: content-type:content-transfer-encoding; b=lmZ5HyuRMA584TuuXoudvf/tew41nXXN+y0+yrpR1bWM2KrE5tQJUX1UJcGpOLqus pEC3rFoqj9875P/30LoVg== Message-ID: <4D0A7618.2080209@delphij.net> Date: Thu, 16 Dec 2010 12:27:04 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101210 Thunderbird/3.0.11 ThunderBrowse/3.3.4 MIME-Version: 1.0 To: =?UTF-8?B?VWxyaWNoIFNww7ZybGVpbg==?= , John Baldwin , Robert Watson , David O'Brien , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <201012161422.48209.jhb@freebsd.org> <20101216202319.GS23098@acme.spoerlein.net> In-Reply-To: <20101216202319.GS23098@acme.spoerlein.net> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 20:27:19 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 12/16/10 12:23, Ulrich Spörlein wrote: > On Thu, 16.12.2010 at 14:22:47 -0500, John Baldwin wrote: >> On Thursday, December 16, 2010 2:04:08 pm Robert Watson wrote: >>> On Thu, 16 Dec 2010, David O'Brien wrote: >>> >>>>>> Log: >>>>>> Bump WARNS to 6. >>>>>> >>>>>> Modified: >>>>>> head/sbin/geom/class/eli/Makefile >>>>> >>>>> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >>>> >>>> Errr. Reverted. I built it on the architectures I had access to... >>> >>> For WARNS-related changes, I generally use "make universe" to test across >>> architectures. This builds all of our architectures world + all available >>> kernels, and seems the most effective way to avoid the above situations. (I've >>> fallen into exactly the same trap...) >>> >>> The one thing to be cautious about is that make universe won't fail if an >>> individual build fails, so you need to check the logs to make sure everything >>> actually succeeded. >> >> Which is why I prefer 'make tinderbox' since it tells you what fails. :) > > Shamless plug: the attached, crude expect(1) script allows you to do > $ cd /usr/src && universe-build sbin/geom WARNS=6 > > with the minimal amount of compilation (you have to build the toolchain > once, though). I found it invaluable. I think we could probably put that in src/tools/somewhere... Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iQEcBAEBCAAGBQJNCnYYAAoJEATO+BI/yjfBJmwH/jmQzWwaUq36K8WiR+PDZl69 j86BxbDBENFitziKYhi5+5OZ1Lqh5iid5x4eZreloLF3/Bj70qLe+sTTGKYkYQIt L4mJAOkBrgC35NVe3V3RenAyyfEZOmm42ofPMAzg98oiGxSxHnTbKy1RZgHhR9O6 ZjIwhY7WJM1Zmwk5lfafzFZuBGoucXWpp54YxdxjIMqqUL16Ivqk715WzfxXzeUj VX9QZBcNZKpK9YWz5c1Z+OTbyMDgGK5jtVtKzkE8ecMNcxJjw2CT2kwJz1HZgGOr eNIHh4dv6LHDuhMj+o6kry3GMvjIDa9XmLHa2heH+PD7Wz+5wnUegF8yg3pElnk= =3hxw -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 21:01:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF4F106566C; Thu, 16 Dec 2010 21:01:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346318FC13; Thu, 16 Dec 2010 21:01:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGL13RZ088360; Thu, 16 Dec 2010 21:01:03 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGL13CZ088357; Thu, 16 Dec 2010 21:01:03 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012162101.oBGL13CZ088357@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Dec 2010 21:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216495 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 21:01:03 -0000 Author: tuexen Date: Thu Dec 16 21:01:02 2010 New Revision: 216495 URL: http://svn.freebsd.org/changeset/base/216495 Log: Bugfix: Take also the nr-mapping array into account when detecting gaps. Reviewed by: rrs@ MFC after: 3 days. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 16 19:48:03 2010 (r216494) +++ head/sys/netinet/sctp_indata.c Thu Dec 16 21:01:02 2010 (r216495) @@ -2585,8 +2585,9 @@ sctp_process_data(struct mbuf **mm, int int num_chunks = 0; /* number of control chunks processed */ int stop_proc = 0; int chk_length, break_flag, last_chunk; - int abort_flag = 0, was_a_gap = 0; + int abort_flag = 0, was_a_gap; struct mbuf *m; + uint32_t highest_tsn; /* set the rwnd */ sctp_set_rwnd(stcb, &stcb->asoc); @@ -2594,11 +2595,12 @@ sctp_process_data(struct mbuf **mm, int m = *mm; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_map, - stcb->asoc.cumulative_tsn, MAX_TSN)) { - /* there was a gap before this data was processed */ - was_a_gap = 1; + if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map, MAX_TSN)) { + highest_tsn = asoc->highest_tsn_inside_nr_map; + } else { + highest_tsn = asoc->highest_tsn_inside_map; } + was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); /* * setup where we got the last DATA packet from for any SACK that * may need to go out. Don't bump the net. This is done ONLY when a Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 16 19:48:03 2010 (r216494) +++ head/sys/netinet/sctp_input.c Thu Dec 16 21:01:02 2010 (r216495) @@ -5650,13 +5650,15 @@ sctp_common_input_processing(struct mbuf */ } if ((data_processed == 0) && (fwd_tsn_seen)) { - int was_a_gap = 0; + int was_a_gap; + uint32_t highest_tsn; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_map, - stcb->asoc.cumulative_tsn, MAX_TSN)) { - /* there was a gap before this data was processed */ - was_a_gap = 1; + if (compare_with_wrap(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map, MAX_TSN)) { + highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; + } else { + highest_tsn = stcb->asoc.highest_tsn_inside_map; } + was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); stcb->asoc.send_sack = 1; sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 16 23:28:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D99D0106566B; Thu, 16 Dec 2010 23:28:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7EC38FC14; Thu, 16 Dec 2010 23:28:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBGNSKAp005701; Thu, 16 Dec 2010 23:28:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBGNSKPE005698; Thu, 16 Dec 2010 23:28:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012162328.oBGNSKPE005698@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 16 Dec 2010 23:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216496 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2010 23:28:20 -0000 Author: jilles Date: Thu Dec 16 23:28:20 2010 New Revision: 216496 URL: http://svn.freebsd.org/changeset/base/216496 Log: sh: Fix corruption of command substitutions with special chars after newline The CTLESC byte to protect a special character was output before instead of after a newline directly preceding the special character. The special handling of newlines is because command substitutions discard all trailing newlines. Added: head/tools/regression/bin/sh/expansion/cmdsubst3.0 (contents, props changed) Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Thu Dec 16 21:01:02 2010 (r216495) +++ head/bin/sh/expand.c Thu Dec 16 23:28:20 2010 (r216496) @@ -499,8 +499,6 @@ expbackq(union node *cmd, int quoted, in } lastc = *p++; if (lastc != '\0') { - if (quotes && syntax[(int)lastc] == CCTL) - STPUTC(CTLESC, dest); if (lastc == '\n') { nnl++; } else { @@ -508,6 +506,8 @@ expbackq(union node *cmd, int quoted, in nnl--; STPUTC('\n', dest); } + if (quotes && syntax[(int)lastc] == CCTL) + STPUTC(CTLESC, dest); STPUTC(lastc, dest); } } Added: head/tools/regression/bin/sh/expansion/cmdsubst3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst3.0 Thu Dec 16 23:28:20 2010 (r216496) @@ -0,0 +1,20 @@ +# $FreeBSD$ + +e= +for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in + 000) continue ;; + esac + e="$e\n\\$i$j$k" + done + done +done +e1=$(printf "$e") +e2="$(printf "$e")" +[ "${#e1}" = 510 ] || echo length bad +[ "$e1" = "$e2" ] || echo e1 != e2 +[ "$e1" = "$(printf "$e")" ] || echo quoted bad +IFS= +[ "$e1" = $(printf "$e") ] || echo unquoted bad From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 00:44:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8596106564A; Fri, 17 Dec 2010 00:44:05 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id A47EB8FC1C; Fri, 17 Dec 2010 00:44:05 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id oBH0hmXN010305; Thu, 16 Dec 2010 16:43:48 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id oBH0hmZN010304; Thu, 16 Dec 2010 16:43:48 -0800 (PST) (envelope-from obrien) Date: Thu, 16 Dec 2010 16:43:48 -0800 From: "David O'Brien" Message-ID: <20101217004348.GA10254@dragon.NUXI.org> References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <201012161422.48209.jhb@freebsd.org> <20101216202319.GS23098@acme.spoerlein.net> <4D0A7618.2080209@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4D0A7618.2080209@delphij.net> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 00:44:05 -0000 On Thu, Dec 16, 2010 at 12:27:04PM -0800, Xin LI wrote: > On 12/16/10 12:23, Ulrich Spörlein wrote: > > Shamless plug: the attached, crude expect(1) script allows you to do > > $ cd /usr/src && universe-build sbin/geom WARNS=6 > > > > with the minimal amount of compilation (you have to build the toolchain > > once, though). I found it invaluable. > > I think we could probably put that in src/tools/somewhere... Ulrich, Yes, please. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 01:30:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B2FE106566B; Fri, 17 Dec 2010 01:30:56 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F0448FC08; Fri, 17 Dec 2010 01:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBH1UuRQ016662; Fri, 17 Dec 2010 01:30:56 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBH1Uuos016660; Fri, 17 Dec 2010 01:30:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012170130.oBH1Uuos016660@svn.freebsd.org> From: Robert Watson Date: Fri, 17 Dec 2010 01:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216497 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 01:30:56 -0000 Author: rwatson Date: Fri Dec 17 01:30:56 2010 New Revision: 216497 URL: http://svn.freebsd.org/changeset/base/216497 Log: Clarifications of a number of points in xen.4, and some additional device driver information from gibbs@. MFC after: 3 days Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Thu Dec 16 23:28:20 2010 (r216496) +++ head/share/man/man4/xen.4 Fri Dec 17 01:30:56 2010 (r216497) @@ -86,17 +86,18 @@ the amd64 architecture, and require Para-virtualized device drivers are required in order to support certain functionality, such as processing management requests, returning idle physical memory pages to the hypevisor, etc. -.Ss Para-virtualized drivers +.Ss Xen DomU device drivers Adding .Cd "options xenpci" -to the kernel configuration enables the Xen para-virtualized drivers: +to the kernel configuration enables the Xen administrative or +para-virtualized drivers: .Bl -hang -offset indent -width blkfront .It Nm balloon Allow physical memory pages to be returned to the hypervisor as a result of manual tuning or automatic policy. .It Nm blkback -Exports local block devices to other Xen domains where they can then be -imported via +Exports local block devices or files to other Xen domains where they can +then be imported via .Nm blkfront . .It Nm blkfront Import block devices from other Xen domains as local block devices, to be @@ -118,13 +119,16 @@ imported via Import network interfaces from other Xen domains as local network interfaces, which may be used for IPv4, IPv6, etc. .It Nm pcifront -No description. +Allow physical PCI devices to be passed through into a PV domain. .It Nm xenpci -No description. +Represents the Xen PCI device, an emulated PCI device that is exposed to +HVM domains. +This device allows detection of the Xen hypervisor, and provides interrupt +and shared memory services required to interact with the hypervisor. .El -.Ss Performance +.Ss Performance considerations In general, PV drivers will perform better than emulated hardware, and are -the recommended configuration. +the recommended configuration for HVM installations. .Pp Using a hypervisor introduces a second layer of scheduling that may limit the effectiveness of certain @@ -168,7 +172,8 @@ amd64. .Pp Para-virtualized drivers under hardware-assisted virtualization (HVM) kernel are only supported on amd64, not i386. -.P -As of this release, Xen DomU support is not heavily tested; instability has -been reported during VM migration of PV kernels, and certain PV driver -features, such as the balloon driver, are under-exercised. +.Pp +As of this release, Xen PV DomU support is not heavily tested; instability +has been reported during VM migration of PV kernels. +.Pp +Certain PV driver features, such as the balloon driver, are under-exercised. From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 02:43:20 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58833106564A; Fri, 17 Dec 2010 02:43:20 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 34EE08FC14; Fri, 17 Dec 2010 02:43:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBH2e2eC099339; Thu, 16 Dec 2010 19:40:03 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D0ACD82.3030303@bsdimp.com> Date: Thu, 16 Dec 2010 19:40:02 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Garrett Cooper References: <201012161754.oBGHsu5d071652@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" Subject: Re: svn commit: r216493 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 02:43:20 -0000 On 12/16/2010 11:54, Garrett Cooper wrote: > On Thu, Dec 16, 2010 at 9:54 AM, David E. O'Brien wrote: >> Author: obrien >> Date: Thu Dec 16 17:54:56 2010 >> New Revision: 216493 >> URL: http://svn.freebsd.org/changeset/base/216493 >> >> Log: >> Revert r216473. >> WARNS=6 causes "warning: cast increases required alignment of target type" >> on arm, ia64, mips, and sparc64. >> >> Modified: >> head/sbin/geom/class/eli/Makefile >> >> Modified: head/sbin/geom/class/eli/Makefile >> ============================================================================== >> --- head/sbin/geom/class/eli/Makefile Thu Dec 16 17:14:37 2010 (r216492) >> +++ head/sbin/geom/class/eli/Makefile Thu Dec 16 17:54:56 2010 (r216493) >> @@ -11,7 +11,7 @@ SRCS+= sha2.c >> DPADD= ${LIBMD} ${LIBCRYPTO} >> LDADD= -lmd -lcrypto >> >> -WARNS?= 6 >> +WARNS?= 3 >> >> CFLAGS+=-I${.CURDIR}/../../../../sys > I think it's actually safe to bump it to WARNS = 6 if you define > NO_WCAST_ALIGN = 1, but that would need to be tested. And the code in question needs to be audited to make sure that the alignment changes are benign. Blindly setting this just papers over the bugs... Warner > Cheers, > -Garrett > > > From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 09:14:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C30106566B; Fri, 17 Dec 2010 09:14:26 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439A28FC2A; Fri, 17 Dec 2010 09:14:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBH9EQe3056178; Fri, 17 Dec 2010 09:14:26 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBH9EQNi056176; Fri, 17 Dec 2010 09:14:26 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201012170914.oBH9EQNi056176@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 17 Dec 2010 09:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216498 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 09:14:26 -0000 Author: jchandra Date: Fri Dec 17 09:14:25 2010 New Revision: 216498 URL: http://svn.freebsd.org/changeset/base/216498 Log: Minor cleanup for sys/conf/Makefile.mips. Use -e and replace two calls to sed with one. Modified: head/sys/conf/Makefile.mips Modified: head/sys/conf/Makefile.mips ============================================================================== --- head/sys/conf/Makefile.mips Fri Dec 17 01:30:56 2010 (r216497) +++ head/sys/conf/Makefile.mips Fri Dec 17 09:14:25 2010 (r216498) @@ -60,9 +60,9 @@ trampoline: ${KERNEL_KO}.tramp.bin ${KERNEL_KO}.tramp.bin: ${KERNEL_KO} $S/$M/$M/elf_trampoline.c \ $S/$M/$M/inckern.S ${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \ - -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp - sed s/${KERNLOADADDR}/${TRAMPLOADADDR}/ ${LDSCRIPT_NAME} | \ - sed s/" + SIZEOF_HEADERS"// > ${LDSCRIPT_NAME}.tramp.noheader + -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp + sed -e s/${KERNLOADADDR}/${TRAMPLOADADDR}/ -e s/" + SIZEOF_HEADERS"// \ + ${LDSCRIPT_NAME} > ${LDSCRIPT_NAME}.tramp.noheader ${CC} -O -nostdlib -I. -I$S ${TRAMP_EXTRA_FLAGS} ${TRAMP_LDFLAGS} -Xlinker \ -T -Xlinker ${LDSCRIPT_NAME}.tramp.noheader \ -DKERNNAME="\"${KERNEL_KO}.tmp\"" $S/$M/$M/elf_trampoline.c \ From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 09:38:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F6BD1065672; Fri, 17 Dec 2010 09:38:56 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4DA8FC17; Fri, 17 Dec 2010 09:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBH9ctZ5058261; Fri, 17 Dec 2010 09:38:55 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBH9ct1J058259; Fri, 17 Dec 2010 09:38:55 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012170938.oBH9ct1J058259@svn.freebsd.org> From: Kevin Lo Date: Fri, 17 Dec 2010 09:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216499 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 09:38:56 -0000 Author: kevlo Date: Fri Dec 17 09:38:55 2010 New Revision: 216499 URL: http://svn.freebsd.org/changeset/base/216499 Log: Add pf in quiet mode Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Fri Dec 17 09:14:25 2010 (r216498) +++ head/etc/rc.d/pf Fri Dec 17 09:38:55 2010 (r216499) @@ -29,7 +29,7 @@ pf_start() $pf_program -F all > /dev/null 2>&1 $pf_program -f "$pf_rules" $pf_flags if ! $pf_program -s info | grep -q "Enabled" ; then - $pf_program -e + $pf_program -eq fi check_startmsgs && echo '.' } @@ -38,7 +38,7 @@ pf_stop() { if $pf_program -s info | grep -q "Enabled" ; then echo -n 'Disabling pf' - $pf_program -d + $pf_program -dq echo '.' fi } From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 10:05:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39707106567A; Fri, 17 Dec 2010 10:05:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 283908FC22; Fri, 17 Dec 2010 10:05:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHA5M2x060417; Fri, 17 Dec 2010 10:05:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHA5Mjb060415; Fri, 17 Dec 2010 10:05:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012171005.oBHA5Mjb060415@svn.freebsd.org> From: Robert Watson Date: Fri, 17 Dec 2010 10:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216500 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 10:05:22 -0000 Author: rwatson Date: Fri Dec 17 10:05:21 2010 New Revision: 216500 URL: http://svn.freebsd.org/changeset/base/216500 Log: Fix spelling nits. MFC after: 3 days Submitted by: bcr Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Fri Dec 17 09:38:55 2010 (r216499) +++ head/share/man/man4/xen.4 Fri Dec 17 10:05:21 2010 (r216500) @@ -85,7 +85,7 @@ the amd64 architecture, and require .Pp Para-virtualized device drivers are required in order to support certain functionality, such as processing management requests, returning idle -physical memory pages to the hypevisor, etc. +physical memory pages to the hypervisor, etc. .Ss Xen DomU device drivers Adding .Cd "options xenpci" @@ -112,7 +112,7 @@ Expose Xen events via the .Pa /dev/xen/evtchn special device. .It Nm netback -Export local network interfacest to other Xen domains where they can be +Export local network interfaces to other Xen domains where they can be imported via .Nm netfront . .It Nm netfront From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 11:25:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3A6106564A; Fri, 17 Dec 2010 11:25:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3054B8FC13; Fri, 17 Dec 2010 11:25:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHBPcsR067952; Fri, 17 Dec 2010 11:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHBPcwU067950; Fri, 17 Dec 2010 11:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012171125.oBHBPcwU067950@svn.freebsd.org> From: Robert Watson Date: Fri, 17 Dec 2010 11:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216501 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 11:25:38 -0000 Author: rwatson Date: Fri Dec 17 11:25:37 2010 New Revision: 216501 URL: http://svn.freebsd.org/changeset/base/216501 Log: Correct some misundertandings on my part about PV vs HVM kernel configuration options. MFC after: 1 day Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Fri Dec 17 10:05:21 2010 (r216500) +++ head/share/man/man4/xen.4 Fri Dec 17 11:25:37 2010 (r216501) @@ -40,17 +40,14 @@ the following lines in your kernel confi .Bd -ragged -offset indent .Cd "options PAE" .Cd "options XEN" +.Cd "nooptions NATIVE" .Ed .Pp -To compile hardware-assisted virtualization (HVM) Xen guest support into an -amd64 kernel, place the following line in your kernel configuration file: +To compile hardware-assisted virtualization (HVM) Xen guest support with +para-virtualized drivers into an amd64 kernel, place the following lines in +your kernel configuration file: .Bd -ragged -offset indent .Cd "options XENHVM" -.Ed -.Pp -To compile support for Xenbux and Xen PV drivers into an amd64 or i386 -kernel, place the following line in your kernel configuration file: -.Bd -ragged -offset indent .Cd "device xenpci" .Ed .Sh DESCRIPTION @@ -73,7 +70,9 @@ semantics. .Pp .Fx supports a fully para-virtualized (PV) kernel on the i386 architecture using -.Cd "options XEN" ; +.Cd "options XEN" +and +.Cd "nooptions NATIVE" ; currently, this requires use of a PAE kernel, enabled via .Cd "options PAE" . .Pp @@ -81,16 +80,23 @@ currently, this requires use of a PAE ke supports hardware-assisted virtualization (HVM) on both the i386 and amd64 kernels; however, PV device drivers with an HVM kernel are only supported on the amd64 architecture, and require -.Cd "options XENHVM" . +.Cd "options XENHVM" +and +.Cd "device xenpci" . .Pp Para-virtualized device drivers are required in order to support certain functionality, such as processing management requests, returning idle physical memory pages to the hypervisor, etc. .Ss Xen DomU device drivers -Adding -.Cd "options xenpci" -to the kernel configuration enables the Xen administrative or -para-virtualized drivers: +Xen administrative and para-virtualized drivers are automatically added to +the kernel if a PV kernel is compiled using +.Cd "options XEN" ; +for HVM environments, +.Cd "options XENHVM" +and +.Cd "device xenpci" +are required. +The follow drivers are supported: .Bl -hang -offset indent -width blkfront .It Nm balloon Allow physical memory pages to be returned to the hypervisor as a result of From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 15:39:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD64106566B; Fri, 17 Dec 2010 15:39:42 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 7EAB28FC0C; Fri, 17 Dec 2010 15:39:42 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 3305A582C9; Fri, 17 Dec 2010 09:22:04 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id mvNu+7skRGiR; Fri, 17 Dec 2010 09:22:04 -0600 (CST) Received: from comporellon.tachypleus.net (unknown [71.150.248.187]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 8290B582C7; Fri, 17 Dec 2010 09:22:03 -0600 (CST) Message-ID: <4D0B801A.7050608@freebsd.org> Date: Fri, 17 Dec 2010 09:22:02 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101214 Thunderbird/3.1.7 MIME-Version: 1.0 To: Robert Watson References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 15:39:42 -0000 On 12/16/10 13:04, Robert Watson wrote: > On Thu, 16 Dec 2010, David O'Brien wrote: > >>>> Log: >>>> Bump WARNS to 6. >>>> >>>> Modified: >>>> head/sbin/geom/class/eli/Makefile >>> >>> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >> >> Errr. Reverted. I built it on the architectures I had access to... > > For WARNS-related changes, I generally use "make universe" to test > across architectures. This builds all of our architectures world + > all available kernels, and seems the most effective way to avoid the > above situations. (I've fallen into exactly the same trap...) > > The one thing to be cautious about is that make universe won't fail if > an individual build fails, so you need to check the logs to make sure > everything actually succeeded. The trouble with make universe is that it has been broken for months and months now. ARM and powerpc64 are disconnected from the build entirely, as are big-endian and 64-bit MIPS, and an increasing number of ARM and PowerPC kernels depend on FDT tools not built by default, and so do not build. Build infrastructure changes also make it appear that the PowerPC GENERIC64 kernel is broken when it is not. This severely reduces the coverage of make universe for problems like this. I have a patch at http://people.freebsd.org/~nwhitehorn/universe.diff that fixes both of these problems, by teaching the universe rule in src/Makefile about MACHINEs with multiple MACHINE_ARCHs and by enabling the build of the FDT tools by default, which adds about 300K to world. The way these are done is probably not optimal, but it is a better than the current situation and is a good stopgap. With the patch, all architectures succeed except for the ARM AVILA kernel, which seems genuinely broken, and the various 64-bit MIPS kernels, since 64-bit MIPS is not hooked up to the build yet. If I don't hear any objections, I would like to commit it on Wednesday the 22nd. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 15:39:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6461E1065783; Fri, 17 Dec 2010 15:39:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 529D38FC15; Fri, 17 Dec 2010 15:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHFdt9o084360; Fri, 17 Dec 2010 15:39:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHFdtfT084358; Fri, 17 Dec 2010 15:39:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012171539.oBHFdtfT084358@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Dec 2010 15:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216502 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 15:39:55 -0000 Author: tuexen Date: Fri Dec 17 15:39:55 2010 New Revision: 216502 URL: http://svn.freebsd.org/changeset/base/216502 Log: Fix a flightsize bug related to the processing of PKTDRP reports. MFC after: 3 days. Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Fri Dec 17 11:25:37 2010 (r216501) +++ head/sys/netinet/sctp_input.c Fri Dec 17 15:39:55 2010 (r216502) @@ -3156,7 +3156,6 @@ process_chunk_drop(struct sctp_tcb *stcb SCTP_STAT_INCR(sctps_pdrpmark); if (tp1->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - tp1->sent = SCTP_DATAGRAM_RESEND; /* * mark it as if we were doing a FR, since * we will be getting gap ack reports behind @@ -3191,6 +3190,7 @@ process_chunk_drop(struct sctp_tcb *stcb sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); } + tp1->sent = SCTP_DATAGRAM_RESEND; } { /* audit code */ unsigned int audit; From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 16:10:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88E94106564A; Fri, 17 Dec 2010 16:10:20 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 30E6C8FC21; Fri, 17 Dec 2010 16:10:19 +0000 (UTC) Received: from outgoing.leidinger.net (p5B32F001.dip.t-dialin.net [91.50.240.1]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 30D56844012; Fri, 17 Dec 2010 17:10:14 +0100 (CET) Received: from unknown (IO.Leidinger.net [192.168.2.110]) by outgoing.leidinger.net (Postfix) with ESMTP id A82282614; Fri, 17 Dec 2010 17:10:09 +0100 (CET) Date: Fri, 17 Dec 2010 17:10:08 +0100 From: Alexander Leidinger To: "Bjoern A. Zeeb" Message-ID: <20101217171008.000010b5@unknown> In-Reply-To: <20101216135547.B6126@maildrop.int.zabbadoz.net> References: <201012161158.oBGBwoep051709@svn.freebsd.org> <20101216135547.B6126@maildrop.int.zabbadoz.net> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 30D56844012.A263C X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.923, required 6, autolearn=disabled, ALL_TRUSTED -1.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1293207016.44257@yWaBhbQYIizhQPaSgagQ8Q X-EBL-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216483 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 16:10:20 -0000 On Thu, 16 Dec 2010 14:22:30 +0000 (UTC) "Bjoern A. Zeeb" wrote: [descsription of the original ordering] > I think grouping by date and then by file/lib/dir is actually better > as it'll keep things logically together rather than possibly splitting > it over 3 sections? As the person who did the initial ordering: whatever makes sense. Way back when I did it, the original ordering made some things more easy. Now that the lists grown very big, everyone is welcome to change it to something which makes sense today. BTW: Should or should we not remove old entries which are way beyond what we support, e.g. files from 2nd previous branches? The idea behind is, that this prevents to have an abnormal big list of old stuff, and that an update from e.g. 6 to 8 is not supported, so people need to go from 6 to 7, can delete old stuff, update to 8 and delete again old stuff. I am aware that people would have to rebuild all ports on 7 and on 8 again, if they want to update libs. I am not sure if this matters. If it matters, what about removing stuff which is from a 3rd previous branch, e.g. if we delete on 8 it will remove outdated files from 7 and 6, but not from 5? Bye, Alexander. From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 16:21:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51ECD106566B; Fri, 17 Dec 2010 16:21:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9918FC08; Fri, 17 Dec 2010 16:21:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHGLUJK087314; Fri, 17 Dec 2010 16:21:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHGLUxK087309; Fri, 17 Dec 2010 16:21:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012171621.oBHGLUxK087309@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Dec 2010 16:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216503 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 16:21:31 -0000 Author: avg Date: Fri Dec 17 16:21:30 2010 New Revision: 216503 URL: http://svn.freebsd.org/changeset/base/216503 Log: small cleanup of acpi battery status setting and checking This is based on the patch submitted by Yuri Skripachov. Overview of the changes: - clarify double-use of some ACPI_BATT_STAT_* definitions - clean up undefined/extended status bits returned by _BST - warn about charging+discharging bits being set at the same time PR: kern/124744 Submitted by: Yuri Skripachov Tested by: Yuri Skripachov MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_battery.c head/sys/dev/acpica/acpi_cmbat.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/acpica/acpiio.h Modified: head/sys/dev/acpica/acpi_battery.c ============================================================================== --- head/sys/dev/acpica/acpi_battery.c Fri Dec 17 15:39:55 2010 (r216502) +++ head/sys/dev/acpica/acpi_battery.c Fri Dec 17 16:21:30 2010 (r216503) @@ -102,8 +102,9 @@ acpi_battery_get_info_expire(void) int acpi_battery_bst_valid(struct acpi_bst *bst) { - return (bst->state < ACPI_BATT_STAT_MAX && bst->cap != ACPI_BATT_UNKNOWN && - bst->volt != ACPI_BATT_UNKNOWN); + + return (bst->state != ACPI_BATT_STAT_NOT_PRESENT && + bst->cap != ACPI_BATT_UNKNOWN && bst->volt != ACPI_BATT_UNKNOWN); } /* Check _BIF results for validity. */ Modified: head/sys/dev/acpica/acpi_cmbat.c ============================================================================== --- head/sys/dev/acpica/acpi_cmbat.c Fri Dec 17 15:39:55 2010 (r216502) +++ head/sys/dev/acpica/acpi_cmbat.c Fri Dec 17 16:21:30 2010 (r216503) @@ -279,6 +279,12 @@ acpi_cmbat_get_bst(void *arg) goto end; acpi_cmbat_info_updated(&sc->bst_lastupdated); + /* Clear out undefined/extended bits that might be set by hardware. */ + sc->bst.state &= ACPI_BATT_STAT_BST_MASK; + if ((sc->bst.state & ACPI_BATT_STAT_INVALID) == ACPI_BATT_STAT_INVALID) + ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), + "battery reports simultaneous charging and discharging\n"); + /* XXX If all batteries are critical, perhaps we should suspend. */ if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) { if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) { Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Fri Dec 17 15:39:55 2010 (r216502) +++ head/sys/dev/acpica/acpi_smbat.c Fri Dec 17 16:21:30 2010 (r216503) @@ -390,6 +390,7 @@ acpi_smbat_get_bst(device_t dev, struct if (val > 0) { sc->bst.rate = val * factor; + sc->bst.state &= ~SMBATT_BS_DISCHARGING; sc->bst.state |= ACPI_BATT_STAT_CHARGING; } else if (val < 0) sc->bst.rate = (-val) * factor; Modified: head/sys/dev/acpica/acpiio.h ============================================================================== --- head/sys/dev/acpica/acpiio.h Fri Dec 17 15:39:55 2010 (r216502) +++ head/sys/dev/acpica/acpiio.h Fri Dec 17 16:21:30 2010 (r216503) @@ -74,11 +74,22 @@ struct acpi_bst { uint32_t volt; /* Present Voltage */ }; +/* + * Note that the following definitions represent status bits for internal + * driver state. The first three of them (charging, discharging and critical) + * conveninetly conform to ACPI specification of status returned by _BST + * method. Other definitions (not present, etc) are synthetic. + * Also note that according to the specification the charging and discharging + * status bits must not be set at the same time. + */ #define ACPI_BATT_STAT_DISCHARG 0x0001 #define ACPI_BATT_STAT_CHARGING 0x0002 #define ACPI_BATT_STAT_CRITICAL 0x0004 -#define ACPI_BATT_STAT_NOT_PRESENT 0x0007 -#define ACPI_BATT_STAT_MAX 0x0007 +#define ACPI_BATT_STAT_INVALID \ + (ACPI_BATT_STAT_DISCHARG | ACPI_BATT_STAT_CHARGING) +#define ACPI_BATT_STAT_BST_MASK \ + (ACPI_BATT_STAT_INVALID | ACPI_BATT_STAT_CRITICAL) +#define ACPI_BATT_STAT_NOT_PRESENT ACPI_BATT_STAT_BST_MASK union acpi_battery_ioctl_arg { int unit; /* Device unit or ACPI_BATTERY_ALL_UNITS. */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 16:29:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 168E7106566C; Fri, 17 Dec 2010 16:29:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04D9B8FC0A; Fri, 17 Dec 2010 16:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHGT62w087789; Fri, 17 Dec 2010 16:29:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHGT614087787; Fri, 17 Dec 2010 16:29:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012171629.oBHGT614087787@svn.freebsd.org> From: John Baldwin Date: Fri, 17 Dec 2010 16:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216504 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 16:29:07 -0000 Author: jhb Date: Fri Dec 17 16:29:06 2010 New Revision: 216504 URL: http://svn.freebsd.org/changeset/base/216504 Log: Add back a bounds check on valid idle priorities that was lost in an earlier commit. While here, move the thread lock down in rtp_to_pri(). It is not needed for all of the priority value checks and the computation of newpri. Reported by: swell.k @ gmail MFC after: 3 days Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Dec 17 16:21:30 2010 (r216503) +++ head/sys/kern/kern_resource.c Fri Dec 17 16:29:06 2010 (r216504) @@ -462,29 +462,27 @@ rtp_to_pri(struct rtprio *rtp, struct th u_char newpri; u_char oldpri; - thread_lock(td); switch (RTP_PRIO_BASE(rtp->type)) { case RTP_PRIO_REALTIME: - if (rtp->prio > RTP_PRIO_MAX) { - thread_unlock(td); + if (rtp->prio > RTP_PRIO_MAX) return (EINVAL); - } newpri = PRI_MIN_REALTIME + rtp->prio; break; case RTP_PRIO_NORMAL: - if (rtp->prio > (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) { - thread_unlock(td); + if (rtp->prio > (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE)) return (EINVAL); - } newpri = PRI_MIN_TIMESHARE + rtp->prio; break; case RTP_PRIO_IDLE: + if (rtp->prio > RTP_PRIO_MAX) + return (EINVAL); newpri = PRI_MIN_IDLE + rtp->prio; break; default: - thread_unlock(td); return (EINVAL); } + + thread_lock(td); sched_class(td, rtp->type); /* XXX fix */ oldpri = td->td_user_pri; sched_user_prio(td, newpri); From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 18:22:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AAF9106564A; Fri, 17 Dec 2010 18:22:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58D658FC08; Fri, 17 Dec 2010 18:22:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHIMoNu098403; Fri, 17 Dec 2010 18:22:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHIMouX098401; Fri, 17 Dec 2010 18:22:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201012171822.oBHIMouX098401@svn.freebsd.org> From: Andriy Gapon Date: Fri, 17 Dec 2010 18:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216505 - head/sys/cddl/dev/cyclic/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 18:22:50 -0000 Author: avg Date: Fri Dec 17 18:22:50 2010 New Revision: 216505 URL: http://svn.freebsd.org/changeset/base/216505 Log: cyclic xcall: use smp_no_rendevous_barrier as setup function parameter In this case we call target function only on a single CPU and do not need any synchronization at the setup stage. It's a bit non-obvious but setup function of NULL means that smp_rendezvous_cpus waits for all CPUs to arrive at the rendezvous point, but without doing any actual setup. While using smp_no_rendevous_barrier means that each CPU proceeds on its own schedule without any synchronization whatsoever. MFC after: 3 weeks Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Modified: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c ============================================================================== --- head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Fri Dec 17 16:29:06 2010 (r216504) +++ head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c Fri Dec 17 18:22:50 2010 (r216505) @@ -122,6 +122,6 @@ static void reprogram(cyb_arg_t arg, hrt static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) { - smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), NULL, - func, smp_no_rendevous_barrier, param); + smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), + smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param); } From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 19:15:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1285F106566B; Fri, 17 Dec 2010 19:15:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9F9258FC0C; Fri, 17 Dec 2010 19:15:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBHJ7SH5010103; Fri, 17 Dec 2010 12:07:29 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D0BB4F0.5090908@bsdimp.com> Date: Fri, 17 Dec 2010 12:07:28 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Nathan Whitehorn References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <4D0B801A.7050608@freebsd.org> In-Reply-To: <4D0B801A.7050608@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 19:15:05 -0000 On 12/17/2010 08:22, Nathan Whitehorn wrote: > On 12/16/10 13:04, Robert Watson wrote: >> On Thu, 16 Dec 2010, David O'Brien wrote: >> >>>>> Log: >>>>> Bump WARNS to 6. >>>>> >>>>> Modified: >>>>> head/sbin/geom/class/eli/Makefile >>>> >>>> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >>> >>> Errr. Reverted. I built it on the architectures I had access to... >> >> For WARNS-related changes, I generally use "make universe" to test >> across architectures. This builds all of our architectures world + >> all available kernels, and seems the most effective way to avoid the >> above situations. (I've fallen into exactly the same trap...) >> >> The one thing to be cautious about is that make universe won't fail >> if an individual build fails, so you need to check the logs to make >> sure everything actually succeeded. > > The trouble with make universe is that it has been broken for months > and months now. ARM and powerpc64 are disconnected from the build > entirely, as are big-endian and 64-bit MIPS, and an increasing number > of ARM and PowerPC kernels depend on FDT tools not built by default, > and so do not build. Build infrastructure changes also make it appear > that the PowerPC GENERIC64 kernel is broken when it is not. This > severely reduces the coverage of make universe for problems like this. > > I have a patch at http://people.freebsd.org/~nwhitehorn/universe.diff > that fixes both of these problems, by teaching the universe rule in > src/Makefile about MACHINEs with multiple MACHINE_ARCHs and by > enabling the build of the FDT tools by default, which adds about 300K > to world. The way these are done is probably not optimal, but it is a > better than the current situation and is a good stopgap. With the > patch, all architectures succeed except for the ARM AVILA kernel, > which seems genuinely broken, and the various 64-bit MIPS kernels, > since 64-bit MIPS is not hooked up to the build yet. If I don't hear > any objections, I would like to commit it on Wednesday the 22nd. That works for me. As far as I can tell, doing the MIPS64 stuff will just take about a day of patiently fixing some breakage... Maybe I'll get to it over the holidays. Warner > -Nathan > > > From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 21:10:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 942F9106566B; Fri, 17 Dec 2010 21:10:09 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8688FC16; Fri, 17 Dec 2010 21:10:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHLA9eq014314; Fri, 17 Dec 2010 21:10:09 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHLA98I014311; Fri, 17 Dec 2010 21:10:09 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012172110.oBHLA98I014311@svn.freebsd.org> From: Bruce Cran Date: Fri, 17 Dec 2010 21:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216508 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 21:10:09 -0000 Author: brucec Date: Fri Dec 17 21:10:08 2010 New Revision: 216508 URL: http://svn.freebsd.org/changeset/base/216508 Log: Update shmget(2) with POSIX access permissions and remove non-standard SHM_R, SHM_W and machine/param.h. Modified: head/lib/libc/sys/shmat.2 head/lib/libc/sys/shmctl.2 head/lib/libc/sys/shmget.2 Modified: head/lib/libc/sys/shmat.2 ============================================================================== --- head/lib/libc/sys/shmat.2 Fri Dec 17 21:03:10 2010 (r216507) +++ head/lib/libc/sys/shmat.2 Fri Dec 17 21:10:08 2010 (r216508) @@ -35,7 +35,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h Modified: head/lib/libc/sys/shmctl.2 ============================================================================== --- head/lib/libc/sys/shmctl.2 Fri Dec 17 21:03:10 2010 (r216507) +++ head/lib/libc/sys/shmctl.2 Fri Dec 17 21:10:08 2010 (r216508) @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h Modified: head/lib/libc/sys/shmget.2 ============================================================================== --- head/lib/libc/sys/shmget.2 Fri Dec 17 21:03:10 2010 (r216507) +++ head/lib/libc/sys/shmget.2 Fri Dec 17 21:10:08 2010 (r216508) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 1995 +.Dd December 17, 2010 .Dt SHMGET 2 .Os .Sh NAME @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In machine/param.h .In sys/types.h .In sys/ipc.h .In sys/shm.h @@ -80,17 +79,17 @@ the following constants into the .Fa flag argument: .Bl -tag -width XSHM_WXX6XXX -.It Dv SHM_R -Read access for user. -.It Dv SHM_W -Write access for user. -.It Dv ( SHM_R>>3 ) +.It Dv S_IRUSR +Read access for owner. +.It Dv S_IWUSR +Write access for owner. +.It Dv S_IRGRP Read access for group. -.It Dv ( SHM_W>>3 ) +.It Dv S_IWGRP Write access for group. -.It Dv ( SHM_R>>6 ) +.It Dv S_IROTH Read access for other. -.It Dv ( SHM_W>>6 ) +.It Dv S_IWOTH Write access for other. .El .\" @@ -143,4 +142,5 @@ already exists. .Xr shmat 2 , .Xr shmctl 2 , .Xr shmdt 2 , -.Xr ftok 3 +.Xr ftok 3 , +.Xr stat 2 From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 22:09:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB931065693; Fri, 17 Dec 2010 22:09:55 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E1808FC12; Fri, 17 Dec 2010 22:09:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHM9tmX017858; Fri, 17 Dec 2010 22:09:55 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHM9tLv017857; Fri, 17 Dec 2010 22:09:55 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012172209.oBHM9tLv017857@svn.freebsd.org> From: Robert Watson Date: Fri, 17 Dec 2010 22:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216509 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 22:09:55 -0000 Author: rwatson Date: Fri Dec 17 22:09:55 2010 New Revision: 216509 URL: http://svn.freebsd.org/changeset/base/216509 Log: Simply refer to all Xen drivers as para-virtualized, as this appears to be the preferred Xen parlance. Discussed with: Steve Hand MFC after: 1 day Modified: head/share/man/man4/xen.4 Modified: head/share/man/man4/xen.4 ============================================================================== --- head/share/man/man4/xen.4 Fri Dec 17 21:10:08 2010 (r216508) +++ head/share/man/man4/xen.4 Fri Dec 17 22:09:55 2010 (r216509) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2010 +.Dd December 17, 2010 .Dt XEN 4 .Os .Sh NAME @@ -88,8 +88,8 @@ Para-virtualized device drivers are requ functionality, such as processing management requests, returning idle physical memory pages to the hypervisor, etc. .Ss Xen DomU device drivers -Xen administrative and para-virtualized drivers are automatically added to -the kernel if a PV kernel is compiled using +Xen para-virtualized drivers are automatically added to the kernel if a PV +kernel is compiled using .Cd "options XEN" ; for HVM environments, .Cd "options XENHVM" From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 22:18:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7792C106566B; Fri, 17 Dec 2010 22:18:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6058FC13; Fri, 17 Dec 2010 22:18:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHMIAM7018287; Fri, 17 Dec 2010 22:18:10 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHMIApH018285; Fri, 17 Dec 2010 22:18:10 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012172218.oBHMIApH018285@svn.freebsd.org> From: Rick Macklem Date: Fri, 17 Dec 2010 22:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216510 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 22:18:10 -0000 Author: rmacklem Date: Fri Dec 17 22:18:09 2010 New Revision: 216510 URL: http://svn.freebsd.org/changeset/base/216510 Log: Fix two vnode locking problems in nfsd_recalldelegation() in the experimental NFSv4 server. The first was a bogus use of VOP_ISLOCKED() in a KASSERT() and the second was the need to lock the vnode for the nfsrv_checkremove() call. Also, delete a "__unused" that was bogus, since the argument is used. Reviewed by: zack.kirsch at isilon.com MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 17 22:09:55 2010 (r216509) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 17 22:18:09 2010 (r216510) @@ -4275,7 +4275,7 @@ nfsrv_clientconflict(struct nfsclient *c */ static int nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, - __unused vnode_t vp) + vnode_t vp) { struct nfsclient *clp = stp->ls_clp; int gotlock, error, retrycnt, zapped_clp; @@ -4568,8 +4568,6 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO int32_t starttime; int error; - KASSERT(!VOP_ISLOCKED(vp), ("vp %p is locked", vp)); - /* * First, check to see if the server is currently running and it has * been called for a regular file when issuing delegations. @@ -4578,6 +4576,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO nfsrv_issuedelegs == 0) return; + KASSERT((VOP_ISLOCKED(vp) != LK_EXCLUSIVE), ("vp %p is locked", vp)); /* * First, get a reference on the nfsv4rootfs_lock so that an * exclusive lock cannot be acquired by another thread. @@ -4593,7 +4592,12 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - error = nfsrv_checkremove(vp, 0, p); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + error = nfsrv_checkremove(vp, 0, p); + else + error = EPERM; + VOP_UNLOCK(vp, 0); if (error == NFSERR_DELAY) { NFSGETNANOTIME(&mytime); if (((u_int32_t)mytime.tv_sec - starttime) > From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 22:41:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC13F1065675; Fri, 17 Dec 2010 22:41:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9B588FC0C; Fri, 17 Dec 2010 22:41:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBHMfMed019895; Fri, 17 Dec 2010 22:41:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBHMfMxH019886; Fri, 17 Dec 2010 22:41:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012172241.oBHMfMxH019886@svn.freebsd.org> From: Alan Cox Date: Fri, 17 Dec 2010 22:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216511 - in head/sys: dev/cxgb/ulp/tom kern vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 22:41:23 -0000 Author: alc Date: Fri Dec 17 22:41:22 2010 New Revision: 216511 URL: http://svn.freebsd.org/changeset/base/216511 Log: Implement and use a single optimized function for unholding a set of pages. Reviewed by: kib@ Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c head/sys/dev/cxgb/ulp/tom/cxgb_ddp.c head/sys/dev/cxgb/ulp/tom/cxgb_vm.c head/sys/dev/cxgb/ulp/tom/cxgb_vm.h head/sys/kern/sys_pipe.c head/sys/kern/vfs_bio.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c Fri Dec 17 22:41:22 2010 (r216511) @@ -454,7 +454,7 @@ sendmore: while (uiotmp.uio_resid > 0) { rv = cxgb_vm_page_to_miov(toep, &uiotmp, &m); if (rv) { - vm_fault_unhold_pages(toep->tp_pages, count); + vm_page_unhold_pages(toep->tp_pages, count); return (rv); } uio->uio_resid -= m->m_pkthdr.len; @@ -469,7 +469,7 @@ sendmore: * */ cxgb_wait_dma_completion(toep); - vm_fault_unhold_pages(toep->tp_pages, count); + vm_page_unhold_pages(toep->tp_pages, count); /* * If there is more data to send adjust local copy of iov * to point to teh start Modified: head/sys/dev/cxgb/ulp/tom/cxgb_ddp.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_ddp.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_ddp.c Fri Dec 17 22:41:22 2010 (r216511) @@ -175,7 +175,7 @@ different_gl: *newgl = p; return (0); unpin: - vm_fault_unhold_pages(p->dgl_pages, npages); + vm_page_unhold_pages(p->dgl_pages, npages); free_gl: @@ -208,7 +208,7 @@ ddp_gl_free_pages(struct ddp_gather_list /* * XXX mark pages as dirty before unholding */ - vm_fault_unhold_pages(gl->dgl_pages, gl->dgl_nelem); + vm_page_unhold_pages(gl->dgl_pages, gl->dgl_nelem); } void Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_vm.c Fri Dec 17 22:41:22 2010 (r216511) @@ -150,16 +150,3 @@ error: } return (EFAULT); } - -void -vm_fault_unhold_pages(vm_page_t *mp, int count) -{ - - KASSERT(count >= 0, ("negative count %d", count)); - while (count--) { - vm_page_lock(*mp); - vm_page_unhold(*mp); - vm_page_unlock(*mp); - mp++; - } -} Modified: head/sys/dev/cxgb/ulp/tom/cxgb_vm.h ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_vm.h Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/dev/cxgb/ulp/tom/cxgb_vm.h Fri Dec 17 22:41:22 2010 (r216511) @@ -34,6 +34,5 @@ $FreeBSD$ int vm_fault_hold_user_pages(vm_map_t map, vm_offset_t addr, vm_page_t *mp, int count, vm_prot_t prot); -void vm_fault_unhold_pages(vm_page_t *mp, int count); #endif Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/kern/sys_pipe.c Fri Dec 17 22:41:22 2010 (r216511) @@ -749,7 +749,7 @@ pipe_build_write_buffer(wpipe, uio) { pmap_t pmap; u_int size; - int i, j; + int i; vm_offset_t addr, endaddr; PIPE_LOCK_ASSERT(wpipe, MA_NOTOWNED); @@ -771,11 +771,7 @@ pipe_build_write_buffer(wpipe, uio) */ race: if (vm_fault_quick((caddr_t)addr, VM_PROT_READ) < 0) { - for (j = 0; j < i; j++) { - vm_page_lock(wpipe->pipe_map.ms[j]); - vm_page_unhold(wpipe->pipe_map.ms[j]); - vm_page_unlock(wpipe->pipe_map.ms[j]); - } + vm_page_unhold_pages(wpipe->pipe_map.ms, i); return (EFAULT); } wpipe->pipe_map.ms[i] = pmap_extract_and_hold(pmap, addr, @@ -812,14 +808,9 @@ static void pipe_destroy_write_buffer(wpipe) struct pipe *wpipe; { - int i; PIPE_LOCK_ASSERT(wpipe, MA_OWNED); - for (i = 0; i < wpipe->pipe_map.npages; i++) { - vm_page_lock(wpipe->pipe_map.ms[i]); - vm_page_unhold(wpipe->pipe_map.ms[i]); - vm_page_unlock(wpipe->pipe_map.ms[i]); - } + vm_page_unhold_pages(wpipe->pipe_map.ms, wpipe->pipe_map.npages); wpipe->pipe_map.npages = 0; } Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/kern/vfs_bio.c Fri Dec 17 22:41:22 2010 (r216511) @@ -3911,16 +3911,11 @@ retry: void vunmapbuf(struct buf *bp) { - int pidx; int npages; npages = bp->b_npages; pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages); - for (pidx = 0; pidx < npages; pidx++) { - vm_page_lock(bp->b_pages[pidx]); - vm_page_unhold(bp->b_pages[pidx]); - vm_page_unlock(bp->b_pages[pidx]); - } + vm_page_unhold_pages(bp->b_pages, npages); bp->b_data = bp->b_saveaddr; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/vm/vm_page.c Fri Dec 17 22:41:22 2010 (r216511) @@ -601,6 +601,35 @@ vm_page_unhold(vm_page_t mem) } /* + * vm_page_unhold_pages: + * + * Unhold each of the pages that is referenced by the given array. + */ +void +vm_page_unhold_pages(vm_page_t *ma, int count) +{ + struct mtx *mtx, *new_mtx; + + mtx = NULL; + for (; count != 0; count--) { + /* + * Avoid releasing and reacquiring the same page lock. + */ + new_mtx = vm_page_lockptr(*ma); + if (mtx != new_mtx) { + if (mtx != NULL) + mtx_unlock(mtx); + mtx = new_mtx; + mtx_lock(mtx); + } + vm_page_unhold(*ma); + ma++; + } + if (mtx != NULL) + mtx_unlock(mtx); +} + +/* * vm_page_free: * * Free a page. Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Dec 17 22:18:09 2010 (r216510) +++ head/sys/vm/vm_page.h Fri Dec 17 22:41:22 2010 (r216511) @@ -364,6 +364,7 @@ void vm_page_set_valid(vm_page_t m, int void vm_page_sleep(vm_page_t m, const char *msg); vm_page_t vm_page_splay(vm_pindex_t, vm_page_t); vm_offset_t vm_page_startup(vm_offset_t vaddr); +void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unwire (vm_page_t, int); void vm_page_wire (vm_page_t); void vm_page_set_validclean (vm_page_t, int, int); From owner-svn-src-head@FreeBSD.ORG Fri Dec 17 23:02:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id E688E1065675; Fri, 17 Dec 2010 23:02:36 +0000 (UTC) Date: Fri, 17 Dec 2010 23:02:36 +0000 From: Alexander Best To: Alexander Leidinger Message-ID: <20101217230236.GA1151@freebsd.org> References: <201012161158.oBGBwoep051709@svn.freebsd.org> <20101216135547.B6126@maildrop.int.zabbadoz.net> <20101217171008.000010b5@unknown> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101217171008.000010b5@unknown> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r216483 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2010 23:02:37 -0000 On Fri Dec 17 10, Alexander Leidinger wrote: > On Thu, 16 Dec 2010 14:22:30 +0000 (UTC) "Bjoern A. Zeeb" > wrote: > > [descsription of the original ordering] > > I think grouping by date and then by file/lib/dir is actually better > > as it'll keep things logically together rather than possibly splitting > > it over 3 sections? > > As the person who did the initial ordering: whatever makes sense. Way > back when I did it, the original ordering made some things more easy. > Now that the lists grown very big, everyone is welcome to change it to > something which makes sense today. > > BTW: Should or should we not remove old entries which are way beyond > what we support, e.g. files from 2nd previous branches? The idea behind > is, that this prevents to have an abnormal big list of old stuff, and > that an update from e.g. 6 to 8 is not supported, so people need to go > from 6 to 7, can delete old stuff, update to 8 and delete again old > stuff. I am aware that people would have to rebuild all ports on 7 and > on 8 again, if they want to update libs. I am not sure if this matters. > If it matters, what about removing stuff which is from a 3rd previous > branch, e.g. if we delete on 8 it will remove outdated files from 7 and > 6, but not from 5? i've seen systems running 7 stable e.g. where sysadmins have never executed target delete-old and old files from the 2.x and 3.x days are still floating around. removing these ancient files from the delete-old target would mean that on such systems getting rid of such legacy files becomes close to impossible. personally i don't see a reason to get rid of those ancient entries. egrep -v '^#' ObsoleteFiles.inc|wc reports: 4972 5164 222607 which isn't really that much. just my 0.02$. cheers. alex ps: another possibility would be to have a target delete-old for old files from the last two releases and a new one called delete-ancient which will delete all the old stuff from way back. > > Bye, > Alexander. -- a13x From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 00:30:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CB79106566B; Sat, 18 Dec 2010 00:30:52 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0DC8FC0C; Sat, 18 Dec 2010 00:30:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBI0UqkB027584; Sat, 18 Dec 2010 00:30:52 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBI0UqYS027582; Sat, 18 Dec 2010 00:30:52 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012180030.oBI0UqYS027582@svn.freebsd.org> From: Doug Barton Date: Sat, 18 Dec 2010 00:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216512 - head/usr.bin/stat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 00:30:52 -0000 Author: dougb Date: Sat Dec 18 00:30:52 2010 New Revision: 216512 URL: http://svn.freebsd.org/changeset/base/216512 Log: Bring in the relevant changes from NetBSD's 1.31: "Use strlcpy, not strncpy, when the desired semantics are strlcpy's rather than strncpy's." Note: NetBSD's 1.32 is their adoption of our r216206 Obtained from: dholland@NetBSD.org Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Fri Dec 17 22:41:22 2010 (r216511) +++ head/usr.bin/stat/stat.c Sat Dec 18 00:30:52 2010 (r216512) @@ -30,7 +30,7 @@ #include #if 0 #ifndef lint -__RCSID("$NetBSD: stat.c,v 1.30 2010/11/25 04:33:30 dholland Exp $" +__RCSID("$NetBSD: stat.c,v 1.31 2010/12/16 05:30:16 dholland Exp $" "$OpenBSD: stat.c,v 1.14 2009/06/24 09:44:25 sobrado Exp $"); #endif #endif @@ -789,7 +789,7 @@ format1(const struct stat *st, small = 0; data = 0; if (file == NULL) { - (void)strncpy(path, "(stdin)", sizeof(path)); + (void)strlcpy(path, "(stdin)", sizeof(path)); sdata = path; } else { snprintf(path, sizeof(path), " -> "); @@ -877,7 +877,7 @@ format1(const struct stat *st, case SHOW_filename: small = 0; data = 0; - (void)strncpy(path, file, sizeof(path)); + (void)strlcpy(path, file, sizeof(path)); sdata = path; formats = FMTF_STRING; if (ofmt == 0) From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 02:54:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08B15106566B; Sat, 18 Dec 2010 02:54:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB3568FC0A; Sat, 18 Dec 2010 02:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBI2spRm037794; Sat, 18 Dec 2010 02:54:51 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBI2sp2N037792; Sat, 18 Dec 2010 02:54:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201012180254.oBI2sp2N037792@svn.freebsd.org> From: Ed Maste Date: Sat, 18 Dec 2010 02:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216513 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 02:54:52 -0000 Author: emaste Date: Sat Dec 18 02:54:51 2010 New Revision: 216513 URL: http://svn.freebsd.org/changeset/base/216513 Log: Add Exar octal PCI UART. Submitted by: Mark Johnston Obtained from: Sandvine Incorporated Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Sat Dec 18 00:30:52 2010 (r216512) +++ head/sys/dev/puc/pucdata.c Sat Dec 18 02:54:51 2010 (r216513) @@ -554,6 +554,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_cronyx }, + { 0x13a8, 0x0258, 0xffff, 0, + "Exar XR17V258IV", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 04:07:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0554106564A; Sat, 18 Dec 2010 04:07:55 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4F65A8FC0C; Sat, 18 Dec 2010 04:07:55 +0000 (UTC) Received: from orion.SpringDaemons.com (207.47.0.2.static.nextweb.net [207.47.0.2]) by mx0.deglitch.com (Postfix) with ESMTPA id BEA3C8FC27; Sat, 18 Dec 2010 07:07:53 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 4B4625C35; Fri, 17 Dec 2010 20:07:43 -0800 (PST) Date: Fri, 17 Dec 2010 20:07:43 -0800 From: Stanislav Sedov To: Nathan Whitehorn Message-Id: <20101217200743.15590b35.stas@FreeBSD.org> In-Reply-To: <4D0B801A.7050608@freebsd.org> References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <4D0B801A.7050608@freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 04:07:55 -0000 On Fri, 17 Dec 2010 09:22:02 -0600 Nathan Whitehorn mentioned: > I have a patch at http://people.freebsd.org/~nwhitehorn/universe.diff > that fixes both of these problems, by teaching the universe rule in > src/Makefile about MACHINEs with multiple MACHINE_ARCHs and by enabling > the build of the FDT tools by default, which adds about 300K to world. > The way these are done is probably not optimal, but it is a better than > the current situation and is a good stopgap. With the patch, all > architectures succeed except for the ARM AVILA kernel, which seems > genuinely broken, and the various 64-bit MIPS kernels, since 64-bit MIPS > is not hooked up to the build yet. If I don't hear any objections, I > would like to commit it on Wednesday the 22nd. Please, do! And I can look into Avila build problems if you like. -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 07:27:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D6031065672; Sat, 18 Dec 2010 07:27:56 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id D40FC8FC08; Sat, 18 Dec 2010 07:27:55 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 1D036E3F07B; Sat, 18 Dec 2010 08:08:07 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DC7tUWagMsEa; Sat, 18 Dec 2010 08:08:04 +0100 (CET) Received: from pluto.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 7CC2DE3F079; Sat, 18 Dec 2010 08:08:03 +0100 (CET) Date: Sat, 18 Dec 2010 08:08:00 +0100 From: Joel Dahl To: Alan Cox Message-ID: <20101218070800.GA59878@pluto.vnode.local> References: <201012092016.oB9KG05P049565@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012092016.oB9KG05P049565@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216333 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 07:27:56 -0000 On 09-12-2010 20:16, Alan Cox wrote: > Author: alc > Date: Thu Dec 9 20:16:00 2010 > New Revision: 216333 > URL: http://svn.freebsd.org/changeset/base/216333 > > Log: > When r207410 eliminated the acquisition and release of the page queues > lock from pmap_extract_and_hold(), it didn't take into account that > pmap_pte_quick() sometimes requires the page queues lock to be held. > This change reimplements pmap_extract_and_hold() such that it no > longer uses pmap_pte_quick(), and thus never requires the page queues > lock. > > For consistency, adopt the same idiom as used by the new > implementation of pmap_extract_and_hold() in pmap_extract() and > pmap_mincore(). It also happens to make these functions shorter. Hi Alan, This commit makes my laptop hang everytime I quit X. I just get a black screen and the machine won't respond to any keys. Everything works if I go back to r216330. -- Joel From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 09:17:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DAB61065679; Sat, 18 Dec 2010 09:17:08 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh6.mail.rice.edu (mh6.mail.rice.edu [128.42.201.4]) by mx1.freebsd.org (Postfix) with ESMTP id 37ADB8FC14; Sat, 18 Dec 2010 09:17:07 +0000 (UTC) Received: from mh6.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh6.mail.rice.edu (Postfix) with ESMTP id 159E128F814; Sat, 18 Dec 2010 03:17:07 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh6.mail.rice.edu, auth channel Received: from mh6.mail.rice.edu ([127.0.0.1]) by mh6.mail.rice.edu (mh6.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id Q8Z-NzGvFlRo; Sat, 18 Dec 2010 03:17:06 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh6.mail.rice.edu (Postfix) with ESMTPSA id 6EBB628F813; Sat, 18 Dec 2010 03:17:06 -0600 (CST) Message-ID: <4D0C7C0F.4000703@rice.edu> Date: Sat, 18 Dec 2010 03:17:03 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Joel Dahl References: <201012092016.oB9KG05P049565@svn.freebsd.org> <20101218070800.GA59878@pluto.vnode.local> In-Reply-To: <20101218070800.GA59878@pluto.vnode.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216333 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 09:17:08 -0000 Joel Dahl wrote: > On 09-12-2010 20:16, Alan Cox wrote: > >> Author: alc >> Date: Thu Dec 9 20:16:00 2010 >> New Revision: 216333 >> URL: http://svn.freebsd.org/changeset/base/216333 >> >> Log: >> When r207410 eliminated the acquisition and release of the page queues >> lock from pmap_extract_and_hold(), it didn't take into account that >> pmap_pte_quick() sometimes requires the page queues lock to be held. >> This change reimplements pmap_extract_and_hold() such that it no >> longer uses pmap_pte_quick(), and thus never requires the page queues >> lock. >> >> For consistency, adopt the same idiom as used by the new >> implementation of pmap_extract_and_hold() in pmap_extract() and >> pmap_mincore(). It also happens to make these functions shorter. >> > > Hi Alan, > > This commit makes my laptop hang everytime I quit X. I just get a black > screen and the machine won't respond to any keys. Everything works if I > go back to r216330. > > Can you please try the following change? Index: i386/i386/pmap.c =================================================================== --- i386/i386/pmap.c (revision 216509) +++ i386/i386/pmap.c (working copy) @@ -1342,7 +1342,8 @@ retry: m = PHYS_TO_VM_PAGE(pa); vm_page_hold(m); PA_UNLOCK(locked_pa); - } + } else + PA_UNLOCK_COND(locked_pa); PMAP_UNLOCK(pmap); return (m); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 10:09:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDF11065670; Sat, 18 Dec 2010 10:09:08 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00EAD8FC12; Sat, 18 Dec 2010 10:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIA971U073476; Sat, 18 Dec 2010 10:09:07 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIA97W7073474; Sat, 18 Dec 2010 10:09:07 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012181009.oBIA97W7073474@svn.freebsd.org> From: Bruce Cran Date: Sat, 18 Dec 2010 10:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216515 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 10:09:08 -0000 Author: brucec Date: Sat Dec 18 10:09:07 2010 New Revision: 216515 URL: http://svn.freebsd.org/changeset/base/216515 Log: Sort cross references by section. Reported by: pluknet Modified: head/lib/libc/sys/shmget.2 Modified: head/lib/libc/sys/shmget.2 ============================================================================== --- head/lib/libc/sys/shmget.2 Sat Dec 18 06:51:48 2010 (r216514) +++ head/lib/libc/sys/shmget.2 Sat Dec 18 10:09:07 2010 (r216515) @@ -142,5 +142,5 @@ already exists. .Xr shmat 2 , .Xr shmctl 2 , .Xr shmdt 2 , -.Xr ftok 3 , -.Xr stat 2 +.Xr stat 2 , +.Xr ftok 3 From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 10:35:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C4DB106564A; Sat, 18 Dec 2010 10:35:50 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id C49058FC12; Sat, 18 Dec 2010 10:35:49 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 71F36E3F07B; Sat, 18 Dec 2010 11:35:48 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iMQQKoabxXJR; Sat, 18 Dec 2010 11:35:45 +0100 (CET) Received: from pluto.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 00053E3F079; Sat, 18 Dec 2010 11:35:44 +0100 (CET) Date: Sat, 18 Dec 2010 11:35:42 +0100 From: Joel Dahl To: Alan Cox Message-ID: <20101218103542.GB59878@pluto.vnode.local> References: <201012092016.oB9KG05P049565@svn.freebsd.org> <20101218070800.GA59878@pluto.vnode.local> <4D0C7C0F.4000703@rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D0C7C0F.4000703@rice.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216333 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 10:35:50 -0000 On 18-12-2010 3:17, Alan Cox wrote: > Joel Dahl wrote: > > On 09-12-2010 20:16, Alan Cox wrote: > > > >> Author: alc > >> Date: Thu Dec 9 20:16:00 2010 > >> New Revision: 216333 > >> URL: http://svn.freebsd.org/changeset/base/216333 > >> > >> Log: > >> When r207410 eliminated the acquisition and release of the page queues > >> lock from pmap_extract_and_hold(), it didn't take into account that > >> pmap_pte_quick() sometimes requires the page queues lock to be held. > >> This change reimplements pmap_extract_and_hold() such that it no > >> longer uses pmap_pte_quick(), and thus never requires the page queues > >> lock. > >> > >> For consistency, adopt the same idiom as used by the new > >> implementation of pmap_extract_and_hold() in pmap_extract() and > >> pmap_mincore(). It also happens to make these functions shorter. > >> > > > > Hi Alan, > > > > This commit makes my laptop hang everytime I quit X. I just get a black > > screen and the machine won't respond to any keys. Everything works if I > > go back to r216330. > > > > > > Can you please try the following change? I'm afraid the patch didn't make any difference. It still hangs. -- Joel From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 11:23:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D0F106566C; Sat, 18 Dec 2010 11:23:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C2AE88FC18; Sat, 18 Dec 2010 11:23:50 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oBIBLH4r077438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Dec 2010 13:21:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oBIBLHDE020343; Sat, 18 Dec 2010 13:21:17 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oBIBLHZ8020342; Sat, 18 Dec 2010 13:21:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 18 Dec 2010 13:21:17 +0200 From: Kostik Belousov To: Joel Dahl Message-ID: <20101218112117.GA33073@deviant.kiev.zoral.com.ua> References: <201012092016.oB9KG05P049565@svn.freebsd.org> <20101218070800.GA59878@pluto.vnode.local> <4D0C7C0F.4000703@rice.edu> <20101218103542.GB59878@pluto.vnode.local> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i8JMrHMYKg4kZNKW" Content-Disposition: inline In-Reply-To: <20101218103542.GB59878@pluto.vnode.local> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Alan Cox Subject: Re: svn commit: r216333 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 11:23:51 -0000 --i8JMrHMYKg4kZNKW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 18, 2010 at 11:35:42AM +0100, Joel Dahl wrote: > On 18-12-2010 3:17, Alan Cox wrote: > > Joel Dahl wrote: > > > On 09-12-2010 20:16, Alan Cox wrote: > > > =20 > > >> Author: alc > > >> Date: Thu Dec 9 20:16:00 2010 > > >> New Revision: 216333 > > >> URL: http://svn.freebsd.org/changeset/base/216333 > > >> > > >> Log: > > >> When r207410 eliminated the acquisition and release of the page qu= eues > > >> lock from pmap_extract_and_hold(), it didn't take into account that > > >> pmap_pte_quick() sometimes requires the page queues lock to be hel= d. > > >> This change reimplements pmap_extract_and_hold() such that it no > > >> longer uses pmap_pte_quick(), and thus never requires the page que= ues > > >> lock. > > >> =20 > > >> For consistency, adopt the same idiom as used by the new > > >> implementation of pmap_extract_and_hold() in pmap_extract() and > > >> pmap_mincore(). It also happens to make these functions shorter. > > >> =20 > > > > > > Hi Alan, > > > > > > This commit makes my laptop hang everytime I quit X. I just get a bl= ack > > > screen and the machine won't respond to any keys. Everything works i= f I > > > go back to r216330. > > > > > > =20 > >=20 > > Can you please try the following change? >=20 > I'm afraid the patch didn't make any difference. It still hangs. I already looked at the similar report. It seems that the driver allocates a page using kmem_alloc_contig(), then creates OBJT_SG object, and changes the mapping to use the fictitious page instantiated by sg object. Since kmem_free() sees wired mapping, it calls vm_fault_unwire(), which is incompatible with fictitious wired pages. I cannot guarantee that this is definitely what happens, but backtrace looked plausible. --i8JMrHMYKg4kZNKW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0MmSwACgkQC3+MBN1Mb4go1gCgyMQ7qaqKw82wHfhSl2GFbghR 7jcAn2tZyjfuX3tf54yyj3pUh2K6AID9 =wkly -----END PGP SIGNATURE----- --i8JMrHMYKg4kZNKW-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 11:31:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9452F1065674; Sat, 18 Dec 2010 11:31:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8395B8FC1B; Sat, 18 Dec 2010 11:31:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIBVWlq078884; Sat, 18 Dec 2010 11:31:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIBVWgw078882; Sat, 18 Dec 2010 11:31:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012181131.oBIBVWgw078882@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Dec 2010 11:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216516 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 11:31:32 -0000 Author: kib Date: Sat Dec 18 11:31:32 2010 New Revision: 216516 URL: http://svn.freebsd.org/changeset/base/216516 Log: In pmap_extract(), unlock pmap lock earlier. The calculation does not need the lock when operating on local variables. Reviewed by: alc Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Dec 18 10:09:07 2010 (r216515) +++ head/sys/i386/i386/pmap.c Sat Dec 18 11:31:32 2010 (r216516) @@ -1299,13 +1299,13 @@ pmap_extract(pmap_t pmap, vm_offset_t va ptep = pmap_pte(pmap, va); pte = (ptep != NULL) ? *ptep : 0; pmap_pte_release(ptep); + PMAP_UNLOCK(pmap); if ((pte & PG_V) != 0) { if ((pte & PG_PS) != 0) rtval = (pte & PG_PS_FRAME) | (va & PDRMASK); else rtval = (pte & PG_FRAME) | (va & PAGE_MASK); } - PMAP_UNLOCK(pmap); return (rtval); } From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 12:52:18 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C6581065670; Sat, 18 Dec 2010 12:52:18 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id F26A88FC14; Sat, 18 Dec 2010 12:52:17 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oBICpcQn045979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Dec 2010 13:51:38 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1292676699; bh=yMdoU3Nhlflgkx4dyMVmAOqbnjYQxYouNb0hgvoRUHg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=qbGImbA/DXQ+lqtIBv9ofeVv5wA/Ljf0xCpC4wgALTHyy+uWZeDqH6pIc3AIV7S0q Gj6eCKMsrRauUW/pLaix0WAJRnpEol1RKw3J8YRTm6reqvCjVsZa0hlJvUwkBsZRtI j68o5jT2gem2iPynxlMmRrfYO8nTbAXt166F8DDY= Date: Sat, 18 Dec 2010 13:51:38 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: "David O'Brien" Message-ID: <20101218125138.GY23098@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , David O'Brien , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <201012161422.48209.jhb@freebsd.org> <20101216202319.GS23098@acme.spoerlein.net> <4D0A7618.2080209@delphij.net> <20101217004348.GA10254@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101217004348.GA10254@dragon.NUXI.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 12:52:18 -0000 On Thu, 16.12.2010 at 16:43:48 -0800, David O'Brien wrote: > On Thu, Dec 16, 2010 at 12:27:04PM -0800, Xin LI wrote: > > On 12/16/10 12:23, Ulrich Spörlein wrote: > > > Shamless plug: the attached, crude expect(1) script allows you to do > > > $ cd /usr/src && universe-build sbin/geom WARNS=6 > > > > > > with the minimal amount of compilation (you have to build the toolchain > > > once, though). I found it invaluable. > > > > I think we could probably put that in src/tools/somewhere... > > Ulrich, > Yes, please. I'd love to, but some tcl/expect expert should get in contact with me first, as the script has some serious deficiencies that need fixing before a public release. Uli From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 14:21:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66B2B106564A; Sat, 18 Dec 2010 14:21:29 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 544168FC0A; Sat, 18 Dec 2010 14:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIELTLH093641; Sat, 18 Dec 2010 14:21:29 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIELTSd093635; Sat, 18 Dec 2010 14:21:29 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201012181421.oBIELTSd093635@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 18 Dec 2010 14:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216518 - in head/sys/dev: if_ndis le malo sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 14:21:29 -0000 Author: tijl Date: Sat Dec 18 14:21:28 2010 New Revision: 216518 URL: http://svn.freebsd.org/changeset/base/216518 Log: Use convenience functions where possible instead of accessing the PCI configuration registers directly. Remove pci_enable_io calls where they are redundant. The PCI bus driver will set the right bits when the corresponding bus resource is activated. Remove redundant pci_* function calls from suspend/resume methods. The bus driver already saves and restores the PCI configuration. Reviewed by: jhb Approved by: kib (mentor) Modified: head/sys/dev/if_ndis/if_ndis_pci.c head/sys/dev/le/if_le_pci.c head/sys/dev/malo/if_malo_pci.c head/sys/dev/sound/pci/atiixp.c head/sys/dev/sound/pci/ich.c Modified: head/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_pci.c Sat Dec 18 11:45:54 2010 (r216517) +++ head/sys/dev/if_ndis/if_ndis_pci.c Sat Dec 18 14:21:28 2010 (r216518) @@ -116,8 +116,8 @@ ndis_devcompare(bustype, t, dev) while(t->ndis_name != NULL) { if ((pci_get_vendor(dev) == t->ndis_vid) && (pci_get_device(dev) == t->ndis_did) && - ((pci_read_config(dev, PCIR_SUBVEND_0, 4) == - t->ndis_subsys) || t->ndis_subsys == 0)) { + (pci_get_subvendor(dev) == t->ndis_subsys || + t->ndis_subsys == 0)) { device_set_desc(dev, t->ndis_name); return(TRUE); } @@ -201,7 +201,6 @@ ndis_attach_pci(dev) error = ENXIO; goto fail; } - pci_enable_io(dev, SYS_RES_IOPORT); break; case SYS_RES_MEMORY: if (sc->ndis_res_altmem != NULL && @@ -239,7 +238,6 @@ ndis_attach_pci(dev) goto fail; } } - pci_enable_io(dev, SYS_RES_MEMORY); break; case SYS_RES_IRQ: rid = rle->rid; @@ -309,11 +307,8 @@ ndis_attach_pci(dev) (pci_get_device(dev) == t->ndis_did)) { if (t->ndis_subsys == 0) defidx = devidx; - else { - if (t->ndis_subsys == - pci_read_config(dev, PCIR_SUBVEND_0, 4)) - break; - } + else if (pci_get_subvendor(dev) == t->ndis_subsys) + break; } t++; devidx++; Modified: head/sys/dev/le/if_le_pci.c ============================================================================== --- head/sys/dev/le/if_le_pci.c Sat Dec 18 11:45:54 2010 (r216517) +++ head/sys/dev/le/if_le_pci.c Sat Dec 18 14:21:28 2010 (r216518) @@ -312,7 +312,6 @@ le_pci_attach(device_t dev) LE_LOCK_INIT(sc, device_get_nameunit(dev)); pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); i = PCIR_BAR(0); lesc->sc_rres = bus_alloc_resource_any(dev, SYS_RES_IOPORT, Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Sat Dec 18 11:45:54 2010 (r216517) +++ head/sys/dev/malo/if_malo_pci.c Sat Dec 18 14:21:28 2010 (r216518) @@ -150,21 +150,6 @@ malo_pci_probe(device_t dev) } static int -malo_pci_setup(device_t dev) -{ - - /* - * Enable memory mapping and bus mastering. - */ - if (pci_enable_busmaster(dev) != 0) - return -1; - if (pci_enable_io(dev, SYS_RES_MEMORY) != 0) - return -1; - - return 0; -} - -static int malo_pci_attach(device_t dev) { int error = ENXIO, i, msic, reg; @@ -173,11 +158,7 @@ malo_pci_attach(device_t dev) sc->malo_dev = dev; - /* - * Enable memory mapping and bus mastering. - */ - if (malo_pci_setup(dev)) - return (ENXIO); + pci_enable_busmaster(dev); /* * Setup memory-mapping of PCI registers. @@ -342,9 +323,6 @@ malo_pci_resume(device_t dev) { struct malo_pci_softc *psc = device_get_softc(dev); - if (!malo_pci_setup(dev)) - return ENXIO; - malo_resume(&psc->malo_sc); return (0); Modified: head/sys/dev/sound/pci/atiixp.c ============================================================================== --- head/sys/dev/sound/pci/atiixp.c Sat Dec 18 11:45:54 2010 (r216517) +++ head/sys/dev/sound/pci/atiixp.c Sat Dec 18 14:21:28 2010 (r216518) @@ -1202,7 +1202,6 @@ atiixp_pci_attach(device_t dev) else sc->polling = 0; - pci_set_powerstate(dev, PCI_POWERSTATE_D0); pci_enable_busmaster(dev); sc->regid = PCIR_BAR(0); @@ -1354,7 +1353,6 @@ atiixp_pci_suspend(device_t dev) value = atiixp_rd(sc, ATI_REG_CMD); value |= ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET; atiixp_wr(sc, ATI_REG_CMD, ATI_REG_CMD_POWERDOWN); - pci_set_powerstate(dev, PCI_POWERSTATE_D3); atiixp_unlock(sc); return (0); @@ -1366,10 +1364,6 @@ atiixp_pci_resume(device_t dev) struct atiixp_info *sc = pcm_getdevinfo(dev); atiixp_lock(sc); - /* power up pci bus */ - pci_set_powerstate(dev, PCI_POWERSTATE_D0); - pci_enable_io(dev, SYS_RES_MEMORY); - pci_enable_busmaster(dev); /* reset / power up aclink */ atiixp_reset_aclink(sc); atiixp_unlock(sc); Modified: head/sys/dev/sound/pci/ich.c ============================================================================== --- head/sys/dev/sound/pci/ich.c Sat Dec 18 11:45:54 2010 (r216517) +++ head/sys/dev/sound/pci/ich.c Sat Dec 18 14:21:28 2010 (r216518) @@ -1192,12 +1192,6 @@ ich_pci_resume(device_t dev) sc = pcm_getdevinfo(dev); - if (sc->regtype == SYS_RES_IOPORT) - pci_enable_io(dev, SYS_RES_IOPORT); - else - pci_enable_io(dev, SYS_RES_MEMORY); - pci_enable_busmaster(dev); - ICH_LOCK(sc); /* Reinit audio device */ if (ich_init(sc) == -1) { From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 14:24:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD87B1065674; Sat, 18 Dec 2010 14:24:24 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81BEB8FC26; Sat, 18 Dec 2010 14:24:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIEOO1J094018; Sat, 18 Dec 2010 14:24:24 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIEOOeB094016; Sat, 18 Dec 2010 14:24:24 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201012181424.oBIEOOeB094016@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 18 Dec 2010 14:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216519 - head/sys/dev/hifn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 14:24:24 -0000 Author: tijl Date: Sat Dec 18 14:24:24 2010 New Revision: 216519 URL: http://svn.freebsd.org/changeset/base/216519 Log: No need to zero the softc. It's allocated with M_ZERO. Use pci_enable_busmaster instead of setting PCIM_CMD_BUSMASTEREN directly. There's no need to set PCIM_CMD_MEMEN. The bit is set when a SYS_RES_MEMORY resource is activated. Remove redundant pci_* function calls from suspend/resume methods. The bus driver already saves and restores the PCI configuration. Write 1 byte instead of 4 when setting the HIFN_TRDY_TIMEOUT register. It is only 1 byte according to the specification. Reviewed by: jhb Approved by: kib (mentor) Modified: head/sys/dev/hifn/hifn7751.c Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Sat Dec 18 14:21:28 2010 (r216518) +++ head/sys/dev/hifn/hifn7751.c Sat Dec 18 14:24:24 2010 (r216519) @@ -355,14 +355,11 @@ static int hifn_attach(device_t dev) { struct hifn_softc *sc = device_get_softc(dev); - u_int32_t cmd; caddr_t kva; int rseg, rid; char rbase; u_int16_t ena, rev; - KASSERT(sc != NULL, ("hifn_attach: null software carrier!")); - bzero(sc, sizeof (*sc)); sc->sc_dev = dev; mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "hifn driver", MTX_DEF); @@ -402,30 +399,13 @@ hifn_attach(device_t dev) } /* - * Configure support for memory-mapped access to - * registers and for DMA operations. - */ -#define PCIM_ENA (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN) - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - cmd |= PCIM_ENA; - pci_write_config(dev, PCIR_COMMAND, cmd, 4); - cmd = pci_read_config(dev, PCIR_COMMAND, 4); - if ((cmd & PCIM_ENA) != PCIM_ENA) { - device_printf(dev, "failed to enable %s\n", - (cmd & PCIM_ENA) == 0 ? - "memory mapping & bus mastering" : - (cmd & PCIM_CMD_MEMEN) == 0 ? - "memory mapping" : "bus mastering"); - goto fail_pci; - } -#undef PCIM_ENA - - /* * Setup PCI resources. Note that we record the bus * tag and handle for each register mapping, this is * used by the READ_REG_0, WRITE_REG_0, READ_REG_1, * and WRITE_REG_1 macros throughout the driver. */ + pci_enable_busmaster(dev); + rid = HIFN_BAR0; sc->sc_bar0res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -727,10 +707,6 @@ hifn_resume(device_t dev) { struct hifn_softc *sc = device_get_softc(dev); #ifdef notyet - /* reenable busmastering */ - pci_enable_busmaster(dev); - pci_enable_io(dev, HIFN_RES); - /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) rl_init(sc); @@ -910,7 +886,7 @@ hifn_set_retry(struct hifn_softc *sc) { /* NB: RETRY only responds to 8-bit reads/writes */ pci_write_config(sc->sc_dev, HIFN_RETRY_TIMEOUT, 0, 1); - pci_write_config(sc->sc_dev, HIFN_TRDY_TIMEOUT, 0, 4); + pci_write_config(sc->sc_dev, HIFN_TRDY_TIMEOUT, 0, 1); } /* From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 14:34:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C11BA106566B; Sat, 18 Dec 2010 14:34:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A41B08FC0A; Sat, 18 Dec 2010 14:34:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIEY5JN095063; Sat, 18 Dec 2010 14:34:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIEY5Nq095061; Sat, 18 Dec 2010 14:34:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012181434.oBIEY5Nq095061@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 18 Dec 2010 14:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216520 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 14:34:05 -0000 Author: nwhitehorn Date: Sat Dec 18 14:34:05 2010 New Revision: 216520 URL: http://svn.freebsd.org/changeset/base/216520 Log: Reconnect arm to the universe build, and connect big-endian MIPS and ARM and powerpc64 to universe for the first time. In general, provide (slightly hacky) knowledge of multi-architecture TARGETs to universe as well as the ability to distinguish the correct toolchain for a given kernel using config -m. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Dec 18 14:24:24 2010 (r216519) +++ head/Makefile Sat Dec 18 14:34:05 2010 (r216520) @@ -281,7 +281,15 @@ tinderbox: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) -TARGETS?=amd64 i386 ia64 pc98 powerpc sparc64 sun4v mips +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGET_ARCHES_arm?= arm armeb +TARGET_ARCHES_mips?= mipsel mipseb +TARGET_ARCHES_powerpc?= powerpc powerpc64 +TARGET_ARCHES_pc98?= i386 +TARGET_ARCHES_sun4v?= sparc64 +.for target in ${TARGETS} +TARGET_ARCHES_${target}?= ${target} +.endfor .if defined(DOING_TINDERBOX) FAILFILE=tinderbox.failed @@ -301,16 +309,24 @@ universe_prologue: .for target in ${TARGETS} universe: universe_${target} .ORDER: universe_prologue universe_${target} universe_epilogue -universe_${target}: -.if !defined(MAKE_JUST_KERNELS) +universe_${target}: universe_${target}_prologue +universe_${target}_prologue: @echo ">> ${target} started on `LC_ALL=C date`" +.if !defined(MAKE_JUST_KERNELS) +.for target_arch in ${TARGET_ARCHES_${target}} +universe_${target}: universe_${target}_${target_arch} +universe_${target}_${target_arch}: universe_${target}_prologue + @echo ">> ${target}.${target_arch} buildworld started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${MAKE} ${JFLAG} buildworld \ TARGET=${target} \ - > _.${target}.buildworld 2>&1 || \ - (echo "${target} world failed," \ - "check _.${target}.buildworld for details" | ${MAKEFAIL})) - @echo ">> ${target} buildworld completed on `LC_ALL=C date`" + TARGET_ARCH=${target_arch} \ + > _.${target}.${target_arch}.buildworld 2>&1 || \ + (echo "${target}.${target_arch} world failed," \ + "check _.${target}.${target_arch}.buildworld for details" | \ + ${MAKEFAIL})) + @echo ">> ${target}.${target_arch} buildworld completed on `LC_ALL=C date`" +.endfor .endif .if !defined(MAKE_JUST_WORLDS) .if exists(${.CURDIR}/sys/${target}/conf/NOTES) @@ -333,9 +349,15 @@ KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/ ! -name DEFAULTS ! -name NOTES universe_kernconfs: .for kernel in ${KERNCONFS} +TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ + config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} | \ + cut -f 2 +universe_kernconfs: universe_kernconf_${TARGET}_${kernel} +universe_kernconf_${TARGET}_${kernel}: @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${MAKE} ${JFLAG} buildkernel \ TARGET=${TARGET} \ + TARGET_ARCH=${TARGET_ARCH_${kernel}} \ KERNCONF=${kernel} \ > _.${TARGET}.${kernel} 2>&1 || \ (echo "${TARGET} ${kernel} kernel failed," \ From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 15:25:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D83191065673; Sat, 18 Dec 2010 15:25:21 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64018FC0A; Sat, 18 Dec 2010 15:25:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIFPLmh099736; Sat, 18 Dec 2010 15:25:21 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIFPLqe099734; Sat, 18 Dec 2010 15:25:21 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181525.oBIFPLqe099734@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 15:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216521 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 15:25:21 -0000 Author: bschmidt Date: Sat Dec 18 15:25:21 2010 New Revision: 216521 URL: http://svn.freebsd.org/changeset/base/216521 Log: Fix a panic while disabling the RF kill button, caller of the wpi_rfkill_resume() function will take care of the lock. PR: kern/144898 MFC after: 3 days Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Dec 18 14:34:05 2010 (r216520) +++ head/sys/dev/wpi/if_wpi.c Sat Dec 18 15:25:21 2010 (r216521) @@ -3004,14 +3004,12 @@ wpi_rfkill_resume(struct wpi_softc *sc) if (ntries == 1000) { device_printf(sc->sc_dev, "timeout waiting for thermal calibration\n"); - WPI_UNLOCK(sc); return; } DPRINTFN(WPI_DEBUG_TEMP,("temperature %d\n", sc->temp)); if (wpi_config(sc) != 0) { device_printf(sc->sc_dev, "device config failed\n"); - WPI_UNLOCK(sc); return; } From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 15:34:21 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893BB1065672; Sat, 18 Dec 2010 15:34:21 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 46F1F8FC27; Sat, 18 Dec 2010 15:34:20 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4173A582C7; Sat, 18 Dec 2010 09:34:20 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id hJgiBwfdpfv5; Sat, 18 Dec 2010 09:34:20 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-71-150-248-191.dsl.mdsnwi.sbcglobal.net [71.150.248.191]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 7E18A582C3; Sat, 18 Dec 2010 09:34:19 -0600 (CST) Message-ID: <4D0CD47A.2060707@freebsd.org> Date: Sat, 18 Dec 2010 09:34:18 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101214 Thunderbird/3.1.7 MIME-Version: 1.0 To: Warner Losh References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <4D0B801A.7050608@freebsd.org> <4D0BB4F0.5090908@bsdimp.com> In-Reply-To: <4D0BB4F0.5090908@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 15:34:21 -0000 On 12/17/10 13:07, Warner Losh wrote: > On 12/17/2010 08:22, Nathan Whitehorn wrote: >> On 12/16/10 13:04, Robert Watson wrote: >>> On Thu, 16 Dec 2010, David O'Brien wrote: >>> >>>>>> Log: >>>>>> Bump WARNS to 6. >>>>>> >>>>>> Modified: >>>>>> head/sbin/geom/class/eli/Makefile >>>>> >>>>> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >>>> >>>> Errr. Reverted. I built it on the architectures I had access to... >>> >>> For WARNS-related changes, I generally use "make universe" to test >>> across architectures. This builds all of our architectures world + >>> all available kernels, and seems the most effective way to avoid the >>> above situations. (I've fallen into exactly the same trap...) >>> >>> The one thing to be cautious about is that make universe won't fail >>> if an individual build fails, so you need to check the logs to make >>> sure everything actually succeeded. >> >> The trouble with make universe is that it has been broken for months >> and months now. ARM and powerpc64 are disconnected from the build >> entirely, as are big-endian and 64-bit MIPS, and an increasing number >> of ARM and PowerPC kernels depend on FDT tools not built by default, >> and so do not build. Build infrastructure changes also make it appear >> that the PowerPC GENERIC64 kernel is broken when it is not. This >> severely reduces the coverage of make universe for problems like this. >> >> I have a patch at http://people.freebsd.org/~nwhitehorn/universe.diff >> that fixes both of these problems, by teaching the universe rule in >> src/Makefile about MACHINEs with multiple MACHINE_ARCHs and by >> enabling the build of the FDT tools by default, which adds about 300K >> to world. The way these are done is probably not optimal, but it is a >> better than the current situation and is a good stopgap. With the >> patch, all architectures succeed except for the ARM AVILA kernel, >> which seems genuinely broken, and the various 64-bit MIPS kernels, >> since 64-bit MIPS is not hooked up to the build yet. If I don't hear >> any objections, I would like to commit it on Wednesday the 22nd. > That works for me. As far as I can tell, doing the MIPS64 stuff will > just take about a day of patiently fixing some breakage... Maybe I'll > get to it over the holidays. Thanks! With your imprimatur, I've committed the src/Makefile portion of the patch early. The FDT piece will wait until Wednesday, as announced. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 15:35:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13877106566B; Sat, 18 Dec 2010 15:35:11 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01C688FC08; Sat, 18 Dec 2010 15:35:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIFZAsj000625; Sat, 18 Dec 2010 15:35:10 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIFZATX000623; Sat, 18 Dec 2010 15:35:10 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181535.oBIFZATX000623@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 15:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216522 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 15:35:11 -0000 Author: bschmidt Date: Sat Dec 18 15:35:10 2010 New Revision: 216522 URL: http://svn.freebsd.org/changeset/base/216522 Log: Fix association on 5GHz channels. The device is initially configured using a 2GHz channel with appropriate flags set to sc->config. Due to not zeroing sc->config for auth/assoc those flags are still set while trying to connect on a 5GHz channel. MFC after: 3 days Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Dec 18 15:25:21 2010 (r216521) +++ head/sys/dev/wpi/if_wpi.c Sat Dec 18 15:35:10 2010 (r216522) @@ -2429,6 +2429,9 @@ wpi_auth(struct wpi_softc *sc, struct ie if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) { sc->config.flags |= htole32(WPI_CONFIG_AUTO | WPI_CONFIG_24GHZ); + } else { + sc->config.flags &= ~htole32(WPI_CONFIG_AUTO | + WPI_CONFIG_24GHZ); } if (IEEE80211_IS_CHAN_A(ni->ni_chan)) { sc->config.cck_mask = 0; From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 15:45:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0283D106564A; Sat, 18 Dec 2010 15:45:11 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B848FC08; Sat, 18 Dec 2010 15:45:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIFjAOu001417; Sat, 18 Dec 2010 15:45:10 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIFjAXq001415; Sat, 18 Dec 2010 15:45:10 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181545.oBIFjAXq001415@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 15:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216523 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 15:45:11 -0000 Author: bschmidt Date: Sat Dec 18 15:45:10 2010 New Revision: 216523 URL: http://svn.freebsd.org/changeset/base/216523 Log: Add 2 missing bus_dmamap_sync() calls. Those fix random 'scan timeout', 'could not set power mode', 'device config failed' and other errors due reading invalid memory. Obtained from: OpenBSD MFC after: 3 days Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Dec 18 15:35:10 2010 (r216522) +++ head/sys/dev/wpi/if_wpi.c Sat Dec 18 15:45:10 2010 (r216523) @@ -1645,9 +1645,15 @@ wpi_notif_intr(struct wpi_softc *sc) struct wpi_rx_data *data; uint32_t hw; + bus_dmamap_sync(sc->shared_dma.tag, sc->shared_dma.map, + BUS_DMASYNC_POSTREAD); + hw = le32toh(sc->shared->next); while (sc->rxq.cur != hw) { data = &sc->rxq.data[sc->rxq.cur]; + + bus_dmamap_sync(sc->rxq.data_dmat, data->map, + BUS_DMASYNC_POSTREAD); desc = (void *)data->m->m_ext.ext_buf; DPRINTFN(WPI_DEBUG_NOTIFY, From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 16:41:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54E34106566C; Sat, 18 Dec 2010 16:41:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42C978FC1C; Sat, 18 Dec 2010 16:41:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIGfCEc006815; Sat, 18 Dec 2010 16:41:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIGfC1L006811; Sat, 18 Dec 2010 16:41:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012181641.oBIGfC1L006811@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Dec 2010 16:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216524 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 16:41:12 -0000 Author: kib Date: Sat Dec 18 16:41:11 2010 New Revision: 216524 URL: http://svn.freebsd.org/changeset/base/216524 Log: Inform a compiler which asm statements in the x86 implementation of atomics change eflags. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Sat Dec 18 15:45:10 2010 (r216523) +++ head/sys/amd64/include/atomic.h Sat Dec 18 16:41:11 2010 (r216524) @@ -108,7 +108,8 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE { \ __asm __volatile(MPLOCKED OP \ : "=m" (*p) \ - : CONS (V), "m" (*p)); \ + : CONS (V), "m" (*p) \ + : "cc"); \ } \ \ static __inline void \ @@ -117,7 +118,7 @@ atomic_##NAME##_barr_##TYPE(volatile u_# __asm __volatile(MPLOCKED OP \ : "=m" (*p) \ : CONS (V), "m" (*p) \ - : "memory"); \ + : "memory", "cc"); \ } \ struct __hack @@ -145,7 +146,7 @@ atomic_cmpset_int(volatile u_int *dst, u : "r" (src), /* 2 */ "a" (expect), /* 3 */ "m" (*dst) /* 4 */ - : "memory"); + : "memory", "cc"); return (res); } @@ -166,7 +167,7 @@ atomic_cmpset_long(volatile u_long *dst, : "r" (src), /* 2 */ "a" (expect), /* 3 */ "m" (*dst) /* 4 */ - : "memory"); + : "memory", "cc"); return (res); } @@ -185,8 +186,8 @@ atomic_fetchadd_int(volatile u_int *p, u "# atomic_fetchadd_int" : "+r" (v), /* 0 (result) */ "=m" (*p) /* 1 */ - : "m" (*p)); /* 2 */ - + : "m" (*p) /* 2 */ + : "cc"); return (v); } @@ -204,8 +205,8 @@ atomic_fetchadd_long(volatile u_long *p, "# atomic_fetchadd_long" : "+r" (v), /* 0 (result) */ "=m" (*p) /* 1 */ - : "m" (*p)); /* 2 */ - + : "m" (*p) /* 2 */ + : "cc"); return (v); } @@ -249,7 +250,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE : "=a" (res), /* 0 */ \ "=m" (*p) /* 1 */ \ : "m" (*p) /* 2 */ \ - : "memory"); \ + : "memory", "cc"); \ \ return (res); \ } \ Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Sat Dec 18 15:45:10 2010 (r216523) +++ head/sys/i386/include/atomic.h Sat Dec 18 16:41:11 2010 (r216524) @@ -106,7 +106,8 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE { \ __asm __volatile(MPLOCKED OP \ : "=m" (*p) \ - : CONS (V), "m" (*p)); \ + : CONS (V), "m" (*p) \ + : "cc"); \ } \ \ static __inline void \ @@ -115,7 +116,7 @@ atomic_##NAME##_barr_##TYPE(volatile u_# __asm __volatile(MPLOCKED OP \ : "=m" (*p) \ : CONS (V), "m" (*p) \ - : "memory"); \ + : "memory", "cc"); \ } \ struct __hack @@ -172,7 +173,7 @@ atomic_cmpset_int(volatile u_int *dst, u : "r" (src), /* 2 */ "a" (expect), /* 3 */ "m" (*dst) /* 4 */ - : "memory"); + : "memory", "cc"); return (res); } @@ -193,8 +194,8 @@ atomic_fetchadd_int(volatile u_int *p, u "# atomic_fetchadd_int" : "+r" (v), /* 0 (result) */ "=m" (*p) /* 1 */ - : "m" (*p)); /* 2 */ - + : "m" (*p) /* 2 */ + : "cc"); return (v); } @@ -238,7 +239,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE : "=a" (res), /* 0 */ \ "=m" (*p) /* 1 */ \ : "m" (*p) /* 2 */ \ - : "memory"); \ + : "memory", "cc"); \ \ return (res); \ } \ From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 17:30:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06176106566C; Sat, 18 Dec 2010 17:30:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AC2D08FC19; Sat, 18 Dec 2010 17:30:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBIHQ6FK022006; Sat, 18 Dec 2010 10:26:07 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D0CEEAE.8070506@bsdimp.com> Date: Sat, 18 Dec 2010 10:26:06 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Nathan Whitehorn References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <201012161225.31459.jhb@freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <4D0B801A.7050608@freebsd.org> <4D0BB4F0.5090908@bsdimp.com> <4D0CD47A.2060707@freebsd.org> In-Reply-To: <4D0CD47A.2060707@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 17:30:43 -0000 On 12/18/2010 08:34, Nathan Whitehorn wrote: > On 12/17/10 13:07, Warner Losh wrote: >> On 12/17/2010 08:22, Nathan Whitehorn wrote: >>> On 12/16/10 13:04, Robert Watson wrote: >>>> On Thu, 16 Dec 2010, David O'Brien wrote: >>>> >>>>>>> Log: >>>>>>> Bump WARNS to 6. >>>>>>> >>>>>>> Modified: >>>>>>> head/sbin/geom/class/eli/Makefile >>>>>> >>>>>> FYI, this broke the tinderbox on arm, ia64, mips, and sparc64. >>>>> >>>>> Errr. Reverted. I built it on the architectures I had access to... >>>> >>>> For WARNS-related changes, I generally use "make universe" to test >>>> across architectures. This builds all of our architectures world + >>>> all available kernels, and seems the most effective way to avoid >>>> the above situations. (I've fallen into exactly the same trap...) >>>> >>>> The one thing to be cautious about is that make universe won't fail >>>> if an individual build fails, so you need to check the logs to make >>>> sure everything actually succeeded. >>> >>> The trouble with make universe is that it has been broken for months >>> and months now. ARM and powerpc64 are disconnected from the build >>> entirely, as are big-endian and 64-bit MIPS, and an increasing >>> number of ARM and PowerPC kernels depend on FDT tools not built by >>> default, and so do not build. Build infrastructure changes also make >>> it appear that the PowerPC GENERIC64 kernel is broken when it is >>> not. This severely reduces the coverage of make universe for >>> problems like this. >>> >>> I have a patch at >>> http://people.freebsd.org/~nwhitehorn/universe.diff that fixes both >>> of these problems, by teaching the universe rule in src/Makefile >>> about MACHINEs with multiple MACHINE_ARCHs and by enabling the build >>> of the FDT tools by default, which adds about 300K to world. The way >>> these are done is probably not optimal, but it is a better than the >>> current situation and is a good stopgap. With the patch, all >>> architectures succeed except for the ARM AVILA kernel, which seems >>> genuinely broken, and the various 64-bit MIPS kernels, since 64-bit >>> MIPS is not hooked up to the build yet. If I don't hear any >>> objections, I would like to commit it on Wednesday the 22nd. >> That works for me. As far as I can tell, doing the MIPS64 stuff will >> just take about a day of patiently fixing some breakage... Maybe >> I'll get to it over the holidays. > > Thanks! With your imprimatur, I've committed the src/Makefile portion > of the patch early. The FDT piece will wait until Wednesday, as > announced. FDT should have always been built from the moment it went into the tree. It was a mistake to make it optional, since we have no good way to make host tools optional based on the target we're compiling... Warner From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 17:46:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE3C7106564A; Sat, 18 Dec 2010 17:46:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id EA3C98FC19; Sat, 18 Dec 2010 17:46:39 +0000 (UTC) Received: by wyf19 with SMTP id 19so1612562wyf.13 for ; Sat, 18 Dec 2010 09:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=o+AVg+kbJ/THSORr3Gw0HErO8/uyvdqTIQW9uLtRtPQ=; b=kC3XM/2T4xhhZBEeGzDnlRMNSe3c4WWYl+fgrYtnfIfsRmL0lNYn5U/A8GEatDGlLE rJ6XRXkvKIPl9oJD9THlqoLp5kVd0A/D0ZES21j3ARqB7T/OnRBC3BlBTg64G51JqfoQ YlemuxiNf96e/BEXOLqvB11QmmyrVNk5v4Z7A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=kffBKW/RhXFeDgx9zkRJ11dwq448bT6DqoUXxJmMxn7R8otO/YciYcO7zXA/uZ8oRx JpagfSZrDZi+a2eUXNjuzupbfe/U6YogeMzq4AOZnxqGmuLVx/Jl7Kt1E3KowRpdS8Nl lhnFnr9g5cfDwchLlsnWC00GcwgF/uGi3xUW4= MIME-Version: 1.0 Received: by 10.216.7.8 with SMTP id 8mr27674weo.30.1292694398745; Sat, 18 Dec 2010 09:46:38 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.198.27 with HTTP; Sat, 18 Dec 2010 09:46:38 -0800 (PST) In-Reply-To: <20101218125138.GY23098@acme.spoerlein.net> References: <201012160036.oBG0aAEh003539@svn.freebsd.org> <20101216175536.GA52462@dragon.NUXI.org> <201012161422.48209.jhb@freebsd.org> <20101216202319.GS23098@acme.spoerlein.net> <4D0A7618.2080209@delphij.net> <20101217004348.GA10254@dragon.NUXI.org> <20101218125138.GY23098@acme.spoerlein.net> Date: Sat, 18 Dec 2010 09:46:38 -0800 X-Google-Sender-Auth: u393HueS9KwHABQtv6EGsaWXO-0 Message-ID: From: Garrett Cooper To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= , "David O'Brien" , Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r216473 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 17:46:41 -0000 On Sat, Dec 18, 2010 at 4:51 AM, Ulrich Sp=F6rlein wrot= e: > On Thu, 16.12.2010 at 16:43:48 -0800, David O'Brien wrote: >> On Thu, Dec 16, 2010 at 12:27:04PM -0800, Xin LI wrote: >> > On 12/16/10 12:23, Ulrich Sp=F6rlein wrote: >> > > Shamless plug: the attached, crude expect(1) script allows you to do >> > > $ cd /usr/src && universe-build sbin/geom WARNS=3D6 >> > > >> > > with the minimal amount of compilation (you have to build the toolch= ain >> > > once, though). I found it invaluable. >> > >> > I think we could probably put that in src/tools/somewhere... >> >> Ulrich, >> Yes, please. > > I'd love to, but some tcl/expect expert should get in contact with me > first, as the script has some serious deficiencies that need fixing > before a public release. I can help spotcheck the script. Feel free to CC a copy to me off-list. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 18:41:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1160106564A; Sat, 18 Dec 2010 18:41:14 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2C45F8FC0A; Sat, 18 Dec 2010 18:41:14 +0000 (UTC) Received: by qwj9 with SMTP id 9so1603404qwj.13 for ; Sat, 18 Dec 2010 10:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ycoJNRb3YNO7SDl7DrHgm0OOduOIoe7DdB+LuVdQycs=; b=SDxXqdsQxVUIKg/wJu0Alp68GLtNyNtfY6tR9JXjUjIEUf5fhIiMFDQt0997jwwdD+ k76Vr6c80rxv97C7HetMGbFkQuk3oq7RZcfo6zWM17rzc5ACuehluvc09yFKp0aq6oNH RCAxcoKF8FYPpiMSfDzANqutSL8/wuKRWxjvw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rVeR2DON1iDEG9Hc1ka9rOrn+JgAQfa9s7XfJItFv1RK559XSaJQfyCvC6TiiG2Mwz GloSAXzrscjfIwooAdSW0xdH4YSOZWDJqgXHkVmNWQD8Qnjk/nfEcT0s0JGwnK5svpad 1BG4dUC8eSB1RV67fN8xsXQk/0nnyqRVJ9cpQ= MIME-Version: 1.0 Received: by 10.229.189.72 with SMTP id dd8mr2170673qcb.18.1292697673575; Sat, 18 Dec 2010 10:41:13 -0800 (PST) Received: by 10.220.175.141 with HTTP; Sat, 18 Dec 2010 10:41:13 -0800 (PST) In-Reply-To: <201012181421.oBIELTSd093635@svn.freebsd.org> References: <201012181421.oBIELTSd093635@svn.freebsd.org> Date: Sat, 18 Dec 2010 18:41:13 +0000 Message-ID: From: Paul B Mahol To: Tijl Coosemans Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216518 - in head/sys/dev: if_ndis le malo sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 18:41:15 -0000 On 12/18/10, Tijl Coosemans wrote: > Author: tijl > Date: Sat Dec 18 14:21:28 2010 > New Revision: 216518 > URL: http://svn.freebsd.org/changeset/base/216518 > > Log: > Use convenience functions where possible instead of accessing the PCI > configuration registers directly. > > Remove pci_enable_io calls where they are redundant. The PCI bus driver > will set the right bits when the corresponding bus resource is activated. > > Remove redundant pci_* function calls from suspend/resume methods. The > bus driver already saves and restores the PCI configuration. > > Reviewed by: jhb > Approved by: kib (mentor) Please revert change to if_ndis regarding introduction of pci_get_subvendor(). You compare 16bit value with 32bit value - this will always fail. From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 19:09:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 777AC106566C; Sat, 18 Dec 2010 19:09:36 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from fsm1.ukr.net (fsm1.ukr.net [195.214.192.23]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6A38FC08; Sat, 18 Dec 2010 19:09:35 +0000 (UTC) Received: from 181-25-132-95.pool.ukrtel.net ([95.132.25.181] helo=localhost) by fsm1.ukr.net with esmtps ID 1PU1tZ-000HW1-Ll ; Sat, 18 Dec 2010 20:52:41 +0200 Date: Sat, 18 Dec 2010 20:52:40 +0200 From: Ivan Klymenko To: John Baldwin Message-ID: <20101218205240.4af888de@ukr.net> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216491 - head/sys/dev/atkbdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:09:36 -0000 after updating svn revision => 216491 system is not detecting the device psm please take a look: http://docs.freebsd.org/cgi/mid.cgi?20101218203020.1cec8dc7 Thanks! From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 19:48:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F9F1106566C; Sat, 18 Dec 2010 19:48:59 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay007.isp.belgacom.be (mailrelay007.isp.belgacom.be [195.238.6.173]) by mx1.freebsd.org (Postfix) with ESMTP id 64D618FC18; Sat, 18 Dec 2010 19:48:57 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPqeDE1bsUgS/2dsb2JhbACkNHS7coVKBJAh Received: from 18.72-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.72.18]) by relay.skynet.be with ESMTP; 18 Dec 2010 20:48:56 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id oBIJmtmW001894; Sat, 18 Dec 2010 20:48:55 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: Paul B Mahol Date: Sat, 18 Dec 2010 20:48:43 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.5.2; i386; ; ) References: <201012181421.oBIELTSd093635@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1987300.O6GHZnZapO"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201012182048.54969.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, Kostik Belousov , svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r216518 - in head/sys/dev: if_ndis le malo sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:48:59 -0000 --nextPart1987300.O6GHZnZapO Content-Type: multipart/mixed; boundary="Boundary-01=_cARDN/Cod0Bap/P" Content-Transfer-Encoding: 7bit --Boundary-01=_cARDN/Cod0Bap/P Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 18 December 2010 19:41:13 Paul B Mahol wrote: > On 12/18/10, Tijl Coosemans wrote: >> Author: tijl >> Date: Sat Dec 18 14:21:28 2010 >> New Revision: 216518 >> URL: http://svn.freebsd.org/changeset/base/216518 >> >> Log: >> Use convenience functions where possible instead of accessing the PCI >> configuration registers directly. >> >> Remove pci_enable_io calls where they are redundant. The PCI bus driver >> will set the right bits when the corresponding bus resource is activat= ed. >> >> Remove redundant pci_* function calls from suspend/resume methods. The >> bus driver already saves and restores the PCI configuration. >> >> Reviewed by: jhb >> Approved by: kib (mentor) >=20 > Please revert change to if_ndis regarding introduction of pci_get_subvend= or(). >=20 > You compare 16bit value with 32bit value - this will always fail. Apologies. Instead of reverting, would the attached patch work for you? It moves the function calls out of the while loop and makes it more clear what subsys means. --Boundary-01=_cARDN/Cod0Bap/P Content-Type: text/x-patch; charset="ISO-8859-15"; name="if_ndis.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="if_ndis.diff" diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c index ff93df3..2b9ad1e 100644 =2D-- a/sys/dev/if_ndis/if_ndis_pci.c +++ b/sys/dev/if_ndis/if_ndis_pci.c @@ -110,14 +110,20 @@ ndis_devcompare(bustype, t, dev) struct ndis_pci_type *t; device_t dev; { + uint16_t vid, did; + uint32_t subsys; + if (bustype !=3D PCIBus) return(FALSE); =20 + vid =3D pci_get_vendor(dev); + did =3D pci_get_device(dev); + subsys =3D pci_get_subdevice(dev); + subsys =3D (subsys << 16) | pci_get_subvendor(dev); + while(t->ndis_name !=3D NULL) { =2D if ((pci_get_vendor(dev) =3D=3D t->ndis_vid) && =2D (pci_get_device(dev) =3D=3D t->ndis_did) && =2D (pci_get_subvendor(dev) =3D=3D t->ndis_subsys || =2D t->ndis_subsys =3D=3D 0)) { + if ((t->ndis_vid =3D=3D vid) && (t->ndis_did =3D=3D did) && + (t->ndis_subsys =3D=3D subsys || t->ndis_subsys =3D=3D 0)) { device_set_desc(dev, t->ndis_name); return(TRUE); } @@ -169,6 +175,8 @@ ndis_attach_pci(dev) struct resource_list *rl; struct resource_list_entry *rle; struct drvdb_ent *db; + uint16_t vid, did; + uint32_t subsys; =20 sc =3D device_get_softc(dev); unit =3D device_get_unit(dev); @@ -300,14 +308,18 @@ ndis_attach_pci(dev) =20 /* Figure out exactly which device we matched. */ =20 + vid =3D pci_get_vendor(dev); + did =3D pci_get_device(dev); + subsys =3D pci_get_subdevice(dev); + subsys =3D (subsys << 16) | pci_get_subvendor(dev); + t =3D db->windrv_devlist; =20 while(t->ndis_name !=3D NULL) { =2D if ((pci_get_vendor(dev) =3D=3D t->ndis_vid) && =2D (pci_get_device(dev) =3D=3D t->ndis_did)) { + if (t->ndis_vid =3D=3D vid && t->ndis_did =3D=3D did) { if (t->ndis_subsys =3D=3D 0) defidx =3D devidx; =2D else if (pci_get_subvendor(dev) =3D=3D t->ndis_subsys) + else if (t->ndis_subsys =3D=3D subsys) break; } t++; --Boundary-01=_cARDN/Cod0Bap/P-- --nextPart1987300.O6GHZnZapO Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAk0NECYACgkQfoCS2CCgtiu8OwD/Tds4r3N/PJpEsQnrWcTwEyNc X9QyCOZaZvdVSiCyReIBAIi6nDaMF1EEEvhgXuGmcVDR8QzP1VHjUOWmOHzfvXDt =JyA6 -----END PGP SIGNATURE----- --nextPart1987300.O6GHZnZapO-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 19:55:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D489106566B; Sat, 18 Dec 2010 19:55:19 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0B58FC18; Sat, 18 Dec 2010 19:55:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIJtJDl026704; Sat, 18 Dec 2010 19:55:19 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIJtJuu026702; Sat, 18 Dec 2010 19:55:19 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181955.oBIJtJuu026702@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 19:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216526 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:55:19 -0000 Author: bschmidt Date: Sat Dec 18 19:55:19 2010 New Revision: 216526 URL: http://svn.freebsd.org/changeset/base/216526 Log: Aggregate SIOCS80211 and SIOCG80211 ioctl request code. While here, bring the wpa_printf()/perror() messages in sync with upstream code. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:04:21 2010 (r216525) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:55:19 2010 (r216526) @@ -58,56 +58,67 @@ static int bsd_sta_deauth(void *priv, co int reason_code); static int -set80211var(struct bsd_driver_data *drv, int op, const void *arg, int arg_len) +bsd_set80211(void *priv, int op, int val, const void *arg, int arg_len) { + struct bsd_driver_data *drv = priv; struct ieee80211req ireq; - memset(&ireq, 0, sizeof(ireq)); - strncpy(ireq.i_name, drv->iface, IFNAMSIZ); + os_memset(&ireq, 0, sizeof(ireq)); + os_strlcpy(ireq.i_name, drv->iface, sizeof(ireq.i_name)); ireq.i_type = op; - ireq.i_len = arg_len; + ireq.i_val = val; ireq.i_data = (void *) arg; + ireq.i_len = arg_len; if (ioctl(drv->ioctl_sock, SIOCS80211, &ireq) < 0) { - perror("ioctl[SIOCS80211]"); + wpa_printf(MSG_ERROR, "ioctl[SIOCS80211, op=%u, val=%u, " + "arg_len=%u]: %s", op, val, arg_len, + strerror(errno)); return -1; } return 0; } static int -get80211var(struct bsd_driver_data *drv, int op, void *arg, int arg_len) +bsd_get80211(void *priv, struct ieee80211req *ireq, int op, void *arg, + int arg_len) { - struct ieee80211req ireq; + struct bsd_driver_data *drv = priv; - memset(&ireq, 0, sizeof(ireq)); - strncpy(ireq.i_name, drv->iface, IFNAMSIZ); - ireq.i_type = op; - ireq.i_len = arg_len; - ireq.i_data = arg; + os_memset(ireq, 0, sizeof(*ireq)); + os_strlcpy(ireq->i_name, drv->iface, sizeof(ireq->i_name)); + ireq->i_type = op; + ireq->i_len = arg_len; + ireq->i_data = arg; - if (ioctl(drv->ioctl_sock, SIOCG80211, &ireq) < 0) { - perror("ioctl[SIOCG80211]"); + if (ioctl(drv->ioctl_sock, SIOCG80211, ireq) < 0) { + wpa_printf(MSG_ERROR, "ioctl[SIOCS80211, op=%u, " + "arg_len=%u]: %s", op, arg_len, strerror(errno)); return -1; } - return ireq.i_len; + return 0; } static int -set80211param(struct bsd_driver_data *drv, int op, int arg) +get80211var(struct bsd_driver_data *drv, int op, void *arg, int arg_len) { struct ieee80211req ireq; - memset(&ireq, 0, sizeof(ireq)); - strncpy(ireq.i_name, drv->iface, IFNAMSIZ); - ireq.i_type = op; - ireq.i_val = arg; - - if (ioctl(drv->ioctl_sock, SIOCS80211, &ireq) < 0) { - perror("ioctl[SIOCS80211]"); + if (bsd_get80211(drv, &ireq, op, arg, arg_len) < 0) return -1; - } - return 0; + return ireq.i_len; +} + +static int +set80211var(struct bsd_driver_data *drv, int op, const void *arg, int arg_len) +{ + return bsd_set80211(drv, op, 0, arg, arg_len); +} + +static int +set80211param(struct bsd_driver_data *drv, int op, int arg) +{ + return bsd_set80211(drv, op, arg, NULL, 0); } static const char * @@ -395,24 +406,10 @@ bsd_sta_clear_stats(void *priv, const u8 static int bsd_set_opt_ie(void *priv, const u8 *ie, size_t ie_len) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - struct ieee80211req ireq; - - memset(&ireq, 0, sizeof(ireq)); - strncpy(ireq.i_name, drv->iface, IFNAMSIZ); - ireq.i_type = IEEE80211_IOC_APPIE; - ireq.i_val = IEEE80211_APPIE_WPA; - ireq.i_data = (void *) ie; - ireq.i_len = ie_len; - - wpa_printf(MSG_DEBUG, "%s: set WPA+RSN ie (len %d)\n", - __func__, ie_len); - if (ioctl(drv->ioctl_sock, SIOCS80211, &ireq) < 0) { - printf("Unable to set WPA+RSN ie\n"); - return -1; - } - return 0; + wpa_printf(MSG_DEBUG, "%s: set WPA+RSN ie (len %lu)", __func__, + (unsigned long)ie_len); + return bsd_set80211(priv, IEEE80211_IOC_APPIE, IEEE80211_APPIE_WPA, + ie, ie_len); } static int From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 19:56:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02C3E1065672; Sat, 18 Dec 2010 19:56:46 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52638FC1B; Sat, 18 Dec 2010 19:56:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIJujoi026785; Sat, 18 Dec 2010 19:56:45 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIJujWr026783; Sat, 18 Dec 2010 19:56:45 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181956.oBIJujWr026783@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 19:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216527 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:56:46 -0000 Author: bschmidt Date: Sat Dec 18 19:56:45 2010 New Revision: 216527 URL: http://svn.freebsd.org/changeset/base/216527 Log: Change bsd_del_key() to match upstream code: - change order of if/else - move wpa_printf() into the condition - change unsigned char* to u8* - prefer os_memset/os_memcpy Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:55:19 2010 (r216526) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:56:45 2010 (r216527) @@ -246,21 +246,19 @@ bsd_sta_set_flags(void *priv, const u8 * } static int -bsd_del_key(void *priv, const unsigned char *addr, int key_idx) +bsd_del_key(void *priv, const u8 *addr, int key_idx) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; struct ieee80211req_del_key wk; - wpa_printf(MSG_DEBUG, "%s: addr=%s key_idx=%d\n", - __func__, ether_sprintf(addr), key_idx); - - memset(&wk, 0, sizeof(wk)); - if (addr != NULL) { - memcpy(wk.idk_macaddr, addr, IEEE80211_ADDR_LEN); - wk.idk_keyix = (u_int8_t) IEEE80211_KEYIX_NONE; /* XXX */ - } else { + os_memset(&wk, 0, sizeof(wk)); + if (addr == NULL) { + wpa_printf(MSG_DEBUG, "%s: key_idx=%d", __func__, key_idx); wk.idk_keyix = key_idx; + } else { + wpa_printf(MSG_DEBUG, "%s: addr=" MACSTR, __func__, + MAC2STR(addr)); + os_memcpy(wk.idk_macaddr, addr, IEEE80211_ADDR_LEN); + wk.idk_keyix = (u_int8_t) IEEE80211_KEYIX_NONE; /* XXX */ } return set80211var(priv, IEEE80211_IOC_DELKEY, &wk, sizeof(wk)); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 19:58:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C2801065672; Sat, 18 Dec 2010 19:58:23 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2B28FC1A; Sat, 18 Dec 2010 19:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIJwNu1026898; Sat, 18 Dec 2010 19:58:23 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIJwNGA026896; Sat, 18 Dec 2010 19:58:23 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012181958.oBIJwNGA026896@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 19:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216528 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 19:58:23 -0000 Author: bschmidt Date: Sat Dec 18 19:58:23 2010 New Revision: 216528 URL: http://svn.freebsd.org/changeset/base/216528 Log: Add bsd_send_mlme_param to aggregate IEEE80211_IOC_MLME ioctls: - merge bsd_set_sta_authorized and bsd_sta_set_flags - change bsd_set_sta_authorized, bsd_sta_deauth and bsd_sta_disassoc to use bsd_send_mlme_param Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:56:45 2010 (r216527) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:58:23 2010 (r216528) @@ -215,34 +215,35 @@ bsd_set_privacy(void *priv, int enabled) } static int -bsd_set_sta_authorized(void *priv, const u8 *addr, int authorized) +bsd_send_mlme_param(void *priv, const u8 op, const u16 reason, const u8 *addr) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; struct ieee80211req_mlme mlme; - wpa_printf(MSG_DEBUG, "%s: addr=%s authorized=%d\n", - __func__, ether_sprintf(addr), authorized); - - if (authorized) - mlme.im_op = IEEE80211_MLME_AUTHORIZE; - else - mlme.im_op = IEEE80211_MLME_UNAUTHORIZE; - mlme.im_reason = 0; - memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); + os_memset(&mlme, 0, sizeof(mlme)); + mlme.im_op = op; + mlme.im_reason = reason; + os_memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); } static int -bsd_sta_set_flags(void *priv, const u8 *addr, int total_flags, - int flags_or, int flags_and) +bsd_set_sta_authorized(void *priv, const u8 *addr, + int total_flags, int flags_or, int flags_and) { + int authorized = -1; + /* For now, only support setting Authorized flag */ if (flags_or & WPA_STA_AUTHORIZED) - return bsd_set_sta_authorized(priv, addr, 1); + authorized = 1; if (!(flags_and & WPA_STA_AUTHORIZED)) - return bsd_set_sta_authorized(priv, addr, 0); - return 0; + authorized = 0; + + if (authorized < 0) + return 0; + + return bsd_send_mlme_param(priv, authorized ? + IEEE80211_MLME_AUTHORIZE : + IEEE80211_MLME_UNAUTHORIZE, 0, addr); } static int @@ -413,32 +414,16 @@ bsd_set_opt_ie(void *priv, const u8 *ie, static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, int reason_code) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - struct ieee80211req_mlme mlme; - - wpa_printf(MSG_DEBUG, "%s: addr=%s reason_code=%d\n", - __func__, ether_sprintf(addr), reason_code); - - mlme.im_op = IEEE80211_MLME_DEAUTH; - mlme.im_reason = reason_code; - memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); - return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); + return bsd_send_mlme_param(priv, IEEE80211_MLME_DEAUTH, reason_code, + addr); } static int -bsd_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr, int reason_code) +bsd_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr, + int reason_code) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - struct ieee80211req_mlme mlme; - - wpa_printf(MSG_DEBUG, "%s: addr=%s reason_code=%d\n", - __func__, ether_sprintf(addr), reason_code); - - mlme.im_reason = reason_code; - memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); - return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); + return bsd_send_mlme_param(priv, IEEE80211_MLME_DISASSOC, reason_code, + addr); } static void @@ -807,7 +792,7 @@ const struct wpa_driver_ops wpa_driver_b .get_seqnum = bsd_get_seqnum, .flush = bsd_flush, .set_generic_elem = bsd_set_opt_ie, - .sta_set_flags = bsd_sta_set_flags, + .sta_set_flags = bsd_set_sta_authorized, .read_sta_data = bsd_read_sta_driver_data, .hapd_send_eapol = bsd_send_eapol, .sta_disassoc = bsd_sta_disassoc, From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:00:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAAB106564A; Sat, 18 Dec 2010 20:00:28 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 694BB8FC08; Sat, 18 Dec 2010 20:00:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIK0SNb027029; Sat, 18 Dec 2010 20:00:28 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIK0S1t027027; Sat, 18 Dec 2010 20:00:28 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182000.oBIK0S1t027027@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216529 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:00:28 -0000 Author: bschmidt Date: Sat Dec 18 20:00:28 2010 New Revision: 216529 URL: http://svn.freebsd.org/changeset/base/216529 Log: Move some functions around to match the upstream order. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 19:58:23 2010 (r216528) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:00:28 2010 (r216529) @@ -24,14 +24,11 @@ #include #include +#include #include #include - -#undef RSN_VERSION -#undef WPA_VERSION -#undef WPA_OUI_TYPE -#undef WME_OUI_TYPE +#include #include "l2_packet/l2_packet.h" @@ -54,9 +51,6 @@ struct bsd_driver_data { static const struct wpa_driver_ops bsd_driver_ops; -static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, - int reason_code); - static int bsd_set80211(void *priv, int op, int val, const void *arg, int arg_len) { @@ -121,16 +115,58 @@ set80211param(struct bsd_driver_data *dr return bsd_set80211(drv, op, arg, NULL, 0); } -static const char * -ether_sprintf(const u8 *addr) +static int +bsd_get_ssid(void *priv, u8 *buf, int len) { - static char buf[sizeof(MACSTR)]; + struct bsd_driver_data *drv = priv; - if (addr != NULL) - snprintf(buf, sizeof(buf), MACSTR, MAC2STR(addr)); - else - snprintf(buf, sizeof(buf), MACSTR, 0,0,0,0,0,0); - return buf; + int ssid_len = get80211var(priv, IEEE80211_IOC_SSID, buf, len); + + wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, ssid_len, buf); + + return ssid_len; +} + +static int +bsd_set_ssid(void *priv, const u8 *buf, int len) +{ + struct bsd_driver_data *drv = priv; + struct hostapd_data *hapd = drv->hapd; + + wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, len, buf); + + return set80211var(priv, IEEE80211_IOC_SSID, buf, len); +} + +static int +bsd_del_key(void *priv, const u8 *addr, int key_idx) +{ + struct ieee80211req_del_key wk; + + os_memset(&wk, 0, sizeof(wk)); + if (addr == NULL) { + wpa_printf(MSG_DEBUG, "%s: key_idx=%d", __func__, key_idx); + wk.idk_keyix = key_idx; + } else { + wpa_printf(MSG_DEBUG, "%s: addr=" MACSTR, __func__, + MAC2STR(addr)); + os_memcpy(wk.idk_macaddr, addr, IEEE80211_ADDR_LEN); + wk.idk_keyix = (u_int8_t) IEEE80211_KEYIX_NONE; /* XXX */ + } + + return set80211var(priv, IEEE80211_IOC_DELKEY, &wk, sizeof(wk)); +} + +static int +bsd_send_mlme_param(void *priv, const u8 op, const u16 reason, const u8 *addr) +{ + struct ieee80211req_mlme mlme; + + os_memset(&mlme, 0, sizeof(mlme)); + mlme.im_op = op; + mlme.im_reason = reason; + os_memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); + return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); } static int @@ -178,6 +214,69 @@ bsd_commit(void *priv) } static int +bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg, + const unsigned char *addr, int key_idx, int set_tx, const u8 *seq, + size_t seq_len, const u8 *key, size_t key_len) +{ + struct ieee80211req_key wk; + + wpa_printf(MSG_DEBUG, "%s: alg=%d addr=%p key_idx=%d set_tx=%d " + "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx, + set_tx, seq_len, key_len); + + if (alg == WPA_ALG_NONE) { + return bsd_del_key(priv, addr, key_idx); + } + + os_memset(&wk, 0, sizeof(wk)); + switch (alg) { + case WPA_ALG_WEP: + wk.ik_type = IEEE80211_CIPHER_WEP; + break; + case WPA_ALG_TKIP: + wk.ik_type = IEEE80211_CIPHER_TKIP; + break; + case WPA_ALG_CCMP: + wk.ik_type = IEEE80211_CIPHER_AES_CCM; + break; + default: + wpa_printf(MSG_ERROR, "%s: unknown alg=%d", __func__, alg); + return -1; + } + + wk.ik_flags = IEEE80211_KEY_RECV; + if (set_tx) + wk.ik_flags |= IEEE80211_KEY_XMIT; + + if (addr == NULL) { + os_memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); + wk.ik_keyix = key_idx; + } else { + os_memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); + /* + * Deduce whether group/global or unicast key by checking + * the address (yech). Note also that we can only mark global + * keys default; doing this for a unicast key is an error. + */ + if (os_memcmp(addr, "\xff\xff\xff\xff\xff\xff", + IEEE80211_ADDR_LEN) == 0) { + wk.ik_flags |= IEEE80211_KEY_GROUP; + wk.ik_keyix = key_idx; + } else { + wk.ik_keyix = key_idx == 0 ? IEEE80211_KEYIX_NONE : + key_idx; + } + } + if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx) + wk.ik_flags |= IEEE80211_KEY_DEFAULT; + wk.ik_keylen = key_len; + os_memcpy(&wk.ik_keyrsc, seq, seq_len); + os_memcpy(wk.ik_keydata, key, key_len); + + return set80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk)); +} + +static int bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params) { wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, params->enabled); @@ -207,26 +306,6 @@ bsd_set_ieee8021x(void *priv, struct wpa } static int -bsd_set_privacy(void *priv, int enabled) -{ - wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, enabled); - - return set80211param(priv, IEEE80211_IOC_PRIVACY, enabled); -} - -static int -bsd_send_mlme_param(void *priv, const u8 op, const u16 reason, const u8 *addr) -{ - struct ieee80211req_mlme mlme; - - os_memset(&mlme, 0, sizeof(mlme)); - mlme.im_op = op; - mlme.im_reason = reason; - os_memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN); - return set80211var(priv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); -} - -static int bsd_set_sta_authorized(void *priv, const u8 *addr, int total_flags, int flags_or, int flags_and) { @@ -246,88 +325,113 @@ bsd_set_sta_authorized(void *priv, const IEEE80211_MLME_UNAUTHORIZE, 0, addr); } -static int -bsd_del_key(void *priv, const u8 *addr, int key_idx) +static void +bsd_new_sta(void *priv, void *ctx, u8 addr[IEEE80211_ADDR_LEN]) { - struct ieee80211req_del_key wk; + struct ieee80211req_wpaie ie; + int ielen = 0; + u8 *iebuf = NULL; - os_memset(&wk, 0, sizeof(wk)); - if (addr == NULL) { - wpa_printf(MSG_DEBUG, "%s: key_idx=%d", __func__, key_idx); - wk.idk_keyix = key_idx; - } else { - wpa_printf(MSG_DEBUG, "%s: addr=" MACSTR, __func__, - MAC2STR(addr)); - os_memcpy(wk.idk_macaddr, addr, IEEE80211_ADDR_LEN); - wk.idk_keyix = (u_int8_t) IEEE80211_KEYIX_NONE; /* XXX */ + /* + * Fetch and validate any negotiated WPA/RSN parameters. + */ + memset(&ie, 0, sizeof(ie)); + memcpy(ie.wpa_macaddr, addr, IEEE80211_ADDR_LEN); + if (get80211var(priv, IEEE80211_IOC_WPAIE, &ie, sizeof(ie)) < 0) { + printf("Failed to get WPA/RSN information element.\n"); + goto no_ie; } + iebuf = ie.wpa_ie; + ielen = ie.wpa_ie[1]; + if (ielen == 0) + iebuf = NULL; + else + ielen += 2; + +no_ie: + drv_event_assoc(ctx, addr, iebuf, ielen); - return set80211var(priv, IEEE80211_IOC_DELKEY, &wk, sizeof(wk)); } static int -bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg, - const unsigned char *addr, int key_idx, int set_tx, const u8 *seq, - size_t seq_len, const u8 *key, size_t key_len) +bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, + int encrypt, const u8 *own_addr) + { - struct ieee80211req_key wk; - - wpa_printf(MSG_DEBUG, "%s: alg=%d addr=%p key_idx=%d set_tx=%d " - "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx, - set_tx, seq_len, key_len); + struct bsd_driver_data *drv = priv; + struct hostapd_data *hapd = drv->hapd; + unsigned char buf[3000]; + unsigned char *bp = buf; + struct l2_ethhdr *eth; + size_t len; + int status; - if (alg == WPA_ALG_NONE) { - return bsd_del_key(priv, addr, key_idx); + /* + * Prepend the Etherent header. If the caller left us + * space at the front we could just insert it but since + * we don't know we copy to a local buffer. Given the frequency + * and size of frames this probably doesn't matter. + */ + len = data_len + sizeof(struct l2_ethhdr); + if (len > sizeof(buf)) { + bp = malloc(len); + if (bp == NULL) { + printf("EAPOL frame discarded, cannot malloc temp " + "buffer of size %u!\n", len); + return -1; + } } + eth = (struct l2_ethhdr *) bp; + memcpy(eth->h_dest, addr, ETH_ALEN); + memcpy(eth->h_source, own_addr, ETH_ALEN); + eth->h_proto = htons(ETH_P_EAPOL); + memcpy(eth+1, data, data_len); - os_memset(&wk, 0, sizeof(wk)); - switch (alg) { - case WPA_ALG_WEP: - wk.ik_type = IEEE80211_CIPHER_WEP; - break; - case WPA_ALG_TKIP: - wk.ik_type = IEEE80211_CIPHER_TKIP; - break; - case WPA_ALG_CCMP: - wk.ik_type = IEEE80211_CIPHER_AES_CCM; - break; - default: - wpa_printf(MSG_ERROR, "%s: unknown alg=%d", __func__, alg); - return -1; - } + wpa_hexdump(MSG_MSGDUMP, "TX EAPOL", bp, len); - wk.ik_flags = IEEE80211_KEY_RECV; - if (set_tx) - wk.ik_flags |= IEEE80211_KEY_XMIT; + status = l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, bp, len); - if (addr == NULL) { - os_memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN); - wk.ik_keyix = key_idx; - } else { - os_memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); - /* - * Deduce whether group/global or unicast key by checking - * the address (yech). Note also that we can only mark global - * keys default; doing this for a unicast key is an error. - */ - if (os_memcmp(addr, "\xff\xff\xff\xff\xff\xff", - IEEE80211_ADDR_LEN) == 0) { - wk.ik_flags |= IEEE80211_KEY_GROUP; - wk.ik_keyix = key_idx; - } else { - wk.ik_keyix = key_idx == 0 ? IEEE80211_KEYIX_NONE : - key_idx; - } - } - if (wk.ik_keyix != IEEE80211_KEYIX_NONE && set_tx) - wk.ik_flags |= IEEE80211_KEY_DEFAULT; - wk.ik_keylen = key_len; - os_memcpy(&wk.ik_keyrsc, seq, seq_len); - os_memcpy(wk.ik_keydata, key, key_len); + if (bp != buf) + free(bp); + return status; +} - return set80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk)); +static int +bsd_set_opt_ie(void *priv, const u8 *ie, size_t ie_len) +{ + wpa_printf(MSG_DEBUG, "%s: set WPA+RSN ie (len %lu)", __func__, + (unsigned long)ie_len); + return bsd_set80211(priv, IEEE80211_IOC_APPIE, IEEE80211_APPIE_WPA, + ie, ie_len); +} + +#undef RSN_VERSION +#undef WPA_VERSION +#undef WPA_OUI_TYPE +#undef WME_OUI_TYPE + +static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, + int reason_code); + +static const char * +ether_sprintf(const u8 *addr) +{ + static char buf[sizeof(MACSTR)]; + + if (addr != NULL) + snprintf(buf, sizeof(buf), MACSTR, MAC2STR(addr)); + else + snprintf(buf, sizeof(buf), MACSTR, 0,0,0,0,0,0); + return buf; } +static int +bsd_set_privacy(void *priv, int enabled) +{ + wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, enabled); + + return set80211param(priv, IEEE80211_IOC_PRIVACY, enabled); +} static int bsd_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx, @@ -403,15 +507,6 @@ bsd_sta_clear_stats(void *priv, const u8 } static int -bsd_set_opt_ie(void *priv, const u8 *ie, size_t ie_len) -{ - wpa_printf(MSG_DEBUG, "%s: set WPA+RSN ie (len %lu)", __func__, - (unsigned long)ie_len); - return bsd_set80211(priv, IEEE80211_IOC_APPIE, IEEE80211_APPIE_WPA, - ie, ie_len); -} - -static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, int reason_code) { return bsd_send_mlme_param(priv, IEEE80211_MLME_DEAUTH, reason_code, @@ -427,37 +522,6 @@ bsd_sta_disassoc(void *priv, const u8 *o } static void -bsd_new_sta(void *priv, void *ctx, u8 addr[IEEE80211_ADDR_LEN]) -{ - struct ieee80211req_wpaie ie; - int ielen = 0; - u8 *iebuf = NULL; - - /* - * Fetch and validate any negotiated WPA/RSN parameters. - */ - memset(&ie, 0, sizeof(ie)); - memcpy(ie.wpa_macaddr, addr, IEEE80211_ADDR_LEN); - if (get80211var(priv, IEEE80211_IOC_WPAIE, &ie, sizeof(ie)) < 0) { - printf("Failed to get WPA/RSN information element.\n"); - goto no_ie; - } - iebuf = ie.wpa_ie; - ielen = ie.wpa_ie[1]; - if (ielen == 0) - iebuf = NULL; - else - ielen += 2; - -no_ie: - drv_event_assoc(ctx, addr, iebuf, ielen); - -} - -#include -#include - -static void bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx) { struct bsd_driver_data *drv = ctx; @@ -559,49 +623,6 @@ bsd_wireless_event_receive(int sock, voi } } -static int -bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, - int encrypt, const u8 *own_addr) - -{ - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - unsigned char buf[3000]; - unsigned char *bp = buf; - struct l2_ethhdr *eth; - size_t len; - int status; - - /* - * Prepend the Etherent header. If the caller left us - * space at the front we could just insert it but since - * we don't know we copy to a local buffer. Given the frequency - * and size of frames this probably doesn't matter. - */ - len = data_len + sizeof(struct l2_ethhdr); - if (len > sizeof(buf)) { - bp = malloc(len); - if (bp == NULL) { - printf("EAPOL frame discarded, cannot malloc temp " - "buffer of size %u!\n", len); - return -1; - } - } - eth = (struct l2_ethhdr *) bp; - memcpy(eth->h_dest, addr, ETH_ALEN); - memcpy(eth->h_source, own_addr, ETH_ALEN); - eth->h_proto = htons(ETH_P_EAPOL); - memcpy(eth+1, data, data_len); - - wpa_hexdump(MSG_MSGDUMP, "TX EAPOL", bp, len); - - status = l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, bp, len); - - if (bp != buf) - free(bp); - return status; -} - static void handle_read(void *ctx, const u8 *src_addr, const u8 *buf, size_t len) { @@ -610,29 +631,6 @@ handle_read(void *ctx, const u8 *src_add } static int -bsd_get_ssid(void *priv, u8 *buf, int len) -{ - struct bsd_driver_data *drv = priv; - - int ssid_len = get80211var(priv, IEEE80211_IOC_SSID, buf, len); - - wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, ssid_len, buf); - - return ssid_len; -} - -static int -bsd_set_ssid(void *priv, const u8 *buf, int len) -{ - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - - wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, len, buf); - - return set80211var(priv, IEEE80211_IOC_SSID, buf, len); -} - -static int bsd_set_countermeasures(void *priv, int enabled) { struct bsd_driver_data *drv = priv; From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:04:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC10C1065679; Sat, 18 Dec 2010 20:04:47 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA5A68FC15; Sat, 18 Dec 2010 20:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIK4ltu027224; Sat, 18 Dec 2010 20:04:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIK4laH027222; Sat, 18 Dec 2010 20:04:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182004.oBIK4laH027222@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216530 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:04:48 -0000 Author: bschmidt Date: Sat Dec 18 20:04:47 2010 New Revision: 216530 URL: http://svn.freebsd.org/changeset/base/216530 Log: Rename ioctl_sock to just sock to match the upstream code. While here remove the no longer used wext_sock and bsd_driver_ops variables. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:00:28 2010 (r216529) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:04:47 2010 (r216530) @@ -35,8 +35,7 @@ struct bsd_driver_data { struct hostapd_data *hapd; /* back pointer */ - int ioctl_sock; /* open socket for 802.11 ioctls */ - int wext_sock; + int sock; /* open socket for 802.11 ioctls */ struct l2_packet_data *sock_xmit;/* raw packet xmit socket */ int route; /* routing socket for events */ char iface[IFNAMSIZ+1]; /* interface name */ @@ -49,8 +48,6 @@ struct bsd_driver_data { int prev_wpa; /* wpa state to restore on deinit */ }; -static const struct wpa_driver_ops bsd_driver_ops; - static int bsd_set80211(void *priv, int op, int val, const void *arg, int arg_len) { @@ -64,7 +61,7 @@ bsd_set80211(void *priv, int op, int val ireq.i_data = (void *) arg; ireq.i_len = arg_len; - if (ioctl(drv->ioctl_sock, SIOCS80211, &ireq) < 0) { + if (ioctl(drv->sock, SIOCS80211, &ireq) < 0) { wpa_printf(MSG_ERROR, "ioctl[SIOCS80211, op=%u, val=%u, " "arg_len=%u]: %s", op, val, arg_len, strerror(errno)); @@ -85,7 +82,7 @@ bsd_get80211(void *priv, struct ieee8021 ireq->i_len = arg_len; ireq->i_data = arg; - if (ioctl(drv->ioctl_sock, SIOCG80211, ireq) < 0) { + if (ioctl(drv->sock, SIOCG80211, ireq) < 0) { wpa_printf(MSG_ERROR, "ioctl[SIOCS80211, op=%u, " "arg_len=%u]: %s", op, arg_len, strerror(errno)); return -1; @@ -178,13 +175,13 @@ bsd_set_iface_flags(void *priv, int flag wpa_printf(MSG_DEBUG, "%s: flags=0x%x\n", __func__, flags); - if (drv->ioctl_sock < 0) + if (drv->sock < 0) return -1; memset(&ifr, 0, sizeof(ifr)); snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->iface); - if (ioctl(drv->ioctl_sock, SIOCGIFFLAGS, &ifr) != 0) { + if (ioctl(drv->sock, SIOCGIFFLAGS, &ifr) != 0) { perror("ioctl[SIOCGIFFLAGS]"); return -1; } @@ -200,7 +197,7 @@ bsd_set_iface_flags(void *priv, int flag ifr.ifr_flags |= flags; } - if (ioctl(drv->ioctl_sock, SIOCSIFFLAGS, &ifr) != 0) { + if (ioctl(drv->sock, SIOCSIFFLAGS, &ifr) != 0) { perror("ioctl[SIOCSIFFLAGS]"); return -1; } @@ -712,8 +709,8 @@ bsd_init(struct hostapd_data *hapd, stru } drv->hapd = hapd; - drv->ioctl_sock = socket(PF_INET, SOCK_DGRAM, 0); - if (drv->ioctl_sock < 0) { + drv->sock = socket(PF_INET, SOCK_DGRAM, 0); + if (drv->sock < 0) { perror("socket[PF_INET,SOCK_DGRAM]"); goto bad; } @@ -755,8 +752,8 @@ bad: if (drv != NULL) { if (drv->sock_xmit != NULL) l2_packet_deinit(drv->sock_xmit); - if (drv->ioctl_sock >= 0) - close(drv->ioctl_sock); + if (drv->sock >= 0) + close(drv->sock); free(drv); } return NULL; @@ -773,8 +770,8 @@ bsd_deinit(void *priv) close(drv->route); } (void) bsd_set_iface_flags(drv, -IFF_UP); - if (drv->ioctl_sock >= 0) - close(drv->ioctl_sock); + if (drv->sock >= 0) + close(drv->sock); if (drv->sock_xmit != NULL) l2_packet_deinit(drv->sock_xmit); free(drv); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:08:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A48A1106564A; Sat, 18 Dec 2010 20:08:21 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 784EB8FC1A; Sat, 18 Dec 2010 20:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIK8Lwx027408; Sat, 18 Dec 2010 20:08:21 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIK8LwH027406; Sat, 18 Dec 2010 20:08:21 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182008.oBIK8LwH027406@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216531 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:08:21 -0000 Author: bschmidt Date: Sat Dec 18 20:08:21 2010 New Revision: 216531 URL: http://svn.freebsd.org/changeset/base/216531 Log: Rename iface to ifname to match the upstream code. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:04:47 2010 (r216530) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:08:21 2010 (r216531) @@ -38,7 +38,7 @@ struct bsd_driver_data { int sock; /* open socket for 802.11 ioctls */ struct l2_packet_data *sock_xmit;/* raw packet xmit socket */ int route; /* routing socket for events */ - char iface[IFNAMSIZ+1]; /* interface name */ + char ifname[IFNAMSIZ+1]; /* interface name */ unsigned int ifindex; /* interface index */ void *ctx; struct wpa_driver_capa capa; /* driver capability */ @@ -55,7 +55,7 @@ bsd_set80211(void *priv, int op, int val struct ieee80211req ireq; os_memset(&ireq, 0, sizeof(ireq)); - os_strlcpy(ireq.i_name, drv->iface, sizeof(ireq.i_name)); + os_strlcpy(ireq.i_name, drv->ifname, sizeof(ireq.i_name)); ireq.i_type = op; ireq.i_val = val; ireq.i_data = (void *) arg; @@ -77,7 +77,7 @@ bsd_get80211(void *priv, struct ieee8021 struct bsd_driver_data *drv = priv; os_memset(ireq, 0, sizeof(*ireq)); - os_strlcpy(ireq->i_name, drv->iface, sizeof(ireq->i_name)); + os_strlcpy(ireq->i_name, drv->ifname, sizeof(ireq->i_name)); ireq->i_type = op; ireq->i_len = arg_len; ireq->i_data = arg; @@ -179,7 +179,7 @@ bsd_set_iface_flags(void *priv, int flag return -1; memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->iface); + snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->ifname); if (ioctl(drv->sock, SIOCGIFFLAGS, &ifr) != 0) { perror("ioctl[SIOCGIFFLAGS]"); @@ -714,7 +714,7 @@ bsd_init(struct hostapd_data *hapd, stru perror("socket[PF_INET,SOCK_DGRAM]"); goto bad; } - memcpy(drv->iface, params->ifname, sizeof(drv->iface)); + memcpy(drv->ifname, params->ifname, sizeof(drv->ifname)); /* * NB: We require the interface name be mappable to an index. * This implies we do not support having wpa_supplicant @@ -722,13 +722,14 @@ bsd_init(struct hostapd_data *hapd, stru * doesn't belong here; it's really the job of devd. * XXXSCW: devd is FreeBSD-specific. */ - drv->ifindex = if_nametoindex(drv->iface); + drv->ifindex = if_nametoindex(drv->ifname); if (drv->ifindex == 0) { - printf("%s: interface %s does not exist", __func__, drv->iface); + printf("%s: interface %s does not exist", __func__, + drv->ifname); goto bad; } - drv->sock_xmit = l2_packet_init(drv->iface, NULL, ETH_P_EAPOL, + drv->sock_xmit = l2_packet_init(drv->ifname, NULL, ETH_P_EAPOL, handle_read, drv, 1); if (drv->sock_xmit == NULL) goto bad; From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:11:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AFE11065672; Sat, 18 Dec 2010 20:11:10 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF398FC12; Sat, 18 Dec 2010 20:11:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKBAXP027575; Sat, 18 Dec 2010 20:11:10 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKBAKr027573; Sat, 18 Dec 2010 20:11:10 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182011.oBIKBAKr027573@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216532 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:11:10 -0000 Author: bschmidt Date: Sat Dec 18 20:11:09 2010 New Revision: 216532 URL: http://svn.freebsd.org/changeset/base/216532 Log: Remove debug messages which are no longer present in upstream code. While here remove some explicit line breaks. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:08:21 2010 (r216531) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:11:09 2010 (r216532) @@ -119,8 +119,6 @@ bsd_get_ssid(void *priv, u8 *buf, int le int ssid_len = get80211var(priv, IEEE80211_IOC_SSID, buf, len); - wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, ssid_len, buf); - return ssid_len; } @@ -130,8 +128,6 @@ bsd_set_ssid(void *priv, const u8 *buf, struct bsd_driver_data *drv = priv; struct hostapd_data *hapd = drv->hapd; - wpa_printf(MSG_DEBUG, "%s: ssid=\"%.*s\"\n", __func__, len, buf); - return set80211var(priv, IEEE80211_IOC_SSID, buf, len); } @@ -173,8 +169,6 @@ bsd_set_iface_flags(void *priv, int flag struct hostapd_data *hapd = drv->hapd; struct ifreq ifr; - wpa_printf(MSG_DEBUG, "%s: flags=0x%x\n", __func__, flags); - if (drv->sock < 0) return -1; @@ -276,7 +270,7 @@ bsd_set_key(const char *ifname, void *pr static int bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params) { - wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, params->enabled); + wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, params->enabled); if (!params->enabled) { /* XXX restore state */ @@ -425,7 +419,7 @@ ether_sprintf(const u8 *addr) static int bsd_set_privacy(void *priv, int enabled) { - wpa_printf(MSG_DEBUG, "%s: enabled=%d\n", __func__, enabled); + wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled); return set80211param(priv, IEEE80211_IOC_PRIVACY, enabled); } @@ -438,7 +432,7 @@ bsd_get_seqnum(const char *ifname, void struct hostapd_data *hapd = drv->hapd; struct ieee80211req_key wk; - wpa_printf(MSG_DEBUG, "%s: addr=%s idx=%d\n", + wpa_printf(MSG_DEBUG, "%s: addr=%s idx=%d", __func__, ether_sprintf(addr), idx); memset(&wk, 0, sizeof(wk)); @@ -495,7 +489,7 @@ bsd_sta_clear_stats(void *priv, const u8 struct hostapd_data *hapd = drv->hapd; struct ieee80211req_sta_stats stats; - wpa_printf(MSG_DEBUG, "%s: addr=%s\n", __func__, ether_sprintf(addr)); + wpa_printf(MSG_DEBUG, "%s: addr=%s", __func__, ether_sprintf(addr)); /* zero station statistics */ memset(&stats, 0, sizeof(stats)); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:13:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2047C106566C; Sat, 18 Dec 2010 20:13:43 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3AB8FC1C; Sat, 18 Dec 2010 20:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKDg8k027682; Sat, 18 Dec 2010 20:13:42 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKDgsl027680; Sat, 18 Dec 2010 20:13:42 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182013.oBIKDgsl027680@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216533 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:13:43 -0000 Author: bschmidt Date: Sat Dec 18 20:13:42 2010 New Revision: 216533 URL: http://svn.freebsd.org/changeset/base/216533 Log: Remove some unused variables and unnecessary casts. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:11:09 2010 (r216532) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:13:42 2010 (r216533) @@ -113,22 +113,19 @@ set80211param(struct bsd_driver_data *dr } static int -bsd_get_ssid(void *priv, u8 *buf, int len) +bsd_get_ssid(void *priv, u8 *ssid, int len) { struct bsd_driver_data *drv = priv; - int ssid_len = get80211var(priv, IEEE80211_IOC_SSID, buf, len); - - return ssid_len; + return get80211var(drv, IEEE80211_IOC_SSID, ssid, IEEE80211_NWID_LEN); } static int -bsd_set_ssid(void *priv, const u8 *buf, int len) +bsd_set_ssid(void *priv, const u8 *ssid, int ssid_len) { struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; - return set80211var(priv, IEEE80211_IOC_SSID, buf, len); + return set80211var(drv, IEEE80211_IOC_SSID, ssid, ssid_len); } static int @@ -166,7 +163,6 @@ static int bsd_set_iface_flags(void *priv, int flags) { struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; struct ifreq ifr; if (drv->sock < 0) @@ -350,7 +346,6 @@ bsd_send_eapol(void *priv, const u8 *add { struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; unsigned char buf[3000]; unsigned char *bp = buf; struct l2_ethhdr *eth; @@ -428,8 +423,6 @@ static int bsd_get_seqnum(const char *ifname, void *priv, const u8 *addr, int idx, u8 *seq) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; struct ieee80211req_key wk; wpa_printf(MSG_DEBUG, "%s: addr=%s idx=%d", @@ -442,7 +435,7 @@ bsd_get_seqnum(const char *ifname, void memcpy(wk.ik_macaddr, addr, IEEE80211_ADDR_LEN); wk.ik_keyix = idx; - if (get80211var(drv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk)) < 0) { + if (get80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk)) < 0) { printf("Failed to get encryption.\n"); return -1; } else { @@ -468,11 +461,11 @@ static int bsd_read_sta_driver_data(void *priv, struct hostap_sta_driver_data *data, const u8 *addr) { - struct bsd_driver_data *drv = priv; struct ieee80211req_sta_stats stats; memcpy(stats.is_u.macaddr, addr, IEEE80211_ADDR_LEN); - if (get80211var(drv, IEEE80211_IOC_STA_STATS, &stats, sizeof(stats)) > 0) { + if (get80211var(priv, IEEE80211_IOC_STA_STATS, &stats, sizeof(stats)) + > 0) { /* XXX? do packets counts include non-data frames? */ data->rx_packets = stats.is_stats.ns_rx_data; data->rx_bytes = stats.is_stats.ns_rx_bytes; @@ -485,8 +478,6 @@ bsd_read_sta_driver_data(void *priv, str static int bsd_sta_clear_stats(void *priv, const u8 *addr) { - struct bsd_driver_data *drv = priv; - struct hostapd_data *hapd = drv->hapd; struct ieee80211req_sta_stats stats; wpa_printf(MSG_DEBUG, "%s: addr=%s", __func__, ether_sprintf(addr)); @@ -494,7 +485,8 @@ bsd_sta_clear_stats(void *priv, const u8 /* zero station statistics */ memset(&stats, 0, sizeof(stats)); memcpy(stats.is_u.macaddr, addr, IEEE80211_ADDR_LEN); - return set80211var(drv, IEEE80211_IOC_STA_STATS, &stats, sizeof(stats)); + return set80211var(priv, IEEE80211_IOC_STA_STATS, &stats, + sizeof(stats)); } static int @@ -516,7 +508,6 @@ static void bsd_wireless_event_receive(int sock, void *ctx, void *sock_ctx) { struct bsd_driver_data *drv = ctx; - struct hostapd_data *hapd = drv->hapd; char buf[2048]; struct if_announcemsghdr *ifan; struct rt_msghdr *rtm; @@ -588,12 +579,12 @@ bsd_wireless_event_receive(int sock, voi auth = (struct ieee80211_auth_event *) &ifan[1]; wpa_printf(MSG_DEBUG, "802.11 AUTH, STA = " MACSTR, MAC2STR(auth->iev_addr)); - n = hostapd_allowed_address(hapd, auth->iev_addr, + n = hostapd_allowed_address(drv->hapd, auth->iev_addr, NULL, 0, NULL, NULL, NULL); switch (n) { case HOSTAPD_ACL_ACCEPT: case HOSTAPD_ACL_REJECT: - hostapd_set_radius_acl_auth(hapd, + hostapd_set_radius_acl_auth(drv->hapd, auth->iev_addr, n, 0); wpa_printf(MSG_DEBUG, "802.11 AUTH, STA = " MACSTR " hostapd says: %s", @@ -624,10 +615,8 @@ handle_read(void *ctx, const u8 *src_add static int bsd_set_countermeasures(void *priv, int enabled) { - struct bsd_driver_data *drv = priv; - wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled); - return set80211param(drv, IEEE80211_IOC_COUNTERMEASURES, enabled); + return set80211param(priv, IEEE80211_IOC_COUNTERMEASURES, enabled); } #ifdef CONFIG_DRIVER_RADIUS_ACL_NOT_YET From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:15:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058CC10656BD; Sat, 18 Dec 2010 20:15:48 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDE038FC17; Sat, 18 Dec 2010 20:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKFlEH027849; Sat, 18 Dec 2010 20:15:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKFleA027847; Sat, 18 Dec 2010 20:15:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182015.oBIKFleA027847@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216535 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:15:48 -0000 Author: bschmidt Date: Sat Dec 18 20:15:47 2010 New Revision: 216535 URL: http://svn.freebsd.org/changeset/base/216535 Log: Prefer os_memset, os_strlcpy and os_free. While here adjust the return value checks for 2 ioctl calls and rewrite error handling in bsd_init to better integrate with upstream code. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:14:47 2010 (r216534) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:15:47 2010 (r216535) @@ -168,10 +168,10 @@ bsd_set_iface_flags(void *priv, int flag if (drv->sock < 0) return -1; - memset(&ifr, 0, sizeof(ifr)); - snprintf(ifr.ifr_name, IFNAMSIZ, "%s", drv->ifname); + os_memset(&ifr, 0, sizeof(ifr)); + os_strlcpy(ifr.ifr_name, drv->ifname, sizeof(ifr.ifr_name)); - if (ioctl(drv->sock, SIOCGIFFLAGS, &ifr) != 0) { + if (ioctl(drv->sock, SIOCGIFFLAGS, &ifr) < 0) { perror("ioctl[SIOCGIFFLAGS]"); return -1; } @@ -187,7 +187,7 @@ bsd_set_iface_flags(void *priv, int flag ifr.ifr_flags |= flags; } - if (ioctl(drv->sock, SIOCSIFFLAGS, &ifr) != 0) { + if (ioctl(drv->sock, SIOCSIFFLAGS, &ifr) < 0) { perror("ioctl[SIOCSIFFLAGS]"); return -1; } @@ -697,7 +697,7 @@ bsd_init(struct hostapd_data *hapd, stru perror("socket[PF_INET,SOCK_DGRAM]"); goto bad; } - memcpy(drv->ifname, params->ifname, sizeof(drv->ifname)); + os_strlcpy(drv->ifname, params->ifname, sizeof(drv->ifname)); /* * NB: We require the interface name be mappable to an index. * This implies we do not support having wpa_supplicant @@ -733,13 +733,13 @@ bsd_init(struct hostapd_data *hapd, stru return drv; bad: - if (drv != NULL) { - if (drv->sock_xmit != NULL) - l2_packet_deinit(drv->sock_xmit); - if (drv->sock >= 0) - close(drv->sock); - free(drv); - } + if (drv == NULL) + return NULL; + if (drv->sock_xmit != NULL) + l2_packet_deinit(drv->sock_xmit); + if (drv->sock >= 0) + close(drv->sock); + os_free(drv); return NULL; } @@ -758,7 +758,7 @@ bsd_deinit(void *priv) close(drv->sock); if (drv->sock_xmit != NULL) l2_packet_deinit(drv->sock_xmit); - free(drv); + os_free(drv); } const struct wpa_driver_ops wpa_driver_bsd_ops = { From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:17:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 462D41065697; Sat, 18 Dec 2010 20:17:11 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34C4B8FC13; Sat, 18 Dec 2010 20:17:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKHBvJ027934; Sat, 18 Dec 2010 20:17:11 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKHB8A027932; Sat, 18 Dec 2010 20:17:11 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182017.oBIKHB8A027932@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216536 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:17:11 -0000 Author: bschmidt Date: Sat Dec 18 20:17:10 2010 New Revision: 216536 URL: http://svn.freebsd.org/changeset/base/216536 Log: Import bsd_configure_wpa() to sync with upstream code. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:15:47 2010 (r216535) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:17:10 2010 (r216536) @@ -264,6 +264,17 @@ bsd_set_key(const char *ifname, void *pr } static int +bsd_configure_wpa(void *priv, struct wpa_bss_params *params) +{ + wpa_printf(MSG_DEBUG, "%s: enable WPA= 0x%x", __func__, params->wpa); + if (set80211param(priv, IEEE80211_IOC_WPA, params->wpa)) { + printf("Unable to set WPA to %u\n", params->wpa); + return -1; + } + return 0; +} + +static int bsd_set_ieee8021x(void *priv, struct wpa_bss_params *params) { wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, params->enabled); @@ -278,7 +289,7 @@ bsd_set_ieee8021x(void *priv, struct wpa __func__); return -1; } - if (params->wpa && set80211param(priv,IEEE80211_IOC_WPA, params->wpa)) { + if (params->wpa && bsd_configure_wpa(priv, params) != 0) { wpa_printf(MSG_ERROR, "%s: Failed to configure WPA state", __func__); return -1; From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:17:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7387106566B; Sat, 18 Dec 2010 20:17:28 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id B0CB38FC13; Sat, 18 Dec 2010 20:17:27 +0000 (UTC) Received: by qwj9 with SMTP id 9so1637919qwj.13 for ; Sat, 18 Dec 2010 12:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=/ssGQAB/MsiO95gu8wrEdPc8OvzmdFLC0MNzbqbaLzc=; b=sg7yt1TROaZPp0Y2tn6qSOyZzXo13Iu7JH2VUIWrbhXi9IRw9Fd1mhbvqyAUkxhZRB 604wZJq+ol3ak8DZH2Rj5YupGXGYwZWWGHx1hap1eMvHeFajsUsNPoYGdbfLXty2ivgY oTUGM+IQZKlr0WPwg5uBbN1YhicScbaNEw67k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XvEjJiiztPmw8GuEklYaUylK+2srVyzC+aI2uatdWj/+Gnmzy4vHyw4XeGxaDXrjF1 fvh1jG20ZejDH5DCe0Cpbmy31HPgWkvsggmLnS311m7gsrxikzP4aNf+7XbxVtb0U9cY 8jDqx1MRUlJymw2SSCvdFNs3rznUr6rO7uVrI= MIME-Version: 1.0 Received: by 10.229.189.72 with SMTP id dd8mr2233325qcb.18.1292703445838; Sat, 18 Dec 2010 12:17:25 -0800 (PST) Received: by 10.220.175.141 with HTTP; Sat, 18 Dec 2010 12:17:25 -0800 (PST) In-Reply-To: <201012182048.54969.tijl@freebsd.org> References: <201012181421.oBIELTSd093635@svn.freebsd.org> <201012182048.54969.tijl@freebsd.org> Date: Sat, 18 Dec 2010 20:17:25 +0000 Message-ID: From: Paul B Mahol To: Tijl Coosemans Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Kostik Belousov , svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r216518 - in head/sys/dev: if_ndis le malo sound/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:17:28 -0000 On 12/18/10, Tijl Coosemans wrote: > On Saturday 18 December 2010 19:41:13 Paul B Mahol wrote: >> On 12/18/10, Tijl Coosemans wrote: >>> Author: tijl >>> Date: Sat Dec 18 14:21:28 2010 >>> New Revision: 216518 >>> URL: http://svn.freebsd.org/changeset/base/216518 >>> >>> Log: >>> Use convenience functions where possible instead of accessing the PCI >>> configuration registers directly. >>> >>> Remove pci_enable_io calls where they are redundant. The PCI bus driver >>> will set the right bits when the corresponding bus resource is >>> activated. >>> >>> Remove redundant pci_* function calls from suspend/resume methods. The >>> bus driver already saves and restores the PCI configuration. >>> >>> Reviewed by: jhb >>> Approved by: kib (mentor) >> >> Please revert change to if_ndis regarding introduction of >> pci_get_subvendor(). >> >> You compare 16bit value with 32bit value - this will always fail. > > Apologies. Instead of reverting, would the attached patch work for you? > It moves the function calls out of the while loop and makes it more clear > what subsys means. Looks fine. From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:22:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56FCF106566C; Sat, 18 Dec 2010 20:22:16 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0BE8FC0A; Sat, 18 Dec 2010 20:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKMGet028178; Sat, 18 Dec 2010 20:22:16 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKMGTY028176; Sat, 18 Dec 2010 20:22:16 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182022.oBIKMGTY028176@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216537 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:22:16 -0000 Author: bschmidt Date: Sat Dec 18 20:22:15 2010 New Revision: 216537 URL: http://svn.freebsd.org/changeset/base/216537 Log: Rename bsd_set_iface_flags to bsd_ctrl_iface and change arguments to match upstream. For the same reason rewrite bsd_get_seqnum. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:17:10 2010 (r216536) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:22:15 2010 (r216537) @@ -160,7 +160,7 @@ bsd_send_mlme_param(void *priv, const u8 } static int -bsd_set_iface_flags(void *priv, int flags) +bsd_ctrl_iface(void *priv, int enable) { struct bsd_driver_data *drv = priv; struct ifreq ifr; @@ -176,15 +176,14 @@ bsd_set_iface_flags(void *priv, int flag return -1; } - if (flags < 0) { - flags = -flags; - if ((ifr.ifr_flags & flags) == 0) + if (enable) { + if ((ifr.ifr_flags & IFF_UP) == IFF_UP) return 0; - ifr.ifr_flags &= ~flags; + ifr.ifr_flags |= IFF_UP; } else { - if ((ifr.ifr_flags & flags) == flags) + if ((ifr.ifr_flags & IFF_UP) == 0) return 0; - ifr.ifr_flags |= flags; + ifr.ifr_flags &= ~IFF_UP; } if (ioctl(drv->sock, SIOCSIFFLAGS, &ifr) < 0) { @@ -197,7 +196,7 @@ bsd_set_iface_flags(void *priv, int flag static int bsd_commit(void *priv) { - return bsd_set_iface_flags(priv, IFF_UP); + return bsd_ctrl_iface(priv, 1); } static int @@ -449,12 +448,25 @@ bsd_get_seqnum(const char *ifname, void if (get80211var(priv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk)) < 0) { printf("Failed to get encryption.\n"); return -1; - } else { - /* NB: upper layer expects tsc in network order */ - wk.ik_keytsc = htole64(wk.ik_keytsc); - memcpy(seq, &wk.ik_keytsc, sizeof(wk.ik_keytsc)); - return 0; } + +#ifdef WORDS_BIGENDIAN + { + /* + * wk.ik_keytsc is in host byte order (big endian), need to + * swap it to match with the byte order used in WPA. + */ + int i; + u8 tmp[WPA_KEY_RSC_LEN]; + memcpy(tmp, &wk.ik_keytsc, sizeof(wk.ik_keytsc)); + for (i = 0; i < WPA_KEY_RSC_LEN; i++) { + seq[i] = tmp[WPA_KEY_RSC_LEN - i - 1]; + } + } +#else /* WORDS_BIGENDIAN */ + memcpy(seq, &wk.ik_keytsc, sizeof(wk.ik_keytsc)); +#endif /* WORDS_BIGENDIAN */ + return 0; } @@ -731,7 +743,7 @@ bsd_init(struct hostapd_data *hapd, stru goto bad; /* mark down during setup */ - if (bsd_set_iface_flags(drv, -IFF_UP) < 0) + if (bsd_ctrl_iface(drv, 0) < 0) goto bad; drv->route = socket(PF_ROUTE, SOCK_RAW, 0); @@ -764,7 +776,7 @@ bsd_deinit(void *priv) eloop_unregister_read_sock(drv->route); close(drv->route); } - (void) bsd_set_iface_flags(drv, -IFF_UP); + bsd_ctrl_iface(drv, 0); if (drv->sock >= 0) close(drv->sock); if (drv->sock_xmit != NULL) From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:23:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 900541065670; Sat, 18 Dec 2010 20:23:28 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7DB8FC17; Sat, 18 Dec 2010 20:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKNSen028253; Sat, 18 Dec 2010 20:23:28 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKNS64028251; Sat, 18 Dec 2010 20:23:28 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182023.oBIKNS64028251@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216538 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:23:28 -0000 Author: bschmidt Date: Sat Dec 18 20:23:28 2010 New Revision: 216538 URL: http://svn.freebsd.org/changeset/base/216538 Log: Add a comment explaining the undefs, while here remove one which is not required. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:22:15 2010 (r216537) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:23:28 2010 (r216538) @@ -401,10 +401,13 @@ bsd_set_opt_ie(void *priv, const u8 *ie, ie, ie_len); } +/* + * Avoid conflicts with hostapd definitions by undefining couple of defines + * from net80211 header files. + */ #undef RSN_VERSION #undef WPA_VERSION #undef WPA_OUI_TYPE -#undef WME_OUI_TYPE static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, int reason_code); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:25:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED5631065673; Sat, 18 Dec 2010 20:25:25 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBCF78FC1B; Sat, 18 Dec 2010 20:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKPPhU028365; Sat, 18 Dec 2010 20:25:25 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKPP8M028363; Sat, 18 Dec 2010 20:25:25 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182025.oBIKPP8M028363@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216539 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:25:26 -0000 Author: bschmidt Date: Sat Dec 18 20:25:25 2010 New Revision: 216539 URL: http://svn.freebsd.org/changeset/base/216539 Log: Change order in wpa_driver_bsd_ops to match upstream code. Add description while here. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:23:28 2010 (r216538) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:25:25 2010 (r216539) @@ -789,23 +789,24 @@ bsd_deinit(void *priv) const struct wpa_driver_ops wpa_driver_bsd_ops = { .name = "bsd", + .desc = "BSD 802.11 support", .hapd_init = bsd_init, .hapd_deinit = bsd_deinit, - .set_ieee8021x = bsd_set_ieee8021x, .set_privacy = bsd_set_privacy, - .set_key = bsd_set_key, .get_seqnum = bsd_get_seqnum, .flush = bsd_flush, - .set_generic_elem = bsd_set_opt_ie, - .sta_set_flags = bsd_set_sta_authorized, .read_sta_data = bsd_read_sta_driver_data, - .hapd_send_eapol = bsd_send_eapol, + .sta_clear_stats = bsd_sta_clear_stats, .sta_disassoc = bsd_sta_disassoc, .sta_deauth = bsd_sta_deauth, + .set_key = bsd_set_key, + .set_ieee8021x = bsd_set_ieee8021x, .hapd_set_ssid = bsd_set_ssid, .hapd_get_ssid = bsd_get_ssid, + .hapd_send_eapol = bsd_send_eapol, + .sta_set_flags = bsd_set_sta_authorized, + .set_generic_elem = bsd_set_opt_ie, .set_countermeasures = bsd_set_countermeasures, - .sta_clear_stats = bsd_sta_clear_stats, .commit = bsd_commit, #ifdef CONFIG_DRIVER_RADIUS_ACL_NOT_YET .set_radius_acl_auth = bsd_set_radius_acl_auth, From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:27:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CA64106564A; Sat, 18 Dec 2010 20:27:09 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE948FC19; Sat, 18 Dec 2010 20:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKR9sZ028461; Sat, 18 Dec 2010 20:27:09 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKR984028459; Sat, 18 Dec 2010 20:27:09 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182027.oBIKR984028459@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216540 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:27:10 -0000 Author: bschmidt Date: Sat Dec 18 20:27:09 2010 New Revision: 216540 URL: http://svn.freebsd.org/changeset/base/216540 Log: Fix some whitespace nits. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:25:25 2010 (r216539) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:27:09 2010 (r216540) @@ -14,6 +14,7 @@ * * $FreeBSD$ */ + #include "includes.h" #include @@ -33,19 +34,19 @@ #include "l2_packet/l2_packet.h" struct bsd_driver_data { - struct hostapd_data *hapd; /* back pointer */ + struct hostapd_data *hapd; /* back pointer */ - int sock; /* open socket for 802.11 ioctls */ + int sock; /* open socket for 802.11 ioctls */ struct l2_packet_data *sock_xmit;/* raw packet xmit socket */ - int route; /* routing socket for events */ - char ifname[IFNAMSIZ+1]; /* interface name */ - unsigned int ifindex; /* interface index */ - void *ctx; - struct wpa_driver_capa capa; /* driver capability */ - int is_ap; /* Access point mode */ - int prev_roaming; /* roaming state to restore on deinit */ - int prev_privacy; /* privacy state to restore on deinit */ - int prev_wpa; /* wpa state to restore on deinit */ + int route; /* routing socket for events */ + char ifname[IFNAMSIZ+1]; /* interface name */ + unsigned int ifindex; /* interface index */ + void *ctx; + struct wpa_driver_capa capa; /* driver capability */ + int is_ap; /* Access point mode */ + int prev_roaming; /* roaming state to restore on deinit */ + int prev_privacy; /* privacy state to restore on deinit */ + int prev_wpa; /* wpa state to restore on deinit */ }; static int @@ -190,6 +191,7 @@ bsd_ctrl_iface(void *priv, int enable) perror("ioctl[SIOCSIFFLAGS]"); return -1; } + return 0; } @@ -207,8 +209,8 @@ bsd_set_key(const char *ifname, void *pr struct ieee80211req_key wk; wpa_printf(MSG_DEBUG, "%s: alg=%d addr=%p key_idx=%d set_tx=%d " - "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx, - set_tx, seq_len, key_len); + "seq_len=%zu key_len=%zu", __func__, alg, addr, key_idx, + set_tx, seq_len, key_len); if (alg == WPA_ALG_NONE) { return bsd_del_key(priv, addr, key_idx); @@ -281,7 +283,7 @@ bsd_set_ieee8021x(void *priv, struct wpa if (!params->enabled) { /* XXX restore state */ return set80211param(priv, IEEE80211_IOC_AUTHMODE, - IEEE80211_AUTH_AUTO); + IEEE80211_AUTH_AUTO); } if (!params->wpa && !params->ieee802_1x) { wpa_printf(MSG_ERROR, "%s: No 802.1X or WPA enabled", @@ -290,11 +292,11 @@ bsd_set_ieee8021x(void *priv, struct wpa } if (params->wpa && bsd_configure_wpa(priv, params) != 0) { wpa_printf(MSG_ERROR, "%s: Failed to configure WPA state", - __func__); + __func__); return -1; } if (set80211param(priv, IEEE80211_IOC_AUTHMODE, - (params->wpa ? IEEE80211_AUTH_WPA : IEEE80211_AUTH_8021X))) { + (params->wpa ? IEEE80211_AUTH_WPA : IEEE80211_AUTH_8021X))) { wpa_printf(MSG_ERROR, "%s: Failed to enable WPA/802.1X", __func__); return -1; @@ -346,14 +348,12 @@ bsd_new_sta(void *priv, void *ctx, u8 ad ielen += 2; no_ie: - drv_event_assoc(ctx, addr, iebuf, ielen); - + drv_event_assoc(ctx, addr, iebuf, ielen); } static int bsd_send_eapol(void *priv, const u8 *addr, const u8 *data, size_t data_len, int encrypt, const u8 *own_addr) - { struct bsd_driver_data *drv = priv; unsigned char buf[3000]; @@ -410,7 +410,7 @@ bsd_set_opt_ie(void *priv, const u8 *ie, #undef WPA_OUI_TYPE static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr, - int reason_code); + int reason_code); static const char * ether_sprintf(const u8 *addr) @@ -439,7 +439,7 @@ bsd_get_seqnum(const char *ifname, void struct ieee80211req_key wk; wpa_printf(MSG_DEBUG, "%s: addr=%s idx=%d", - __func__, ether_sprintf(addr), idx); + __func__, ether_sprintf(addr), idx); memset(&wk, 0, sizeof(wk)); if (addr == NULL) @@ -505,7 +505,7 @@ static int bsd_sta_clear_stats(void *priv, const u8 *addr) { struct ieee80211req_sta_stats stats; - + wpa_printf(MSG_DEBUG, "%s: addr=%s", __func__, ether_sprintf(addr)); /* zero station statistics */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:29:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483FC106566B; Sat, 18 Dec 2010 20:29:42 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4F78FC14; Sat, 18 Dec 2010 20:29:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKTgTY028583; Sat, 18 Dec 2010 20:29:42 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKTfG9028581; Sat, 18 Dec 2010 20:29:42 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012182029.oBIKTfG9028581@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 18 Dec 2010 20:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216541 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:29:42 -0000 Author: bschmidt Date: Sat Dec 18 20:29:41 2010 New Revision: 216541 URL: http://svn.freebsd.org/changeset/base/216541 Log: Unbreak hostapd. This code has been explicitly removed in upstream versions. Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c Modified: head/usr.sbin/wpa/hostapd/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:27:09 2010 (r216540) +++ head/usr.sbin/wpa/hostapd/driver_freebsd.c Sat Dec 18 20:29:41 2010 (r216541) @@ -356,40 +356,11 @@ bsd_send_eapol(void *priv, const u8 *add int encrypt, const u8 *own_addr) { struct bsd_driver_data *drv = priv; - unsigned char buf[3000]; - unsigned char *bp = buf; - struct l2_ethhdr *eth; - size_t len; - int status; - /* - * Prepend the Etherent header. If the caller left us - * space at the front we could just insert it but since - * we don't know we copy to a local buffer. Given the frequency - * and size of frames this probably doesn't matter. - */ - len = data_len + sizeof(struct l2_ethhdr); - if (len > sizeof(buf)) { - bp = malloc(len); - if (bp == NULL) { - printf("EAPOL frame discarded, cannot malloc temp " - "buffer of size %u!\n", len); - return -1; - } - } - eth = (struct l2_ethhdr *) bp; - memcpy(eth->h_dest, addr, ETH_ALEN); - memcpy(eth->h_source, own_addr, ETH_ALEN); - eth->h_proto = htons(ETH_P_EAPOL); - memcpy(eth+1, data, data_len); - - wpa_hexdump(MSG_MSGDUMP, "TX EAPOL", bp, len); - - status = l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, bp, len); - - if (bp != buf) - free(bp); - return status; + wpa_hexdump(MSG_MSGDUMP, "TX EAPOL", data, data_len); + + return l2_packet_send(drv->sock_xmit, addr, ETH_P_EAPOL, data, + data_len); } static int @@ -739,7 +710,7 @@ bsd_init(struct hostapd_data *hapd, stru } drv->sock_xmit = l2_packet_init(drv->ifname, NULL, ETH_P_EAPOL, - handle_read, drv, 1); + handle_read, drv, 0); if (drv->sock_xmit == NULL) goto bad; if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr)) From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 20:43:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 283FC106564A; Sat, 18 Dec 2010 20:43:19 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16E4B8FC08; Sat, 18 Dec 2010 20:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIKhI2b029156; Sat, 18 Dec 2010 20:43:18 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIKhIgs029153; Sat, 18 Dec 2010 20:43:18 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <201012182043.oBIKhIgs029153@svn.freebsd.org> From: Ulf Lilleengen Date: Sat, 18 Dec 2010 20:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216542 - head/usr.bin/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 20:43:19 -0000 Author: lulf Date: Sat Dec 18 20:43:18 2010 New Revision: 216542 URL: http://svn.freebsd.org/changeset/base/216542 Log: - Signal that data should not be modified. Modified: head/usr.bin/csup/rcsfile.c head/usr.bin/csup/rcsfile.h Modified: head/usr.bin/csup/rcsfile.c ============================================================================== --- head/usr.bin/csup/rcsfile.c Sat Dec 18 20:29:41 2010 (r216541) +++ head/usr.bin/csup/rcsfile.c Sat Dec 18 20:43:18 2010 (r216542) @@ -175,7 +175,8 @@ print_stream(struct stream *s) * Parse rcsfile from path and return a pointer to it. */ struct rcsfile * -rcsfile_frompath(char *path, char *name, char *cvsroot, char *colltag, int ro) +rcsfile_frompath(const char *path, const char *name, const char *cvsroot, + const char *colltag, int ro) { struct rcsfile *rf; FILE *infp; Modified: head/usr.bin/csup/rcsfile.h ============================================================================== --- head/usr.bin/csup/rcsfile.h Sat Dec 18 20:29:41 2010 (r216541) +++ head/usr.bin/csup/rcsfile.h Sat Dec 18 20:43:18 2010 (r216542) @@ -42,7 +42,8 @@ struct delta; struct stream; /* Fetching, sending and writing an RCS file. */ -struct rcsfile *rcsfile_frompath(char *, char *, char *, char *, int); +struct rcsfile *rcsfile_frompath(const char *, const char *, const char *, + const char *, int); int rcsfile_send_details(struct rcsfile *, struct stream *); int rcsfile_write(struct rcsfile *, struct stream *); void rcsfile_print(struct rcsfile *); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 22:16:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF6B31065670; Sat, 18 Dec 2010 22:16:15 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE6848FC13; Sat, 18 Dec 2010 22:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIMGFYP033658; Sat, 18 Dec 2010 22:16:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIMGF2E033656; Sat, 18 Dec 2010 22:16:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012182216.oBIMGF2E033656@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 18 Dec 2010 22:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216544 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 22:16:15 -0000 Author: uqs Date: Sat Dec 18 22:16:15 2010 New Revision: 216544 URL: http://svn.freebsd.org/changeset/base/216544 Log: Remove dead code. c is assigned 0 and *loc is pointing to NULL, so c!=0 cannot be true, and dereferencing loc would be a bad idea anyway. Coverity Prevent: CID 5113 Reviewed by: jilles Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Dec 18 20:56:49 2010 (r216543) +++ head/bin/sh/expand.c Sat Dec 18 22:16:15 2010 (r216544) @@ -557,8 +557,6 @@ subevalvar(char *p, char *str, int strlo amount = startp - expdest; STADJUST(amount, expdest); varflags &= ~VSNUL; - if (c != 0) - *loc = c; return 1; case VSQUESTION: From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:03:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A50D1065672; Sat, 18 Dec 2010 23:03:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1ED138FC15; Sat, 18 Dec 2010 23:03:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIN3d5B035941; Sat, 18 Dec 2010 23:03:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIN3dHY035939; Sat, 18 Dec 2010 23:03:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012182303.oBIN3dHY035939@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 18 Dec 2010 23:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216546 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:03:39 -0000 Author: yongari Date: Sat Dec 18 23:03:38 2010 New Revision: 216546 URL: http://svn.freebsd.org/changeset/base/216546 Log: Consistently put a tab character between #define and the macro name. Modified: head/sys/dev/jme/if_jmevar.h Modified: head/sys/dev/jme/if_jmevar.h ============================================================================== --- head/sys/dev/jme/if_jmevar.h Sat Dec 18 23:03:01 2010 (r216545) +++ head/sys/dev/jme/if_jmevar.h Sat Dec 18 23:03:38 2010 (r216546) @@ -66,8 +66,8 @@ * JMC250 can send 9K jumbo frame on Tx path and can receive * 65535 bytes. */ -#define JME_JUMBO_FRAMELEN 9216 -#define JME_JUMBO_MTU \ +#define JME_JUMBO_FRAMELEN 9216 +#define JME_JUMBO_MTU \ (JME_JUMBO_FRAMELEN - sizeof(struct ether_vlan_header) - \ ETHER_HDR_LEN - ETHER_CRC_LEN) #define JME_MAX_MTU \ @@ -143,14 +143,14 @@ struct jme_ring_data { bus_addr_t jme_ssb_block_paddr; }; -#define JME_TX_RING_ADDR(sc, i) \ +#define JME_TX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_tx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_RX_RING_ADDR(sc, i) \ +#define JME_RX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_rx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_TX_RING_SIZE \ +#define JME_TX_RING_SIZE \ (sizeof(struct jme_desc) * JME_TX_RING_CNT) -#define JME_RX_RING_SIZE \ +#define JME_RX_RING_SIZE \ (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) @@ -223,14 +223,14 @@ struct jme_softc { }; /* Register access macros. */ -#define CSR_WRITE_4(_sc, reg, val) \ +#define CSR_WRITE_4(_sc, reg, val) \ bus_write_4((_sc)->jme_res[0], (reg), (val)) -#define CSR_READ_4(_sc, reg) \ +#define CSR_READ_4(_sc, reg) \ bus_read_4((_sc)->jme_res[0], (reg)) -#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) -#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) -#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) +#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) +#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) +#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) #define JME_MAXERR 5 @@ -242,8 +242,8 @@ do { \ } while (0) #define JME_TX_TIMEOUT 5 -#define JME_TIMEOUT 1000 -#define JME_PHY_TIMEOUT 1000 -#define JME_EEPROM_TIMEOUT 1000 +#define JME_TIMEOUT 1000 +#define JME_PHY_TIMEOUT 1000 +#define JME_EEPROM_TIMEOUT 1000 #endif From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:03:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BF6110656C3; Sat, 18 Dec 2010 23:03:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A91B8FC14; Sat, 18 Dec 2010 23:03:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBIN3q89035992; Sat, 18 Dec 2010 23:03:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBIN3qPD035989; Sat, 18 Dec 2010 23:03:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012182303.oBIN3qPD035989@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Dec 2010 23:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216547 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:03:52 -0000 Author: jilles Date: Sat Dec 18 23:03:51 2010 New Revision: 216547 URL: http://svn.freebsd.org/changeset/base/216547 Log: sh: arith: Disallow decimal constants starting with 0 (containing 8 or 9). Constants in arithmetic starting with 0 should be octal only. This avoids the following highly puzzling result: $ echo $((018-017)) 3 by making it an error instead. Added: head/tools/regression/bin/sh/expansion/arith8.0 (contents, props changed) Modified: head/bin/sh/arith_lex.l Modified: head/bin/sh/arith_lex.l ============================================================================== --- head/bin/sh/arith_lex.l Sat Dec 18 23:03:38 2010 (r216546) +++ head/bin/sh/arith_lex.l Sat Dec 18 23:03:51 2010 (r216547) @@ -74,12 +74,12 @@ int yylex(void); return ARITH_NUM; } -0[0-7]+ { +0[0-7]* { yylval.l_value = strtoarith_t(yytext, NULL, 8); return ARITH_NUM; } -[0-9]+ { +[1-9][0-9]* { yylval.l_value = strtoarith_t(yytext, NULL, 10); return ARITH_NUM; } Added: head/tools/regression/bin/sh/expansion/arith8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith8.0 Sat Dec 18 23:03:51 2010 (r216547) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +v=$( (eval ': $((08))') 2>&1 >/dev/null) +[ $? -ne 0 ] && [ -n "$v" ] From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:21:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6E2A106566C; Sat, 18 Dec 2010 23:21:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C59BD8FC08; Sat, 18 Dec 2010 23:21:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBINLG34036813; Sat, 18 Dec 2010 23:21:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBINLGWf036811; Sat, 18 Dec 2010 23:21:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012182321.oBINLGWf036811@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 18 Dec 2010 23:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216548 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:21:16 -0000 Author: yongari Date: Sat Dec 18 23:21:16 2010 New Revision: 216548 URL: http://svn.freebsd.org/changeset/base/216548 Log: Fix a regression introduced in r213893. FPGA version requires PHY probing so allow PHY probing on all possible addresses. Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Dec 18 23:03:51 2010 (r216547) +++ head/sys/dev/jme/if_jme.c Sat Dec 18 23:21:16 2010 (r216548) @@ -730,8 +730,9 @@ jme_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, - jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, - MIIF_DOPAUSE); + jme_mediastatus, BMSR_DEFCAPMASK, + sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, + MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:24:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95F461065670; Sat, 18 Dec 2010 23:24:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84DB68FC08; Sat, 18 Dec 2010 23:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBINOxCK037023; Sat, 18 Dec 2010 23:24:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBINOxjR037021; Sat, 18 Dec 2010 23:24:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012182324.oBINOxjR037021@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 18 Dec 2010 23:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216549 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:24:59 -0000 Author: yongari Date: Sat Dec 18 23:24:59 2010 New Revision: 216549 URL: http://svn.freebsd.org/changeset/base/216549 Log: Make sure whether driver allocated resource before releasing it. Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Dec 18 23:21:16 2010 (r216548) +++ head/sys/dev/jme/if_jme.c Sat Dec 18 23:24:59 2010 (r216549) @@ -854,10 +854,12 @@ jme_detach(device_t dev) } } - bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); + if (sc->jme_irq[0] != NULL) + bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); if ((sc->jme_flags & (JME_FLAG_MSIX | JME_FLAG_MSI)) != 0) pci_release_msi(dev); - bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); + if (sc->jme_res[0] != NULL) + bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); mtx_destroy(&sc->jme_mtx); return (0); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:26:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12F9106566C; Sat, 18 Dec 2010 23:26:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B02788FC15; Sat, 18 Dec 2010 23:26:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBINQc9S037131; Sat, 18 Dec 2010 23:26:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBINQcqF037128; Sat, 18 Dec 2010 23:26:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012182326.oBINQcqF037128@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 18 Dec 2010 23:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216550 - head/sys/dev/jme X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:26:38 -0000 Author: yongari Date: Sat Dec 18 23:26:38 2010 New Revision: 216550 URL: http://svn.freebsd.org/changeset/base/216550 Log: Use system defined PCIR_EXPRESS_DEVICE_CTL instead of using magic number. Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Dec 18 23:24:59 2010 (r216549) +++ head/sys/dev/jme/if_jme.c Sat Dec 18 23:26:38 2010 (r216550) @@ -675,7 +675,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + 0x08, 2); + burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); From owner-svn-src-head@FreeBSD.ORG Sat Dec 18 23:52:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4590E106566B; Sat, 18 Dec 2010 23:52:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E2D8FC1C; Sat, 18 Dec 2010 23:52:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBINqp8J038301; Sat, 18 Dec 2010 23:52:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBINqp9s038295; Sat, 18 Dec 2010 23:52:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012182352.oBINqp9s038295@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 18 Dec 2010 23:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216551 - in head/sys/dev: jme mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2010 23:52:51 -0000 Author: yongari Date: Sat Dec 18 23:52:50 2010 New Revision: 216551 URL: http://svn.freebsd.org/changeset/base/216551 Log: Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet controller with Card Read Host Controller. These controllers are multi-function devices and have the same ethernet core of JMC250/JMC260. Starting from REVFM 5(chip full mask revision) controllers have the following features. o eFuse support o PCD(Packet Completion Deferring) o More advanced PHY power saving Because these controllers started to use eFuse, station address modified by driver is permanent as if it was written to EEPROM. If you have to change station address please save your controller default address to safe place before reprogramming it. There is no way to restore factory default station address. Many thanks to JMicron for continuing to support FreeBSD. HW donated by: JMicron Modified: head/sys/dev/jme/if_jme.c head/sys/dev/jme/if_jmereg.h head/sys/dev/jme/if_jmevar.h head/sys/dev/mii/jmphy.c head/sys/dev/mii/jmphyreg.h Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Sat Dec 18 23:26:38 2010 (r216550) +++ head/sys/dev/jme/if_jme.c Sat Dec 18 23:52:50 2010 (r216551) @@ -97,9 +97,9 @@ static struct jme_dev { const char *jme_name; } jme_devs[] = { { VENDORID_JMICRON, DEVICEID_JMC250, - "JMicron Inc, JMC250 Gigabit Ethernet" }, + "JMicron Inc, JMC25x Gigabit Ethernet" }, { VENDORID_JMICRON, DEVICEID_JMC260, - "JMicron Inc, JMC260 Fast Ethernet" }, + "JMicron Inc, JMC26x Fast Ethernet" }, }; static int jme_miibus_readreg(device_t, int, int); @@ -110,7 +110,9 @@ static int jme_mediachange(struct ifnet static int jme_probe(device_t); static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *); static int jme_eeprom_macaddr(struct jme_softc *); +static int jme_efuse_macaddr(struct jme_softc *); static void jme_reg_macaddr(struct jme_softc *); +static void jme_set_macaddr(struct jme_softc *, uint8_t *); static void jme_map_intr_vector(struct jme_softc *); static int jme_attach(device_t); static int jme_detach(device_t); @@ -152,6 +154,8 @@ static void jme_set_filter(struct jme_so static void jme_stats_clear(struct jme_softc *); static void jme_stats_save(struct jme_softc *); static void jme_stats_update(struct jme_softc *); +static void jme_phy_down(struct jme_softc *); +static void jme_phy_up(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -432,6 +436,55 @@ jme_eeprom_macaddr(struct jme_softc *sc) return (ENOENT); } +static int +jme_efuse_macaddr(struct jme_softc *sc) +{ + uint32_t reg; + int i; + + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | EFUSE_CTL1_AUTOLAOD_DONE)) != + EFUSE_CTL1_AUTOLAOD_DONE) + return (ENOENT); + /* Reset eFuse controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg |= EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg &= ~EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + + /* Have eFuse reload station address to MAC controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + reg &= ~EFUSE_CTL1_CMD_MASK; + reg |= EFUSE_CTL1_CMD_AUTOLOAD | EFUSE_CTL1_EXECUTE; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL1, reg, 4); + + /* + * Verify completion of eFuse autload command. It should be + * completed within 108us. + */ + DELAY(110); + for (i = 10; i > 0; i--) { + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | + EFUSE_CTL1_AUTOLAOD_DONE)) != EFUSE_CTL1_AUTOLAOD_DONE) { + DELAY(20); + continue; + } + if ((reg & EFUSE_CTL1_EXECUTE) == 0) + break; + /* Station address loading is still in progress. */ + DELAY(20); + } + if (i == 0) { + device_printf(sc->jme_dev, "eFuse autoload timed out.\n"); + return (ETIMEDOUT); + } + + return (0); +} + static void jme_reg_macaddr(struct jme_softc *sc) { @@ -446,6 +499,13 @@ jme_reg_macaddr(struct jme_softc *sc) device_printf(sc->jme_dev, "Failed to retrieve Ethernet address.\n"); } else { + /* + * For controllers that use eFuse, the station address + * could also be extracted from JME_PCI_PAR0 and + * JME_PCI_PAR1 registers in PCI configuration space. + * Each register holds exactly half of station address(24bits) + * so use JME_PAR0, JME_PAR1 registers instead. + */ sc->jme_eaddr[0] = (par0 >> 0) & 0xFF; sc->jme_eaddr[1] = (par0 >> 8) & 0xFF; sc->jme_eaddr[2] = (par0 >> 16) & 0xFF; @@ -456,6 +516,42 @@ jme_reg_macaddr(struct jme_softc *sc) } static void +jme_set_macaddr(struct jme_softc *sc, uint8_t *eaddr) +{ + uint32_t val; + int i; + + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + /* + * Avoid reprogramming station address if the address + * is the same as previous one. Note, reprogrammed + * station address is permanent as if it was written + * to EEPROM. So if station address was changed by + * admistrator it's possible to lose factory configured + * address when driver fails to restore its address. + * (e.g. reboot or system crash) + */ + if (bcmp(eaddr, sc->jme_eaddr, ETHER_ADDR_LEN) != 0) { + for (i = 0; i < ETHER_ADDR_LEN; i++) { + val = JME_EFUSE_EEPROM_FUNC0 << + JME_EFUSE_EEPROM_FUNC_SHIFT; + val |= JME_EFUSE_EEPROM_PAGE_BAR1 << + JME_EFUSE_EEPROM_PAGE_SHIFT; + val |= (JME_PAR0 + i) << + JME_EFUSE_EEPROM_ADDR_SHIFT; + val |= eaddr[i] << JME_EFUSE_EEPROM_DATA_SHIFT; + pci_write_config(sc->jme_dev, JME_EFUSE_EEPROM, + val | JME_EFUSE_EEPROM_WRITE, 4); + } + } + } else { + CSR_WRITE_4(sc, JME_PAR0, + eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); + CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + } +} + +static void jme_map_intr_vector(struct jme_softc *sc) { uint32_t map[MSINUM_NUM_INTR_SOURCE / JME_MSI_MESSAGES]; @@ -534,7 +630,7 @@ jme_attach(device_t dev) struct mii_data *mii; uint32_t reg; uint16_t burst; - int error, i, msic, msixc, pmc; + int error, i, mii_flags, msic, msixc, pmc; error = 0; sc = device_get_softc(dev); @@ -636,11 +732,14 @@ jme_attach(device_t dev) goto fail; } + /* Identify controller features and bugs. */ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; - sc->jme_flags |= JME_FLAG_TXCLK; + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + sc->jme_flags |= JME_FLAG_EFUSE | JME_FLAG_PCCPCD; + sc->jme_flags |= JME_FLAG_TXCLK | JME_FLAG_RXCLK; sc->jme_flags |= JME_FLAG_HWMIB; } @@ -648,14 +747,20 @@ jme_attach(device_t dev) jme_reset(sc); /* Get station address. */ - reg = CSR_READ_4(sc, JME_SMBCSR); - if ((reg & SMBCSR_EEPROM_PRESENT) != 0) - error = jme_eeprom_macaddr(sc); - if (error != 0 || (reg & SMBCSR_EEPROM_PRESENT) == 0) { - if (error != 0 && (bootverbose)) + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + error = jme_efuse_macaddr(sc); + if (error == 0) + jme_reg_macaddr(sc); + } else { + error = ENOENT; + reg = CSR_READ_4(sc, JME_SMBCSR); + if ((reg & SMBCSR_EEPROM_PRESENT) != 0) + error = jme_eeprom_macaddr(sc); + if (error != 0 && bootverbose) device_printf(sc->jme_dev, "ethernet hardware address not found in EEPROM.\n"); - jme_reg_macaddr(sc); + if (error != 0) + jme_reg_macaddr(sc); } /* @@ -728,11 +833,17 @@ jme_attach(device_t dev) } ifp->if_capenable = ifp->if_capabilities; + /* Wakeup PHY. */ + jme_phy_up(sc); + mii_flags = MIIF_DOPAUSE; + /* Ask PHY calibration to PHY driver. */ + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + mii_flags |= MIIF_MACPRIV0; /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, - MII_OFFSET_ANY, MIIF_DOPAUSE); + MII_OFFSET_ANY, mii_flags); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -825,6 +936,9 @@ jme_detach(device_t dev) taskqueue_drain(sc->jme_tq, &sc->jme_int_task); taskqueue_drain(sc->jme_tq, &sc->jme_tx_task); taskqueue_drain(taskqueue_swi, &sc->jme_link_task); + /* Restore possibly modified station address. */ + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) + jme_set_macaddr(sc, sc->jme_eaddr); ether_ifdetach(ifp); } @@ -1485,9 +1599,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) | GPREG1_RX_MAC_CLK_DIS); /* No PME capability, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); return; } @@ -1519,8 +1635,7 @@ jme_setwol(struct jme_softc *sc) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); if ((ifp->if_capenable & IFCAP_WOL) == 0) { /* No WOL, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); } } @@ -1558,6 +1673,8 @@ jme_resume(device_t dev) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } + /* Wakeup PHY. */ + jme_phy_up(sc); ifp = sc->jme_ifp; if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -2210,6 +2327,13 @@ jme_link_task(void *arg, int pending) CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr | RXCSR_RX_ENB | RXCSR_RXQ_START); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr | TXCSR_TX_ENB); + /* Lastly enable TX/RX clock. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, + CSR_READ_4(sc, JME_GHC) & ~GHC_TX_MAC_CLK_DIS); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) & ~GPREG1_RX_MAC_CLK_DIS); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2588,13 +2712,45 @@ jme_tick(void *arg) static void jme_reset(struct jme_softc *sc) { + uint32_t ghc, gpreg; /* Stop receiver, transmitter. */ jme_stop_rx(sc); jme_stop_tx(sc); + + /* Reset controller. */ CSR_WRITE_4(sc, JME_GHC, GHC_RESET); + CSR_READ_4(sc, JME_GHC); + DELAY(10); + /* + * Workaround Rx FIFO overruns seen under certain conditions. + * Explicitly synchorize TX/RX clock. TX/RX clock should be + * enabled only after enabling TX/RX MACs. + */ + if ((sc->jme_flags & (JME_FLAG_TXCLK | JME_FLAG_RXCLK)) != 0) { + /* Disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_RESET | GHC_TX_MAC_CLK_DIS); + /* Disable RX clock. */ + gpreg = CSR_READ_4(sc, JME_GPREG1); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + gpreg = CSR_READ_4(sc, JME_GPREG1); + /* De-assert RESET but still disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + ghc = CSR_READ_4(sc, JME_GHC); + + /* Enable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, ghc & ~GHC_TX_MAC_CLK_DIS); + /* Enable RX clock. */ + CSR_WRITE_4(sc, JME_GPREG1, gpreg & ~GPREG1_RX_MAC_CLK_DIS); + CSR_READ_4(sc, JME_GPREG1); + + /* Disable TX/RX clock again. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + } else + CSR_WRITE_4(sc, JME_GHC, 0); + CSR_READ_4(sc, JME_GHC); DELAY(10); - CSR_WRITE_4(sc, JME_GHC, 0); } static void @@ -2613,7 +2769,6 @@ jme_init_locked(struct jme_softc *sc) { struct ifnet *ifp; struct mii_data *mii; - uint8_t eaddr[ETHER_ADDR_LEN]; bus_addr_t paddr; uint32_t reg; int error; @@ -2649,10 +2804,7 @@ jme_init_locked(struct jme_softc *sc) jme_init_ssb(sc); /* Reprogram the station address. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); - CSR_WRITE_4(sc, JME_PAR0, - eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); - CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + jme_set_macaddr(sc, IF_LLADDR(sc->jme_ifp)); /* * Configure Tx queue. @@ -2790,6 +2942,30 @@ jme_init_locked(struct jme_softc *sc) PCCRX_COAL_PKT_MASK; CSR_WRITE_4(sc, JME_PCCRX0, reg); + /* + * Configure PCD(Packet Completion Deferring). It seems PCD + * generates an interrupt when the time interval between two + * back-to-back incoming/outgoing packet is long enough for + * it to reach its timer value 0. The arrival of new packets + * after timer has started causes the PCD timer to restart. + * Unfortunately, it's not clear how PCD is useful at this + * moment, so just use the same of PCC parameters. + */ + if ((sc->jme_flags & JME_FLAG_PCCPCD) != 0) { + sc->jme_rx_pcd_to = sc->jme_rx_coal_to; + if (sc->jme_rx_coal_to > PCDRX_TO_MAX) + sc->jme_rx_pcd_to = PCDRX_TO_MAX; + sc->jme_tx_pcd_to = sc->jme_tx_coal_to; + if (sc->jme_tx_coal_to > PCDTX_TO_MAX) + sc->jme_tx_pcd_to = PCDTX_TO_MAX; + reg = sc->jme_rx_pcd_to << PCDRX0_TO_THROTTLE_SHIFT; + reg |= sc->jme_rx_pcd_to << PCDRX0_TO_SHIFT; + CSR_WRITE_4(sc, PCDRX_REG(0), reg); + reg = sc->jme_tx_pcd_to << PCDTX_TO_THROTTLE_SHIFT; + reg |= sc->jme_tx_pcd_to << PCDTX_TO_SHIFT; + CSR_WRITE_4(sc, JME_PCDTX, reg); + } + /* Configure shadow status block but don't enable posting. */ paddr = sc->jme_rdata.jme_ssb_block_paddr; CSR_WRITE_4(sc, JME_SHBASE_ADDR_HI, JME_ADDR_HI(paddr)); @@ -3195,6 +3371,43 @@ jme_stats_update(struct jme_softc *sc) stat->tx_bad_frames += ostat->tx_bad_frames; } +static void +jme_phy_down(struct jme_softc *sc) +{ + uint32_t reg; + + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg |= 0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_D3; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + +static void +jme_phy_up(struct jme_softc *sc) +{ + uint32_t reg; + uint16_t bmcr; + + bmcr = jme_miibus_readreg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR); + bmcr &= ~BMCR_PDOWN; + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, bmcr); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg &= ~0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_DIS; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: head/sys/dev/jme/if_jmereg.h ============================================================================== --- head/sys/dev/jme/if_jmereg.h Sat Dec 18 23:26:38 2010 (r216550) +++ head/sys/dev/jme/if_jmereg.h Sat Dec 18 23:52:50 2010 (r216551) @@ -63,6 +63,10 @@ #define JME_PCI_DBG 0x9C +#define JME_PCI_PAR0 0xA4 /* JMC25x/JMC26x REVFM >= 5 */ + +#define JME_PCI_PAR1 0xA8 /* JMC25x/JMC26x REVFM >= 5 */ + #define JME_PCI_SPI 0xB0 #define SPI_ENB 0x00000010 @@ -71,6 +75,21 @@ #define SPI_SCK_CTRL 0x00000002 #define SPI_CS_N_CTRL 0x00000001 +#define JME_EFUSE_CTL1 0xB8 +#define EFUSE_CTL1_DATA_MASK 0xF0000000 +#define EFUSE_CTL1_EXECUTE 0x08000000 +#define EFUSE_CTL1_CMD_AUTOLOAD 0x02000000 +#define EFUSE_CTL1_CMD_READ 0x04000000 +#define EFUSE_CTL1_CMD_BLOW 0x06000000 +#define EFUSE_CTL1_CMD_MASK 0x06000000 +#define EFUSE_CTL1_AUTOLOAD_ERR 0x00010000 +#define EFUSE_CTL1_BYTE_SEL_MASK 0x0000FF00 +#define EFUSE_CTL1_BIT_SEL_MASK 0x00000070 +#define EFUSE_CTL1_AUTOLAOD_DONE 0x00000001 + +#define JME_EFUSE_CTL2 0xBC +#define EFUSE_CTL2_RESET 0x00008000 + #define JME_PCI_PHYCFG0 0xC0 #define JME_PCI_PHYCFG1 0xC4 @@ -86,7 +105,7 @@ /* PCIe link error/status. */ #define JME_PCI_LES 0xD8 -/* propeietary register 0. */ +/* Proprietary register 0. */ #define JME_PCI_PE0 0xE0 #define PE0_SPI_EXIST 0x00200000 #define PE0_PME_D0 0x00100000 @@ -115,7 +134,31 @@ #define PE0_PM_AUXC_MASK 0x00000007 #define PE0_PM_AUXC_DEF 0x00000007 +/* Proprietary register 1. */ #define JME_PCI_PE1 0xE4 +#define PE1_GIGA_PDOWN_MASK 0x0000C000 +#define PE1_GIGA_PDOWN_DIS 0x00000000 +#define PE1_GIGA_PDOWN_D3 0x00004000 +#define PE1_GIGA_PDOWN_PCIE_SHUTDOWN 0x00008000 +#define PE1_GIGA_PDOWN_PCIE_IDDQ 0x0000C000 + +#define JME_EFUSE_EEPROM 0xE8 +#define JME_EFUSE_EEPROM_WRITE 0x80000000 +#define JME_EFUSE_EEPROM_FUNC_MASK 0x70000000 +#define JME_EFUSE_EEPROM_PAGE_MASK 0x0F000000 +#define JME_EFUSE_EEPROM_ADDR_MASK 0x00FF0000 +#define JME_EFUSE_EEPROM_DATA_MASK 0x0000FF00 +#define JME_EFUSE_EEPROM_SMBSTAT_MASK 0x000000FF +#define JME_EFUSE_EEPROM_FUNC_SHIFT 28 +#define JME_EFUSE_EEPROM_PAGE_SHIFT 24 +#define JME_EFUSE_EEPROM_ADDR_SHIFT 16 +#define JME_EFUSE_EEPROM_DATA_SHIFT 8 +#define JME_EFUSE_EEPROM_SMBSTAT_SHIFT 0 + +#define JME_EFUSE_EEPROM_FUNC0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR1 1 +#define JME_EFUSE_EEPROM_PAGE_BAR2 2 #define JME_PCI_PHYTEST 0xF8 @@ -312,7 +355,7 @@ #define RXMAC_PAD_10BYTES 0x00000002 #define RXMAC_CSUM_ENB 0x00000001 -/* Rx unicast MAC address. */ +/* Rx unicast MAC address. Read-only on JMC25x/JMC26x REVFM >= 5 */ #define JME_PAR0 0x0038 #define JME_PAR1 0x003C @@ -455,6 +498,7 @@ #define JME_GIGARCHI 0x041C #define JME_GIGARDLO 0x0420 #define JME_GIGARDHI 0x0424 +#define JME_PHYPOWDN 0x0424 /* JMC250/JMC260 REVFM >= 5 */ /* BIST status and control. */ #define JME_GIGACSR 0x0428 @@ -627,6 +671,7 @@ /* General purpose register 1. */ #define JME_GPREG1 0x080C +#define GPREG1_RX_MAC_CLK_DIS 0x04000000 /* JMC250/JMC260 REVFM >= 2 */ #define GPREG1_RSS_IPV6_10_100 0x00000040 /* JMC250 A2 */ #define GPREG1_HDPX_FIX 0x00000020 /* JMC250 A2 */ #define GPREG1_INTDLY_UNIT_16US 0x00000018 /* JMC250 A1, A2 */ @@ -816,6 +861,53 @@ #define SHBASE_POST_FORCE 0x00000002 #define SHBASE_POST_ENB 0x00000001 +#define JME_PCDRX_BASE 0x0850 +#define JME_PCDRX_END 0x0857 +#define PCDRX_REG(x) (JME_PCDRX_BASE + (((x) / 2) * 4)) +#define PCDRX1_TO_THROTTLE_MASK 0xFF000000 +#define PCDRX1_TO_MASK 0x00FF0000 +#define PCDRX0_TO_THROTTLE_MASK 0x0000FF00 +#define PCDRX0_TO_MASK 0x000000FF +#define PCDRX1_TO_THROTTLE_SHIFT 24 +#define PCDRX1_TO_SHIFT 16 +#define PCDRX0_TO_THROTTLE_SHIFT 8 +#define PCDRX0_TO_SHIFT 0 +#define PCDRX_TO_MIN 1 +#define PCDRX_TO_MAX 255 + +#define JME_PCDTX 0x0858 +#define PCDTX_TO_THROTTLE_MASK 0x0000FF00 +#define PCDTX_TO_MASK 0x000000FF +#define PCDTX_TO_THROTTLE_SHIFT 8 +#define PCDTX_TO_SHIFT 0 +#define PCDTX_TO_MIN 1 +#define PCDTX_TO_MAX 255 + +#define JME_PCCPCD_STAT 0x085C +#define PCCPCD_STAT_RX3_MASK 0xFF000000 +#define PCCPCD_STAT_RX2_MASK 0x00FF0000 +#define PCCPCD_STAT_RX1_MASK 0x0000FF00 +#define PCCPCD_STAT_RX0_MASK 0x000000FF +#define PCCPCD_STAT_RX3_SHIFT 24 +#define PCCPCD_STAT_RX2_SHIFT 16 +#define PCCPCD_STAT_RX1_SHIFT 8 +#define PCCPCD_STAT_RX0_SHIFT 0 + +/* TX data throughput in KB. */ +#define JME_TX_THROUGHPUT 0x0860 +#define TX_THROUGHPUT_MASK 0x000FFFFF + +/* RX data throughput in KB. */ +#define JME_RX_THROUGHPUT 0x0864 +#define RX_THROUGHPUT_MASK 0x000FFFFF + +#define JME_LPI_CTL 0x086C +#define LPI_STAT_ANC_ANF 0x00000010 +#define LPI_STAT_AN_TIMEOUT 0x00000008 +#define LPI_STAT_RX_LPI 0x00000004 +#define LPI_INT_ENB 0x00000002 +#define LPI_REQ 0x00000001 + /* Timer 1 and 2. */ #define JME_TIMER1 0x0870 #define JME_TIMER2 0x0874 @@ -824,6 +916,15 @@ #define TIMER_CNT_SHIFT 0 #define TIMER_UNIT 1024 /* 1024us */ +/* Timer 3. */ +#define JME_TIMER3 0x0878 +#define TIMER3_TIMEOUT 0x00010000 +#define TIMER3_TIMEOUT_COUNT_MASK 0x0000FF00 /* 130ms unit */ +#define TIMER3_TIMEOUT_VAL_MASK 0x000000E0 +#define TIMER3_ENB 0x00000001 +#define TIMER3_TIMEOUT_COUNT_SHIFT 8 +#define TIMER3_TIMEOUT_VALUE_SHIFT 1 + /* Aggresive power mode control. */ #define JME_APMC 0x087C #define APMC_PCIE_SDOWN_STAT 0x80000000 Modified: head/sys/dev/jme/if_jmevar.h ============================================================================== --- head/sys/dev/jme/if_jmevar.h Sat Dec 18 23:26:38 2010 (r216550) +++ head/sys/dev/jme/if_jmevar.h Sat Dec 18 23:52:50 2010 (r216551) @@ -185,19 +185,22 @@ struct jme_softc { uint32_t jme_tx_dma_size; uint32_t jme_rx_dma_size; int jme_flags; -#define JME_FLAG_FPGA 0x0001 -#define JME_FLAG_PCIE 0x0002 -#define JME_FLAG_PCIX 0x0003 -#define JME_FLAG_MSI 0x0004 -#define JME_FLAG_MSIX 0x0010 -#define JME_FLAG_PMCAP 0x0020 -#define JME_FLAG_FASTETH 0x0040 -#define JME_FLAG_NOJUMBO 0x0080 -#define JME_FLAG_TXCLK 0x0100 -#define JME_FLAG_DMA32BIT 0x0200 -#define JME_FLAG_HWMIB 0x0400 -#define JME_FLAG_DETACH 0x4000 -#define JME_FLAG_LINK 0x8000 +#define JME_FLAG_FPGA 0x00000001 +#define JME_FLAG_PCIE 0x00000002 +#define JME_FLAG_PCIX 0x00000004 +#define JME_FLAG_MSI 0x00000008 +#define JME_FLAG_MSIX 0x00000010 +#define JME_FLAG_PMCAP 0x00000020 +#define JME_FLAG_FASTETH 0x00000040 +#define JME_FLAG_NOJUMBO 0x00000080 +#define JME_FLAG_RXCLK 0x00000100 +#define JME_FLAG_TXCLK 0x00000200 +#define JME_FLAG_DMA32BIT 0x00000400 +#define JME_FLAG_HWMIB 0x00000800 +#define JME_FLAG_EFUSE 0x00001000 +#define JME_FLAG_PCCPCD 0x00002000 +#define JME_FLAG_DETACH 0x40000000 +#define JME_FLAG_LINK 0x80000000 struct jme_hw_stats jme_ostats; struct jme_hw_stats jme_stats; @@ -210,8 +213,10 @@ struct jme_softc { uint32_t jme_rxcsr; int jme_process_limit; int jme_tx_coal_to; + int jme_tx_pcd_to; int jme_tx_coal_pkt; int jme_rx_coal_to; + int jme_rx_pcd_to; int jme_rx_coal_pkt; volatile int jme_morework; Modified: head/sys/dev/mii/jmphy.c ============================================================================== --- head/sys/dev/mii/jmphy.c Sat Dec 18 23:26:38 2010 (r216550) +++ head/sys/dev/mii/jmphy.c Sat Dec 18 23:52:50 2010 (r216551) @@ -104,6 +104,7 @@ jmphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; jsc = device_get_softc(dev); sc = &jsc->mii_sc; @@ -118,6 +119,10 @@ jmphy_attach(device_t dev) sc->mii_service = jmphy_service; sc->mii_pdata = mii; + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "jme") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -265,6 +270,7 @@ static void jmphy_reset(struct mii_softc *sc) { struct jmphy_softc *jsc; + uint16_t t2cr, val; int i; jsc = (struct jmphy_softc *)sc; @@ -279,6 +285,39 @@ jmphy_reset(struct mii_softc *sc) if ((PHY_READ(sc, MII_BMCR) & BMCR_RESET) == 0) break; } + /* Perform vendor recommended PHY calibration. */ + if ((sc->mii_flags & MIIF_PHYPRIV0) != 0) { + /* Select PHY test mode 1. */ + t2cr = PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + t2cr |= 0x2000; + PHY_WRITE(sc, MII_100T2CR, t2cr); + /* Apply calibration patch. */ + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~0x0002; + val |= 0x0010 | 0x0001; + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + + /* XXX 20ms to complete recalibration. */ + DELAY(20 * 1000); + + PHY_READ(sc, MII_100T2CR); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~(0x0001 | 0x0002 | 0x0010); + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + /* Disable PHY test mode. */ + PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + PHY_WRITE(sc, MII_100T2CR, t2cr); + } } static uint16_t Modified: head/sys/dev/mii/jmphyreg.h ============================================================================== --- head/sys/dev/mii/jmphyreg.h Sat Dec 18 23:26:38 2010 (r216550) +++ head/sys/dev/mii/jmphyreg.h Sat Dec 18 23:52:50 2010 (r216551) @@ -105,4 +105,13 @@ #define JMPHY_TMCTL 0x1A #define JMPHY_TMCTL_SLEEP_ENB 0x1000 +/* PHY specific configuration register. */ +#define JMPHY_SPEC_ADDR 0x1E +#define JMPHY_SPEC_ADDR_READ 0x4000 +#define JMPHY_SPEC_ADDR_WRITE 0x8000 + +#define JMPHY_SPEC_DATA 0x1F + +#define JMPHY_EXT_COMM_2 0x32 + #endif /* _DEV_MII_JMPHYREG_H_ */