From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 00:05:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDDB1065673; Sun, 14 Jun 2009 00:05:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29E158FC17; Sun, 14 Jun 2009 00:05:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E05dLk028250; Sun, 14 Jun 2009 00:05:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E05cXu028241; Sun, 14 Jun 2009 00:05:38 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906140005.n5E05cXu028241@svn.freebsd.org> From: Marius Strobl Date: Sun, 14 Jun 2009 00:05: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: r194138 - head/sys/dev/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 00:05:39 -0000 Author: marius Date: Sun Jun 14 00:05:38 2009 New Revision: 194138 URL: http://svn.freebsd.org/changeset/base/194138 Log: Fix style. Modified: head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofw_disk.c head/sys/dev/ofw/ofw_if.m head/sys/dev/ofw/ofw_iicbus.c head/sys/dev/ofw/ofw_standard.c head/sys/dev/ofw/ofwvar.h head/sys/dev/ofw/openfirm.c head/sys/dev/ofw/openfirm.h head/sys/dev/ofw/openfirmio.c Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_bus_subr.c Sun Jun 14 00:05:38 2009 (r194138) @@ -74,10 +74,11 @@ ofw_bus_gen_destroy_devinfo(struct ofw_b free(obd->obd_type, M_OFWPROP); } -int +int ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t child, char *buf, size_t buflen) { + if (ofw_bus_get_name(child) != NULL) { strlcat(buf, "name=", buflen); strlcat(buf, ofw_bus_get_name(child), buflen); @@ -87,7 +88,6 @@ ofw_bus_gen_child_pnpinfo_str(device_t c strlcat(buf, " compat=", buflen); strlcat(buf, ofw_bus_get_compat(child), buflen); } - return (0); }; @@ -95,19 +95,19 @@ const char * ofw_bus_gen_get_compat(device_t bus, device_t dev) { const struct ofw_bus_devinfo *obd; - - obd = OFW_BUS_GET_DEVINFO(bus, dev); + + obd = OFW_BUS_GET_DEVINFO(bus, dev); if (obd == NULL) return (NULL); return (obd->obd_compat); } - + const char * ofw_bus_gen_get_model(device_t bus, device_t dev) { const struct ofw_bus_devinfo *obd; - obd = OFW_BUS_GET_DEVINFO(bus, dev); + obd = OFW_BUS_GET_DEVINFO(bus, dev); if (obd == NULL) return (NULL); return (obd->obd_model); @@ -118,7 +118,7 @@ ofw_bus_gen_get_name(device_t bus, devic { const struct ofw_bus_devinfo *obd; - obd = OFW_BUS_GET_DEVINFO(bus, dev); + obd = OFW_BUS_GET_DEVINFO(bus, dev); if (obd == NULL) return (NULL); return (obd->obd_name); @@ -129,7 +129,7 @@ ofw_bus_gen_get_node(device_t bus, devic { const struct ofw_bus_devinfo *obd; - obd = OFW_BUS_GET_DEVINFO(bus, dev); + obd = OFW_BUS_GET_DEVINFO(bus, dev); if (obd == NULL) return (0); return (obd->obd_node); @@ -140,7 +140,7 @@ ofw_bus_gen_get_type(device_t bus, devic { const struct ofw_bus_devinfo *obd; - obd = OFW_BUS_GET_DEVINFO(bus, dev); + obd = OFW_BUS_GET_DEVINFO(bus, dev); if (obd == NULL) return (NULL); return (obd->obd_type); @@ -162,15 +162,13 @@ ofw_bus_setup_iinfo(phandle_t node, stru msksz = OF_getprop_alloc(node, "interrupt-map-mask", 1, (void **)&ii->opi_imapmsk); /* - * Failure to get the mask is ignored; a full mask is used then. - * Barf on bad mask sizes, however. + * Failure to get the mask is ignored; a full mask is used + * then. We barf on bad mask sizes, however. */ - if (msksz != -1 && msksz != ii->opi_addrc + intrsz) { + if (msksz != -1 && msksz != ii->opi_addrc + intrsz) panic("ofw_bus_setup_iinfo: bad interrupt-map-mask " "property!"); - } } - } int @@ -197,10 +195,10 @@ ofw_bus_lookup_imap(phandle_t node, stru * Map an interrupt using the firmware reg, interrupt-map and * interrupt-map-mask properties. * The interrupt property to be mapped must be of size intrsz, and pointed to - * by intr. The regs property of the node for which the mapping is done must + * by intr. The regs property of the node for which the mapping is done must * be passed as regs. This property is an array of register specifications; * the size of the address part of such a specification must be passed as - * physsz. Only the first element of the property is used. + * physsz. Only the first element of the property is used. * imap and imapsz hold the interrupt mask and it's size. * imapmsk is a pointer to the interrupt-map-mask property, which must have * a size of physsz + intrsz; it may be NULL, in which case a full mask is @@ -216,11 +214,11 @@ ofw_bus_search_intrmap(void *intr, int i int rintrsz) { phandle_t parent; - u_int8_t *ref = maskbuf; - u_int8_t *uiintr = intr; - u_int8_t *uiregs = regs; - u_int8_t *uiimapmsk = imapmsk; - u_int8_t *mptr; + uint8_t *ref = maskbuf; + uint8_t *uiintr = intr; + uint8_t *uiregs = regs; + uint8_t *uiimapmsk = imapmsk; + uint8_t *mptr; pcell_t pintrsz; int i, rsz, tsz; @@ -244,13 +242,13 @@ ofw_bus_search_intrmap(void *intr, int i pintrsz = 1; /* default */ pintrsz *= sizeof(pcell_t); - /* Compute the map stride size */ + /* Compute the map stride size. */ tsz = physsz + intrsz + sizeof(phandle_t) + pintrsz; KASSERT(i >= tsz, ("ofw_bus_search_intrmap: truncated map")); - + /* * XXX: Apple hardware uses a second cell to set information - * on the interrupt trigger type. This information should + * on the interrupt trigger type. This information should * be used somewhere to program the PIC. */ Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_bus_subr.h Sun Jun 14 00:05:38 2009 (r194138) @@ -41,30 +41,30 @@ #define ORIR_NOTFOUND 0xffffffff struct ofw_bus_iinfo { - u_int8_t *opi_imap; - u_int8_t *opi_imapmsk; + uint8_t *opi_imap; + uint8_t *opi_imapmsk; int opi_imapsz; pcell_t opi_addrc; }; +/* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); void ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *); +ofw_bus_get_compat_t ofw_bus_gen_get_compat; +ofw_bus_get_model_t ofw_bus_gen_get_model; +ofw_bus_get_name_t ofw_bus_gen_get_name; +ofw_bus_get_node_t ofw_bus_gen_get_node; +ofw_bus_get_type_t ofw_bus_gen_get_type; + /* Helper method to report interesting OF properties in pnpinfo */ -int ofw_bus_gen_child_pnpinfo_str(device_t, device_t, char *, size_t); +bus_child_pnpinfo_str_t ofw_bus_gen_child_pnpinfo_str; /* Routines for processing firmware interrupt maps */ - void ofw_bus_setup_iinfo(phandle_t, struct ofw_bus_iinfo *, int); int ofw_bus_lookup_imap(phandle_t, struct ofw_bus_iinfo *, void *, int, void *, int, void *, int, void *); int ofw_bus_search_intrmap(void *, int, void *, int, void *, int, void *, void *, void *, int); -ofw_bus_get_compat_t ofw_bus_gen_get_compat; -ofw_bus_get_model_t ofw_bus_gen_get_model; -ofw_bus_get_name_t ofw_bus_gen_get_name; -ofw_bus_get_node_t ofw_bus_gen_get_node; -ofw_bus_get_type_t ofw_bus_gen_get_type; - #endif /* !_DEV_OFW_OFW_BUS_SUBR_H_ */ Modified: head/sys/dev/ofw/ofw_disk.c ============================================================================== --- head/sys/dev/ofw/ofw_disk.c Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_disk.c Sun Jun 14 00:05:38 2009 (r194138) @@ -47,16 +47,16 @@ __FBSDID("$FreeBSD$"); struct ofwd_softc { - struct bio_queue_head ofwd_bio_queue; - struct mtx ofwd_queue_mtx; + struct bio_queue_head ofwd_bio_queue; + struct mtx ofwd_queue_mtx; ihandle_t ofwd_instance; off_t ofwd_mediasize; - unsigned ofwd_sectorsize; - unsigned ofwd_fwheads; - unsigned ofwd_fwsectors; - struct proc *ofwd_procp; - struct g_geom *ofwd_gp; - struct g_provider *ofwd_pp; + unsigned ofwd_sectorsize; + unsigned ofwd_fwheads; + unsigned ofwd_fwsectors; + struct proc *ofwd_procp; + struct g_geom *ofwd_gp; + struct g_provider *ofwd_pp; } ofwd_softc; static g_init_t g_ofwd_init; @@ -83,21 +83,21 @@ ofwd_startio(struct ofwd_softc *sc, stru r = OF_seek(sc->ofwd_instance, bp->bio_offset); - switch (bp->bio_cmd) { - case BIO_READ: + switch (bp->bio_cmd) { + case BIO_READ: r = OF_read(sc->ofwd_instance, (void *)bp->bio_data, - bp->bio_length); - break; - case BIO_WRITE: + bp->bio_length); + break; + case BIO_WRITE: r = OF_write(sc->ofwd_instance, (void *)bp->bio_data, - bp->bio_length); - break; - } + bp->bio_length); + break; + } if (r != bp->bio_length) panic("ofwd: incorrect i/o count"); - bp->bio_resid = 0; - return (0); + bp->bio_resid = 0; + return (0); } static void @@ -107,41 +107,41 @@ ofwd_kthread(void *arg) struct bio *bp; int error; - sc = arg; - curthread->td_base_pri = PRIBIO; + sc = arg; + curthread->td_base_pri = PRIBIO; - for (;;) { + for (;;) { mtx_lock(&sc->ofwd_queue_mtx); bp = bioq_takefirst(&sc->ofwd_bio_queue); if (!bp) { msleep(sc, &sc->ofwd_queue_mtx, PRIBIO | PDROP, "ofwdwait", 0); - continue; + continue; } - mtx_unlock(&sc->ofwd_queue_mtx); - if (bp->bio_cmd == BIO_GETATTR) { + mtx_unlock(&sc->ofwd_queue_mtx); + if (bp->bio_cmd == BIO_GETATTR) { error = EOPNOTSUPP; - } else + } else error = ofwd_startio(sc, bp); if (error != -1) { - bp->bio_completed = bp->bio_length; - g_io_deliver(bp, error); - } + bp->bio_completed = bp->bio_length; + g_io_deliver(bp, error); + } } } static void g_ofwd_init(struct g_class *mp __unused) { - struct ofwd_softc *sc; - struct g_geom *gp; - struct g_provider *pp; - char path[128]; - char fname[32]; + char path[128]; + char fname[32]; phandle_t ofd; + struct ofwd_softc *sc; + struct g_geom *gp; + struct g_provider *pp; ihandle_t ifd; - int error; + int error; if (ofwd_enable == 0) return; @@ -161,19 +161,19 @@ g_ofwd_init(struct g_class *mp __unused) } sc = (struct ofwd_softc *)malloc(sizeof *sc, M_DEVBUF, - M_WAITOK|M_ZERO); + M_WAITOK|M_ZERO); bioq_init(&sc->ofwd_bio_queue); - mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF); + mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF); sc->ofwd_instance = ifd; - sc->ofwd_mediasize = (off_t)2*33554432; + sc->ofwd_mediasize = (off_t)2 * 33554432; sc->ofwd_sectorsize = OFWD_BLOCKSIZE; sc->ofwd_fwsectors = 0; sc->ofwd_fwheads = 0; error = kproc_create(ofwd_kthread, sc, &sc->ofwd_procp, 0, 0, - "ofwd0"); - if (error != 0) { + "ofwd0"); + if (error != 0) { free(sc, M_DEVBUF); - return; + return; } gp = g_new_geomf(&g_ofwd_class, "ofwd0"); @@ -189,13 +189,13 @@ g_ofwd_init(struct g_class *mp __unused) static void g_ofwd_start(struct bio *bp) { - struct ofwd_softc *sc; + struct ofwd_softc *sc; - sc = bp->bio_to->geom->softc; - mtx_lock(&sc->ofwd_queue_mtx); - bioq_disksort(&sc->ofwd_bio_queue, bp); - mtx_unlock(&sc->ofwd_queue_mtx); - wakeup(sc); + sc = bp->bio_to->geom->softc; + mtx_lock(&sc->ofwd_queue_mtx); + bioq_disksort(&sc->ofwd_bio_queue, bp); + mtx_unlock(&sc->ofwd_queue_mtx); + wakeup(sc); } static int @@ -204,5 +204,5 @@ g_ofwd_access(struct g_provider *pp, int if (pp->geom->softc == NULL) return (ENXIO); - return (0); + return (0); } Modified: head/sys/dev/ofw/ofw_if.m ============================================================================== --- head/sys/dev/ofw/ofw_if.m Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_if.m Sun Jun 14 00:05:38 2009 (r194138) @@ -32,7 +32,7 @@ /** * @defgroup OFW ofw - KObj methods for Open Firmware RTAS implementations * @brief A set of methods to implement the Open Firmware client side interface. - *@{ + * @{ */ INTERFACE ofw; @@ -49,59 +49,59 @@ METHOD void init { }; /** - * @brief Return next sibling of node + * @brief Return next sibling of node. * * @param _node Selected node */ METHOD phandle_t peer { ofw_t _ofw; - phandle_t _node; + phandle_t _node; }; /** - * @brief Return parent of node + * @brief Return parent of node. * * @param _node Selected node */ METHOD phandle_t parent { ofw_t _ofw; - phandle_t _node; + phandle_t _node; }; /** - * @brief Return first child of node + * @brief Return first child of node. * * @param _node Selected node */ METHOD phandle_t child { ofw_t _ofw; - phandle_t _node; + phandle_t _node; }; /** - * @brief Return package corresponding to instance + * @brief Return package corresponding to instance. * * @param _handle Selected instance */ METHOD phandle_t instance_to_package { ofw_t _ofw; - ihandle_t _handle; + ihandle_t _handle; }; /** - * @brief Return length of node property + * @brief Return length of node property. * * @param _node Selected node * @param _prop Property name */ METHOD ssize_t getproplen { ofw_t _ofw; - phandle_t _node; - const char *_prop; + phandle_t _node; + const char *_prop; }; /** - * @brief Read node property + * @brief Read node property. * * @param _node Selected node * @param _prop Property name @@ -110,14 +110,14 @@ METHOD ssize_t getproplen { */ METHOD ssize_t getprop { ofw_t _ofw; - phandle_t _node; + phandle_t _node; const char *_prop; void *_buf; size_t _size; }; /** - * @brief Get next property name + * @brief Get next property name. * * @param _node Selected node * @param _prop Current property name @@ -126,14 +126,14 @@ METHOD ssize_t getprop { */ METHOD int nextprop { ofw_t _ofw; - phandle_t _node; + phandle_t _node; const char *_prop; - char *_buf; + char *_buf; size_t _size; }; /** - * @brief Set property + * @brief Set property. * * @param _node Selected node * @param _prop Property name @@ -142,14 +142,14 @@ METHOD int nextprop { */ METHOD int setprop { ofw_t _ofw; - phandle_t _node; - const char *_prop; + phandle_t _node; + const char *_prop; const void *_buf; size_t _size; }; /** - * @brief Canonicalize path + * @brief Canonicalize path. * * @param _path Path to canonicalize * @param _buf Buffer for canonicalized path @@ -163,17 +163,17 @@ METHOD ssize_t canon { }; /** - * @brief Return phandle for named device + * @brief Return phandle for named device. * * @param _path Device path */ METHOD phandle_t finddevice { ofw_t _ofw; - const char *_path; + const char *_path; }; /** - * @brief Return path for node instance + * @brief Return path for node instance. * * @param _handle Instance handle * @param _path Buffer for path @@ -182,12 +182,12 @@ METHOD phandle_t finddevice { METHOD ssize_t instance_to_path { ofw_t _ofw; ihandle_t _handle; - char *_path; + char *_path; size_t _size; }; /** - * @brief Return path for node + * @brief Return path for node. * * @param _node Package node * @param _path Buffer for path @@ -196,11 +196,10 @@ METHOD ssize_t instance_to_path { METHOD ssize_t package_to_path { ofw_t _ofw; phandle_t _node; - char *_path; + char *_path; size_t _size; }; - # Methods for OF method calls (optional) /** @@ -214,7 +213,7 @@ METHOD int test { }; /** - * @brief Call method belonging to an instance handle + * @brief Call method belonging to an instance handle. * * @param _instance Instance handle * @param _method Method name @@ -228,13 +227,13 @@ METHOD int call_method { ihandle_t _instance; const char *_method; int _nargs; - int _nreturns; + int _nreturns; unsigned long *_args_and_returns; }; /** - * @brief Interpret a forth command + * @brief Interpret a forth command. * * @param _cmd Command * @param _nreturns Number of return values @@ -244,14 +243,14 @@ METHOD int call_method { METHOD int interpret { ofw_t _ofw; const char *_cmd; - int _nreturns; + int _nreturns; unsigned long *_returns; }; # Device I/O Functions (optional) /** - * @brief Open node, returning instance handle + * @brief Open node, returning instance handle. * * @param _path Path to node */ @@ -261,7 +260,7 @@ METHOD ihandle_t open { } /** - * @brief Close node instance + * @brief Close node instance. * * @param _instance Instance to close */ @@ -271,7 +270,7 @@ METHOD void close { } /** - * @brief Read from device + * @brief Read from device. * * @param _instance Device instance * @param _buf Buffer to read to @@ -285,7 +284,7 @@ METHOD ssize_t read { } /** - * @brief Write to device + * @brief Write to device. * * @param _instance Device instance * @param _buf Buffer to write from @@ -299,7 +298,7 @@ METHOD ssize_t write { } /** - * @brief Seek device + * @brief Seek device. * * @param _instance Device instance * @param _off Offset to which to seek @@ -313,7 +312,7 @@ METHOD int seek { # Open Firmware memory management /** - * @brief Claim virtual memory + * @brief Claim virtual memory. * * @param _addr Requested memory location (NULL for first available) * @param _size Requested size in bytes @@ -327,7 +326,7 @@ METHOD caddr_t claim { } /** - * @brief Release virtual memory + * @brief Release virtual memory. * * @param _addr Memory location * @param _size Size in bytes @@ -341,17 +340,15 @@ METHOD void release { # Commands for returning control to the firmware /** - * @brief Temporarily return control to firmware + * @brief Temporarily return control to firmware. */ METHOD void enter { ofw_t _ofw; }; /** - * @brief Halt and return control to firmware + * @brief Halt and return control to firmware. */ METHOD void exit { ofw_t _ofw; }; - - Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_iicbus.c Sun Jun 14 00:05:38 2009 (r194138) @@ -68,7 +68,7 @@ static device_method_t ofw_iicbus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + KOBJMETHOD_END }; struct ofw_iicbus_devinfo { @@ -100,7 +100,7 @@ ofw_iicbus_attach(device_t dev) { struct iicbus_softc *sc = IICBUS_SOFTC(dev); struct ofw_iicbus_devinfo *dinfo; - phandle_t node, child; + phandle_t child; device_t childdev; uint32_t addr; @@ -114,16 +114,13 @@ ofw_iicbus_attach(device_t dev) /* * Attach those children represented in the device tree. */ - - node = ofw_bus_get_node(dev); - - for (child = OF_child(node); child != 0; child = OF_peer(child)) { + for (child = OF_child(ofw_bus_get_node(dev)); child != 0; + child = OF_peer(child)) { /* * Try to get the I2C address first from the i2c-address - * property, then try the reg property. It moves around + * property, then try the reg property. It moves around * on different systems. */ - if (OF_getprop(child, "i2c-address", &addr, sizeof(addr)) == -1) if (OF_getprop(child, "reg", &addr, sizeof(addr)) == -1) continue; @@ -132,7 +129,6 @@ ofw_iicbus_attach(device_t dev) * Now set up the I2C and OFW bus layer devinfo and add it * to the bus. */ - dinfo = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, M_NOWAIT | M_ZERO); if (dinfo == NULL) @@ -159,15 +155,17 @@ ofw_iicbus_add_child(device_t dev, int o child = device_add_child_ordered(dev, order, name, unit); if (child == NULL) return (child); - devi = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, + devi = malloc(sizeof(struct ofw_iicbus_devinfo), M_DEVBUF, M_NOWAIT | M_ZERO); if (devi == NULL) { device_delete_child(dev, child); return (0); } - /* NULL all the OFW-related parts of the ivars for non-OFW children */ - + /* + * NULL all the OFW-related parts of the ivars for non-OFW + * children. + */ devi->opd_obdinfo.obd_node = -1; devi->opd_obdinfo.obd_name = NULL; devi->opd_obdinfo.obd_compat = NULL; @@ -175,7 +173,7 @@ ofw_iicbus_add_child(device_t dev, int o devi->opd_obdinfo.obd_model = NULL; device_set_ivars(child, devi); - + return (child); } @@ -187,4 +185,3 @@ ofw_iicbus_get_devinfo(device_t bus, dev dinfo = device_get_ivars(dev); return (&dinfo->opd_obdinfo); } - Modified: head/sys/dev/ofw/ofw_standard.c ============================================================================== --- head/sys/dev/ofw/ofw_standard.c Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofw_standard.c Sun Jun 14 00:05:38 2009 (r194138) @@ -65,8 +65,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include + #include "ofw_if.h" static void ofw_std_init(ofw_t ofw, void *openfirm); @@ -101,7 +102,7 @@ static ssize_t ofw_std_read(ofw_t ofw, i size_t len); static ssize_t ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len); -static int ofw_std_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos); +static int ofw_std_seek(ofw_t ofw, ihandle_t instance, uint64_t pos); static caddr_t ofw_std_claim(ofw_t ofw, void *virt, size_t size, u_int align); static void ofw_std_release(ofw_t ofw, void *virt, size_t size); static void ofw_std_enter(ofw_t ofw); @@ -147,11 +148,12 @@ OFW_DEF(ofw_std); static int (*openfirmware)(void *); -/* Initialiser */ +/* Initializer */ static void ofw_std_init(ofw_t ofw, void *openfirm) { + openfirmware = (int (*)(void *))openfirm; } @@ -199,9 +201,8 @@ ofw_std_interpret(ofw_t ofw, const char args.nreturns = ++nreturns; args.slot[i++] = (cell_t)cmd; - if (openfirmware(&args) == -1) { + if (openfirmware(&args) == -1) return (-1); - } status = args.slot[i++]; while (i < 1 + nreturns) returns[j++] = args.slot[i++]; @@ -571,9 +572,8 @@ ofw_std_open(ofw_t ofw, const char *devi }; args.device = (cell_t)device; - if (openfirmware(&args) == -1 || args.instance == 0) { + if (openfirmware(&args) == -1 || args.instance == 0) return (-1); - } return (args.instance); } @@ -650,7 +650,7 @@ ofw_std_write(ofw_t ofw, ihandle_t insta /* Seek to a position. */ static int -ofw_std_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos) +ofw_std_seek(ofw_t ofw, ihandle_t instance, uint64_t pos) { static struct { cell_t name; @@ -760,4 +760,3 @@ ofw_std_exit(ofw_t ofw) for (;;) /* just in case */ ; } - Modified: head/sys/dev/ofw/ofwvar.h ============================================================================== --- head/sys/dev/ofw/ofwvar.h Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/ofwvar.h Sun Jun 14 00:05:38 2009 (r194138) @@ -27,8 +27,8 @@ * $FreeBSD$ */ -#ifndef _OFW_OFWVAR_H_ -#define _OFW_OFWVAR_H_ +#ifndef _DEV_OFW_OFWVAR_H_ +#define _DEV_OFW_OFWVAR_H_ /* * An Open Firmware client implementation is declared with a kernel object and @@ -45,7 +45,7 @@ * }; * * static ofw_def_t ofw_fdt = { - * "ofw_fdt", + * "ofw_fdt", * fdt_methods, * sizeof(fdt_softc), // or 0 if no softc * }; @@ -69,21 +69,21 @@ struct ofw_kobj { /* * Opaque data that can be overlaid with an instance-private - * structure. OFW code can test that this is large enough at - * compile time with a sizeof() test againt it's softc. There + * structure. OFW code can test that this is large enough at + * compile time with a sizeof() test againt it's softc. There * is also a run-time test when the MMU kernel object is * registered. */ -#define OFW_OPAQUESZ 64 +#define OFW_OPAQUESZ 64 u_int ofw_opaque[OFW_OPAQUESZ]; }; typedef struct ofw_kobj *ofw_t; typedef struct kobj_class ofw_def_t; -#define ofw_method_t kobj_method_t -#define OFWMETHOD KOBJMETHOD +#define ofw_method_t kobj_method_t +#define OFWMETHOD KOBJMETHOD -#define OFW_DEF(name) DATA_SET(ofw_set, name) +#define OFW_DEF(name) DATA_SET(ofw_set, name) -#endif /* _OFW_OFWVAR_H_ */ +#endif /* _DEV_OFW_OFWVAR_H_ */ Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sat Jun 13 23:44:56 2009 (r194137) +++ head/sys/dev/ofw/openfirm.c Sun Jun 14 00:05:38 2009 (r194138) @@ -65,8 +65,8 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include #include "ofw_if.h" @@ -88,12 +88,12 @@ SET_DECLARE(ofw_set, ofw_def_t); boolean_t OF_install(char *name, int prio) { - ofw_def_t **ofwpp, *ofwp; + ofw_def_t *ofwp, **ofwpp; static int curr_prio = 0; /* - * Try and locate the OFW kobj corresponding to the name - */ + * Try and locate the OFW kobj corresponding to the name. + */ SET_FOREACH(ofwpp, ofw_set) { ofwp = *ofwpp; @@ -109,8 +109,7 @@ OF_install(char *name, int prio) return (FALSE); } -/* Initialiser */ - +/* Initializer */ void OF_init(void *cookie) { @@ -119,7 +118,7 @@ OF_init(void *cookie) ofw_obj = &ofw_kernel_obj; /* * Take care of compiling the selected class, and - * then statically initialize the OFW object + * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); kobj_init((kobj_t)ofw_obj, ofw_def_impl); @@ -152,6 +151,7 @@ OF_printf(const char *fmt, ...) int OF_test(const char *name) { + return (OFW_TEST(ofw_obj, name)); } @@ -183,6 +183,7 @@ OF_interpret(const char *cmd, int nretur phandle_t OF_peer(phandle_t node) { + return (OFW_PEER(ofw_obj, node)); } @@ -190,6 +191,7 @@ OF_peer(phandle_t node) phandle_t OF_child(phandle_t node) { + return (OFW_CHILD(ofw_obj, node)); } @@ -197,6 +199,7 @@ OF_child(phandle_t node) phandle_t OF_parent(phandle_t node) { + return (OFW_PARENT(ofw_obj, node)); } @@ -204,6 +207,7 @@ OF_parent(phandle_t node) phandle_t OF_instance_to_package(ihandle_t instance) { + return (OFW_INSTANCE_TO_PACKAGE(ofw_obj, instance)); } @@ -211,6 +215,7 @@ OF_instance_to_package(ihandle_t instanc ssize_t OF_getproplen(phandle_t package, const char *propname) { + return (OFW_GETPROPLEN(ofw_obj, package, propname)); } @@ -218,6 +223,7 @@ OF_getproplen(phandle_t package, const c ssize_t OF_getprop(phandle_t package, const char *propname, void *buf, size_t buflen) { + return (OFW_GETPROP(ofw_obj, package, propname, buf, buflen)); } @@ -227,20 +233,19 @@ OF_getprop(phandle_t package, const char * first match. */ ssize_t -OF_searchprop(phandle_t node, char *propname, void *buf, size_t len) +OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len) { ssize_t rv; - for (; node != 0; node = OF_parent(node)) { + for (; node != 0; node = OF_parent(node)) if ((rv = OF_getprop(node, propname, buf, len)) != -1) return (rv); - } return (-1); } /* * Store the value of a property of a package into newly allocated memory - * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a + * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a * single element, the number of elements is return in number. */ ssize_t @@ -266,6 +271,7 @@ OF_getprop_alloc(phandle_t package, cons int OF_nextprop(phandle_t package, const char *previous, char *buf, size_t size) { + return (OFW_NEXTPROP(ofw_obj, package, previous, buf, size)); } @@ -273,6 +279,7 @@ OF_nextprop(phandle_t package, const cha int OF_setprop(phandle_t package, const char *propname, const void *buf, size_t len) { + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 00:15:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4750E106566B; Sun, 14 Jun 2009 00:15:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 345A38FC0C; Sun, 14 Jun 2009 00:15:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E0FRju028456; Sun, 14 Jun 2009 00:15:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E0FRWk028455; Sun, 14 Jun 2009 00:15:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906140015.n5E0FRWk028455@svn.freebsd.org> From: Marius Strobl Date: Sun, 14 Jun 2009 00:15: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: r194139 - head/sys/dev/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 00:15:27 -0000 Author: marius Date: Sun Jun 14 00:15:26 2009 New Revision: 194139 URL: http://svn.freebsd.org/changeset/base/194139 Log: Missed style fixes. Modified: head/sys/dev/ofw/ofw_disk.c Modified: head/sys/dev/ofw/ofw_disk.c ============================================================================== --- head/sys/dev/ofw/ofw_disk.c Sun Jun 14 00:05:38 2009 (r194138) +++ head/sys/dev/ofw/ofw_disk.c Sun Jun 14 00:15:26 2009 (r194139) @@ -21,8 +21,6 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * */ #include @@ -86,11 +84,11 @@ ofwd_startio(struct ofwd_softc *sc, stru switch (bp->bio_cmd) { case BIO_READ: r = OF_read(sc->ofwd_instance, (void *)bp->bio_data, - bp->bio_length); + bp->bio_length); break; case BIO_WRITE: r = OF_write(sc->ofwd_instance, (void *)bp->bio_data, - bp->bio_length); + bp->bio_length); break; } if (r != bp->bio_length) @@ -161,7 +159,7 @@ g_ofwd_init(struct g_class *mp __unused) } sc = (struct ofwd_softc *)malloc(sizeof *sc, M_DEVBUF, - M_WAITOK|M_ZERO); + M_WAITOK | M_ZERO); bioq_init(&sc->ofwd_bio_queue); mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF); sc->ofwd_instance = ifd; From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 02:55:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB48D1065670; Sun, 14 Jun 2009 02:55:07 +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 BA1958FC0C; Sun, 14 Jun 2009 02:55:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E2t7HQ032450; Sun, 14 Jun 2009 02:55:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E2t7kZ032449; Sun, 14 Jun 2009 02:55:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906140255.n5E2t7kZ032449@svn.freebsd.org> From: Warner Losh Date: Sun, 14 Jun 2009 02:55: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: r194141 - head/sys/mips/idt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 02:55:08 -0000 Author: imp Date: Sun Jun 14 02:55:07 2009 New Revision: 194141 URL: http://svn.freebsd.org/changeset/base/194141 Log: Formatting nit. Modified: head/sys/mips/idt/files.idt Modified: head/sys/mips/idt/files.idt ============================================================================== --- head/sys/mips/idt/files.idt Sun Jun 14 02:46:07 2009 (r194140) +++ head/sys/mips/idt/files.idt Sun Jun 14 02:55:07 2009 (r194141) @@ -2,7 +2,7 @@ mips/idt/idt_machdep.c standard mips/idt/idtpci.c optional pci -mips/idt/if_kr.c optional kr +mips/idt/if_kr.c optional kr mips/idt/obio.c standard mips/idt/uart_cpu_rc32434.c optional uart mips/idt/uart_bus_rc32434.c optional uart From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 02:58:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 636161065673; Sun, 14 Jun 2009 02:58:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5233B8FC13; Sun, 14 Jun 2009 02:58:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E2wuZj032543; Sun, 14 Jun 2009 02:58:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E2wu8o032542; Sun, 14 Jun 2009 02:58:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906140258.n5E2wu8o032542@svn.freebsd.org> From: Warner Losh Date: Sun, 14 Jun 2009 02:58: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: r194142 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 02:58:56 -0000 Author: imp Date: Sun Jun 14 02:58:56 2009 New Revision: 194142 URL: http://svn.freebsd.org/changeset/base/194142 Log: After Marcel's change to DEFAULTS, we were bringing in a bogus copy of uart_8250. Remove it here since the UART on the ADM5120 isn't the typical 16550: its completely different. Modified: head/sys/mips/conf/ADM5120 Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Sun Jun 14 02:55:07 2009 (r194141) +++ head/sys/mips/conf/ADM5120 Sun Jun 14 02:58:56 2009 (r194142) @@ -54,7 +54,6 @@ options BOOTP_COMPAT #options UFS_DIRHASH #Improve performance on big directories options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" - # Debugging for use in -current options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS @@ -64,4 +63,5 @@ options INVARIANT_SUPPORT #Extra sanity device loop device ether device uart +nodevice uart_8250 # No 8250 here # device md From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 03:29:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D061065672; Sun, 14 Jun 2009 03:29:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74FCA8FC13; Sun, 14 Jun 2009 03:29:14 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E3TEin033435; Sun, 14 Jun 2009 03:29:14 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E3TEcZ033434; Sun, 14 Jun 2009 03:29:14 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906140329.n5E3TEcZ033434@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 03:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194144 - head/tools/tools/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 03:29:15 -0000 Author: edwin Date: Sun Jun 14 03:29:14 2009 New Revision: 194144 URL: http://svn.freebsd.org/changeset/base/194144 Log: Tool to compare two (roughly similar) termcap entries (like rxvt-mono and rxvt-unicode) so see which fields should don't need to be copied if the :tc=xxx: option is used. Added: head/tools/tools/termcap/ head/tools/tools/termcap/compare_termcap.pl (contents, props changed) Added: head/tools/tools/termcap/compare_termcap.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/termcap/compare_termcap.pl Sun Jun 14 03:29:14 2009 (r194144) @@ -0,0 +1,98 @@ +#!/usr/bin/perl -w + +# +# Copyright (C) 2009 Edwin Groothuis. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +use strict; +use Data::Dumper; + +if ($#ARGV != 1) { + print < +Compares the entries in the termcap.src for and and +print the keys and definitions on the screen. This can be used to reduce +the size of two similar termcap entries with the "tc" option. +EOF + exit(0); +} + +open(FIN, "termcap.src"); +my @lines = ; +chomp(@lines); +close(FIN); + +my %tcs = (); + +my $tc = ""; +foreach my $l (@lines) { + next if ($l =~ /^#/); + next if ($l eq ""); + + $tc .= $l; + next if ($l =~ /\\$/); + + my @a = split(/:/, $tc); + next if ($#a < 0); + my @b = split(/\|/, $a[0]); + if ($#b >= 0) { + $tcs{$b[0]} = $tc; + } else { + $tcs{$a[0]} = $tc; + } + $tc = ""; +} + +die "Cannot find definitions for $ARGV[0]" if (!defined $tcs{$ARGV[0]}); +die "Cannot find definitions for $ARGV[1]" if (!defined $tcs{$ARGV[1]}); + +my %tc = (); +my %keys = (); + +for (my $i = 0; $i < 2; $i++) { + foreach my $tc (split(/:/, $tcs{$ARGV[$i]})) { + next if ($tc =~ /^\\/); + $tc{$i}{$tc} = 0 if (!defined $tc{$i}{$tc}); + $tc{$i}{$tc}++; + $keys{$tc} = 0; + } +} + +foreach my $key (sort(keys(%keys))) { + if (length($key) > 15) { + print "$key\n"; + printf("%-15s %-3s %-3s\n", "", + defined $tc{0}{$key} ? "+" : "", + defined $tc{1}{$key} ? "+" : "" + ); + } else { + printf("%-15s %-3s %-3s\n", $key, + defined $tc{0}{$key} ? "+" : "", + defined $tc{1}{$key} ? "+" : "" + ); + } +} + From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 03:32:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7853F106564A; Sun, 14 Jun 2009 03:32:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D60A8FC13; Sun, 14 Jun 2009 03:32:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E3WqFk033554; Sun, 14 Jun 2009 03:32:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E3Wq6k033553; Sun, 14 Jun 2009 03:32:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200906140332.n5E3Wq6k033553@svn.freebsd.org> From: Warner Losh Date: Sun, 14 Jun 2009 03:32: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: r194145 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 03:32:53 -0000 Author: imp Date: Sun Jun 14 03:32:52 2009 New Revision: 194145 URL: http://svn.freebsd.org/changeset/base/194145 Log: Fix typo... bad imp. Modified: head/sys/mips/conf/ADM5120 Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Sun Jun 14 03:29:14 2009 (r194144) +++ head/sys/mips/conf/ADM5120 Sun Jun 14 03:32:52 2009 (r194145) @@ -63,5 +63,5 @@ options INVARIANT_SUPPORT #Extra sanity device loop device ether device uart -nodevice uart_8250 # No 8250 here +nodevice uart_ns8250 # ADM5120's UART not 16550-like # device md From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 03:34:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B30E1065672; Sun, 14 Jun 2009 03:34:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A06A8FC29; Sun, 14 Jun 2009 03:34:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E3YsRe033637; Sun, 14 Jun 2009 03:34:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E3Ysjn033636; Sun, 14 Jun 2009 03:34:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906140334.n5E3Ysjn033636@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 03:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194146 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 03:34:54 -0000 Author: edwin Date: Sun Jun 14 03:34:54 2009 New Revision: 194146 URL: http://svn.freebsd.org/changeset/base/194146 Log: Add missing termcap entry for rxvt-unicode. The termcap database does not have an entry for rxvt-unicode. This means that programs that need an entry such as vi fail to work when connecting via ssh using this terminal emulator. The added data is not the same as the PR submitted by Richard, it uses the :tc=xxx: option to inherit everything from rxvt-mono. PR: conf/117323 Submitted by: Richard Bradshaw MFC after: 1 week Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sun Jun 14 03:32:52 2009 (r194145) +++ head/share/termcap/termcap.src Sun Jun 14 03:34:54 2009 (r194146) @@ -4547,6 +4547,12 @@ rxvt-mono|rxvt terminal emulator (monoch :te=\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:us=\E[4m:\ :vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:vs=\E[?25h: +# Termcap entry for rxvt-unicode, taken from http://cvs.schmorp.de/rxvt-unicode/doc/rxvt.7.html#I_need_a_termcap_file_entry +rxvt-unicode|rxvt-unicode terminal (X Window System):\ + :SF=\E[%dS:SR=\E[%dT:bw:ec=\E[%dX:kb=\177:kd=\EOB:ke=\E[?1l\E>:\ + :kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:lm#0:te=\E[r\E[?1049l:\ + :ti=\E[?1049h:tc=rxvt-mono: + rxvt|rxvt terminal emulator (X Window System):\ :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono: From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 04:03:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B93C6106566B; Sun, 14 Jun 2009 04:03:18 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6108FC08; Sun, 14 Jun 2009 04:03:18 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E43IOH034600; Sun, 14 Jun 2009 04:03:18 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E43IRm034599; Sun, 14 Jun 2009 04:03:18 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906140403.n5E43IRm034599@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 04:03: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: r194152 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 04:03:19 -0000 Author: edwin Date: Sun Jun 14 04:03:18 2009 New Revision: 194152 URL: http://svn.freebsd.org/changeset/base/194152 Log: Add missing terminal definition for Wyse 120 in termcap Although the PR contains also the definitions of the Wyse 60, they are not copied into it since there are already definition for them in the termcap file since 1997. Also, the PR didn't use the :tc=xxx: feature, so I've imploded them. PR: conf/81882 Submitted by: Meister des Chaos MFC after: 1 week Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sun Jun 14 03:57:03 2009 (r194151) +++ head/share/termcap/termcap.src Sun Jun 14 04:03:18 2009 (r194152) @@ -3998,6 +3998,31 @@ wy100q|Wyse 100 for Quotron:\ :dc=\EW:dl=\ER:do=^J:ei=\Er:im=\Eq:is=\E`\072\200\EC\EDF\E0\E'\E(\EA21:\ :kd=^J:kl=^H:kr=^L:ku=^K:li#24:nd=^L:up=^K:us=\EG8:ue=\EG0:\ :so=\EG4:se=\EG0:sg#1:sr=\Ej:ho=^^:ug#1: +# Wyse 120 definitions from conf/81882 by Meister des Chaos +wy120|wyse120|wy150|wyse150|Wyse 120/150:\ + :am:bw:hs:km:mi:ms:xo:\ + :co#80:it#8:li#24:pb#9601:ws#45:\ + :ae=\EcD:al=\EE:as=\EcE:bl=^G:bt=\EI:cd=\EY:ce=\ET:cl=\E+:\ + :cm=\E=%+ %+ :cr=^M:ct=\E0:dc=\EW:dl=\ER:do=^J:ds=\EF\r:\ + :ei=\Er:fs=^M:ho=^^:i1=\EcB0\EcC1:i2=\EwJ\Ew1:im=\Eq:ip=:\ + :is=\Ed$\EcD\E'\Er\EH\003\Ed/\EO\Ee1\Ed*\E`@\E`9\E`1\016\024\El:\ + :k1=^A@\r:k2=^AA\r:k3=^AB\r:k4=^AC\r:k5=^AD\r:k6=^AE\r:\ + :k7=^AF\r:k8=^AG\r:k9=^AH\r:kD=\EW:kI=\EQ:kN=\EK:kP=\EJ:\ + :kb=^H:kd=^J:kh=^^:kl=^H:kr=^L:ku=^K:le=^H:ll=^^^K:mb=\EG2:\ + :me=\E(\EH\003\EG0\EcD:mh=\EGp:mr=\EG4:nd=^L:nw=\r\n:\ + :se=\EG0:sf=\n:so=\EGt:sr=\Ej:st=\E1:ta=\011:te=\Ew1:\ + :ti=\Ew0:ts=\EF:ue=\EG0:up=^K:us=\EG8:vb=\E`8\E`9:ve=\E`1:\ + :vi=\E`0: +wy120-w|wyse120-w|wy150-w|wyse150-w|wyse 120/150 132-column:\ + :cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120: +wy120-25|wyse120-25|wy150-25|wyse150-25|wyse 120/150 80-column 25-lines:\ + :li#25:tc=wy120: +wy120-25-w|wyse120-25-w|wy150-25-w|wyse150-25-w|wyse 120/150 132-column 25-lines:\ + :cm=\Ea%i%dR%dC:co#132:li#25:ws#97:tc=wy120: +wy120-vb|wyse120-vb|wy150-vb|wyse150-vb|Wyse 120/150 visible bell:\ + :bl@:tc=wy120: +wy120-w-vb|wy120-wvb|wyse120-wvb|wy150-w-vb|wyse150-w-vb|Wyse 120/150 132-column visible bell:\ + :bl@:cm=\Ea%i%dR%dC:co#132:ws#97:tc=wy120: # # -------------------------------- # # y: TELERAY From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 06:09:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDF6D106564A; Sun, 14 Jun 2009 06:09:33 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD0A58FC19; Sun, 14 Jun 2009 06:09:33 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E69XHr037135; Sun, 14 Jun 2009 06:09:33 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E69XdQ037134; Sun, 14 Jun 2009 06:09:33 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906140609.n5E69XdQ037134@svn.freebsd.org> From: Brian Somers Date: Sun, 14 Jun 2009 06:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194158 - head/gnu/usr.bin/man/apropos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 06:09:34 -0000 Author: brian Date: Sun Jun 14 06:09:33 2009 New Revision: 194158 URL: http://svn.freebsd.org/changeset/base/194158 Log: Don't set $PATH - if the caller doesn't have /bin and /usr/bin in their PATH then they can expect things to break. PR: 135417 MFC after: 3 weeks Modified: head/gnu/usr.bin/man/apropos/apropos.sh Modified: head/gnu/usr.bin/man/apropos/apropos.sh ============================================================================== --- head/gnu/usr.bin/man/apropos/apropos.sh Sun Jun 14 06:01:46 2009 (r194157) +++ head/gnu/usr.bin/man/apropos/apropos.sh Sun Jun 14 06:09:33 2009 (r194158) @@ -18,7 +18,6 @@ # $FreeBSD$ -PATH=/bin:/usr/bin:$PATH db=whatis # name of whatis data base grepopt='' From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 06:37:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09822106564A; Sun, 14 Jun 2009 06:37:20 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2C5E8FC13; Sun, 14 Jun 2009 06:37:19 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E6bJNO038174; Sun, 14 Jun 2009 06:37:19 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E6bJkN038173; Sun, 14 Jun 2009 06:37:19 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906140637.n5E6bJkN038173@svn.freebsd.org> From: Brian Somers Date: Sun, 14 Jun 2009 06:37: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: r194170 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 06:37:20 -0000 Author: brian Date: Sun Jun 14 06:37:19 2009 New Revision: 194170 URL: http://svn.freebsd.org/changeset/base/194170 Log: Remove HOME= - this has surprised me several times in the past. PR: 132135 Submitted by: Craig Leres MFC after: 3 weeks Modified: head/etc/crontab Modified: head/etc/crontab ============================================================================== --- head/etc/crontab Sun Jun 14 06:36:50 2009 (r194169) +++ head/etc/crontab Sun Jun 14 06:37:19 2009 (r194170) @@ -4,7 +4,6 @@ # SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin -HOME=/var/log # #minute hour mday month wday who command # From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 06:47:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F565106566B; Sun, 14 Jun 2009 06:47:22 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 039E18FC0C; Sun, 14 Jun 2009 06:47:22 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E6lLqI038400; Sun, 14 Jun 2009 06:47:21 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E6lL2r038398; Sun, 14 Jun 2009 06:47:21 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200906140647.n5E6lL2r038398@svn.freebsd.org> From: Brian Somers Date: Sun, 14 Jun 2009 06:47: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: r194171 - head/usr.sbin/lpr/lp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 06:47:22 -0000 Author: brian Date: Sun Jun 14 06:47:21 2009 New Revision: 194171 URL: http://svn.freebsd.org/changeset/base/194171 Log: Add -m and -t options. PR: 129554 Submitted by: gavin MFC after: 3 weeks Modified: head/usr.sbin/lpr/lp/lp.1 head/usr.sbin/lpr/lp/lp.sh Modified: head/usr.sbin/lpr/lp/lp.1 ============================================================================== --- head/usr.sbin/lpr/lp/lp.1 Sun Jun 14 06:37:19 2009 (r194170) +++ head/usr.sbin/lpr/lp/lp.1 Sun Jun 14 06:47:21 2009 (r194171) @@ -78,6 +78,8 @@ or .Ev PRINTER (with this precedence) are taken as the destination printer. +.It Fl m +Send mail upon completion. .It Fl n Ar num Specify that .Ar num @@ -91,6 +93,9 @@ Silent operation. Not supported, provided only as a compatibility option for .St -susv2 . +.It Fl t Ar title +Set the job title to +.Ar title . .El .Sh ENVIRONMENT As described above, the variables Modified: head/usr.sbin/lpr/lp/lp.sh ============================================================================== --- head/usr.sbin/lpr/lp/lp.sh Sun Jun 14 06:37:19 2009 (r194170) +++ head/usr.sbin/lpr/lp/lp.sh Sun Jun 14 06:47:21 2009 (r194171) @@ -41,6 +41,8 @@ ncopies="" symlink="-s" +mailafter="" +title="" # Posix says LPDEST gets precedence over PRINTER dest=${LPDEST:-${PRINTER:-lp}} @@ -51,7 +53,7 @@ dest=${LPDEST:-${PRINTER:-lp}} # XXX We include the -s flag as a dummy. SUSv2 requires it, # although we do not yet emit the affected messages. # -while getopts "cd:n:o:s" option +while getopts "cd:mn:o:st:" option do case $option in @@ -59,12 +61,16 @@ do symlink="";; d) # destination dest="${OPTARG}";; + m) # mail after job + mailafter="-m";; n) # number of copies ncopies="-#${OPTARG}";; o) # (printer option) : ;; s) # (silent option) : ;; + t) # title for banner page + title="-J${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -72,4 +78,4 @@ done shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 06:48:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2D6106566B; Sun, 14 Jun 2009 06:48:31 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3BA8FC1A; Sun, 14 Jun 2009 06:48:31 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E6mVPo038458; Sun, 14 Jun 2009 06:48:31 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E6mVGK038457; Sun, 14 Jun 2009 06:48:31 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906140648.n5E6mVGK038457@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 06:48: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: r194172 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 06:48:31 -0000 Author: edwin Date: Sun Jun 14 06:48:31 2009 New Revision: 194172 URL: http://svn.freebsd.org/changeset/base/194172 Log: Termcap updates for screen and linux console: screen entry: F11-F20 keys added linux entry: F10-F20 keys added, ACS line graphics added PR: kern/108899 Submitted by: Joseph Terner MFC after: 1 week Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sun Jun 14 06:47:21 2009 (r194171) +++ head/share/termcap/termcap.src Sun Jun 14 06:48:31 2009 (r194172) @@ -2771,6 +2771,8 @@ SC|screen|VT 100/ANSI X3.64 virtual term :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ + :F3=\E[25~:F4=\E[26~:F5=\E[28~:F6=\E[29~:\ + :F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\ :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\ :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ @@ -4526,7 +4528,9 @@ linux|Linux Console:\ :me=\E[0;10m:mh=\E[2m:mr=\E[7m:nd=\E[C:nw=^M^J:rc=\E8:\ :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\ :ue=\E[24m:up=\E[A:us=\E[4m:vb=200\E[?5h\E[?5l:\ - :ve=\E[?25h:vi=\E[?25l: + :ve=\E[?25h:vi=\E[?25l:\ + :k;=\E[21~:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\ + :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~: linux-m|Linux Console no color:\ :pa@:Co@:AF@:AB@:op@:\ :tc=linux: From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 07:02:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFC78106564A; Sun, 14 Jun 2009 07:02:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBF88FC16; Sun, 14 Jun 2009 07:02:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E72ojS038891; Sun, 14 Jun 2009 07:02:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E72ote038890; Sun, 14 Jun 2009 07:02:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906140702.n5E72ote038890@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 07:02: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: r194176 - head/share/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 07:02:51 -0000 Author: edwin Date: Sun Jun 14 07:02:50 2009 New Revision: 194176 URL: http://svn.freebsd.org/changeset/base/194176 Log: Add missing passthrough printing entries for VT100 and workalikes in /etc/termcap: VT100 spec indicates that passthrough printing can be enabled by sending ESC[5i and disabled by sending ESC[4i These entries should be listed as po and pf in /etc/termcap, but are absent. See http://www.vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.23 PR: conf/71549 Submitted by: Andrew Webster MFC after: 1 week Modified: head/share/termcap/termcap.src Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Sun Jun 14 07:01:22 2009 (r194175) +++ head/share/termcap/termcap.src Sun Jun 14 07:02:50 2009 (r194176) @@ -2481,7 +2481,7 @@ vt100|dec-vt100|vt100-am|vt100am|dec vt1 :K1=\EOq:K2=\EOr:K3=\EOs:K4=\EOp:K5=\EOn:pt:sr=2*\EM:xn:\ :sc=2\E7:rc=2\E8:cs=5\E[%i%d;%dr:UP=2\E[%dA:DO=2\E[%dB:RI=2\E[%dC:\ :LE=2\E[%dD:ct=2\E[3g:st=2\EH:ta=^I:ms:bl=^G:cr=^M:eo:it#8:\ - :RA=\E[?7l:SA=\E[?7h: + :RA=\E[?7l:SA=\E[?7h:po=\E[5i:pf=\E[4i: vt100-nam|dec-vt100-nam|vt100nam|vt100 w/no am:\ :am@:xn@:\ :is=\E>\E[?1;3;4;5;7l\E[?8h\E[1;24r\E[24;1H:\ From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 07:34:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B40EB106564A; Sun, 14 Jun 2009 07:34:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2B9D8FC08; Sun, 14 Jun 2009 07:34:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5E7YLtN039467; Sun, 14 Jun 2009 07:34:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5E7YL0L039466; Sun, 14 Jun 2009 07:34:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200906140734.n5E7YL0L039466@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Jun 2009 07:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194177 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 07:34:22 -0000 Author: mav Date: Sun Jun 14 07:34:21 2009 New Revision: 194177 URL: http://svn.freebsd.org/changeset/base/194177 Log: Fix type of lowaddr variable. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Jun 14 07:02:50 2009 (r194176) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Jun 14 07:34:21 2009 (r194177) @@ -87,7 +87,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090608_0134" +#define HDA_DRV_TEST_REV "20090614_0135" SND_DECLARE_FILE("$FreeBSD$"); @@ -1593,9 +1593,9 @@ hdac_dma_cb(void *callback_arg, bus_dma_ static int hdac_dma_alloc(struct hdac_softc *sc, struct hdac_dma *dma, bus_size_t size) { + bus_addr_t lowaddr; bus_size_t roundsz; int result; - int lowaddr; roundsz = roundup2(size, HDAC_DMA_ALIGNMENT); lowaddr = (sc->support_64bit) ? BUS_SPACE_MAXADDR : From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 11:41:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 954021065673; Sun, 14 Jun 2009 11:41:11 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB808FC16; Sun, 14 Jun 2009 11:41:11 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 2EDA01CC26; Sun, 14 Jun 2009 13:41:10 +0200 (CEST) Date: Sun, 14 Jun 2009 13:41:10 +0200 From: Ed Schouten To: Edwin Groothuis Message-ID: <20090614114110.GK48776@hoeg.nl> References: <200906131335.n5DDZII5015147@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wICP0NOJ5+05hdQ6" Content-Disposition: inline In-Reply-To: <200906131335.n5DDZII5015147@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194107 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 11:41:12 -0000 --wICP0NOJ5+05hdQ6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Edwin Groothuis wrote: > Sync termcap.small with main termcap; add xterm entry for libteken Nice! --=20 Ed Schouten WWW: http://80386.nl/ --wICP0NOJ5+05hdQ6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko04dYACgkQ52SDGA2eCwX16wCfdAQgT5bU1EKgrkzbZvEKO+5Q mSoAnildcpJeRblbPsXmOSFA1PGJuWr7 =HJMJ -----END PGP SIGNATURE----- --wICP0NOJ5+05hdQ6-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:04:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A9A41065686; Sun, 14 Jun 2009 12:04:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F04B88FC1E; Sun, 14 Jun 2009 12:04:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EC4Yuo048705; Sun, 14 Jun 2009 12:04:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EC4Y7r048704; Sun, 14 Jun 2009 12:04:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141204.n5EC4Y7r048704@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:04: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: r194184 - head/sys/dev/syscons X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:04:37 -0000 Author: ed Date: Sun Jun 14 12:04:34 2009 New Revision: 194184 URL: http://svn.freebsd.org/changeset/base/194184 Log: Add more entries to the Unicode-to-CP437 table. Characters between 0x07 and 0x0d are now also mapped, which means we can display almost 256 different characters. Also remap certain types of dashes and quotes, which means we can finally read our manual pages without red question marks in them. Submitted by: Christoph Mallon Modified: head/sys/dev/syscons/scterm-teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun Jun 14 11:26:42 2009 (r194183) +++ head/sys/dev/syscons/scterm-teken.c Sun Jun 14 12:04:34 2009 (r194184) @@ -376,11 +376,15 @@ static const struct unicp437 cp437table[ { 0x03b4, 0xeb, 0x00 }, { 0x03b5, 0xee, 0x00 }, { 0x03c0, 0xe3, 0x00 }, { 0x03c3, 0xe5, 0x00 }, { 0x03c4, 0xe7, 0x00 }, { 0x03c6, 0xed, 0x00 }, - { 0x203c, 0x13, 0x00 }, { 0x207f, 0xfc, 0x00 }, - { 0x20a7, 0x9e, 0x00 }, { 0x2190, 0x1b, 0x00 }, - { 0x2191, 0x18, 0x00 }, { 0x2192, 0x1a, 0x00 }, - { 0x2193, 0x19, 0x00 }, { 0x2194, 0x1d, 0x00 }, - { 0x2195, 0x12, 0x00 }, { 0x21a8, 0x17, 0x00 }, + { 0x2010, 0x2d, 0x00 }, { 0x2014, 0x2d, 0x00 }, + { 0x2018, 0x60, 0x00 }, { 0x2019, 0x27, 0x00 }, + { 0x201c, 0x22, 0x00 }, { 0x201d, 0x22, 0x00 }, + { 0x2022, 0x07, 0x00 }, { 0x203c, 0x13, 0x00 }, + { 0x207f, 0xfc, 0x00 }, { 0x20a7, 0x9e, 0x00 }, + { 0x2190, 0x1b, 0x00 }, { 0x2191, 0x18, 0x00 }, + { 0x2192, 0x1a, 0x00 }, { 0x2193, 0x19, 0x00 }, + { 0x2194, 0x1d, 0x00 }, { 0x2195, 0x12, 0x00 }, + { 0x21a8, 0x17, 0x00 }, { 0x2212, 0x2d, 0x00 }, { 0x2219, 0xf9, 0x00 }, { 0x221a, 0xfb, 0x00 }, { 0x221e, 0xec, 0x00 }, { 0x221f, 0x1c, 0x00 }, { 0x2229, 0xef, 0x00 }, { 0x2248, 0xf7, 0x00 }, @@ -412,10 +416,12 @@ static const struct unicp437 cp437table[ { 0x2591, 0xb0, 0x02 }, { 0x25a0, 0xfe, 0x00 }, { 0x25ac, 0x16, 0x00 }, { 0x25b2, 0x1e, 0x00 }, { 0x25ba, 0x10, 0x00 }, { 0x25bc, 0x1f, 0x00 }, - { 0x25c4, 0x11, 0x00 }, { 0x263a, 0x01, 0x01 }, - { 0x263c, 0x0f, 0x00 }, { 0x2660, 0x06, 0x00 }, - { 0x2663, 0x05, 0x00 }, { 0x2665, 0x03, 0x01 }, - { 0x266b, 0x0e, 0x00 }, + { 0x25c4, 0x11, 0x00 }, { 0x25cb, 0x09, 0x00 }, + { 0x25d8, 0x08, 0x00 }, { 0x25d9, 0x0a, 0x00 }, + { 0x263a, 0x01, 0x01 }, { 0x263c, 0x0f, 0x00 }, + { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, + { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, + { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x01 }, }; static void From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:11:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46042106566B; Sun, 14 Jun 2009 12:11:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 343508FC16; Sun, 14 Jun 2009 12:11:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ECBGY3048874; Sun, 14 Jun 2009 12:11:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ECBGno048873; Sun, 14 Jun 2009 12:11:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906141211.n5ECBGno048873@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 14 Jun 2009 12:11: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: r194185 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 12:11:17 -0000 Author: bz Date: Sun Jun 14 12:11:15 2009 New Revision: 194185 URL: http://svn.freebsd.org/changeset/base/194185 Log: Remove a line break leaving a function return type attached to the old function declaration bottom rather than the new function declaration start. Modified: head/share/man/man9/netisr.9 Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Sun Jun 14 12:04:34 2009 (r194184) +++ head/share/man/man9/netisr.9 Sun Jun 14 12:11:15 2009 (r194185) @@ -51,8 +51,7 @@ .Fn netisr_clearqdrops "const struct netisr_handler *nhp" .Ft void .Fn netisr_getqdrops "const struct netisr_handler *nhp" "u_int64_t *qdropsp" -.Ft -void +.Ft void .Fn netisr_getqlimit "const struct netisr_handler *nhp" "u_int *qlimitp" .Ft int .Fn netisr_setqlimit "const struct netisr_handler *nhp" "u_int qlimit" From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:42:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B683106566C; Sun, 14 Jun 2009 12:42:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498BA8FC1D; Sun, 14 Jun 2009 12:42:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ECg7m8049443; Sun, 14 Jun 2009 12:42:07 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ECg623049436; Sun, 14 Jun 2009 12:42:06 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141242.n5ECg623049436@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:42: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: r194186 - head/lib/libkvm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:42:07 -0000 Author: ed Date: Sun Jun 14 12:42:06 2009 New Revision: 194186 URL: http://svn.freebsd.org/changeset/base/194186 Log: Fix missing includes of , to silence some compiler warnings. Submitted by: Pawel Worach Modified: head/lib/libkvm/kvm_amd64.c head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_cptime.c head/lib/libkvm/kvm_file.c head/lib/libkvm/kvm_i386.c head/lib/libkvm/kvm_minidump_amd64.c head/lib/libkvm/kvm_minidump_i386.c Modified: head/lib/libkvm/kvm_amd64.c ============================================================================== --- head/lib/libkvm/kvm_amd64.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_amd64.c Sun Jun 14 12:42:06 2009 (r194186) @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)kvm_hp300.c #include #include #include +#include #include #include #include Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_arm.c Sun Jun 14 12:42:06 2009 (r194186) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "kvm_private.h" Modified: head/lib/libkvm/kvm_cptime.c ============================================================================== --- head/lib/libkvm/kvm_cptime.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_cptime.c Sun Jun 14 12:42:06 2009 (r194186) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "kvm_private.h" Modified: head/lib/libkvm/kvm_file.c ============================================================================== --- head/lib/libkvm/kvm_file.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_file.c Sun Jun 14 12:42:06 2009 (r194186) @@ -61,6 +61,7 @@ static char sccsid[] = "@(#)kvm_file.c 8 #include #include #include +#include #include "kvm_private.h" Modified: head/lib/libkvm/kvm_i386.c ============================================================================== --- head/lib/libkvm/kvm_i386.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_i386.c Sun Jun 14 12:42:06 2009 (r194186) @@ -51,6 +51,7 @@ static char sccsid[] = "@(#)kvm_hp300.c #include #include #include +#include #include #include #include Modified: head/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_amd64.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_minidump_amd64.c Sun Jun 14 12:42:06 2009 (r194186) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- head/lib/libkvm/kvm_minidump_i386.c Sun Jun 14 12:11:15 2009 (r194185) +++ head/lib/libkvm/kvm_minidump_i386.c Sun Jun 14 12:42:06 2009 (r194186) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:44:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0860106566C; Sun, 14 Jun 2009 12:44:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F1C68FC16; Sun, 14 Jun 2009 12:44:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ECi9vT049523; Sun, 14 Jun 2009 12:44:09 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ECi9uV049522; Sun, 14 Jun 2009 12:44:09 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141244.n5ECi9uV049522@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:44: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: r194187 - head/usr.sbin/dconschat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:44:10 -0000 Author: ed Date: Sun Jun 14 12:44:09 2009 New Revision: 194187 URL: http://svn.freebsd.org/changeset/base/194187 Log: Include and for wait() and kill(). Modified: head/usr.sbin/dconschat/dconschat.c Modified: head/usr.sbin/dconschat/dconschat.c ============================================================================== --- head/usr.sbin/dconschat/dconschat.c Sun Jun 14 12:42:06 2009 (r194186) +++ head/usr.sbin/dconschat/dconschat.c Sun Jun 14 12:44:09 2009 (r194187) @@ -38,8 +38,10 @@ #include #include #include +#include #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:45:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DECBA1065678; Sun, 14 Jun 2009 12:45:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD7118FC1B; Sun, 14 Jun 2009 12:45:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ECjmpu049598; Sun, 14 Jun 2009 12:45:48 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ECjmNU049597; Sun, 14 Jun 2009 12:45:48 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141245.n5ECjmNU049597@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194188 - head/lib/libpam/modules/pam_exec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:45:49 -0000 Author: ed Date: Sun Jun 14 12:45:48 2009 New Revision: 194188 URL: http://svn.freebsd.org/changeset/base/194188 Log: Include for asprintf(). Submitted by: Pawel Worach Modified: head/lib/libpam/modules/pam_exec/pam_exec.c Modified: head/lib/libpam/modules/pam_exec/pam_exec.c ============================================================================== --- head/lib/libpam/modules/pam_exec/pam_exec.c Sun Jun 14 12:44:09 2009 (r194187) +++ head/lib/libpam/modules/pam_exec/pam_exec.c Sun Jun 14 12:45:48 2009 (r194188) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:46:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0E4D10656A7; Sun, 14 Jun 2009 12:46:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94E4C8FC21; Sun, 14 Jun 2009 12:46:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ECkYq7049658; Sun, 14 Jun 2009 12:46:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ECkYwL049657; Sun, 14 Jun 2009 12:46:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141246.n5ECkYwL049657@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:46: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: r194189 - head/sys/cam X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:46:35 -0000 Author: ed Date: Sun Jun 14 12:46:34 2009 New Revision: 194189 URL: http://svn.freebsd.org/changeset/base/194189 Log: Include for cam_path_string(). Submitted by: Pawel Worach Modified: head/sys/cam/cam.c Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Sun Jun 14 12:45:48 2009 (r194188) +++ head/sys/cam/cam.c Sun Jun 14 12:46:34 2009 (r194189) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #else /* _KERNEL */ #include #include +#include #endif /* _KERNEL */ #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 12:47:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9EC5106568E; Sun, 14 Jun 2009 12:47:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B87E38FC15; Sun, 14 Jun 2009 12:47:27 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EClRRI049711; Sun, 14 Jun 2009 12:47:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EClRB3049710; Sun, 14 Jun 2009 12:47:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141247.n5EClRB3049710@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 12:47: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: r194190 - head/usr.bin/nfsstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 12:47:28 -0000 Author: ed Date: Sun Jun 14 12:47:27 2009 New Revision: 194190 URL: http://svn.freebsd.org/changeset/base/194190 Log: Include for modfind(). Submitted by: Pawel Worach Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sun Jun 14 12:46:34 2009 (r194189) +++ head/usr.bin/nfsstat/nfsstat.c Sun Jun 14 12:47:27 2009 (r194190) @@ -49,6 +49,7 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 13:43:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9AC21065670; Sun, 14 Jun 2009 13:43:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C70258FC19; Sun, 14 Jun 2009 13:43:07 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EDh72E050769; Sun, 14 Jun 2009 13:43:07 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EDh7VX050768; Sun, 14 Jun 2009 13:43:07 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906141343.n5EDh7VX050768@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 13:43: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: r194191 - head/tools/tools/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 13:43:08 -0000 Author: edwin Date: Sun Jun 14 13:43:07 2009 New Revision: 194191 URL: http://svn.freebsd.org/changeset/base/194191 Log: Rename since it has will have more capabilities than just comparing of two termcap entries. Added: head/tools/tools/termcap/termcap.pl (props changed) - copied unchanged from r194190, head/tools/tools/termcap/compare_termcap.pl Deleted: head/tools/tools/termcap/compare_termcap.pl Copied: head/tools/tools/termcap/termcap.pl (from r194190, head/tools/tools/termcap/compare_termcap.pl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/termcap/termcap.pl Sun Jun 14 13:43:07 2009 (r194191, copy of r194190, head/tools/tools/termcap/compare_termcap.pl) @@ -0,0 +1,98 @@ +#!/usr/bin/perl -w + +# +# Copyright (C) 2009 Edwin Groothuis. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +use strict; +use Data::Dumper; + +if ($#ARGV != 1) { + print < +Compares the entries in the termcap.src for and and +print the keys and definitions on the screen. This can be used to reduce +the size of two similar termcap entries with the "tc" option. +EOF + exit(0); +} + +open(FIN, "termcap.src"); +my @lines = ; +chomp(@lines); +close(FIN); + +my %tcs = (); + +my $tc = ""; +foreach my $l (@lines) { + next if ($l =~ /^#/); + next if ($l eq ""); + + $tc .= $l; + next if ($l =~ /\\$/); + + my @a = split(/:/, $tc); + next if ($#a < 0); + my @b = split(/\|/, $a[0]); + if ($#b >= 0) { + $tcs{$b[0]} = $tc; + } else { + $tcs{$a[0]} = $tc; + } + $tc = ""; +} + +die "Cannot find definitions for $ARGV[0]" if (!defined $tcs{$ARGV[0]}); +die "Cannot find definitions for $ARGV[1]" if (!defined $tcs{$ARGV[1]}); + +my %tc = (); +my %keys = (); + +for (my $i = 0; $i < 2; $i++) { + foreach my $tc (split(/:/, $tcs{$ARGV[$i]})) { + next if ($tc =~ /^\\/); + $tc{$i}{$tc} = 0 if (!defined $tc{$i}{$tc}); + $tc{$i}{$tc}++; + $keys{$tc} = 0; + } +} + +foreach my $key (sort(keys(%keys))) { + if (length($key) > 15) { + print "$key\n"; + printf("%-15s %-3s %-3s\n", "", + defined $tc{0}{$key} ? "+" : "", + defined $tc{1}{$key} ? "+" : "" + ); + } else { + printf("%-15s %-3s %-3s\n", $key, + defined $tc{0}{$key} ? "+" : "", + defined $tc{1}{$key} ? "+" : "" + ); + } +} + From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 13:46:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00595106564A; Sun, 14 Jun 2009 13:46:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E20E88FC13; Sun, 14 Jun 2009 13:46:32 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EDkWgA050932; Sun, 14 Jun 2009 13:46:32 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EDkWSC050931; Sun, 14 Jun 2009 13:46:32 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906141346.n5EDkWSC050931@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 14 Jun 2009 13:46: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: r194192 - head/tools/tools/termcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 13:46:33 -0000 Author: edwin Date: Sun Jun 14 13:46:32 2009 New Revision: 194192 URL: http://svn.freebsd.org/changeset/base/194192 Log: Instead of only being able to compare two terminal definitions, now also be able to print information about... - length of the terminal capabilties - dump of one terminal definition - relationship overview for a terminal definition Modified: head/tools/tools/termcap/termcap.pl Modified: head/tools/tools/termcap/termcap.pl ============================================================================== --- head/tools/tools/termcap/termcap.pl Sun Jun 14 13:43:07 2009 (r194191) +++ head/tools/tools/termcap/termcap.pl Sun Jun 14 13:46:32 2009 (r194192) @@ -30,16 +30,29 @@ use strict; use Data::Dumper; -if ($#ARGV != 1) { +if ($#ARGV < 0) { print < +Usage: $0 -c Compares the entries in the termcap.src for and and print the keys and definitions on the screen. This can be used to reduce the size of two similar termcap entries with the "tc" option. + +Usage: $0 -l [term] +Show all lengths or the ones for terminals matching [term] + +Usage: $0 -p +Print all information about + +Usage: $0 -r +Print all relations from and to EOF exit(0); } +my $command = $ARGV[0]; +my $tca = $ARGV[1]; +my $tcb = $ARGV[2]; + open(FIN, "termcap.src"); my @lines = ; chomp(@lines); @@ -55,6 +68,8 @@ foreach my $l (@lines) { $tc .= $l; next if ($l =~ /\\$/); + $tc =~ s/:\\\s+:/:/g; + my @a = split(/:/, $tc); next if ($#a < 0); my @b = split(/\|/, $a[0]); @@ -63,36 +78,88 @@ foreach my $l (@lines) { } else { $tcs{$a[0]} = $tc; } + if (length($tc) - length($a[0]) > 1023) { + print "$a[0] has a length of ", length($tc) - length($a[0]), "\n"; + exit(0); + } $tc = ""; } -die "Cannot find definitions for $ARGV[0]" if (!defined $tcs{$ARGV[0]}); -die "Cannot find definitions for $ARGV[1]" if (!defined $tcs{$ARGV[1]}); - my %tc = (); my %keys = (); +my %len = (); +my %refs = (); -for (my $i = 0; $i < 2; $i++) { - foreach my $tc (split(/:/, $tcs{$ARGV[$i]})) { +for my $tcs (keys(%tcs)) { + $len{$tcs} = 0; + my $first = 0; + foreach my $tc (split(/:/, $tcs{$tcs})) { + if ($first++ == 0) { + foreach my $ref (split(/\|/, $tc)) { + $refs{$ref} = $tcs; + } + next; + } next if ($tc =~ /^\\/); - $tc{$i}{$tc} = 0 if (!defined $tc{$i}{$tc}); - $tc{$i}{$tc}++; + $tc{$tcs}{$tc} = 0 if (!defined $tc{$tcs}{$tc}); + $tc{$tcs}{$tc}++; + $len{$tcs} += length($tc) + 1; $keys{$tc} = 0; } } -foreach my $key (sort(keys(%keys))) { - if (length($key) > 15) { - print "$key\n"; - printf("%-15s %-3s %-3s\n", "", - defined $tc{0}{$key} ? "+" : "", - defined $tc{1}{$key} ? "+" : "" - ); - } else { - printf("%-15s %-3s %-3s\n", $key, - defined $tc{0}{$key} ? "+" : "", - defined $tc{1}{$key} ? "+" : "" - ); +$tca = $refs{$tca} if (defined $tca && defined $refs{$tca}); +$tcb = $refs{$tcb} if (defined $tcb && defined $refs{$tca}); + +die "Cannot find definitions for $tca" if (defined $tca && !defined $tcs{$tca}); +die "Cannot find definitions for $tcb" if (defined $tcb && !defined $tcs{$tcb}); + +if ($command eq "-c") { + foreach my $key (sort(keys(%keys))) { + next if (!defined $tc{$tca}{$key} && !defined $tc{$tcb}{$key}); + printf("%-3s %-3s %s\n", + defined $tc{$tca}{$key} ? "+" : "", + defined $tc{$tcb}{$key} ? "+" : "", + $key, + ); + } + + print "$len{$tca} - $len{$tcb}\n"; +} + +if ($command eq "-l") { + foreach my $tcs (sort(keys(%tcs))) { + next if (defined $tca && $tcs !~ /$tca/); + printf("%4d %s\n", $len{$tcs}, $tcs); + } +} + +if ($command eq "-p") { + printf("%s (%d bytes)\n", $tca, $len{$tca}); + foreach my $key (sort(keys(%keys))) { + next if (!defined $tc{$tca}{$key}); + printf("%s\n", $key); } } +if ($command eq "-r") { + foreach my $key (keys(%{$tc{$tca}})) { + next if ($key !~ /^tc=/); + $key =~ s/tc=//; + print "Links to:\t$key\n"; + } + my $first = 0; + foreach my $ref (sort(keys(%refs))) { + next if ($refs{$ref} ne $tca); + foreach my $tc (sort(keys(%tcs))) { + if (defined $tc{$tc}{"tc=$ref"}) { + if ($first++ == 0) { + print "Links from:\t"; + } else { + print "\t\t"; + } + print "$ref -> $tc\n"; + } + } + } +} From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 14:46:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A13A106564A; Sun, 14 Jun 2009 14:46:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87D358FC15; Sun, 14 Jun 2009 14:46:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EEkKHW052101; Sun, 14 Jun 2009 14:46:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EEkKOC052100; Sun, 14 Jun 2009 14:46:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906141446.n5EEkKOC052100@svn.freebsd.org> From: Marius Strobl Date: Sun, 14 Jun 2009 14:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194193 - 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: Sun, 14 Jun 2009 14:46:21 -0000 Author: marius Date: Sun Jun 14 14:46:20 2009 New Revision: 194193 URL: http://svn.freebsd.org/changeset/base/194193 Log: Improve the description a bit and add a reference to vlan(4). Modified: head/share/man/man4/hme.4 Modified: head/share/man/man4/hme.4 ============================================================================== --- head/share/man/man4/hme.4 Sun Jun 14 13:46:32 2009 (r194192) +++ head/share/man/man4/hme.4 Sun Jun 14 14:46:20 2009 (r194193) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2009 +.Dd June 14, 2009 .Dt HME 4 .Os .Sh NAME @@ -60,7 +60,16 @@ if_hme_load="YES" .Sh DESCRIPTION The .Nm -driver supports Sun Microelectronics STP2002-STQ Fast Ethernet interfaces. +driver supports Sun Microelectronics STP2002-STQ +.Dq Happy Meal Ethernet +Fast Ethernet interfaces. +.Pp +All controllers supported by the +.Nm +driver have TCP checksum offload capability for both receive and transmit, +support for the reception and transmission of extended frames for +.Xr vlan 4 +and a 128-bit multicast hash filter. .Sh HARDWARE The .Nm @@ -123,6 +132,7 @@ except the single-port SBus versions. .Xr intro 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr vlan 4 , .Xr eeprom 8 , .Xr ifconfig 8 .Rs From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 15:16:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50F8E106564A; Sun, 14 Jun 2009 15:16:25 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F0348FC08; Sun, 14 Jun 2009 15:16:25 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EFGP0X052696; Sun, 14 Jun 2009 15:16:25 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EFGP8Z052695; Sun, 14 Jun 2009 15:16:25 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <200906141516.n5EFGP8Z052695@svn.freebsd.org> From: Mark Murray Date: Sun, 14 Jun 2009 15:16: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: r194194 - 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: Sun, 14 Jun 2009 15:16:25 -0000 Author: markm Date: Sun Jun 14 15:16:24 2009 New Revision: 194194 URL: http://svn.freebsd.org/changeset/base/194194 Log: Allow "make update" work with SVN, if you take the time to set up your /etc/make.conf properly. Only one SCM? I do not think this is right. Now I have fixed it. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 14 14:46:20 2009 (r194193) +++ head/Makefile.inc1 Sun Jun 14 15:16:24 2009 (r194194) @@ -94,6 +94,8 @@ CLEANDIR= cleandir CVS?= cvs CVSFLAGS?= -A -P -d -I! +SVN?= svn +SVNFLAGS?= -r HEAD SUP?= /usr/bin/csup SUPFLAGS?= -g -L 2 .if defined(SUPHOST) @@ -854,10 +856,24 @@ update: .endif .endif .if defined(CVS_UPDATE) - @echo "--------------------------------------------------------------" - @echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} - @echo "--------------------------------------------------------------" - cd ${.CURDIR}; ${CVS} -R -q update ${CVSFLAGS} + @cd ${.CURDIR} ; \ + if [ -d CVS ] ; then \ + echo "--------------------------------------------------------------" ; \ + echo ">>> Updating ${.CURDIR} from CVS repository" ${CVSROOT} ; \ + echo "--------------------------------------------------------------" ; \ + echo ${CVS} -R -q update ${CVSFLAGS} ; \ + ${CVS} -R -q update ${CVSFLAGS} ; \ + fi +.endif +.if defined(SVN_UPDATE) + @cd ${.CURDIR} ; \ + if [ -d .svn ] ; then \ + echo "--------------------------------------------------------------" ; \ + echo ">>> Updating ${.CURDIR} using Subversion" ; \ + echo "--------------------------------------------------------------" ; \ + echo ${SVN} update ${SVNFLAGS} ; \ + ${SVN} update ${SVNFLAGS} ; \ + fi .endif # From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 16:21:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3367B1065672; Sun, 14 Jun 2009 16:21: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 20AD38FC15; Sun, 14 Jun 2009 16:21:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EGLpBw054004; Sun, 14 Jun 2009 16:21:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EGLpMR054002; Sun, 14 Jun 2009 16:21:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906141621.n5EGLpMR054002@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 14 Jun 2009 16:21: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: r194196 - in head/tools/regression/bin/sh: builtins 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, 14 Jun 2009 16:21:52 -0000 Author: jilles Date: Sun Jun 14 16:21:51 2009 New Revision: 194196 URL: http://svn.freebsd.org/changeset/base/194196 Log: Add tests for r194127 and r194128. Approved by: ed (mentor) Added: head/tools/regression/bin/sh/builtins/trap1.0 (contents, props changed) head/tools/regression/bin/sh/execution/ head/tools/regression/bin/sh/execution/fork1.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/trap1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap1.0 Sun Jun 14 16:21:51 2009 (r194196) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +test "$(trap 'echo trapped' EXIT; :)" = trapped || exit 1 + +test "$(trap 'echo trapped' EXIT; /usr/bin/true)" = trapped || exit 1 + +result=$(sh -c 'trap "echo trapped" EXIT; /usr/bin/false') +test $? -eq 1 || exit 1 +test "$result" = trapped || exit 1 + +result=$(sh -c 'trap "echo trapped" EXIT; exec /usr/bin/false') +test $? -eq 1 || exit 1 +test -z "$result" || exit 1 + +result=0 +trap 'result=$((result+1))' INT +kill -INT $$ +test "$result" -eq 1 || exit 1 +(kill -INT $$) +test "$result" -eq 2 || exit 1 + +exit 0 Added: head/tools/regression/bin/sh/execution/fork1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/fork1.0 Sun Jun 14 16:21:51 2009 (r194196) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +result=$(sh -c 'ps -p $$ -o comm=') +test "$result" = "ps" || exit 1 + +result=$(sh -c 'ps -p $$ -o comm=; :') +test "$result" = "sh" || exit 1 From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 16:48:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76B45106564A; Sun, 14 Jun 2009 16:48:18 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64AEF8FC1B; Sun, 14 Jun 2009 16:48:18 +0000 (UTC) (envelope-from nork@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EGmI6U054569; Sun, 14 Jun 2009 16:48:18 GMT (envelope-from nork@svn.freebsd.org) Received: (from nork@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EGmHax054568; Sun, 14 Jun 2009 16:48:18 GMT (envelope-from nork@svn.freebsd.org) Message-Id: <200906141648.n5EGmHax054568@svn.freebsd.org> From: Norikatsu Shigemura Date: Sun, 14 Jun 2009 16:48: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: r194197 - 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: Sun, 14 Jun 2009 16:48:18 -0000 Author: nork Date: Sun Jun 14 16:48:17 2009 New Revision: 194197 URL: http://svn.freebsd.org/changeset/base/194197 Log: Add myself. Approved by: imp (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jun 14 16:21:51 2009 (r194196) +++ head/share/misc/committers-src.dot Sun Jun 14 16:48:17 2009 (r194197) @@ -139,6 +139,7 @@ mr [label="Michael Reifenberger\nmr@Free murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07"] +nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] @@ -288,6 +289,7 @@ imp -> keichii imp -> mb imp -> mr imp -> non +imp -> nork imp -> onoe imp -> remko imp -> rik From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 17:00:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E256D106566B; Sun, 14 Jun 2009 17:00:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06388FC1B; Sun, 14 Jun 2009 17:00:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EH0ZhR054847; Sun, 14 Jun 2009 17:00:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EH0Zgv054846; Sun, 14 Jun 2009 17:00:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141700.n5EH0Zgv054846@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 17:00: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: r194198 - head/sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 17:00:36 -0000 Author: ed Date: Sun Jun 14 17:00:35 2009 New Revision: 194198 URL: http://svn.freebsd.org/changeset/base/194198 Log: Fix the staircase issue properly this time. Even though I thought this bug was somewhere in the TTY layer, it turns out init(8) doesn't make sure /dev/console is opened initially properly. I've added revoke() to two pieces of code: - death(): Apart from killing the gettys on shutdown, this doesn't guarantee the TTY to be closed immediately. - runshutdown(): Just like setctty(), we should revoke /dev/console. Applications like syslogd may have file descriptors to the console. Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sun Jun 14 16:48:17 2009 (r194197) +++ head/sbin/init/init.c Sun Jun 14 17:00:35 2009 (r194198) @@ -1495,9 +1495,16 @@ death(void) /* NB: should send a message to the session logger to avoid blocking. */ logwtmp("~", "shutdown", ""); + /* + * Also revoke the TTY here. Because runshutdown() may reopen + * the TTY whose getty we're killing here, there is no guarantee + * runshutdown() will perform the initial open() call, causing + * the terminal attributes to be misconfigured. + */ for (sp = sessions; sp; sp = sp->se_next) { sp->se_flags |= SE_SHUTDOWN; kill(sp->se_process, SIGHUP); + revoke(sp->se_device); } /* Try to run the rc.shutdown script within a period of time */ @@ -1566,6 +1573,7 @@ runshutdown(void) sigaction(SIGTSTP, &sa, (struct sigaction *)0); sigaction(SIGHUP, &sa, (struct sigaction *)0); + revoke(_PATH_CONSOLE); if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1) warning("can't open %s: %m", _PATH_CONSOLE); else { From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 17:15:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0151106566C; Sun, 14 Jun 2009 17:15:18 +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 AD7B98FC1C; Sun, 14 Jun 2009 17:15:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EHFILc055242; Sun, 14 Jun 2009 17:15:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EHFIrD055238; Sun, 14 Jun 2009 17:15:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906141715.n5EHFIrD055238@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 14 Jun 2009 17:15: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: r194201 - in head: share/man/man9 sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 17:15:19 -0000 Author: bz Date: Sun Jun 14 17:15:18 2009 New Revision: 194201 URL: http://svn.freebsd.org/changeset/base/194201 Log: Add an optional callback function that will be invoked when a per-CPU queue was drained. It will never fire for a directly dispatched packet. You will most likely never want to use this for any ordinary netisr usage and you will never blame netisr in case you try to use it and it does not work as expected. Reviewed by: rwatson Modified: head/share/man/man9/netisr.9 head/sys/net/netisr.c head/sys/net/netisr.h Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Sun Jun 14 17:05:54 2009 (r194200) +++ head/share/man/man9/netisr.9 Sun Jun 14 17:15:18 2009 (r194201) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 7, 2009 +.Dd June 14, 2009 .Dt NETISR 9 .Os .Sh NAME @@ -137,6 +137,13 @@ Will be used only with Protocol function to determine what CPU a packet should be processed on. Will be used only with .Dv NETISR_POLICY_CPU . +.It Vt netisr_drainedcpu_t Va nh_drainedcpu +Optional callback function that will be invoked when a per-CPU queue +was drained. +It will never fire for directly dispatched packets. +Unless fully understood, this special-purpose function should not be used. +.\" In case you intend to use this please send 50 chocolate bars to each +.\" of rwatson and bz and wait for an answer. .It Vt u_int Va nh_proto Protocol number used by both protocols to identify themselves to .Nm , Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sun Jun 14 17:05:54 2009 (r194200) +++ head/sys/net/netisr.c Sun Jun 14 17:15:18 2009 (r194201) @@ -197,6 +197,7 @@ struct netisr_proto { netisr_handler_t *np_handler; /* Protocol handler. */ netisr_m2flow_t *np_m2flow; /* Query flow for untagged packet. */ netisr_m2cpuid_t *np_m2cpuid; /* Query CPU to process packet on. */ + netisr_drainedcpu_t *np_drainedcpu; /* Callback when drained a queue. */ u_int np_qlimit; /* Maximum per-CPU queue depth. */ u_int np_policy; /* Work placement policy. */ }; @@ -380,6 +381,7 @@ netisr_register(const struct netisr_hand np[proto].np_handler = nhp->nh_handler; np[proto].np_m2flow = nhp->nh_m2flow; np[proto].np_m2cpuid = nhp->nh_m2cpuid; + np[proto].np_drainedcpu = nhp->nh_drainedcpu; if (nhp->nh_qlimit == 0) np[proto].np_qlimit = netisr_defaultqlimit; else if (nhp->nh_qlimit > netisr_maxqlimit) { @@ -705,6 +707,8 @@ netisr_process_workstream_proto(struct n } KASSERT(local_npw.nw_len == 0, ("%s(%u): len %u", __func__, proto, local_npw.nw_len)); + if (np[proto].np_drainedcpu) + np[proto].np_drainedcpu(nwsp->nws_cpu); NWS_LOCK(nwsp); npwp->nw_handled += handled; return (handled); Modified: head/sys/net/netisr.h ============================================================================== --- head/sys/net/netisr.h Sun Jun 14 17:05:54 2009 (r194200) +++ head/sys/net/netisr.h Sun Jun 14 17:15:18 2009 (r194201) @@ -88,6 +88,7 @@ typedef void netisr_handler_t (struct typedef struct mbuf *netisr_m2cpuid_t(struct mbuf *m, uintptr_t source, u_int *cpuid); typedef struct mbuf *netisr_m2flow_t(struct mbuf *m, uintptr_t source); +typedef void netisr_drainedcpu_t(u_int cpuid); #define NETISR_POLICY_SOURCE 1 /* Maintain source ordering. */ #define NETISR_POLICY_FLOW 2 /* Maintain flow ordering. */ @@ -101,6 +102,7 @@ struct netisr_handler { netisr_handler_t *nh_handler; /* Protocol handler. */ netisr_m2flow_t *nh_m2flow; /* Query flow for untagged packet. */ netisr_m2cpuid_t *nh_m2cpuid; /* Query CPU to process mbuf on. */ + netisr_drainedcpu_t *nh_drainedcpu; /* Callback when drained a queue. */ u_int nh_proto; /* Integer protocol ID. */ u_int nh_qlimit; /* Maximum per-CPU queue depth. */ u_int nh_policy; /* Work placement policy. */ From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 17:33:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EDAA1065672; Sun, 14 Jun 2009 17:33:46 +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 4C67F8FC13; Sun, 14 Jun 2009 17:33:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EHXk1m055638; Sun, 14 Jun 2009 17:33:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EHXkfO055637; Sun, 14 Jun 2009 17:33:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906141733.n5EHXkfO055637@svn.freebsd.org> From: Rick Macklem Date: Sun, 14 Jun 2009 17:33: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: r194202 - head/sys/kgssapi/krb5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 17:33:46 -0000 Author: rmacklem Date: Sun Jun 14 17:33:46 2009 New Revision: 194202 URL: http://svn.freebsd.org/changeset/base/194202 Log: When the KOBJMETHOD() macro was updated, it resulted in the compiler doing argument type checking. Since the prototypes in kgss_if.h used the generic gss_ctx_id_t for the context argument, but the functions in sys/kgssapi/krb5/krb5_mech.c used the KerberosV specific context argument, the file would no longer build. This patch fixes it so it will build by replacing the argument with a gss_ctx_id_t one and setting a local "struct krb5_context *" variable to it for use by the function. Reviewed by: dfr Approved by: kib (mentor) Modified: head/sys/kgssapi/krb5/krb5_mech.c Modified: head/sys/kgssapi/krb5/krb5_mech.c ============================================================================== --- head/sys/kgssapi/krb5/krb5_mech.c Sun Jun 14 17:15:18 2009 (r194201) +++ head/sys/kgssapi/krb5/krb5_mech.c Sun Jun 14 17:33:46 2009 (r194202) @@ -393,17 +393,19 @@ get_keys(struct krb5_context *kc) } static void -krb5_init(struct krb5_context *kc) +krb5_init(gss_ctx_id_t ctx) { + struct krb5_context *kc = (struct krb5_context *)ctx; mtx_init(&kc->kc_lock, "krb5 gss lock", NULL, MTX_DEF); } static OM_uint32 -krb5_import(struct krb5_context *kc, +krb5_import(gss_ctx_id_t ctx, enum sec_context_format format, const gss_buffer_t context_token) { + struct krb5_context *kc = (struct krb5_context *)ctx; OM_uint32 res; const uint8_t *p = (const uint8_t *) context_token->value; size_t len = context_token->length; @@ -489,8 +491,9 @@ krb5_import(struct krb5_context *kc, } static void -krb5_delete(struct krb5_context *kc, gss_buffer_t output_token) +krb5_delete(gss_ctx_id_t ctx, gss_buffer_t output_token) { + struct krb5_context *kc = (struct krb5_context *)ctx; delete_address(&kc->kc_local_address); delete_address(&kc->kc_remote_address); @@ -525,7 +528,7 @@ krb5_delete(struct krb5_context *kc, gss } static gss_OID -krb5_mech_type(struct krb5_context *kc) +krb5_mech_type(gss_ctx_id_t ctx) { return (&krb5_mech_oid); @@ -1002,9 +1005,10 @@ krb5_get_mic_new(struct krb5_context *kc } static OM_uint32 -krb5_get_mic(struct krb5_context *kc, OM_uint32 *minor_status, +krb5_get_mic(gss_ctx_id_t ctx, OM_uint32 *minor_status, gss_qop_t qop_req, struct mbuf *m, struct mbuf **micp) { + struct krb5_context *kc = (struct krb5_context *)ctx; *minor_status = 0; @@ -1211,9 +1215,10 @@ krb5_verify_mic_new(struct krb5_context } static OM_uint32 -krb5_verify_mic(struct krb5_context *kc, OM_uint32 *minor_status, +krb5_verify_mic(gss_ctx_id_t ctx, OM_uint32 *minor_status, struct mbuf *m, struct mbuf *mic, gss_qop_t *qop_state) { + struct krb5_context *kc = (struct krb5_context *)ctx; *minor_status = 0; if (qop_state) @@ -1536,10 +1541,11 @@ krb5_wrap_new(struct krb5_context *kc, i } static OM_uint32 -krb5_wrap(struct krb5_context *kc, OM_uint32 *minor_status, +krb5_wrap(gss_ctx_id_t ctx, OM_uint32 *minor_status, int conf_req_flag, gss_qop_t qop_req, struct mbuf **mp, int *conf_state) { + struct krb5_context *kc = (struct krb5_context *)ctx; *minor_status = 0; if (conf_state) @@ -1946,9 +1952,10 @@ krb5_unwrap_new(struct krb5_context *kc, } static OM_uint32 -krb5_unwrap(struct krb5_context *kc, OM_uint32 *minor_status, +krb5_unwrap(gss_ctx_id_t ctx, OM_uint32 *minor_status, struct mbuf **mp, int *conf_state, gss_qop_t *qop_state) { + struct krb5_context *kc = (struct krb5_context *)ctx; OM_uint32 maj_stat; *minor_status = 0; @@ -1991,10 +1998,11 @@ krb5_unwrap(struct krb5_context *kc, OM_ } static OM_uint32 -krb5_wrap_size_limit(struct krb5_context *kc, OM_uint32 *minor_status, +krb5_wrap_size_limit(gss_ctx_id_t ctx, OM_uint32 *minor_status, int conf_req_flag, gss_qop_t qop_req, OM_uint32 req_output_size, OM_uint32 *max_input_size) { + struct krb5_context *kc = (struct krb5_context *)ctx; const struct krb5_encryption_class *ec; OM_uint32 overhead; From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 17:53:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9693B106566B; Sun, 14 Jun 2009 17:53:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 849948FC22; Sun, 14 Jun 2009 17:53:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EHrtxa056035; Sun, 14 Jun 2009 17:53:55 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EHrt9V056034; Sun, 14 Jun 2009 17:53:55 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <200906141753.n5EHrt9V056034@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 14 Jun 2009 17:53: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: r194203 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 17:53:56 -0000 Author: dchagin Date: Sun Jun 14 17:53:55 2009 New Revision: 194203 URL: http://svn.freebsd.org/changeset/base/194203 Log: Unlock process lock when return error from getrobustlist call. Tested by: Alexander Best Approved by: kib (mentor) MFC after: 3 days Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Sun Jun 14 17:33:46 2009 (r194202) +++ head/sys/compat/linux/linux_futex.c Sun Jun 14 17:53:55 2009 (r194203) @@ -707,8 +707,10 @@ linux_get_robust_list(struct thread *td, /* XXX: ptrace? */ if (priv_check(td, PRIV_CRED_SETUID) || priv_check(td, PRIV_CRED_SETEUID) || - p_candebug(td, p)) + p_candebug(td, p)) { + PROC_UNLOCK(p); return (EPERM); + } head = em->robust_futexes; PROC_UNLOCK(p); From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 18:01:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4018106564A; Sun, 14 Jun 2009 18:01:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A224C8FC15; Sun, 14 Jun 2009 18:01:35 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EI1Z3T056241; Sun, 14 Jun 2009 18:01:35 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EI1Zti056239; Sun, 14 Jun 2009 18:01:35 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906141801.n5EI1Zti056239@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 18:01: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: r194204 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 18:01:36 -0000 Author: ed Date: Sun Jun 14 18:01:35 2009 New Revision: 194204 URL: http://svn.freebsd.org/changeset/base/194204 Log: Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. In the past there have been some reports of PRINTF_BUFR_SIZE not functioning correctly. Instead of having garbled console messages, we should just see whether the issues are still there and analyze them. Approved by: re Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jun 14 17:53:55 2009 (r194203) +++ head/sys/amd64/conf/GENERIC Sun Jun 14 18:01:35 2009 (r194204) @@ -66,6 +66,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jun 14 17:53:55 2009 (r194203) +++ head/sys/i386/conf/GENERIC Sun Jun 14 18:01:35 2009 (r194204) @@ -67,6 +67,7 @@ options SYSVSHM # SYSV-style shared m options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options KBD_INSTALL_CDEV # install a CDEV entry in /dev options STOP_NMI # Stop CPUS using NMI instead of IPI options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:36:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48B91065670; Sun, 14 Jun 2009 19:36:16 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 914E18FC12; Sun, 14 Jun 2009 19:36:16 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 6ABD28FC2E; Sun, 14 Jun 2009 23:36:14 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id A05C939C4B; Sun, 14 Jun 2009 23:36:11 +0400 (MSD) Date: Sun, 14 Jun 2009 23:36:07 +0400 From: Stanislav Sedov To: Ivan Voras Message-Id: <20090614233607.8db3c945.stas@FreeBSD.org> In-Reply-To: <200906130027.n5D0R3CU097629@svn.freebsd.org> References: <200906130027.n5D0R3CU097629@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Sun__14_Jun_2009_23_36_07_+0400_Tn1szYaupzDOFSji" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194092 - in head: sbin/geom/class/label sys/conf sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 19:36:17 -0000 --Signature=_Sun__14_Jun_2009_23_36_07_+0400_Tn1szYaupzDOFSji Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! There're some style errors in the file. See below. On Sat, 13 Jun 2009 00:27:03 +0000 (UTC) Ivan Voras mentioned: > + > +#define PART_CLASS_NAME "PART" > +#define SCHEME_NAME "GPT" > + > +#define G_LABEL_GPT_VOLUME_DIR "gpt" ^^^ > +#define G_LABEL_GPT_ID_DIR "gptid" ^^^ These shoule be tabs, not spaces as above. > + > +/* shamelessly stolen from g_part_gpt.c */ > +static void > +sbuf_nprintf_utf16(struct sbuf *sb, uint16_t *str, size_t len) > +{ <...> > + } > +} Why not put this function into the separate file, or turn it into inline? This way you'll avoid code duplication. > + /* > + * create sbuf with biggest possible size > + * we need max. 4 bytes for every 2-byte utf16 char > + */ Most of comments in geom code start with a capital and end up with a dot. This one doesn't follow this rule. There're also other places. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Sun__14_Jun_2009_23_36_07_+0400_Tn1szYaupzDOFSji Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKNVErAAoJEKN82nOYvCd03vkQALNXCNaoOroqP2tRZWPW5aB0 goETQ44ZmI//qrf0v8cmgvIWpArqX6ru8EKnQ+CNyqOPoD9oCEb9gokG8b/xcpEO amZjTOJItW0v4xmoOZrI9AfzGDj4b+aF3Fwkpr/m+/VnBQsUg6ouxRazD21p4f1B QaXoQwWnRvISX7qhuzsBMME2LVuk3xs/ntjIl8wQl/jyHebN6Ho8LxQUMzYHGXfL WcCFL9woDEB38Mp4dPIcJahX0ff5H/AdT/lL0sRwamO7JxyKmnPZaWMLgx+im4gY hvReA7ED88lj+hrFrTUIwC3QMfxmC9LSYq2r1A8c1V3j+u6NnNq4b5YyW88fH2Al +ixGuq1HMJ5XNJXDR6s1Z6G5Rh4BueWneIFttGW9CmQYhPcE20RK/w3Bapi1TGO2 LxO1LYMZ86FO2vJiA8kUK1sH0IduQgFW1w1lrukSH7pm/JpU+36IS4xUGvyqMCt0 ZPMqDElr+V2KsvTJIdPAWO6HFeXFMnMUnq8g93YQ2AslRQLeM5Bbj3tt9NZ8QGv0 CSYLKUBEnQZyBnnjJ+Dis6iPpIOyNyKqMZBCn8qxK9b8mZTich7QYbQOvKxfsFZy 2s6KY5oBii2xpJG+qLmiWyqysgZ80SidInpaAxKvKPMPiMLx+WURDF6X6A3unC/9 XcVvwoMYHJTbboz5/ovd =ywzK -----END PGP SIGNATURE----- --Signature=_Sun__14_Jun_2009_23_36_07_+0400_Tn1szYaupzDOFSji-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:45:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0CA81065675; Sun, 14 Jun 2009 19:45:17 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D86458FC08; Sun, 14 Jun 2009 19:45:17 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EJjHj4058277; Sun, 14 Jun 2009 19:45:17 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EJjHbW058273; Sun, 14 Jun 2009 19:45:17 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200906141945.n5EJjHbW058273@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 14 Jun 2009 19:45: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: r194206 - in head/crypto/openssl: . apps certs certs/demo certs/expired crypto crypto/aes crypto/aes/asm crypto/asn1 crypto/bf crypto/bio crypto/bn crypto/bn/asm crypto/buffer crypto/ca... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 19:45:18 -0000 Author: simon Date: Sun Jun 14 19:45:16 2009 New Revision: 194206 URL: http://svn.freebsd.org/changeset/base/194206 Log: Merge OpenSSL 0.9.8k into head. Approved by: re Added: head/crypto/openssl/apps/cms.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/cms.c head/crypto/openssl/apps/genpkey.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/genpkey.c head/crypto/openssl/apps/md4.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/md4.c head/crypto/openssl/apps/pkey.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/pkey.c head/crypto/openssl/apps/pkeyparam.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/pkeyparam.c head/crypto/openssl/apps/pkeyutl.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/pkeyutl.c head/crypto/openssl/apps/ts.c - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/ts.c head/crypto/openssl/apps/tsget - copied unchanged from r194205, vendor-crypto/openssl/dist/apps/tsget head/crypto/openssl/certs/README.RootCerts - copied unchanged from r194205, vendor-crypto/openssl/dist/certs/README.RootCerts head/crypto/openssl/crypto/aes/aes_wrap.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/aes_wrap.c head/crypto/openssl/crypto/aes/aes_x86core.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/aes_x86core.c head/crypto/openssl/crypto/aes/asm/aes-armv4.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/asm/aes-armv4.pl head/crypto/openssl/crypto/aes/asm/aes-ppc.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/asm/aes-ppc.pl head/crypto/openssl/crypto/aes/asm/aes-s390x.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/asm/aes-s390x.pl head/crypto/openssl/crypto/aes/asm/aes-sparcv9.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/asm/aes-sparcv9.pl head/crypto/openssl/crypto/aes/asm/aes-x86_64.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/aes/asm/aes-x86_64.pl head/crypto/openssl/crypto/asn1/ameth_lib.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/ameth_lib.c head/crypto/openssl/crypto/asn1/asn1_locl.h - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/asn1_locl.h head/crypto/openssl/crypto/asn1/asn_mime.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/asn_mime.c head/crypto/openssl/crypto/asn1/bio_asn1.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/bio_asn1.c head/crypto/openssl/crypto/asn1/bio_ndef.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/bio_ndef.c head/crypto/openssl/crypto/asn1/x_nx509.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/asn1/x_nx509.c head/crypto/openssl/crypto/bn/asm/alpha-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/alpha-mont.pl head/crypto/openssl/crypto/bn/asm/armv4-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/armv4-mont.pl head/crypto/openssl/crypto/bn/asm/mips3-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/mips3-mont.pl head/crypto/openssl/crypto/bn/asm/mo-586.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/mo-586.pl head/crypto/openssl/crypto/bn/asm/ppc-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/ppc-mont.pl head/crypto/openssl/crypto/bn/asm/ppc64-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/ppc64-mont.pl head/crypto/openssl/crypto/bn/asm/s390x-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/s390x-mont.pl head/crypto/openssl/crypto/bn/asm/s390x.S - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/s390x.S head/crypto/openssl/crypto/bn/asm/sparcv9-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9-mont.pl head/crypto/openssl/crypto/bn/asm/sparcv9a-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/sparcv9a-mont.pl head/crypto/openssl/crypto/bn/asm/via-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/via-mont.pl head/crypto/openssl/crypto/bn/asm/x86-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/x86-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/bn_opt.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/bn_opt.c head/crypto/openssl/crypto/bn/bn_x931p.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/bn/bn_x931p.c head/crypto/openssl/crypto/buffer/buf_str.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/buffer/buf_str.c head/crypto/openssl/crypto/camellia/asm/ - copied from r194205, vendor-crypto/openssl/dist/crypto/camellia/asm/ head/crypto/openssl/crypto/cms/ - copied from r194205, vendor-crypto/openssl/dist/crypto/cms/ head/crypto/openssl/crypto/des/des_lib.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/des/des_lib.c head/crypto/openssl/crypto/dsa/dsa_utl.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/dsa/dsa_utl.c head/crypto/openssl/crypto/dyn_lck.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/dyn_lck.c head/crypto/openssl/crypto/err/err_bio.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/err/err_bio.c head/crypto/openssl/crypto/err/err_def.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/err/err_def.c head/crypto/openssl/crypto/err/err_str.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/err/err_str.c head/crypto/openssl/crypto/evp/dig_eng.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/evp/dig_eng.c head/crypto/openssl/crypto/evp/e_seed.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/evp/e_seed.c head/crypto/openssl/crypto/evp/enc_min.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/evp/enc_min.c head/crypto/openssl/crypto/evp/evp_cnf.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/evp/evp_cnf.c head/crypto/openssl/crypto/fips_err.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/fips_err.c head/crypto/openssl/crypto/fips_err.h - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/fips_err.h head/crypto/openssl/crypto/jpake/ - copied from r194205, vendor-crypto/openssl/dist/crypto/jpake/ head/crypto/openssl/crypto/o_init.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/o_init.c head/crypto/openssl/crypto/ppccpuid.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/ppccpuid.pl head/crypto/openssl/crypto/rand/rand_eng.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/rand/rand_eng.c head/crypto/openssl/crypto/rc4/rc4_fblk.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/rc4/rc4_fblk.c head/crypto/openssl/crypto/rsa/rsa_eng.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/rsa/rsa_eng.c head/crypto/openssl/crypto/rsa/rsa_x931g.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/rsa/rsa_x931g.c head/crypto/openssl/crypto/s390xcpuid.S - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/s390xcpuid.S head/crypto/openssl/crypto/seed/ - copied from r194205, vendor-crypto/openssl/dist/crypto/seed/ head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/sha/asm/sha512-x86_64.pl head/crypto/openssl/crypto/sparcv9cap.c - copied unchanged from r194205, vendor-crypto/openssl/dist/crypto/sparcv9cap.c head/crypto/openssl/demos/jpake/ - copied from r194205, vendor-crypto/openssl/dist/demos/jpake/ head/crypto/openssl/engines/e_capi.c - copied unchanged from r194205, vendor-crypto/openssl/dist/engines/e_capi.c head/crypto/openssl/engines/e_capi.ec - copied unchanged from r194205, vendor-crypto/openssl/dist/engines/e_capi.ec head/crypto/openssl/engines/e_capi_err.c - copied unchanged from r194205, vendor-crypto/openssl/dist/engines/e_capi_err.c head/crypto/openssl/engines/e_capi_err.h - copied unchanged from r194205, vendor-crypto/openssl/dist/engines/e_capi_err.h head/crypto/openssl/fips/ - copied from r194205, vendor-crypto/openssl/dist/fips/ head/crypto/openssl/test/SHAmix.r - copied unchanged from r194205, vendor-crypto/openssl/dist/test/SHAmix.r head/crypto/openssl/test/SHAmix.x - copied unchanged from r194205, vendor-crypto/openssl/dist/test/SHAmix.x head/crypto/openssl/test/bftest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/bftest.c head/crypto/openssl/test/bntest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/bntest.c head/crypto/openssl/test/casttest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/casttest.c head/crypto/openssl/test/cms-examples.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/test/cms-examples.pl head/crypto/openssl/test/cms-test.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/test/cms-test.pl head/crypto/openssl/test/destest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/destest.c head/crypto/openssl/test/dhtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/dhtest.c head/crypto/openssl/test/dsatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/dsatest.c head/crypto/openssl/test/ecdhtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/ecdhtest.c head/crypto/openssl/test/ecdsatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/ecdsatest.c head/crypto/openssl/test/ectest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/ectest.c head/crypto/openssl/test/enginetest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/enginetest.c head/crypto/openssl/test/evp_test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/evp_test.c head/crypto/openssl/test/exptest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/exptest.c head/crypto/openssl/test/fips_aesavs.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_aesavs.c head/crypto/openssl/test/fips_desmovs.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_desmovs.c head/crypto/openssl/test/fips_dsatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_dsatest.c head/crypto/openssl/test/fips_dssvs.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_dssvs.c head/crypto/openssl/test/fips_hmactest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_hmactest.c head/crypto/openssl/test/fips_randtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_randtest.c head/crypto/openssl/test/fips_rngvs.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_rngvs.c head/crypto/openssl/test/fips_rsagtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_rsagtest.c head/crypto/openssl/test/fips_rsastest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_rsastest.c head/crypto/openssl/test/fips_rsavtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_rsavtest.c head/crypto/openssl/test/fips_shatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_shatest.c head/crypto/openssl/test/fips_test_suite.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/fips_test_suite.c head/crypto/openssl/test/hmactest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/hmactest.c head/crypto/openssl/test/ideatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/ideatest.c head/crypto/openssl/test/jpaketest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/jpaketest.c head/crypto/openssl/test/md2test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/md2test.c head/crypto/openssl/test/md4test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/md4test.c head/crypto/openssl/test/md5test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/md5test.c head/crypto/openssl/test/mdc2test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/mdc2test.c head/crypto/openssl/test/randtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/randtest.c head/crypto/openssl/test/rc2test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/rc2test.c head/crypto/openssl/test/rc4test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/rc4test.c head/crypto/openssl/test/rc5test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/rc5test.c head/crypto/openssl/test/rmdtest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/rmdtest.c head/crypto/openssl/test/rsa_test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/rsa_test.c head/crypto/openssl/test/sha1test.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/sha1test.c head/crypto/openssl/test/sha256t.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/sha256t.c head/crypto/openssl/test/sha512t.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/sha512t.c head/crypto/openssl/test/shatest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/shatest.c head/crypto/openssl/test/smcont.txt - copied unchanged from r194205, vendor-crypto/openssl/dist/test/smcont.txt head/crypto/openssl/test/smime-certs/ - copied from r194205, vendor-crypto/openssl/dist/test/smime-certs/ head/crypto/openssl/test/ssltest.c - copied unchanged from r194205, vendor-crypto/openssl/dist/test/ssltest.c head/crypto/openssl/test/testfipsssl - copied unchanged from r194205, vendor-crypto/openssl/dist/test/testfipsssl head/crypto/openssl/util/arx.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/util/arx.pl head/crypto/openssl/util/fipslink.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/util/fipslink.pl head/crypto/openssl/util/mksdef.pl - copied unchanged from r194205, vendor-crypto/openssl/dist/util/mksdef.pl Deleted: head/crypto/openssl/ChangeLog.0_9_7-stable_not-in-head head/crypto/openssl/ChangeLog.0_9_7-stable_not-in-head_FIPS head/crypto/openssl/certs/RegTP-5R.pem head/crypto/openssl/certs/RegTP-6R.pem head/crypto/openssl/certs/aol1.pem head/crypto/openssl/certs/aol2.pem head/crypto/openssl/certs/aoltw1.pem head/crypto/openssl/certs/aoltw2.pem head/crypto/openssl/certs/argena.pem head/crypto/openssl/certs/argeng.pem head/crypto/openssl/certs/demo/nortelCA.pem head/crypto/openssl/certs/demo/timCA.pem head/crypto/openssl/certs/demo/tjhCA.pem head/crypto/openssl/certs/demo/vsigntca.pem head/crypto/openssl/certs/eng1.pem head/crypto/openssl/certs/eng2.pem head/crypto/openssl/certs/eng3.pem head/crypto/openssl/certs/eng4.pem head/crypto/openssl/certs/eng5.pem head/crypto/openssl/certs/expired/ICE-CA.pem head/crypto/openssl/certs/expired/ICE-root.pem head/crypto/openssl/certs/expired/ICE-user.pem head/crypto/openssl/certs/expired/RegTP-4R.pem head/crypto/openssl/certs/expired/factory.pem head/crypto/openssl/certs/expired/rsa-cca.pem head/crypto/openssl/certs/expired/rsa-ssca.pem head/crypto/openssl/certs/expired/vsign2.pem head/crypto/openssl/certs/expired/vsign3.pem head/crypto/openssl/certs/thawteCb.pem head/crypto/openssl/certs/thawteCp.pem head/crypto/openssl/certs/vsign1.pem head/crypto/openssl/certs/vsign3.pem head/crypto/openssl/certs/vsignss.pem head/crypto/openssl/certs/wellsfgo.pem head/crypto/openssl/crypto/md5/asm/md5-sparcv9.S Modified: head/crypto/openssl/ (props changed) head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/FAQ head/crypto/openssl/INSTALL head/crypto/openssl/LICENSE head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/Makefile.shared head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/Makefile head/crypto/openssl/apps/apps.c head/crypto/openssl/apps/apps.h head/crypto/openssl/apps/asn1pars.c head/crypto/openssl/apps/ca.c head/crypto/openssl/apps/crl.c head/crypto/openssl/apps/dgst.c head/crypto/openssl/apps/dsa.c head/crypto/openssl/apps/ec.c head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/engine.c head/crypto/openssl/apps/gendsa.c head/crypto/openssl/apps/genrsa.c head/crypto/openssl/apps/nseq.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/openssl.c head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/pkcs8.c head/crypto/openssl/apps/progs.h head/crypto/openssl/apps/progs.pl head/crypto/openssl/apps/rand.c head/crypto/openssl/apps/req.c head/crypto/openssl/apps/rsa.c head/crypto/openssl/apps/rsautl.c head/crypto/openssl/apps/s_apps.h head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/smime.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/spkac.c head/crypto/openssl/apps/version.c head/crypto/openssl/apps/x509.c head/crypto/openssl/config head/crypto/openssl/crypto/Makefile head/crypto/openssl/crypto/aes/Makefile head/crypto/openssl/crypto/aes/aes.h head/crypto/openssl/crypto/aes/aes_cbc.c head/crypto/openssl/crypto/aes/aes_core.c head/crypto/openssl/crypto/aes/aes_ige.c head/crypto/openssl/crypto/aes/asm/aes-586.pl head/crypto/openssl/crypto/aes/asm/aes-ia64.S head/crypto/openssl/crypto/asn1/Makefile head/crypto/openssl/crypto/asn1/a_bytes.c head/crypto/openssl/crypto/asn1/a_mbstr.c head/crypto/openssl/crypto/asn1/a_object.c head/crypto/openssl/crypto/asn1/a_sign.c head/crypto/openssl/crypto/asn1/a_strex.c head/crypto/openssl/crypto/asn1/a_strnid.c head/crypto/openssl/crypto/asn1/a_type.c head/crypto/openssl/crypto/asn1/a_verify.c head/crypto/openssl/crypto/asn1/asn1.h head/crypto/openssl/crypto/asn1/asn1_err.c head/crypto/openssl/crypto/asn1/asn1_gen.c head/crypto/openssl/crypto/asn1/asn1_lib.c head/crypto/openssl/crypto/asn1/asn1_par.c head/crypto/openssl/crypto/asn1/asn1t.h head/crypto/openssl/crypto/asn1/asn_moid.c head/crypto/openssl/crypto/asn1/asn_pack.c head/crypto/openssl/crypto/asn1/nsseq.c head/crypto/openssl/crypto/asn1/p5_pbe.c head/crypto/openssl/crypto/asn1/p5_pbev2.c head/crypto/openssl/crypto/asn1/p8_pkey.c head/crypto/openssl/crypto/asn1/t_bitst.c head/crypto/openssl/crypto/asn1/t_crl.c head/crypto/openssl/crypto/asn1/t_req.c head/crypto/openssl/crypto/asn1/t_spki.c head/crypto/openssl/crypto/asn1/t_x509.c head/crypto/openssl/crypto/asn1/t_x509a.c head/crypto/openssl/crypto/asn1/tasn_dec.c head/crypto/openssl/crypto/asn1/tasn_enc.c head/crypto/openssl/crypto/asn1/tasn_fre.c head/crypto/openssl/crypto/asn1/tasn_new.c head/crypto/openssl/crypto/asn1/tasn_prn.c head/crypto/openssl/crypto/asn1/tasn_typ.c head/crypto/openssl/crypto/asn1/tasn_utl.c head/crypto/openssl/crypto/asn1/x_algor.c head/crypto/openssl/crypto/asn1/x_bignum.c head/crypto/openssl/crypto/asn1/x_crl.c head/crypto/openssl/crypto/asn1/x_exten.c head/crypto/openssl/crypto/asn1/x_long.c head/crypto/openssl/crypto/asn1/x_name.c head/crypto/openssl/crypto/asn1/x_x509a.c head/crypto/openssl/crypto/bf/Makefile head/crypto/openssl/crypto/bf/bf_skey.c head/crypto/openssl/crypto/bf/blowfish.h head/crypto/openssl/crypto/bio/Makefile head/crypto/openssl/crypto/bio/b_print.c head/crypto/openssl/crypto/bio/b_sock.c head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bss_bio.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bio/bss_file.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/bio/bss_sock.c head/crypto/openssl/crypto/bn/Makefile head/crypto/openssl/crypto/bn/asm/ia64.S head/crypto/openssl/crypto/bn/bn.h head/crypto/openssl/crypto/bn/bn_blind.c head/crypto/openssl/crypto/bn/bn_div.c head/crypto/openssl/crypto/bn/bn_err.c head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/bn_gcd.c head/crypto/openssl/crypto/bn/bn_gf2m.c head/crypto/openssl/crypto/bn/bn_lcl.h head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_mont.c head/crypto/openssl/crypto/bn/bn_mul.c head/crypto/openssl/crypto/bn/bn_nist.c head/crypto/openssl/crypto/bn/bn_prime.c head/crypto/openssl/crypto/bn/bn_prime.h head/crypto/openssl/crypto/bn/bn_prime.pl head/crypto/openssl/crypto/bn/bn_rand.c head/crypto/openssl/crypto/bn/bn_shift.c head/crypto/openssl/crypto/bn/bntest.c head/crypto/openssl/crypto/buffer/Makefile head/crypto/openssl/crypto/buffer/buffer.c head/crypto/openssl/crypto/camellia/Makefile head/crypto/openssl/crypto/camellia/camellia.h head/crypto/openssl/crypto/camellia/cmll_misc.c head/crypto/openssl/crypto/cast/Makefile head/crypto/openssl/crypto/cast/c_skey.c head/crypto/openssl/crypto/cast/cast.h head/crypto/openssl/crypto/comp/Makefile head/crypto/openssl/crypto/comp/c_zlib.c head/crypto/openssl/crypto/comp/comp.h head/crypto/openssl/crypto/comp/comp_err.c head/crypto/openssl/crypto/conf/Makefile head/crypto/openssl/crypto/conf/conf.h head/crypto/openssl/crypto/conf/conf_api.c head/crypto/openssl/crypto/conf/conf_mall.c head/crypto/openssl/crypto/conf/conf_mod.c head/crypto/openssl/crypto/conf/conf_sap.c head/crypto/openssl/crypto/cryptlib.c head/crypto/openssl/crypto/cryptlib.h head/crypto/openssl/crypto/crypto.h head/crypto/openssl/crypto/des/Makefile head/crypto/openssl/crypto/des/asm/des_enc.m4 head/crypto/openssl/crypto/des/des.h head/crypto/openssl/crypto/des/des_enc.c head/crypto/openssl/crypto/des/des_old.c head/crypto/openssl/crypto/des/des_old.h head/crypto/openssl/crypto/des/ecb_enc.c head/crypto/openssl/crypto/des/enc_read.c head/crypto/openssl/crypto/des/enc_writ.c head/crypto/openssl/crypto/des/set_key.c head/crypto/openssl/crypto/des/times/usparc.cc head/crypto/openssl/crypto/des/xcbc_enc.c head/crypto/openssl/crypto/dh/Makefile head/crypto/openssl/crypto/dh/dh.h head/crypto/openssl/crypto/dh/dh_asn1.c head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dh_err.c head/crypto/openssl/crypto/dh/dh_gen.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dsa/Makefile head/crypto/openssl/crypto/dsa/dsa.h head/crypto/openssl/crypto/dsa/dsa_asn1.c head/crypto/openssl/crypto/dsa/dsa_err.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_key.c head/crypto/openssl/crypto/dsa/dsa_lib.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dsa/dsa_sign.c head/crypto/openssl/crypto/dsa/dsa_vrf.c head/crypto/openssl/crypto/dso/Makefile head/crypto/openssl/crypto/ec/Makefile head/crypto/openssl/crypto/ec/ec.h head/crypto/openssl/crypto/ec/ec_err.c head/crypto/openssl/crypto/ec/ec_key.c head/crypto/openssl/crypto/ec/ec_mult.c head/crypto/openssl/crypto/ec/ectest.c head/crypto/openssl/crypto/ecdh/Makefile head/crypto/openssl/crypto/ecdh/ecdhtest.c head/crypto/openssl/crypto/ecdsa/Makefile head/crypto/openssl/crypto/ecdsa/ecdsatest.c head/crypto/openssl/crypto/ecdsa/ecs_ossl.c head/crypto/openssl/crypto/engine/Makefile head/crypto/openssl/crypto/engine/eng_all.c head/crypto/openssl/crypto/engine/eng_cnf.c head/crypto/openssl/crypto/engine/eng_err.c head/crypto/openssl/crypto/engine/eng_int.h head/crypto/openssl/crypto/engine/eng_padlock.c head/crypto/openssl/crypto/engine/eng_pkey.c head/crypto/openssl/crypto/engine/eng_table.c head/crypto/openssl/crypto/engine/engine.h head/crypto/openssl/crypto/engine/enginetest.c head/crypto/openssl/crypto/err/Makefile head/crypto/openssl/crypto/err/err.c head/crypto/openssl/crypto/err/err.h head/crypto/openssl/crypto/err/err_all.c head/crypto/openssl/crypto/err/err_prn.c head/crypto/openssl/crypto/err/openssl.ec head/crypto/openssl/crypto/evp/Makefile head/crypto/openssl/crypto/evp/bio_md.c head/crypto/openssl/crypto/evp/c_allc.c head/crypto/openssl/crypto/evp/digest.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_camellia.c head/crypto/openssl/crypto/evp/e_des.c head/crypto/openssl/crypto/evp/e_des3.c head/crypto/openssl/crypto/evp/e_null.c head/crypto/openssl/crypto/evp/e_rc4.c head/crypto/openssl/crypto/evp/evp.h head/crypto/openssl/crypto/evp/evp_acnf.c head/crypto/openssl/crypto/evp/evp_enc.c head/crypto/openssl/crypto/evp/evp_err.c head/crypto/openssl/crypto/evp/evp_lib.c head/crypto/openssl/crypto/evp/evp_locl.h head/crypto/openssl/crypto/evp/evp_pbe.c head/crypto/openssl/crypto/evp/evp_pkey.c head/crypto/openssl/crypto/evp/evp_test.c head/crypto/openssl/crypto/evp/evptests.txt head/crypto/openssl/crypto/evp/m_dss.c head/crypto/openssl/crypto/evp/m_dss1.c head/crypto/openssl/crypto/evp/m_md2.c head/crypto/openssl/crypto/evp/m_md4.c head/crypto/openssl/crypto/evp/m_md5.c head/crypto/openssl/crypto/evp/m_mdc2.c head/crypto/openssl/crypto/evp/m_sha.c head/crypto/openssl/crypto/evp/m_sha1.c head/crypto/openssl/crypto/evp/names.c head/crypto/openssl/crypto/evp/p5_crpt.c head/crypto/openssl/crypto/evp/p5_crpt2.c head/crypto/openssl/crypto/evp/p_sign.c head/crypto/openssl/crypto/evp/p_verify.c head/crypto/openssl/crypto/ex_data.c head/crypto/openssl/crypto/hmac/Makefile head/crypto/openssl/crypto/hmac/hmac.c head/crypto/openssl/crypto/hmac/hmac.h head/crypto/openssl/crypto/idea/Makefile head/crypto/openssl/crypto/idea/i_skey.c head/crypto/openssl/crypto/idea/idea.h head/crypto/openssl/crypto/krb5/Makefile head/crypto/openssl/crypto/lhash/Makefile head/crypto/openssl/crypto/md2/Makefile head/crypto/openssl/crypto/md2/md2.h head/crypto/openssl/crypto/md2/md2_dgst.c head/crypto/openssl/crypto/md32_common.h head/crypto/openssl/crypto/md4/Makefile head/crypto/openssl/crypto/md4/md4.h head/crypto/openssl/crypto/md4/md4_dgst.c head/crypto/openssl/crypto/md4/md4_locl.h head/crypto/openssl/crypto/md4/md4test.c head/crypto/openssl/crypto/md5/Makefile head/crypto/openssl/crypto/md5/asm/md5-586.pl head/crypto/openssl/crypto/md5/asm/md5-x86_64.pl head/crypto/openssl/crypto/md5/md5.h head/crypto/openssl/crypto/md5/md5_dgst.c head/crypto/openssl/crypto/md5/md5_locl.h head/crypto/openssl/crypto/md5/md5test.c head/crypto/openssl/crypto/mdc2/Makefile head/crypto/openssl/crypto/mdc2/mdc2.h head/crypto/openssl/crypto/mdc2/mdc2dgst.c head/crypto/openssl/crypto/mem.c head/crypto/openssl/crypto/mem_clr.c head/crypto/openssl/crypto/mem_dbg.c head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/objects/Makefile head/crypto/openssl/crypto/objects/obj_dat.c head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/obj_dat.pl head/crypto/openssl/crypto/objects/obj_mac.h head/crypto/openssl/crypto/objects/obj_mac.num head/crypto/openssl/crypto/objects/objects.txt head/crypto/openssl/crypto/ocsp/Makefile head/crypto/openssl/crypto/ocsp/ocsp.h head/crypto/openssl/crypto/ocsp/ocsp_asn.c head/crypto/openssl/crypto/ocsp/ocsp_err.c head/crypto/openssl/crypto/ocsp/ocsp_ht.c head/crypto/openssl/crypto/ocsp/ocsp_srv.c head/crypto/openssl/crypto/ocsp/ocsp_vfy.c head/crypto/openssl/crypto/opensslconf.h head/crypto/openssl/crypto/opensslconf.h.in head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/ossl_typ.h head/crypto/openssl/crypto/pem/Makefile head/crypto/openssl/crypto/pem/pem.h head/crypto/openssl/crypto/pem/pem_all.c head/crypto/openssl/crypto/pem/pem_info.c head/crypto/openssl/crypto/pem/pem_lib.c head/crypto/openssl/crypto/pem/pem_x509.c head/crypto/openssl/crypto/pem/pem_xaux.c head/crypto/openssl/crypto/perlasm/x86_64-xlate.pl head/crypto/openssl/crypto/perlasm/x86ms.pl head/crypto/openssl/crypto/perlasm/x86nasm.pl head/crypto/openssl/crypto/perlasm/x86unix.pl head/crypto/openssl/crypto/pkcs12/Makefile head/crypto/openssl/crypto/pkcs12/p12_add.c head/crypto/openssl/crypto/pkcs12/p12_asn.c head/crypto/openssl/crypto/pkcs12/p12_attr.c head/crypto/openssl/crypto/pkcs12/p12_crpt.c head/crypto/openssl/crypto/pkcs12/p12_crt.c head/crypto/openssl/crypto/pkcs12/p12_decr.c head/crypto/openssl/crypto/pkcs12/p12_init.c head/crypto/openssl/crypto/pkcs12/p12_key.c head/crypto/openssl/crypto/pkcs12/p12_kiss.c head/crypto/openssl/crypto/pkcs12/p12_mutl.c head/crypto/openssl/crypto/pkcs12/p12_npas.c head/crypto/openssl/crypto/pkcs12/p12_p8d.c head/crypto/openssl/crypto/pkcs12/p12_p8e.c head/crypto/openssl/crypto/pkcs12/p12_utl.c head/crypto/openssl/crypto/pkcs12/pkcs12.h head/crypto/openssl/crypto/pkcs7/Makefile head/crypto/openssl/crypto/pkcs7/p7/a1 (props changed) head/crypto/openssl/crypto/pkcs7/p7/a2 (props changed) head/crypto/openssl/crypto/pkcs7/p7/cert.p7c (props changed) head/crypto/openssl/crypto/pkcs7/p7/smime.p7m (props changed) head/crypto/openssl/crypto/pkcs7/p7/smime.p7s (props changed) head/crypto/openssl/crypto/pkcs7/pk7_asn1.c head/crypto/openssl/crypto/pkcs7/pk7_attr.c head/crypto/openssl/crypto/pkcs7/pk7_mime.c head/crypto/openssl/crypto/pkcs7/pk7_smime.c head/crypto/openssl/crypto/pqueue/Makefile head/crypto/openssl/crypto/pqueue/pq_compat.h head/crypto/openssl/crypto/rand/Makefile head/crypto/openssl/crypto/rand/md_rand.c head/crypto/openssl/crypto/rand/rand.h head/crypto/openssl/crypto/rand/rand_err.c head/crypto/openssl/crypto/rand/rand_lcl.h head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_nw.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rc2/Makefile head/crypto/openssl/crypto/rc2/rc2.h head/crypto/openssl/crypto/rc2/rc2_skey.c head/crypto/openssl/crypto/rc4/Makefile head/crypto/openssl/crypto/rc4/asm/rc4-586.pl head/crypto/openssl/crypto/rc4/asm/rc4-ia64.S head/crypto/openssl/crypto/rc4/asm/rc4-x86_64.pl head/crypto/openssl/crypto/rc4/rc4.h head/crypto/openssl/crypto/rc4/rc4_skey.c head/crypto/openssl/crypto/rc5/Makefile head/crypto/openssl/crypto/rc5/rc5.h head/crypto/openssl/crypto/rc5/rc5_skey.c head/crypto/openssl/crypto/ripemd/Makefile head/crypto/openssl/crypto/ripemd/README head/crypto/openssl/crypto/ripemd/asm/rmd-586.pl head/crypto/openssl/crypto/ripemd/ripemd.h head/crypto/openssl/crypto/ripemd/rmd_dgst.c head/crypto/openssl/crypto/ripemd/rmd_locl.h head/crypto/openssl/crypto/ripemd/rmdtest.c head/crypto/openssl/crypto/rsa/Makefile head/crypto/openssl/crypto/rsa/rsa.h head/crypto/openssl/crypto/rsa/rsa_asn1.c head/crypto/openssl/crypto/rsa/rsa_eay.c head/crypto/openssl/crypto/rsa/rsa_err.c head/crypto/openssl/crypto/rsa/rsa_gen.c head/crypto/openssl/crypto/rsa/rsa_lib.c head/crypto/openssl/crypto/rsa/rsa_null.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_pss.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/rsa/rsa_ssl.c head/crypto/openssl/crypto/rsa/rsa_test.c head/crypto/openssl/crypto/rsa/rsa_x931.c head/crypto/openssl/crypto/sha/Makefile head/crypto/openssl/crypto/sha/asm/sha1-586.pl head/crypto/openssl/crypto/sha/asm/sha1-ia64.pl head/crypto/openssl/crypto/sha/asm/sha512-ia64.pl head/crypto/openssl/crypto/sha/sha.h head/crypto/openssl/crypto/sha/sha1_one.c head/crypto/openssl/crypto/sha/sha1dgst.c head/crypto/openssl/crypto/sha/sha1test.c head/crypto/openssl/crypto/sha/sha256.c head/crypto/openssl/crypto/sha/sha512.c head/crypto/openssl/crypto/sha/sha_dgst.c head/crypto/openssl/crypto/sha/sha_locl.h head/crypto/openssl/crypto/sha/shatest.c head/crypto/openssl/crypto/stack/Makefile head/crypto/openssl/crypto/stack/safestack.h head/crypto/openssl/crypto/store/Makefile head/crypto/openssl/crypto/store/str_lib.c head/crypto/openssl/crypto/symhacks.h head/crypto/openssl/crypto/txt_db/Makefile head/crypto/openssl/crypto/ui/Makefile head/crypto/openssl/crypto/ui/ui_lib.c head/crypto/openssl/crypto/ui/ui_openssl.c head/crypto/openssl/crypto/x509/Makefile head/crypto/openssl/crypto/x509/by_dir.c head/crypto/openssl/crypto/x509/x509.h head/crypto/openssl/crypto/x509/x509_att.c head/crypto/openssl/crypto/x509/x509_cmp.c head/crypto/openssl/crypto/x509/x509_trs.c head/crypto/openssl/crypto/x509/x509_txt.c head/crypto/openssl/crypto/x509/x509_vfy.c head/crypto/openssl/crypto/x509/x509_vpm.c head/crypto/openssl/crypto/x509/x509cset.c head/crypto/openssl/crypto/x509/x509spki.c head/crypto/openssl/crypto/x509v3/Makefile head/crypto/openssl/crypto/x509v3/ext_dat.h head/crypto/openssl/crypto/x509v3/pcy_cache.c head/crypto/openssl/crypto/x509v3/pcy_data.c head/crypto/openssl/crypto/x509v3/pcy_int.h head/crypto/openssl/crypto/x509v3/pcy_lib.c head/crypto/openssl/crypto/x509v3/pcy_map.c head/crypto/openssl/crypto/x509v3/pcy_node.c head/crypto/openssl/crypto/x509v3/pcy_tree.c head/crypto/openssl/crypto/x509v3/tabtest.c head/crypto/openssl/crypto/x509v3/v3_addr.c head/crypto/openssl/crypto/x509v3/v3_akey.c head/crypto/openssl/crypto/x509v3/v3_akeya.c head/crypto/openssl/crypto/x509v3/v3_alt.c head/crypto/openssl/crypto/x509v3/v3_asid.c head/crypto/openssl/crypto/x509v3/v3_bcons.c head/crypto/openssl/crypto/x509v3/v3_bitst.c head/crypto/openssl/crypto/x509v3/v3_conf.c head/crypto/openssl/crypto/x509v3/v3_cpols.c head/crypto/openssl/crypto/x509v3/v3_crld.c head/crypto/openssl/crypto/x509v3/v3_enum.c head/crypto/openssl/crypto/x509v3/v3_extku.c head/crypto/openssl/crypto/x509v3/v3_genn.c head/crypto/openssl/crypto/x509v3/v3_ia5.c head/crypto/openssl/crypto/x509v3/v3_info.c head/crypto/openssl/crypto/x509v3/v3_int.c head/crypto/openssl/crypto/x509v3/v3_lib.c head/crypto/openssl/crypto/x509v3/v3_ncons.c head/crypto/openssl/crypto/x509v3/v3_ocsp.c head/crypto/openssl/crypto/x509v3/v3_pci.c head/crypto/openssl/crypto/x509v3/v3_pcons.c head/crypto/openssl/crypto/x509v3/v3_pku.c head/crypto/openssl/crypto/x509v3/v3_pmaps.c head/crypto/openssl/crypto/x509v3/v3_prn.c head/crypto/openssl/crypto/x509v3/v3_purp.c head/crypto/openssl/crypto/x509v3/v3_skey.c head/crypto/openssl/crypto/x509v3/v3_sxnet.c head/crypto/openssl/crypto/x509v3/v3_utl.c head/crypto/openssl/crypto/x509v3/v3conf.c head/crypto/openssl/crypto/x509v3/v3prin.c head/crypto/openssl/crypto/x509v3/x509v3.h head/crypto/openssl/crypto/x86_64cpuid.pl head/crypto/openssl/crypto/x86cpuid.pl head/crypto/openssl/demos/asn1/ocsp.c head/crypto/openssl/demos/engines/cluster_labs/hw_cluster_labs_err.h head/crypto/openssl/demos/engines/ibmca/hw_ibmca_err.h head/crypto/openssl/demos/engines/zencod/hw_zencod_err.h head/crypto/openssl/doc/apps/ciphers.pod head/crypto/openssl/doc/apps/dgst.pod head/crypto/openssl/doc/apps/enc.pod head/crypto/openssl/doc/apps/ocsp.pod head/crypto/openssl/doc/apps/openssl.pod head/crypto/openssl/doc/apps/rand.pod head/crypto/openssl/doc/apps/rsautl.pod head/crypto/openssl/doc/apps/s_client.pod head/crypto/openssl/doc/apps/s_server.pod head/crypto/openssl/doc/apps/verify.pod head/crypto/openssl/doc/apps/x509.pod head/crypto/openssl/doc/c-indentation.el head/crypto/openssl/doc/crypto/ASN1_generate_nconf.pod head/crypto/openssl/doc/crypto/DH_set_method.pod head/crypto/openssl/doc/crypto/DSA_set_method.pod head/crypto/openssl/doc/crypto/OPENSSL_ia32cap.pod head/crypto/openssl/doc/crypto/RAND_bytes.pod head/crypto/openssl/doc/crypto/RAND_egd.pod head/crypto/openssl/doc/crypto/RAND_set_rand_method.pod head/crypto/openssl/doc/crypto/RSA_set_method.pod head/crypto/openssl/doc/crypto/X509_NAME_print_ex.pod head/crypto/openssl/doc/crypto/des_modes.pod head/crypto/openssl/doc/crypto/engine.pod head/crypto/openssl/doc/openssl_button.gif (props changed) head/crypto/openssl/doc/ssl/SSL_CIPHER_get_name.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_options.pod head/crypto/openssl/doc/ssl/SSL_CTX_set_verify.pod head/crypto/openssl/doc/ssl/SSL_SESSION_free.pod head/crypto/openssl/doc/ssl/SSL_free.pod head/crypto/openssl/doc/ssl/SSL_read.pod head/crypto/openssl/doc/ssleay.txt head/crypto/openssl/doc/standards.txt head/crypto/openssl/e_os.h head/crypto/openssl/engines/Makefile head/crypto/openssl/engines/e_4758cca_err.h head/crypto/openssl/engines/e_aep.c head/crypto/openssl/engines/e_aep_err.h head/crypto/openssl/engines/e_atalla_err.h head/crypto/openssl/engines/e_chil.c head/crypto/openssl/engines/e_chil_err.c head/crypto/openssl/engines/e_chil_err.h head/crypto/openssl/engines/e_cswift_err.h head/crypto/openssl/engines/e_gmp.c head/crypto/openssl/engines/e_gmp_err.h head/crypto/openssl/engines/e_nuron_err.h head/crypto/openssl/engines/e_sureware_err.h head/crypto/openssl/engines/e_ubsec.c head/crypto/openssl/engines/e_ubsec_err.h head/crypto/openssl/openssl.spec head/crypto/openssl/ssl/Makefile head/crypto/openssl/ssl/d1_both.c head/crypto/openssl/ssl/d1_clnt.c head/crypto/openssl/ssl/d1_enc.c head/crypto/openssl/ssl/d1_lib.c head/crypto/openssl/ssl/d1_pkt.c head/crypto/openssl/ssl/d1_srvr.c head/crypto/openssl/ssl/dtls1.h head/crypto/openssl/ssl/kssl.c head/crypto/openssl/ssl/s23_clnt.c head/crypto/openssl/ssl/s23_srvr.c head/crypto/openssl/ssl/s2_clnt.c head/crypto/openssl/ssl/s2_srvr.c head/crypto/openssl/ssl/s3_clnt.c head/crypto/openssl/ssl/s3_enc.c head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/crypto/openssl/ssl/ssl.h head/crypto/openssl/ssl/ssl3.h head/crypto/openssl/ssl/ssl_algs.c head/crypto/openssl/ssl/ssl_asn1.c head/crypto/openssl/ssl/ssl_cert.c head/crypto/openssl/ssl/ssl_ciph.c head/crypto/openssl/ssl/ssl_err.c head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/ssl_rsa.c head/crypto/openssl/ssl/ssl_sess.c head/crypto/openssl/ssl/ssl_stat.c head/crypto/openssl/ssl/ssl_txt.c head/crypto/openssl/ssl/ssltest.c head/crypto/openssl/ssl/t1_enc.c head/crypto/openssl/ssl/t1_lib.c head/crypto/openssl/ssl/tls1.h head/crypto/openssl/test/CAss.cnf head/crypto/openssl/test/Makefile head/crypto/openssl/test/Uss.cnf head/crypto/openssl/test/evptests.txt head/crypto/openssl/test/igetest.c head/crypto/openssl/test/times head/crypto/openssl/util/clean-depend.pl head/crypto/openssl/util/copy.pl head/crypto/openssl/util/domd head/crypto/openssl/util/libeay.num head/crypto/openssl/util/mk1mf.pl head/crypto/openssl/util/mkdef.pl head/crypto/openssl/util/mkerr.pl head/crypto/openssl/util/mkfiles.pl head/crypto/openssl/util/mklink.pl head/crypto/openssl/util/opensslwrap.sh head/crypto/openssl/util/pl/VC-32.pl head/crypto/openssl/util/pl/netware.pl head/crypto/openssl/util/shlib_wrap.sh head/crypto/openssl/util/ssleay.num Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Sun Jun 14 18:04:22 2009 (r194205) +++ head/crypto/openssl/CHANGES Sun Jun 14 19:45:16 2009 (r194206) @@ -2,13 +2,455 @@ OpenSSL CHANGES _______________ - Changes between 0.9.8d and 0.9.8e [23 Feb 2007] + Changes between 0.9.8j and 0.9.8k [25 Mar 2009] + + *) Don't set val to NULL when freeing up structures, it is freed up by + underlying code. If sizeof(void *) > sizeof(long) this can result in + zeroing past the valid field. (CVE-2009-0789) + [Paolo Ganci ] + + *) Fix bug where return value of CMS_SignerInfo_verify_content() was not + checked correctly. This would allow some invalid signed attributes to + appear to verify correctly. (CVE-2009-0591) + [Ivan Nestlerode ] + + *) Reject UniversalString and BMPString types with invalid lengths. This + prevents a crash in ASN1_STRING_print_ex() which assumes the strings have + a legal length. (CVE-2009-0590) + [Steve Henson] + + *) Set S/MIME signing as the default purpose rather than setting it + unconditionally. This allows applications to override it at the store + level. + [Steve Henson] + + *) Permit restricted recursion of ASN1 strings. This is needed in practice + to handle some structures. + [Steve Henson] + + *) Improve efficiency of mem_gets: don't search whole buffer each time + for a '\n' + [Jeremy Shapiro ] + + *) New -hex option for openssl rand. + [Matthieu Herrb] + + *) Print out UTF8String and NumericString when parsing ASN1. + [Steve Henson] + + *) Support NumericString type for name components. + [Steve Henson] + + *) Allow CC in the environment to override the automatically chosen + compiler. Note that nothing is done to ensure flags work with the + chosen compiler. + [Ben Laurie] + + Changes between 0.9.8i and 0.9.8j [07 Jan 2009] + + *) Properly check EVP_VerifyFinal() and similar return values + (CVE-2008-5077). + [Ben Laurie, Bodo Moeller, Google Security Team] + + *) Enable TLS extensions by default. + [Ben Laurie] + + *) Allow the CHIL engine to be loaded, whether the application is + multithreaded or not. (This does not release the developer from the + obligation to set up the dynamic locking callbacks.) + [Sander Temme ] + + *) Use correct exit code if there is an error in dgst command. + [Steve Henson; problem pointed out by Roland Dirlewanger] + + *) Tweak Configure so that you need to say "experimental-jpake" to enable + JPAKE, and need to use -DOPENSSL_EXPERIMENTAL_JPAKE in applications. + [Bodo Moeller] + + *) Add experimental JPAKE support, including demo authentication in + s_client and s_server. + [Ben Laurie] + + *) Set the comparison function in v3_addr_canonize(). + [Rob Austein ] + + *) Add support for XMPP STARTTLS in s_client. + [Philip Paeps ] + + *) Change the server-side SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG behavior + to ensure that even with this option, only ciphersuites in the + server's preference list will be accepted. (Note that the option + applies only when resuming a session, so the earlier behavior was + just about the algorithm choice for symmetric cryptography.) + [Bodo Moeller] + + Changes between 0.9.8h and 0.9.8i [15 Sep 2008] + + *) Fix a state transitition in s3_srvr.c and d1_srvr.c + (was using SSL3_ST_CW_CLNT_HELLO_B, should be ..._ST_SW_SRVR_...). + [Nagendra Modadugu] + + *) The fix in 0.9.8c that supposedly got rid of unsafe + double-checked locking was incomplete for RSA blinding, + addressing just one layer of what turns out to have been + doubly unsafe triple-checked locking. + + So now fix this for real by retiring the MONT_HELPER macro + in crypto/rsa/rsa_eay.c. + + [Bodo Moeller; problem pointed out by Marius Schilder] + + *) Various precautionary measures: + + - Avoid size_t integer overflow in HASH_UPDATE (md32_common.h). + + - Avoid a buffer overflow in d2i_SSL_SESSION() (ssl_asn1.c). + (NB: This would require knowledge of the secret session ticket key + to exploit, in which case you'd be SOL either way.) + + - Change bn_nist.c so that it will properly handle input BIGNUMs + outside the expected range. + + - Enforce the 'num' check in BN_div() (bn_div.c) for non-BN_DEBUG + builds. + + [Neel Mehta, Bodo Moeller] + + *) Allow engines to be "soft loaded" - i.e. optionally don't die if + the load fails. Useful for distros. + [Ben Laurie and the FreeBSD team] + + *) Add support for Local Machine Keyset attribute in PKCS#12 files. + [Steve Henson] + + *) Fix BN_GF2m_mod_arr() top-bit cleanup code. + [Huang Ying] + + *) Expand ENGINE to support engine supplied SSL client certificate functions. + + This work was sponsored by Logica. + [Steve Henson] + + *) Add CryptoAPI ENGINE to support use of RSA and DSA keys held in Windows + keystores. Support for SSL/TLS client authentication too. + Not compiled unless enable-capieng specified to Configure. + + This work was sponsored by Logica. + [Steve Henson] + + *) Fix bug in X509_ATTRIBUTE creation: dont set attribute using + ASN1_TYPE_set1 if MBSTRING flag set. This bug would crash certain + attribute creation routines such as certifcate requests and PKCS#12 + files. + [Steve Henson] + + Changes between 0.9.8g and 0.9.8h [28 May 2008] + + *) Fix flaw if 'Server Key exchange message' is omitted from a TLS + handshake which could lead to a cilent crash as found using the + Codenomicon TLS test suite (CVE-2008-1672) + [Steve Henson, Mark Cox] + + *) Fix double free in TLS server name extensions which could lead to + a remote crash found by Codenomicon TLS test suite (CVE-2008-0891) + [Joe Orton] + + *) Clear error queue in SSL_CTX_use_certificate_chain_file() + + Clear the error queue to ensure that error entries left from + older function calls do not interfere with the correct operation. + [Lutz Jaenicke, Erik de Castro Lopo] + + *) Remove root CA certificates of commercial CAs: + + The OpenSSL project does not recommend any specific CA and does not + have any policy with respect to including or excluding any CA. + Therefore it does not make any sense to ship an arbitrary selection + of root CA certificates with the OpenSSL software. + [Lutz Jaenicke] + + *) RSA OAEP patches to fix two separate invalid memory reads. + The first one involves inputs when 'lzero' is greater than + 'SHA_DIGEST_LENGTH' (it would read about SHA_DIGEST_LENGTH bytes + before the beginning of from). The second one involves inputs where + the 'db' section contains nothing but zeroes (there is a one-byte + invalid read after the end of 'db'). + [Ivan Nestlerode ] + + *) Partial backport from 0.9.9-dev: + + Introduce bn_mul_mont (dedicated Montgomery multiplication + procedure) as a candidate for BIGNUM assembler implementation. + While 0.9.9-dev uses assembler for various architectures, only + x86_64 is available by default here in the 0.9.8 branch, and + 32-bit x86 is available through a compile-time setting. + + To try the 32-bit x86 assembler implementation, use Configure + option "enable-montasm" (which exists only for this backport). + + As "enable-montasm" for 32-bit x86 disclaims code stability + anyway, in this constellation we activate additional code + backported from 0.9.9-dev for further performance improvements, + namely BN_from_montgomery_word. (To enable this otherwise, + e.g. x86_64, try "-DMONT_FROM_WORD___NON_DEFAULT_0_9_8_BUILD".) + + [Andy Polyakov (backport partially by Bodo Moeller)] + + *) Add TLS session ticket callback. This allows an application to set + TLS ticket cipher and HMAC keys rather than relying on hardcoded fixed + values. This is useful for key rollover for example where several key + sets may exist with different names. + [Steve Henson] + + *) Reverse ENGINE-internal logic for caching default ENGINE handles. + This was broken until now in 0.9.8 releases, such that the only way + a registered ENGINE could be used (assuming it initialises + successfully on the host) was to explicitly set it as the default + for the relevant algorithms. This is in contradiction with 0.9.7 + behaviour and the documentation. With this fix, when an ENGINE is + registered into a given algorithm's table of implementations, the + 'uptodate' flag is reset so that auto-discovery will be used next + time a new context for that algorithm attempts to select an + implementation. + [Ian Lister (tweaked by Geoff Thorpe)] + + *) Backport of CMS code to OpenSSL 0.9.8. This differs from the 0.9.9 + implemention in the following ways: + + Lack of EVP_PKEY_ASN1_METHOD means algorithm parameters have to be + hard coded. + + Lack of BER streaming support means one pass streaming processing is + only supported if data is detached: setting the streaming flag is + ignored for embedded content. + + CMS support is disabled by default and must be explicitly enabled + with the enable-cms configuration option. + [Steve Henson] + + *) Update the GMP engine glue to do direct copies between BIGNUM and + mpz_t when openssl and GMP use the same limb size. Otherwise the + existing "conversion via a text string export" trick is still used. + [Paul Sheer ] + + *) Zlib compression BIO. This is a filter BIO which compressed and + uncompresses any data passed through it. + [Steve Henson] + + *) Add AES_wrap_key() and AES_unwrap_key() functions to implement + RFC3394 compatible AES key wrapping. + [Steve Henson] + + *) Add utility functions to handle ASN1 structures. ASN1_STRING_set0(): + sets string data without copying. X509_ALGOR_set0() and + X509_ALGOR_get0(): set and retrieve X509_ALGOR (AlgorithmIdentifier) + data. Attribute function X509at_get0_data_by_OBJ(): retrieves data + from an X509_ATTRIBUTE structure optionally checking it occurs only + once. ASN1_TYPE_set1(): set and ASN1_TYPE structure copying supplied + data. + [Steve Henson] + + *) Fix BN flag handling in RSA_eay_mod_exp() and BN_MONT_CTX_set() + to get the expected BN_FLG_CONSTTIME behavior. + [Bodo Moeller (Google)] + + *) Netware support: + + - fixed wrong usage of ioctlsocket() when build for LIBC BSD sockets + - fixed do_tests.pl to run the test suite with CLIB builds too (CLIB_OPT) + - added some more tests to do_tests.pl + - fixed RunningProcess usage so that it works with newer LIBC NDKs too + - removed usage of BN_LLONG for CLIB builds to avoid runtime dependency + - added new Configure targets netware-clib-bsdsock, netware-clib-gcc, + netware-clib-bsdsock-gcc, netware-libc-bsdsock-gcc + - various changes to netware.pl to enable gcc-cross builds on Win32 + platform + - changed crypto/bio/b_sock.c to work with macro functions (CLIB BSD) + - various changes to fix missing prototype warnings + - fixed x86nasm.pl to create correct asm files for NASM COFF output + - added AES, WHIRLPOOL and CPUID assembler code to build files + - added missing AES assembler make rules to mk1mf.pl + - fixed order of includes in apps/ocsp.c so that e_os.h settings apply + [Guenter Knauf ] + + *) Implement certificate status request TLS extension defined in RFC3546. + A client can set the appropriate parameters and receive the encoded + OCSP response via a callback. A server can query the supplied parameters + and set the encoded OCSP response in the callback. Add simplified examples + to s_client and s_server. + [Steve Henson] + + Changes between 0.9.8f and 0.9.8g [19 Oct 2007] + + *) Fix various bugs: + + Binary incompatibility of ssl_ctx_st structure + + DTLS interoperation with non-compliant servers + + Don't call get_session_cb() without proposed session + + Fix ia64 assembler code + [Andy Polyakov, Steve Henson] + + Changes between 0.9.8e and 0.9.8f [11 Oct 2007] + + *) DTLS Handshake overhaul. There were longstanding issues with + OpenSSL DTLS implementation, which were making it impossible for + RFC 4347 compliant client to communicate with OpenSSL server. + Unfortunately just fixing these incompatibilities would "cut off" + pre-0.9.8f clients. To allow for hassle free upgrade post-0.9.8e + server keeps tolerating non RFC compliant syntax. The opposite is + not true, 0.9.8f client can not communicate with earlier server. + This update even addresses CVE-2007-4995. + [Andy Polyakov] + + *) Changes to avoid need for function casts in OpenSSL: some compilers + (gcc 4.2 and later) reject their use. + [Kurt Roeckx , Peter Hartley , + Steve Henson] + + *) Add RFC4507 support to OpenSSL. This includes the corrections in + RFC4507bis. The encrypted ticket format is an encrypted encoded + SSL_SESSION structure, that way new session features are automatically + supported. + + If a client application caches session in an SSL_SESSION structure + support is transparent because tickets are now stored in the encoded + SSL_SESSION. + + The SSL_CTX structure automatically generates keys for ticket + protection in servers so again support should be possible + with no application modification. + + If a client or server wishes to disable RFC4507 support then the option + SSL_OP_NO_TICKET can be set. + + Add a TLS extension debugging callback to allow the contents of any client + or server extensions to be examined. + + This work was sponsored by Google. + [Steve Henson] + + *) Add initial support for TLS extensions, specifically for the server_name + extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now + have new members for a host name. The SSL data structure has an + additional member SSL_CTX *initial_ctx so that new sessions can be + stored in that context to allow for session resumption, even after the + SSL has been switched to a new SSL_CTX in reaction to a client's + server_name extension. + + New functions (subject to change): + + SSL_get_servername() + SSL_get_servername_type() + SSL_set_SSL_CTX() + + New CTRL codes and macros (subject to change): + + SSL_CTRL_SET_TLSEXT_SERVERNAME_CB + - SSL_CTX_set_tlsext_servername_callback() + SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG + - SSL_CTX_set_tlsext_servername_arg() + SSL_CTRL_SET_TLSEXT_HOSTNAME - SSL_set_tlsext_host_name() + + openssl s_client has a new '-servername ...' option. + + openssl s_server has new options '-servername_host ...', '-cert2 ...', + '-key2 ...', '-servername_fatal' (subject to change). This allows + testing the HostName extension for a specific single host name ('-cert' + and '-key' remain fallbacks for handshakes without HostName + negotiation). If the unrecogninzed_name alert has to be sent, this by + default is a warning; it becomes fatal with the '-servername_fatal' + option. + + [Peter Sylvester, Remy Allais, Christophe Renou, Steve Henson] + + *) Add AES and SSE2 assembly language support to VC++ build. + [Steve Henson] + + *) Mitigate attack on final subtraction in Montgomery reduction. + [Andy Polyakov] + + *) Fix crypto/ec/ec_mult.c to work properly with scalars of value 0 + (which previously caused an internal error). + [Bodo Moeller] + + *) Squeeze another 10% out of IGE mode when in != out. + [Ben Laurie] + + *) AES IGE mode speedup. + [Dean Gaudet (Google)] + + *) Add the Korean symmetric 128-bit cipher SEED (see + http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp) and + add SEED ciphersuites from RFC 4162: + + TLS_RSA_WITH_SEED_CBC_SHA = "SEED-SHA" + TLS_DHE_DSS_WITH_SEED_CBC_SHA = "DHE-DSS-SEED-SHA" + TLS_DHE_RSA_WITH_SEED_CBC_SHA = "DHE-RSA-SEED-SHA" + TLS_DH_anon_WITH_SEED_CBC_SHA = "ADH-SEED-SHA" + + To minimize changes between patchlevels in the OpenSSL 0.9.8 + series, SEED remains excluded from compilation unless OpenSSL + is configured with 'enable-seed'. + [KISA, Bodo Moeller] + + *) Mitigate branch prediction attacks, which can be practical if a + single processor is shared, allowing a spy process to extract + information. For detailed background information, see + http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron, + J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL + and Necessary Software Countermeasures"). The core of the change + are new versions BN_div_no_branch() and + BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(), + respectively, which are slower, but avoid the security-relevant + conditional branches. These are automatically called by BN_div() + and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one + of the input BIGNUMs. Also, BN_is_bit_set() has been changed to + remove a conditional branch. + + BN_FLG_CONSTTIME is the new name for the previous + BN_FLG_EXP_CONSTTIME flag, since it now affects more than just + modular exponentiation. (Since OpenSSL 0.9.7h, setting this flag + in the exponent causes BN_mod_exp_mont() to use the alternative + implementation in BN_mod_exp_mont_consttime().) The old name + remains as a deprecated alias. + + Similary, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general + RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses + constant-time implementations for more than just exponentiation. + Here too the old name is kept as a deprecated alias. + + BN_BLINDING_new() will now use BN_dup() for the modulus so that + the BN_BLINDING structure gets an independent copy of the + modulus. This means that the previous "BIGNUM *m" argument to + BN_BLINDING_new() and to BN_BLINDING_create_param() now + essentially becomes "const BIGNUM *m", although we can't actually + change this in the header file before 0.9.9. It allows + RSA_setup_blinding() to use BN_with_flags() on the modulus to + enable BN_FLG_CONSTTIME. + + [Matthew D Wood (Intel Corp)] + + *) In the SSL/TLS server implementation, be strict about session ID + context matching (which matters if an application uses a single + external cache for different purposes). Previously, + out-of-context reuse was forbidden only if SSL_VERIFY_PEER was + set. This did ensure strict client verification, but meant that, + with applications using a single external cache for quite + different requirements, clients could circumvent ciphersuite + restrictions for a given session ID context by starting a session + in a different context. + [Bodo Moeller] *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that a ciphersuite string such as "DEFAULT:RSA" cannot enable authentication-only ciphersuites. [Bodo Moeller] + *) Update the SSL_get_shared_ciphers() fix CVE-2006-3738 which was + not complete and could lead to a possible single byte overflow + (CVE-2007-5135) [Ben Laurie] + + Changes between 0.9.8d and 0.9.8e [23 Feb 2007] + *) Since AES128 and AES256 (and similarly Camellia128 and Camellia256) share a single mask bit in the logic of ssl/ssl_ciph.c, the code for masking out disabled ciphers needs a @@ -1047,7 +1489,20 @@ differing sizes. [Richard Levitte] - Changes between 0.9.7l and 0.9.7m [xx XXX xxxx] + Changes between 0.9.7m and 0.9.7n [xx XXX xxxx] + + *) In the SSL/TLS server implementation, be strict about session ID + context matching (which matters if an application uses a single + external cache for different purposes). Previously, + out-of-context reuse was forbidden only if SSL_VERIFY_PEER was + set. This did ensure strict client verification, but meant that, + with applications using a single external cache for quite + different requirements, clients could circumvent ciphersuite + restrictions for a given session ID context by starting a session + in a different context. + [Bodo Moeller] + + Changes between 0.9.7l and 0.9.7m [23 Feb 2007] *) Cleanse PEM buffers before freeing them since they may contain sensitive data. @@ -1063,6 +1518,20 @@ kludge to work properly if AES128 is available and AES256 isn't. [Victor Duchovni] + *) Expand security boundary to match 1.1.1 module. + [Steve Henson] + + *) Remove redundant features: hash file source, editing of test vectors + modify fipsld to use external fips_premain.c signature. + [Steve Henson] + + *) New perl script mkfipsscr.pl to create shell scripts or batch files to + run algorithm test programs. + [Steve Henson] + + *) Make algorithm test programs more tolerant of whitespace. + [Steve Henson] + *) Have SSL/TLS server implementation tolerate "mismatched" record protocol version while receiving ClientHello even if the ClientHello is fragmented. (The server can't insist on the Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Sun Jun 14 18:04:22 2009 (r194205) +++ head/crypto/openssl/Configure Sun Jun 14 19:45:16 2009 (r194206) @@ -6,11 +6,13 @@ eval 'exec perl -S $0 ${1+"$@"}' ## require 5.000; -use strict; +eval 'use strict;'; + +print STDERR "Warning: perl module strict not found.\n" if ($@); # see INSTALL for instructions. -my $usage="Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; +my $usage="Usage: Configure [no- ...] [enable- ...] [experimental- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [enable-montasm] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; # Options: # @@ -54,6 +56,8 @@ my $usage="Usage: Configure [no- # [no-]zlib [don't] compile support for zlib compression. # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared # library and will be loaded in run-time by the OpenSSL library. +# enable-montasm 0.9.8 branch only: enable Montgomery x86 assembler backport +# from 0.9.9 # 386 generate 80386 code # no-sse2 disables IA-32 SSE2 code, above option implies no-sse2 # no- build without specified algorithm (rsa, idea, rc5, ...) @@ -97,6 +101,11 @@ my $usage="Usage: Configure [no- # SHA512_ASM sha512_block is implemented in assembler # AES_ASM ASE_[en|de]crypt is implemented in assembler +# Minimum warning options... any contributions to OpenSSL should at least get +# past these. + +my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; + my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; # MD2_CHAR slags pentium pros @@ -114,12 +123,12 @@ my $tlib="-lnsl -lsocket"; my $bits1="THIRTY_TWO_BIT "; my $bits2="SIXTY_FOUR_BIT "; -my $x86_elf_asm="x86cpuid-elf.o:bn86-elf.o co86-elf.o:dx86-elf.o yx86-elf.o:ax86-elf.o:bx86-elf.o:mx86-elf.o:sx86-elf.o s512sse2-elf.o:cx86-elf.o:rx86-elf.o:rm86-elf.o:r586-elf.o"; -my $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o:dx86-cof.o yx86-cof.o:ax86-cof.o:bx86-cof.o:mx86-cof.o:sx86-cof.o s512sse2-cof.o:cx86-cof.o:rx86-cof.o:rm86-cof.o:r586-cof.o"; -my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o:rm86-out.o:r586-out.o"; +my $x86_elf_asm="x86cpuid-elf.o:bn86-elf.o co86-elf.o MAYBE-MO86-elf.o:dx86-elf.o yx86-elf.o:ax86-elf.o:bx86-elf.o:mx86-elf.o:sx86-elf.o s512sse2-elf.o:cx86-elf.o:rx86-elf.o rc4_skey.o:rm86-elf.o:r586-elf.o"; +my $x86_coff_asm="x86cpuid-cof.o:bn86-cof.o co86-cof.o MAYBE-MO86-cof.o:dx86-cof.o yx86-cof.o:ax86-cof.o:bx86-cof.o:mx86-cof.o:sx86-cof.o s512sse2-cof.o:cx86-cof.o:rx86-cof.o rc4_skey.o:rm86-cof.o:r586-cof.o"; +my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o MAYBE-MO86-out.o:dx86-out.o yx86-out.o:ax86-out.o:bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o rc4_skey.o:rm86-out.o:r586-out.o"; -my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o::::md5-x86_64.o:::rc4-x86_64.o::"; -my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o::"; +my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o::"; +my $ia64_asm=":bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o:::sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o::"; my $no_asm="::::::::::"; @@ -150,12 +159,15 @@ my %table=( "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", -"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::::", +"debug-ben-debug", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe::(unknown)::::::", "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", -"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", +"debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", -"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -march=i486 -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", +"debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -m32 -g -pedantic -Wno-long-long -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared", "debug-steve-linux-pseudo64", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DOPENSSL_NO_ASM -g -mcpu=i486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::-rdynamic -ldl:SIXTY_FOUR_BIT:${no_asm}:dlfcn:linux-shared", "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -201,11 +213,11 @@ my %table=( "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", # -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc -"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### "debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### SPARC Solaris with Sun C setups # SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2. @@ -213,11 +225,11 @@ my %table=( # SC5.0 note: Compiler common patch 107357-01 or later is required! "solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", +"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plus -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs", #### "debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::md5-sparcv8plus.o::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### SunOS configs, assuming sparc for the gcc one. #"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::", @@ -231,10 +243,10 @@ my %table=( # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke # './Configure irix-cc -o32' manually. "irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT::bn-mips3.o::::::::::dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", # N64 ABI builds. "irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG::bn-mips3.o::::::::::dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### Unified HP-UX ANSI C configs. # Special notes: @@ -321,8 +333,7 @@ my %table=( "linux-aout", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}", #### "linux-generic64","gcc:-DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -# -bpowerpc64-linux is transient option, -m64 should be the one to use... -"linux-ppc64", "gcc:-bpowerpc64-linux -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-bpowerpc64-linux:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-ppc64", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL::linux_ppc64.o::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -333,9 +344,9 @@ my %table=( "linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", # it's a real mess with -mcpu=ultrasparc option under Linux, but # -Wa,-Av8plus should do the trick no matter what. -"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plus -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", # GCC 3.1 is a requirement -"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::::::::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", #### Alpha Linux with GNU C and Compaq C setups # Special notes: # - linux-alpha+bwx-gcc is ment to be used from ./config only. If you @@ -365,7 +376,7 @@ my %table=( # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it # simply *happens* to work around a compiler bug in gcc 3.3.3, # triggered by RIPEMD160 code. -"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:::des_enc-sparc.o fcrypt_b.o:::md5-sparcv9.o::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:::des_enc-sparc.o fcrypt_b.o:::::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -403,12 +414,12 @@ my %table=( #### IBM's AIX. "aix3-cc", "cc:-O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::BN_LLONG RC4_CHAR:::", -"aix-gcc", "gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:", -"aix64-gcc","gcc:-O -DB_ENDIAN::-D_THREAD_SAFE:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn::::::-X64", +"aix-gcc", "gcc:-O -DB_ENDIAN::-pthread:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +"aix64-gcc","gcc:-maix64 -O -DB_ENDIAN::-pthread:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-maix64 -shared -Wl,-G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X64", # Below targets assume AIX 5. Idea is to effectively disregard $OBJECT_MODE # at build time. $OBJECT_MODE is respected at ./config stage! -"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", -"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384::(unknown):AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", +"aix-cc", "cc:-q32 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::BN_LLONG RC4_CHAR::aix_ppc32.o::::::::::dlfcn:aix-shared::-q32 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 32", +"aix64-cc", "cc:-q64 -O -DB_ENDIAN -qmaxmem=16384 -qro -qroconst::-qthreaded:AIX::SIXTY_FOUR_BIT_LONG RC4_CHAR::aix_ppc64.o::::::::::dlfcn:aix-shared::-q64 -G:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)::-X 64", # # Cray T90 and similar (SDSC) @@ -479,15 +490,20 @@ my %table=( "Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::CYGWIN32::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_coff_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", "debug-Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:::CYGWIN32:::${no_asm}:dlfcn:cygwin-shared:-D_WINDLL:-shared:.dll.a", -# NetWare from David Ward (dsward@novell.com) - requires MetroWerks NLM development tools +# NetWare from David Ward (dsward@novell.com) +# requires either MetroWerks NLM development tools, or gcc / nlmconv +# NetWare defaults socket bio to WinSock sockets. However, +# the builds can be configured to use BSD sockets instead. # netware-clib => legacy CLib c-runtime support -"netware-clib", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", +"netware-clib", "mwccnlm::::::${x86_gcc_opts}::", +"netware-clib-bsdsock", "mwccnlm::::::${x86_gcc_opts}::", +"netware-clib-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -I/ndk/ws295sdk/include -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", +"netware-clib-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/nwsdk/include/nlm -DNETWARE_BSDSOCK -DNETDB_USE_INTERNET -DL_ENDIAN -DNETWARE_CLIB -DOPENSSL_SYSNAME_NETWARE -O2 -Wall:::::${x86_gcc_opts}::", # netware-libc => LibC/NKS support -# NetWare defaults socket bio to WinSock sockets. However, the LibC build can be -# configured to use BSD sockets instead. "netware-libc", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", "netware-libc-bsdsock", "mwccnlm::::::BN_LLONG ${x86_gcc_opts}::", "netware-libc-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -I/ndk/libc/include/winsock -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", +"netware-libc-bsdsock-gcc", "i586-netware-gcc:-nostdinc -I/ndk/libc/include -DNETWARE_BSDSOCK -DL_ENDIAN -DNETWARE_LIBC -DOPENSSL_SYSNAME_NETWARE -DTERMIO -O2 -Wall:::::BN_LLONG ${x86_gcc_opts}::", # DJGPP "DJGPP", "gcc:-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall:::MSDOS:-L/dev/env/WATT_ROOT/lib -lwatt:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:", @@ -500,8 +516,11 @@ my %table=( ##### MacOS X (a.k.a. Rhapsody or Darwin) setup "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", -"darwin-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", -"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -fno-common::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc64.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -fomit-frame-pointer -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::osx_ppc32.o::::::::::dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ##### A/UX @@ -530,7 +549,9 @@ my %table=( my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A VC-NT VC-CE VC-WIN32 - BC-32 OS2-EMX netware-clib netware-libc netware-libc-bsdsock); + BC-32 OS2-EMX + netware-clib netware-clib-bsdsock + netware-libc netware-libc-bsdsock); my $idx = 0; my $idx_cc = $idx++; @@ -563,12 +584,18 @@ my $prefix=""; my $openssldir=""; my $exe_ext=""; my $install_prefix=""; +my $fipslibdir="/usr/local/ssl/fips-1.0/lib/"; +my $nofipscanistercheck=0; +my $fipsdso=0; +my $fipscanisterinternal="n"; +my $baseaddr="0xFB00000"; my $no_threads=0; my $threads=0; my $no_shared=0; # but "no-shared" is default my $zlib=1; # but "no-zlib" is default my $no_krb5=0; # but "no-krb5" is implied unless "--with-krb5-..." is used my $no_rfc3779=1; # but "no-rfc3779" is default +my $montasm=1; # but "no-montasm" is default my $no_asm=0; my $no_dso=0; my $no_gmp=0; @@ -585,10 +612,11 @@ my $rc2 ="crypto/rc2/rc2.h"; my $bf ="crypto/bf/bf_locl.h"; my $bn_asm ="bn_asm.o"; my $des_enc="des_enc.o fcrypt_b.o"; +my $fips_des_enc="fips_des_enc.o"; my $aes_enc="aes_core.o aes_cbc.o"; my $bf_enc ="bf_enc.o"; my $cast_enc="c_enc.o"; -my $rc4_enc="rc4_enc.o"; +my $rc4_enc="rc4_enc.o rc4_skey.o"; my $rc5_enc="rc5_enc.o"; my $md5_obj=""; my $sha1_obj=""; @@ -596,27 +624,40 @@ my $rmd160_obj=""; my $processor=""; my $default_ranlib; my $perl; +my $fips=0; # All of the following is disabled by default (RC5 was enabled before 0.9.8): -my %disabled = ( # "what" => "comment" - "camellia" => "default", - "gmp" => "default", +my %disabled = ( # "what" => "comment" [or special keyword "experimental"] + "camellia" => "default", + "capieng" => "default", + "cms" => "default", + "gmp" => "default", + "jpake" => "experimental", "mdc2" => "default", + "montasm" => "default", # explicit option in 0.9.8 only (implicitly enabled in 0.9.9) "rc5" => "default", - "rfc3779" => "default", + "rfc3779" => "default", + "seed" => "default", "shared" => "default", "zlib" => "default", "zlib-dynamic" => "default" ); +my @experimental = (); + +# This is what $depflags will look like with the above defaults +# (we need this to see if we should advise the user to run "make depend"): +my $default_depflags = " -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED"; + -# Additional "no-..." options will be collected in %disabled. -# To remove something from %disabled, use e.g. "enable-rc5". -# For symmetry, "disable-..." is a synonym for "no-...". +# Explicit "no-..." options will be collected in %disabled along with the defaults. +# To remove something from %disabled, use "enable-foo" (unless it's experimental). +# For symmetry, "disable-foo" is a synonym for "no-foo". -# This is what $depflags will look like with the above default: -my $default_depflags = "-DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 "; +# For features called "experimental" here, a more explicit "experimental-foo" is needed to enable. +# We will collect such requests in @experimental. +# To avoid accidental use of experimental features, applications will have to use -DOPENSSL_EXPERIMENTAL_FOO. my $no_sse2=0; @@ -625,6 +666,7 @@ my $no_sse2=0; my $flags; my $depflags; +my $openssl_experimental_defines; my $openssl_algorithm_defines; my $openssl_thread_defines; my $openssl_sys_defines=""; @@ -645,6 +687,7 @@ while($argv_unprocessed) { $flags=""; $depflags=""; + $openssl_experimental_defines=""; $openssl_algorithm_defines=""; $openssl_thread_defines=""; $openssl_sys_defines=""; @@ -670,25 +713,35 @@ PROCESS_ARGS: if (/^no-(.+)$/ || /^disable-(.+)$/) { - if ($1 eq "ssl") + if (!($disabled{$1} eq "experimental")) { - $disabled{"ssl2"} = "option(ssl)"; - $disabled{"ssl3"} = "option(ssl)"; - } - elsif ($1 eq "tls") - { - $disabled{"tls1"} = "option(tls)" - } - else - { - $disabled{$1} = "option"; + if ($1 eq "ssl") + { + $disabled{"ssl2"} = "option(ssl)"; + $disabled{"ssl3"} = "option(ssl)"; + } + elsif ($1 eq "tls") + { + $disabled{"tls1"} = "option(tls)" + } + else + { + $disabled{$1} = "option"; + } } } - elsif (/^enable-(.+)$/) + elsif (/^enable-(.+)$/ || /^experimental-(.+)$/) { - delete $disabled{$1}; + my $algo = $1; + if ($disabled{$algo} eq "experimental") + { + die "You are requesting an experimental feature; please say 'experimental-$algo' if you are sure\n" + unless (/^experimental-/); + push @experimental, $algo; + } + delete $disabled{$algo}; - $threads = 1 if ($1 eq "threads"); + $threads = 1 if ($algo eq "threads"); } elsif (/^--test-sanity$/) { @@ -719,12 +772,36 @@ PROCESS_ARGS: } elsif (/^386$/) { $processor=386; } + elsif (/^fips$/) + { + $fips=1; + } elsif (/^rsaref$/) { # No RSAref support any more since it's not needed. # The check for the option is there so scripts aren't # broken } + elsif (/^nofipscanistercheck$/) + { + $fips = 1; + $nofipscanistercheck = 1; + } + elsif (/^fipscanisterbuild$/) + { + $fips = 1; + $nofipscanistercheck = 1; + $fipslibdir=""; + $fipscanisterinternal="y"; + } + elsif (/^fipsdso$/) + { + $fips = 1; + $nofipscanistercheck = 1; + $fipslibdir=""; + $fipscanisterinternal="y"; + $fipsdso = 1; + } elsif (/^[-+]/) { if (/^-[lL](.*)$/) @@ -759,6 +836,14 @@ PROCESS_ARGS: { $withargs{"zlib-include"}="-I$1"; } + elsif (/^--with-fipslibdir=(.*)$/) + { + $fipslibdir="$1/"; + } + elsif (/^--with-baseaddr=(.*)$/) + { + $baseaddr="$1"; + } else { print STDERR $usage; @@ -838,6 +923,10 @@ if (defined($disabled{"md5"}) || defined $disabled{"tls1"} = "forced"; } +if (defined($disabled{"tls1"})) + { + $disabled{"tlsext"} = "forced"; + } if ($target eq "TABLE") { foreach $target (sort keys %table) { @@ -862,6 +951,54 @@ print "Configuring for $target\n"; &usage if (!defined($table{$target})); +my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); +my $cc = $fields[$idx_cc]; +# Allow environment CC to override compiler... +if($ENV{CC}) { + $cc = $ENV{CC}; +} +my $cflags = $fields[$idx_cflags]; +my $unistd = $fields[$idx_unistd]; +my $thread_cflag = $fields[$idx_thread_cflag]; +my $sys_id = $fields[$idx_sys_id]; +my $lflags = $fields[$idx_lflags]; +my $bn_ops = $fields[$idx_bn_ops]; +my $cpuid_obj = $fields[$idx_cpuid_obj]; +my $bn_obj = $fields[$idx_bn_obj]; +my $des_obj = $fields[$idx_des_obj]; +my $aes_obj = $fields[$idx_aes_obj]; +my $bf_obj = $fields[$idx_bf_obj]; +my $md5_obj = $fields[$idx_md5_obj]; +my $sha1_obj = $fields[$idx_sha1_obj]; +my $cast_obj = $fields[$idx_cast_obj]; +my $rc4_obj = $fields[$idx_rc4_obj]; +my $rmd160_obj = $fields[$idx_rmd160_obj]; +my $rc5_obj = $fields[$idx_rc5_obj]; +my $dso_scheme = $fields[$idx_dso_scheme]; +my $shared_target = $fields[$idx_shared_target]; +my $shared_cflag = $fields[$idx_shared_cflag]; +my $shared_ldflag = $fields[$idx_shared_ldflag]; +my $shared_extension = $fields[$idx_shared_extension]; +my $ranlib = $fields[$idx_ranlib]; +my $arflags = $fields[$idx_arflags]; + +if ($fips) + { + delete $disabled{"shared"} if ($disabled{"shared"} eq "default"); + $disabled{"asm"}="forced" + if ($target !~ "VC\-.*" && + "$cpuid_obj:$bn_obj:$aes_obj:$des_obj:$sha1_obj" eq "::::"); + } + +foreach (sort @experimental) + { + my $ALGO; + ($ALGO = $_) =~ tr/[a-z]/[A-Z]/; + + # opensslconf.h will set OPENSSL_NO_... unless OPENSSL_EXPERIMENTAL_... is defined + $openssl_experimental_defines .= "#define OPENSSL_NO_$ALGO\n"; + $cflags .= " -DOPENSSL_EXPERIMENTAL_$ALGO"; + } foreach (sort (keys %disabled)) { @@ -877,6 +1014,8 @@ foreach (sort (keys %disabled)) { $no_shared = 1; } elsif (/^zlib$/) { $zlib = 0; } + elsif (/^montasm$/) + { $montasm = 0; } elsif (/^static-engine$/) { } elsif (/^zlib-dynamic$/) @@ -910,7 +1049,7 @@ foreach (sort (keys %disabled)) push @skip, $algo; print " (skip dir)"; - $depflags .="-DOPENSSL_NO_$ALGO "; + $depflags .= " -DOPENSSL_NO_$ALGO"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:46:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25135106568F; Sun, 14 Jun 2009 19:46:19 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 114E28FC17; Sun, 14 Jun 2009 19:46:19 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EJkJwq058347; Sun, 14 Jun 2009 19:46:19 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EJkIeb058337; Sun, 14 Jun 2009 19:46:18 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200906141946.n5EJkIeb058337@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 14 Jun 2009 19:46: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: r194207 - in head/secure: lib/libcrypto usr.bin/openssl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 19:46:20 -0000 Author: simon Date: Sun Jun 14 19:46:18 2009 New Revision: 194207 URL: http://svn.freebsd.org/changeset/base/194207 Log: Update build infrastructure for OpenSSL 0.9.8k. Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/opensslconf-amd64.h head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-i386.h head/secure/lib/libcrypto/opensslconf-ia64.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/usr.bin/openssl/Makefile Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/Makefile Sun Jun 14 19:46:18 2009 (r194207) @@ -21,13 +21,14 @@ MAN+= config.5 des_modes.7 # base sources SRCS= cpt_err.c cryptlib.c cversion.c ebcdic.c ex_data.c mem.c mem_clr.c \ - mem_dbg.c o_dir.c o_str.c o_time.c tmdiff.c uid.c + mem_dbg.c o_dir.c o_str.c o_time.c tmdiff.c uid.c dyn_lck.c \ + o_init.c fips_err.c INCS= crypto.h ebcdic.h opensslv.h ossl_typ.h symhacks.h tmdiff.h \ ../e_os.h ../e_os2.h # aes SRCS+= aes_cbc.c aes_cfb.c aes_core.c aes_ctr.c aes_ecb.c aes_ige.c \ - aes_misc.c aes_ofb.c + aes_misc.c aes_ofb.c aes_wrap.c INCS+= aes.h aes_locl.h # asn1 @@ -36,7 +37,7 @@ SRCS+= a_bitstr.c a_bool.c a_bytes.c a_d a_meth.c a_object.c a_octet.c a_print.c a_set.c a_sign.c \ a_strex.c a_strnid.c a_time.c a_type.c a_utctm.c a_utf8.c \ a_verify.c asn1_err.c asn1_gen.c asn1_lib.c asn1_par.c \ - asn_moid.c asn_pack.c d2i_pr.c d2i_pu.c evp_asn1.c f_enum.c \ + asn_moid.c asn_mime.c asn_pack.c d2i_pr.c d2i_pu.c evp_asn1.c f_enum.c \ f_int.c f_string.c i2d_pr.c i2d_pu.c n_pkey.c nsseq.c p5_pbe.c \ p5_pbev2.c p8_pkey.c t_bitst.c t_crl.c t_pkey.c t_req.c \ t_spki.c t_x509.c t_x509a.c tasn_dec.c tasn_enc.c tasn_fre.c \ @@ -69,9 +70,9 @@ INCS+= bio.h bio_lcl.h # bn SRCS+= bn_add.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_div.c \ bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c \ - bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c \ + bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \ bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \ - bn_sqrt.c bn_word.c + bn_sqrt.c bn_word.c bn_x931p.c .if ${MACHINE_ARCH} == "i386" SRCS+= bn-586.s co-586.s .elif ${MACHINE_ARCH} == "amd64" @@ -83,7 +84,7 @@ SRCS+= bn_asm.c INCS+= bn.h # buffer -SRCS+= buf_err.c buffer.c +SRCS+= buf_err.c buf_str.c buffer.c INCS+= buffer.h # cast @@ -112,7 +113,7 @@ INCS+= conf.h conf_api.h # des SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \ - des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \ + des_lib.c des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \ enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \ ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \ rpc_enc.c set_key.c str2key.c xcbc_enc.c @@ -129,7 +130,7 @@ INCS+= dh.h # dsa SRCS+= dsa_asn1.c dsa_err.c dsa_depr.c dsa_gen.c dsa_key.c dsa_lib.c \ - dsa_ossl.c dsa_sign.c dsa_vrf.c + dsa_ossl.c dsa_sign.c dsa_vrf.c dsa_utl.c INCS+= dsa.h # dso @@ -159,15 +160,15 @@ SRCS+= eng_all.c eng_cnf.c eng_cryptodev INCS+= engine.h # err -SRCS+= err.c err_all.c err_prn.c +SRCS+= err.c err_all.c err_prn.c err_def.c err_str.c err_bio.c INCS+= err.h # evp SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \ - digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \ + dig_eng.c digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \ e_null.c e_old.c e_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c \ - evp_acnf.c evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c \ - evp_pkey.c m_dss.c m_dss1.c m_ecdsa.c m_md2.c m_md4.c m_md5.c \ + evp_acnf.c evp_cnf.c evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c \ + evp_pkey.c e_seed.c enc_min.c m_dss.c m_dss1.c m_ecdsa.c m_md2.c m_md4.c m_md5.c \ m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \ openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \ p_open.c p_seal.c p_sign.c p_verify.c @@ -245,7 +246,7 @@ SRCS+= pqueue.c INCS+= pqueue.h pq_compat.h # rand -SRCS+= md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c +SRCS+= md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c rand_eng.c INCS+= rand.h # rc2 @@ -253,7 +254,7 @@ SRCS+= rc2_cbc.c rc2_ecb.c rc2_skey.c rc INCS+= rc2.h # rc4 -SRCS+= rc4_skey.c +SRCS+= rc4_skey.c rc4_fblk.c .if ${MACHINE_ARCH} == "i386" SRCS+= rc4-586.s .else @@ -277,7 +278,8 @@ INCS+= ripemd.h # rsa SRCS+= rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \ rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \ - rsa_sign.c rsa_ssl.c rsa_depr.c rsa_pss.c rsa_x931.c + rsa_sign.c rsa_ssl.c rsa_depr.c rsa_pss.c rsa_x931.c rsa_x931g.c \ + rsa_eng.c INCS+= rsa.h # sha @@ -324,6 +326,19 @@ SRCS+= pcy_cache.c pcy_data.c pcy_lib.c v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c INCS+= x509v3.h +# cms +#SRCS+= cms_lib.c cms_asn1.c cms_att.c cms_io.c cms_smime.c cms_err.c \ +# cms_sd.c cms_dd.c cms_cd.c cms_env.c cms_enc.c cms_ess.c +#INCS+= cms.h + +# jpake - is marked experimental +#SRCS+= jpake.c jpake_err.c +#INCS+= jpake.h + +# seed +#SRCS+= seed.c seed_ecb.c seed_cbc.c seed_cfb.c seed_ofb.c +#INCS+= seed.h + SRCS+= buildinf.h INCS+= opensslconf.h evp.h INCSDIR= ${INCLUDEDIR}/openssl @@ -392,6 +407,7 @@ _ideapath= ${LCRYPTO_SRC}/crypto/idea ${LCRYPTO_SRC}/crypto/buffer \ ${LCRYPTO_SRC}/crypto/cast \ ${LCRYPTO_SRC}/crypto/camellia \ + ${LCRYPTO_SRC}/crypto/cms \ ${LCRYPTO_SRC}/crypto/comp \ ${LCRYPTO_SRC}/crypto/conf \ ${LCRYPTO_SRC}/crypto/des \ @@ -406,6 +422,7 @@ _ideapath= ${LCRYPTO_SRC}/crypto/idea ${LCRYPTO_SRC}/crypto/evp \ ${LCRYPTO_SRC}/crypto/hmac \ ${_ideapath} \ + ${LCRYPTO_SRC}/crypto/jpake \ ${LCRYPTO_SRC}/crypto/krb5 \ ${LCRYPTO_SRC}/crypto/lhash \ ${LCRYPTO_SRC}/crypto/md2 \ @@ -424,6 +441,7 @@ _ideapath= ${LCRYPTO_SRC}/crypto/idea ${LCRYPTO_SRC}/crypto/rc5 \ ${LCRYPTO_SRC}/crypto/ripemd \ ${LCRYPTO_SRC}/crypto/rsa \ + ${LCRYPTO_SRC}/crypto/seed \ ${LCRYPTO_SRC}/crypto/sha \ ${LCRYPTO_SRC}/crypto/stack \ ${LCRYPTO_SRC}/crypto/store \ Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/Makefile.inc Sun Jun 14 19:46:18 2009 (r194207) @@ -34,7 +34,7 @@ man-update: @(sec=${manpage:E}; \ pod=${manpage:R}.pod; \ cp ${LCRYPTO_DOC}/${_docs}/$$pod .; \ - pod2man --section=$$sec --release="0.9.8e" --center="OpenSSL" \ + pod2man --section=$$sec --release="0.9.8k" --center="OpenSSL" \ $$pod > ${.CURDIR}/man/${manpage}; \ rm -f $$pod; \ ${ECHO} ${manpage}) Modified: head/secure/lib/libcrypto/opensslconf-amd64.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-amd64.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-amd64.h Sun Jun 14 19:46:18 2009 (r194207) @@ -5,10 +5,22 @@ /* OpenSSL was configured with the following options: */ #ifndef OPENSSL_DOING_MAKEDEPEND +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP #endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* The Kerberos 5 support is MIT-specific. */ #ifndef OPENSSL_NO_KRB5 # define OPENSSL_NO_KRB5 Modified: head/secure/lib/libcrypto/opensslconf-arm.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-arm.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-arm.h Sun Jun 14 19:46:18 2009 (r194207) @@ -9,10 +9,22 @@ #ifndef OPENSSL_NO_CAMELLIA # define OPENSSL_NO_CAMELLIA #endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP #endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* The Kerberos 5 support is MIT-specific. */ #ifndef OPENSSL_NO_KRB5 # define OPENSSL_NO_KRB5 Modified: head/secure/lib/libcrypto/opensslconf-i386.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-i386.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-i386.h Sun Jun 14 19:46:18 2009 (r194207) @@ -5,10 +5,22 @@ /* OpenSSL was configured with the following options: */ #ifndef OPENSSL_DOING_MAKEDEPEND +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP #endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* The Kerberos 5 support is MIT-specific. */ #ifndef OPENSSL_NO_KRB5 # define OPENSSL_NO_KRB5 Modified: head/secure/lib/libcrypto/opensslconf-ia64.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-ia64.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-ia64.h Sun Jun 14 19:46:18 2009 (r194207) @@ -9,6 +9,18 @@ #ifndef OPENSSL_NO_CAMELLIA # define OPENSSL_NO_CAMELLIA #endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP Modified: head/secure/lib/libcrypto/opensslconf-mips.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-mips.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-mips.h Sun Jun 14 19:46:18 2009 (r194207) @@ -9,6 +9,18 @@ #ifndef OPENSSL_NO_CAMELLIA # define OPENSSL_NO_CAMELLIA #endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP Modified: head/secure/lib/libcrypto/opensslconf-powerpc.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-powerpc.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-powerpc.h Sun Jun 14 19:46:18 2009 (r194207) @@ -9,6 +9,18 @@ #ifndef OPENSSL_NO_CAMELLIA # define OPENSSL_NO_CAMELLIA #endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP Modified: head/secure/lib/libcrypto/opensslconf-sparc64.h ============================================================================== --- head/secure/lib/libcrypto/opensslconf-sparc64.h Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/lib/libcrypto/opensslconf-sparc64.h Sun Jun 14 19:46:18 2009 (r194207) @@ -9,6 +9,18 @@ #ifndef OPENSSL_NO_CAMELLIA # define OPENSSL_NO_CAMELLIA #endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_CMS +# define OPENSSL_NO_CMS +#endif +/* Disabled by default in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_SEED +# define OPENSSL_NO_SEED +#endif +/* jpake is marked experimental in OpenSSL 0.9.8. */ +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif /* libgmp is not in the FreeBSD base system. */ #ifndef OPENSSL_NO_GMP # define OPENSSL_NO_GMP Modified: head/secure/usr.bin/openssl/Makefile ============================================================================== --- head/secure/usr.bin/openssl/Makefile Sun Jun 14 19:45:16 2009 (r194206) +++ head/secure/usr.bin/openssl/Makefile Sun Jun 14 19:46:18 2009 (r194207) @@ -12,7 +12,7 @@ LDADD= -lssl -lcrypto CFLAGS+= -DMONOLITH -I${.CURDIR} -SRCS+= app_rand.c apps.c asn1pars.c ca.c ciphers.c crl.c crl2p7.c \ +SRCS+= app_rand.c apps.c asn1pars.c ca.c ciphers.c cms.c crl.c crl2p7.c \ dgst.c dh.c dhparam.c dsa.c dsaparam.c ec.c ecparam.c enc.c \ engine.c errstr.c \ gendh.c gendsa.c genrsa.c nseq.c ocsp.c openssl.c passwd.c \ From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:51:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E0531065688; Sun, 14 Jun 2009 19:51:08 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 792318FC17; Sun, 14 Jun 2009 19:51:08 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EJp8QC058564; Sun, 14 Jun 2009 19:51:08 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EJp6uu058508; Sun, 14 Jun 2009 19:51:06 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200906141951.n5EJp6uu058508@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 14 Jun 2009 19:51: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: r194208 - in head/secure: lib/libcrypto/man lib/libssl/man usr.bin/openssl/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: Sun, 14 Jun 2009 19:51:09 -0000 Author: simon Date: Sun Jun 14 19:51:05 2009 New Revision: 194208 URL: http://svn.freebsd.org/changeset/base/194208 Log: Regenerate manual pages for OpenSSL 0.9.8k. Modified: head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/bio.3 head/secure/lib/libcrypto/man/blowfish.3 head/secure/lib/libcrypto/man/bn.3 head/secure/lib/libcrypto/man/bn_internal.3 head/secure/lib/libcrypto/man/buffer.3 head/secure/lib/libcrypto/man/crypto.3 head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 head/secure/lib/libcrypto/man/d2i_X509_CRL.3 head/secure/lib/libcrypto/man/d2i_X509_NAME.3 head/secure/lib/libcrypto/man/d2i_X509_REQ.3 head/secure/lib/libcrypto/man/d2i_X509_SIG.3 head/secure/lib/libcrypto/man/des.3 head/secure/lib/libcrypto/man/dh.3 head/secure/lib/libcrypto/man/dsa.3 head/secure/lib/libcrypto/man/ecdsa.3 head/secure/lib/libcrypto/man/engine.3 head/secure/lib/libcrypto/man/err.3 head/secure/lib/libcrypto/man/evp.3 head/secure/lib/libcrypto/man/hmac.3 head/secure/lib/libcrypto/man/lh_stats.3 head/secure/lib/libcrypto/man/lhash.3 head/secure/lib/libcrypto/man/md5.3 head/secure/lib/libcrypto/man/mdc2.3 head/secure/lib/libcrypto/man/pem.3 head/secure/lib/libcrypto/man/rand.3 head/secure/lib/libcrypto/man/rc4.3 head/secure/lib/libcrypto/man/ripemd.3 head/secure/lib/libcrypto/man/rsa.3 head/secure/lib/libcrypto/man/sha.3 head/secure/lib/libcrypto/man/threads.3 head/secure/lib/libcrypto/man/ui.3 head/secure/lib/libcrypto/man/ui_compat.3 head/secure/lib/libcrypto/man/x509.3 head/secure/lib/libssl/man/SSL_CIPHER_get_name.3 head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libssl/man/SSL_CTX_add_session.3 head/secure/lib/libssl/man/SSL_CTX_ctrl.3 head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 head/secure/lib/libssl/man/SSL_CTX_free.3 head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libssl/man/SSL_CTX_new.3 head/secure/lib/libssl/man/SSL_CTX_sess_number.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libssl/man/SSL_CTX_sessions.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libssl/man/SSL_CTX_set_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_options.3 head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libssl/man/SSL_CTX_set_timeout.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 head/secure/lib/libssl/man/SSL_CTX_set_verify.3 head/secure/lib/libssl/man/SSL_CTX_use_certificate.3 head/secure/lib/libssl/man/SSL_SESSION_free.3 head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_SESSION_get_time.3 head/secure/lib/libssl/man/SSL_accept.3 head/secure/lib/libssl/man/SSL_alert_type_string.3 head/secure/lib/libssl/man/SSL_clear.3 head/secure/lib/libssl/man/SSL_connect.3 head/secure/lib/libssl/man/SSL_do_handshake.3 head/secure/lib/libssl/man/SSL_free.3 head/secure/lib/libssl/man/SSL_get_SSL_CTX.3 head/secure/lib/libssl/man/SSL_get_ciphers.3 head/secure/lib/libssl/man/SSL_get_client_CA_list.3 head/secure/lib/libssl/man/SSL_get_current_cipher.3 head/secure/lib/libssl/man/SSL_get_default_timeout.3 head/secure/lib/libssl/man/SSL_get_error.3 head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 head/secure/lib/libssl/man/SSL_get_ex_new_index.3 head/secure/lib/libssl/man/SSL_get_fd.3 head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 head/secure/lib/libssl/man/SSL_get_peer_certificate.3 head/secure/lib/libssl/man/SSL_get_rbio.3 head/secure/lib/libssl/man/SSL_get_session.3 head/secure/lib/libssl/man/SSL_get_verify_result.3 head/secure/lib/libssl/man/SSL_get_version.3 head/secure/lib/libssl/man/SSL_library_init.3 head/secure/lib/libssl/man/SSL_load_client_CA_file.3 head/secure/lib/libssl/man/SSL_new.3 head/secure/lib/libssl/man/SSL_pending.3 head/secure/lib/libssl/man/SSL_read.3 head/secure/lib/libssl/man/SSL_rstate_string.3 head/secure/lib/libssl/man/SSL_session_reused.3 head/secure/lib/libssl/man/SSL_set_bio.3 head/secure/lib/libssl/man/SSL_set_connect_state.3 head/secure/lib/libssl/man/SSL_set_fd.3 head/secure/lib/libssl/man/SSL_set_session.3 head/secure/lib/libssl/man/SSL_set_shutdown.3 head/secure/lib/libssl/man/SSL_set_verify_result.3 head/secure/lib/libssl/man/SSL_shutdown.3 head/secure/lib/libssl/man/SSL_state_string.3 head/secure/lib/libssl/man/SSL_want.3 head/secure/lib/libssl/man/SSL_write.3 head/secure/lib/libssl/man/d2i_SSL_SESSION.3 head/secure/lib/libssl/man/ssl.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 head/secure/usr.bin/openssl/man/x509v3_config.1 Modified: head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_OBJECT_new 3" -.TH ASN1_OBJECT_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH ASN1_OBJECT_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" ASN1_OBJECT_new, ASN1_OBJECT_free, \- object allocation functions .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/ASN1_STRING_length.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_length.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/ASN1_STRING_length.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_length 3" -.TH ASN1_STRING_length 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH ASN1_STRING_length 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" ASN1_STRING_dup, ASN1_STRING_cmp, ASN1_STRING_set, ASN1_STRING_length, ASN1_STRING_length_set, ASN1_STRING_type, ASN1_STRING_data \- Modified: head/secure/lib/libcrypto/man/ASN1_STRING_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/ASN1_STRING_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_new 3" -.TH ASN1_STRING_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH ASN1_STRING_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" ASN1_STRING_new, ASN1_STRING_type_new, ASN1_STRING_free \- ASN1_STRING allocation functions Modified: head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_STRING_print_ex 3" -.TH ASN1_STRING_print_ex 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH ASN1_STRING_print_ex 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" ASN1_STRING_print_ex, ASN1_STRING_print_ex_fp \- ASN1_STRING output routines. .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 ============================================================================== --- head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "ASN1_generate_nconf 3" -.TH ASN1_generate_nconf 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH ASN1_generate_nconf 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" ASN1_generate_nconf, ASN1_generate_v3 \- ASN1 generation functions .SH "SYNOPSIS" @@ -155,10 +155,8 @@ configuration will be used. The actual data encoded is determined by the string \fBstr\fR and the configuration information. The general format of the string is: -.PP -.Vb 1 -\& B<[modifier,]type[:value]> -.Ve +.IP "\fB[modifier,]type[:value]\fR" 2 +.IX Item "[modifier,]type[:value]" .PP That is zero or more comma separated modifiers followed by a type followed by an optional colon and a value. The formats of \fBtype\fR, @@ -200,12 +198,12 @@ Encodes an \s-1ASN1\s0 \fBGeneralizedTim the format \fB\s-1YYYYMMDDHHMMSSZ\s0\fR. .IP "\fB\s-1OCTETSTRING\s0\fR, \fB\s-1OCT\s0\fR" 2 .IX Item "OCTETSTRING, OCT" -Emcodes an \s-1ASN1\s0 \fB\s-1OCTET\s0 \s-1STRING\s0\fR. \fBvalue\fR represents the contents +Encodes an \s-1ASN1\s0 \fB\s-1OCTET\s0 \s-1STRING\s0\fR. \fBvalue\fR represents the contents of this structure, the format strings \fB\s-1ASCII\s0\fR and \fB\s-1HEX\s0\fR can be used to specify the format of \fBvalue\fR. -.IP "\fB\s-1BITSRING\s0\fR, \fB\s-1BITSTR\s0\fR" 2 -.IX Item "BITSRING, BITSTR" -Emcodes an \s-1ASN1\s0 \fB\s-1BIT\s0 \s-1STRING\s0\fR. \fBvalue\fR represents the contents +.IP "\fB\s-1BITSTRING\s0\fR, \fB\s-1BITSTR\s0\fR" 2 +.IX Item "BITSTRING, BITSTR" +Encodes an \s-1ASN1\s0 \fB\s-1BIT\s0 \s-1STRING\s0\fR. \fBvalue\fR represents the contents of this structure, the format strings \fB\s-1ASCII\s0\fR, \fB\s-1HEX\s0\fR and \fB\s-1BITLIST\s0\fR can be used to specify the format of \fBvalue\fR. .Sp @@ -251,10 +249,11 @@ bits is set to zero. This specifies the format of the ultimate value. It should be followed by a colon and one of the strings \fB\s-1ASCII\s0\fR, \fB\s-1UTF8\s0\fR, \fB\s-1HEX\s0\fR or \fB\s-1BITLIST\s0\fR. .Sp -If no format specifier is included then \fB\s-1ASCII\s0\fR is used. If \fB\s-1UTF8\s0\fR is specified -then the value string must be a valid \fB\s-1UTF8\s0\fR string. For \fB\s-1HEX\s0\fR the output must -be a set of hex digits. \fB\s-1BITLIST\s0\fR (which is only valid for a \s-1BIT\s0 \s-1STRING\s0) is a -comma separated list of set bits. +If no format specifier is included then \fB\s-1ASCII\s0\fR is used. If \fB\s-1UTF8\s0\fR is +specified then the value string must be a valid \fB\s-1UTF8\s0\fR string. For \fB\s-1HEX\s0\fR the +output must be a set of hex digits. \fB\s-1BITLIST\s0\fR (which is only valid for a \s-1BIT\s0 +\&\s-1STRING\s0) is a comma separated list of the indices of the set bits, all other +bits are zero. .SH "EXAMPLES" .IX Header "EXAMPLES" A simple IA5String: @@ -275,16 +274,28 @@ An IA5String explicitly tagged using \s- \& EXPLICIT:0A,IA5STRING:Hello World .Ve .PP +A \s-1BITSTRING\s0 with bits 1 and 5 set and all others zero: +.PP +.Vb 1 +\& FORMAT=BITLIST,BITSTRING:1,5 +.Ve +.PP A more complex example using a config file to produce a \&\s-1SEQUENCE\s0 consiting of a \s-1BOOL\s0 an \s-1OID\s0 and a UTF8String: .PP -asn1 = SEQUENCE:seq_section +.Vb 1 +\& asn1 = SEQUENCE:seq_section +.Ve .PP -[seq_section] +.Vb 1 +\& [seq_section] +.Ve .PP -field1 = \s-1BOOLEAN:TRUE\s0 -field2 = OID:commonName -field3 = UTF8:Third field +.Vb 3 +\& field1 = BOOLEAN:TRUE +\& field2 = OID:commonName +\& field3 = UTF8:Third field +.Ve .PP This example produces an RSAPrivateKey structure, this is the key contained in the file client.pem in all OpenSSL distributions Modified: head/secure/lib/libcrypto/man/BIO_ctrl.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_ctrl.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_ctrl.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_ctrl 3" -.TH BIO_ctrl 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_ctrl 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset, BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close, Modified: head/secure/lib/libcrypto/man/BIO_f_base64.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_base64.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_base64.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_base64 3" -.TH BIO_f_base64 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_base64 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_base64 \- base64 BIO filter .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_f_buffer.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_buffer.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_buffer.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_buffer 3" -.TH BIO_f_buffer 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_buffer 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_buffer \- buffering BIO .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_f_cipher.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_cipher.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_cipher.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_cipher 3" -.TH BIO_f_cipher 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_cipher 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_cipher, BIO_set_cipher, BIO_get_cipher_status, BIO_get_cipher_ctx \- cipher BIO filter .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_f_md.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_md.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_md.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_md 3" -.TH BIO_f_md 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_md 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_md, BIO_set_md, BIO_get_md, BIO_get_md_ctx \- message digest BIO filter .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_f_null.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_null.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_null.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_null 3" -.TH BIO_f_null 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_null 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_null \- null filter .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_f_ssl.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_f_ssl.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_f_ssl.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_f_ssl 3" -.TH BIO_f_ssl 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_f_ssl 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_f_ssl, BIO_set_ssl, BIO_get_ssl, BIO_set_ssl_mode, BIO_set_ssl_renegotiate_bytes, BIO_get_num_renegotiates, BIO_set_ssl_renegotiate_timeout, BIO_new_ssl, Modified: head/secure/lib/libcrypto/man/BIO_find_type.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_find_type.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_find_type.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_find_type 3" -.TH BIO_find_type 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_find_type 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_find_type, BIO_next \- BIO chain traversal .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_new 3" -.TH BIO_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all \- BIO allocation and freeing functions .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_push.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_push.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_push.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_push 3" -.TH BIO_push 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_push 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_push, BIO_pop \- add and remove BIOs from a chain. .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_read.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_read.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_read.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_read 3" -.TH BIO_read 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_read 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_read, BIO_write, BIO_gets, BIO_puts \- BIO I/O functions .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_s_accept.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_accept.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_accept.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_accept 3" -.TH BIO_s_accept 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_accept 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_accept, BIO_set_accept_port, BIO_get_accept_port, BIO_set_nbio_accept, BIO_set_accept_bios, BIO_set_bind_mode, Modified: head/secure/lib/libcrypto/man/BIO_s_bio.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_bio.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_bio.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_bio 3" -.TH BIO_s_bio 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_bio 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_bio, BIO_make_bio_pair, BIO_destroy_bio_pair, BIO_shutdown_wr, BIO_set_write_buf_size, BIO_get_write_buf_size, BIO_new_bio_pair, Modified: head/secure/lib/libcrypto/man/BIO_s_connect.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_connect.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_connect.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_connect 3" -.TH BIO_s_connect 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_connect 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_connect, BIO_set_conn_hostname, BIO_set_conn_port, BIO_set_conn_ip, BIO_set_conn_int_port, BIO_get_conn_hostname, Modified: head/secure/lib/libcrypto/man/BIO_s_fd.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_fd.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_fd.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_fd 3" -.TH BIO_s_fd 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_fd 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_fd, BIO_set_fd, BIO_get_fd, BIO_new_fd \- file descriptor BIO .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_s_file.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_file.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_file.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_file 3" -.TH BIO_s_file 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_file 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_file, BIO_new_file, BIO_new_fp, BIO_set_fp, BIO_get_fp, BIO_read_filename, BIO_write_filename, BIO_append_filename, Modified: head/secure/lib/libcrypto/man/BIO_s_mem.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_mem.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_mem.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_mem 3" -.TH BIO_s_mem 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_mem 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_mem, BIO_set_mem_eof_return, BIO_get_mem_data, BIO_set_mem_buf, BIO_get_mem_ptr, BIO_new_mem_buf \- memory BIO Modified: head/secure/lib/libcrypto/man/BIO_s_null.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_null.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_null.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_null 3" -.TH BIO_s_null 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_null 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_null \- null data sink .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_s_socket.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_s_socket.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_s_socket.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_s_socket 3" -.TH BIO_s_socket 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_s_socket 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_s_socket, BIO_new_socket \- socket BIO .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BIO_set_callback.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_set_callback.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_set_callback.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_set_callback 3" -.TH BIO_set_callback 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_set_callback 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_set_callback, BIO_get_callback, BIO_set_callback_arg, BIO_get_callback_arg, BIO_debug_callback \- BIO callback functions Modified: head/secure/lib/libcrypto/man/BIO_should_retry.3 ============================================================================== --- head/secure/lib/libcrypto/man/BIO_should_retry.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BIO_should_retry.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BIO_should_retry 3" -.TH BIO_should_retry 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BIO_should_retry 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BIO_should_retry, BIO_should_read, BIO_should_write, BIO_should_io_special, BIO_retry_type, BIO_should_retry, Modified: head/secure/lib/libcrypto/man/BN_BLINDING_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_BLINDING_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_BLINDING_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_BLINDING_new 3" -.TH BN_BLINDING_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_BLINDING_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert, BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex, Modified: head/secure/lib/libcrypto/man/BN_CTX_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_CTX_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_CTX_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_CTX_new 3" -.TH BN_CTX_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_CTX_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_CTX_new, BN_CTX_init, BN_CTX_free \- allocate and free BN_CTX structures .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_CTX_start.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_CTX_start.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_CTX_start.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_CTX_start 3" -.TH BN_CTX_start 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_CTX_start 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_CTX_start, BN_CTX_get, BN_CTX_end \- use temporary BIGNUM variables .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_add.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_add.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_add.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_add 3" -.TH BN_add 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_add 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_add, BN_sub, BN_mul, BN_sqr, BN_div, BN_mod, BN_nnmod, BN_mod_add, BN_mod_sub, BN_mod_mul, BN_mod_sqr, BN_exp, BN_mod_exp, BN_gcd \- Modified: head/secure/lib/libcrypto/man/BN_add_word.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_add_word.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_add_word.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_add_word 3" -.TH BN_add_word 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_add_word 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_add_word, BN_sub_word, BN_mul_word, BN_div_word, BN_mod_word \- arithmetic functions on BIGNUMs with integers Modified: head/secure/lib/libcrypto/man/BN_bn2bin.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_bn2bin.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_bn2bin.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_bn2bin 3" -.TH BN_bn2bin 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_bn2bin 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_bn2bin, BN_bin2bn, BN_bn2hex, BN_bn2dec, BN_hex2bn, BN_dec2bn, BN_print, BN_print_fp, BN_bn2mpi, BN_mpi2bn \- format conversions Modified: head/secure/lib/libcrypto/man/BN_cmp.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_cmp.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_cmp.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_cmp 3" -.TH BN_cmp 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_cmp 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_cmp, BN_ucmp, BN_is_zero, BN_is_one, BN_is_word, BN_is_odd \- BIGNUM comparison and test functions .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_copy.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_copy.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_copy.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_copy 3" -.TH BN_copy 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_copy 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_copy, BN_dup \- copy BIGNUMs .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_generate_prime.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_generate_prime.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_generate_prime.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_generate_prime 3" -.TH BN_generate_prime 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_generate_prime 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_generate_prime, BN_is_prime, BN_is_prime_fasttest \- generate primes and test for primality .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_mod_inverse.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_inverse.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_mod_inverse.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_inverse 3" -.TH BN_mod_inverse 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_mod_inverse 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_mod_inverse \- compute inverse modulo n .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_mul_montgomery 3" -.TH BN_mod_mul_montgomery 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_mod_mul_montgomery 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_mod_mul_montgomery, BN_MONT_CTX_new, BN_MONT_CTX_init, BN_MONT_CTX_free, BN_MONT_CTX_set, BN_MONT_CTX_copy, Modified: head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_mod_mul_reciprocal 3" -.TH BN_mod_mul_reciprocal 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_mod_mul_reciprocal 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_mod_mul_reciprocal, BN_div_recp, BN_RECP_CTX_new, BN_RECP_CTX_init, BN_RECP_CTX_free, BN_RECP_CTX_set \- modular multiplication using Modified: head/secure/lib/libcrypto/man/BN_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_new 3" -.TH BN_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_new, BN_init, BN_clear, BN_free, BN_clear_free \- allocate and free BIGNUMs .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_num_bytes.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_num_bytes.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_num_bytes.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_num_bytes 3" -.TH BN_num_bytes 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_num_bytes 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_num_bits, BN_num_bytes, BN_num_bits_word \- get BIGNUM size .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_rand.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_rand.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_rand.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_rand 3" -.TH BN_rand 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_rand 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_rand, BN_pseudo_rand \- generate pseudo\-random number .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_set_bit.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_set_bit.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_set_bit.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_set_bit 3" -.TH BN_set_bit 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_set_bit 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_set_bit, BN_clear_bit, BN_is_bit_set, BN_mask_bits, BN_lshift, BN_lshift1, BN_rshift, BN_rshift1 \- bit operations on BIGNUMs Modified: head/secure/lib/libcrypto/man/BN_swap.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_swap.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_swap.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_swap 3" -.TH BN_swap 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_swap 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_swap \- exchange BIGNUMs .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/BN_zero.3 ============================================================================== --- head/secure/lib/libcrypto/man/BN_zero.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/BN_zero.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "BN_zero 3" -.TH BN_zero 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH BN_zero 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" BN_zero, BN_one, BN_value_one, BN_set_word, BN_get_word \- BIGNUM assignment operations Modified: head/secure/lib/libcrypto/man/CONF_modules_free.3 ============================================================================== --- head/secure/lib/libcrypto/man/CONF_modules_free.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/CONF_modules_free.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "CONF_modules_free 3" -.TH CONF_modules_free 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH CONF_modules_free 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" .Vb 2 \& CONF_modules_free, CONF_modules_finish, CONF_modules_unload - Modified: head/secure/lib/libcrypto/man/CONF_modules_load_file.3 ============================================================================== --- head/secure/lib/libcrypto/man/CONF_modules_load_file.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/CONF_modules_load_file.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "CONF_modules_load_file 3" -.TH CONF_modules_load_file 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH CONF_modules_load_file 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" .Vb 1 \& CONF_modules_load_file, CONF_modules_load - OpenSSL configuration functions Modified: head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 ============================================================================== --- head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "CRYPTO_set_ex_data 3" -.TH CRYPTO_set_ex_data 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH CRYPTO_set_ex_data 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" CRYPTO_set_ex_data, CRYPTO_get_ex_data \- internal application specific data functions .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DH_generate_key.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_generate_key.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_generate_key.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_generate_key 3" -.TH DH_generate_key 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_generate_key 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_generate_key, DH_compute_key \- perform Diffie\-Hellman key exchange .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DH_generate_parameters.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_generate_parameters.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_generate_parameters.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_generate_parameters 3" -.TH DH_generate_parameters 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_generate_parameters 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_generate_parameters, DH_check \- generate and check Diffie\-Hellman parameters .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_get_ex_new_index.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_get_ex_new_index 3" -.TH DH_get_ex_new_index 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_get_ex_new_index 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data \- add application specific data to DH structures .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DH_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_new 3" -.TH DH_new 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_new 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_new, DH_free \- allocate and free DH objects .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DH_set_method.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_set_method.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_set_method.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_set_method 3" -.TH DH_set_method 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_set_method 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_set_default_method, DH_get_default_method, DH_set_method, DH_new_method, DH_OpenSSL \- select DH method @@ -175,7 +175,7 @@ structures created later. \fB\s-1NB\s0\f as a default for \s-1DH\s0, so this function is no longer recommended. .PP \&\fIDH_get_default_method()\fR returns a pointer to the current default \s-1DH_METHOD\s0. -However, the meaningfulness of this result is dependant on whether the \s-1ENGINE\s0 +However, the meaningfulness of this result is dependent on whether the \s-1ENGINE\s0 \&\s-1API\s0 is being used, so this function is no longer recommended. .PP \&\fIDH_set_method()\fR selects \fBmeth\fR to perform all operations using the key \fBdh\fR. Modified: head/secure/lib/libcrypto/man/DH_size.3 ============================================================================== --- head/secure/lib/libcrypto/man/DH_size.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DH_size.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "DH_size 3" -.TH DH_size 3 "2007-03-15" "0.9.8e" "OpenSSL" +.TH DH_size 3 "2009-06-14" "0.9.8k" "OpenSSL" .SH "NAME" DH_size \- get Diffie\-Hellman prime size .SH "SYNOPSIS" Modified: head/secure/lib/libcrypto/man/DSA_SIG_new.3 ============================================================================== --- head/secure/lib/libcrypto/man/DSA_SIG_new.3 Sun Jun 14 19:46:18 2009 (r194207) +++ head/secure/lib/libcrypto/man/DSA_SIG_new.3 Sun Jun 14 19:51:05 2009 (r194208) @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.35 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:51:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5170D106566C; Sun, 14 Jun 2009 19:51:44 +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 3E80B8FC13; Sun, 14 Jun 2009 19:51:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EJpiYv058619; Sun, 14 Jun 2009 19:51:44 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EJphEV058615; Sun, 14 Jun 2009 19:51:43 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906141951.n5EJphEV058615@svn.freebsd.org> From: Alan Cox Date: Sun, 14 Jun 2009 19:51: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: r194209 - in head/sys: amd64/amd64 i386/i386 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: Sun, 14 Jun 2009 19:51:45 -0000 Author: alc Date: Sun Jun 14 19:51:43 2009 New Revision: 194209 URL: http://svn.freebsd.org/changeset/base/194209 Log: Long, long ago in r27464 special case code for mapping device-backed memory with 4MB pages was added to pmap_object_init_pt(). This code assumes that the pages of a OBJT_DEVICE object are always physically contiguous. Unfortunately, this is not always the case. For example, jhb@ informs me that the recently introduced /dev/ksyms driver creates a OBJT_DEVICE object that violates this assumption. Thus, this revision modifies pmap_object_init_pt() to abort the mapping if the OBJT_DEVICE object's pages are not physically contiguous. This revision also changes some inconsistent if not buggy behavior. For example, the i386 version aborts if the first 4MB virtual page that would be mapped is already valid. However, it incorrectly replaces any subsequent 4MB virtual page mappings that it encounters, potentially leaking a page table page. The amd64 version has a bug of my own creation. It potentially busies the wrong page and always an insufficent number of pages if it blocks allocating a page table page. To my knowledge, there have been no reports of these bugs, hence, their persistance. I suspect that the existing restrictions that pmap_object_init_pt() placed on the OBJT_DEVICE objects that it would choose to map, for example, that the first page must be aligned on a 2 or 4MB physical boundary and that the size of the mapping must be a multiple of the large page size, were enough to avoid triggering the bug for drivers like ksyms. However, one side effect of testing the OBJT_DEVICE object's pages for physical contiguity is that a dubious difference between pmap_object_init_pt() and the standard path for mapping devices pages, i.e., vm_fault(), has been eliminated. Previously, pmap_object_init_pt() would only instantiate the first PG_FICTITOUS page being mapped because it never examined the rest. Now, however, pmap_object_init_pt() uses the new function vm_object_populate() to instantiate them all (in order to support testing their physical contiguity). These pages need to be instantiated for the mechanism that I have prototyped for automatically maintaining the consistency of the PAT settings across multiple mappings, particularly, amd64's direct mapping, to work. (Translation: This change is also being made to support jhb@'s work on the Nvidia feature requests.) Discussed with: jhb@ Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Jun 14 19:51:05 2009 (r194208) +++ head/sys/amd64/amd64/pmap.c Sun Jun 14 19:51:43 2009 (r194209) @@ -3322,78 +3322,74 @@ void pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_pindex_t pindex, vm_size_t size) { - vm_offset_t va; + pd_entry_t *pde; + vm_paddr_t pa, ptepa; vm_page_t p, pdpg; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT(object->type == OBJT_DEVICE, ("pmap_object_init_pt: non-device object")); - if (((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { - vm_page_t m[1]; - pd_entry_t ptepa, *pde; - - PMAP_LOCK(pmap); - pde = pmap_pde(pmap, addr); - if (pde != 0 && (*pde & PG_V) != 0) - goto out; - PMAP_UNLOCK(pmap); -retry: + if ((addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { + if (!vm_object_populate(object, pindex, pindex + atop(size))) + return; p = vm_page_lookup(object, pindex); - if (p != NULL) { - if (vm_page_sleep_if_busy(p, FALSE, "init4p")) - goto retry; - } else { - p = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); - if (p == NULL) - return; - m[0] = p; - - if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) { - vm_page_lock_queues(); - vm_page_free(p); - vm_page_unlock_queues(); - return; - } - - p = vm_page_lookup(object, pindex); - vm_page_wakeup(p); - } + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + /* + * Abort the mapping if the first page is not physically + * aligned to a 2MB page boundary. + */ ptepa = VM_PAGE_TO_PHYS(p); if (ptepa & (NBPDR - 1)) return; - p->valid = VM_PAGE_BITS_ALL; + /* + * Skip the first page. Abort the mapping if the rest of + * the pages are not physically contiguous. + */ + p = TAILQ_NEXT(p, listq); + for (pa = ptepa + PAGE_SIZE; pa < ptepa + size; + pa += PAGE_SIZE) { + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + if (pa != VM_PAGE_TO_PHYS(p)) + return; + p = TAILQ_NEXT(p, listq); + } + /* Map using 2MB pages. */ PMAP_LOCK(pmap); - for (va = addr; va < addr + size; va += NBPDR) { - while ((pdpg = - pmap_allocpde(pmap, va, M_NOWAIT)) == NULL) { - PMAP_UNLOCK(pmap); - vm_page_busy(p); - VM_OBJECT_UNLOCK(object); - VM_WAIT; - VM_OBJECT_LOCK(object); - vm_page_wakeup(p); - PMAP_LOCK(pmap); + for (pa = ptepa; pa < ptepa + size; pa += NBPDR) { + pdpg = pmap_allocpde(pmap, addr, M_NOWAIT); + if (pdpg == NULL) { + /* + * The creation of mappings below is only an + * optimization. If a page directory page + * cannot be allocated without blocking, + * continue on to the next mapping rather than + * blocking. + */ + addr += NBPDR; + continue; } pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); - pde = &pde[pmap_pde_index(va)]; + pde = &pde[pmap_pde_index(addr)]; if ((*pde & PG_V) == 0) { - pde_store(pde, ptepa | PG_PS | PG_M | PG_A | + pde_store(pde, pa | PG_PS | PG_M | PG_A | PG_U | PG_RW | PG_V); - pmap->pm_stats.resident_count += - NBPDR / PAGE_SIZE; + pmap->pm_stats.resident_count += NBPDR / + PAGE_SIZE; + pmap_pde_mappings++; } else { + /* Continue on if the PDE is already valid. */ pdpg->wire_count--; KASSERT(pdpg->wire_count > 0, ("pmap_object_init_pt: missing reference " - "to page directory page, va: 0x%lx", va)); + "to page directory page, va: 0x%lx", addr)); } - ptepa += NBPDR; + addr += NBPDR; } - pmap_invalidate_all(pmap); -out: PMAP_UNLOCK(pmap); } } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Jun 14 19:51:05 2009 (r194208) +++ head/sys/i386/i386/pmap.c Sun Jun 14 19:51:43 2009 (r194209) @@ -3442,62 +3442,57 @@ void pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_object_t object, vm_pindex_t pindex, vm_size_t size) { + pd_entry_t *pde; + vm_paddr_t pa, ptepa; vm_page_t p; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT(object->type == OBJT_DEVICE, ("pmap_object_init_pt: non-device object")); if (pseflag && - ((addr & (NBPDR - 1)) == 0) && ((size & (NBPDR - 1)) == 0)) { - int i; - vm_page_t m[1]; - unsigned int ptepindex; - int npdes; - pd_entry_t ptepa; - - PMAP_LOCK(pmap); - if (pmap->pm_pdir[ptepindex = (addr >> PDRSHIFT)]) - goto out; - PMAP_UNLOCK(pmap); -retry: + (addr & (NBPDR - 1)) == 0 && (size & (NBPDR - 1)) == 0) { + if (!vm_object_populate(object, pindex, pindex + atop(size))) + return; p = vm_page_lookup(object, pindex); - if (p != NULL) { - if (vm_page_sleep_if_busy(p, FALSE, "init4p")) - goto retry; - } else { - p = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); - if (p == NULL) - return; - m[0] = p; - - if (vm_pager_get_pages(object, m, 1, 0) != VM_PAGER_OK) { - vm_page_lock_queues(); - vm_page_free(p); - vm_page_unlock_queues(); - return; - } - - p = vm_page_lookup(object, pindex); - vm_page_wakeup(p); - } + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + /* + * Abort the mapping if the first page is not physically + * aligned to a 2/4MB page boundary. + */ ptepa = VM_PAGE_TO_PHYS(p); if (ptepa & (NBPDR - 1)) return; - p->valid = VM_PAGE_BITS_ALL; + /* + * Skip the first page. Abort the mapping if the rest of + * the pages are not physically contiguous. + */ + p = TAILQ_NEXT(p, listq); + for (pa = ptepa + PAGE_SIZE; pa < ptepa + size; + pa += PAGE_SIZE) { + KASSERT(p->valid == VM_PAGE_BITS_ALL, + ("pmap_object_init_pt: invalid page %p", p)); + if (pa != VM_PAGE_TO_PHYS(p)) + return; + p = TAILQ_NEXT(p, listq); + } + /* Map using 2/4MB pages. */ PMAP_LOCK(pmap); - pmap->pm_stats.resident_count += size >> PAGE_SHIFT; - npdes = size >> PDRSHIFT; - for(i = 0; i < npdes; i++) { - pde_store(&pmap->pm_pdir[ptepindex], - ptepa | PG_U | PG_RW | PG_V | PG_PS); - ptepa += NBPDR; - ptepindex += 1; + for (pa = ptepa; pa < ptepa + size; pa += NBPDR) { + pde = pmap_pde(pmap, addr); + if (*pde == 0) { + pde_store(pde, pa | PG_PS | PG_M | PG_A | + PG_U | PG_RW | PG_V); + pmap->pm_stats.resident_count += NBPDR / + PAGE_SIZE; + pmap_pde_mappings++; + } + /* Else continue on if the PDE is already valid. */ + addr += NBPDR; } - pmap_invalidate_all(pmap); -out: PMAP_UNLOCK(pmap); } } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jun 14 19:51:05 2009 (r194208) +++ head/sys/vm/vm_object.c Sun Jun 14 19:51:43 2009 (r194209) @@ -1931,6 +1931,55 @@ skipmemq: } /* + * Populate the specified range of the object with valid pages. Returns + * TRUE if the range is successfully populated and FALSE otherwise. + * + * Note: This function should be optimized to pass a larger array of + * pages to vm_pager_get_pages() before it is applied to a non- + * OBJT_DEVICE object. + * + * The object must be locked. + */ +boolean_t +vm_object_populate(vm_object_t object, vm_pindex_t start, vm_pindex_t end) +{ + vm_page_t m, ma[1]; + vm_pindex_t pindex; + int rv; + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + for (pindex = start; pindex < end; pindex++) { + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | + VM_ALLOC_RETRY); + if (m->valid != VM_PAGE_BITS_ALL) { + ma[0] = m; + rv = vm_pager_get_pages(object, ma, 1, 0); + m = vm_page_lookup(object, pindex); + if (m == NULL) + break; + if (rv != VM_PAGER_OK) { + vm_page_lock_queues(); + vm_page_free(m); + vm_page_unlock_queues(); + break; + } + } + /* + * Keep "m" busy because a subsequent iteration may unlock + * the object. + */ + } + if (pindex > start) { + m = vm_page_lookup(object, start); + while (m != NULL && m->pindex < pindex) { + vm_page_wakeup(m); + m = TAILQ_NEXT(m, listq); + } + } + return (pindex == end); +} + +/* * Routine: vm_object_coalesce * Function: Coalesces two objects backing up adjoining * regions of memory into a single object. Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Jun 14 19:51:05 2009 (r194208) +++ head/sys/vm/vm_object.h Sun Jun 14 19:51:43 2009 (r194209) @@ -207,6 +207,7 @@ void vm_object_set_writeable_dirty (vm_o void vm_object_init (void); void vm_object_page_clean (vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t); void vm_object_page_remove (vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t); +boolean_t vm_object_populate(vm_object_t, vm_pindex_t, vm_pindex_t); void vm_object_reference (vm_object_t); void vm_object_reference_locked(vm_object_t); void vm_object_shadow (vm_object_t *, vm_ooffset_t *, vm_size_t); From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 19:53:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A0E1065672; Sun, 14 Jun 2009 19:53:52 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C451C8FC1F; Sun, 14 Jun 2009 19:53:52 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EJrqTn058710; Sun, 14 Jun 2009 19:53:52 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EJrqg5058709; Sun, 14 Jun 2009 19:53:52 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200906141953.n5EJrqg5058709@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 14 Jun 2009 19:53: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: r194210 - 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: Sun, 14 Jun 2009 19:53:53 -0000 Author: simon Date: Sun Jun 14 19:53:52 2009 New Revision: 194210 URL: http://svn.freebsd.org/changeset/base/194210 Log: Bump __FreeBSD_version for OpenSSL 0.9.8k import. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jun 14 19:51:43 2009 (r194209) +++ head/sys/sys/param.h Sun Jun 14 19:53:52 2009 (r194210) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ +#define __FreeBSD_version 800098 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 21:14:01 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A187106564A; Sun, 14 Jun 2009 21:14:01 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from phoebe.cse.buffalo.edu (phoebe.cse.buffalo.edu [128.205.32.89]) by mx1.freebsd.org (Postfix) with ESMTP id E58528FC1F; Sun, 14 Jun 2009 21:14:00 +0000 (UTC) (envelope-from kensmith@cse.Buffalo.EDU) Received: from [192.168.1.101] (cpe-74-77-179-53.buffalo.res.rr.com [74.77.179.53]) (authenticated bits=0) by phoebe.cse.buffalo.edu (8.14.1/8.13.7) with ESMTP id n5ELDxeY078386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Jun 2009 17:13:59 -0400 (EDT) (envelope-from kensmith@cse.buffalo.edu) From: Ken Smith To: "Simon L. Nielsen" In-Reply-To: <200906141953.n5EJrqg5058709@svn.freebsd.org> References: <200906141953.n5EJrqg5058709@svn.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-IQcsuVPrVZ+yjbr2fmYi" Date: Sun, 14 Jun 2009 17:13:50 -0400 Message-Id: <1245014030.12125.34.camel@neo.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port X-DCC-Buffalo.EDU-Metrics: phoebe.cse.buffalo.edu 1029; Body=0 Fuz1=0 Fuz2=0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194210 - 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: Sun, 14 Jun 2009 21:14:01 -0000 --=-IQcsuVPrVZ+yjbr2fmYi Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2009-06-14 at 19:53 +0000, Simon L. Nielsen wrote: > Author: simon > Date: Sun Jun 14 19:53:52 2009 > New Revision: 194210 > URL: http://svn.freebsd.org/changeset/base/194210 >=20 > Log: > Bump __FreeBSD_version for OpenSSL 0.9.8k import. >=20 > Modified: > head/sys/sys/param.h >=20 > Modified: head/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/param.h Sun Jun 14 19:51:43 2009 (r194209) > +++ head/sys/sys/param.h Sun Jun 14 19:53:52 2009 (r194210) > @@ -57,7 +57,7 @@ > * is created, otherwise 1. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ > +#define __FreeBSD_version 800098 /* Master, propagated to newvers */ > =20 > #ifndef LOCORE > #include It's been suggested we change the heuristic to be stable branches start with 200. I think we're going to do that so don't panic about there only being one number left for changes between now and the time we branch. At first it surprised me we ate through almost 100 version numbers in head, which is a place traditionally abi changes are *expected* and the attitude has more or less been head is a free-for-all with all bets off. But some IRC chatter enlightened me to there actually being people who do advanced testing of ports and whatnot in head under the encouragement of portmgr@ despite its free-for-all nature to try and cut down on work during later stages of the release. That seems reasonable so I think in general starting to give more than 100 bumps to work with in head is worthwhile. Thanks... --=20 Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-IQcsuVPrVZ+yjbr2fmYi Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAko1aA4ACgkQ/G14VSmup/bZtQCeOftHYhxBKGXquOhjiu6DX2x6 oqIAnjjacppTk9NUTIeM1nnutLhapqYN =cAQM -----END PGP SIGNATURE----- --=-IQcsuVPrVZ+yjbr2fmYi-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 21:22:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5CD6106566B; Sun, 14 Jun 2009 21:22:24 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD5F8FC18; Sun, 14 Jun 2009 21:22:24 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from Macintosh-4.local ([10.0.0.200]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n5ELMN8w058354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Jun 2009 14:22:23 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4A356A0F.3050800@freebsd.org> Date: Sun, 14 Jun 2009 14:22:23 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Ed Schouten References: <200906141801.n5EI1Zti056239@svn.freebsd.org> In-Reply-To: <200906141801.n5EI1Zti056239@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 21:22:25 -0000 Ed Schouten wrote: > Author: ed > Date: Sun Jun 14 18:01:35 2009 > New Revision: 194204 > URL: http://svn.freebsd.org/changeset/base/194204 > > Log: > Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. > > In the past there have been some reports of PRINTF_BUFR_SIZE not > functioning correctly. Instead of having garbled console messages, we > should just see whether the issues are still there and analyze them. > When I suggested enabling this by default for SMP configurations I was reminded it wasn't enabled because of potential stack overflow. Sam From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 21:39:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C92E106566C; Sun, 14 Jun 2009 21:39:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9D48FC14; Sun, 14 Jun 2009 21:39:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ELdrGV061833; Sun, 14 Jun 2009 21:39:53 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ELdr3N061830; Sun, 14 Jun 2009 21:39:53 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906142139.n5ELdr3N061830@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 14 Jun 2009 21:39: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: r194217 - in head: usr.bin/make usr.sbin/mount_portalfs usr.sbin/ngctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 21:39:54 -0000 Author: des Date: Sun Jun 14 21:39:52 2009 New Revision: 194217 URL: http://svn.freebsd.org/changeset/base/194217 Log: Add volatile to sig_atomic_t where it was missing. MFC after: 1 week Modified: head/usr.bin/make/job.c head/usr.sbin/mount_portalfs/mount_portalfs.c head/usr.sbin/ngctl/main.c Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Sun Jun 14 21:16:23 2009 (r194216) +++ head/usr.bin/make/job.c Sun Jun 14 21:39:52 2009 (r194217) @@ -342,7 +342,7 @@ static int fifoFd; /* Fd of our job fif static char fifoName[] = "/tmp/make_fifo_XXXXXXXXX"; static int fifoMaster; -static sig_atomic_t interrupted; +static volatile sig_atomic_t interrupted; #if defined(USE_PGRP) && defined(SYSV) Modified: head/usr.sbin/mount_portalfs/mount_portalfs.c ============================================================================== --- head/usr.sbin/mount_portalfs/mount_portalfs.c Sun Jun 14 21:16:23 2009 (r194216) +++ head/usr.sbin/mount_portalfs/mount_portalfs.c Sun Jun 14 21:39:52 2009 (r194217) @@ -70,7 +70,7 @@ struct mntopt mopts[] = { static void usage(void) __dead2; -static sig_atomic_t readcf; /* Set when SIGHUP received */ +static volatile sig_atomic_t readcf; /* Set when SIGHUP received */ static void sighup(int sig __unused) { Modified: head/usr.sbin/ngctl/main.c ============================================================================== --- head/usr.sbin/ngctl/main.c Sun Jun 14 21:16:23 2009 (r194216) +++ head/usr.sbin/ngctl/main.c Sun Jun 14 21:39:52 2009 (r194217) @@ -79,7 +79,7 @@ static int ReadCmd(int ac, char **av); static int HelpCmd(int ac, char **av); static int QuitCmd(int ac, char **av); #ifdef EDITLINE -static sig_atomic_t unblock; +static volatile sig_atomic_t unblock; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; #endif From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 22:03:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1937B106566C; Sun, 14 Jun 2009 22:03:52 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id AAE9F8FC0A; Sun, 14 Jun 2009 22:03:51 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 970ED1CC8D; Mon, 15 Jun 2009 00:03:50 +0200 (CEST) Date: Mon, 15 Jun 2009 00:03:50 +0200 From: Ed Schouten To: Sam Leffler Message-ID: <20090614220350.GQ48776@hoeg.nl> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XV2oFgeyH+4vHrAu" Content-Disposition: inline In-Reply-To: <4A356A0F.3050800@freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 22:03:52 -0000 --XV2oFgeyH+4vHrAu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Sam, * Sam Leffler wrote: > When I suggested enabling this by default for SMP configurations I was > reminded it wasn't enabled because of potential stack overflow. I entirely agree it is a stack hog, but people have demonstrated in the past that there are a lot of other functions in the kernel that are a lot worse. Even the old TTY code had a 384 buffer on stack and nobody cared about it for 20 years. I wouldn't have a problem disabling it again after we've branched stable/8, but I think we should at least let people test it and see whether we can get it into the release. --=20 Ed Schouten WWW: http://80386.nl/ --XV2oFgeyH+4vHrAu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko1c8YACgkQ52SDGA2eCwWLkgCeMVy1I8fqef5NiUzZjifxyF9t CvkAnjC9rSOjolGpr0Q1x+qwiXFYjieu =w23J -----END PGP SIGNATURE----- --XV2oFgeyH+4vHrAu-- From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 22:35:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90B9B106566B; Sun, 14 Jun 2009 22:35:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5FC8FC13; Sun, 14 Jun 2009 22:35:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EMZYoM064018; Sun, 14 Jun 2009 22:35:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EMZXnd064011; Sun, 14 Jun 2009 22:35:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906142235.n5EMZXnd064011@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Jun 2009 22:35:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194218 - in head/etc: etc.amd64 etc.arm etc.i386 etc.ia64 etc.mips etc.powerpc etc.sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 22:35:35 -0000 Author: ed Date: Sun Jun 14 22:35:33 2009 New Revision: 194218 URL: http://svn.freebsd.org/changeset/base/194218 Log: Remove the note about using vt220, which makes no sense at all. vt220 will not work better. Even though it probably will remove warnings about unknown terminal types, a cons25 emulator is not compatible with vt220 at all. Modified: head/etc/etc.amd64/ttys head/etc/etc.arm/ttys head/etc/etc.i386/ttys head/etc/etc.ia64/ttys head/etc/etc.mips/ttys head/etc/etc.powerpc/ttys head/etc/etc.sparc64/ttys Modified: head/etc/etc.amd64/ttys ============================================================================== --- head/etc/etc.amd64/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.amd64/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.arm/ttys ============================================================================== --- head/etc/etc.arm/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.arm/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.i386/ttys ============================================================================== --- head/etc/etc.i386/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.i386/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.ia64/ttys ============================================================================== --- head/etc/etc.ia64/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.ia64/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.mips/ttys ============================================================================== --- head/etc/etc.mips/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.mips/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.powerpc/ttys ============================================================================== --- head/etc/etc.powerpc/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.powerpc/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. Modified: head/etc/etc.sparc64/ttys ============================================================================== --- head/etc/etc.sparc64/ttys Sun Jun 14 21:39:52 2009 (r194217) +++ head/etc/etc.sparc64/ttys Sun Jun 14 22:35:33 2009 (r194218) @@ -15,9 +15,7 @@ # # type The initial terminal type for this port. For hardwired # terminal lines, this will contain the type of terminal used. -# For virtual consoles, the correct type is typically cons25, but -# vt220 will work better if you need interoperability with other -# systems like Solaris or GNU/Linux. +# For virtual consoles, the correct type is typically cons25. # Other common values include network for network connections on # pseudo-terminals, dialup for incoming modem ports, and unknown # when the terminal type cannot be predetermined. From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 23:26:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439941065670; Sun, 14 Jun 2009 23:26:16 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 70EC68FC19; Sun, 14 Jun 2009 23:26:15 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: (from root@localhost) by kientzle.com (8.14.3/8.14.3) id n5ENQDGQ079400; Sun, 14 Jun 2009 16:26:13 -0700 (PDT) (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id ba3ey2txyfceme2xjj9fxygy8n; Sun, 14 Jun 2009 16:26:13 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <4A358714.40001@freebsd.org> Date: Sun, 14 Jun 2009 16:26:12 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Sam Leffler References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> In-Reply-To: <4A356A0F.3050800@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, Ed Schouten Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 23:26:16 -0000 Sam Leffler wrote: > Ed Schouten wrote: >> >> Log: >> Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. Thank you! > When I suggested enabling this by default for SMP configurations I was > reminded it wasn't enabled because of potential stack overflow. If 128 is problematic, we can try a lower value. I think even 8 or 16 would make interleaved console messages much easier to read. Tim From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 23:27:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4808106566C; Sun, 14 Jun 2009 23:27:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791058FC0A; Sun, 14 Jun 2009 23:27:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ENR9sV065099; Sun, 14 Jun 2009 23:27:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ENR9jL065098; Sun, 14 Jun 2009 23:27:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906142327.n5ENR9jL065098@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 14 Jun 2009 23: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: r194220 - head/sys/modules/if_ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 23:27:10 -0000 Author: des Date: Sun Jun 14 23:27:09 2009 New Revision: 194220 URL: http://svn.freebsd.org/changeset/base/194220 Log: Ed forgot this in r190751. Deleted: head/sys/modules/if_ppp/ From owner-svn-src-head@FreeBSD.ORG Sun Jun 14 23:44:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B34C106567C; Sun, 14 Jun 2009 23:44:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38AA8FC0A; Sun, 14 Jun 2009 23:44:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ENi6PY066085; Sun, 14 Jun 2009 23:44:06 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ENi64p066084; Sun, 14 Jun 2009 23:44:06 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200906142344.n5ENi64p066084@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 14 Jun 2009 23:44: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: r194225 - head/sys/modules/if_sl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 14 Jun 2009 23:44:07 -0000 Author: des Date: Sun Jun 14 23:44:06 2009 New Revision: 194225 URL: http://svn.freebsd.org/changeset/base/194225 Log: Ed forgot this in r190751. Deleted: head/sys/modules/if_sl/ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 00:16:14 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11D7B106566C; Mon, 15 Jun 2009 00:16:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 894708FC0C; Mon, 15 Jun 2009 00:16:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5F0G9lb026850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Jun 2009 10:16:10 +1000 Date: Mon, 15 Jun 2009 10:16:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Sam Leffler In-Reply-To: <4A356A0F.3050800@freebsd.org> Message-ID: <20090615075134.K24645@delplex.bde.org> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@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, Ed Schouten Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 00:16:14 -0000 On Sun, 14 Jun 2009, Sam Leffler wrote: >> Log: >> Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. >> >> In the past there have been some reports of PRINTF_BUFR_SIZE not >> functioning correctly. Instead of having garbled console messages, we >> should just see whether the issues are still there and analyze them. > > When I suggested enabling this by default for SMP configurations I was > reminded it wasn't enabled because of potential stack overflow. Stack overflow shouldn't be a problem, since printf shouldn't be called recursively. However, recursive calls are possible from panic(), and recursive calls are handled badly if they happen. E.g., PRINTF_BUFR_SIZE gives unlimited stack growth, and the locking in cnputs() may give deadlock. Deadlock should occur if cnputs() is preempted and the new thread panics, since panicing should prevent the preempted thread from running (and the system state may be so messed up that the preempted thread cannot run anyway). I wouldn't use an implementation anything like FreeBSD's. printf()s must be serialized, and once printf() is serialized there is no need for buffering or cnputs(). Put the locking in kvprintf() only. To avoid deadlock, the locking must not be strict. Either allow it to be bypassed (needed for calls from db_printf() and panic()), or automatically bypass it after a timeout, or automatically abort the printf() after a timeout. I use the latter to fix related bugs in kernel profiling (for some arches, MCOUNT_ENTER() deadlocks on NMIs and ddb traps if trap occurs while the lock is held, and for other arches MCOUNT_ENTER() is missing locking). For printf(), an automatic bypass after a timeout seems best -- in the worst case, it just gives interleaved messages like now, but that should rarely happen; the timeout can be very long for a CPU but short enough on a human scale for important messages to not be blocked for significantly long by unimportant messages or locking bugs. Here is my locking for kernel profiling (not showing simplications in MCOUNT_ENTER/EXIT()): % Index: mcount.c % =================================================================== % RCS file: /home/ncvs/src/sys/libkern/mcount.c,v % retrieving revision 1.24 % diff -u -2 -r1.24 mcount.c % --- mcount.c 13 Jun 2007 06:17:48 -0000 1.24 % +++ mcount.c 13 Jun 2007 06:18:33 -0000 % @@ -34,7 +34,5 @@ % #include % #ifdef _KERNEL % -#ifndef GUPROF % #include % -#endif % #include % #include % @@ -43,4 +41,61 @@ % % /* % + * Locking strategy: use a simple spin mutex, but don't wait very long % + * for it. When we don't acquire it, just give up. We avoid using a % + * normal mutex since normal mutex code is profiled and might be % + * inefficent. Not waiting very long avoids deadlock. Our callers % + * should have used the usual anti-deadlock strategy of disabling % + * interrupts on the current CPU, but that is especially insufficient % + * for us since it doesn't affect debugger traps and NMIs, and at least % + * the debugger code is profiled. % + * % + * Note: the atomic functions used here, like all functions used in this % + * file, must be compiled without profiling. This normally happens for % + * the atomic functions because they are inline. % + */ % + % +static __inline int % +mcount_trylock(struct gmonparam *p, int want_both) % +{ % +#ifdef SMP % + int timeout; % + % + timeout = 1000; /* XXX ~= 10 times #statements in mcount(). */ % + do { % + /* XXX having 2 "on" states complicates things. */ % +#ifdef GUPROF % + if (atomic_cmpset_acq_int(&p->state, GMON_PROF_HIRES, % + GMON_PROF_BUSY)) % + return (GMON_PROF_HIRES); % +#endif % + if (want_both && atomic_cmpset_acq_int(&p->state, GMON_PROF_ON, % + GMON_PROF_BUSY)) % + return (GMON_PROF_ON); % + } while (--timeout != 0); % +#else /* !SMP */ % + /* Ugliness for efficiency. */ % +#ifdef GUPROF % + if (p->state == GMON_PROF_HIRES) { % + /* XXX want acq. */ % + atomic_store_rel_int(&p->state, GMON_PROF_BUSY); % + return (GMON_PROF_HIRES); % + } % +#endif % + if (want_both && p->state == GMON_PROF_ON) { % + atomic_store_rel_int(&p->state, GMON_PROF_BUSY); % + return (GMON_PROF_ON); % + } % +#endif /* SMP */ % + return (GMON_PROF_BUSY); /* Might actually be OFF or ERROR. */ % +} % + % +static __inline void % +mcount_unlock(struct gmonparam *p, int ostate) % +{ % + % + atomic_store_rel_int(&p->state, ostate); % +} % + % +/* % * mcount is called on entry to each function compiled with the profiling % * switch set. _mcount(), which is declared in a machine-dependent way % @@ -68,4 +123,5 @@ % struct gmonparam *p; % long toindex; % + int ostate; % #ifdef _KERNEL % MCOUNT_DECL(s) % @@ -73,17 +129,17 @@ % % p = &_gmonparam; % -#ifndef GUPROF /* XXX */ % +#ifndef GUPROF % /* % - * check that we are profiling % - * and that we aren't recursively invoked. % + * Quick check that we are profiling. In caller for GUPROF, and % + * should always be there. % */ % - if (p->state != GMON_PROF_ON) % + if (p->state == GMON_PROF_OFF) % return; % #endif % #ifdef _KERNEL % MCOUNT_ENTER(s); % -#else % - p->state = GMON_PROF_BUSY; % #endif % + if ((ostate = mcount_trylock(p, 1)) == GMON_PROF_BUSY) % + return; % % #ifdef _KERNEL % @@ -101,5 +157,5 @@ % % #ifdef GUPROF % - if (p->state == GMON_PROF_HIRES) { % + if (ostate == GMON_PROF_HIRES) { % /* % * Count the time since cputime() was previously called % @@ -224,12 +281,11 @@ % } % done: % + mcount_unlock(p, ostate); % #ifdef _KERNEL % MCOUNT_EXIT(s); % -#else % - p->state = GMON_PROF_ON; % #endif % return; % overflow: % - p->state = GMON_PROF_ERROR; % + mcount_unlock(p, GMON_PROF_ERROR); % #ifdef _KERNEL % MCOUNT_EXIT(s); % @@ -251,6 +307,9 @@ % struct gmonparam *p; % uintfptr_t selfpcdiff; % + int ostate; % % p = &_gmonparam; % + if ((ostate = mcount_trylock(p, 0)) == GMON_PROF_BUSY) % + return; % selfpcdiff = selfpc - (uintfptr_t)p->lowpc; % if (selfpcdiff < p->textsize) { % @@ -267,4 +326,5 @@ % *p->mexitcount_count += p->mexitcount_overhead; % } % + mcount_unlock(p, ostate); % } % The above makes mcount()'s kernel locking strategy very similar to its userland one -- try to obtain the lock, and if it cannot be obtained then do nothing and just lose some statistics. In userland, recursive calls to mcount() are possible for signal handlers and for threads. For signal handlers, waiting forever could deadlock and the old code avoids that using a simple state flag; it assumes atomic accesses to p->state. The threaded case was mostly broken -- it won't have the necessary atomic accesses in the SMP case, and contention on mcount() and consequent lost statistics is much more common for threads. The above is supposed to fix the locking in userland in the same way as in the kernel using the same trylock function, but hasn't been tested in userland. In the kernel, there is enormous contention on the lock iff multiple threads are in the kernel. mcount() needs to have per-CPU context to run fast enough in this case. For printf(), things are much simpler because results are only needed on a human time scale, and printf()'s internals are reentrant enough. Instead of: if ((ostate = mcount_trylock(p, 0)) == GMON_PROF_BUSY) return; ... mcount_unlock(p, ostate); kvprintf() can just do: printf_trylock(); /* * Continue (after a timeout) even if we didn't acquire the lock * exclusively, so that printf() is guaranteed to complete * eventually. Use a global in-use counter instead of p->state * and ostate above. */ ... printf_unlock(); Normal mutex locking should not be used here. (For profiling, it cannot be used, since mutex code is profiled). mtx_lock_spin() is more unusuable than I remembered, for the above and where it is now used in cnputs(). It does recursion inline even when MTX_RECURSE is not configured for the mutex. _mtx_lock_spin_flags() checks for recursion on non-recursive mutexes but won't be called in the usual case where the recursion is done inline. This results in erroneous recursive calls to cnputs() not deadlocking like they should; instead the locking just doesn't work. The effectiveness of the automatic bypass of printf()'s locking after a timeout can be tested easily by debugging printf() and/or its locking code using ddb without using a special bypass for ddb's printf()s. Once the top level printf() acquires the lock, ddb's printf()s should become quite slow since they have to wait for the lock, but they should still occur (interleaved with the top-level i/o, which should be messed up further by ddb's printfs interfering with device accesses for the top-level i/o when you step through the lowest levels), and they might even be useable if the timeout is short enough. The timeout needs to be configured better than by `timeout = 1000; /* XXX */' Use something like DELAY(1000) tested 1000 times. Use a timeout of 0 for ddb once the above tests are done. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 00:33:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68EA4106564A; Mon, 15 Jun 2009 00:33:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55E888FC08; Mon, 15 Jun 2009 00:33:19 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F0XJIt070497; Mon, 15 Jun 2009 00:33:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F0XIjV070484; Mon, 15 Jun 2009 00:33:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906150033.n5F0XIjV070484@svn.freebsd.org> From: Andrew Thompson Date: Mon, 15 Jun 2009 00:33: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: r194227 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 00:33:19 -0000 Author: thompsa Date: Mon Jun 15 00:33:18 2009 New Revision: 194227 URL: http://svn.freebsd.org/changeset/base/194227 Log: Remove usb2_cv_* and just use the kernel condvar implementation, it was needed earlier since condition variables didnt work with Giant but this was fixed 10 months ago. Modified: head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_util.c head/sys/dev/usb/usb_util.h Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/serial/ufoma.c Mon Jun 15 00:33:18 2009 (r194227) @@ -366,7 +366,7 @@ ufoma_attach(device_t dev) sc->sc_unit = device_get_unit(dev); mtx_init(&sc->sc_mtx, "ufoma", NULL, MTX_DEF); - usb2_cv_init(&sc->sc_cv, "CWAIT"); + cv_init(&sc->sc_cv, "CWAIT"); device_set_usb2_desc(dev); @@ -475,7 +475,7 @@ ufoma_detach(device_t dev) free(sc->sc_modetable, M_USBDEV); } mtx_destroy(&sc->sc_mtx); - usb2_cv_destroy(&sc->sc_cv); + cv_destroy(&sc->sc_cv); return (0); } @@ -514,7 +514,7 @@ ufoma_cfg_link_state(struct ufoma_softc usb2_com_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, sc->sc_modetable, 0, 1000); - error = usb2_cv_timedwait(&sc->sc_cv, &sc->sc_mtx, hz); + error = cv_timedwait(&sc->sc_cv, &sc->sc_mtx, hz); if (error) { DPRINTF("NO response\n"); @@ -536,7 +536,7 @@ ufoma_cfg_activate_state(struct ufoma_so usb2_com_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000); - error = usb2_cv_timedwait(&sc->sc_cv, &sc->sc_mtx, + error = cv_timedwait(&sc->sc_cv, &sc->sc_mtx, (UFOMA_MAX_TIMEOUT * hz)); if (error) { DPRINTF("No response\n"); @@ -672,7 +672,7 @@ ufoma_intr_callback(struct usb_xfer *xfe if (!(temp & 0xff)) { DPRINTF("Mode change failed!\n"); } - usb2_cv_signal(&sc->sc_cv); + cv_signal(&sc->sc_cv); } if (pkt.bmRequestType != UCDC_NOTIFICATION) { goto tr_setup; Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/serial/usb_serial.c Mon Jun 15 00:33:18 2009 (r194227) @@ -328,7 +328,7 @@ usb2_com_attach_tty(struct ucom_softc *s sc->sc_tty = tp; DPRINTF("ttycreate: %s\n", buf); - usb2_cv_init(&sc->sc_cv, "usb2_com"); + cv_init(&sc->sc_cv, "usb2_com"); done: return (error); @@ -358,7 +358,7 @@ usb2_com_detach_tty(struct ucom_softc *s mtx_lock(sc->sc_mtx); /* Wait for the callback after the TTY is torn down */ while (sc->sc_ttyfreed == 0) - usb2_cv_wait(&sc->sc_cv, sc->sc_mtx); + cv_wait(&sc->sc_cv, sc->sc_mtx); /* * make sure that read and write transfers are stopped */ @@ -370,7 +370,7 @@ usb2_com_detach_tty(struct ucom_softc *s } mtx_unlock(sc->sc_mtx); } - usb2_cv_destroy(&sc->sc_cv); + cv_destroy(&sc->sc_cv); } static void @@ -1117,6 +1117,6 @@ usb2_com_free(void *xsc) mtx_lock(sc->sc_mtx); sc->sc_ttyfreed = 1; - usb2_cv_signal(&sc->sc_cv); + cv_signal(&sc->sc_cv); mtx_unlock(sc->sc_mtx); } Modified: head/sys/dev/usb/usb_busdma.c ============================================================================== --- head/sys/dev/usb/usb_busdma.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_busdma.c Mon Jun 15 00:33:18 2009 (r194227) @@ -445,7 +445,7 @@ done: if (isload) { (uptag->func) (uptag); } else { - usb2_cv_broadcast(uptag->cv); + cv_broadcast(uptag->cv); } if (!owned) mtx_unlock(uptag->mtx); @@ -531,7 +531,7 @@ usb2_pc_alloc_mem(struct usb_page_cache pc, (BUS_DMA_WAITOK | BUS_DMA_COHERENT)); if (err == EINPROGRESS) { - usb2_cv_wait(uptag->cv, uptag->mtx); + cv_wait(uptag->cv, uptag->mtx); err = 0; } mtx_unlock(uptag->mtx); @@ -612,7 +612,7 @@ usb2_pc_load_mem(struct usb_page_cache * pc->tag, pc->map, pc->buffer, size, &usb2_pc_alloc_mem_cb, pc, BUS_DMA_WAITOK); if (err == EINPROGRESS) { - usb2_cv_wait(uptag->cv, uptag->mtx); + cv_wait(uptag->cv, uptag->mtx); err = 0; } if (err || uptag->dma_error) { @@ -782,7 +782,7 @@ usb2_dma_tag_setup(struct usb_dma_parent return; } /* initialise condition variable */ - usb2_cv_init(udpt->cv, "USB DMA CV"); + cv_init(udpt->cv, "USB DMA CV"); /* store some information */ udpt->mtx = mtx; @@ -823,7 +823,7 @@ usb2_dma_tag_unsetup(struct usb_dma_pare if (udpt->utag_max) { /* destroy the condition variable */ - usb2_cv_destroy(udpt->cv); + cv_destroy(udpt->cv); } } Modified: head/sys/dev/usb/usb_compat_linux.c ============================================================================== --- head/sys/dev/usb/usb_compat_linux.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_compat_linux.c Mon Jun 15 00:33:18 2009 (r194227) @@ -556,7 +556,7 @@ usb_start_wait_urb(struct urb *urb, usb_ */ while (urb->transfer_flags & URB_WAIT_WAKEUP) { urb->transfer_flags |= URB_IS_SLEEPING; - usb2_cv_wait(&urb->cv_wait, &Giant); + cv_wait(&urb->cv_wait, &Giant); urb->transfer_flags &= ~URB_IS_SLEEPING; } @@ -943,7 +943,7 @@ usb_alloc_urb(uint16_t iso_packets, uint urb = malloc(size, M_USBDEV, M_WAITOK | M_ZERO); if (urb) { - usb2_cv_init(&urb->cv_wait, "URBWAIT"); + cv_init(&urb->cv_wait, "URBWAIT"); if (iso_packets == 0xFFFF) { urb->setup_packet = (void *)(urb + 1); urb->transfer_buffer = (void *)(urb->setup_packet + @@ -1169,7 +1169,7 @@ usb_free_urb(struct urb *urb) usb_kill_urb(urb); /* destroy condition variable */ - usb2_cv_destroy(&urb->cv_wait); + cv_destroy(&urb->cv_wait); /* just free it */ free(urb, M_USBDEV); @@ -1252,7 +1252,7 @@ static void usb_linux_wait_complete(struct urb *urb) { if (urb->transfer_flags & URB_IS_SLEEPING) { - usb2_cv_signal(&urb->cv_wait); + cv_signal(&urb->cv_wait); } urb->transfer_flags &= ~URB_WAIT_WAKEUP; } Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_core.h Mon Jun 15 00:33:18 2009 (r194227) @@ -41,14 +41,6 @@ /* Default USB configuration */ /* - * The following macro defines if the code shall use cv_xxx() instead - * of msleep() and wakeup(). - */ -#ifndef USB_HAVE_CONDVAR -#define USB_HAVE_CONDVAR 0 -#endif - -/* * The following macro defines if the code shall support * /dev/usb/x.y.z. */ Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_dev.c Mon Jun 15 00:33:18 2009 (r194227) @@ -261,7 +261,7 @@ error: if (crd->is_uref) { sx_unlock(cpd->udev->default_sx + 1); if (--(cpd->udev->refcount) == 0) { - usb2_cv_signal(cpd->udev->default_cv + 1); + cv_signal(cpd->udev->default_cv + 1); } } mtx_unlock(&usb2_ref_lock); @@ -318,19 +318,19 @@ usb2_unref_device(struct usb_cdev_privda mtx_lock(&usb2_ref_lock); if (crd->is_read) { if (--(crd->rxfifo->refcount) == 0) { - usb2_cv_signal(&crd->rxfifo->cv_drain); + cv_signal(&crd->rxfifo->cv_drain); } crd->is_read = 0; } if (crd->is_write) { if (--(crd->txfifo->refcount) == 0) { - usb2_cv_signal(&crd->txfifo->cv_drain); + cv_signal(&crd->txfifo->cv_drain); } crd->is_write = 0; } if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { - usb2_cv_signal(cpd->udev->default_cv + 1); + cv_signal(cpd->udev->default_cv + 1); } crd->is_uref = 0; } @@ -344,8 +344,8 @@ usb2_fifo_alloc(void) f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO); if (f) { - usb2_cv_init(&f->cv_io, "FIFO-IO"); - usb2_cv_init(&f->cv_drain, "FIFO-DRAIN"); + cv_init(&f->cv_io, "FIFO-IO"); + cv_init(&f->cv_drain, "FIFO-DRAIN"); f->refcount = 1; } return (f); @@ -567,21 +567,21 @@ usb2_fifo_free(struct usb_fifo *f) /* get I/O thread out of any sleep state */ if (f->flag_sleeping) { f->flag_sleeping = 0; - usb2_cv_broadcast(&f->cv_io); + cv_broadcast(&f->cv_io); } mtx_unlock(f->priv_mtx); mtx_lock(&usb2_ref_lock); /* wait for sync */ - usb2_cv_wait(&f->cv_drain, &usb2_ref_lock); + cv_wait(&f->cv_drain, &usb2_ref_lock); } mtx_unlock(&usb2_ref_lock); /* take care of closing the device here, if any */ usb2_fifo_close(f, 0); - usb2_cv_destroy(&f->cv_io); - usb2_cv_destroy(&f->cv_drain); + cv_destroy(&f->cv_io); + cv_destroy(&f->cv_drain); free(f, M_USBDEV); } @@ -768,7 +768,7 @@ usb2_fifo_close(struct usb_fifo *f, int (!f->flag_iserror)) { /* wait until all data has been written */ f->flag_sleeping = 1; - err = usb2_cv_wait_sig(&f->cv_io, f->priv_mtx); + err = cv_wait_sig(&f->cv_io, f->priv_mtx); if (err) { DPRINTF("signal received\n"); break; @@ -1454,7 +1454,7 @@ usb2_fifo_wait(struct usb_fifo *f) } f->flag_sleeping = 1; - err = usb2_cv_wait_sig(&f->cv_io, f->priv_mtx); + err = cv_wait_sig(&f->cv_io, f->priv_mtx); if (f->flag_iserror) { /* we are gone */ @@ -1468,7 +1468,7 @@ usb2_fifo_signal(struct usb_fifo *f) { if (f->flag_sleeping) { f->flag_sleeping = 0; - usb2_cv_broadcast(&f->cv_io); + cv_broadcast(&f->cv_io); } } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_device.c Mon Jun 15 00:33:18 2009 (r194227) @@ -1464,8 +1464,8 @@ usb2_alloc_device(device_t parent_dev, s /* initialise our SX-lock */ sx_init(udev->default_sx + 1, "0123456789ABCDEF - USB config SX lock" + depth); - usb2_cv_init(udev->default_cv, "WCTRL"); - usb2_cv_init(udev->default_cv + 1, "UGONE"); + cv_init(udev->default_cv, "WCTRL"); + cv_init(udev->default_cv + 1, "UGONE"); /* initialise our mutex */ mtx_init(udev->default_mtx, "USB device mutex", NULL, MTX_DEF); @@ -1947,7 +1947,7 @@ usb2_free_device(struct usb_device *udev mtx_lock(&usb2_ref_lock); udev->refcount--; while (udev->refcount != 0) { - usb2_cv_wait(udev->default_cv + 1, &usb2_ref_lock); + cv_wait(udev->default_cv + 1, &usb2_ref_lock); } mtx_unlock(&usb2_ref_lock); @@ -1981,8 +1981,8 @@ usb2_free_device(struct usb_device *udev sx_destroy(udev->default_sx); sx_destroy(udev->default_sx + 1); - usb2_cv_destroy(udev->default_cv); - usb2_cv_destroy(udev->default_cv + 1); + cv_destroy(udev->default_cv); + cv_destroy(udev->default_cv + 1); mtx_destroy(udev->default_mtx); #if USB_HAVE_UGEN Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_msctest.c Mon Jun 15 00:33:18 2009 (r194227) @@ -214,7 +214,7 @@ bbb_done(struct bbb_transfer *sc, uint8_ sc->error = error; sc->state = ST_COMMAND; sc->status_try = 1; - usb2_cv_signal(&sc->cv); + cv_signal(&sc->cv); } static void @@ -450,7 +450,7 @@ bbb_command_start(struct bbb_transfer *s usb2_transfer_start(sc->xfer[sc->state]); while (usb2_transfer_pending(sc->xfer[sc->state])) { - usb2_cv_wait(&sc->cv, &sc->mtx); + cv_wait(&sc->cv, &sc->mtx); } return (sc->error); } @@ -508,7 +508,7 @@ usb2_test_autoinstall(struct usb_device return (USB_ERR_NOMEM); } mtx_init(&sc->mtx, "USB autoinstall", NULL, MTX_DEF); - usb2_cv_init(&sc->cv, "WBBB"); + cv_init(&sc->cv, "WBBB"); err = usb2_transfer_setup(udev, &iface_index, sc->xfer, bbb_config, @@ -568,7 +568,7 @@ done: mtx_unlock(&sc->mtx); usb2_transfer_unsetup(sc->xfer, ST_MAX); mtx_destroy(&sc->mtx); - usb2_cv_destroy(&sc->cv); + cv_destroy(&sc->cv); free(sc, M_USB); return (err); } Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_process.c Mon Jun 15 00:33:18 2009 (r194227) @@ -150,14 +150,14 @@ usb_process(void *arg) /* end if messages - check if anyone is waiting for sync */ if (up->up_dsleep) { up->up_dsleep = 0; - usb2_cv_broadcast(&up->up_drain); + cv_broadcast(&up->up_drain); } up->up_msleep = 1; - usb2_cv_wait(&up->up_cv, up->up_mtx); + cv_wait(&up->up_cv, up->up_mtx); } up->up_ptr = NULL; - usb2_cv_signal(&up->up_cv); + cv_signal(&up->up_cv); mtx_unlock(up->up_mtx); USB_THREAD_EXIT(0); @@ -185,8 +185,8 @@ usb2_proc_create(struct usb_process *up, TAILQ_INIT(&up->up_qhead); - usb2_cv_init(&up->up_cv, "wmsg"); - usb2_cv_init(&up->up_drain, "dmsg"); + cv_init(&up->up_cv, "wmsg"); + cv_init(&up->up_drain, "dmsg"); if (USB_THREAD_CREATE(&usb_process, up, &up->up_ptr, pmesg)) { @@ -219,8 +219,8 @@ usb2_proc_free(struct usb_process *up) usb2_proc_drain(up); - usb2_cv_destroy(&up->up_cv); - usb2_cv_destroy(&up->up_drain); + cv_destroy(&up->up_cv); + cv_destroy(&up->up_drain); /* make sure that we do not enter here again */ up->up_mtx = NULL; @@ -308,7 +308,7 @@ usb2_proc_msignal(struct usb_process *up if (up->up_msleep) { up->up_msleep = 0; /* save "cv_signal()" calls */ - usb2_cv_signal(&up->up_cv); + cv_signal(&up->up_cv); } return (pm2); } @@ -366,7 +366,7 @@ usb2_proc_mwait(struct usb_process *up, if (up->up_gone) break; up->up_dsleep = 1; - usb2_cv_wait(&up->up_drain, up->up_mtx); + cv_wait(&up->up_drain, up->up_mtx); } } @@ -402,7 +402,7 @@ usb2_proc_drain(struct usb_process *up) if (up->up_msleep || up->up_csleep) { up->up_msleep = 0; up->up_csleep = 0; - usb2_cv_signal(&up->up_cv); + cv_signal(&up->up_cv); } /* Check if we are still cold booted */ @@ -412,13 +412,13 @@ usb2_proc_drain(struct usb_process *up) "been left suspended!\n"); break; } - usb2_cv_wait(&up->up_cv, up->up_mtx); + cv_wait(&up->up_cv, up->up_mtx); } /* Check if someone is waiting - should not happen */ if (up->up_dsleep) { up->up_dsleep = 0; - usb2_cv_broadcast(&up->up_drain); + cv_broadcast(&up->up_drain); DPRINTF("WARNING: Someone is waiting " "for USB process drain!\n"); } Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_request.c Mon Jun 15 00:33:18 2009 (r194227) @@ -79,7 +79,7 @@ usb2_do_request_callback(struct usb_xfer usb2_start_hardware(xfer); break; default: - usb2_cv_signal(xfer->xroot->udev->default_cv); + cv_signal(xfer->xroot->udev->default_cv); break; } } @@ -437,7 +437,7 @@ usb2_do_request_flags(struct usb_device usb2_transfer_start(xfer); while (usb2_transfer_pending(xfer)) { - usb2_cv_wait(udev->default_cv, + cv_wait(udev->default_cv, xfer->xroot->xfer_mtx); } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_transfer.c Mon Jun 15 00:33:18 2009 (r194227) @@ -799,7 +799,7 @@ usb2_transfer_setup(struct usb_device *u info->xfer_page_cache_start = USB_ADD_BYTES(buf, parm.size[5]); info->xfer_page_cache_end = USB_ADD_BYTES(buf, parm.size[2]); - usb2_cv_init(&info->cv_drain, "WDRAIN"); + cv_init(&info->cv_drain, "WDRAIN"); info->xfer_mtx = xfer_mtx; #if USB_HAVE_BUSDMA @@ -1089,7 +1089,7 @@ usb2_transfer_unsetup_sub(struct usb_xfe usb2_dma_tag_unsetup(&info->dma_parent_tag); #endif - usb2_cv_destroy(&info->cv_drain); + cv_destroy(&info->cv_drain); /* * free the "memory_base" last, hence the "info" structure is @@ -1775,7 +1775,7 @@ usb2_transfer_drain(struct usb_xfer *xfe * Wait until the current outstanding USB * transfer is complete ! */ - usb2_cv_wait(&xfer->xroot->cv_drain, xfer->xroot->xfer_mtx); + cv_wait(&xfer->xroot->cv_drain, xfer->xroot->xfer_mtx); } USB_XFER_UNLOCK(xfer); } @@ -1988,7 +1988,7 @@ done: (!xfer->flags_int.transferring)) { /* "usb2_transfer_drain()" is waiting for end of transfer */ xfer->flags_int.draining = 0; - usb2_cv_broadcast(&info->cv_drain); + cv_broadcast(&info->cv_drain); } /* do the next callback, if any */ Modified: head/sys/dev/usb/usb_util.c ============================================================================== --- head/sys/dev/usb/usb_util.c Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_util.c Mon Jun 15 00:33:18 2009 (r194227) @@ -38,11 +38,6 @@ #include #include -/* function prototypes */ -#if (USB_HAVE_CONDVAR == 0) -static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, int timo); - -#endif /*------------------------------------------------------------------------* * device_delete_all_children - delete all children of a device @@ -233,101 +228,3 @@ usb2_make_str_desc(void *ptr, uint16_t m } return (totlen); } - -#if (USB_HAVE_CONDVAR == 0) - -/*------------------------------------------------------------------------* - * usb2_cv_init - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_init(struct cv *cv, const char *desc) -{ - cv_init(cv, desc); -} - -/*------------------------------------------------------------------------* - * usb2_cv_destroy - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_destroy(struct cv *cv) -{ - cv_destroy(cv); -} - -/*------------------------------------------------------------------------* - * usb2_cv_wait - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_wait(struct cv *cv, struct mtx *mtx) -{ - int err; - - err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), 0); -} - -/*------------------------------------------------------------------------* - * usb2_cv_wait_sig - wrapper function - *------------------------------------------------------------------------*/ -int -usb2_cv_wait_sig(struct cv *cv, struct mtx *mtx) -{ - int err; - - err = usb2_msleep(cv, mtx, PCATCH, cv_wmesg(cv), 0); - return (err); -} - -/*------------------------------------------------------------------------* - * usb2_cv_timedwait - wrapper function - *------------------------------------------------------------------------*/ -int -usb2_cv_timedwait(struct cv *cv, struct mtx *mtx, int timo) -{ - int err; - - if (timo == 0) - timo = 1; /* zero means no timeout */ - err = usb2_msleep(cv, mtx, 0, cv_wmesg(cv), timo); - return (err); -} - -/*------------------------------------------------------------------------* - * usb2_cv_signal - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_signal(struct cv *cv) -{ - wakeup_one(cv); -} - -/*------------------------------------------------------------------------* - * usb2_cv_broadcast - wrapper function - *------------------------------------------------------------------------*/ -void -usb2_cv_broadcast(struct cv *cv) -{ - wakeup(cv); -} - -/*------------------------------------------------------------------------* - * usb2_msleep - wrapper function - *------------------------------------------------------------------------*/ -static int -usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, - int timo) -{ - int err; - - if (mtx == &Giant) { - err = tsleep(chan, priority, wmesg, timo); - } else { -#ifdef mtx_sleep - err = mtx_sleep(chan, mtx, priority, wmesg, timo); -#else - err = msleep(chan, mtx, priority, wmesg, timo); -#endif - } - return (err); -} - -#endif Modified: head/sys/dev/usb/usb_util.h ============================================================================== --- head/sys/dev/usb/usb_util.h Mon Jun 15 00:17:22 2009 (r194226) +++ head/sys/dev/usb/usb_util.h Mon Jun 15 00:33:18 2009 (r194227) @@ -34,23 +34,4 @@ void usb2_pause_mtx(struct mtx *mtx, int void usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd); void usb2_trim_spaces(char *p); -#if (USB_HAVE_CONDVAR == 0) -void usb2_cv_init(struct cv *cv, const char *desc); -void usb2_cv_destroy(struct cv *cv); -void usb2_cv_wait(struct cv *cv, struct mtx *mtx); -int usb2_cv_wait_sig(struct cv *cv, struct mtx *mtx); -int usb2_cv_timedwait(struct cv *cv, struct mtx *mtx, int timo); -void usb2_cv_signal(struct cv *cv); -void usb2_cv_broadcast(struct cv *cv); - -#else -#define usb2_cv_init cv_init -#define usb2_cv_destroy cv_destroy -#define usb2_cv_wait cv_wait -#define usb2_cv_wait_sig cv_wait_sig -#define usb2_cv_timedwait cv_timedwait -#define usb2_cv_signal cv_signal -#define usb2_cv_broadcast cv_broadcast -#endif - #endif /* _USB2_UTIL_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 00:49:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1872A106567F; Mon, 15 Jun 2009 00:49:44 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id DFA8E8FC21; Mon, 15 Jun 2009 00:49:43 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n5F0nggY059249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Jun 2009 17:49:43 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4A359AA6.7010101@freebsd.org> Date: Sun, 14 Jun 2009 17:49:42 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090411) MIME-Version: 1.0 To: Bruce Evans References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> <20090615075134.K24645@delplex.bde.org> In-Reply-To: <20090615075134.K24645@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 00:49:44 -0000 Bruce Evans wrote: > On Sun, 14 Jun 2009, Sam Leffler wrote: > >>> Log: >>> Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. >>> >>> In the past there have been some reports of PRINTF_BUFR_SIZE not >>> functioning correctly. Instead of having garbled console messages, we >>> should just see whether the issues are still there and analyze them. >> >> When I suggested enabling this by default for SMP configurations I was >> reminded it wasn't enabled because of potential stack overflow. > > Stack overflow shouldn't be a problem, since printf shouldn't be called > recursively. You don't need recursion to overflow the stack. I'd love to see someone properly lock printf/console output instead of kludges like PRINTF_BUFR_SIZE. Sam From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 01:02:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A56F6106564A; Mon, 15 Jun 2009 01:02:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1808FC0A; Mon, 15 Jun 2009 01:02:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F12hHv072208; Mon, 15 Jun 2009 01:02:43 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F12hJh072202; Mon, 15 Jun 2009 01:02:43 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906150102.n5F12hJh072202@svn.freebsd.org> From: Andrew Thompson Date: Mon, 15 Jun 2009 01:02: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: r194228 - in head/sys: compat/ndis dev/ata dev/if_ndis dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/quirk dev/usb/serial dev/usb/storage dev/u... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 01:02:44 -0000 Author: thompsa Date: Mon Jun 15 01:02:43 2009 New Revision: 194228 URL: http://svn.freebsd.org/changeset/base/194228 Log: s/usb2_/usb_|usbd_/ on all function names for the USB stack. Modified: head/sys/compat/ndis/subr_usbd.c head/sys/dev/ata/ata-usb.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/at91dci_atmelarm.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/atmegadci_atmelarm.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mbus.c head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg_atmelarm.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/ohci_atmelarm.c head/sys/dev/usb/controller/ohci_pci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uhci_pci.c head/sys/dev/usb/controller/usb_controller.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/uss820dci_atmelarm.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_auereg.h head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axereg.h head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_ruereg.h head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_udavreg.h head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/usb/net/usb_ethernet.h head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/usb_busdma.c head/sys/dev/usb/usb_busdma.h head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_compat_linux.h head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_debug.c head/sys/dev/usb/usb_debug.h head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_dev.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_dynamic.c head/sys/dev/usb/usb_dynamic.h head/sys/dev/usb/usb_error.c head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_generic.h head/sys/dev/usb/usb_handle_request.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usb_hid.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_lookup.c head/sys/dev/usb/usb_lookup.h head/sys/dev/usb/usb_mbuf.c head/sys/dev/usb/usb_mbuf.h head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usb_parse.c head/sys/dev/usb/usb_parse.h head/sys/dev/usb/usb_process.c head/sys/dev/usb/usb_process.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_transfer.h head/sys/dev/usb/usb_util.c head/sys/dev/usb/usb_util.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Modified: head/sys/compat/ndis/subr_usbd.c ============================================================================== --- head/sys/compat/ndis/subr_usbd.c Mon Jun 15 00:33:18 2009 (r194227) +++ head/sys/compat/ndis/subr_usbd.c Mon Jun 15 01:02:43 2009 (r194228) @@ -472,7 +472,7 @@ usbd_func_getdesc(ip) * The NDIS driver is not allowed to change the * config! There is only one choice! */ - cdp = usb2_get_config_descriptor(sc->ndisusb_dev); + cdp = usbd_get_config_descriptor(sc->ndisusb_dev); if (cdp == NULL) { status = USB_ERR_INVAL; goto exit; @@ -492,7 +492,7 @@ usbd_func_getdesc(ip) status = USB_ERR_NORMAL_COMPLETION; } else { NDISUSB_LOCK(sc); - status = usb2_req_get_desc(sc->ndisusb_dev, &sc->ndisusb_mtx, + status = usbd_req_get_desc(sc->ndisusb_dev, &sc->ndisusb_mtx, &actlen, ctldesc->ucd_trans_buf, 2, ctldesc->ucd_trans_buflen, ctldesc->ucd_langid, ctldesc->ucd_desctype, ctldesc->ucd_idx, @@ -540,16 +540,16 @@ usbd_func_selconf(ip) intf = &selconf->usc_intf; for (i = 0; i < conf->bNumInterface && intf->uii_len > 0; i++) { - ret = usb2_set_alt_interface_index(udev, + ret = usbd_set_alt_interface_index(udev, intf->uii_intfnum, intf->uii_altset); if (ret != USB_ERR_NORMAL_COMPLETION && ret != USB_ERR_IN_USE) { device_printf(dev, "setting alternate interface failed: %s\n", - usb2_errstr(ret)); + usbd_errstr(ret)); return usbd_usb2urb(ret); } - for (j = 0; (ep = usb2_endpoint_foreach(udev, ep)); j++) { + for (j = 0; (ep = usb_endpoint_foreach(udev, ep)); j++) { if (j >= intf->uii_numeps) { device_printf(dev, "endpoint %d and above are ignored", @@ -608,11 +608,11 @@ usbd_setup_endpoint_one(ip, ifidx, ne, e InitializeListHead(&ne->ne_pending); KeInitializeSpinLock(&ne->ne_lock); - status = usb2_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, + status = usbd_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, epconf, 1, sc, &sc->ndisusb_mtx); if (status != USB_ERR_NORMAL_COMPLETION) { device_printf(dev, "couldn't setup xfer: %s\n", - usb2_errstr(status)); + usbd_errstr(status)); return (status); } xfer = ne->ne_xfer[0]; @@ -680,11 +680,11 @@ usbd_setup_endpoint(ip, ifidx, ep) if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_IN) cfg.flags.short_xfer_ok = 1; - status = usb2_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, + status = usbd_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, &cfg, 1, sc, &sc->ndisusb_mtx); if (status != USB_ERR_NORMAL_COMPLETION) { device_printf(dev, "couldn't setup xfer: %s\n", - usb2_errstr(status)); + usbd_errstr(status)); return (status); } xfer = ne->ne_xfer[0]; @@ -718,8 +718,8 @@ usbd_func_abort_pipe(ip) } NDISUSB_LOCK(sc); - usb2_transfer_stop(ne->ne_xfer[0]); - usb2_transfer_start(ne->ne_xfer[0]); + usbd_transfer_stop(ne->ne_xfer[0]); + usbd_transfer_start(ne->ne_xfer[0]); NDISUSB_UNLOCK(sc); return (USBD_STATUS_SUCCESS); @@ -800,8 +800,8 @@ usbd_irpcancel(dobj, ip) * cancelled and then restarted. */ NDISUSB_LOCK(sc); - usb2_transfer_stop(ne->ne_xfer[0]); - usb2_transfer_start(ne->ne_xfer[0]); + usbd_transfer_stop(ne->ne_xfer[0]); + usbd_transfer_start(ne->ne_xfer[0]); NDISUSB_UNLOCK(sc); ip->irp_cancel = TRUE; @@ -873,7 +873,7 @@ usbd_non_isoc_callback(struct usb_xfer * /* copy in data with regard to the URB */ if (ne->ne_dirin != 0) - usb2_copy_out(xfer->frbuffers, 0, nx->nx_urbbuf, + usbd_copy_out(xfer->frbuffers, 0, nx->nx_urbbuf, xfer->frlengths[0]); nx->nx_urbbuf += xfer->frlengths[0]; nx->nx_urbactlen += xfer->frlengths[0]; @@ -929,10 +929,10 @@ next: extra: len = MIN(xfer->max_data_length, nx->nx_urblen); if (UE_GET_DIR(ep->bEndpointAddress) == UE_DIR_OUT) - usb2_copy_in(xfer->frbuffers, 0, nx->nx_urbbuf, len); + usbd_copy_in(xfer->frbuffers, 0, nx->nx_urbbuf, len); xfer->frlengths[0] = len; xfer->nframes = 1; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); break; default: nx = usbd_aq_getfirst(sc, ne); @@ -941,7 +941,7 @@ extra: if (xfer->error != USB_ERR_CANCELLED) { xfer->flags.stall_pipe = 1; device_printf(sc->ndis_dev, "usb xfer warning (%s)\n", - usb2_errstr(xfer->error)); + usbd_errstr(xfer->error)); } usbd_xfer_complete(sc, ne, nx, xfer->error); if (xfer->error != USB_ERR_CANCELLED) @@ -974,7 +974,7 @@ usbd_ctrl_callback(struct usb_xfer *xfer vcreq = &urb->uu_vcreq; if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) { - usb2_copy_out(xfer->frbuffers + 1, 0, + usbd_copy_out(xfer->frbuffers + 1, 0, vcreq->uvc_trans_buf, xfer->frlengths[1]); nx->nx_urbactlen += xfer->frlengths[1]; } @@ -1044,7 +1044,7 @@ next: nx->nx_urblen = vcreq->uvc_trans_buflen; nx->nx_urbactlen = 0; - usb2_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); + usbd_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); xfer->frlengths[0] = sizeof(req); xfer->nframes = 1; if (vcreq->uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) { @@ -1066,13 +1066,13 @@ next: * the future if it needs to be. */ if (nx->nx_urblen > 0) { - usb2_copy_in(xfer->frbuffers + 1 , 0, + usbd_copy_in(xfer->frbuffers + 1 , 0, nx->nx_urbbuf, nx->nx_urblen); xfer->frlengths[1] = nx->nx_urblen; xfer->nframes = 2; } } - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); break; default: nx = usbd_aq_getfirst(sc, ne); @@ -1081,7 +1081,7 @@ next: if (xfer->error != USB_ERR_CANCELLED) { xfer->flags.stall_pipe = 1; device_printf(sc->ndis_dev, "usb xfer warning (%s)\n", - usb2_errstr(xfer->error)); + usbd_errstr(xfer->error)); } usbd_xfer_complete(sc, ne, nx, xfer->error); if (xfer->error != USB_ERR_CANCELLED) @@ -1244,7 +1244,7 @@ usbd_task(dobj, arg) ne = usbd_get_ndisep(ip, urb->uu_bulkintr.ubi_epdesc); if (ne == NULL) goto exit; - usb2_transfer_start(ne->ne_xfer[0]); + usbd_transfer_start(ne->ne_xfer[0]); break; case NDISUSB_TASK_IRPCANCEL: ne = usbd_get_ndisep(ip, @@ -1254,14 +1254,14 @@ usbd_task(dobj, arg) if (ne == NULL) goto exit; - usb2_transfer_stop(ne->ne_xfer[0]); - usb2_transfer_start(ne->ne_xfer[0]); + usbd_transfer_stop(ne->ne_xfer[0]); + usbd_transfer_start(ne->ne_xfer[0]); break; case NDISUSB_TASK_VENDOR: ne = (urb->uu_vcreq.uvc_trans_flags & USBD_TRANSFER_DIRECTION_IN) ? &sc->ndisusb_dread_ep : &sc->ndisusb_dwrite_ep; - usb2_transfer_start(ne->ne_xfer[0]); + usbd_transfer_start(ne->ne_xfer[0]); break; default: break; @@ -1437,7 +1437,7 @@ USBD_ParseConfigurationDescriptorEx(conf struct usb_descriptor *next = NULL; usb_interface_descriptor_t *desc; - while ((next = usb2_desc_foreach(conf, next)) != NULL) { + while ((next = usb_desc_foreach(conf, next)) != NULL) { desc = (usb_interface_descriptor_t *)next; if (desc->bDescriptorType != UDESC_INTERFACE) continue; Modified: head/sys/dev/ata/ata-usb.c ============================================================================== --- head/sys/dev/ata/ata-usb.c Mon Jun 15 00:33:18 2009 (r194227) +++ head/sys/dev/ata/ata-usb.c Mon Jun 15 01:02:43 2009 (r194228) @@ -288,7 +288,7 @@ atausb2_probe(device_t dev) /* give other drivers a try first */ return (ENXIO); } - id = usb2_get_interface_descriptor(uaa->iface); + id = usbd_get_interface_descriptor(uaa->iface); if ((!id) || (id->bInterfaceClass != UICLASS_MASS)) { return (ENXIO); } @@ -328,16 +328,16 @@ atausb2_attach(device_t dev) uint8_t has_intr; int err; - device_set_usb2_desc(dev); + device_set_usb_desc(dev); sc->dev = dev; sc->maxlun = 0; sc->locked_ch = NULL; sc->restart_ch = NULL; - sc->usb2_speed = usb2_get_speed(uaa->device); + sc->usb2_speed = usbd_get_speed(uaa->device); mtx_init(&sc->locked_mtx, "ATAUSB lock", NULL, (MTX_DEF | MTX_RECURSE)); - id = usb2_get_interface_descriptor(uaa->iface); + id = usbd_get_interface_descriptor(uaa->iface); switch (id->bInterfaceProtocol) { case UIPROTO_MASS_BBB: case UIPROTO_MASS_BBB_OLD: @@ -380,7 +380,7 @@ atausb2_attach(device_t dev) (strcmp(subclass, "ATAPI") && strcmp(subclass, "SCSI"))) { goto detach; } - err = usb2_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, + err = usbd_transfer_setup(uaa->device, &uaa->info.bIfaceIndex, sc->xfer, atausb2_config, ATAUSB_T_BBB_MAX, sc, &sc->locked_mtx); @@ -389,7 +389,7 @@ atausb2_attach(device_t dev) if (err) { device_printf(sc->dev, "could not setup required " - "transfers, %s\n", usb2_errstr(err)); + "transfers, %s\n", usbd_errstr(err)); goto detach; } /* get number of devices so we can add matching channels */ @@ -398,12 +398,12 @@ atausb2_attach(device_t dev) USETW(request.wValue, 0); USETW(request.wIndex, sc->iface_no); USETW(request.wLength, sizeof(maxlun)); - err = usb2_do_request(uaa->device, &Giant, &request, &maxlun); + err = usbd_do_request(uaa->device, &Giant, &request, &maxlun); if (err) { if (bootverbose) { device_printf(sc->dev, "get maxlun not supported %s\n", - usb2_errstr(err)); + usbd_errstr(err)); } } else { sc->maxlun = maxlun; @@ -438,7 +438,7 @@ atausb2_detach(device_t dev) /* teardown our statemachine */ - usb2_transfer_unsetup(sc->xfer, ATAUSB_T_MAX); + usbd_transfer_unsetup(sc->xfer, ATAUSB_T_MAX); /* detach & delete all children, if any */ @@ -460,7 +460,7 @@ atausb2_transfer_start(struct atausb2_so } if (sc->xfer[xfer_no]) { sc->last_xfer_no = xfer_no; - usb2_transfer_start(sc->xfer[xfer_no]); + usbd_transfer_start(sc->xfer[xfer_no]); } else { atausb2_cancel_request(sc); } @@ -485,11 +485,11 @@ atausb2_t_bbb_reset1_callback(struct usb req.wIndex[1] = 0; USETW(req.wLength, 0); - usb2_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); + usbd_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); xfer->frlengths[0] = sizeof(req); xfer->nframes = 1; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: /* Error */ @@ -527,7 +527,7 @@ tr_transferred: return; case USB_ST_SETUP: - if (usb2_clear_stall_callback(xfer, sc->xfer[stall_xfer])) { + if (usbd_clear_stall_callback(xfer, sc->xfer[stall_xfer])) { goto tr_transferred; } return; @@ -575,10 +575,10 @@ atausb2_t_bbb_command_callback(struct us bzero(sc->cbw.cdb, 16); bcopy(request->u.atapi.ccb, sc->cbw.cdb, 12); /* XXX SOS */ - usb2_copy_in(xfer->frbuffers, 0, &sc->cbw, sizeof(sc->cbw)); + usbd_copy_in(xfer->frbuffers, 0, &sc->cbw, sizeof(sc->cbw)); xfer->frlengths[0] = sizeof(sc->cbw); - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); } return; @@ -598,7 +598,7 @@ atausb2_t_bbb_data_read_callback(struct switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - usb2_copy_out(xfer->frbuffers, 0, + usbd_copy_out(xfer->frbuffers, 0, sc->ata_data, xfer->actlen); sc->ata_bytecount -= xfer->actlen; @@ -625,7 +625,7 @@ atausb2_t_bbb_data_read_callback(struct xfer->timeout = sc->timeout; xfer->frlengths[0] = max_bulk; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: /* Error */ @@ -675,10 +675,10 @@ atausb2_t_bbb_data_write_callback(struct xfer->timeout = sc->timeout; xfer->frlengths[0] = max_bulk; - usb2_copy_in(xfer->frbuffers, 0, + usbd_copy_in(xfer->frbuffers, 0, sc->ata_data, max_bulk); - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: /* Error */ @@ -712,7 +712,7 @@ atausb2_t_bbb_status_callback(struct usb if (xfer->actlen < sizeof(sc->csw)) { bzero(&sc->csw, sizeof(sc->csw)); } - usb2_copy_out(xfer->frbuffers, 0, &sc->csw, xfer->actlen); + usbd_copy_out(xfer->frbuffers, 0, &sc->csw, xfer->actlen); if (request->flags & (ATA_R_READ | ATA_R_WRITE)) { request->donecount = sc->ata_donecount; @@ -780,7 +780,7 @@ atausb2_t_bbb_status_callback(struct usb case USB_ST_SETUP: xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: @@ -828,7 +828,7 @@ atausb2_tr_error(struct usb_xfer *xfer) if (atausbdebug) { device_printf(sc->dev, "transfer failed, %s, in state %d " - "-> BULK reset\n", usb2_errstr(xfer->error), + "-> BULK reset\n", usbd_errstr(xfer->error), sc->last_xfer_no); } } @@ -903,7 +903,7 @@ ata_usbchannel_begin_transaction(struct sc->ata_data = request->data; sc->ata_donecount = 0; - usb2_transfer_start(sc->xfer[sc->last_xfer_no]); + usbd_transfer_start(sc->xfer[sc->last_xfer_no]); error = ATA_OP_CONTINUES; } else { request->result = EIO; Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Mon Jun 15 00:33:18 2009 (r194227) +++ head/sys/dev/if_ndis/if_ndis_usb.c Mon Jun 15 01:02:43 2009 (r194228) @@ -211,12 +211,12 @@ ndisusb_detach(device_t self) ndis_pnpevent_nic(self, NDIS_PNP_EVENT_SURPRISE_REMOVED); if (sc->ndisusb_status & NDISUSB_STATUS_SETUP_EP) { - usb2_transfer_unsetup(sc->ndisusb_dread_ep.ne_xfer, 1); - usb2_transfer_unsetup(sc->ndisusb_dwrite_ep.ne_xfer, 1); + usbd_transfer_unsetup(sc->ndisusb_dread_ep.ne_xfer, 1); + usbd_transfer_unsetup(sc->ndisusb_dwrite_ep.ne_xfer, 1); } for (i = 0; i < NDISUSB_ENDPT_MAX; i++) { ne = &sc->ndisusb_ep[i]; - usb2_transfer_unsetup(ne->ne_xfer, 1); + usbd_transfer_unsetup(ne->ne_xfer, 1); } (void)ndis_detach(self); Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon Jun 15 00:33:18 2009 (r194227) +++ head/sys/dev/sound/usb/uaudio.c Mon Jun 15 01:02:43 2009 (r194228) @@ -547,7 +547,7 @@ uaudio_probe(device_t dev) if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && (uaa->info.bInterfaceSubClass == UISUBCLASS_AUDIOCONTROL)) { - if (usb2_test_quirk(uaa, UQ_BAD_AUDIO)) + if (usb_test_quirk(uaa, UQ_BAD_AUDIO)) return (ENXIO); else return (0); @@ -567,23 +567,23 @@ uaudio_attach(device_t dev) sc->sc_rec_chan.priv_sc = sc; sc->sc_udev = uaa->device; - if (usb2_test_quirk(uaa, UQ_AUDIO_SWAP_LR)) + if (usb_test_quirk(uaa, UQ_AUDIO_SWAP_LR)) sc->sc_uq_audio_swap_lr = 1; - if (usb2_test_quirk(uaa, UQ_AU_INP_ASYNC)) + if (usb_test_quirk(uaa, UQ_AU_INP_ASYNC)) sc->sc_uq_au_inp_async = 1; - if (usb2_test_quirk(uaa, UQ_AU_NO_XU)) + if (usb_test_quirk(uaa, UQ_AU_NO_XU)) sc->sc_uq_au_no_xu = 1; - if (usb2_test_quirk(uaa, UQ_BAD_ADC)) + if (usb_test_quirk(uaa, UQ_BAD_ADC)) sc->sc_uq_bad_adc = 1; umidi_init(dev); - device_set_usb2_desc(dev); + device_set_usb_desc(dev); - id = usb2_get_interface_descriptor(uaa->iface); + id = usbd_get_interface_descriptor(uaa->iface); uaudio_chan_fill_info(sc, uaa->device); @@ -728,7 +728,7 @@ repeat: if (error) { device_printf(dev, "Waiting for sound application to exit!\n"); - usb2_pause_mtx(NULL, 2 * hz); + usb_pause_mtx(NULL, 2 * hz); goto repeat; /* try again */ } return (0); /* success */ @@ -783,7 +783,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ const struct usb2_audio_streaming_endpoint_descriptor *sed = NULL; const usb2_endpoint_descriptor_audio_t *ed1 = NULL; const usb2_endpoint_descriptor_audio_t *ed2 = NULL; - struct usb_config_descriptor *cd = usb2_get_config_descriptor(udev); + struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; const struct uaudio_format *p_fmt; struct uaudio_chan *chan; @@ -800,7 +800,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint8_t audio_if = 0; uint8_t sample_size; - while ((desc = usb2_desc_foreach(cd, desc))) { + while ((desc = usb_desc_foreach(cd, desc))) { if ((desc->bDescriptorType == UDESC_INTERFACE) && (desc->bLength >= sizeof(*id))) { @@ -832,7 +832,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ */ if ((sc->sc_midi_chan.valid == 0) && - usb2_get_iface(udev, curidx)) { + usbd_get_iface(udev, curidx)) { sc->sc_midi_chan.iface_index = curidx; sc->sc_midi_chan.iface_alt_index = alt_index; sc->sc_midi_chan.valid = 1; @@ -994,7 +994,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usb2_get_iface(udev, curidx)) { + if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { chan->valid = 1; #if USB_DEBUG @@ -1061,7 +1061,7 @@ uaudio_chan_fill_info(struct uaudio_soft { uint32_t rate = uaudio_default_rate; uint32_t z; - uint16_t fps = usb2_get_isoc_fps(udev); + uint16_t fps = usbd_get_isoc_fps(udev); uint8_t bits = uaudio_default_bits; uint8_t y; uint8_t channels = uaudio_default_channels; @@ -1172,7 +1172,7 @@ tr_transferred: if (n > total) { n = total; } - usb2_copy_in(xfer->frbuffers, offset, ch->cur, n); + usbd_copy_in(xfer->frbuffers, offset, ch->cur, n); total -= n; ch->cur += n; @@ -1183,7 +1183,7 @@ tr_transferred: } } - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); break; default: /* Error */ @@ -1249,7 +1249,7 @@ tr_transferred: if (m > p_len[n]) { m = p_len[n]; } - usb2_copy_out(xfer->frbuffers, offset1, ch->cur, m); + usbd_copy_out(xfer->frbuffers, offset1, ch->cur, m); p_len[n] -= m; offset1 += m; @@ -1282,7 +1282,7 @@ tr_transferred: DPRINTF("no buffer!\n"); return; } - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: /* Error */ @@ -1361,13 +1361,13 @@ uaudio_chan_init(struct uaudio_softc *sc DPRINTF("endpoint=0x%02x, speed=%d, iface=%d alt=%d\n", endpoint, ch->sample_rate, iface_index, alt_index); - err = usb2_set_alt_interface_index(sc->sc_udev, iface_index, alt_index); + err = usbd_set_alt_interface_index(sc->sc_udev, iface_index, alt_index); if (err) { DPRINTF("setting of alternate index failed: %s!\n", - usb2_errstr(err)); + usbd_errstr(err)); goto error; } - usb2_set_parent_iface(sc->sc_udev, iface_index, sc->sc_mixer_iface_index); + usbd_set_parent_iface(sc->sc_udev, iface_index, sc->sc_mixer_iface_index); /* * If just one sampling rate is supported, @@ -1383,7 +1383,7 @@ uaudio_chan_init(struct uaudio_softc *sc DPRINTF("setting of sample rate failed! (continuing anyway)\n"); } } - if (usb2_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, + if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, ch->usb2_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { DPRINTF("could not allocate USB transfers!\n"); goto error; @@ -1402,7 +1402,7 @@ uaudio_chan_free(struct uaudio_chan *ch) free(ch->buf, M_DEVBUF); ch->buf = NULL; } - usb2_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS); ch->valid = 0; @@ -1521,10 +1521,10 @@ uaudio_chan_start(struct uaudio_chan *ch #error "please update code" #endif if (ch->xfer[0]) { - usb2_transfer_start(ch->xfer[0]); + usbd_transfer_start(ch->xfer[0]); } if (ch->xfer[1]) { - usb2_transfer_start(ch->xfer[1]); + usbd_transfer_start(ch->xfer[1]); } return (0); } @@ -1535,8 +1535,8 @@ uaudio_chan_stop(struct uaudio_chan *ch) #if (UAUDIO_NCHANBUFS != 2) #error "please update code" #endif - usb2_transfer_stop(ch->xfer[0]); - usb2_transfer_stop(ch->xfer[1]); + usbd_transfer_stop(ch->xfer[0]); + usbd_transfer_stop(ch->xfer[1]); return (0); } @@ -2677,7 +2677,7 @@ uaudio_mixer_fill_info(struct uaudio_sof void *desc) { const struct usb2_audio_control_descriptor *acdp; - struct usb_config_descriptor *cd = usb2_get_config_descriptor(udev); + struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); const struct usb_descriptor *dp; const struct usb2_audio_unit *au; struct uaudio_terminal_node *iot = NULL; @@ -2685,7 +2685,7 @@ uaudio_mixer_fill_info(struct uaudio_sof uint8_t ID_max = 0; /* inclusive */ uint8_t i; - desc = usb2_desc_foreach(cd, desc); + desc = usb_desc_foreach(cd, desc); if (desc == NULL) { DPRINTF("no Audio Control header\n"); @@ -2724,7 +2724,7 @@ uaudio_mixer_fill_info(struct uaudio_sof DPRINTF("no memory!\n"); goto done; } - while ((desc = usb2_desc_foreach(cd, desc))) { + while ((desc = usb_desc_foreach(cd, desc))) { dp = desc; @@ -2939,9 +2939,9 @@ uaudio_mixer_get(struct usb_device *udev USETW(req.wIndex, mc->wIndex); USETW(req.wLength, len); - err = usb2_do_request(udev, &Giant, &req, data); + err = usbd_do_request(udev, &Giant, &req, data); if (err) { - DPRINTF("err=%s\n", usb2_errstr(err)); + DPRINTF("err=%s\n", usbd_errstr(err)); return (0); } if (len < 1) { @@ -3011,13 +3011,13 @@ tr_setup: if (len > 1) { buf[1] = (mc->wData[chan] >> 8) & 0xFF; } - usb2_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); - usb2_copy_in(xfer->frbuffers + 1, 0, buf, len); + usbd_copy_in(xfer->frbuffers, 0, &req, sizeof(req)); + usbd_copy_in(xfer->frbuffers + 1, 0, buf, len); xfer->frlengths[0] = sizeof(req); xfer->frlengths[1] = len; xfer->nframes = xfer->frlengths[1] ? 2 : 1; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; } } @@ -3033,7 +3033,7 @@ tr_setup: break; default: /* Error */ - DPRINTF("error=%s\n", usb2_errstr(xfer->error)); + DPRINTF("error=%s\n", usbd_errstr(xfer->error)); if (xfer->error == USB_ERR_CANCELLED) { /* do nothing - we are detaching */ break; @@ -3059,7 +3059,7 @@ uaudio_set_speed(struct usb_device *udev data[1] = speed >> 8; data[2] = speed >> 16; - return (usb2_do_request(udev, &Giant, &req, data)); + return (usbd_do_request(udev, &Giant, &req, data)); } static int @@ -3105,7 +3105,7 @@ uaudio_mixer_ctl_set(struct uaudio_softc /* start the transfer, if not already started */ - usb2_transfer_start(sc->sc_mixer_xfer[0]); + usbd_transfer_start(sc->sc_mixer_xfer[0]); } static void @@ -3142,7 +3142,7 @@ uaudio_mixer_init_sub(struct uaudio_soft { DPRINTF("\n"); - if (usb2_transfer_setup(sc->sc_udev, &sc->sc_mixer_iface_index, + if (usbd_transfer_setup(sc->sc_udev, &sc->sc_mixer_iface_index, sc->sc_mixer_xfer, uaudio_mixer_config, 1, sc, mixer_get_lock(m))) { DPRINTFN(0, "could not allocate USB " @@ -3163,7 +3163,7 @@ uaudio_mixer_uninit_sub(struct uaudio_so { DPRINTF("\n"); - usb2_transfer_unsetup(sc->sc_mixer_xfer, 1); + usbd_transfer_unsetup(sc->sc_mixer_xfer, 1); return (0); } @@ -3242,10 +3242,10 @@ umidi_read_clear_stall_callback(struct u struct umidi_chan *chan = xfer->priv_sc; struct usb_xfer *xfer_other = chan->xfer[1]; - if (usb2_clear_stall_callback(xfer, xfer_other)) { + if (usbd_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); chan->flags &= ~UMIDI_FLAG_READ_STALL; - usb2_transfer_start(xfer_other); + usbd_transfer_start(xfer_other); } } @@ -3272,14 +3272,14 @@ umidi_bulk_read_callback(struct usb_xfer while (xfer->actlen >= 4) { - usb2_copy_out(xfer->frbuffers, pos, buf, 1); + usbd_copy_out(xfer->frbuffers, pos, buf, 1); cmd_len = umidi_cmd_to_len[buf[0] & 0xF]; /* command length */ cn = buf[0] >> 4; /* cable number */ sub = &chan->sub[cn]; if (cmd_len && (cn < chan->max_cable) && sub->read_open) { - usb2_fifo_put_data(sub->fifo.fp[USB_FIFO_RX], xfer->frbuffers, + usb_fifo_put_data(sub->fifo.fp[USB_FIFO_RX], xfer->frbuffers, pos + 1, cmd_len, 1); } else { /* ignore the command */ @@ -3293,22 +3293,22 @@ umidi_bulk_read_callback(struct usb_xfer DPRINTF("start\n"); if (chan->flags & UMIDI_FLAG_READ_STALL) { - usb2_transfer_start(chan->xfer[3]); + usbd_transfer_start(chan->xfer[3]); return; } xfer->frlengths[0] = xfer->max_data_length; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); return; default: tr_error: - DPRINTF("error=%s\n", usb2_errstr(xfer->error)); + DPRINTF("error=%s\n", usbd_errstr(xfer->error)); if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ chan->flags |= UMIDI_FLAG_READ_STALL; - usb2_transfer_start(chan->xfer[3]); + usbd_transfer_start(chan->xfer[3]); } return; @@ -3321,10 +3321,10 @@ umidi_write_clear_stall_callback(struct struct umidi_chan *chan = xfer->priv_sc; struct usb_xfer *xfer_other = chan->xfer[0]; - if (usb2_clear_stall_callback(xfer, xfer_other)) { + if (usbd_clear_stall_callback(xfer, xfer_other)) { DPRINTF("stall cleared\n"); chan->flags &= ~UMIDI_FLAG_WRITE_STALL; - usb2_transfer_start(xfer_other); + usbd_transfer_start(xfer_other); } } @@ -3481,7 +3481,7 @@ umidi_bulk_write_callback(struct usb_xfe DPRINTF("start\n"); if (chan->flags & UMIDI_FLAG_WRITE_STALL) { - usb2_transfer_start(chan->xfer[2]); + usbd_transfer_start(chan->xfer[2]); return; } total_length = 0; /* reset */ @@ -3497,7 +3497,7 @@ umidi_bulk_write_callback(struct usb_xfe sub = &chan->sub[chan->curr_cable]; if (sub->write_open) { - usb2_fifo_get_data(sub->fifo.fp[USB_FIFO_TX], + usb_fifo_get_data(sub->fifo.fp[USB_FIFO_TX], xfer->frbuffers, total_length, 1, &actlen, 0); } else { @@ -3505,7 +3505,7 @@ umidi_bulk_write_callback(struct usb_xfe } if (actlen) { - usb2_copy_out(xfer->frbuffers, total_length, &buf, 1); + usbd_copy_out(xfer->frbuffers, total_length, &buf, 1); tr_any = 1; @@ -3517,7 +3517,7 @@ umidi_bulk_write_callback(struct usb_xfe sub->temp_cmd[0], sub->temp_cmd[1], sub->temp_cmd[2], sub->temp_cmd[3]); - usb2_copy_in(xfer->frbuffers, total_length, + usbd_copy_in(xfer->frbuffers, total_length, sub->temp_cmd, 4); total_length += 4; @@ -3543,18 +3543,18 @@ umidi_bulk_write_callback(struct usb_xfe if (total_length) { xfer->frlengths[0] = total_length; - usb2_start_hardware(xfer); + usbd_transfer_submit(xfer); } return; default: /* Error */ - DPRINTF("error=%s\n", usb2_errstr(xfer->error)); + DPRINTF("error=%s\n", usbd_errstr(xfer->error)); if (xfer->error != USB_ERR_CANCELLED) { /* try to clear stall first */ chan->flags |= UMIDI_FLAG_WRITE_STALL; - usb2_transfer_start(chan->xfer[2]); + usbd_transfer_start(chan->xfer[2]); } return; @@ -3587,7 +3587,7 @@ umidi_start_read(struct usb_fifo *fifo) { struct umidi_chan *chan = fifo->priv_sc0; - usb2_transfer_start(chan->xfer[1]); + usbd_transfer_start(chan->xfer[1]); } static void @@ -3614,7 +3614,7 @@ umidi_start_write(struct usb_fifo *fifo) { struct umidi_chan *chan = fifo->priv_sc0; - usb2_transfer_start(chan->xfer[0]); + usbd_transfer_start(chan->xfer[0]); } static void @@ -3629,8 +3629,8 @@ umidi_stop_write(struct usb_fifo *fifo) if (--(chan->write_open_refcount) == 0) { DPRINTF("(stopping write transfer)\n"); - usb2_transfer_stop(chan->xfer[2]); - usb2_transfer_stop(chan->xfer[0]); + usbd_transfer_stop(chan->xfer[2]); + usbd_transfer_stop(chan->xfer[0]); } } @@ -3641,7 +3641,7 @@ umidi_open(struct usb_fifo *fifo, int ff struct umidi_sub_chan *sub = umidi_sub_by_fifo(fifo); if (fflags & FREAD) { - if (usb2_fifo_alloc_buffer(fifo, 4, (1024 / 4))) { + if (usb_fifo_alloc_buffer(fifo, 4, (1024 / 4))) { return (ENOMEM); } mtx_lock(fifo->priv_mtx); @@ -3650,7 +3650,7 @@ umidi_open(struct usb_fifo *fifo, int ff mtx_unlock(fifo->priv_mtx); } if (fflags & FWRITE) { - if (usb2_fifo_alloc_buffer(fifo, 32, (1024 / 32))) { + if (usb_fifo_alloc_buffer(fifo, 32, (1024 / 32))) { return (ENOMEM); } /* clear stall first */ @@ -3670,10 +3670,10 @@ static void umidi_close(struct usb_fifo *fifo, int fflags) { if (fflags & FREAD) { - usb2_fifo_free_buffer(fifo); + usb_fifo_free_buffer(fifo); } if (fflags & FWRITE) { - usb2_fifo_free_buffer(fifo); + usb_fifo_free_buffer(fifo); } } @@ -3716,18 +3716,18 @@ umidi_probe(device_t dev) int error; uint32_t n; - if (usb2_set_alt_interface_index(sc->sc_udev, chan->iface_index, + if (usbd_set_alt_interface_index(sc->sc_udev, chan->iface_index, chan->iface_alt_index)) { DPRINTF("setting of alternate index failed!\n"); goto detach; } - usb2_set_parent_iface(sc->sc_udev, chan->iface_index, sc->sc_mixer_iface_index); + usbd_set_parent_iface(sc->sc_udev, chan->iface_index, sc->sc_mixer_iface_index); - error = usb2_transfer_setup(uaa->device, &chan->iface_index, + error = usbd_transfer_setup(uaa->device, &chan->iface_index, chan->xfer, umidi_config, UMIDI_N_TRANSFER, chan, &chan->mtx); if (error) { - DPRINTF("error=%s\n", usb2_errstr(error)); + DPRINTF("error=%s\n", usbd_errstr(error)); goto detach; } if ((chan->max_cable > UMIDI_CABLES_MAX) || @@ -3739,7 +3739,7 @@ umidi_probe(device_t dev) sub = &chan->sub[n]; - error = usb2_fifo_attach(sc->sc_udev, chan, &chan->mtx, + error = usb_fifo_attach(sc->sc_udev, chan, &chan->mtx, &umidi_fifo_methods, &sub->fifo, unit, n, chan->iface_index, UID_ROOT, GID_OPERATOR, 0644); @@ -3757,7 +3757,7 @@ umidi_probe(device_t dev) * NOTE: at least one device will not work properly unless * the BULK pipe is open all the time. */ - usb2_transfer_start(chan->xfer[1]); + usbd_transfer_start(chan->xfer[1]); mtx_unlock(&chan->mtx); @@ -3775,17 +3775,17 @@ umidi_detach(device_t dev) uint32_t n; for (n = 0; n < UMIDI_CABLES_MAX; n++) { - usb2_fifo_detach(&chan->sub[n].fifo); + usb_fifo_detach(&chan->sub[n].fifo); } mtx_lock(&chan->mtx); - usb2_transfer_stop(chan->xfer[3]); - usb2_transfer_stop(chan->xfer[1]); + usbd_transfer_stop(chan->xfer[3]); + usbd_transfer_stop(chan->xfer[1]); mtx_unlock(&chan->mtx); - usb2_transfer_unsetup(chan->xfer, UMIDI_N_TRANSFER); + usbd_transfer_unsetup(chan->xfer, UMIDI_N_TRANSFER); mtx_destroy(&chan->mtx); Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Mon Jun 15 00:33:18 2009 (r194227) +++ head/sys/dev/usb/controller/at91dci.c Mon Jun 15 01:02:43 2009 (r194228) @@ -260,7 +260,7 @@ at91dci_wakeup_peer(struct at91dci_softc /* wait 8 milliseconds */ /* Wait for reset to complete. */ - usb2_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 125); AT91_UDP_WRITE_4(sc, AT91_UDP_GSTATE, 0); } @@ -321,7 +321,7 @@ at91dci_setup_rx(struct at91dci_td *td) td->fifo_reg, (void *)&req, sizeof(req)); /* copy data into real buffer */ - usb2_copy_in(td->pc, 0, &req, sizeof(req)); + usbd_copy_in(td->pc, 0, &req, sizeof(req)); td->offset = sizeof(req); td->remainder = 0; @@ -442,7 +442,7 @@ repeat: return (0); /* we are complete */ } while (count > 0) { - usb2_get_page(td->pc, td->offset, &buf_res); + usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ if (buf_res.length > count) { @@ -549,7 +549,7 @@ repeat: } while (count > 0) { - usb2_get_page(td->pc, td->offset, &buf_res); + usbd_get_page(td->pc, td->offset, &buf_res); /* get correct length */ if (buf_res.length > count) { @@ -865,7 +865,7 @@ at91dci_setup_standard_chain(struct usb_ DPRINTFN(9, "addr=%d endpt=%d sumlen=%d speed=%d\n", xfer->address, UE_GET_ADDR(xfer->endpointno), - xfer->sumlen, usb2_get_speed(xfer->xroot->udev)); + xfer->sumlen, usbd_get_speed(xfer->xroot->udev)); temp.max_frame_size = xfer->max_frame_size; @@ -1046,11 +1046,11 @@ at91dci_start_standard_chain(struct usb_ DPRINTFN(15, "enable interrupts on endpoint %d\n", ep_no); /* put transfer on interrupt queue */ - usb2_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); + usbd_transfer_enqueue(&xfer->xroot->bus->intr_q, xfer); /* start timeout, if any */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 01:05:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5376106564A; Mon, 15 Jun 2009 01:05:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A29D88FC15; Mon, 15 Jun 2009 01:05:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F15kIl072424; Mon, 15 Jun 2009 01:05:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F15k9c072423; Mon, 15 Jun 2009 01:05:46 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906150105.n5F15k9c072423@svn.freebsd.org> From: Andrew Thompson Date: Mon, 15 Jun 2009 01:05: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: r194229 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 01:05:47 -0000 Author: thompsa Date: Mon Jun 15 01:05:46 2009 New Revision: 194229 URL: http://svn.freebsd.org/changeset/base/194229 Log: Fix compile with changes to the usb_config struct. Modified: head/sys/dev/ata/ata-usb.c Modified: head/sys/dev/ata/ata-usb.c ============================================================================== --- head/sys/dev/ata/ata-usb.c Mon Jun 15 01:02:43 2009 (r194228) +++ head/sys/dev/ata/ata-usb.c Mon Jun 15 01:05:46 2009 (r194229) @@ -166,93 +166,93 @@ struct usb_config atausb2_config[ATAUSB_ .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb_device_request), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_reset1_callback, - .mh.timeout = 5000, /* 5 seconds */ - .mh.interval = 500, /* 500 milliseconds */ + .bufsize = sizeof(struct usb_device_request), + .flags = {}, + .callback = &atausb2_t_bbb_reset1_callback, + .timeout = 5000, /* 5 seconds */ + .interval = 500, /* 500 milliseconds */ }, [ATAUSB_T_BBB_RESET2] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb_device_request), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_reset2_callback, - .mh.timeout = 5000, /* 5 seconds */ - .mh.interval = 50, /* 50 milliseconds */ + .bufsize = sizeof(struct usb_device_request), + .flags = {}, + .callback = &atausb2_t_bbb_reset2_callback, + .timeout = 5000, /* 5 seconds */ + .interval = 50, /* 50 milliseconds */ }, [ATAUSB_T_BBB_RESET3] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb_device_request), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_reset3_callback, - .mh.timeout = 5000, /* 5 seconds */ - .mh.interval = 50, /* 50 milliseconds */ + .bufsize = sizeof(struct usb_device_request), + .flags = {}, + .callback = &atausb2_t_bbb_reset3_callback, + .timeout = 5000, /* 5 seconds */ + .interval = 50, /* 50 milliseconds */ }, [ATAUSB_T_BBB_COMMAND] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = sizeof(struct bbb_cbw), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_command_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = sizeof(struct bbb_cbw), + .flags = {}, + .callback = &atausb2_t_bbb_command_callback, + .timeout = 5000, /* 5 seconds */ }, [ATAUSB_T_BBB_DATA_READ] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = ATAUSB_BULK_SIZE, - .mh.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, - .mh.callback = &atausb2_t_bbb_data_read_callback, - .mh.timeout = 0, /* overwritten later */ + .bufsize = ATAUSB_BULK_SIZE, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .callback = &atausb2_t_bbb_data_read_callback, + .timeout = 0, /* overwritten later */ }, [ATAUSB_T_BBB_DATA_RD_CS] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb_device_request), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_data_rd_cs_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = sizeof(struct usb_device_request), + .flags = {}, + .callback = &atausb2_t_bbb_data_rd_cs_callback, + .timeout = 5000, /* 5 seconds */ }, [ATAUSB_T_BBB_DATA_WRITE] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .mh.bufsize = ATAUSB_BULK_SIZE, - .mh.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, - .mh.callback = &atausb2_t_bbb_data_write_callback, - .mh.timeout = 0, /* overwritten later */ + .bufsize = ATAUSB_BULK_SIZE, + .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,}, + .callback = &atausb2_t_bbb_data_write_callback, + .timeout = 0, /* overwritten later */ }, [ATAUSB_T_BBB_DATA_WR_CS] = { .type = UE_CONTROL, .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, - .mh.bufsize = sizeof(struct usb_device_request), - .mh.flags = {}, - .mh.callback = &atausb2_t_bbb_data_wr_cs_callback, - .mh.timeout = 5000, /* 5 seconds */ + .bufsize = sizeof(struct usb_device_request), + .flags = {}, + .callback = &atausb2_t_bbb_data_wr_cs_callback, + .timeout = 5000, /* 5 seconds */ }, [ATAUSB_T_BBB_STATUS] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .mh.bufsize = sizeof(struct bbb_csw), - .mh.flags = {.short_xfer_ok = 1,}, - .mh.callback = &atausb2_t_bbb_status_callback, - .mh.timeout = 5000, /* ms */ + .bufsize = sizeof(struct bbb_csw), + .flags = {.short_xfer_ok = 1,}, + .callback = &atausb2_t_bbb_status_callback, + .timeout = 5000, /* ms */ }, }; From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 01:09:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24C431065672; Mon, 15 Jun 2009 01:09:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 116138FC13; Mon, 15 Jun 2009 01:09:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F19Ksr072685; Mon, 15 Jun 2009 01:09:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F19JGt072651; Mon, 15 Jun 2009 01:09:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906150109.n5F19JGt072651@svn.freebsd.org> From: Andrew Thompson Date: Mon, 15 Jun 2009 01:09: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: r194230 - in head/sys/dev/usb: . net quirk serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 01:09:21 -0000 Author: thompsa Date: Mon Jun 15 01:09:19 2009 New Revision: 194230 URL: http://svn.freebsd.org/changeset/base/194230 Log: Fix _USB2_* refernces in the header protection defines. Modified: head/sys/dev/usb/net/usb_ethernet.h head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/serial/usb_serial.h head/sys/dev/usb/usb.h head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_busdma.h head/sys/dev/usb/usb_controller.h head/sys/dev/usb/usb_core.h head/sys/dev/usb/usb_debug.h head/sys/dev/usb/usb_defs.h head/sys/dev/usb/usb_dev.h head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_dynamic.h head/sys/dev/usb/usb_endian.h head/sys/dev/usb/usb_error.h head/sys/dev/usb/usb_generic.h head/sys/dev/usb/usb_handle_request.h head/sys/dev/usb/usb_hid.h head/sys/dev/usb/usb_hub.h head/sys/dev/usb/usb_ioctl.h head/sys/dev/usb/usb_lookup.h head/sys/dev/usb/usb_mbuf.h head/sys/dev/usb/usb_mfunc.h head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usb_parse.h head/sys/dev/usb/usb_pci.h head/sys/dev/usb/usb_process.h head/sys/dev/usb/usb_request.h head/sys/dev/usb/usb_revision.h head/sys/dev/usb/usb_transfer.h head/sys/dev/usb/usb_util.h head/sys/dev/usb/usbhid.h Modified: head/sys/dev/usb/net/usb_ethernet.h ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/net/usb_ethernet.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_ETHERNET_H_ -#define _USB2_ETHERNET_H_ +#ifndef _USB_ETHERNET_H_ +#define _USB_ETHERNET_H_ #include "opt_inet.h" @@ -119,4 +119,4 @@ int uether_rxbuf(struct usb_ether *, unsigned int, unsigned int); void uether_rxflush(struct usb_ether *); uint8_t uether_is_gone(struct usb_ether *); -#endif /* _USB2_ETHERNET_H_ */ +#endif /* _USB_ETHERNET_H_ */ Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/quirk/usb_quirk.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_QUIRK_H_ -#define _USB2_QUIRK_H_ +#ifndef _USB_QUIRK_H_ +#define _USB_QUIRK_H_ /* NOTE: UQ_NONE is not a valid quirk */ enum { /* keep in sync with usb_quirk_str table */ @@ -56,4 +56,4 @@ enum { /* keep in sync with usb_quirk_st USB_QUIRK_MAX }; -#endif /* _USB2_QUIRK_H_ */ +#endif /* _USB_QUIRK_H_ */ Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/serial/usb_serial.h Mon Jun 15 01:09:19 2009 (r194230) @@ -64,8 +64,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _USB2_SERIAL_H_ -#define _USB2_SERIAL_H_ +#ifndef _USB_SERIAL_H_ +#define _USB_SERIAL_H_ #include #include @@ -196,4 +196,4 @@ uint8_t ucom_get_data(struct ucom_softc void ucom_put_data(struct ucom_softc *, struct usb_page_cache *, uint32_t, uint32_t); uint8_t ucom_cfg_is_gone(struct ucom_softc *); -#endif /* _USB2_SERIAL_H_ */ +#endif /* _USB_SERIAL_H_ */ Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb.h Mon Jun 15 01:09:19 2009 (r194230) @@ -36,8 +36,8 @@ * USB v3.0 */ -#ifndef _USB2_STANDARD_H_ -#define _USB2_STANDARD_H_ +#ifndef _USB_STANDARD_H_ +#define _USB_STANDARD_H_ #include @@ -642,4 +642,4 @@ struct usb_port_status { } __packed; typedef struct usb_port_status usb_port_status_t; -#endif /* _USB2_STANDARD_H_ */ +#endif /* _USB_STANDARD_H_ */ Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_bus.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_BUS_H_ -#define _USB2_BUS_H_ +#ifndef _USB_BUS_H_ +#define _USB_BUS_H_ /* * The following structure defines the USB explore message sent to the USB @@ -105,4 +105,4 @@ struct usb_bus { } scratch[1]; }; -#endif /* _USB2_BUS_H_ */ +#endif /* _USB_BUS_H_ */ Modified: head/sys/dev/usb/usb_busdma.h ============================================================================== --- head/sys/dev/usb/usb_busdma.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_busdma.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_BUSDMA_H_ -#define _USB2_BUSDMA_H_ +#ifndef _USB_BUSDMA_H_ +#define _USB_BUSDMA_H_ #include #include @@ -172,4 +172,4 @@ void usb_pc_cpu_invalidate(struct usb_pa void usb_pc_dmamap_destroy(struct usb_page_cache *pc); void usb_pc_free_mem(struct usb_page_cache *pc); -#endif /* _USB2_BUSDMA_H_ */ +#endif /* _USB_BUSDMA_H_ */ Modified: head/sys/dev/usb/usb_controller.h ============================================================================== --- head/sys/dev/usb/usb_controller.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_controller.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_CONTROLLER_H_ -#define _USB2_CONTROLLER_H_ +#ifndef _USB_CONTROLLER_H_ +#define _USB_CONTROLLER_H_ /* defines */ @@ -190,4 +190,4 @@ uint16_t usb_isoc_time_expand(struct usb uint16_t usbd_fs_isoc_schedule_isoc_time_expand(struct usb_device *udev, struct usb_fs_isoc_schedule **pp_start, struct usb_fs_isoc_schedule **pp_end, uint16_t isoc_time); uint8_t usbd_fs_isoc_schedule_alloc(struct usb_fs_isoc_schedule *fss, uint8_t *pstart, uint16_t len); -#endif /* _USB2_CONTROLLER_H_ */ +#endif /* _USB_CONTROLLER_H_ */ Modified: head/sys/dev/usb/usb_core.h ============================================================================== --- head/sys/dev/usb/usb_core.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_core.h Mon Jun 15 01:09:19 2009 (r194230) @@ -28,8 +28,8 @@ * Including this file is mandatory for all USB related c-files in the kernel. */ -#ifndef _USB2_CORE_H_ -#define _USB2_CORE_H_ +#ifndef _USB_CORE_H_ +#define _USB_CORE_H_ #define USB_STACK_VERSION 2000 /* 2.0 */ @@ -542,4 +542,4 @@ uint8_t usbd_get_device_index(struct usb void usbd_set_power_mode(struct usb_device *udev, uint8_t power_mode); uint8_t usbd_device_attached(struct usb_device *udev); -#endif /* _USB2_CORE_H_ */ +#endif /* _USB_CORE_H_ */ Modified: head/sys/dev/usb/usb_debug.h ============================================================================== --- head/sys/dev/usb/usb_debug.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_debug.h Mon Jun 15 01:09:19 2009 (r194230) @@ -26,8 +26,8 @@ /* This file contains various factored out debug macros. */ -#ifndef _USB2_DEBUG_H_ -#define _USB2_DEBUG_H_ +#ifndef _USB_DEBUG_H_ +#define _USB_DEBUG_H_ /* Declare parent SYSCTL USB node. */ SYSCTL_DECL(_hw_usb); @@ -62,4 +62,4 @@ void usb_dump_queue(struct usb_endpoint void usb_dump_endpoint(struct usb_endpoint *ep); void usb_dump_xfer(struct usb_xfer *xfer); -#endif /* _USB2_DEBUG_H_ */ +#endif /* _USB_DEBUG_H_ */ Modified: head/sys/dev/usb/usb_defs.h ============================================================================== --- head/sys/dev/usb/usb_defs.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_defs.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_DEFS_H_ -#define _USB2_DEFS_H_ +#ifndef _USB_DEFS_H_ +#define _USB_DEFS_H_ /* Definition of some hardcoded USB constants. */ @@ -58,4 +58,4 @@ #if (USB_ROOT_HUB_ADDR >= USB_MIN_DEVICES) #error "The root hub address must be less than USB_MIN_DEVICES." #endif -#endif /* _USB2_DEFS_H_ */ +#endif /* _USB_DEFS_H_ */ Modified: head/sys/dev/usb/usb_dev.h ============================================================================== --- head/sys/dev/usb/usb_dev.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_dev.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_DEV_H_ -#define _USB2_DEV_H_ +#ifndef _USB_DEV_H_ +#define _USB_DEV_H_ #include #include @@ -204,4 +204,4 @@ int usb_read_symlink(uint8_t *user_ptr, uint32_t user_len); void usb_fifo_set_close_zlp(struct usb_fifo *, uint8_t); -#endif /* _USB2_DEV_H_ */ +#endif /* _USB_DEV_H_ */ Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_device.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_DEVICE_H_ -#define _USB2_DEVICE_H_ +#ifndef _USB_DEVICE_H_ +#define _USB_DEVICE_H_ struct usb_symlink; /* UGEN */ struct usb_device; /* linux compat */ @@ -256,4 +256,4 @@ struct usb_endpoint *usb_endpoint_foreac void usb_set_device_state(struct usb_device *udev, enum usb_dev_state state); -#endif /* _USB2_DEVICE_H_ */ +#endif /* _USB_DEVICE_H_ */ Modified: head/sys/dev/usb/usb_dynamic.h ============================================================================== --- head/sys/dev/usb/usb_dynamic.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_dynamic.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_DYNAMIC_H_ -#define _USB2_DYNAMIC_H_ +#ifndef _USB_DYNAMIC_H_ +#define _USB_DYNAMIC_H_ /* prototypes */ @@ -64,4 +64,4 @@ void usb_bus_unload(void *); uint8_t usb_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk); -#endif /* _USB2_DYNAMIC_H_ */ +#endif /* _USB_DYNAMIC_H_ */ Modified: head/sys/dev/usb/usb_endian.h ============================================================================== --- head/sys/dev/usb/usb_endian.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_endian.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_ENDIAN_H_ -#define _USB2_ENDIAN_H_ +#ifndef _USB_ENDIAN_H_ +#define _USB_ENDIAN_H_ #include #include @@ -116,4 +116,4 @@ typedef uint8_t uQWord[8]; (w)[7] = (uint8_t)(b7); \ } while (0) -#endif /* _USB2_ENDIAN_H_ */ +#endif /* _USB_ENDIAN_H_ */ Modified: head/sys/dev/usb/usb_error.h ============================================================================== --- head/sys/dev/usb/usb_error.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_error.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_ERROR_H_ -#define _USB2_ERROR_H_ +#ifndef _USB_ERROR_H_ +#define _USB_ERROR_H_ enum { /* keep in sync with usb_errstr_table */ USB_ERR_NORMAL_COMPLETION = 0, @@ -60,4 +60,4 @@ enum { /* keep in sync with usb_errstr_t USB_ERR_MAX }; -#endif /* _USB2_ERROR_H_ */ +#endif /* _USB_ERROR_H_ */ Modified: head/sys/dev/usb/usb_generic.h ============================================================================== --- head/sys/dev/usb/usb_generic.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_generic.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,10 +24,10 @@ * SUCH DAMAGE. */ -#ifndef _USB2_GENERIC_H_ -#define _USB2_GENERIC_H_ +#ifndef _USB_GENERIC_H_ +#define _USB_GENERIC_H_ extern struct usb_fifo_methods usb_ugen_methods; int ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur); -#endif /* _USB2_GENERIC_H_ */ +#endif /* _USB_GENERIC_H_ */ Modified: head/sys/dev/usb/usb_handle_request.h ============================================================================== --- head/sys/dev/usb/usb_handle_request.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_handle_request.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -#ifndef _USB2_HANDLE_REQUEST_H_ -#define _USB2_HANDLE_REQUEST_H_ +#ifndef _USB_HANDLE_REQUEST_H_ +#define _USB_HANDLE_REQUEST_H_ -#endif /* _USB2_HANDLE_REQUEST_H_ */ +#endif /* _USB_HANDLE_REQUEST_H_ */ Modified: head/sys/dev/usb/usb_hid.h ============================================================================== --- head/sys/dev/usb/usb_hid.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_hid.h Mon Jun 15 01:09:19 2009 (r194230) @@ -26,8 +26,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_CORE_HID_H_ -#define _USB2_CORE_HID_H_ +#ifndef _USB_CORE_HID_H_ +#define _USB_CORE_HID_H_ struct usb_hid_descriptor; struct usb_config_descriptor; @@ -92,4 +92,4 @@ usb_error_t usbd_req_get_hid_desc(struct void **descp, uint16_t *sizep, struct malloc_type *mem, uint8_t iface_index); -#endif /* _USB2_CORE_HID_H_ */ +#endif /* _USB_CORE_HID_H_ */ Modified: head/sys/dev/usb/usb_hub.h ============================================================================== --- head/sys/dev/usb/usb_hub.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_hub.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_HUB_H_ -#define _USB2_HUB_H_ +#ifndef _USB_HUB_H_ +#define _USB_HUB_H_ /* * The following structure defines an USB port. @@ -79,4 +79,4 @@ void usb_bus_power_update(struct usb_bus void usb_bus_powerd(struct usb_bus *bus); void uhub_root_intr(struct usb_bus *, const uint8_t *, uint8_t); -#endif /* _USB2_HUB_H_ */ +#endif /* _USB_HUB_H_ */ Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_ioctl.h Mon Jun 15 01:09:19 2009 (r194230) @@ -26,8 +26,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_IOCTL_H_ -#define _USB2_IOCTL_H_ +#ifndef _USB_IOCTL_H_ +#define _USB_IOCTL_H_ #include @@ -272,4 +272,4 @@ struct usb_gen_quirk { #define USB_DEV_QUIRK_ADD _IOW ('Q', 2, struct usb_gen_quirk) #define USB_DEV_QUIRK_REMOVE _IOW ('Q', 3, struct usb_gen_quirk) -#endif /* _USB2_IOCTL_H_ */ +#endif /* _USB_IOCTL_H_ */ Modified: head/sys/dev/usb/usb_lookup.h ============================================================================== --- head/sys/dev/usb/usb_lookup.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_lookup.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_LOOKUP_H_ -#define _USB2_LOOKUP_H_ +#ifndef _USB_LOOKUP_H_ +#define _USB_LOOKUP_H_ struct usb_attach_arg; @@ -119,4 +119,4 @@ const struct usb_device_id *usbd_lookup_ int usbd_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id, struct usb_attach_arg *uaa); -#endif /* _USB2_LOOKUP_H_ */ +#endif /* _USB_LOOKUP_H_ */ Modified: head/sys/dev/usb/usb_mbuf.h ============================================================================== --- head/sys/dev/usb/usb_mbuf.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_mbuf.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_MBUF_H_ -#define _USB2_MBUF_H_ +#ifndef _USB_MBUF_H_ +#define _USB_MBUF_H_ /* * The following structure defines a minimum re-implementation of the @@ -99,4 +99,4 @@ struct usb_ifqueue { void *usb_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq, usb_size_t block_size, uint16_t nblocks); -#endif /* _USB2_MBUF_H_ */ +#endif /* _USB_MBUF_H_ */ Modified: head/sys/dev/usb/usb_mfunc.h ============================================================================== --- head/sys/dev/usb/usb_mfunc.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_mfunc.h Mon Jun 15 01:09:19 2009 (r194230) @@ -26,8 +26,8 @@ /* This file contains various macro functions. */ -#ifndef _USB2_MFUNC_H_ -#define _USB2_MFUNC_H_ +#ifndef _USB_MFUNC_H_ +#define _USB_MFUNC_H_ #define USB_LOG2(n) ( \ ((x) <= (1<<0x00)) ? 0x00 : \ @@ -75,4 +75,4 @@ /* debug macro */ #define USB_ASSERT KASSERT -#endif /* _USB2_MFUNC_H_ */ +#endif /* _USB_MFUNC_H_ */ Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_msctest.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,10 +24,10 @@ * SUCH DAMAGE. */ -#ifndef _USB2_MSCTEST_H_ -#define _USB2_MSCTEST_H_ +#ifndef _USB_MSCTEST_H_ +#define _USB_MSCTEST_H_ usb_error_t usb_test_autoinstall(struct usb_device *udev, uint8_t iface_index, uint8_t do_eject); -#endif /* _USB2_MSCTEST_H_ */ +#endif /* _USB_MSCTEST_H_ */ Modified: head/sys/dev/usb/usb_parse.h ============================================================================== --- head/sys/dev/usb/usb_parse.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_parse.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_PARSE_H_ -#define _USB2_PARSE_H_ +#ifndef _USB_PARSE_H_ +#define _USB_PARSE_H_ /* structures */ @@ -51,4 +51,4 @@ uint8_t usbd_get_no_descriptors(struct u uint8_t usbd_get_no_alts(struct usb_config_descriptor *cd, struct usb_interface_descriptor *id); -#endif /* _USB2_PARSE_H_ */ +#endif /* _USB_PARSE_H_ */ Modified: head/sys/dev/usb/usb_pci.h ============================================================================== --- head/sys/dev/usb/usb_pci.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_pci.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_PCI_H_ -#define _USB2_PCI_H_ +#ifndef _USB_PCI_H_ +#define _USB_PCI_H_ /* * We don't want the following files included everywhere, that's why @@ -36,4 +36,4 @@ #include -#endif /* _USB2_PCI_H_ */ +#endif /* _USB_PCI_H_ */ Modified: head/sys/dev/usb/usb_process.h ============================================================================== --- head/sys/dev/usb/usb_process.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_process.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_PROCESS_H_ -#define _USB2_PROCESS_H_ +#ifndef _USB_PROCESS_H_ +#define _USB_PROCESS_H_ #include @@ -85,4 +85,4 @@ void usb_proc_mwait(struct usb_process * void usb_proc_free(struct usb_process *up); void *usb_proc_msignal(struct usb_process *up, void *pm0, void *pm1); -#endif /* _USB2_PROCESS_H_ */ +#endif /* _USB_PROCESS_H_ */ Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_request.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_REQUEST_H_ -#define _USB2_REQUEST_H_ +#ifndef _USB_REQUEST_H_ +#define _USB_REQUEST_H_ struct usb_process; @@ -103,4 +103,4 @@ usb_error_t usbd_req_set_device_feature( #define usbd_do_request(u,m,r,d) \ usbd_do_request_flags(u,m,r,d,0,NULL,USB_DEFAULT_TIMEOUT) -#endif /* _USB2_REQUEST_H_ */ +#endif /* _USB_REQUEST_H_ */ Modified: head/sys/dev/usb/usb_revision.h ============================================================================== --- head/sys/dev/usb/usb_revision.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_revision.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_REVISION_H_ -#define _USB2_REVISION_H_ +#ifndef _USB_REVISION_H_ +#define _USB_REVISION_H_ /* * The "USB_SPEED" macros defines all the supported USB speeds. @@ -74,4 +74,4 @@ enum usb_dev_state { USB_STATE_CONFIGURED, }; #define USB_STATE_MAX (USB_STATE_CONFIGURED+1) -#endif /* _USB2_REVISION_H_ */ +#endif /* _USB_REVISION_H_ */ Modified: head/sys/dev/usb/usb_transfer.h ============================================================================== --- head/sys/dev/usb/usb_transfer.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_transfer.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_TRANSFER_H_ -#define _USB2_TRANSFER_H_ +#ifndef _USB_TRANSFER_H_ +#define _USB_TRANSFER_H_ /* * The following structure defines the messages that is used to signal @@ -135,4 +135,4 @@ void usbd_transfer_timeout_ms(struct usb usb_timeout_t usbd_get_dma_delay(struct usb_bus *bus); void usbd_transfer_power_ref(struct usb_xfer *xfer, int val); -#endif /* _USB2_TRANSFER_H_ */ +#endif /* _USB_TRANSFER_H_ */ Modified: head/sys/dev/usb/usb_util.h ============================================================================== --- head/sys/dev/usb/usb_util.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usb_util.h Mon Jun 15 01:09:19 2009 (r194230) @@ -24,8 +24,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_UTIL_H_ -#define _USB2_UTIL_H_ +#ifndef _USB_UTIL_H_ +#define _USB_UTIL_H_ int device_delete_all_children(device_t dev); uint8_t usb_make_str_desc(void *ptr, uint16_t max_len, const char *s); @@ -34,4 +34,4 @@ void usb_pause_mtx(struct mtx *mtx, int void usb_printbcd(char *p, uint16_t p_len, uint16_t bcd); void usb_trim_spaces(char *p); -#endif /* _USB2_UTIL_H_ */ +#endif /* _USB_UTIL_H_ */ Modified: head/sys/dev/usb/usbhid.h ============================================================================== --- head/sys/dev/usb/usbhid.h Mon Jun 15 01:05:46 2009 (r194229) +++ head/sys/dev/usb/usbhid.h Mon Jun 15 01:09:19 2009 (r194230) @@ -26,8 +26,8 @@ * SUCH DAMAGE. */ -#ifndef _USB2_HID_H_ -#define _USB2_HID_H_ +#ifndef _USB_HID_H_ +#define _USB_HID_H_ #include @@ -173,4 +173,4 @@ struct usb_hid_descriptor { #define HIO_VOLATILE 0x080 #define HIO_BUFBYTES 0x100 -#endif /* _USB2_HID_H_ */ +#endif /* _USB_HID_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 02:17:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70A431065704; Mon, 15 Jun 2009 02:17:10 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1C08FC19; Mon, 15 Jun 2009 02:17:10 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F2HAlp076658; Mon, 15 Jun 2009 02:17:10 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F2HA9C076656; Mon, 15 Jun 2009 02:17:10 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906150217.n5F2HA9C076656@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 15 Jun 2009 02:17: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: r194231 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 02:17:11 -0000 Author: edwin Date: Mon Jun 15 02:17:10 2009 New Revision: 194231 URL: http://svn.freebsd.org/changeset/base/194231 Log: Undo the change in r193688 as suggested in conf/72076. People on IRC and the -doc mailinglist (June 2009) showed that this new format wasn't used or known widely enough to justify the change. Modified: head/share/timedef/de_DE.ISO8859-1.src head/share/timedef/de_DE.UTF-8.src Modified: head/share/timedef/de_DE.ISO8859-1.src ============================================================================== --- head/share/timedef/de_DE.ISO8859-1.src Mon Jun 15 01:09:19 2009 (r194230) +++ head/share/timedef/de_DE.ISO8859-1.src Mon Jun 15 02:17:10 2009 (r194231) @@ -59,7 +59,11 @@ Samstag # # x_fmt # -%Y-%m-%d +# Note about the new DIN5008, ISO8601 and EN28601 format of %Y-%m-%d: +# A quick poll on IRC and the -doc mailinglist (June 2009) showed that +# this format was not used often enough to push this change through. +# +%d.%m.%Y # # c_fmt # Modified: head/share/timedef/de_DE.UTF-8.src ============================================================================== --- head/share/timedef/de_DE.UTF-8.src Mon Jun 15 01:09:19 2009 (r194230) +++ head/share/timedef/de_DE.UTF-8.src Mon Jun 15 02:17:10 2009 (r194231) @@ -59,7 +59,11 @@ Samstag # # x_fmt # -%Y-%m-%d +# Note about the new DIN5008, ISO8601 and EN28601 format of %Y-%m-%d: +# A quick poll on IRC and the -doc mailinglist (June 2009) showed that +# this format was not used often enough to push this change through. +# +%d.%m.%Y # # c_fmt # From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 02:45:21 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE0B106564A; Mon, 15 Jun 2009 02:45:21 +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 A81AC8FC17; Mon, 15 Jun 2009 02:45:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5F2jG6X002969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Jun 2009 12:45:18 +1000 Date: Mon, 15 Jun 2009 12:45:16 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sam Leffler In-Reply-To: <4A359AA6.7010101@freebsd.org> Message-ID: <20090615114142.B775@besplex.bde.org> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> <20090615075134.K24645@delplex.bde.org> <4A359AA6.7010101@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, Ed Schouten , Bruce Evans Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 02:45:21 -0000 On Sun, 14 Jun 2009, Sam Leffler wrote: > Bruce Evans wrote: >> On Sun, 14 Jun 2009, Sam Leffler wrote: >> >>>> Log: >>>> Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. >>>> >>>> In the past there have been some reports of PRINTF_BUFR_SIZE not >>>> functioning correctly. Instead of having garbled console messages, we >>>> should just see whether the issues are still there and analyze them. >>> >>> When I suggested enabling this by default for SMP configurations I was >>> reminded it wasn't enabled because of potential stack overflow. >> >> Stack overflow shouldn't be a problem, since printf shouldn't be called >> recursively. > > You don't need recursion to overflow the stack. You should need it, since it the stack is going to overflow from another 128-512 bytes of unnecessary stuff on it, then it is too close to overflowing with 128-512 bytes of necessary stuff on it. > I'd love to see someone > properly lock printf/console output instead of kludges like PRINTF_BUFR_SIZE. Almost done (for FreeBSD-~5.2): non-production version with lots of debugging cruft: % --- subr_prf.c~~ Sun Jun 20 14:40:46 2004 % +++ subr_prf.c Mon Jun 15 11:39:29 2009 % @@ -468,4 +468,39 @@ % } % % +static int printf_lockcount; % +static int printf_timeout = 1000; % + % +static void % +printf_lock(void) % +{ % + struct timeval tv, tv1; % + static int t; % + int timeout; % + % + if (db_active) % + return; % + microuptime(&tv); % + timeout = printf_timeout; % + do { % + if (atomic_cmpset_acq_int(&printf_lockcount, 0, 1)) % + return; % + breakpoint(); % + DELAY(1000); % + } while (--timeout != 0); % + microuptime(&tv1); % + t = (tv1.tv_sec - tv.tv_sec) * 1000000 + tv1.tv_usec - tv.tv_usec; % + breakpoint(); % + atomic_add_acq_int(&printf_lockcount, 1); % +} % + % +static void % +printf_unlock(void) % +{ % + % + if (db_active) % + return; % + atomic_add_rel_int(&printf_lockcount, -1); % +} % + % /* % * Scaled down version of printf(3). % @@ -523,10 +558,13 @@ % radix = 10; % % + printf_lock(); % for (;;) { % padc = ' '; % width = 0; % while ((ch = (u_char)*fmt++) != '%') { % - if (ch == '\0') % + if (ch == '\0') { % + printf_unlock(); % return (retval); % + } % PCHAR(ch); % } % @@ -799,4 +837,5 @@ % } % #undef PCHAR % + breakpoint(); % } % The locking is centralized in kvprintf() like I said to, but this is excessive since kvprintf() is used even for strings. It will have to be applied only to printf() and vprintf() and maybe another function where the pca.bufr initializations are. The debugging code (and the original version without any debugging code) shows very interesting behaviour (bugs) for ddb. - ddb calls kvprintf() recursively! Only 2 levels I think. - when ddb calls kvprintf() recursively, it sometimes violates its own rules and calls via printf() instead of via db_printf(). - the above 2 bugs combined with implementation details give extreme slowness (< 1 char per second) when they occur. I have programmed the delay larger than necessary (1 second) so as to make such bugs more obvious. They are even obvious with a 50 ms delay due to the implementation details. These are: + db_printf() is essentially kvprintf() with db_putchar() as the per-char output routine + db_putchar() calls back to kvprintf() in some (unusual) cases. (In usual cases it calls cnputc() directly.) This gives the recursion. It also gives inefficiency, but no one notices unless there is a delay. With string printfs() also affected, and most strings being 1 character long (possibly preformatted by a string printf(), even a delay of 50 ms is very noticable. + When ddb calls back to kvprintf(), it intentionally breaks its own rule of never calling printf() directly. The PRINT_BUFR stuff doesn't expect this. + The unusual case where db_putchar() calls back to kvprintf() is the usual case for interactive debugger entry under ~5.2, so I saw it immediately. All versions of debugger entry erroneously print stuff before being fully entered. Debugger("") in ~5.2 uses db_printf() and this gives the recursion, etc., since db_putchar() is "smart" and knows that calls to db_printf() in non-debugger mode are errors, so it switches to printf(). kdb_enter() in -current calls printf() and thus misses benefits from the special handling in db_printf(). + The unusual case where db_putchar() calls back to kvprintf() is the usual case when someone sets the "debug.ddb_use_printf" sysctl to 1. At least 4 levels of recursion into kvprintf() are possible without anything else being wrong -- 1 for a normal call, 1 for a panic, plus 2 as above for db_printf(). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 04:05:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27B8106564A; Mon, 15 Jun 2009 04:05:38 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D218FC12; Mon, 15 Jun 2009 04:05:38 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F45cXJ078852; Mon, 15 Jun 2009 04:05:38 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F45cAm078851; Mon, 15 Jun 2009 04:05:38 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906150405.n5F45cAm078851@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 15 Jun 2009 04:05: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: r194232 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 04:05:39 -0000 Author: ariff Date: Mon Jun 15 04:05:38 2009 New Revision: 194232 URL: http://svn.freebsd.org/changeset/base/194232 Log: Remap type of polynomial interpolators for better polyphase coefficients quality: - Linear interpolator for oversampling factor larger and equal than 4096 (log2 = 12). - Quadratic interpolator for oversampling factor larger and equal than 256 (log2 = 8). Default oversampling factor (128 ~ log2 = 7) will use OPT32X, which provides better accuracy. Modified: head/sys/dev/sound/pcm/feeder_rate.c Modified: head/sys/dev/sound/pcm/feeder_rate.c ============================================================================== --- head/sys/dev/sound/pcm/feeder_rate.c Mon Jun 15 02:17:10 2009 (r194231) +++ head/sys/dev/sound/pcm/feeder_rate.c Mon Jun 15 04:05:38 2009 (r194232) @@ -789,13 +789,11 @@ z_resampler_sinc_len(struct z_info *info defined(Z_COEFF_INTER_BSPLINE) || defined(Z_COEFF_INTERP_OPT32X) || \ defined(Z_COEFF_INTERP_OPT16X) || defined(Z_COEFF_INTERP_OPT8X) || \ defined(Z_COEFF_INTERP_OPT4X) || defined(Z_COEFF_INTERP_OPT2X)) -#if Z_DRIFT_SHIFT >= 8 +#if Z_DRIFT_SHIFT >= 12 #define Z_COEFF_INTERP_LINEAR 1 -#elif Z_DRIFT_SHIFT == 7 +#elif Z_DRIFT_SHIFT >= 8 #define Z_COEFF_INTERP_QUADRATIC 1 -#elif Z_DRIFT_SHIFT == 6 -#define Z_COEFF_INTERP_HERMITE 1 -#elif Z_DRIFT_SHIFT == 5 +#elif Z_DRIFT_SHIFT >= 5 #define Z_COEFF_INTERP_OPT32X 1 #elif Z_DRIFT_SHIFT == 4 #define Z_COEFF_INTERP_OPT16X 1 From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 04:31:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1AD1106564A; Mon, 15 Jun 2009 04:31:34 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF69A8FC14; Mon, 15 Jun 2009 04:31:34 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5F4VYTk079322; Mon, 15 Jun 2009 04:31:34 GMT (envelope-from ariff@svn.freebsd.org) Received: (from ariff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5F4VYHB079320; Mon, 15 Jun 2009 04:31:34 GMT (envelope-from ariff@svn.freebsd.org) Message-Id: <200906150431.n5F4VYHB079320@svn.freebsd.org> From: Ariff Abdullah Date: Mon, 15 Jun 2009 04:31: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: r194233 - in head/sys: dev/sound tools/sound X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 04:31:35 -0000 Author: ariff Date: Mon Jun 15 04:31:34 2009 New Revision: 194233 URL: http://svn.freebsd.org/changeset/base/194233 Log: - Add a way to change filter oversampling factor through FEEDER_RATE_PRESET "OVERSAMPLING_FACTOR:X .. .." where X = log2(oversampling factor). - Lower down default filter oversampling factor from 128 (log2 = 7) to 32 (log2 = 5), saving worth of 80 Kb. The use of better polynomial interpolator will raise its conversion quality/accuracy to match (or slightly better) with previous settings. - Bump driver version. Modified: head/sys/dev/sound/version.h head/sys/tools/sound/feeder_rate_mkfilter.awk Modified: head/sys/dev/sound/version.h ============================================================================== --- head/sys/dev/sound/version.h Mon Jun 15 04:05:38 2009 (r194232) +++ head/sys/dev/sound/version.h Mon Jun 15 04:31:34 2009 (r194233) @@ -37,6 +37,6 @@ * Last 2 decimal places reserved for daily versioning, starting * with 0. */ -#define SND_DRV_VERSION 2009060800 +#define SND_DRV_VERSION 2009061500 #endif /* !_SND_VERSION_H_ */ Modified: head/sys/tools/sound/feeder_rate_mkfilter.awk ============================================================================== --- head/sys/tools/sound/feeder_rate_mkfilter.awk Mon Jun 15 04:05:38 2009 (r194232) +++ head/sys/tools/sound/feeder_rate_mkfilter.awk Mon Jun 15 04:31:34 2009 (r194233) @@ -379,8 +379,15 @@ function filter_parse(s, a, i, attn, ale split(s, a, ":"); alen = length(a); + if (alen > 0 && a[1] == "OVERSAMPLING_FACTOR") { + if (alen != 2) + return (-1); + init_drift(floor(a[2])); + return (-1); + } + if (alen == 1 || alen == 2) { - if (a[1] == "nyquist_hover") { + if (a[1] == "NYQUIST_HOVER") { i = 1.0 * a[2]; Z_NYQUIST_HOVER = (i > 0.0 && i < 1.0) ? i : 0.0; return (-1); @@ -493,6 +500,33 @@ function genlerp(bit, use64, lerp) bit, (bit < 10) ? "\t" : "", lerp); } +function init_drift(drift, xdrift) +{ + xdrift = floor(drift); + + if (Z_DRIFT_SHIFT != -1) { + if (xdrift != Z_DRIFT_SHIFT) + printf("#error Z_DRIFT_SHIFT reinitialize!\n"); + return; + } + + # + # Initialize filter oversampling factor, or in other word + # Z_DRIFT_SHIFT. + # + if (xdrift < 0) + xdrift = 1; + else if (xdrift > 31) + xdrift = 31; + + Z_DRIFT_SHIFT = xdrift; + Z_DRIFT_ONE = shl(1, Z_DRIFT_SHIFT); + + Z_SHIFT = Z_FULL_SHIFT - Z_DRIFT_SHIFT; + Z_ONE = shl(1, Z_SHIFT); + Z_MASK = Z_ONE - 1; +} + BEGIN { I0_EPSILON = 1e-21; M_PI = atan2(0.0, -1.0); @@ -511,25 +545,14 @@ BEGIN { Z_INTERP_COEFF_SHIFT = 24; Z_INTERP_COEFF_ONE = shl(1, Z_INTERP_COEFF_SHIFT); - # - # Filter oversampling factor. - # - # 6, 7, or 8 depending on how much you can trade off between memory - # consumption (due to large tables) and precision / quality. - # - Z_DRIFT_SHIFT = 7; - Z_DRIFT_ONE = shl(1, Z_DRIFT_SHIFT); - - Z_SHIFT = Z_FULL_SHIFT - Z_DRIFT_SHIFT; - Z_ONE = shl(1, Z_SHIFT); - Z_MASK = Z_ONE - 1; - Z_LINEAR_FULL_SHIFT = Z_FULL_SHIFT; Z_LINEAR_FULL_ONE = shl(1, Z_LINEAR_FULL_SHIFT); Z_LINEAR_SHIFT = 8; Z_LINEAR_UNSHIFT = Z_LINEAR_FULL_SHIFT - Z_LINEAR_SHIFT; Z_LINEAR_ONE = shl(1, Z_LINEAR_SHIFT) + Z_DRIFT_SHIFT_DEFAULT = 5; + Z_DRIFT_SHIFT = -1; # meehhhh... let it overflow... #Z_SCALE_SHIFT = 31; #Z_SCALE_ONE = shl(1, Z_SCALE_SHIFT); @@ -595,6 +618,8 @@ BEGIN { beta = Popts["beta"]; nmult = Popts["nmult"]; rolloff = Popts["rolloff"]; + if (Z_DRIFT_SHIFT == -1) + init_drift(Z_DRIFT_SHIFT_DEFAULT); ztab[imp["quality"] - 2] = \ mkfilter(imp, nmult, rolloff, beta, Z_DRIFT_ONE); imp["quality"]++; From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 06:10:25 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65CD4106566C; Mon, 15 Jun 2009 06:10:25 +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 2278E8FC08; Mon, 15 Jun 2009 06:10:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n5F68lAZ063805; Mon, 15 Jun 2009 00:08:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 15 Jun 2009 00:09:09 -0600 (MDT) Message-Id: <20090615.000909.-1219445083.imp@bsdimp.com> To: kensmith@cse.Buffalo.EDU From: "M. Warner Losh" In-Reply-To: <1245014030.12125.34.camel@neo.cse.buffalo.edu> References: <200906141953.n5EJrqg5058709@svn.freebsd.org> <1245014030.12125.34.camel@neo.cse.buffalo.edu> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, simon@FreeBSD.org Subject: Re: svn commit: r194210 - 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, 15 Jun 2009 06:10:25 -0000 In message: <1245014030.12125.34.camel@neo.cse.buffalo.edu> Ken Smith writes: : On Sun, 2009-06-14 at 19:53 +0000, Simon L. Nielsen wrote: : > Author: simon : > Date: Sun Jun 14 19:53:52 2009 : > New Revision: 194210 : > URL: http://svn.freebsd.org/changeset/base/194210 : > : > Log: : > Bump __FreeBSD_version for OpenSSL 0.9.8k import. : > : > Modified: : > head/sys/sys/param.h : > : > Modified: head/sys/sys/param.h : > ============================================================================== : > --- head/sys/sys/param.h Sun Jun 14 19:51:43 2009 (r194209) : > +++ head/sys/sys/param.h Sun Jun 14 19:53:52 2009 (r194210) : > @@ -57,7 +57,7 @@ : > * is created, otherwise 1. : > */ : > #undef __FreeBSD_version : > -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ : > +#define __FreeBSD_version 800098 /* Master, propagated to newvers */ : > : > #ifndef LOCORE : > #include : : It's been suggested we change the heuristic to be stable branches start : with 200. I think we're going to do that so don't panic about there : only being one number left for changes between now and the time we : branch. Why not 500? : At first it surprised me we ate through almost 100 version numbers in : head, which is a place traditionally abi changes are *expected* and the : attitude has more or less been head is a free-for-all with all bets off. : But some IRC chatter enlightened me to there actually being people who : do advanced testing of ports and whatnot in head under the encouragement : of portmgr@ despite its free-for-all nature to try and cut down on work : during later stages of the release. That seems reasonable so I think in : general starting to give more than 100 bumps to work with in head is : worthwhile. I think so too. If we're going to change, we might as well change big and infrequently. Warner From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 06:18:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71549106566C; Mon, 15 Jun 2009 06:18:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 06F618FC19; Mon, 15 Jun 2009 06:18:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5F6Hxpc003090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Jun 2009 16:18:00 +1000 Date: Mon, 15 Jun 2009 16:17:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20090615114142.B775@besplex.bde.org> Message-ID: <20090615153040.R1080@besplex.bde.org> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> <20090615075134.K24645@delplex.bde.org> <4A359AA6.7010101@freebsd.org> <20090615114142.B775@besplex.bde.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, Sam Leffler , Ed Schouten , src-committers@FreeBSD.org Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 06:18:05 -0000 On Mon, 15 Jun 2009, Bruce Evans wrote: > On Sun, 14 Jun 2009, Sam Leffler wrote: >> I'd love to see someone properly lock printf/console output instead of >> kludges like PRINTF_BUFR_SIZE. > > Almost done (for FreeBSD-~5.2): non-production version with lots of debugging > cruft: This version for RELENG_7 seems to work as intended. jhb should look at its atomic ops. I only have 1 normal source of interleaved messages -- the messages about waiting for system processes on shutdown on SMP systems -- and this seems to be fixed. The patch applies even without removing PRINTF_BUFR_SIZE or cnputs(), and works, at least if PRINTF_BUFR_SIZE and the per-cpu buffer are not enabled. Note that it serializes accesses to the message buffer too. The locks automatically cover the message buffer if they are applied, and are applied to all cases that set TOLOG, though this might be too dangerous for tprintf() since printing to a user's console shouldn't block other parts of the kernel. printf() to a redirected console is more careful about this -- it extracts messages from the message buffer and can handle long delays provided the message buffer doesn't wrap around. This might be the best method for all cases. Accesses to the message buffer need to be serialized for this to work properly, and serializing ony accesses to the message buffer is easier since there are no hardware delays to worry about -- strict locking with no timeouts will work provided the halting problem is solvable for kvprintf() to the message buffer alone. No attempt is made to buffer messages across printf()s. Neither does PRINTF_BUFR_SIZE. PRINTF_BUFR_SIZE uses an auto buffer so it obviously has to flush at the end of each printf. Always extracting from the message buffer might be the best way to handle this too. Normally you would extract complete lines, but there must be a timeout to handle partial lines. The 1 second timeout here isn't best if the timeout is needed for avoiding deadlock, as may happen when a printf() is interrupted by panic(). panic could reasonably() blow open all locks including printf_lock(), but this is not easy to do without letting other CPUs proceed and/or complicating the usual case. Very slow terminals, say 50 bps, need a timeout of say 16 seconds so that the can print an 80-character line without being interrupted. % Index: subr_prf.c % =================================================================== % RCS file: /home/ncvs/src/sys/kern/subr_prf.c,v % retrieving revision 1.130.2.1 % diff -u -2 -r1.130.2.1 subr_prf.c % --- subr_prf.c 21 Jan 2009 00:26:45 -0000 1.130.2.1 % +++ subr_prf.c 15 Jun 2009 05:32:03 -0000 % @@ -112,4 +112,27 @@ % &always_console_output, 0, "Always output to console despite TIOCCONS."); % % +static int printf_lockcount; % + % +static void % +printf_lock(void) % +{ % + int timeout; % + % + timeout = 1000; % + do { % + if (atomic_cmpset_acq_int(&printf_lockcount, 0, 1)) % + return; % + DELAY(1000); % + } while (--timeout != 0); % + atomic_add_acq_int(&printf_lockcount, 1); % +} % + % +static void % +printf_unlock(void) % +{ % + % + atomic_add_rel_int(&printf_lockcount, -1); % +} % + % /* % * Warn that a system table is full. % @@ -198,5 +221,9 @@ % pca.flags = flags; % va_start(ap, fmt); % + if (pri != -1) % + printf_lock(); /* To serialize msgbuf. XXX: long-held lock? */ % kvprintf(fmt, putchar, &pca, 10, ap); % + if (pri != -1) % + printf_unlock(); % va_end(ap); % if (sess != NULL) % @@ -243,5 +270,7 @@ % % va_start(ap, fmt); % + printf_lock(); /* Even for TOLOG, for serializing msgbuf. */ % kvprintf(fmt, putchar, &pca, 10, ap); % + printf_unlock(); % va_end(ap); % % @@ -312,5 +341,7 @@ % #endif % % + printf_lock(); % retval = kvprintf(fmt, putchar, &pca, 10, ap); % + printf_unlock(); % va_end(ap); % % @@ -350,5 +381,7 @@ % #endif % % + printf_lock(); % retval = kvprintf(fmt, putchar, &pca, 10, ap); % + printf_unlock(); % % #ifdef PRINTF_BUFR_SIZE Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 06:23:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6871106566B; Mon, 15 Jun 2009 06:23:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 725908FC16; Mon, 15 Jun 2009 06:23:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 787961CC4E; Mon, 15 Jun 2009 08:23:58 +0200 (CEST) Date: Mon, 15 Jun 2009 08:23:58 +0200 From: Ed Schouten To: Bruce Evans Message-ID: <20090615062358.GR48776@hoeg.nl> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> <20090615075134.K24645@delplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="K9fR5eBdO1VxXkhU" Content-Disposition: inline In-Reply-To: <20090615075134.K24645@delplex.bde.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sam Leffler , src-committers@FreeBSD.org Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 06:24:00 -0000 --K9fR5eBdO1VxXkhU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Bruce, * Bruce Evans wrote: > I wouldn't use an implementation anything like FreeBSD's. printf()s > must be serialized, and once printf() is serialized there is no need > for buffering or cnputs().=20 Indeed. Just adding some synchronisation to printf() should also work and is in my opinion the best solution. printf() should only be called in exceptional cases, so taking the overhead of locking shouldn't really matter there. Unfortunately I am not planning on fixing this before the code freeze. PRINTF_BUFR_SIZE really isn't beautiful, but it should be good enough for now. To be continued. --=20 Ed Schouten WWW: http://80386.nl/ --K9fR5eBdO1VxXkhU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko16P4ACgkQ52SDGA2eCwVFQgCfduWO9o0hgJISd7XSrfYCh1b2 lXUAmQGzM1nab41S4VadtCBlWt9caQ4D =dupT -----END PGP SIGNATURE----- --K9fR5eBdO1VxXkhU-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 06:35:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545371065672; Mon, 15 Jun 2009 06:35:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 08C398FC19; Mon, 15 Jun 2009 06:35:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A36AF41C750; Mon, 15 Jun 2009 08:35:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id q7uMYxPUMEJa; Mon, 15 Jun 2009 08:35:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 0DF4441C757; Mon, 15 Jun 2009 08:35:06 +0200 (CEST) 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 4B3684448E6; Mon, 15 Jun 2009 06:34:23 +0000 (UTC) Date: Mon, 15 Jun 2009 06:34:23 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Edwin Groothuis In-Reply-To: <200906150217.n5F2HA9C076656@svn.freebsd.org> Message-ID: <20090615062346.Q22887@maildrop.int.zabbadoz.net> References: <200906150217.n5F2HA9C076656@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194231 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 06:35:08 -0000 On Mon, 15 Jun 2009, Edwin Groothuis wrote: > Author: edwin > Date: Mon Jun 15 02:17:10 2009 > New Revision: 194231 > URL: http://svn.freebsd.org/changeset/base/194231 > > Log: > Undo the change in r193688 as suggested in conf/72076. > > People on IRC and the -doc mailinglist (June 2009) showed that this > new format wasn't used or known widely enough to justify the change. grml; it is but people have been ignorant for ages now, still using DIN 1355; not sure we want to encourage this anymore:( What follows is from the top of my head: ISO8601 - from 198x[x=8|9]/1991 EN28601 - from 1992 DIN5008 - from 2001 In contrast to that DIN1355 imho was fomm 194x, changed at least 1975 and I think they did something mid-90s after EN28601 was out. Imho since 2005 or 2006 ISO8601 is authoritative. > Modified: > head/share/timedef/de_DE.ISO8859-1.src > head/share/timedef/de_DE.UTF-8.src > > Modified: head/share/timedef/de_DE.ISO8859-1.src > ============================================================================== > --- head/share/timedef/de_DE.ISO8859-1.src Mon Jun 15 01:09:19 2009 (r194230) > +++ head/share/timedef/de_DE.ISO8859-1.src Mon Jun 15 02:17:10 2009 (r194231) > @@ -59,7 +59,11 @@ Samstag > # > # x_fmt > # > -%Y-%m-%d > +# Note about the new DIN5008, ISO8601 and EN28601 format of %Y-%m-%d: > +# A quick poll on IRC and the -doc mailinglist (June 2009) showed that > +# this format was not used often enough to push this change through. > +# > +%d.%m.%Y > # > # c_fmt > # > > Modified: head/share/timedef/de_DE.UTF-8.src > ============================================================================== > --- head/share/timedef/de_DE.UTF-8.src Mon Jun 15 01:09:19 2009 (r194230) > +++ head/share/timedef/de_DE.UTF-8.src Mon Jun 15 02:17:10 2009 (r194231) > @@ -59,7 +59,11 @@ Samstag > # > # x_fmt > # > -%Y-%m-%d > +# Note about the new DIN5008, ISO8601 and EN28601 format of %Y-%m-%d: > +# A quick poll on IRC and the -doc mailinglist (June 2009) showed that > +# this format was not used often enough to push this change through. > +# > +%d.%m.%Y > # > # c_fmt > # > -- Bjoern A. Zeeb The greatest risk is not taking one. From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 06:43:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44F65106564A; Mon, 15 Jun 2009 06:43:47 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id EC25A8FC0C; Mon, 15 Jun 2009 06:43:46 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by k7.mavetju.org (Postfix, from userid 1001) id 70F5C450C8; Mon, 15 Jun 2009 16:43:45 +1000 (EST) Date: Mon, 15 Jun 2009 16:43:45 +1000 From: Edwin Groothuis To: "Bjoern A. Zeeb" Message-ID: <20090615064345.GA98056@mavetju.org> References: <200906150217.n5F2HA9C076656@svn.freebsd.org> <20090615062346.Q22887@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090615062346.Q22887@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194231 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 06:43:47 -0000 On Mon, Jun 15, 2009 at 06:34:23AM +0000, Bjoern A. Zeeb wrote: > On Mon, 15 Jun 2009, Edwin Groothuis wrote: > > Undo the change in r193688 as suggested in conf/72076. > > > > People on IRC and the -doc mailinglist (June 2009) showed that this > > new format wasn't used or known widely enough to justify the change. > > grml; it is but people have been ignorant for ages now, still using DIN > 1355; > not sure we want to encourage this anymore:( > > What follows is from the top of my head: > > ISO8601 - from 198x[x=8|9]/1991 > EN28601 - from 1992 > DIN5008 - from 2001 > > In contrast to that DIN1355 imho was fomm 194x, changed at least 1975 > and I think they did something mid-90s after EN28601 was out. > > Imho since 2005 or 2006 ISO8601 is authoritative. Grab your asbestos underpants and re-commit the change :-) Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 07:53:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89FFF1065673; Mon, 15 Jun 2009 07:53:55 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout3.freenet.de (mout3.freenet.de [IPv6:2001:748:100:40::2:5]) by mx1.freebsd.org (Postfix) with ESMTP id 21CB58FC0A; Mon, 15 Jun 2009 07:53:55 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.18] (helo=8.mx.freenet.de) by mout3.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #88) id 1MG70q-0004EM-Gt; Mon, 15 Jun 2009 09:53:52 +0200 Received: from ta650.t.pppool.de ([89.55.166.80]:21106 helo=ernst.jennejohn.org) by 8.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #79) id 1MG70q-0000RL-7a; Mon, 15 Jun 2009 09:53:52 +0200 Date: Mon, 15 Jun 2009 09:53:51 +0200 From: Gary Jennejohn To: Sam Leffler Message-ID: <20090615095351.42d823c1@ernst.jennejohn.org> In-Reply-To: <4A356A0F.3050800@freebsd.org> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; amd64-portbld-freebsd8.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, Ed Schouten Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: 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, 15 Jun 2009 07:53:56 -0000 On Sun, 14 Jun 2009 14:22:23 -0700 Sam Leffler wrote: > Ed Schouten wrote: > > Author: ed > > Date: Sun Jun 14 18:01:35 2009 > > New Revision: 194204 > > URL: http://svn.freebsd.org/changeset/base/194204 > > > > Log: > > Enable PRINTF_BUFR_SIZE on i386 and amd64 by default. > > > > In the past there have been some reports of PRINTF_BUFR_SIZE not > > functioning correctly. Instead of having garbled console messages, we > > should just see whether the issues are still there and analyze them. > > > > When I suggested enabling this by default for SMP configurations I was > reminded it wasn't enabled because of potential stack overflow. > I've been using this for years and have yet to see a stack overflow. As a rule, kernel printf's seem to be short enough that a value of 128 is sufficient and doesn't result in stack pressure. --- Gary Jennejohn From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 08:41:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9EF0106566C; Mon, 15 Jun 2009 08:41:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 76BE58FC19; Mon, 15 Jun 2009 08:41:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 8DAAB1CC2E; Mon, 15 Jun 2009 10:41:28 +0200 (CEST) Date: Mon, 15 Jun 2009 10:41:28 +0200 From: Ed Schouten To: Dag-Erling Smorgrav Message-ID: <20090615084128.GV48776@hoeg.nl> References: <200906142344.n5ENi64p066084@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8XzOrflVn8HobiNv" Content-Disposition: inline In-Reply-To: <200906142344.n5ENi64p066084@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194225 - head/sys/modules/if_sl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 08:41:30 -0000 --8XzOrflVn8HobiNv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Dag-Erling Smorgrav wrote: > Log: > Ed forgot this in r190751. >=20 > Deleted: > head/sys/modules/if_sl/ Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --8XzOrflVn8HobiNv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko2CTgACgkQ52SDGA2eCwXixQCeJZmNhuDtQrRmPTuY+/Ljvhhj 94EAn3DmqrcADPgB+5iClIRdTdGmcvGl =4DkD -----END PGP SIGNATURE----- --8XzOrflVn8HobiNv-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 13:47:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF92106566C; Mon, 15 Jun 2009 13:47:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE9998FC0C; Mon, 15 Jun 2009 13:47:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FDlndC091346; Mon, 15 Jun 2009 13:47:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FDlnYO091344; Mon, 15 Jun 2009 13:47:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200906151347.n5FDlnYO091344@svn.freebsd.org> From: Alexander Motin Date: Mon, 15 Jun 2009 13:47: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: r194237 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 13:47:50 -0000 Author: mav Date: Mon Jun 15 13:47:49 2009 New Revision: 194237 URL: http://svn.freebsd.org/changeset/base/194237 Log: Forbid multi-vector MSI interrupt vectors migration to another CPU once allocated. MSI have strict vectors allocation requirements, which are not satisfied now during reallocation. This is not the best possible solution, but better then just broken, as it was. No objections: current@, arch@, jhb@ Modified: head/sys/amd64/amd64/msi.c head/sys/i386/i386/msi.c Modified: head/sys/amd64/amd64/msi.c ============================================================================== --- head/sys/amd64/amd64/msi.c Mon Jun 15 13:17:05 2009 (r194236) +++ head/sys/amd64/amd64/msi.c Mon Jun 15 13:47:49 2009 (r194237) @@ -210,6 +210,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in old_id = msi->msi_cpu; if (old_vector && old_id == apic_id) return; + if (old_vector && !msi->msi_msix && msi->msi_first->msi_count > 1) + return; /* Allocate IDT vector on this cpu. */ vector = apic_alloc_vector(apic_id, msi->msi_irq); if (vector == 0) Modified: head/sys/i386/i386/msi.c ============================================================================== --- head/sys/i386/i386/msi.c Mon Jun 15 13:17:05 2009 (r194236) +++ head/sys/i386/i386/msi.c Mon Jun 15 13:47:49 2009 (r194237) @@ -210,6 +210,8 @@ msi_assign_cpu(struct intsrc *isrc, u_in old_id = msi->msi_cpu; if (old_vector && old_id == apic_id) return; + if (old_vector && !msi->msi_msix && msi->msi_first->msi_count > 1) + return; /* Allocate IDT vector on this cpu. */ vector = apic_alloc_vector(apic_id, msi->msi_irq); if (vector == 0) From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 14:39:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2B131065673; Mon, 15 Jun 2009 14:39:15 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 948058FC12; Mon, 15 Jun 2009 14:39:15 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n5FEdD3K063243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Jun 2009 07:39:13 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4A365D11.50503@freebsd.org> Date: Mon, 15 Jun 2009 07:39:13 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090411) MIME-Version: 1.0 To: "M. Warner Losh" References: <200906141953.n5EJrqg5058709@svn.freebsd.org> <1245014030.12125.34.camel@neo.cse.buffalo.edu> <20090615.000909.-1219445083.imp@bsdimp.com> In-Reply-To: <20090615.000909.-1219445083.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Misty-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194210 - 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, 15 Jun 2009 14:39:16 -0000 M. Warner Losh wrote: > In message: <1245014030.12125.34.camel@neo.cse.buffalo.edu> > Ken Smith writes: > : On Sun, 2009-06-14 at 19:53 +0000, Simon L. Nielsen wrote: > : > Author: simon > : > Date: Sun Jun 14 19:53:52 2009 > : > New Revision: 194210 > : > URL: http://svn.freebsd.org/changeset/base/194210 > : > > : > Log: > : > Bump __FreeBSD_version for OpenSSL 0.9.8k import. > : > > : > Modified: > : > head/sys/sys/param.h > : > > : > Modified: head/sys/sys/param.h > : > ============================================================================== > : > --- head/sys/sys/param.h Sun Jun 14 19:51:43 2009 (r194209) > : > +++ head/sys/sys/param.h Sun Jun 14 19:53:52 2009 (r194210) > : > @@ -57,7 +57,7 @@ > : > * is created, otherwise 1. > : > */ > : > #undef __FreeBSD_version > : > -#define __FreeBSD_version 800097 /* Master, propagated to newvers */ > : > +#define __FreeBSD_version 800098 /* Master, propagated to newvers */ > : > > : > #ifndef LOCORE > : > #include > : > : It's been suggested we change the heuristic to be stable branches start > : with 200. I think we're going to do that so don't panic about there > : only being one number left for changes between now and the time we > : branch. > > Why not 500? > > : At first it surprised me we ate through almost 100 version numbers in > : head, which is a place traditionally abi changes are *expected* and the > : attitude has more or less been head is a free-for-all with all bets off. > : But some IRC chatter enlightened me to there actually being people who > : do advanced testing of ports and whatnot in head under the encouragement > : of portmgr@ despite its free-for-all nature to try and cut down on work > : during later stages of the release. That seems reasonable so I think in > : general starting to give more than 100 bumps to work with in head is > : worthwhile. > > I think so too. If we're going to change, we might as well change big > and infrequently. > netbsd reserves 4 digits. I've never bought the idea that people can ignore ABI changes (even in HEAD). But not recording an incompatibility is just stupid. Sam From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 14:44:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B237106564A; Mon, 15 Jun 2009 14:44:56 +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 D31418FC16; Mon, 15 Jun 2009 14:44:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FEit5n092513; Mon, 15 Jun 2009 14:44:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FEitbl092512; Mon, 15 Jun 2009 14:44:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906151444.n5FEitbl092512@svn.freebsd.org> From: Rick Macklem Date: Mon, 15 Jun 2009 14:44: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: r194239 - head/sys/rpc/rpcsec_gss X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 14:44:56 -0000 Author: rmacklem Date: Mon Jun 15 14:44:55 2009 New Revision: 194239 URL: http://svn.freebsd.org/changeset/base/194239 Log: Replace the global references to "hostid" in svc_rpcsec_gss.c to local variables set via the getcredhostid() function. I also changed the type of ci_hostid to "unsigned long" so that it matches what is returned by getcredhostid(). Although "struct svc_rpc_gss_clientid" goes on the wire during RPCSEC_GSS, it is just a variable # of opaque bytes to the client, so it doesn't matter how much storage ci_hostid uses. Approved by: kib (mentor) Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Jun 15 13:48:31 2009 (r194238) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Mon Jun 15 14:44:55 2009 (r194239) @@ -65,12 +65,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include #include +#include #include #include @@ -121,7 +123,7 @@ enum svc_rpc_gss_client_state { #define SVC_RPC_GSS_SEQWINDOW 128 struct svc_rpc_gss_clientid { - uint32_t ci_hostid; + unsigned long ci_hostid; uint32_t ci_boottime; uint32_t ci_id; }; @@ -505,9 +507,11 @@ svc_rpc_gss_find_client(struct svc_rpc_g { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_find_client(%d)", id->ci_id); + getcredhostid(curthread->td_ucred, &hostid); if (id->ci_hostid != hostid || id->ci_boottime != boottime.tv_sec) return (NULL); @@ -536,6 +540,7 @@ svc_rpc_gss_create_client(void) { struct svc_rpc_gss_client *client; struct svc_rpc_gss_client_list *list; + unsigned long hostid; rpc_gss_log_debug("in svc_rpc_gss_create_client()"); @@ -543,6 +548,7 @@ svc_rpc_gss_create_client(void) memset(client, 0, sizeof(struct svc_rpc_gss_client)); refcount_init(&client->cl_refs, 1); sx_init(&client->cl_lock, "GSS-client"); + getcredhostid(curthread->td_ucred, &hostid); client->cl_id.ci_hostid = hostid; client->cl_id.ci_boottime = boottime.tv_sec; client->cl_id.ci_id = svc_rpc_gss_next_clientid++; From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 15:43:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0347F1065676; Mon, 15 Jun 2009 15:43:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57DE8FC16; Mon, 15 Jun 2009 15:43:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FFh0ZF093648; Mon, 15 Jun 2009 15:43:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FFh08t093646; Mon, 15 Jun 2009 15:43:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906151543.n5FFh08t093646@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Jun 2009 15:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194240 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 15:43:01 -0000 Author: jhb Date: Mon Jun 15 15:43:00 2009 New Revision: 194240 URL: http://svn.freebsd.org/changeset/base/194240 Log: Note that the structures are defined in in the text (using language from stat(2)) rather than in the synopsis. Requested by: bde Modified: head/lib/libutil/kinfo_getfile.3 head/lib/libutil/kinfo_getvmmap.3 Modified: head/lib/libutil/kinfo_getfile.3 ============================================================================== --- head/lib/libutil/kinfo_getfile.3 Mon Jun 15 14:44:55 2009 (r194239) +++ head/lib/libutil/kinfo_getfile.3 Mon Jun 15 15:43:00 2009 (r194240) @@ -35,7 +35,6 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h -.In sys/user.h .In libutil.h .Ft struct kinfo_file * .Fn kinfo_getfile "pid_t pid" "int *cntp" @@ -63,7 +62,8 @@ On success the .Fn kinfo_getfile function returns a pointer to an array of .Vt struct kinfo_file -structures. +structures as defined by +.In sys/user.h . The array was obtained by an internal call to .Xr malloc 3 and must be freed by the caller with a call to Modified: head/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- head/lib/libutil/kinfo_getvmmap.3 Mon Jun 15 14:44:55 2009 (r194239) +++ head/lib/libutil/kinfo_getvmmap.3 Mon Jun 15 15:43:00 2009 (r194240) @@ -35,7 +35,6 @@ .Lb libutil .Sh SYNOPSIS .In sys/types.h -.In sys/user.h .In libutil.h .Ft struct kinfo_vmentry * .Fn kinfo_getfile "pid_t pid" "int *cntp" @@ -63,7 +62,8 @@ On success the .Fn kinfo_getvmmap function returns a pointer to an array of .Vt struct kinfo_vmentry -structures. +structures as defined by +.In sys/user.h . The array was obtained by an internal call to .Xr malloc 3 and must be freed by the caller with a call to From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:14:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF4E1065675; Mon, 15 Jun 2009 16:14:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 71DA08FC1F; Mon, 15 Jun 2009 16:14:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 286E546B0D; Mon, 15 Jun 2009 12:14:10 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2B9EB8A073; Mon, 15 Jun 2009 12:14:09 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Mon, 15 Jun 2009 11:43:28 -0400 User-Agent: KMail/1.9.7 References: <200906121813.n5CIDY1c089109@svn.freebsd.org> <20090613113554.E22985@delplex.bde.org> In-Reply-To: <20090613113554.E22985@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906151143.28890.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 12:14:09 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194071 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 16:14:11 -0000 On Friday 12 June 2009 9:49:42 pm Bruce Evans wrote: > On Fri, 12 Jun 2009, John Baldwin wrote: > > > Log: > > - Note that these interfaces require for the structure > > definitions. > > This should be noted somewhere other than in the synopsis. Struct > definitions may or may not be needed for using a function, but one > place where they are certainly not needed is for calling a function > (unless the API involves complete structs or the public header is > missing a forward declaration). Hmm, I was just copying from kvm_getprocs(3). I've updated them to refer to the header inline instead. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:18:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A210410656B0; Mon, 15 Jun 2009 16:18:24 +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 903D48FC08; Mon, 15 Jun 2009 16:18:24 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FGIOtG094445; Mon, 15 Jun 2009 16:18:24 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FGIO0o094444; Mon, 15 Jun 2009 16:18:24 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906151618.n5FGIO0o094444@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 15 Jun 2009 16:18: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: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 16:18:25 -0000 Author: lulf Date: Mon Jun 15 16:18:24 2009 New Revision: 194241 URL: http://svn.freebsd.org/changeset/base/194241 Log: - Relax sanitazion requirements in libdisk, as a previous commit enabling this sanitization broke sysinstall on some disks. This was due to the disks reporting a geometry that was incorrectly sanitized by sysinstall. This makes the sanitization consistent with fdisk. Tested by: randi Modified: head/lib/libdisk/change.c Modified: head/lib/libdisk/change.c ============================================================================== --- head/lib/libdisk/change.c Mon Jun 15 15:43:00 2009 (r194240) +++ head/lib/libdisk/change.c Mon Jun 15 16:18:24 2009 (r194241) @@ -34,17 +34,9 @@ Sanitize_Bios_Geom(struct disk *disk) sane = 1; -#ifdef PC98 if (disk->bios_cyl >= 65536) -#else - if (disk->bios_cyl > 1024) -#endif sane = 0; -#ifdef PC98 - if (disk->bios_hd >= 256) -#else - if (disk->bios_hd > 16) -#endif + if (disk->bios_hd > 256) sane = 0; #ifdef PC98 if (disk->bios_sect >= 256) From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:32:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94132106568F; Mon, 15 Jun 2009 16:32:17 +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 822468FC16; Mon, 15 Jun 2009 16:32:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FGWHYC094742; Mon, 15 Jun 2009 16:32:17 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FGWHGa094740; Mon, 15 Jun 2009 16:32:17 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906151632.n5FGWHGa094740@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 15 Jun 2009 16:32: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: r194242 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 16:32:18 -0000 Author: jkim Date: Mon Jun 15 16:32:17 2009 New Revision: 194242 URL: http://svn.freebsd.org/changeset/base/194242 Log: AM/PM should come first in korean. Modified: head/share/timedef/ko_KR.UTF-8.src (contents, props changed) head/share/timedef/ko_KR.eucKR.src (contents, props changed) Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Mon Jun 15 16:18:24 2009 (r194241) +++ head/share/timedef/ko_KR.UTF-8.src Mon Jun 15 16:32:17 2009 (r194242) @@ -102,5 +102,5 @@ md # # ampm_fmt # -%I:%M:%S %p +%p %I:%M:%S # EOF Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Mon Jun 15 16:18:24 2009 (r194241) +++ head/share/timedef/ko_KR.eucKR.src Mon Jun 15 16:32:17 2009 (r194242) @@ -102,5 +102,5 @@ md # # ampm_fmt # -%I:%M:%S %p +%p %I:%M:%S # EOF From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:33:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00221065677; Mon, 15 Jun 2009 16:33:44 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by mx1.freebsd.org (Postfix) with ESMTP id B91A48FC20; Mon, 15 Jun 2009 16:33:44 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KLA003NAGO6PD20@asmtp019.mac.com>; Mon, 15 Jun 2009 09:33:42 -0700 (PDT) Message-id: <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> From: Marcel Moolenaar To: Ulf Lilleengen In-reply-to: <200906151618.n5FGIO0o094444@svn.freebsd.org> Date: Mon, 15 Jun 2009 09:33:41 -0700 References: <200906151618.n5FGIO0o094444@svn.freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 16:33:46 -0000 On Jun 15, 2009, at 9:18 AM, Ulf Lilleengen wrote: > Author: lulf > Date: Mon Jun 15 16:18:24 2009 > New Revision: 194241 > URL: http://svn.freebsd.org/changeset/base/194241 > > Log: > - Relax sanitazion requirements in libdisk, as a previous commit > enabling this > sanitization broke sysinstall on some disks. This was due to the > disks > reporting a geometry that was incorrectly sanitized by > sysinstall. This makes > the sanitization consistent with fdisk. *snip* > + if (disk->bios_hd > 256) > sane = 0; The number of heads cannot exceed 255. There are only 8-bits in which the number of heads is stored. This also applies to PC98, BTW. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:42:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CC281065672; Mon, 15 Jun 2009 16:42:08 +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 8AF238FC22; Mon, 15 Jun 2009 16:42:08 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FGg8gG094962; Mon, 15 Jun 2009 16:42:08 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FGg8gg094961; Mon, 15 Jun 2009 16:42:08 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906151642.n5FGg8gg094961@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 15 Jun 2009 16:42: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: r194243 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 16:42:09 -0000 Author: lulf Date: Mon Jun 15 16:42:08 2009 New Revision: 194243 URL: http://svn.freebsd.org/changeset/base/194243 Log: - Remove old and add new valid flags for the chunk structure. Submitted by: randi Modified: head/lib/libdisk/libdisk.3 Modified: head/lib/libdisk/libdisk.3 ============================================================================== --- head/lib/libdisk/libdisk.3 Mon Jun 15 16:32:17 2009 (r194242) +++ head/lib/libdisk/libdisk.3 Mon Jun 15 16:42:08 2009 (r194243) @@ -181,14 +181,7 @@ These are the valid .Ql flags values for a .Ql struct chunk . -.Bl -tag -offset indent -width CHUNK_BSD_COMPATXX -.It CHUNK_PAST_1024 -This chunk cannot be booted from because it extends past cylinder 1024. -.It CHUNK_BSD_COMPAT -This chunk is in the -.Bx Ns -compatibility , -and has a short name too, i.e.\& -.Ql wd0s4f -> wd0f . +.Bl -tag -offset indent -width CHUNK_AUTO_SIZEXX .It CHUNK_ALIGN This chunk should be aligned. .It CHUNK_IS_ROOT @@ -202,6 +195,10 @@ This is the active slice in the MBR. Force a dedicated disk for .Fx , bypassing all BIOS geometry considerations. +.It CHUNK_AUTO_SIZE +This chunk was auto-sized and can fill out any deleted following chunks. +.It CHUNK_NEWFS +newfs pending, used to enable auto-resizing on delete (along with AUTO_SIZE). .El .Pp The From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 16:51:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3CC31065670; Mon, 15 Jun 2009 16:51:07 +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 B21438FC28; Mon, 15 Jun 2009 16:51:07 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FGp7Q7095202; Mon, 15 Jun 2009 16:51:07 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FGp77O095200; Mon, 15 Jun 2009 16:51:07 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906151651.n5FGp77O095200@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 15 Jun 2009 16:51: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: r194244 - in head: lib/libdisk sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 16:51:08 -0000 Author: lulf Date: Mon Jun 15 16:51:07 2009 New Revision: 194244 URL: http://svn.freebsd.org/changeset/base/194244 Log: - The maximum number of heads is 255, not 256. Pointed out by: marcel Modified: head/lib/libdisk/change.c head/sbin/fdisk/fdisk.c Modified: head/lib/libdisk/change.c ============================================================================== --- head/lib/libdisk/change.c Mon Jun 15 16:42:08 2009 (r194243) +++ head/lib/libdisk/change.c Mon Jun 15 16:51:07 2009 (r194244) @@ -36,7 +36,7 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_cyl >= 65536) sane = 0; - if (disk->bios_hd > 256) + if (disk->bios_hd >= 256) sane = 0; #ifdef PC98 if (disk->bios_sect >= 256) Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Mon Jun 15 16:42:08 2009 (r194243) +++ head/sbin/fdisk/fdisk.c Mon Jun 15 16:51:07 2009 (r194244) @@ -1066,8 +1066,8 @@ process_geometry(CMD *command) warnx("ERROR line %d: number of heads not specified", current_line_number); status = 0; - } else if (dos_heads > 256) { - warnx("ERROR line %d: number of heads must be within (1-256)", + } else if (dos_heads > 255) { + warnx("ERROR line %d: number of heads must be within (1-255)", current_line_number); status = 0; } From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 17:13:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAEE81065670; Mon, 15 Jun 2009 17:13:51 +0000 (UTC) (envelope-from ulf.lilleengen@gmail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id E78778FC21; Mon, 15 Jun 2009 17:13:50 +0000 (UTC) (envelope-from ulf.lilleengen@gmail.com) Received: by ewy8 with SMTP id 8so4377608ewy.43 for ; Mon, 15 Jun 2009 10:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=xM1hp/cHqStBHWnqIscPJC5KPNTV/9EwyhRg7ALfnyE=; b=O9wFji+Iqum/OAUL9w6cncjAES+ZXKcNDUHIXWOlLZhY6vkGXjHUB5HOBYeonLWcsY vGm9NZvX829/0zxWLIKrSJmnQ5R8NQL/gRdKWIc9Zbr+FgxgsG3oBt/cB4TV2uBmP1Oz gIJGD7qVCvJy9mGWcIGKF2unQ5ZCCYcifk5j0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=VInzt6c/tN7s3R3K1SvaoQfeXHyc9EP24/K/KlJr2oh7X+TVAzRvllFvfsEiUsuA+6 pedAshl5xxDuh7BEtrcg7d1ocUCCkPzxIbZw9hua1ITWe0hY1jKqdOAQeQb2yJYWM6Ej kedIKTJEsc7PNZkKnobyj5POh8ZnhesaEs1JQ= Received: by 10.210.42.13 with SMTP id p13mr3973035ebp.99.1245084170338; Mon, 15 Jun 2009 09:42:50 -0700 (PDT) Received: from carrot.geeknest.org (z032069.its-s.tudelft.nl [145.94.32.69]) by mx.google.com with ESMTPS id 7sm149784eyg.42.2009.06.15.09.42.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 15 Jun 2009 09:42:49 -0700 (PDT) Message-ID: <4A367A11.4080202@FreeBSD.org> Date: Mon, 15 Jun 2009 18:42:57 +0200 From: Ulf Lilleengen User-Agent: Thunderbird 2.0.0.21 (X11/20090411) MIME-Version: 1.0 To: Marcel Moolenaar References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> In-Reply-To: <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 17:13:52 -0000 Marcel Moolenaar wrote: > > On Jun 15, 2009, at 9:18 AM, Ulf Lilleengen wrote: > >> Author: lulf >> Date: Mon Jun 15 16:18:24 2009 >> New Revision: 194241 >> URL: http://svn.freebsd.org/changeset/base/194241 >> >> Log: >> - Relax sanitazion requirements in libdisk, as a previous commit >> enabling this >> sanitization broke sysinstall on some disks. This was due to the >> disks >> reporting a geometry that was incorrectly sanitized by sysinstall. >> This makes >> the sanitization consistent with fdisk. > > *snip* > >> + if (disk->bios_hd > 256) >> sane = 0; > > > The number of heads cannot exceed 255. There are only 8-bits > in which the number of heads is stored. This also applies to > PC98, BTW. > Aha, so I should fix fdisk too then. Thanks. From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 17:14:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F7E51065672; Mon, 15 Jun 2009 17:14:47 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0F98FC0C; Mon, 15 Jun 2009 17:14:47 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FHElaZ095689; Mon, 15 Jun 2009 17:14:47 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FHEl4F095688; Mon, 15 Jun 2009 17:14:47 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <200906151714.n5FHEl4F095688@svn.freebsd.org> From: Oleg Bulyzhin Date: Mon, 15 Jun 2009 17:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194245 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 17:14:48 -0000 Author: oleg Date: Mon Jun 15 17:14:47 2009 New Revision: 194245 URL: http://svn.freebsd.org/changeset/base/194245 Log: Since dn_pipe.numbytes is int64_t now - remove unnecessary overflow detection code in ready_event_wfq(). Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Jun 15 16:51:07 2009 (r194244) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Jun 15 17:14:47 2009 (r194245) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); * include files marked with XXX are probably not needed */ -#include #include #include #include @@ -686,16 +685,11 @@ ready_event_wfq(struct dn_pipe *p, struc int p_was_empty = (p->head == NULL); struct dn_heap *sch = &(p->scheduler_heap); struct dn_heap *neh = &(p->not_eligible_heap); - int64_t p_numbytes = p->numbytes; DUMMYNET_LOCK_ASSERT(); if (p->if_name[0] == 0) /* tx clock is simulated */ - /* - * Since result may not fit into p->numbytes (32bit) we - * are using 64bit var here. - */ - p_numbytes += (curr_time - p->sched_time) * p->bandwidth; + p->numbytes += (curr_time - p->sched_time) * p->bandwidth; else { /* * tx clock is for real, * the ifq must be empty or this is a NOP. @@ -712,7 +706,7 @@ ready_event_wfq(struct dn_pipe *p, struc * While we have backlogged traffic AND credit, we need to do * something on the queue. */ - while (p_numbytes >= 0 && (sch->elements > 0 || neh->elements > 0)) { + while (p->numbytes >= 0 && (sch->elements > 0 || neh->elements > 0)) { if (sch->elements > 0) { /* Have some eligible pkts to send out. */ struct dn_flow_queue *q = sch->p[0].object; @@ -722,7 +716,7 @@ ready_event_wfq(struct dn_pipe *p, struc int len_scaled = p->bandwidth ? len * 8 * hz : 0; heap_extract(sch, NULL); /* Remove queue from heap. */ - p_numbytes -= len_scaled; + p->numbytes -= len_scaled; move_pkt(pkt, q, p, len); p->V += (len << MY_M) / p->sum; /* Update V. */ @@ -763,11 +757,11 @@ ready_event_wfq(struct dn_pipe *p, struc } if (p->if_name[0] != '\0') { /* Tx clock is from a real thing */ - p_numbytes = -1; /* Mark not ready for I/O. */ + p->numbytes = -1; /* Mark not ready for I/O. */ break; } } - if (sch->elements == 0 && neh->elements == 0 && p_numbytes >= 0 && + if (sch->elements == 0 && neh->elements == 0 && p->numbytes >= 0 && p->idle_heap.elements > 0) { /* * No traffic and no events scheduled. @@ -790,11 +784,11 @@ ready_event_wfq(struct dn_pipe *p, struc * If we are under credit, schedule the next ready event. * Also fix the delivery time of the last packet. */ - if (p->if_name[0]==0 && p_numbytes < 0) { /* This implies bw > 0. */ + if (p->if_name[0]==0 && p->numbytes < 0) { /* This implies bw > 0. */ dn_key t = 0; /* Number of ticks i have to wait. */ if (p->bandwidth > 0) - t = (p->bandwidth - 1 - p_numbytes) / p->bandwidth; + t = (p->bandwidth - 1 - p->numbytes) / p->bandwidth; dn_tag_get(p->tail)->output_time += t; p->sched_time = curr_time; heap_insert(&wfq_ready_heap, curr_time + t, (void *)p); @@ -804,14 +798,6 @@ ready_event_wfq(struct dn_pipe *p, struc */ } - /* Fit (adjust if necessary) 64bit result into 32bit variable. */ - if (p_numbytes > INT_MAX) - p->numbytes = INT_MAX; - else if (p_numbytes < INT_MIN) - p->numbytes = INT_MIN; - else - p->numbytes = p_numbytes; - /* * If the delay line was empty call transmit_event() now. * Otherwise, the scheduler will take care of it. From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 17:24:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28733106567F; Mon, 15 Jun 2009 17:24:54 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from mail-fx0-f225.google.com (mail-fx0-f225.google.com [209.85.220.225]) by mx1.freebsd.org (Postfix) with ESMTP id 309DF8FC26; Mon, 15 Jun 2009 17:24:52 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by fxm25 with SMTP id 25so265311fxm.43 for ; Mon, 15 Jun 2009 10:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=GO0SGqHQZBcl8L5mPLJNOUoKmIXBGPYR0XHIMNhXZCw=; b=UrHpFkDnoyZgefG5D7lLxtQB5MNel6UCP6QrJ+mnCynpqvQWgRw4HECFXmwcC5RyNO 2K67EhN9qiT4cvavbdDNWPXTSL510CEYpJcAjVRPOOcJnILfgWlo7EDnGqbqHmUMwHl9 iLSRv26Hb+gRdbrfjAwqqQwYw2nvKsfp8kAGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=GhijMZqN5FtE+ZaFeTM93HjOouJ1Q3aquAQeyGqoW0/Ie1LaQcZbXn25DiswtJhFod h53Fi3PfcJfbwdXnjgjT/1kRdS2b31XYdzHi+n4fO9kTQFRzh65QIbmNcV9lH8MBSGnm Z61gRWmk4ElEi/qRZ4xAqRdU6tULibNDD2yd0= MIME-Version: 1.0 Received: by 10.223.126.203 with SMTP id d11mr4489876fas.22.1245084927150; Mon, 15 Jun 2009 09:55:27 -0700 (PDT) In-Reply-To: <200906151651.n5FGp77O095200@svn.freebsd.org> References: <200906151651.n5FGp77O095200@svn.freebsd.org> From: =?ISO-8859-1?Q?Jo=E3o_Barros?= Date: Mon, 15 Jun 2009 17:55:07 +0100 Message-ID: <70e8236f0906150955rc016a7fka18a9722468f3477@mail.gmail.com> To: Ulf Lilleengen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194244 - in head: lib/libdisk sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 17:24:55 -0000 On Mon, Jun 15, 2009 at 5:51 PM, Ulf Lilleengen wrote: > Author: lulf > Date: Mon Jun 15 16:51:07 2009 > New Revision: 194244 > URL: http://svn.freebsd.org/changeset/base/194244 > > Log: > =A0- The maximum number of heads is 255, not 256. > Why not make it a #define along with max cylinders and sectors? --=20 Joao Barros From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 17:28:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D24FF1065674; Mon, 15 Jun 2009 17:28:50 +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 96F398FC12; Mon, 15 Jun 2009 17:28:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3190E46B7F; Mon, 15 Jun 2009 13:28:50 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 01A378A070; Mon, 15 Jun 2009 13:28:49 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Mon, 15 Jun 2009 13:28:31 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906120849.07127.jhb@freebsd.org> <20090613094302.I22933@delplex.bde.org> In-Reply-To: <20090613094302.I22933@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906151328.32279.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 13:28:49 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 17:28:51 -0000 On Friday 12 June 2009 8:56:56 pm Bruce Evans wrote: > On Fri, 12 Jun 2009, John Baldwin wrote: > > > On Thursday 11 June 2009 11:12:58 pm Bruce Evans wrote: > >> On Thu, 11 Jun 2009, John Baldwin wrote: > >> > >>> On Wednesday 10 June 2009 11:53:16 pm Bruce Evans wrote: > >>>> On Wed, 10 Jun 2009, John Baldwin wrote: > >>> > >>> I wanted to match 'ticks' and figured changing 'ticks' was a far larger > >>> headache. > >> > >> By changing the signedness you get undefined behaviour for the other types > >> too, and risk new and/or different sign extension bugs. > > > > FWIW, the variables were signed before they were changed to unsigned and are now > > back as signed again. It just seems really odd to have the types not match > > 'ticks' especially since many of the values are just cached copies of 'ticks'. > > No, they were originally u_long and stayed that way until you changed them > (except possibly for newer variables). The type of `ticks' is just wrong, > and fixing that would take more work, but there is no reason to propagate > this bug to new variables. The original version is: Gah, I had misremembered the diffs, they were indeed unsigned. Here is my attempt at trying to fix things then based on my understanding so far: - It changes the variables back to unsigned (but u_int instead of unsigned long). It also changes a few other members to be u_int instead of int such as the two rtttime members. - I changed t_starttime in the timewait structure to u_int. - I changed t_recent in the timewait structure to u_int32_t as it is only used in relation to other u_int32_t variables. - I also attempted to fix overflow errors with t_badrxtwin by using subtraction and casting the result to an int to compare with zero instead of doing a direct comparison. - I cast 'ticks' to u_int in the code to compute a new isn. I'm not sure if this is needed. - Some style fixes to remove extra ()'s from 'ticks - t_rcvtime'. --- //depot/projects/smpng/sys/netinet/tcp_input.c 2009/06/12 13:45:50 +++ //depot/user/jhb/socket/netinet/tcp_input.c 2009/06/15 17:22:13 @@ -1296,7 +1296,7 @@ * "bad retransmit" recovery. */ if (tp->t_rxtshift == 1 && - ticks < tp->t_badrxtwin) { + (int)(ticks - tp->t_badrxtwin) < 0) { TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = @@ -2253,7 +2253,7 @@ * original cwnd and ssthresh, and proceed to transmit where * we left off. */ - if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) { + if (tp->t_rxtshift == 1 && (int)(ticks - tp->t_badrxtwin) < 0) { TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = tp->snd_ssthresh_prev; --- //depot/projects/smpng/sys/netinet/tcp_output.c 2009/06/09 15:15:22 +++ //depot/user/jhb/socket/netinet/tcp_output.c 2009/06/15 17:22:13 @@ -172,7 +172,7 @@ * to send, then transmit; otherwise, investigate further. */ idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { + if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) { /* * We have been idle for "a while" and no acks are * expected to clock out any data we send -- --- //depot/projects/smpng/sys/netinet/tcp_timer.c 2009/04/14 19:06:19 +++ //depot/user/jhb/socket/netinet/tcp_timer.c 2009/06/15 17:22:13 @@ -254,7 +254,7 @@ tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - (ticks - tp->t_rcvtime) <= tcp_maxidle) + ticks - tp->t_rcvtime <= tcp_maxidle) callout_reset(&tp->t_timers->tt_2msl, tcp_keepintvl, tcp_timer_2msl, tp); else @@ -318,7 +318,7 @@ goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) goto dropit; /* * Send a packet designed to force a response @@ -418,8 +418,8 @@ * backoff that we would use if retransmitting. */ if (tp->t_rxtshift == TCP_MAXRXTSHIFT && - ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || - (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { + (ticks - tp->t_rcvtime >= tcp_maxpersistidle || + ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { TCPSTAT_INC(tcps_persistdrop); tp = tcp_drop(tp, ETIMEDOUT); goto out; --- //depot/projects/smpng/sys/netinet/tcp_timewait.c 2009/06/09 15:15:22 +++ //depot/user/jhb/socket/netinet/tcp_timewait.c 2009/06/15 17:22:13 @@ -322,8 +322,10 @@ tcp_seq new_irs = tw->irs; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); - new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz); - new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz); + new_iss += ((u_int)ticks - tw->t_starttime) * + (ISN_BYTES_PER_SECOND / hz); + new_irs += ((u_int)ticks - tw->t_starttime) * + (MS_ISN_BYTES_PER_SECOND / hz); if (SEQ_GT(new_iss, tw->snd_nxt) && SEQ_GT(new_irs, tw->rcv_nxt)) return (1); --- //depot/projects/smpng/sys/netinet/tcp_usrreq.c 2009/06/12 13:45:50 +++ //depot/user/jhb/socket/netinet/tcp_usrreq.c 2009/06/15 17:22:13 @@ -1823,11 +1823,11 @@ tp->snd_recover); db_print_indent(indent); - db_printf("t_maxopd: %u t_rcvtime: %d t_startime: %d\n", + db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); - db_printf("t_rttime: %d t_rtsq: 0x%08x t_bw_rtttime: %d\n", + db_printf("t_rttime: %u t_rtsq: 0x%08x t_bw_rtttime: %u\n", tp->t_rtttime, tp->t_rtseq, tp->t_bw_rtttime); db_print_indent(indent); @@ -1854,7 +1854,7 @@ tp->snd_scale, tp->rcv_scale, tp->request_r_scale); db_print_indent(indent); - db_printf("ts_recent: %u ts_recent_age: %d\n", + db_printf("ts_recent: %u ts_recent_age: %u\n", tp->ts_recent, tp->ts_recent_age); db_print_indent(indent); @@ -1863,7 +1863,7 @@ db_print_indent(indent); db_printf("snd_ssthresh_prev: %lu snd_recover_prev: 0x%08x " - "t_badrxtwin: %d\n", tp->snd_ssthresh_prev, + "t_badrxtwin: %u\n", tp->snd_ssthresh_prev, tp->snd_recover_prev, tp->t_badrxtwin); db_print_indent(indent); @@ -1877,7 +1877,7 @@ /* Skip sackblks, sackhint. */ db_print_indent(indent); - db_printf("t_rttlow: %d rfbuf_ts: %u rfbuf_cnt: %d\n", + db_printf("t_rttlow: %u rfbuf_ts: %u rfbuf_cnt: %d\n", tp->t_rttlow, tp->rfbuf_ts, tp->rfbuf_cnt); } --- //depot/projects/smpng/sys/netinet/tcp_var.h 2009/06/12 13:45:50 +++ //depot/user/jhb/socket/netinet/tcp_var.h 2009/06/15 17:22:13 @@ -139,12 +139,12 @@ u_int t_maxopd; /* mss plus options */ - int t_rcvtime; /* inactivity time */ - int t_starttime; /* time connection was established */ - int t_rtttime; /* round trip time */ + u_int t_rcvtime; /* inactivity time */ + u_int t_starttime; /* time connection was established */ + u_int t_rtttime; /* round trip time */ tcp_seq t_rtseq; /* sequence number being timed */ - int t_bw_rtttime; /* used for bandwidth calculation */ + u_int t_bw_rtttime; /* used for bandwidth calculation */ tcp_seq t_bw_rtseq; /* used for bandwidth calculation */ int t_rxtcur; /* current retransmit value (ticks) */ @@ -167,7 +167,7 @@ u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_int32_t ts_recent; /* timestamp echo data */ - int ts_recent_age; /* when last updated */ + u_int ts_recent_age; /* when last updated */ u_int32_t ts_offset; /* our timestamp offset */ tcp_seq last_ack_sent; @@ -175,7 +175,7 @@ u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ - int t_badrxtwin; /* window for retransmit recovery */ + u_int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ int snd_numholes; /* number of holes seen by sender */ @@ -187,7 +187,7 @@ tcp_seq sack_newdata; /* New data xmitted in this recovery episode starts at this seq number */ struct sackhint sackhint; /* SACK scoreboard hint */ - int t_rttlow; /* smallest observerved RTT */ + u_int t_rttlow; /* smallest observerved RTT */ u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ void *t_pspare[3]; /* toe usrreqs / toepcb * / congestion algo / 1 general use */ @@ -306,9 +306,9 @@ u_short last_win; /* cached window value */ u_short tw_so_options; /* copy of so_options */ struct ucred *tw_cred; /* user credentials */ - u_long t_recent; + u_int32_t t_recent; u_int32_t ts_offset; /* our timestamp offset */ - u_long t_starttime; + u_int t_starttime; int tw_time; TAILQ_ENTRY(tcptw) tw_2msl; }; -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 17:30:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B87AD106566C; Mon, 15 Jun 2009 17:30:18 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by mx1.freebsd.org (Postfix) with ESMTP id A14E98FC13; Mon, 15 Jun 2009 17:30:18 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KLA0013TJAGD060@asmtp017.mac.com>; Mon, 15 Jun 2009 10:30:18 -0700 (PDT) Message-id: <4F28FD5D-C503-4F08-89F7-2AD7B427DF36@mac.com> From: Marcel Moolenaar To: Ulf Lilleengen In-reply-to: <4A367A11.4080202@FreeBSD.org> Date: Mon, 15 Jun 2009 10:30:16 -0700 References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> <4A367A11.4080202@FreeBSD.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 17:30:19 -0000 On Jun 15, 2009, at 9:42 AM, Ulf Lilleengen wrote: >>> >>> + if (disk->bios_hd > 256) >>> sane = 0; >> >> >> The number of heads cannot exceed 255. There are only 8-bits >> in which the number of heads is stored. This also applies to >> PC98, BTW. >> > Aha, so I should fix fdisk too then. Thanks. If you like... :-) -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:22:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B03301065670; Mon, 15 Jun 2009 18:22:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B92E8FC23; Mon, 15 Jun 2009 18:22:41 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIMfIU097248; Mon, 15 Jun 2009 18:22:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIMfnq097243; Mon, 15 Jun 2009 18:22:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906151822.n5FIMfnq097243@svn.freebsd.org> From: Marius Strobl Date: Mon, 15 Jun 2009 18:22: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: r194246 - in head/sys: boot/forth conf dev/cas modules modules/cas sparc64/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, 15 Jun 2009 18:22:42 -0000 Author: marius Date: Mon Jun 15 18:22:41 2009 New Revision: 194246 URL: http://svn.freebsd.org/changeset/base/194246 Log: Add cas(4), a driver for Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn Gigabit Ethernet controllers. These are the successors of the Sun GEM controllers and still have a similar but extended transmit logic. As such this driver is based on gem(4). Thanks to marcel@ for providing a Sun Quad GigaSwift Ethernet UTP (QGE) card which was vital for getting this driver to work on architectures not using Open Firmware. Approved by: re (kib) MFC after: 2 weeks Added: head/sys/dev/cas/ head/sys/dev/cas/if_cas.c (contents, props changed) head/sys/dev/cas/if_casreg.h (contents, props changed) head/sys/dev/cas/if_casvar.h (contents, props changed) head/sys/modules/cas/ head/sys/modules/cas/Makefile (contents, props changed) Modified: head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Mon Jun 15 17:14:47 2009 (r194245) +++ head/sys/boot/forth/loader.conf Mon Jun 15 18:22:41 2009 (r194246) @@ -221,6 +221,7 @@ if_axe_load="NO" # ASIX Electronics AX8 if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 if_cue_load="NO" # CATC USB-EL1210A USB Ethernet Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jun 15 17:14:47 2009 (r194245) +++ head/sys/conf/NOTES Mon Jun 15 18:22:41 2009 (r194246) @@ -1768,6 +1768,7 @@ device miibus # BCM570x family of controllers, including the 3Com 3c996-T, # the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and # the embedded gigE NICs on Dell PowerEdge 2550 servers. +# cas: Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 @@ -1907,6 +1908,7 @@ device ale # Atheros AR8121/AR8113/AR8 device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet +device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware device dc # DEC/Intel 21143 and various workalikes Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jun 15 17:14:47 2009 (r194245) +++ head/sys/conf/files Mon Jun 15 18:22:41 2009 (r194246) @@ -738,6 +738,7 @@ dev/bwi/if_bwi_pci.c optional bwi pci dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus +dev/cas/if_cas.c optional cas dev/cfi/cfi_core.c optional cfi dev/cfi/cfi_dev.c optional cfi dev/cfi/cfi_disk.c optional cfid Added: head/sys/dev/cas/if_cas.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cas/if_cas.c Mon Jun 15 18:22:41 2009 (r194246) @@ -0,0 +1,2772 @@ +/*- + * Copyright (C) 2001 Eduardo Horvath. + * Copyright (c) 2001-2003 Thomas Moestl + * Copyright (c) 2007-2009 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * from: NetBSD: gem.c,v 1.21 2002/06/01 23:50:58 lukem Exp + * from: FreeBSD: if_gem.c 182060 2008-08-23 15:03:26Z marius + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * driver for Sun Cassini/Cassini+ and National Semiconductor DP83065 + * Saturn Gigabit Ethernet controllers + */ + +#if 0 +#define CAS_DEBUG +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#if defined(__powerpc__) || defined(__sparc64__) +#include +#include +#endif +#include + +#include +#include + +#include +#include + +#include +#include + +#include "miibus_if.h" + +#define RINGASSERT(n , min, max) \ + CTASSERT(powerof2(n) && (n) >= (min) && (n) <= (max)) + +RINGASSERT(CAS_NRXCOMP, 128, 32768); +RINGASSERT(CAS_NRXDESC, 32, 8192); +RINGASSERT(CAS_NRXDESC2, 32, 8192); +RINGASSERT(CAS_NTXDESC, 32, 8192); + +#undef RINGASSERT + +#define CCDASSERT(m, a) \ + CTASSERT((offsetof(struct cas_control_data, m) & ((a) - 1)) == 0) + +CCDASSERT(ccd_rxcomps, CAS_RX_COMP_ALIGN); +CCDASSERT(ccd_rxdescs, CAS_RX_DESC_ALIGN); +CCDASSERT(ccd_rxdescs2, CAS_RX_DESC_ALIGN); + +#undef CCDASSERT + +#define CAS_TRIES 10000 + +/* + * According to documentation, the hardware has support for basic TCP + * checksum offloading only, in practice this can be also used for UDP + * however (i.e. the problem of previous Sun NICs that a checksum of 0x0 + * is not converted to 0xffff no longer exists). + */ +#define CAS_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) + +static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx); +static int cas_attach(struct cas_softc *sc); +static int cas_bitwait(struct cas_softc *sc, bus_addr_t r, uint32_t clr, + uint32_t set); +static void cas_cddma_callback(void *xsc, bus_dma_segment_t *segs, + int nsegs, int error); +static void cas_detach(struct cas_softc *sc); +static int cas_disable_rx(struct cas_softc *sc); +static int cas_disable_tx(struct cas_softc *sc); +static void cas_eint(struct cas_softc *sc, u_int status); +static void cas_free(void *arg1, void* arg2); +static void cas_init(void *xsc); +static void cas_init_locked(struct cas_softc *sc); +static void cas_init_regs(struct cas_softc *sc); +static void cas_intr(void *v); +static int cas_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); +static int cas_load_txmbuf(struct cas_softc *sc, struct mbuf **m_head); +static int cas_mediachange(struct ifnet *ifp); +static void cas_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr); +static void cas_meminit(struct cas_softc *sc); +static void cas_mifinit(struct cas_softc *sc); +static int cas_mii_readreg(device_t dev, int phy, int reg); +static void cas_mii_statchg(device_t dev); +static int cas_mii_writereg(device_t dev, int phy, int reg, int val); +static void cas_reset(struct cas_softc *sc); +static int cas_reset_rx(struct cas_softc *sc); +static int cas_reset_tx(struct cas_softc *sc); +static void cas_resume(struct cas_softc *sc); +static u_int cas_descsize(u_int sz); +static void cas_rint(struct cas_softc *sc); +static void cas_rint_timeout(void *arg); +static inline void cas_rxcksum(struct mbuf *m, uint16_t cksum); +static inline void cas_rxcompinit(struct cas_rx_comp *rxcomp); +static u_int cas_rxcompsize(u_int sz); +static void cas_rxdma_callback(void *xsc, bus_dma_segment_t *segs, + int nsegs, int error); +static void cas_setladrf(struct cas_softc *sc); +static void cas_start(struct ifnet *ifp); +static void cas_start_locked(struct ifnet *ifp); +static void cas_stop(struct ifnet *ifp); +static void cas_suspend(struct cas_softc *sc); +static void cas_tick(void *arg); +static void cas_tint(struct cas_softc *sc); +static inline void cas_txkick(struct cas_softc *sc); +static int cas_watchdog(struct cas_softc *sc); + +static devclass_t cas_devclass; + +MODULE_DEPEND(cas, ether, 1, 1, 1); +MODULE_DEPEND(cas, miibus, 1, 1, 1); + +#ifdef CAS_DEBUG +#include +#define KTR_CAS KTR_CT2 +#endif + +static int +cas_attach(struct cas_softc *sc) +{ + struct cas_txsoft *txs; + struct ifnet *ifp; + int error, i; + uint32_t v; + + /* Set up ifnet structure. */ + ifp = sc->sc_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) + return (ENOSPC); + ifp->if_softc = sc; + if_initname(ifp, device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = cas_start; + ifp->if_ioctl = cas_ioctl; + ifp->if_init = cas_init; + IFQ_SET_MAXLEN(&ifp->if_snd, CAS_TXQUEUELEN); + ifp->if_snd.ifq_drv_maxlen = CAS_TXQUEUELEN; + IFQ_SET_READY(&ifp->if_snd); + + callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); + + /* Make sure the chip is stopped. */ + cas_reset(sc); + + error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + BUS_SPACE_MAXSIZE, 0, BUS_SPACE_MAXSIZE, 0, NULL, NULL, + &sc->sc_pdmatag); + if (error != 0) + goto fail_ifnet; + + error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + CAS_PAGE_SIZE, 1, CAS_PAGE_SIZE, 0, NULL, NULL, &sc->sc_rdmatag); + if (error != 0) + goto fail_ptag; + + error = bus_dma_tag_create(sc->sc_pdmatag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES * CAS_NTXSEGS, CAS_NTXSEGS, MCLBYTES, + BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_tdmatag); + if (error != 0) + goto fail_rtag; + + error = bus_dma_tag_create(sc->sc_pdmatag, CAS_TX_DESC_ALIGN, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + sizeof(struct cas_control_data), 1, + sizeof(struct cas_control_data), 0, + NULL, NULL, &sc->sc_cdmatag); + if (error != 0) + goto fail_ttag; + + /* + * Allocate the control data structures, create and load the + * DMA map for it. + */ + if ((error = bus_dmamem_alloc(sc->sc_cdmatag, + (void **)&sc->sc_control_data, + BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO, + &sc->sc_cddmamap)) != 0) { + device_printf(sc->sc_dev, + "unable to allocate control data, error = %d\n", error); + goto fail_ctag; + } + + sc->sc_cddma = 0; + if ((error = bus_dmamap_load(sc->sc_cdmatag, sc->sc_cddmamap, + sc->sc_control_data, sizeof(struct cas_control_data), + cas_cddma_callback, sc, 0)) != 0 || sc->sc_cddma == 0) { + device_printf(sc->sc_dev, + "unable to load control data DMA map, error = %d\n", + error); + goto fail_cmem; + } + + /* + * Initialize the transmit job descriptors. + */ + STAILQ_INIT(&sc->sc_txfreeq); + STAILQ_INIT(&sc->sc_txdirtyq); + + /* + * Create the transmit buffer DMA maps. + */ + error = ENOMEM; + for (i = 0; i < CAS_TXQUEUELEN; i++) { + txs = &sc->sc_txsoft[i]; + txs->txs_mbuf = NULL; + txs->txs_ndescs = 0; + if ((error = bus_dmamap_create(sc->sc_tdmatag, 0, + &txs->txs_dmamap)) != 0) { + device_printf(sc->sc_dev, + "unable to create TX DMA map %d, error = %d\n", + i, error); + goto fail_txd; + } + STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); + } + + /* + * Allocate the receive buffers, create and load the DMA maps + * for them. + */ + for (i = 0; i < CAS_NRXDESC; i++) { + if ((error = bus_dmamem_alloc(sc->sc_rdmatag, + &sc->sc_rxdsoft[i].rxds_buf, BUS_DMA_WAITOK, + &sc->sc_rxdsoft[i].rxds_dmamap)) != 0) { + device_printf(sc->sc_dev, + "unable to allocate RX buffer %d, error = %d\n", + i, error); + goto fail_rxmem; + } + + sc->sc_rxdptr = i; + sc->sc_rxdsoft[i].rxds_paddr = 0; + if ((error = bus_dmamap_load(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_dmamap, sc->sc_rxdsoft[i].rxds_buf, + CAS_PAGE_SIZE, cas_rxdma_callback, sc, 0)) != 0 || + sc->sc_rxdsoft[i].rxds_paddr == 0) { + device_printf(sc->sc_dev, + "unable to load RX DMA map %d, error = %d\n", + i, error); + goto fail_rxmap; + } + } + + CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_MII); + + cas_mifinit(sc); + + /* + * Look for an external PHY. + */ + error = ENXIO; + v = CAS_READ_4(sc, CAS_MIF_CONF); + if ((v & CAS_MIF_CONF_MDI1) != 0) { + v |= CAS_MIF_CONF_PHY_SELECT; + CAS_WRITE_4(sc, CAS_MIF_CONF, v); + switch (sc->sc_variant) { + default: + sc->sc_phyad = -1; + break; + } + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + cas_mediachange, cas_mediastatus); + } + + /* + * Fall back on an internal PHY if no external PHY was found. + */ + if (error != 0 && (v & CAS_MIF_CONF_MDI0) != 0) { + v &= ~CAS_MIF_CONF_PHY_SELECT; + CAS_WRITE_4(sc, CAS_MIF_CONF, v); + switch (sc->sc_variant) { + default: + sc->sc_phyad = -1; + break; + } + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + cas_mediachange, cas_mediastatus); + } + + /* + * Try the external PCS SERDES if we didn't find any PHYs. + */ + if (error != 0) { + CAS_WRITE_4(sc, CAS_PCS_DATAPATH, CAS_PCS_DATAPATH_SERDES); + CAS_WRITE_4(sc, CAS_PCS_SERDES_CTRL, CAS_PCS_SERDES_CTRL_ESD); + CAS_WRITE_4(sc, CAS_PCS_CONF_EN, CAS_PCS_CONF_EN); + sc->sc_flags |= CAS_SERDES; + sc->sc_phyad = CAS_PHYAD_EXTERNAL; + error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, + cas_mediachange, cas_mediastatus); + } + + if (error != 0) { + device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + goto fail_rxmap; + } + sc->sc_mii = device_get_softc(sc->sc_miibus); + + /* + * From this point forward, the attachment cannot fail. A failure + * before this point releases all resources that may have been + * allocated. + */ + + /* Announce FIFO sizes. */ + v = CAS_READ_4(sc, CAS_TX_FIFO_SIZE); + device_printf(sc->sc_dev, "%ukB RX FIFO, %ukB TX FIFO\n", + CAS_RX_FIFO_SIZE / 1024, v / 16); + + /* Attach the interface. */ + ether_ifattach(ifp, sc->sc_enaddr); + + /* + * Tell the upper layer(s) we support long frames/checksum offloads. + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + ifp->if_capabilities = IFCAP_VLAN_MTU; + if ((sc->sc_flags & CAS_NO_CSUM) == 0) { + ifp->if_capabilities |= IFCAP_HWCSUM; + ifp->if_hwassist = CAS_CSUM_FEATURES; + } + ifp->if_capenable = ifp->if_capabilities; + + return (0); + + /* + * Free any resources we've allocated during the failed attach + * attempt. Do this in reverse order and fall through. + */ + fail_rxmap: + for (i = 0; i < CAS_NRXDESC; i++) + if (sc->sc_rxdsoft[i].rxds_paddr != 0) + bus_dmamap_unload(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_dmamap); + fail_rxmem: + for (i = 0; i < CAS_NRXDESC; i++) + if (sc->sc_rxdsoft[i].rxds_buf != NULL) + bus_dmamem_free(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_buf, + sc->sc_rxdsoft[i].rxds_dmamap); + fail_txd: + for (i = 0; i < CAS_TXQUEUELEN; i++) + if (sc->sc_txsoft[i].txs_dmamap != NULL) + bus_dmamap_destroy(sc->sc_tdmatag, + sc->sc_txsoft[i].txs_dmamap); + bus_dmamap_unload(sc->sc_cdmatag, sc->sc_cddmamap); + fail_cmem: + bus_dmamem_free(sc->sc_cdmatag, sc->sc_control_data, + sc->sc_cddmamap); + fail_ctag: + bus_dma_tag_destroy(sc->sc_cdmatag); + fail_ttag: + bus_dma_tag_destroy(sc->sc_tdmatag); + fail_rtag: + bus_dma_tag_destroy(sc->sc_rdmatag); + fail_ptag: + bus_dma_tag_destroy(sc->sc_pdmatag); + fail_ifnet: + if_free(ifp); + return (error); +} + +static void +cas_detach(struct cas_softc *sc) +{ + struct ifnet *ifp = sc->sc_ifp; + int i; + + CAS_LOCK(sc); + cas_stop(ifp); + CAS_UNLOCK(sc); + callout_drain(&sc->sc_tick_ch); + callout_drain(&sc->sc_rx_ch); + ether_ifdetach(ifp); + if_free(ifp); + device_delete_child(sc->sc_dev, sc->sc_miibus); + + for (i = 0; i < CAS_NRXDESC; i++) + if (sc->sc_rxdsoft[i].rxds_dmamap != NULL) + bus_dmamap_sync(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + for (i = 0; i < CAS_NRXDESC; i++) + if (sc->sc_rxdsoft[i].rxds_paddr != 0) + bus_dmamap_unload(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_dmamap); + for (i = 0; i < CAS_NRXDESC; i++) + if (sc->sc_rxdsoft[i].rxds_buf != NULL) + bus_dmamem_free(sc->sc_rdmatag, + sc->sc_rxdsoft[i].rxds_buf, + sc->sc_rxdsoft[i].rxds_dmamap); + for (i = 0; i < CAS_TXQUEUELEN; i++) + if (sc->sc_txsoft[i].txs_dmamap != NULL) + bus_dmamap_destroy(sc->sc_tdmatag, + sc->sc_txsoft[i].txs_dmamap); + CAS_CDSYNC(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sc_cdmatag, sc->sc_cddmamap); + bus_dmamem_free(sc->sc_cdmatag, sc->sc_control_data, + sc->sc_cddmamap); + bus_dma_tag_destroy(sc->sc_cdmatag); + bus_dma_tag_destroy(sc->sc_tdmatag); + bus_dma_tag_destroy(sc->sc_rdmatag); + bus_dma_tag_destroy(sc->sc_pdmatag); +} + +static void +cas_suspend(struct cas_softc *sc) +{ + struct ifnet *ifp = sc->sc_ifp; + + CAS_LOCK(sc); + cas_stop(ifp); + CAS_UNLOCK(sc); +} + +static void +cas_resume(struct cas_softc *sc) +{ + struct ifnet *ifp = sc->sc_ifp; + + CAS_LOCK(sc); + /* + * On resume all registers have to be initialized again like + * after power-on. + */ + sc->sc_flags &= ~CAS_INITED; + if (ifp->if_flags & IFF_UP) + cas_init_locked(sc); + CAS_UNLOCK(sc); +} + +static inline void +cas_rxcksum(struct mbuf *m, uint16_t cksum) +{ + struct ether_header *eh; + struct ip *ip; + struct udphdr *uh; + uint16_t *opts; + int32_t hlen, len, pktlen; + uint32_t temp32; + + pktlen = m->m_pkthdr.len; + if (pktlen < sizeof(struct ether_header) + sizeof(struct ip)) + return; + eh = mtod(m, struct ether_header *); + if (eh->ether_type != htons(ETHERTYPE_IP)) + return; + ip = (struct ip *)(eh + 1); + if (ip->ip_v != IPVERSION) + return; + + hlen = ip->ip_hl << 2; + pktlen -= sizeof(struct ether_header); + if (hlen < sizeof(struct ip)) + return; + if (ntohs(ip->ip_len) < hlen) + return; + if (ntohs(ip->ip_len) != pktlen) + return; + if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) + return; /* Cannot handle fragmented packet. */ + + switch (ip->ip_p) { + case IPPROTO_TCP: + if (pktlen < (hlen + sizeof(struct tcphdr))) + return; + break; + case IPPROTO_UDP: + if (pktlen < (hlen + sizeof(struct udphdr))) + return; + uh = (struct udphdr *)((uint8_t *)ip + hlen); + if (uh->uh_sum == 0) + return; /* no checksum */ + break; + default: + return; + } + + cksum = ~cksum; + /* checksum fixup for IP options */ + len = hlen - sizeof(struct ip); + if (len > 0) { + opts = (uint16_t *)(ip + 1); + for (; len > 0; len -= sizeof(uint16_t), opts++) { + temp32 = cksum - *opts; + temp32 = (temp32 >> 16) + (temp32 & 65535); + cksum = temp32 & 65535; + } + } + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; + m->m_pkthdr.csum_data = cksum; +} + +static void +cas_cddma_callback(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct cas_softc *sc = xsc; + + if (error != 0) + return; + if (nsegs != 1) + panic("%s: bad control buffer segment count", __func__); + sc->sc_cddma = segs[0].ds_addr; +} + +static void +cas_rxdma_callback(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct cas_softc *sc = xsc; + + if (error != 0) + return; + if (nsegs != 1) + panic("%s: bad RX buffer segment count", __func__); + sc->sc_rxdsoft[sc->sc_rxdptr].rxds_paddr = segs[0].ds_addr; +} + +static void +cas_tick(void *arg) +{ + struct cas_softc *sc = arg; + struct ifnet *ifp; + uint32_t v; + + CAS_LOCK_ASSERT(sc, MA_OWNED); + + ifp = sc->sc_ifp; + /* + * Unload collision and error counters. + */ + ifp->if_collisions += + CAS_READ_4(sc, CAS_MAC_NORM_COLL_CNT) + + CAS_READ_4(sc, CAS_MAC_FIRST_COLL_CNT); + v = CAS_READ_4(sc, CAS_MAC_EXCESS_COLL_CNT) + + CAS_READ_4(sc, CAS_MAC_LATE_COLL_CNT); + ifp->if_collisions += v; + ifp->if_oerrors += v; + ifp->if_ierrors += + CAS_READ_4(sc, CAS_MAC_RX_LEN_ERR_CNT) + + CAS_READ_4(sc, CAS_MAC_RX_ALIGN_ERR) + + CAS_READ_4(sc, CAS_MAC_RX_CRC_ERR_CNT) + + CAS_READ_4(sc, CAS_MAC_RX_CODE_VIOL); + + /* + * Then clear the hardware counters. + */ + CAS_WRITE_4(sc, CAS_MAC_NORM_COLL_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_FIRST_COLL_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_EXCESS_COLL_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_LATE_COLL_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_RX_LEN_ERR_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_RX_ALIGN_ERR, 0); + CAS_WRITE_4(sc, CAS_MAC_RX_CRC_ERR_CNT, 0); + CAS_WRITE_4(sc, CAS_MAC_RX_CODE_VIOL, 0); + + mii_tick(sc->sc_mii); + + if (cas_watchdog(sc) == EJUSTRETURN) + return; + + callout_reset(&sc->sc_tick_ch, hz, cas_tick, sc); +} + +static int +cas_bitwait(struct cas_softc *sc, bus_addr_t r, uint32_t clr, uint32_t set) +{ + int i; + uint32_t reg; + + for (i = CAS_TRIES; i--; DELAY(100)) { + reg = CAS_READ_4(sc, r); + if ((reg & clr) == 0 && (reg & set) == set) + return (1); + } + return (0); +} + +static void +cas_reset(struct cas_softc *sc) +{ + +#ifdef CAS_DEBUG + CTR2(KTR_CAS, "%s: %s", device_get_name(sc->sc_dev), __func__); +#endif + /* Disable all interrupts in order to avoid spurious ones. */ + CAS_WRITE_4(sc, CAS_INTMASK, 0xffffffff); + + cas_reset_rx(sc); + cas_reset_tx(sc); + + /* + * Do a full reset modulo the result of the last auto-negotiation + * when using the SERDES. + */ + CAS_WRITE_4(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX | + ((sc->sc_flags & CAS_SERDES) != 0 ? CAS_RESET_PCS_DIS : 0)); + CAS_BARRIER(sc, CAS_RESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(3000); + if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX, 0)) + device_printf(sc->sc_dev, "cannot reset device\n"); +} + +static void +cas_stop(struct ifnet *ifp) +{ + struct cas_softc *sc = ifp->if_softc; + struct cas_txsoft *txs; + +#ifdef CAS_DEBUG + CTR2(KTR_CAS, "%s: %s", device_get_name(sc->sc_dev), __func__); +#endif + + callout_stop(&sc->sc_tick_ch); + callout_stop(&sc->sc_rx_ch); + + /* Disable all interrupts in order to avoid spurious ones. */ + CAS_WRITE_4(sc, CAS_INTMASK, 0xffffffff); + + cas_reset_tx(sc); + cas_reset_rx(sc); + + /* + * Release any queued transmit buffers. + */ + while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) { + STAILQ_REMOVE_HEAD(&sc->sc_txdirtyq, txs_q); + if (txs->txs_ndescs != 0) { + bus_dmamap_sync(sc->sc_tdmatag, txs->txs_dmamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->sc_tdmatag, txs->txs_dmamap); + if (txs->txs_mbuf != NULL) { + m_freem(txs->txs_mbuf); + txs->txs_mbuf = NULL; + } + } + STAILQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q); + } + + /* + * Mark the interface down and cancel the watchdog timer. + */ + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~CAS_LINK; + sc->sc_wdog_timer = 0; +} + +static int +cas_reset_rx(struct cas_softc *sc) +{ + + /* + * Resetting while DMA is in progress can cause a bus hang, so we + * disable DMA first. + */ + cas_disable_rx(sc); + CAS_WRITE_4(sc, CAS_RX_CONF, 0); + CAS_BARRIER(sc, CAS_RX_CONF, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!cas_bitwait(sc, CAS_RX_CONF, CAS_RX_CONF_RXDMA_EN, 0)) + device_printf(sc->sc_dev, "cannot disable RX DMA\n"); + + /* Finally, reset the ERX. */ + CAS_WRITE_4(sc, CAS_RESET, CAS_RESET_RX | + ((sc->sc_flags & CAS_SERDES) != 0 ? CAS_RESET_PCS_DIS : 0)); + CAS_BARRIER(sc, CAS_RESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX, 0)) { + device_printf(sc->sc_dev, "cannot reset receiver\n"); + return (1); + } + return (0); +} + +static int +cas_reset_tx(struct cas_softc *sc) +{ + + /* + * Resetting while DMA is in progress can cause a bus hang, so we + * disable DMA first. + */ + cas_disable_tx(sc); + CAS_WRITE_4(sc, CAS_TX_CONF, 0); + CAS_BARRIER(sc, CAS_TX_CONF, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!cas_bitwait(sc, CAS_TX_CONF, CAS_TX_CONF_TXDMA_EN, 0)) + device_printf(sc->sc_dev, "cannot disable TX DMA\n"); + + /* Finally, reset the ETX. */ + CAS_WRITE_4(sc, CAS_RESET, CAS_RESET_TX | + ((sc->sc_flags & CAS_SERDES) != 0 ? CAS_RESET_PCS_DIS : 0)); + CAS_BARRIER(sc, CAS_RESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!cas_bitwait(sc, CAS_RESET, CAS_RESET_RX | CAS_RESET_TX, 0)) { + device_printf(sc->sc_dev, "cannot reset transmitter\n"); + return (1); + } + return (0); +} + +static int +cas_disable_rx(struct cas_softc *sc) +{ + + CAS_WRITE_4(sc, CAS_MAC_RX_CONF, + CAS_READ_4(sc, CAS_MAC_RX_CONF) & ~CAS_MAC_RX_CONF_EN); + CAS_BARRIER(sc, CAS_MAC_RX_CONF, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return (cas_bitwait(sc, CAS_MAC_RX_CONF, CAS_MAC_RX_CONF_EN, 0)); +} + +static int +cas_disable_tx(struct cas_softc *sc) +{ + + CAS_WRITE_4(sc, CAS_MAC_TX_CONF, + CAS_READ_4(sc, CAS_MAC_TX_CONF) & ~CAS_MAC_TX_CONF_EN); + CAS_BARRIER(sc, CAS_MAC_TX_CONF, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return (cas_bitwait(sc, CAS_MAC_TX_CONF, CAS_MAC_TX_CONF_EN, 0)); +} + +static inline void +cas_rxcompinit(struct cas_rx_comp *rxcomp) +{ + + rxcomp->crc_word1 = 0; + rxcomp->crc_word2 = 0; + rxcomp->crc_word3 = + htole64(CAS_SET(ETHER_HDR_LEN + sizeof(struct ip), CAS_RC3_CSO)); + rxcomp->crc_word4 = htole64(CAS_RC4_ZERO); +} + +static void +cas_meminit(struct cas_softc *sc) +{ + int i; + + CAS_LOCK_ASSERT(sc, MA_OWNED); + + /* + * Initialize the transmit descriptor ring. + */ + for (i = 0; i < CAS_NTXDESC; i++) { + sc->sc_txdescs[i].cd_flags = 0; + sc->sc_txdescs[i].cd_buf_ptr = 0; + } + sc->sc_txfree = CAS_MAXTXFREE; + sc->sc_txnext = 0; + sc->sc_txwin = 0; + + /* + * Initialize the receive completion ring. + */ + for (i = 0; i < CAS_NRXCOMP; i++) + cas_rxcompinit(&sc->sc_rxcomps[i]); + sc->sc_rxcptr = 0; + + /* + * Initialize the first receive descriptor ring. We leave + * the second one zeroed as we don't actually use it. + */ + for (i = 0; i < CAS_NRXDESC; i++) + CAS_INIT_RXDESC(sc, i, i); + sc->sc_rxdptr = 0; + + CAS_CDSYNC(sc, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); +} + +static u_int +cas_descsize(u_int sz) +{ + + switch (sz) { + case 32: + return (CAS_DESC_32); + case 64: + return (CAS_DESC_64); + case 128: + return (CAS_DESC_128); + case 256: + return (CAS_DESC_256); + case 512: + return (CAS_DESC_512); + case 1024: + return (CAS_DESC_1K); + case 2048: + return (CAS_DESC_2K); + case 4096: + return (CAS_DESC_4K); + case 8192: + return (CAS_DESC_8K); + default: + printf("%s: invalid descriptor ring size %d\n", __func__, sz); + return (CAS_DESC_32); + } +} + +static u_int +cas_rxcompsize(u_int sz) +{ + + switch (sz) { + case 128: + return (CAS_RX_CONF_COMP_128); + case 256: + return (CAS_RX_CONF_COMP_256); + case 512: + return (CAS_RX_CONF_COMP_512); + case 1024: + return (CAS_RX_CONF_COMP_1K); + case 2048: + return (CAS_RX_CONF_COMP_2K); + case 4096: + return (CAS_RX_CONF_COMP_4K); + case 8192: + return (CAS_RX_CONF_COMP_8K); + case 16384: + return (CAS_RX_CONF_COMP_16K); + case 32768: + return (CAS_RX_CONF_COMP_32K); + default: + printf("%s: invalid dcompletion ring size %d\n", __func__, sz); + return (CAS_RX_CONF_COMP_128); + } +} + +static void +cas_init(void *xsc) +{ + struct cas_softc *sc = xsc; + + CAS_LOCK(sc); + cas_init_locked(sc); + CAS_UNLOCK(sc); +} + +/* + * Initialization of interface; set up initialization block + * and transmit/receive descriptor rings. + */ +static void +cas_init_locked(struct cas_softc *sc) +{ + struct ifnet *ifp = sc->sc_ifp; + uint32_t v; + + CAS_LOCK_ASSERT(sc, MA_OWNED); + +#ifdef CAS_DEBUG + CTR2(KTR_CAS, "%s: %s: calling stop", device_get_name(sc->sc_dev), + __func__); +#endif + /* + * Initialization sequence. The numbered steps below correspond + * to the sequence outlined in section 6.3.5.1 in the Ethernet + * Channel Engine manual (part of the PCIO manual). + * See also the STP2002-STQ document from Sun Microsystems. + */ + + /* step 1 & 2. Reset the Ethernet Channel. */ + cas_stop(ifp); + cas_reset(sc); +#ifdef CAS_DEBUG + CTR2(KTR_CAS, "%s: %s: restarting", device_get_name(sc->sc_dev), + __func__); +#endif + + /* Re-initialize the MIF. */ + cas_mifinit(sc); + + /* step 3. Setup data structures in host memory. */ + cas_meminit(sc); + + /* step 4. TX MAC registers & counters */ + cas_init_regs(sc); + + /* step 5. RX MAC registers & counters */ + cas_setladrf(sc); + + /* step 6 & 7. Program Ring Base Addresses. */ + CAS_WRITE_4(sc, CAS_TX_DESC3_BASE_HI, + (((uint64_t)CAS_CDTXDADDR(sc, 0)) >> 32)); + CAS_WRITE_4(sc, CAS_TX_DESC3_BASE_LO, + CAS_CDTXDADDR(sc, 0) & 0xffffffff); + + CAS_WRITE_4(sc, CAS_RX_COMP_BASE_HI, + (((uint64_t)CAS_CDRXCADDR(sc, 0)) >> 32)); + CAS_WRITE_4(sc, CAS_RX_COMP_BASE_LO, + CAS_CDRXCADDR(sc, 0) & 0xffffffff); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:24:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FDC5106566B; Mon, 15 Jun 2009 18:24:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0EFF8FC13; Mon, 15 Jun 2009 18:24:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIO432097310; Mon, 15 Jun 2009 18:24:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIO4pC097305; Mon, 15 Jun 2009 18:24:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906151824.n5FIO4pC097305@svn.freebsd.org> From: Marius Strobl Date: Mon, 15 Jun 2009 18:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194247 - 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, 15 Jun 2009 18:24:05 -0000 Author: marius Date: Mon Jun 15 18:24:04 2009 New Revision: 194247 URL: http://svn.freebsd.org/changeset/base/194247 Log: Add a man page for cas(4) and reference it as appropriate. Approved by: re (kib) MFC after: 2 weeks Added: head/share/man/man4/cas.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Jun 15 18:22:41 2009 (r194246) +++ head/share/man/man4/Makefile Mon Jun 15 18:24:04 2009 (r194247) @@ -55,6 +55,7 @@ MAN= aac.4 \ bwi.4 \ cardbus.4 \ carp.4 \ + cas.4 \ ccd.4 \ cd.4 \ cdce.4 \ @@ -472,6 +473,7 @@ MLINKS+=bfe.4 if_bfe.4 MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 MLINKS+=bwi.4 if_bwi.4 +MLINKS+=cas.4 if_cas.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=dc.4 if_dc.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Mon Jun 15 18:22:41 2009 (r194246) +++ head/share/man/man4/altq.4 Mon Jun 15 18:24:04 2009 (r194247) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt ALTQ 4 .Os .Sh NAME @@ -125,6 +125,7 @@ They have been applied to the following .Xr bce 4 , .Xr bfe 4 , .Xr bge 4 , +.Xr cas 4 , .Xr dc 4 , .Xr de 4 , .Xr ed 4 , Added: head/share/man/man4/cas.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cas.4 Mon Jun 15 18:24:04 2009 (r194247) @@ -0,0 +1,154 @@ +.\" +.\" Copyright (c) 2009 Marius Strobl +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 15, 2009 +.Dt CAS 4 +.Os +.Sh NAME +.Nm cas +.Nd Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn Gigabit Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device cas" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_cas="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Sun Cassini/Cassini+ and National +Semiconductor DP83065 Saturn Gigabit Ethernet controllers found +on-board in Sun UltraSPARC machines and as add-on cards. +.Pp +All controllers supported by the +.Nm +driver have TCP/UDP checksum offload capability for both receive and +transmit, support for the reception and transmission of extended frames +for +.Xr vlan 4 +and an interrupt coalescing/moderation mechanism as well as a 512-bit +multicast hash filter. +.Pp +The +.Nm +driver also supports Jumbo Frames (up to 9022 bytes), which can be +configured via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Sh HARDWARE +.Pp +The chips supported by the +.Nm +driver are: +.Pp +.Bl -bullet -compact +.It +National Semiconductor DP83065 Saturn Gigabit Ethernet +.It +Sun Cassini Gigabit Ethernet +.It +Sun Cassini+ Gigabit Ethernet +.El +.Pp +The +following add-on cards are known to work with the +.Nm +driver at this time: +.Pp +.Bl -bullet -compact +.It +Sun GigaSwift Ethernet 1.0 UTP (Cassini) +(part no.\& 501-5902) +.It +Sun GigaSwift Ethernet UTP (GCS) +(part no.\& 501-6719) +.It +Sun Quad GigaSwift Ethernet UTP (QGE) +(part no.\& 501-6522) +.El +.Sh NOTES +On sparc64 the +.Nm +driver respects the +.Va local-mac-address? +system configuration variable which can be set in the Open Firmware boot +monitor using the +.Ic setenv +command or by +.Xr eeprom 8 . +If set to +.Dq Li false +(the default), the +.Nm +driver will use the system's default MAC address for all of its devices. +If set to +.Dq Li true , +the unique MAC address of each interface is used if present rather than +the system's default MAC address. +.Pp +Supported interfaces having their own MAC address include on-board +versions on boards equipped with more than one Ethernet interface and +all add-on cards. +.Sh SEE ALSO +.Xr altq 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr vlan 4 , +.Xr eeprom 8 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 +and +.Fx 7.3 . +It is named after the +.Nm +driver which first appeared in +.Ox 4.1 +and supports the same set of controllers but is otherwise unrelated. +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Marius Strobl +.Aq marius@FreeBSD.org +based on the +.Xr gem 4 +driver. Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Mon Jun 15 18:22:41 2009 (r194246) +++ head/share/man/man4/miibus.4 Mon Jun 15 18:24:04 2009 (r194247) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt MIIBUS 4 .Os .Sh NAME @@ -61,6 +61,8 @@ Broadcom NetXtreme II Gigabit Ethernet Broadcom BCM4401 Ethernet .It Xr bge 4 Broadcom BCM570xx Gigabit Ethernet +.It Xr cas 4 +Sun Cassini/Cassini+ and National Semiconductor DP83065 Saturn .It Xr dc 4 DEC/Intel 21143 and various workalikes .It Xr ed 4 @@ -137,6 +139,7 @@ but as a result are not well behaved new .Xr bce 4 , .Xr bfe 4 , .Xr bge 4 , +.Xr cas 4 , .Xr dc 4 , .Xr ed 4 , .Xr et 4 , Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Mon Jun 15 18:22:41 2009 (r194246) +++ head/share/man/man4/vlan.4 Mon Jun 15 18:24:04 2009 (r194247) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 10, 2009 +.Dd June 14, 2009 .Dt VLAN 4 .Os .Sh NAME @@ -161,6 +161,7 @@ The following interfaces support long fr .Nm natively: .Xr bfe 4 , +.Xr cas 4 , .Xr dc 4 , .Xr fwe 4 , .Xr fxp 4 , From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:25:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E310B1065672; Mon, 15 Jun 2009 18:25:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D12EC8FC1B; Mon, 15 Jun 2009 18:25:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIPAGw097369; Mon, 15 Jun 2009 18:25:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIPAn2097368; Mon, 15 Jun 2009 18:25:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906151825.n5FIPAn2097368@svn.freebsd.org> From: Marius Strobl Date: Mon, 15 Jun 2009 18:25: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: r194248 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 18:25:11 -0000 Author: marius Date: Mon Jun 15 18:25:10 2009 New Revision: 194248 URL: http://svn.freebsd.org/changeset/base/194248 Log: Add cas(4). Approved by: re (kib) MFC after: 2 weeks Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon Jun 15 18:24:04 2009 (r194247) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon Jun 15 18:25:10 2009 (r194248) @@ -756,6 +756,8 @@ &hwlist.bge; + &hwlist.cas; + &hwlist.cdce; [&arch.amd64;, &arch.i386;] Crystal Semiconductor From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:27:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16DCD106564A; Mon, 15 Jun 2009 18:27:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04D7E8FC13; Mon, 15 Jun 2009 18:27:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIRRaB097451; Mon, 15 Jun 2009 18:27:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIRR22097450; Mon, 15 Jun 2009 18:27:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200906151827.n5FIRR22097450@svn.freebsd.org> From: Marius Strobl Date: Mon, 15 Jun 2009 18:27: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: r194249 - 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, 15 Jun 2009 18:27:28 -0000 Author: marius Date: Mon Jun 15 18:27:27 2009 New Revision: 194249 URL: http://svn.freebsd.org/changeset/base/194249 Log: Add cas(4). Approved by: re (kib) MFC after: 2 weeks Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Mon Jun 15 18:25:10 2009 (r194248) +++ head/usr.sbin/sysinstall/devices.c Mon Jun 15 18:27:27 2009 (r194249) @@ -101,6 +101,7 @@ static struct _devname { NETWORK("bfe", "Broadcom BCM440x PCI Ethernet card"), NETWORK("bge", "Broadcom BCM570x PCI Gigabit Ethernet card"), NETWORK("bm", "Apple BMAC Built-in Ethernet"), + NETWORK("cas", "Sun Cassini/Cassini+ or NS DP83065 Saturn Ethernet"), NETWORK("cue", "CATC USB Ethernet adapter"), NETWORK("cxgb", "Chelsio T3 10Gb Ethernet card"), NETWORK("fpa", "DEC DEFPA PCI FDDI card"), From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:49:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37B72106566C; Mon, 15 Jun 2009 18:49:07 +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 25C938FC24; Mon, 15 Jun 2009 18:49:07 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIn7Du097970; Mon, 15 Jun 2009 18:49:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIn6JR097968; Mon, 15 Jun 2009 18:49:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906151849.n5FIn6JR097968@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 15 Jun 2009 18:49: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: r194250 - head/share/timedef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 18:49:08 -0000 Author: jkim Date: Mon Jun 15 18:49:06 2009 New Revision: 194250 URL: http://svn.freebsd.org/changeset/base/194250 Log: Long long time ago, several utilities in base used to parse %c output and we were not able to change c_fmt without breaking these utilities. Since ache fixed all known issues 8 years ago, now we make ko_KR more usable. Better late than never... Modified: head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Mon Jun 15 18:27:27 2009 (r194249) +++ head/share/timedef/ko_KR.UTF-8.src Mon Jun 15 18:49:06 2009 (r194250) @@ -61,13 +61,11 @@ # # x_fmt # -%Y/%m/%d +%Yë…„ %bì›” %eì¼ # # c_fmt # -# just following tradition... -# %Yë…„ %bì›” %eì¼ %aìš”ì¼ %X -%a %b/%e %H:%M:%S %Y +%x %A %X # # am # @@ -79,7 +77,7 @@ # # date_fmt # -%Yë…„ %B %eì¼ %A %X %Z +%c %Z # # Long month names (without case ending) # Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Mon Jun 15 18:27:27 2009 (r194249) +++ head/share/timedef/ko_KR.eucKR.src Mon Jun 15 18:49:06 2009 (r194250) @@ -61,13 +61,11 @@ # # x_fmt # -%Y/%m/%d +%Y³â %b¿ù %eÀÏ # # c_fmt # -# just following tradition... -# %Y³â %b¿ù %eÀÏ %a¿äÀÏ %X -%a %b/%e %H:%M:%S %Y +%x %A %X # # am # @@ -79,7 +77,7 @@ # # date_fmt # -%Y³â %B %eÀÏ %A %X %Z +%c %Z # # Long month names (without case ending) # From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 18:59:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F2A31065672; Mon, 15 Jun 2009 18:59:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BC6A8FC17; Mon, 15 Jun 2009 18:59:30 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FIxUrd098287; Mon, 15 Jun 2009 18:59:30 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FIxUbl098279; Mon, 15 Jun 2009 18:59:30 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906151859.n5FIxUbl098279@svn.freebsd.org> From: Jamie Gritton Date: Mon, 15 Jun 2009 18:59: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: r194251 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 18:59:30 -0000 Author: jamie Date: Mon Jun 15 18:59:29 2009 New Revision: 194251 URL: http://svn.freebsd.org/changeset/base/194251 Log: Manage vnets via the jail system. If a jail is given the boolean parameter "vnet" when it is created, a new vnet instance will be created along with the jail. Networks interfaces can be moved between prisons with an ioctl similar to the one that moves them between vimages. For now vnets will co-exist under both jails and vimages, but soon struct vimage will be going away. Reviewed by: zec, julian Approved by: bz (mentor) Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_vimage.c head/sys/net/if.c head/sys/net/if.h head/sys/sys/jail.h head/sys/sys/priv.h head/sys/sys/sockio.h head/sys/sys/vimage.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/kern/kern_jail.c Mon Jun 15 18:59:29 2009 (r194251) @@ -126,6 +126,9 @@ static char *pr_flag_names[] = { #ifdef INET6 [3] = "ip6", #endif +#ifdef VIMAGE + [4] = "vnet", +#endif }; static char *pr_flag_nonames[] = { @@ -137,6 +140,9 @@ static char *pr_flag_nonames[] = { #ifdef INET6 [3] = "noip6", #endif +#ifdef VIMAGE + [4] = "novnet", +#endif }; static char *pr_allow_names[] = { @@ -561,6 +567,13 @@ kern_jail_set(struct thread *td, struct vfs_opterror(opts, "new jail must persist or attach"); goto done_errmsg; } +#ifdef VIMAGE + if ((flags & JAIL_UPDATE) && (ch_flags & PR_VNET)) { + error = EINVAL; + vfs_opterror(opts, "vnet cannot be changed after creation"); + goto done_errmsg; + } +#endif pr_allow = ch_allow = 0; for (fi = 0; fi < sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); @@ -1113,6 +1126,11 @@ kern_jail_set(struct thread *td, struct LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); +#ifdef VIMAGE + /* Allocate a new vnet if specified. */ + pr->pr_vnet = (pr_flags & PR_VNET) + ? vnet_alloc() : ppr->pr_vnet; +#endif /* * Allocate a dedicated cpuset for each jail. * Unlike other initial settings, this may return an erorr. @@ -2410,6 +2428,10 @@ prison_deref(struct prison *pr, int flag tpr->pr_prisoncount--; sx_downgrade(&allprison_lock); +#ifdef VIMAGE + if (pr->pr_flags & PR_VNET) + vnet_destroy(pr->pr_vnet); +#endif if (pr->pr_root != NULL) { vfslocked = VFS_LOCK_GIANT(pr->pr_root->v_mount); vrele(pr->pr_root); @@ -3849,6 +3871,10 @@ SYSCTL_JAIL_PARAM(, enforce_statfs, CTLT "I", "Jail cannot see all mounted file systems"); SYSCTL_JAIL_PARAM(, persist, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail persistence"); +#ifdef VIMAGE +SYSCTL_JAIL_PARAM(, vnet, CTLTYPE_INT | CTLFLAG_RDTUN, + "B", "Virtual network stack"); +#endif SYSCTL_JAIL_PARAM(, dying, CTLTYPE_INT | CTLFLAG_RD, "B", "Jail is in the process of shutting down"); @@ -3923,6 +3949,9 @@ db_show_prison(struct prison *pr) db_printf(" path = %s\n", pr->pr_path); db_printf(" cpuset = %d\n", pr->pr_cpuset ? pr->pr_cpuset->cs_id : -1); +#ifdef VIMAGE + db_printf(" vnet = %p\n", pr->pr_vnet); +#endif db_printf(" root = %p\n", pr->pr_root); db_printf(" securelevel = %d\n", pr->pr_securelevel); db_printf(" child = %p\n", LIST_FIRST(&pr->pr_children)); Modified: head/sys/kern/kern_vimage.c ============================================================================== --- head/sys/kern/kern_vimage.c Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/kern/kern_vimage.c Mon Jun 15 18:59:29 2009 (r194251) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include @@ -96,7 +97,6 @@ struct mtx vnet_list_refc_mtx; int vnet_list_refc = 0; static u_int last_vi_id = 0; -static u_int last_vnet_id = 0; static u_int last_vprocg_id = 0; struct vnet *vnet0; @@ -105,69 +105,90 @@ struct vnet *vnet0; #ifdef VIMAGE /* - * Interim userspace interface - will be replaced by jail soon. - */ - -/* - * Move an ifnet to another vnet. The ifnet can be specified either - * by ifp argument, or by name contained in vi_req->vi_if_xname if NULL is - * passed as ifp. The target vnet can be specified either by vnet - * argument or by name. If vnet name equals to ".." or vi_req is set to - * NULL the interface is moved to the parent vnet. + * Move an ifnet to or from another vnet, specified by the jail id. If a + * vi_req is passed in, it is used to find the interface and a vimage + * containing the vnet (a vimage name of ".." stands for the parent vnet). */ int -vi_if_move(struct vi_req *vi_req, struct ifnet *ifp, struct vimage *vip) +vi_if_move(struct thread *td, struct ifnet *ifp, char *ifname, int jid, + struct vi_req *vi_req) { - struct vimage *new_vip; - struct vnet *new_vnet = NULL; + struct ifnet *t_ifp; + struct prison *pr; + struct vimage *new_vip, *my_vip; + struct vnet *new_vnet; - /* Check for API / ABI version mismatch. */ - if (vi_req != NULL && vi_req->vi_api_cookie != VI_API_COOKIE) - return (EDOOFUS); + if (vi_req != NULL) { + /* SIOCSIFVIMAGE */ + /* Check for API / ABI version mismatch. */ + if (vi_req->vi_api_cookie != VI_API_COOKIE) + return (EDOOFUS); + + /* Find the target vnet. */ + my_vip = TD_TO_VIMAGE(td); + if (strcmp(vi_req->vi_name, "..") == 0) { + if (IS_DEFAULT_VIMAGE(my_vip)) + return (ENXIO); + new_vnet = my_vip->vi_parent->v_net; + } else { + new_vip = vimage_by_name(my_vip, vi_req->vi_name); + if (new_vip == NULL) + return (ENXIO); + new_vnet = new_vip->v_net; + } - /* Find the target vnet. */ - if (vi_req == NULL || strcmp(vi_req->vi_name, "..") == 0) { - if (IS_DEFAULT_VIMAGE(vip)) + /* Try to find the target ifnet by name. */ + ifname = vi_req->vi_if_xname; + ifp = ifunit(ifname); + if (ifp == NULL) return (ENXIO); - new_vnet = vip->vi_parent->v_net; } else { - new_vip = vimage_by_name(vip, vi_req->vi_name); - if (new_vip == NULL) + sx_slock(&allprison_lock); + pr = prison_find_child(td->td_ucred->cr_prison, jid); + sx_sunlock(&allprison_lock); + if (pr == NULL) return (ENXIO); - new_vnet = new_vip->v_net; - } - - /* Try to find the target ifnet by name. */ - if (ifp == NULL) - ifp = ifunit(vi_req->vi_if_xname); + mtx_unlock(&pr->pr_mtx); + if (ifp != NULL) { + /* SIOCSIFVNET */ + new_vnet = pr->pr_vnet; + } else { + /* SIOCSIFRVNET */ + new_vnet = TD_TO_VNET(td); + CURVNET_SET(pr->pr_vnet); + ifp = ifunit(ifname); + CURVNET_RESTORE(); + if (ifp == NULL) + return (ENXIO); + } - if (ifp == NULL) - return (ENXIO); + /* No-op if the target jail has the same vnet. */ + if (new_vnet == ifp->if_vnet) + return (0); + } /* * Check for naming clashes in target vnet. Not locked so races * are possible. */ - if (vi_req != NULL) { - struct ifnet *t_ifp; - - CURVNET_SET_QUIET(new_vnet); - t_ifp = ifunit(vi_req->vi_if_xname); - CURVNET_RESTORE(); - if (t_ifp != NULL) - return (EEXIST); - } + CURVNET_SET_QUIET(new_vnet); + t_ifp = ifunit(ifname); + CURVNET_RESTORE(); + if (t_ifp != NULL) + return (EEXIST); /* Detach from curvnet and attach to new_vnet. */ if_vmove(ifp, new_vnet); /* Report the new if_xname back to the userland */ - if (vi_req != NULL) - sprintf(vi_req->vi_if_xname, "%s", ifp->if_xname); - + sprintf(ifname, "%s", ifp->if_xname); return (0); } +/* + * Interim userspace interface - will be replaced by jail soon. + */ + int vi_td_ioctl(u_long cmd, struct vi_req *vi_req, struct thread *td) { @@ -606,13 +627,66 @@ vi_symlookup(struct kld_sym_lookup *look } #ifdef VIMAGE +struct vnet * +vnet_alloc(void) +{ + struct vnet *vnet; + struct vnet_modlink *vml; + + vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); + vnet->vnet_magic_n = VNET_MAGIC_N; + + /* Initialize / attach vnet module instances. */ + CURVNET_SET_QUIET(vnet); + TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) + vnet_mod_constructor(vml); + CURVNET_RESTORE(); + + VNET_LIST_WLOCK(); + LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); + VNET_LIST_WUNLOCK(); + + return (vnet); +} + +void +vnet_destroy(struct vnet *vnet) +{ + struct ifnet *ifp, *nifp; + struct vnet_modlink *vml; + + KASSERT(vnet->sockcnt == 0, ("%s: vnet still has sockets", __func__)); + + VNET_LIST_WLOCK(); + LIST_REMOVE(vnet, vnet_le); + VNET_LIST_WUNLOCK(); + + CURVNET_SET_QUIET(vnet); + INIT_VNET_NET(vnet); + + /* Return all inherited interfaces to their parent vnets. */ + TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { + if (ifp->if_home_vnet != ifp->if_vnet) + if_vmove(ifp, ifp->if_home_vnet); + } + + /* Detach / free per-module state instances. */ + TAILQ_FOREACH_REVERSE(vml, &vnet_modlink_head, + vnet_modlink_head, vml_mod_le) + vnet_mod_destructor(vml); + + CURVNET_RESTORE(); + + /* Hopefully, we are OK to free the vnet container itself. */ + vnet->vnet_magic_n = 0xdeadbeef; + free(vnet, M_VNET); +} + static struct vimage * vi_alloc(struct vimage *parent, char *name) { struct vimage *vip; struct vprocg *vprocg; - struct vnet *vnet; - struct vnet_modlink *vml; vip = malloc(sizeof(struct vimage), M_VIMAGE, M_NOWAIT | M_ZERO); if (vip == NULL) @@ -628,14 +702,7 @@ vi_alloc(struct vimage *parent, char *na panic("there can be only one default vimage!"); LIST_INSERT_HEAD(&vimage_head, vip, vi_le); - vnet = malloc(sizeof(struct vnet), M_VNET, M_NOWAIT | M_ZERO); - if (vnet == NULL) - panic("vi_alloc: malloc failed for vnet \"%s\"\n", name); - vip->v_net = vnet; - vnet->vnet_id = last_vnet_id++; - if (vnet->vnet_id == 0) - vnet0 = vnet; - vnet->vnet_magic_n = VNET_MAGIC_N; + vip->v_net = vnet_alloc(); vprocg = malloc(sizeof(struct vprocg), M_VPROCG, M_NOWAIT | M_ZERO); if (vprocg == NULL) @@ -643,16 +710,6 @@ vi_alloc(struct vimage *parent, char *na vip->v_procg = vprocg; vprocg->vprocg_id = last_vprocg_id++; - /* Initialize / attach vnet module instances. */ - CURVNET_SET_QUIET(vnet); - TAILQ_FOREACH(vml, &vnet_modlink_head, vml_mod_le) - vnet_mod_constructor(vml); - CURVNET_RESTORE(); - - VNET_LIST_WLOCK(); - LIST_INSERT_HEAD(&vnet_head, vnet, vnet_le); - VNET_LIST_WUNLOCK(); - /* XXX locking */ LIST_INSERT_HEAD(&vprocg_head, vprocg, vprocg_le); @@ -666,10 +723,7 @@ vi_alloc(struct vimage *parent, char *na static int vi_destroy(struct vimage *vip) { - struct vnet *vnet = vip->v_net; struct vprocg *vprocg = vip->v_procg; - struct ifnet *ifp, *nifp; - struct vnet_modlink *vml; /* XXX Beware of races -> more locking to be done... */ if (!LIST_EMPTY(&vip->vi_child_head)) @@ -678,9 +732,6 @@ vi_destroy(struct vimage *vip) if (vprocg->nprocs != 0) return (EBUSY); - if (vnet->sockcnt != 0) - return (EBUSY); - #ifdef INVARIANTS if (vip->vi_ucredrefc != 0) printf("vi_destroy: %s ucredrefc %d\n", @@ -688,33 +739,12 @@ vi_destroy(struct vimage *vip) #endif /* Point with no return - cleanup MUST succeed! */ + vnet_destroy(vip->v_net); + LIST_REMOVE(vip, vi_le); LIST_REMOVE(vip, vi_sibling); LIST_REMOVE(vprocg, vprocg_le); - VNET_LIST_WLOCK(); - LIST_REMOVE(vnet, vnet_le); - VNET_LIST_WUNLOCK(); - - CURVNET_SET_QUIET(vnet); - INIT_VNET_NET(vnet); - - /* Return all inherited interfaces to their parent vnets. */ - TAILQ_FOREACH_SAFE(ifp, &V_ifnet, if_link, nifp) { - if (ifp->if_home_vnet != ifp->if_vnet) - vi_if_move(NULL, ifp, vip); - } - - /* Detach / free per-module state instances. */ - TAILQ_FOREACH_REVERSE(vml, &vnet_modlink_head, - vnet_modlink_head, vml_mod_le) - vnet_mod_destructor(vml); - - CURVNET_RESTORE(); - - /* Hopefully, we are OK to free the vnet container itself. */ - vnet->vnet_magic_n = 0xdeadbeef; - free(vnet, M_VNET); free(vprocg, M_VPROCG); free(vip, M_VIMAGE); @@ -745,7 +775,7 @@ vi_init(void *unused) * otherwise CURVNET_SET() macros would scream about unnecessary * curvnet recursions. */ - curvnet = LIST_FIRST(&vnet_head); + curvnet = prison0.pr_vnet = vnet0 = LIST_FIRST(&vnet_head); #endif } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/net/if.c Mon Jun 15 18:59:29 2009 (r194251) @@ -2127,6 +2127,15 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, rt_ifannouncemsg(ifp, IFAN_ARRIVAL); break; +#ifdef VIMAGE + case SIOCSIFVNET: + error = priv_check(td, PRIV_NET_SETIFVNET); + if (error) + return (error); + error = vi_if_move(td, ifp, ifr->ifr_name, ifr->ifr_jid, NULL); + break; +#endif + case SIOCSIFMETRIC: error = priv_check(td, PRIV_NET_SETIFMETRIC); if (error) @@ -2313,14 +2322,19 @@ ifioctl(struct socket *so, u_long cmd, c switch (cmd) { #ifdef VIMAGE + case SIOCSIFRVNET: + error = priv_check(td, PRIV_NET_SETIFVNET); + if (error) + return (error); + return (vi_if_move(td, NULL, ifr->ifr_name, ifr->ifr_jid, + NULL)); /* * XXX vnet creation will be implemented through the new jail * framework - this is just a temporary hack for testing the * vnet create / destroy mechanisms. */ case SIOCSIFVIMAGE: - error = vi_if_move((struct vi_req *) data, NULL, - TD_TO_VIMAGE(td)); + error = vi_if_move(td, NULL, NULL, 0, (struct vi_req *) data); return (error); case SIOCSPVIMAGE: case SIOCGPVIMAGE: Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/net/if.h Mon Jun 15 18:59:29 2009 (r194251) @@ -296,6 +296,7 @@ struct ifreq { struct sockaddr ifru_broadaddr; short ifru_flags[2]; short ifru_index; + int ifru_jid; int ifru_metric; int ifru_mtu; int ifru_phys; @@ -308,6 +309,7 @@ struct ifreq { #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ #define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ #define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ +#define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */ #define ifr_metric ifr_ifru.ifru_metric /* metric */ #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */ #define ifr_phys ifr_ifru.ifru_phys /* physical wire */ Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/sys/jail.h Mon Jun 15 18:59:29 2009 (r194251) @@ -171,6 +171,7 @@ struct prison { char pr_domainname[MAXHOSTNAMELEN]; /* (p) jail domainname */ char pr_hostuuid[HOSTUUIDLEN]; /* (p) jail hostuuid */ unsigned long pr_hostid; /* (p) jail hostid */ + struct vnet *pr_vnet; /* (c) network stack */ }; #endif /* _KERNEL || _WANT_PRISON */ @@ -180,6 +181,7 @@ struct prison { #define PR_HOST 0x00000002 /* Virtualize hostname et al */ #define PR_IP4_USER 0x00000004 /* Virtualize IPv4 addresses */ #define PR_IP6_USER 0x00000008 /* Virtualize IPv6 addresses */ +#define PR_VNET 0x00000010 /* Virtual network stack */ /* Internal flag bits */ #define PR_REMOVE 0x01000000 /* In process of being removed */ Modified: head/sys/sys/priv.h ============================================================================== --- head/sys/sys/priv.h Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/sys/priv.h Mon Jun 15 18:59:29 2009 (r194251) @@ -325,6 +325,7 @@ #define PRIV_NET_DELIFADDR 414 /* Delete protocol addr on interface. */ #define PRIV_NET_LAGG 415 /* Administer lagg interface. */ #define PRIV_NET_GIF 416 /* Administer gif interface. */ +#define PRIV_NET_SETIFVNET 417 /* Move interface to vnet. */ /* * 802.11-related privileges. Modified: head/sys/sys/sockio.h ============================================================================== --- head/sys/sys/sockio.h Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/sys/sockio.h Mon Jun 15 18:59:29 2009 (r194251) @@ -108,6 +108,9 @@ #define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */ #define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */ +#define SIOCSIFVNET _IOWR('i', 90, struct ifreq) /* move IF jail/vnet */ +#define SIOCSIFRVNET _IOWR('i', 91, struct ifreq) /* reclaim vnet IF */ + #define SIOCSPVIMAGE _IOW('i', 101, struct vi_req) /* set proc vimage */ #define SIOCGPVIMAGE _IOWR('i', 102, struct vi_req) /* get proc vimage */ #define SIOCSIFVIMAGE _IOWR('i', 103, struct vi_req) /* set ifc vi/net */ Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Mon Jun 15 18:49:06 2009 (r194250) +++ head/sys/sys/vimage.h Mon Jun 15 18:59:29 2009 (r194251) @@ -35,6 +35,9 @@ #include #include +#ifdef VIMAGE +#include +#endif /* Interim userspace API. */ struct vi_req { @@ -69,11 +72,13 @@ struct vi_req { #define VNET_DEBUG #endif +struct vimage; struct vprocg; struct vnet; struct vi_req; struct ifnet; struct kld_sym_lookup; +struct thread; typedef int vnet_attach_fn(const void *); typedef int vnet_detach_fn(const void *); @@ -157,13 +162,16 @@ struct vnet_modlink { int vi_symlookup(struct kld_sym_lookup *, char *); int vi_td_ioctl(u_long, struct vi_req *, struct thread *); -int vi_if_move(struct vi_req *, struct ifnet *, struct vimage *); +int vi_if_move(struct thread *, struct ifnet *, char *, int, + struct vi_req *); int vi_child_of(struct vimage *, struct vimage *); struct vimage *vimage_by_name(struct vimage *, char *); void vnet_mod_register(const struct vnet_modinfo *); void vnet_mod_register_multi(const struct vnet_modinfo *, void *, char *); void vnet_mod_deregister(const struct vnet_modinfo *); void vnet_mod_deregister_multi(const struct vnet_modinfo *, void *, char *); +struct vnet *vnet_alloc(void); +void vnet_destroy(struct vnet *); #endif /* !VIMAGE_GLOBALS */ @@ -199,7 +207,7 @@ struct vimage { LIST_HEAD(, vimage) vi_child_head; /* direct offspring list */ struct vimage *vi_parent; /* ptr to parent vimage */ u_int vi_id; /* ID num */ - u_int vi_ucredrefc; /* # of ucreds pointing to us */ + volatile u_int vi_ucredrefc; /* # of ucreds pointing to us */ char vi_name[MAXHOSTNAMELEN]; struct vnet *v_net; struct vprocg *v_procg; @@ -209,7 +217,6 @@ struct vnet { void *mod_data[VNET_MOD_MAX]; LIST_ENTRY(vnet) vnet_le; /* all vnets list */ u_int vnet_magic_n; - u_int vnet_id; /* ID num */ u_int ifcnt; u_int sockcnt; }; @@ -319,20 +326,24 @@ extern struct vprocg_list_head vprocg_he #ifdef VIMAGE #define IS_DEFAULT_VIMAGE(arg) ((arg)->vi_id == 0) -#define IS_DEFAULT_VNET(arg) ((arg)->vnet_id == 0) +#define IS_DEFAULT_VNET(arg) ((arg) == vnet0) #else #define IS_DEFAULT_VIMAGE(arg) 1 #define IS_DEFAULT_VNET(arg) 1 #endif #ifdef VIMAGE +#define CRED_TO_VNET(cr) \ + (IS_DEFAULT_VIMAGE((cr)->cr_vimage) ? (cr)->cr_prison->pr_vnet \ + : (cr)->cr_vimage->v_net) #define TD_TO_VIMAGE(td) (td)->td_ucred->cr_vimage -#define TD_TO_VNET(td) (td)->td_ucred->cr_vimage->v_net +#define TD_TO_VNET(td) CRED_TO_VNET((td)->td_ucred) #define TD_TO_VPROCG(td) (td)->td_ucred->cr_vimage->v_procg #define P_TO_VIMAGE(p) (p)->p_ucred->cr_vimage -#define P_TO_VNET(p) (p)->p_ucred->cr_vimage->v_net +#define P_TO_VNET(p) CRED_TO_VNET((p)->p_ucred) #define P_TO_VPROCG(p) (p)->p_ucred->cr_vimage->v_procg #else /* !VIMAGE */ +#define CRED_TO_VNET(cr) NULL #define TD_TO_VIMAGE(td) NULL #define TD_TO_VNET(td) NULL #define P_TO_VIMAGE(p) NULL From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:01:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC5C106564A; Mon, 15 Jun 2009 19:01:54 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C458FC16; Mon, 15 Jun 2009 19:01:54 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FJ1svG098406; Mon, 15 Jun 2009 19:01:54 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FJ1s82098399; Mon, 15 Jun 2009 19:01:54 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906151901.n5FJ1s82098399@svn.freebsd.org> From: Jamie Gritton Date: Mon, 15 Jun 2009 19:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194252 - in head/sys: compat/linprocfs compat/linux kern net netinet 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, 15 Jun 2009 19:01:54 -0000 Author: jamie Date: Mon Jun 15 19:01:53 2009 New Revision: 194252 URL: http://svn.freebsd.org/changeset/base/194252 Log: Get vnets from creds instead of threads where they're available, and from passed threads instead of curthread. Reviewed by: zec, julian Approved by: bz (mentor) Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/compat/linux/linux_ioctl.c head/sys/kern/kern_sysctl.c head/sys/kern/uipc_socket.c head/sys/net/if_tun.c head/sys/netinet/tcp_subr.c head/sys/sys/sysctl.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/compat/linprocfs/linprocfs.c Mon Jun 15 19:01:53 2009 (r194252) @@ -1079,7 +1079,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) static int linprocfs_donetdev(PFS_FILL_ARGS) { - INIT_VNET_NET(TD_TO_VNET(curthread)); + INIT_VNET_NET(TD_TO_VNET(td)); char ifname[16]; /* XXX LINUX_IFNAMSIZ */ struct ifnet *ifp; Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/compat/linux/linux_ioctl.c Mon Jun 15 19:01:53 2009 (r194252) @@ -2091,9 +2091,9 @@ linux_ifname(struct ifnet *ifp, char *bu */ static struct ifnet * -ifname_linux_to_bsd(const char *lxname, char *bsdname) +ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) { - INIT_VNET_NET(TD_TO_VNET(curthread)); + INIT_VNET_NET(TD_TO_VNET(td)); struct ifnet *ifp; int len, unit; char *ep; @@ -2379,7 +2379,7 @@ linux_ioctl_socket(struct thread *td, st printf("%s(): ioctl %d on %.*s\n", __func__, args->cmd & 0xffff, LINUX_IFNAMSIZ, lifname); #endif - ifp = ifname_linux_to_bsd(lifname, ifname); + ifp = ifname_linux_to_bsd(td, lifname, ifname); if (ifp == NULL) return (EINVAL); /* Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/kern/kern_sysctl.c Mon Jun 15 19:01:53 2009 (r194252) @@ -1599,7 +1599,7 @@ userland_sysctl(struct thread *td, int * sx_xlock(&sysctlmemlock); } else memlocked = 0; - CURVNET_SET(TD_TO_VNET(curthread)); + CURVNET_SET(TD_TO_VNET(td)); for (;;) { req.oldidx = 0; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/kern/uipc_socket.c Mon Jun 15 19:01:53 2009 (r194252) @@ -359,7 +359,7 @@ socreate(int dom, struct socket **aso, i if (prp->pr_type != type) return (EPROTOTYPE); - so = soalloc(TD_TO_VNET(td)); + so = soalloc(CRED_TO_VNET(cred)); if (so == NULL) return (ENOBUFS); Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/net/if_tun.c Mon Jun 15 19:01:53 2009 (r194252) @@ -226,7 +226,7 @@ tunclone(void *arg, struct ucred *cred, else append_unit = 0; - CURVNET_SET(TD_TO_VNET(curthread)); + CURVNET_SET(CRED_TO_VNET(cred)); /* find any existing device, or allocate new unit number */ i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0); if (i) { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/netinet/tcp_subr.c Mon Jun 15 19:01:53 2009 (r194252) @@ -131,7 +131,7 @@ static int tcp_inflight_stab; static int sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); + INIT_VNET_INET(TD_TO_VNET(req->td)); int error, new; new = V_tcp_mssdflt; @@ -154,7 +154,7 @@ SYSCTL_V_PROC(V_NET, vnet_inet, _net_ine static int sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); + INIT_VNET_INET(TD_TO_VNET(req->td)); int error, new; new = V_tcp_v6mssdflt; Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Jun 15 18:59:29 2009 (r194251) +++ head/sys/sys/sysctl.h Mon Jun 15 19:01:53 2009 (r194252) @@ -456,7 +456,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e break; \ case V_NET: \ cp = (char *) \ - TD_TO_VNET(curthread)->mod_data[oidp->oid_v_mod]; \ + TD_TO_VNET(req->td)->mod_data[oidp->oid_v_mod]; \ arg1 = cp + (size_t) arg1; \ break; \ case V_PROCG: \ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:17:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCE251065676 for ; Mon, 15 Jun 2009 19:17:49 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outT.internet-mail-service.net (outt.internet-mail-service.net [216.240.47.243]) by mx1.freebsd.org (Postfix) with ESMTP id C17428FC1D for ; Mon, 15 Jun 2009 19:17:49 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id BFCAF8DF27; Mon, 15 Jun 2009 12:18:25 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 313CD2D6006; Mon, 15 Jun 2009 12:17:49 -0700 (PDT) Message-ID: <4A369E5C.3070807@elischer.org> Date: Mon, 15 Jun 2009 12:17:48 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Jamie Gritton References: <200906151859.n5FIxUbl098279@svn.freebsd.org> In-Reply-To: <200906151859.n5FIxUbl098279@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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: r194251 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:17:50 -0000 Jamie Gritton wrote: > Author: jamie > Date: Mon Jun 15 18:59:29 2009 > New Revision: 194251 > URL: http://svn.freebsd.org/changeset/base/194251 > > Log: > Manage vnets via the jail system. If a jail is given the boolean > parameter "vnet" when it is created, a new vnet instance will be created > along with the jail. Networks interfaces can be moved between prisons > with an ioctl similar to the one that moves them between vimages. > For now vnets will co-exist under both jails and vimages, but soon > struct vimage will be going away. > > Reviewed by: zec, julian > Approved by: bz (mentor) > > Modified: > head/sys/kern/kern_jail.c > head/sys/kern/kern_vimage.c > head/sys/net/if.c > head/sys/net/if.h > head/sys/sys/jail.h > head/sys/sys/priv.h > head/sys/sys/sockio.h > head/sys/sys/vimage.h > the ioctl will be in ifcofig right? ifconfig em0 jail {Jail-ID} ?? From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:17:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D1051065674; Mon, 15 Jun 2009 19:17:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5135A8FC1F; Mon, 15 Jun 2009 19:17:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FJHrhJ098875; Mon, 15 Jun 2009 19:17:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FJHr3U098873; Mon, 15 Jun 2009 19:17:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906151917.n5FJHr3U098873@svn.freebsd.org> From: Ed Schouten Date: Mon, 15 Jun 2009 19:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194256 - 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, 15 Jun 2009 19:17:54 -0000 Author: ed Date: Mon Jun 15 19:17:52 2009 New Revision: 194256 URL: http://svn.freebsd.org/changeset/base/194256 Log: Make tcsetsid(3) work on revoked TTYs. Right now the only way to make tcsetsid(3)/TIOCSCTTY work, is by ensuring the session leader is dead. This means that an application that catches SIGHUPs and performs a sleep prevents us from assigning a new session leader. Change the code to make it work on revoked TTYs as well. This allows us to change init(8) to make the shutdown script run in a more clean environment. Modified: head/sys/kern/kern_exit.c head/sys/kern/tty.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Jun 15 19:16:43 2009 (r194255) +++ head/sys/kern/kern_exit.c Mon Jun 15 19:17:52 2009 (r194256) @@ -309,7 +309,7 @@ exit1(struct thread *td, int rv) sp->s_ttyvp = NULL; SESS_UNLOCK(sp); - if (ttyvp != NULL) { + if (ttyvp != NULL && ttyvp->v_type != VBAD) { /* * Controlling process. * Signal foreground pgrp and revoke access to Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jun 15 19:16:43 2009 (r194255) +++ head/sys/kern/tty.c Mon Jun 15 19:17:52 2009 (r194256) @@ -1487,15 +1487,18 @@ tty_generic_ioctl(struct tty *tp, u_long } if (p->p_session->s_ttyvp != NULL || - (tp->t_session != NULL && tp->t_session->s_ttyvp != NULL)) { + (tp->t_session != NULL && tp->t_session->s_ttyvp != NULL && + tp->t_session->s_ttyvp->v_type != VBAD)) { /* * There is already a relation between a TTY and * a session, or the caller is not the session * leader. * * Allow the TTY to be stolen when the vnode is - * NULL, but the reference to the TTY is still - * active. + * invalid, but the reference to the TTY is + * still active. This allows immediate reuse of + * TTYs of which the session leader has been + * killed or the TTY revoked. */ sx_xunlock(&proctree_lock); return (EPERM); From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:21:04 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A31BC1065676; Mon, 15 Jun 2009 19:21:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 696208FC1D; Mon, 15 Jun 2009 19:21:04 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n5FJL2Iq043415; Mon, 15 Jun 2009 13:21:02 -0600 (MDT) Message-ID: <4A369F19.5090406@FreeBSD.org> Date: Mon, 15 Jun 2009 13:20:57 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Julian Elischer References: <200906151859.n5FIxUbl098279@svn.freebsd.org> <4A369E5C.3070807@elischer.org> In-Reply-To: <4A369E5C.3070807@elischer.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9467/Mon Jun 15 02:11:58 2009 on gritton.org X-Virus-Status: Clean Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194251 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:21:05 -0000 Julian Elischer wrote: > Jamie Gritton wrote: >> Author: jamie >> Date: Mon Jun 15 18:59:29 2009 >> New Revision: 194251 >> URL: http://svn.freebsd.org/changeset/base/194251 >> >> Log: >> Manage vnets via the jail system. If a jail is given the boolean >> parameter "vnet" when it is created, a new vnet instance will be >> created >> along with the jail. Networks interfaces can be moved between prisons >> with an ioctl similar to the one that moves them between vimages. >> For now vnets will co-exist under both jails and vimages, but soon >> struct vimage will be going away. >> Reviewed by: zec, julian >> Approved by: bz (mentor) >> >> Modified: >> head/sys/kern/kern_jail.c >> head/sys/kern/kern_vimage.c >> head/sys/net/if.c >> head/sys/net/if.h >> head/sys/sys/jail.h >> head/sys/sys/priv.h >> head/sys/sys/sockio.h >> head/sys/sys/vimage.h >> > > > the ioctl will be in ifcofig right? > > ifconfig em0 jail {Jail-ID} ?? Right. Perhaps "jail" and "unjail". Some pair to move an interface into a vnetted jail and to reclaim it from one. - Jamie From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:24:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74FA51065674; Mon, 15 Jun 2009 19:24:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62FA18FC20; Mon, 15 Jun 2009 19:24:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FJOllk099051; Mon, 15 Jun 2009 19:24:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FJOlP3099050; Mon, 15 Jun 2009 19:24:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906151924.n5FJOlP3099050@svn.freebsd.org> From: Ed Schouten Date: Mon, 15 Jun 2009 19:24: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: r194257 - head/sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:24:48 -0000 Author: ed Date: Mon Jun 15 19:24:47 2009 New Revision: 194257 URL: http://svn.freebsd.org/changeset/base/194257 Log: Remove redundant code from runshutdown() now tcsetsid(3) works reliably. We can now just call setctty() without any problems. This means the shell running the shutdown script is now the session leader, just like on startup. Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Mon Jun 15 19:17:52 2009 (r194256) +++ head/sbin/init/init.c Mon Jun 15 19:24:47 2009 (r194257) @@ -1563,30 +1563,13 @@ runshutdown(void) shell = get_shell(); if ((pid = fork()) == 0) { - int fd; - - /* Assume that init already grab console as ctty before */ - sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = SIG_IGN; sigaction(SIGTSTP, &sa, (struct sigaction *)0); sigaction(SIGHUP, &sa, (struct sigaction *)0); - revoke(_PATH_CONSOLE); - if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1) - warning("can't open %s: %m", _PATH_CONSOLE); - else { - dup2(fd, 0); - dup2(fd, 1); - dup2(fd, 2); - if (fd > 2) - close(fd); - } - - /* - * Run the shutdown script. - */ + setctty(_PATH_CONSOLE); char _sh[] = "sh"; char _reboot[] = "reboot"; From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:37:05 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC4C61065673 for ; Mon, 15 Jun 2009 19:37:05 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outJ.internet-mail-service.net (outj.internet-mail-service.net [216.240.47.233]) by mx1.freebsd.org (Postfix) with ESMTP id 91A238FC13 for ; Mon, 15 Jun 2009 19:37:05 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id D6A98322D9; Mon, 15 Jun 2009 12:37:19 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 18F3D2D601B; Mon, 15 Jun 2009 12:37:05 -0700 (PDT) Message-ID: <4A36A2E0.6040300@elischer.org> Date: Mon, 15 Jun 2009 12:37:04 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Jamie Gritton References: <200906151859.n5FIxUbl098279@svn.freebsd.org> <4A369E5C.3070807@elischer.org> <4A369F19.5090406@FreeBSD.org> In-Reply-To: <4A369F19.5090406@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; 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: r194251 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:37:06 -0000 Jamie Gritton wrote: > Julian Elischer wrote: >> >> >> the ioctl will be in ifconfig right? >> >> ifconfig em0 jail {Jail-ID} ?? > > Right. Perhaps "jail" and "unjail". Some pair to move an interface > into a vnetted jail and to reclaim it from one. > > - Jamie interesting.. I hadn't thought about unjail.... (just assumed it went back to parent when jail dies). From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:38:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB8441065676; Mon, 15 Jun 2009 19:38:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from gritton.org (gritton.org [161.58.222.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7106D8FC24; Mon, 15 Jun 2009 19:38:33 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from guppy.corp.verio.net (fw.oremut02.us.wh.verio.net [198.65.168.24]) (authenticated bits=0) by gritton.org (8.13.6.20060614/8.13.6) with ESMTP id n5FJcVpO045769; Mon, 15 Jun 2009 13:38:31 -0600 (MDT) Message-ID: <4A36A332.5060305@FreeBSD.org> Date: Mon, 15 Jun 2009 13:38:26 -0600 From: Jamie Gritton User-Agent: Thunderbird 2.0.0.19 (X11/20090109) MIME-Version: 1.0 To: Julian Elischer References: <200906151859.n5FIxUbl098279@svn.freebsd.org> <4A369E5C.3070807@elischer.org> <4A369F19.5090406@FreeBSD.org> <4A36A2E0.6040300@elischer.org> In-Reply-To: <4A36A2E0.6040300@elischer.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.94.2/9467/Mon Jun 15 02:11:58 2009 on gritton.org X-Virus-Status: Clean Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194251 - in head/sys: kern net sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:38:34 -0000 Julian Elischer wrote: > Jamie Gritton wrote: >> Julian Elischer wrote: >>> >>> >>> the ioctl will be in ifconfig right? >>> >>> ifconfig em0 jail {Jail-ID} ?? >> >> Right. Perhaps "jail" and "unjail". Some pair to move an interface >> into a vnetted jail and to reclaim it from one. >> >> - Jamie > > > interesting.. I hadn't thought about unjail.... (just assumed it went > back to parent when jail dies). It does. But there's also an allowance for it going back before then. Vimage has the ability to give the interface back to the parent, which is the same thing from a different direction. - Jamie From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 19:50:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00F831065672; Mon, 15 Jun 2009 19:50:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D844E8FC1A; Mon, 15 Jun 2009 19:50:03 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FJo3H3099672; Mon, 15 Jun 2009 19:50:03 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FJo3XY099669; Mon, 15 Jun 2009 19:50:03 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906151950.n5FJo3XY099669@svn.freebsd.org> From: Sam Leffler Date: Mon, 15 Jun 2009 19:50: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: r194259 - in head/sys: dev/cxgb net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 19:50:04 -0000 Author: sam Date: Mon Jun 15 19:50:03 2009 New Revision: 194259 URL: http://svn.freebsd.org/changeset/base/194259 Log: r193336 moved ifq_detach to if_free which broke if_alloc followed by if_free (w/o doing if_attach); move ifq_attach to if_alloc and rename ifq_attach/detach to ifq_init/ifq_delete to better identify their purpose Reviewed by: jhb, kmacy Modified: head/sys/dev/cxgb/cxgb_sge.c head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Mon Jun 15 19:26:34 2009 (r194258) +++ head/sys/dev/cxgb/cxgb_sge.c Mon Jun 15 19:50:03 2009 (r194259) @@ -1719,7 +1719,7 @@ t3_free_qset(adapter_t *sc, struct sge_q if (q->txq[i].txq_mr != NULL) buf_ring_free(q->txq[i].txq_mr, M_DEVBUF); if (q->txq[i].txq_ifq != NULL) { - ifq_detach(q->txq[i].txq_ifq); + ifq_delete(q->txq[i].txq_ifq); free(q->txq[i].txq_ifq, M_DEVBUF); } } @@ -2289,7 +2289,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i device_printf(sc->dev, "failed to allocate ifq\n"); goto err; } - ifq_attach(q->txq[i].txq_ifq, pi->ifp); + ifq_init(q->txq[i].txq_ifq, pi->ifp); } init_qset_cntxt(q, id); q->idx = id; Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jun 15 19:26:34 2009 (r194258) +++ head/sys/net/if.c Mon Jun 15 19:50:03 2009 (r194259) @@ -554,6 +554,7 @@ if_alloc(u_char type) #ifdef MAC mac_ifnet_init(ifp); #endif + ifq_init(&ifp->if_snd, ifp); refcount_init(&ifp->if_refcount, 1); /* Index reference. */ IFNET_WLOCK(); @@ -596,7 +597,7 @@ if_free_internal(struct ifnet *ifp) knlist_destroy(&ifp->if_klist); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); - ifq_detach(&ifp->if_snd); + ifq_delete(&ifp->if_snd); free(ifp, M_IFNET); } @@ -655,7 +656,7 @@ if_rele(struct ifnet *ifp) } void -ifq_attach(struct ifaltq *ifq, struct ifnet *ifp) +ifq_init(struct ifaltq *ifq, struct ifnet *ifp) { mtx_init(&ifq->ifq_mtx, ifp->if_xname, "if send queue", MTX_DEF); @@ -671,7 +672,7 @@ ifq_attach(struct ifaltq *ifq, struct if } void -ifq_detach(struct ifaltq *ifq) +ifq_delete(struct ifaltq *ifq) { mtx_destroy(&ifq->ifq_mtx); } @@ -742,8 +743,6 @@ if_attach_internal(struct ifnet *ifp, in net_cdevsw.d_name, ifp->if_index); } - ifq_attach(&ifp->if_snd, ifp); - /* * Create a Link Level name for this device. */ Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Jun 15 19:26:34 2009 (r194258) +++ head/sys/net/if_var.h Mon Jun 15 19:50:03 2009 (r194259) @@ -817,8 +817,8 @@ int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); struct ifnet *ifunit_ref(const char *); -void ifq_attach(struct ifaltq *, struct ifnet *ifp); -void ifq_detach(struct ifaltq *); +void ifq_init(struct ifaltq *, struct ifnet *ifp); +void ifq_delete(struct ifaltq *); struct ifaddr *ifa_ifwithaddr(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 20:38:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511DD106564A; Mon, 15 Jun 2009 20:38:56 +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 3C7428FC17; Mon, 15 Jun 2009 20:38:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FKcuoM001037; Mon, 15 Jun 2009 20:38:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FKctaR001026; Mon, 15 Jun 2009 20:38:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906152038.n5FKctaR001026@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Jun 2009 20: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: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 20:38:56 -0000 Author: jhb Date: Mon Jun 15 20:38:55 2009 New Revision: 194262 URL: http://svn.freebsd.org/changeset/base/194262 Log: Add a new 'void closefrom(int lowfd)' system call. When called, it closes any open file descriptors >= 'lowfd'. It is largely identical to the same function on other operating systems such as Solaris, DFly, NetBSD, and OpenBSD. One difference from other *BSD is that this closefrom() does not fail with any errors. In practice, while the manpages for NetBSD and OpenBSD claim that they return EINTR, they ignore internal errors from close() and never return EINTR. DFly does return EINTR, but for the common use case (closing fd's prior to execve()), the caller really wants all fd's closed and returning EINTR just forces callers to call closefrom() in a loop until it stops failing. Note that this implementation of closefrom(2) does not make any effort to resolve userland races with open(2) in other threads. As such, it is not multithread safe. Submitted by: rwatson (initial version) Reviewed by: rwatson MFC after: 2 weeks Added: head/lib/libc/sys/closefrom.2 (contents, props changed) head/tools/regression/file/closefrom/ head/tools/regression/file/closefrom/Makefile (contents, props changed) head/tools/regression/file/closefrom/closefrom.c (contents, props changed) head/tools/regression/file/closefrom/closefrom.t (contents, props changed) Modified: head/include/unistd.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/close.2 head/sys/compat/freebsd32/syscalls.master head/sys/kern/kern_descrip.c head/sys/kern/syscalls.master Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Jun 15 20:12:27 2009 (r194261) +++ head/include/unistd.h Mon Jun 15 20:38:55 2009 (r194262) @@ -326,6 +326,7 @@ unsigned int alarm(unsigned int); int chdir(const char *); int chown(const char *, uid_t, gid_t); int close(int); +void closefrom(int); int dup(int); int dup2(int, int); int execl(const char *, const char *, ...); Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Mon Jun 15 20:12:27 2009 (r194261) +++ head/lib/libc/sys/Makefile.inc Mon Jun 15 20:38:55 2009 (r194262) @@ -63,7 +63,7 @@ MAN+= abort2.2 accept.2 access.2 acct.2 aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ aio_suspend.2 aio_waitcomplete.2 aio_write.2 \ bind.2 brk.2 chdir.2 chflags.2 \ - chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ + chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \ connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 _exit.2 \ extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ getdirentries.2 getdtablesize.2 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Jun 15 20:12:27 2009 (r194261) +++ head/lib/libc/sys/Symbol.map Mon Jun 15 20:38:55 2009 (r194262) @@ -333,6 +333,7 @@ FBSD_1.0 { }; FBSD_1.1 { + closefrom; cpuset; cpuset_getid; cpuset_setid; @@ -472,6 +473,8 @@ FBSDprivate_1.0 { __sys_clock_settime; _close; __sys_close; + _closefrom; + __sys_closefrom; _connect; __sys_connect; _cpuset; Modified: head/lib/libc/sys/close.2 ============================================================================== --- head/lib/libc/sys/close.2 Mon Jun 15 20:12:27 2009 (r194261) +++ head/lib/libc/sys/close.2 Mon Jun 15 20:38:55 2009 (r194262) @@ -120,6 +120,7 @@ before all pending data was delivered. .El .Sh SEE ALSO .Xr accept 2 , +.Xr closefrom 2 , .Xr execve 2 , .Xr fcntl 2 , .Xr flock 2 , Added: head/lib/libc/sys/closefrom.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/closefrom.2 Mon Jun 15 20:38:55 2009 (r194262) @@ -0,0 +1,53 @@ +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 12, 2009 +.Dt CLOSEFROM 2 +.Os +.Sh NAME +.Nm closefrom +.Nd delete open file descriptors +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft void +.Fn closefrom "int lowfd" +.Sh DESCRIPTION +The +.Fn closefrom +system call deletes all open file descriptors greater than or equal to +.Fa lowfd +from the per-process object reference table. +Any errors encountered while closing file descriptors are ignored. +.Sh SEE ALSO +.Xr close 2 +.Sh HISTORY +The +.Fn closefrom +function first appeared in +.Fx 8.0 . Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Jun 15 20:12:27 2009 (r194261) +++ head/sys/compat/freebsd32/syscalls.master Mon Jun 15 20:38:55 2009 (r194262) @@ -889,3 +889,4 @@ 507 AUE_NULL STD { int freebsd32_jail_set(struct iovec32 *iovp, \ unsigned int iovcnt, int flags); } 508 AUE_NULL NOPROTO { int jail_remove(int jid); } +509 AUE_CLOSEFROM NOPROTO { int closefrom(int lowfd); } Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Jun 15 20:12:27 2009 (r194261) +++ head/sys/kern/kern_descrip.c Mon Jun 15 20:38:55 2009 (r194262) @@ -1128,6 +1128,42 @@ kern_close(td, fd) return (error); } +/* + * Close open file descriptors. + */ +#ifndef _SYS_SYSPROTO_H_ +struct closefrom_args { + int lowfd; +}; +#endif +/* ARGSUSED */ +int +closefrom(struct thread *td, struct closefrom_args *uap) +{ + struct filedesc *fdp; + int fd; + + fdp = td->td_proc->p_fd; + AUDIT_ARG(fd, uap->lowfd); + + /* + * Treat negative starting file descriptor values identical to + * closefrom(0) which closes all files. + */ + if (uap->lowfd < 0) + uap->lowfd = 0; + FILEDESC_SLOCK(fdp); + for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { + if (fdp->fd_ofiles[fd] != NULL) { + FILEDESC_SUNLOCK(fdp); + (void)kern_close(td, fd); + FILEDESC_SLOCK(fdp); + } + } + FILEDESC_SUNLOCK(fdp); + return (0); +} + #if defined(COMPAT_43) /* * Return status information about a file descriptor. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Jun 15 20:12:27 2009 (r194261) +++ head/sys/kern/syscalls.master Mon Jun 15 20:38:55 2009 (r194262) @@ -902,5 +902,6 @@ 507 AUE_NULL STD { int jail_set(struct iovec *iovp, \ unsigned int iovcnt, int flags); } 508 AUE_NULL STD { int jail_remove(int jid); } +509 AUE_CLOSEFROM STD { int closefrom(int lowfd); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Added: head/tools/regression/file/closefrom/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/file/closefrom/Makefile Mon Jun 15 20:38:55 2009 (r194262) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= closefrom +MAN= +WARNS?= 6 + +LDADD= -lutil + +.include Added: head/tools/regression/file/closefrom/closefrom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/file/closefrom/closefrom.c Mon Jun 15 20:38:55 2009 (r194262) @@ -0,0 +1,274 @@ +/*- + * Copyright (c) 2009 Advanced Computing Technologies LLC + * Written by: John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Regression tests for the closefrom(2) system call. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct shared_info { + int failed; + char tag[64]; + char message[0]; +}; + +static int test = 1; + +static void +ok(const char *descr) +{ + + printf("ok %d - %s\n", test, descr); + test++; +} + +static void +fail(const char *descr, const char *fmt, ...) +{ + va_list ap; + + printf("not ok %d - %s", test, descr); + test++; + if (fmt) { + va_start(ap, fmt); + printf(" # "); + vprintf(fmt, ap); + va_end(ap); + } + printf("\n"); + exit(1); +} + +#define fail_err(descr) fail((descr), "%s", strerror(errno)) + +static void +cok(struct shared_info *info, const char *descr) +{ + + info->failed = 0; + strlcpy(info->tag, descr, sizeof(info->tag)); + exit(0); +} + +static void +cfail(struct shared_info *info, const char *descr, const char *fmt, ...) +{ + va_list ap; + + info->failed = 1; + strlcpy(info->tag, descr, sizeof(info->tag)); + if (fmt) { + va_start(ap, fmt); + vsprintf(info->message, fmt, ap); + va_end(ap); + } + exit(0); +} + +#define cfail_err(info, descr) cfail((info), (descr), "%s", strerror(errno)) + +/* + * Use kinfo_getfile() to fetch the list of file descriptors and figure out + * the highest open file descriptor. + */ +static int +highest_fd(void) +{ + struct kinfo_file *kif; + int cnt, i, highest; + + kif = kinfo_getfile(getpid(), &cnt); + if (kif == NULL) + fail_err("kinfo_getfile"); + highest = INT_MIN; + for (i = 0; i < cnt; i++) + if (kif[i].kf_fd > highest) + highest = kif[i].kf_fd; + free(kif); + return (highest); +} + +static int +devnull(void) +{ + int fd; + + fd = open("/dev/null", O_RDONLY); + if (fd < 0) + fail_err("open(\"/dev/null\")"); + return (fd); +} + +int +main(int __unused argc, char __unused *argv[]) +{ + struct shared_info *info; + pid_t pid; + int fd, i; + + printf("1..15\n"); + + /* We better start up with fd's 0, 1, and 2 open. */ + fd = devnull(); + if (fd != 3) + fail("open", "bad descriptor %d", fd); + ok("open"); + + /* Make sure highest_fd() works. */ + fd = highest_fd(); + if (fd != 3) + fail("highest_fd", "bad descriptor %d", fd); + ok("highest_fd"); + + /* Try to use closefrom() for just closing fd 3. */ + closefrom(3); + fd = highest_fd(); + if (fd != 2) + fail("closefrom", "highest fd %d", fd); + ok("closefrom"); + + /* Eat up 16 descriptors. */ + for (i = 0; i < 16; i++) + (void)devnull(); + fd = highest_fd(); + if (fd != 18) + fail("open 16", "highest fd %d", fd); + ok("open 16"); + + /* Close half of them. */ + closefrom(11); + fd = highest_fd(); + if (fd != 10) + fail("closefrom", "highest fd %d", fd); + ok("closefrom"); + + /* Explicitly close descriptors 6 and 8 to create holes. */ + if (close(6) < 0 || close(8) < 0) + fail_err("close2 "); + ok("close 2"); + + /* Verify that close on 6 and 8 fails with EBADF. */ + if (close(6) == 0) + fail("close(6)", "did not fail"); + if (errno != EBADF) + fail_err("close(6)"); + ok("close(6)"); + if (close(8) == 0) + fail("close(8)", "did not fail"); + if (errno != EBADF) + fail_err("close(8)"); + ok("close(8)"); + + /* Close from 4 on. */ + closefrom(4); + fd = highest_fd(); + if (fd != 3) + fail("closefrom", "highest fd %d", fd); + ok("closefrom"); + + /* Allocate a small SHM region for IPC with our child. */ + info = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANON | + MAP_SHARED, -1, 0); + if (info == MAP_FAILED) + fail_err("mmap"); + ok("mmap"); + + /* Fork a child process to test closefrom(0). */ + pid = fork(); + if (pid < 0) + fail_err("fork"); + if (pid == 0) { + /* Child. */ + closefrom(0); + fd = highest_fd(); + if (fd >= 0) + cfail(info, "closefrom(0)", "highest fd %d", fd); + cok(info, "closefrom(0)"); + } + if (wait(NULL) < 0) + fail_err("wait"); + if (info->failed) + fail(info->tag, "%s", info->message); + ok(info->tag); + + /* Fork a child process to test closefrom(-1). */ + pid = fork(); + if (pid < 0) + fail_err("fork"); + if (pid == 0) { + /* Child. */ + closefrom(-1); + fd = highest_fd(); + if (fd >= 0) + cfail(info, "closefrom(-1)", "highest fd %d", fd); + cok(info, "closefrom(-1)"); + } + if (wait(NULL) < 0) + fail_err("wait"); + if (info->failed) + fail(info->tag, "%s", info->message); + ok(info->tag); + + /* Dup stdout to 6. */ + if (dup2(1, 6) < 0) + fail_err("dup2"); + fd = highest_fd(); + if (fd != 6) + fail("dup2", "highest fd %d", fd); + ok("dup2"); + + /* Do a closefrom() starting in a hole. */ + closefrom(4); + fd = highest_fd(); + if (fd != 3) + fail("closefrom", "highest fd %d", fd); + ok("closefrom"); + + /* Do a closefrom() beyond our highest open fd. */ + closefrom(32); + fd = highest_fd(); + if (fd != 3) + fail("closefrom", "highest fd %d", fd); + ok("closefrom"); + + return (0); +} Added: head/tools/regression/file/closefrom/closefrom.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/file/closefrom/closefrom.t Mon Jun 15 20:38:55 2009 (r194262) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 20:40:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E8BD1065672; Mon, 15 Jun 2009 20:40:24 +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 8B51E8FC08; Mon, 15 Jun 2009 20:40:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FKeOhn001123; Mon, 15 Jun 2009 20:40:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FKeOEC001113; Mon, 15 Jun 2009 20:40:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906152040.n5FKeOEC001113@svn.freebsd.org> From: John Baldwin Date: Mon, 15 Jun 2009 20:40: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: r194263 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 20:40:25 -0000 Author: jhb Date: Mon Jun 15 20:40:23 2009 New Revision: 194263 URL: http://svn.freebsd.org/changeset/base/194263 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -377,4 +377,5 @@ #define FREEBSD32_SYS_freebsd32_jail_get 506 #define FREEBSD32_SYS_freebsd32_jail_set 507 #define FREEBSD32_SYS_jail_remove 508 -#define FREEBSD32_SYS_MAXSYSCALL 509 +#define FREEBSD32_SYS_closefrom 509 +#define FREEBSD32_SYS_MAXSYSCALL 510 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ const char *freebsd32_syscallnames[] = { @@ -516,4 +516,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_jail_get", /* 506 = freebsd32_jail_get */ "freebsd32_jail_set", /* 507 = freebsd32_jail_set */ "jail_remove", /* 508 = jail_remove */ + "closefrom", /* 509 = closefrom */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 193916 2009-06-10 13:48:13Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #include "opt_compat.h" @@ -547,4 +547,5 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_jail_get_args), (sy_call_t *)freebsd32_jail_get, AUE_NULL, NULL, 0, 0, 0 }, /* 506 = freebsd32_jail_get */ { AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, AUE_NULL, NULL, 0, 0, 0 }, /* 507 = freebsd32_jail_set */ { AS(jail_remove_args), (sy_call_t *)jail_remove, AUE_NULL, NULL, 0, 0, 0 }, /* 508 = jail_remove */ + { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0, 0 }, /* 509 = closefrom */ }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/kern/init_sysent.c Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 191673 2009-04-29 21:14:15Z jamie + * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #include "opt_compat.h" @@ -537,4 +537,5 @@ struct sysent sysent[] = { { AS(jail_get_args), (sy_call_t *)jail_get, AUE_NULL, NULL, 0, 0, 0 }, /* 506 = jail_get */ { AS(jail_set_args), (sy_call_t *)jail_set, AUE_NULL, NULL, 0, 0, 0 }, /* 507 = jail_set */ { AS(jail_remove_args), (sy_call_t *)jail_remove, AUE_NULL, NULL, 0, 0, 0 }, /* 508 = jail_remove */ + { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0, 0 }, /* 509 = closefrom */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/kern/syscalls.c Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 191673 2009-04-29 21:14:15Z jamie + * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ const char *syscallnames[] = { @@ -516,4 +516,5 @@ const char *syscallnames[] = { "jail_get", /* 506 = jail_get */ "jail_set", /* 507 = jail_set */ "jail_remove", /* 508 = jail_remove */ + "closefrom", /* 509 = closefrom */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/kern/systrace_args.c Mon Jun 15 20:40:23 2009 (r194263) @@ -3065,6 +3065,13 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } + /* closefrom */ + case 509: { + struct closefrom_args *p = params; + iarg[0] = p->lowfd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8137,6 +8144,16 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* closefrom */ + case 509: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/sys/syscall.h Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 191673 2009-04-29 21:14:15Z jamie + * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #define SYS_syscall 0 @@ -424,4 +424,5 @@ #define SYS_jail_get 506 #define SYS_jail_set 507 #define SYS_jail_remove 508 -#define SYS_MAXSYSCALL 509 +#define SYS_closefrom 509 +#define SYS_MAXSYSCALL 510 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/sys/syscall.mk Mon Jun 15 20:40:23 2009 (r194263) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 191673 2009-04-29 21:14:15Z jamie +# created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb MIASM = \ syscall.o \ exit.o \ @@ -372,4 +372,5 @@ MIASM = \ gssd_syscall.o \ jail_get.o \ jail_set.o \ - jail_remove.o + jail_remove.o \ + closefrom.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Jun 15 20:38:55 2009 (r194262) +++ head/sys/sys/sysproto.h Mon Jun 15 20:40:23 2009 (r194263) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 191673 2009-04-29 21:14:15Z jamie + * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1638,6 +1638,9 @@ struct jail_set_args { struct jail_remove_args { char jid_l_[PADL_(int)]; int jid; char jid_r_[PADR_(int)]; }; +struct closefrom_args { + char lowfd_l_[PADL_(int)]; int lowfd; char lowfd_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1995,6 +1998,7 @@ int gssd_syscall(struct thread *, struct int jail_get(struct thread *, struct jail_get_args *); int jail_set(struct thread *, struct jail_set_args *); int jail_remove(struct thread *, struct jail_remove_args *); +int closefrom(struct thread *, struct closefrom_args *); #ifdef COMPAT_43 @@ -2591,6 +2595,7 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_jail_get AUE_NULL #define SYS_AUE_jail_set AUE_NULL #define SYS_AUE_jail_remove AUE_NULL +#define SYS_AUE_closefrom AUE_CLOSEFROM #undef PAD_ #undef PADL_ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 20:45:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5366E106566C; Mon, 15 Jun 2009 20:45:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 419B88FC15; Mon, 15 Jun 2009 20:45:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FKjq6F001261; Mon, 15 Jun 2009 20:45:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FKjqRa001259; Mon, 15 Jun 2009 20:45:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906152045.n5FKjqRa001259@svn.freebsd.org> From: Ed Schouten Date: Mon, 15 Jun 2009 20:45: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: r194264 - 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, 15 Jun 2009 20:45:52 -0000 Author: ed Date: Mon Jun 15 20:45:51 2009 New Revision: 194264 URL: http://svn.freebsd.org/changeset/base/194264 Log: Perform some more cleanups to in-kernel session handling. The code that was in place in exit1() was mainly based on code from the old TTY layer. The main reason behind this, was because at one moment I ran a system that had two TTY layers in place at the same time. It is now sufficient to do the following: - Remove references from the session structure to the TTY vnode and the session leader. - If we have a controlling TTY and the session used by the TTY is equal to our session, send the SIGHUP. - If we have a vnode to the controlling TTY which has not been revoked, revoke it. While there, change sys/kern/tty.c to use s_ttyp in the comparison instead of s_ttyvp. It should not make any difference, because s_ttyvp can only become null when the session leader already left, but it's nicer to compare against the proper value. Modified: head/sys/kern/kern_exit.c head/sys/kern/tty.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Jun 15 20:40:23 2009 (r194263) +++ head/sys/kern/kern_exit.c Mon Jun 15 20:45:51 2009 (r194264) @@ -300,52 +300,47 @@ exit1(struct thread *td, int rv) sx_xlock(&proctree_lock); if (SESS_LEADER(p)) { - struct session *sp; - - sp = p->p_session; + struct session *sp = p->p_session; + struct tty *tp; + /* + * s_ttyp is not zero'd; we use this to indicate that + * the session once had a controlling terminal. (for + * logging and informational purposes) + */ SESS_LOCK(sp); ttyvp = sp->s_ttyvp; + tp = sp->s_ttyp; sp->s_ttyvp = NULL; + sp->s_leader = NULL; SESS_UNLOCK(sp); - if (ttyvp != NULL && ttyvp->v_type != VBAD) { - /* - * Controlling process. - * Signal foreground pgrp and revoke access to - * controlling terminal. - * - * There is no need to drain the terminal here, - * because this will be done on revocation. - */ - if (sp->s_ttyp != NULL) { - struct tty *tp = sp->s_ttyp; + /* + * Signal foreground pgrp and revoke access to + * controlling terminal if it has not been revoked + * already. + * + * Because the TTY may have been revoked in the mean + * time and could already have a new session associated + * with it, make sure we don't send a SIGHUP to a + * foreground process group that does not belong to this + * session. + */ - tty_lock(tp); + if (tp != NULL) { + tty_lock(tp); + if (tp->t_session == sp) tty_signal_pgrp(tp, SIGHUP); - tty_unlock(tp); + tty_unlock(tp); + } - /* - * The tty could have been revoked - * if we blocked. - */ - if (ttyvp->v_type != VBAD) { - sx_xunlock(&proctree_lock); - VOP_LOCK(ttyvp, LK_EXCLUSIVE); - VOP_REVOKE(ttyvp, REVOKEALL); - VOP_UNLOCK(ttyvp, 0); - sx_xlock(&proctree_lock); - } - } - /* - * s_ttyp is not zero'd; we use this to indicate that - * the session once had a controlling terminal. - * (for logging and informational purposes) - */ + if (ttyvp != NULL && ttyvp->v_type != VBAD) { + sx_xunlock(&proctree_lock); + VOP_LOCK(ttyvp, LK_EXCLUSIVE); + VOP_REVOKE(ttyvp, REVOKEALL); + VOP_UNLOCK(ttyvp, 0); + sx_xlock(&proctree_lock); } - SESS_LOCK(p->p_session); - sp->s_leader = NULL; - SESS_UNLOCK(p->p_session); } fixjobc(p, p->p_pgrp, 0); sx_xunlock(&proctree_lock); Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jun 15 20:40:23 2009 (r194263) +++ head/sys/kern/tty.c Mon Jun 15 20:45:51 2009 (r194264) @@ -1486,7 +1486,7 @@ tty_generic_ioctl(struct tty *tp, u_long return (0); } - if (p->p_session->s_ttyvp != NULL || + if (p->p_session->s_ttyp != NULL || (tp->t_session != NULL && tp->t_session->s_ttyvp != NULL && tp->t_session->s_ttyvp->v_type != VBAD)) { /* From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 20:49:35 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 09C9D1065676 for ; Mon, 15 Jun 2009 20:49:35 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 5D7CA1560BB for ; Mon, 15 Jun 2009 20:49:34 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 18272 invoked from network); 15 Jun 2009 20:49:38 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2009 20:49:38 -0000 Message-ID: <4A36B3E2.7060309@freebsd.org> Date: Mon, 15 Jun 2009 14:49:38 -0600 From: Colin Percival User-Agent: Thunderbird 2.0.0.21 (X11/20090405) MIME-Version: 1.0 To: John Baldwin References: <200906152038.n5FKctaR001026@svn.freebsd.org> In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; 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: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 20:49:35 -0000 John Baldwin wrote: > One difference from other *BSD is that this closefrom() does not > fail with any errors. In practice, while the manpages for NetBSD and > OpenBSD claim that they return EINTR, they ignore internal errors from > close() and never return EINTR. DFly does return EINTR, but for the common > use case (closing fd's prior to execve()), the caller really wants all > fd's closed and returning EINTR just forces callers to call closefrom() in > a loop until it stops failing. Wouldn't it be better for portability if closefrom(2) is defined to return an int, even if the value returned is always zero? Otherwise people who want to write code which works on all BSDs end up having to do something like #ifdef __FreeBSD__ closefrom(x); #else while (closefrom(x)) continue; #endif -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:02:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A8D1065679; Mon, 15 Jun 2009 21:02:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id BB7958FC31; Mon, 15 Jun 2009 21:02:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1MGJJu-0008DD-E3; Tue, 16 Jun 2009 00:02:22 +0300 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 n5FL2JJB098025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 00:02:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n5FL2JxD051524; Tue, 16 Jun 2009 00:02:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n5FL2ID7051523; Tue, 16 Jun 2009 00:02:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 16 Jun 2009 00:02:18 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> References: <200906152038.n5FKctaR001026@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8DtChEGCcMdSgkU2" Content-Disposition: inline In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1MGJJu-0008DD-E3 39838eac427f415681f76d38b2cdde6d X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:02:28 -0000 --8DtChEGCcMdSgkU2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 15, 2009 at 08:38:55PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 >=20 > Log: > Note that this implementation of closefrom(2) does not make any effort = to > resolve userland races with open(2) in other threads. As such, it is n= ot > multithread safe. =2E.. > + FILEDESC_SLOCK(fdp); > + for (fd =3D uap->lowfd; fd < fdp->fd_nfiles; fd++) { > + if (fdp->fd_ofiles[fd] !=3D NULL) { > + FILEDESC_SUNLOCK(fdp); > + (void)kern_close(td, fd); > + FILEDESC_SLOCK(fdp); > + } > + } > + FILEDESC_SUNLOCK(fdp); Just curious why this was not implemented in userspace ? Audit + fd_nfiles, perhaps ? I am sorry, but somebody would ask this question anyway, so why not me ? --8DtChEGCcMdSgkU2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAko2ttoACgkQC3+MBN1Mb4iPSACg1BIc0glya2bZEbey8ZPT24jr Q8oAoKoh7FSS1wqf4SL5e/Qofxnrv2tK =Q9Ng -----END PGP SIGNATURE----- --8DtChEGCcMdSgkU2-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:05:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C741065678; Mon, 15 Jun 2009 21:05:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95B2A8FC2A; Mon, 15 Jun 2009 21:05:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FL50iB001951; Mon, 15 Jun 2009 21:05:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FL50Ju001949; Mon, 15 Jun 2009 21:05:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906152105.n5FL50Ju001949@svn.freebsd.org> From: Ed Schouten Date: Mon, 15 Jun 2009 21:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194266 - head/usr.bin/chpass X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 21:05:02 -0000 Author: ed Date: Mon Jun 15 21:05:00 2009 New Revision: 194266 URL: http://svn.freebsd.org/changeset/base/194266 Log: Make the chpass Makefile honour NO_FSCHG. The chpass Makefile tried to set the fschg flag on the binaries, even if NO_FSCHG was passed to the installworld. This meant that if I installed FreeBSD into a Jail, I couldn't installworld from within the Jail anymore. Now that it listens to NO_FSCHG, we can just make it bail out when it fails, just like PRECIOUSPROG does. Modified: head/usr.bin/chpass/Makefile Modified: head/usr.bin/chpass/Makefile ============================================================================== --- head/usr.bin/chpass/Makefile Mon Jun 15 21:03:25 2009 (r194265) +++ head/usr.bin/chpass/Makefile Mon Jun 15 21:05:00 2009 (r194266) @@ -39,11 +39,12 @@ MLINKS+= chpass.1 ypchpass.1 chpass.1 yp beforeinstall: .for i in chpass chfn chsh ypchpass ypchfn ypchsh - [ ! -e ${DESTDIR}${BINDIR}/$i ] || \ - chflags noschg ${DESTDIR}${BINDIR}/$i || true + -chflags noschg ${DESTDIR}${BINDIR}/$i .endfor +.if !defined(NO_FSCHG) afterinstall: - -chflags schg ${DESTDIR}${BINDIR}/chpass + chflags schg ${DESTDIR}${BINDIR}/chpass +.endif .include From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:10:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618A01065874; Mon, 15 Jun 2009 21:10:14 +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 2D67F8FC29; Mon, 15 Jun 2009 21:10:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D7C9D46B51; Mon, 15 Jun 2009 17:10:13 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E154F8A070; Mon, 15 Jun 2009 17:10:12 -0400 (EDT) From: John Baldwin To: Kostik Belousov Date: Mon, 15 Jun 2009 17:08:11 -0400 User-Agent: KMail/1.9.7 References: <200906152038.n5FKctaR001026@svn.freebsd.org> <20090615210218.GS23592@deviant.kiev.zoral.com.ua> In-Reply-To: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906151708.11776.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 17:10:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:10:19 -0000 On Monday 15 June 2009 5:02:18 pm Kostik Belousov wrote: > On Mon, Jun 15, 2009 at 08:38:55PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Mon Jun 15 20:38:55 2009 > > New Revision: 194262 > > URL: http://svn.freebsd.org/changeset/base/194262 > > > > Log: > > Note that this implementation of closefrom(2) does not make any effort to > > resolve userland races with open(2) in other threads. As such, it is not > > multithread safe. > ... > > + FILEDESC_SLOCK(fdp); > > + for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { > > + if (fdp->fd_ofiles[fd] != NULL) { > > + FILEDESC_SUNLOCK(fdp); > > + (void)kern_close(td, fd); > > + FILEDESC_SLOCK(fdp); > > + } > > + } > > + FILEDESC_SUNLOCK(fdp); > > Just curious why this was not implemented in userspace ? Audit + fd_nfiles, > perhaps ? > > I am sorry, but somebody would ask this question anyway, so why not me ? I will defer to Robert so he can expound on this. :) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:10:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 613C81065843; Mon, 15 Jun 2009 21:10:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB238FC20; Mon, 15 Jun 2009 21:10:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D54A346B52; Mon, 15 Jun 2009 17:10:14 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BFD1B8A072; Mon, 15 Jun 2009 17:10:13 -0400 (EDT) From: John Baldwin To: Colin Percival Date: Mon, 15 Jun 2009 17:09:54 -0400 User-Agent: KMail/1.9.7 References: <200906152038.n5FKctaR001026@svn.freebsd.org> <4A36B3E2.7060309@freebsd.org> In-Reply-To: <4A36B3E2.7060309@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906151709.55435.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 17:10:13 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:10:24 -0000 On Monday 15 June 2009 4:49:38 pm Colin Percival wrote: > John Baldwin wrote: > > One difference from other *BSD is that this closefrom() does not > > fail with any errors. In practice, while the manpages for NetBSD and > > OpenBSD claim that they return EINTR, they ignore internal errors from > > close() and never return EINTR. DFly does return EINTR, but for the common > > use case (closing fd's prior to execve()), the caller really wants all > > fd's closed and returning EINTR just forces callers to call closefrom() in > > a loop until it stops failing. > > Wouldn't it be better for portability if closefrom(2) is defined to return an > int, even if the value returned is always zero? Otherwise people who want to > write code which works on all BSDs end up having to do something like > #ifdef __FreeBSD__ > closefrom(x); > #else > while (closefrom(x)) > continue; > #endif Solaris returns void, so we just end up in their #ifdef vs the other. Also, Robert's belief is that the vast majority of existing code doesn't do a loop correctly, but instead just does a single call to closefrom(x). In that case, ignoring errors gives the best chance of working correctly. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:23:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B0A1065A1E; Mon, 15 Jun 2009 21:23:21 +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 78B9E8FC1B; Mon, 15 Jun 2009 21:23:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1A50B46B29; Mon, 15 Jun 2009 17:23:21 -0400 (EDT) Date: Mon, 15 Jun 2009 22:23:20 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kostik Belousov In-Reply-To: <20090615210218.GS23592@deviant.kiev.zoral.com.ua> Message-ID: References: <200906152038.n5FKctaR001026@svn.freebsd.org> <20090615210218.GS23592@deviant.kiev.zoral.com.ua> 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: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:23:24 -0000 On Tue, 16 Jun 2009, Kostik Belousov wrote: >> Note that this implementation of closefrom(2) does not make any effort to >> resolve userland races with open(2) in other threads. As such, it is not >> multithread safe. > ... >> + FILEDESC_SLOCK(fdp); >> + for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { >> + if (fdp->fd_ofiles[fd] != NULL) { >> + FILEDESC_SUNLOCK(fdp); >> + (void)kern_close(td, fd); >> + FILEDESC_SLOCK(fdp); >> + } >> + } >> + FILEDESC_SUNLOCK(fdp); > > Just curious why this was not implemented in userspace ? Audit + fd_nfiles, > perhaps ? > > I am sorry, but somebody would ask this question anyway, so why not me ? Actually close(2) from userspace has better audit properties, since you get per-fd close information as part of the trail (at least, today). The Solaris closefrom(3) uses procfs to decide what file descriptors are open in order to avoid additional syscalls, as I recall, and we'd need some similar optimization to make closefrom(3) in userspace make any sense. Apart from the audit properties, the current approach seems fairly reasonable, though, and has the best performance properties (which is actually useful, since we currently do a lot of closing of unopened file descriptors on execve(2)). Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:25:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50FE71065B74; Mon, 15 Jun 2009 21:25:48 +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 23CE28FC29; Mon, 15 Jun 2009 21:25:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CA83D46B29; Mon, 15 Jun 2009 17:25:47 -0400 (EDT) Date: Mon, 15 Jun 2009 22:25:47 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <200906151709.55435.jhb@freebsd.org> Message-ID: References: <200906152038.n5FKctaR001026@svn.freebsd.org> <4A36B3E2.7060309@freebsd.org> <200906151709.55435.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:25:49 -0000 On Mon, 15 Jun 2009, John Baldwin wrote: > On Monday 15 June 2009 4:49:38 pm Colin Percival wrote: >> John Baldwin wrote: >>> One difference from other *BSD is that this closefrom() does not >>> fail with any errors. In practice, while the manpages for NetBSD and >>> OpenBSD claim that they return EINTR, they ignore internal errors from >>> close() and never return EINTR. DFly does return EINTR, but for the common >>> use case (closing fd's prior to execve()), the caller really wants all >>> fd's closed and returning EINTR just forces callers to call closefrom() in >>> a loop until it stops failing. >> >> Wouldn't it be better for portability if closefrom(2) is defined to return an >> int, even if the value returned is always zero? Otherwise people who want to >> write code which works on all BSDs end up having to do something like >> #ifdef __FreeBSD__ >> closefrom(x); >> #else >> while (closefrom(x)) >> continue; >> #endif > > Solaris returns void, so we just end up in their #ifdef vs the other. > Also, Robert's belief is that the vast majority of existing code doesn't do > a loop correctly, but instead just does a single call to closefrom(x). In > that case, ignoring errors gives the best chance of working correctly. To me, interrupting the loop on EINTR doesn't make much sense, as it means applications would always use: do { ret = closefrom(x); } while (ret < 0); Since the desirable idiom is rarely "close until you hit one that EINTRs, in which case abort but don't tell me which one it was". I find it equally likely for other errno values sometimes returned -- EIO, etc. If you want to close one file descriptor and reliably collect error-on-close, you must use close(2). Non-deterministic file descriptor closing seems... unuseful. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:52:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A6DC1065670; Mon, 15 Jun 2009 21:52:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577EA8FC0A; Mon, 15 Jun 2009 21:52:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FLqSxC002936; Mon, 15 Jun 2009 21:52:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FLqSms002931; Mon, 15 Jun 2009 21:52:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906152152.n5FLqSms002931@svn.freebsd.org> From: Ed Schouten Date: Mon, 15 Jun 2009 21:52: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: r194267 - in head: lib/libc/sys usr.bin usr.bin/revoke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 21:52:28 -0000 Author: ed Date: Mon Jun 15 21:52:27 2009 New Revision: 194267 URL: http://svn.freebsd.org/changeset/base/194267 Log: Add revoke(1). While hacking on TTY code, I often miss a small utility to revoke my own (pseudo-)terminals. This small utility is just a small wrapper around the revoke(2) call, so you can destroy your very own login sessions. Approved by: re Added: head/usr.bin/revoke/ head/usr.bin/revoke/Makefile (contents, props changed) head/usr.bin/revoke/revoke.1 (contents, props changed) head/usr.bin/revoke/revoke.c (contents, props changed) Modified: head/lib/libc/sys/revoke.2 head/usr.bin/Makefile Modified: head/lib/libc/sys/revoke.2 ============================================================================== --- head/lib/libc/sys/revoke.2 Mon Jun 15 21:05:00 2009 (r194266) +++ head/lib/libc/sys/revoke.2 Mon Jun 15 21:52:27 2009 (r194267) @@ -97,7 +97,8 @@ operation on the named file. The caller is neither the owner of the file nor the super user. .El .Sh SEE ALSO -.Xr close 2 +.Xr close 2 , +.Xr revoke 1 .Sh HISTORY The .Fn revoke Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Jun 15 21:05:00 2009 (r194266) +++ head/usr.bin/Makefile Mon Jun 15 21:52:27 2009 (r194267) @@ -157,6 +157,7 @@ SUBDIR= alias \ ${_quota} \ renice \ rev \ + revoke \ ${_rlogin} \ ${_rpcgen} \ rpcinfo \ Added: head/usr.bin/revoke/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/revoke/Makefile Mon Jun 15 21:52:27 2009 (r194267) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= revoke + +WARNS?= 6 + +.include Added: head/usr.bin/revoke/revoke.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/revoke/revoke.1 Mon Jun 15 21:52:27 2009 (r194267) @@ -0,0 +1,56 @@ +.\" Copyright (c) 2009 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 15, 2009 +.Dt REVOKE 1 +.Os +.Sh NAME +.Nm revoke +.Nd "revoke a character device" +.Sh SYNOPSIS +.Nm +.Ar +.Sh DESCRIPTION +The +.Nm +program revokes the character devices using +.Xr revoke 2 . +When used on a TTY, calls like +.Xr read 2 , +.Xr write 2 +and +.Xr ioctl 2 , +will be aborted immediately, effectively causing login sessions to be +terminated. +.Sh SEE ALSO +.Xr revoke 2 +.Sh HISTORY +The +.Nm +program first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/usr.bin/revoke/revoke.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/revoke/revoke.c Mon Jun 15 21:52:27 2009 (r194267) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +static void +usage(void) +{ + + fprintf(stderr, "usage: revoke file ...\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + char **d; + int error = 0; + + if (argc == 1) + usage(); + + for (d = &argv[1]; *d != NULL; d++) { + if (revoke(*d) != 0) { + perror(*d); + error = 1; + } + } + + return (error); +} From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 21:55:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F30B9106566B; Mon, 15 Jun 2009 21:55:29 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12488FC1C; Mon, 15 Jun 2009 21:55:29 +0000 (UTC) (envelope-from ps@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FLtTEN003082; Mon, 15 Jun 2009 21:55:29 GMT (envelope-from ps@svn.freebsd.org) Received: (from ps@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FLtTuQ003081; Mon, 15 Jun 2009 21:55:29 GMT (envelope-from ps@svn.freebsd.org) Message-Id: <200906152155.n5FLtTuQ003081@svn.freebsd.org> From: Paul Saab Date: Mon, 15 Jun 2009 21:55: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: r194269 - 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, 15 Jun 2009 21:55:31 -0000 Author: ps Date: Mon Jun 15 21:55:29 2009 New Revision: 194269 URL: http://svn.freebsd.org/changeset/base/194269 Log: I have several machines where the following warning is printed: warning: no time-of-day clock registered, system time will not be set accurately Provide hints to atrtc on amd64 since it's not being described in ACPI on some systems. Reviewed by: jhb Modified: head/sys/amd64/conf/GENERIC.hints Modified: head/sys/amd64/conf/GENERIC.hints ============================================================================== --- head/sys/amd64/conf/GENERIC.hints Mon Jun 15 21:54:26 2009 (r194268) +++ head/sys/amd64/conf/GENERIC.hints Mon Jun 15 21:55:29 2009 (r194269) @@ -24,3 +24,6 @@ hint.uart.1.port="0x2F8" hint.uart.1.irq="3" hint.ppc.0.at="isa" hint.ppc.0.irq="7" +hint.atrtc.0.at="isa" +hint.atrtc.0.port="0x70" +hint.atrtc.0.irq="8" From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 22:16:08 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4EC2106566B; Mon, 15 Jun 2009 22:16:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 598B98FC17; Mon, 15 Jun 2009 22:16:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5FMG3XV022515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 08:16:05 +1000 Date: Tue, 16 Jun 2009 08:16:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Bruce Evans In-Reply-To: <20090615153040.R1080@besplex.bde.org> Message-ID: <20090616070732.Q25544@delplex.bde.org> References: <200906141801.n5EI1Zti056239@svn.freebsd.org> <4A356A0F.3050800@freebsd.org> <20090615075134.K24645@delplex.bde.org> <4A359AA6.7010101@freebsd.org> <20090615114142.B775@besplex.bde.org> <20090615153040.R1080@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, jhb@FreeBSD.org, svn-src-all@FreeBSD.org, Ed Schouten , Sam Leffler , svn-src-head@FreeBSD.org Subject: Re: svn commit: r194204 - in head/sys: amd64/conf i386/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, 15 Jun 2009 22:16:09 -0000 On Mon, 15 Jun 2009, Bruce Evans wrote: > ... > This version for RELENG_7 seems to work as intended. jhb should look at > its atomic ops. No reply yet. I thought of some problems with this version. Mainly with the delaying code: - Some versions of DELAY() need to lock the hardware, so calling DELAY() can deadlock. E.g., on amd64 before the TSC is initialized, and on i386 with no TSC and/or before the TSC is initialized, and when kdb is not active on both, DELAY() calls getit(), and getit() locks the clock hardware unconditionally using a non-recursive spin mutex. Contrary to what I said in previous mail, detection of erroneous recursion isn't broken in the usual case. The usual case is probably INVARIANTS, and then recursion is detected. The handling of erroneous version then causes endless recursion on printf(): it is a failing KASSERT() which will call panic(), which will call printf(), which will reach the failing KASSERT() again. The non-recursive spinlock in cnputs() has the same bug (deadlock --> recursive deadlock). This problem in DELAY() is well known, so it is worked around when kdb is active by not calling getit() then. Nearby bugs in DELAY(): if DELAY() is first called after the TSC is initialized, then its debugging code is never reached. Its debugging code is a non-NOTEd non-option and could have been removed after the getit() version of DELAY() was verified to give reasonably accurate timing, but it is more useful for the TSC version since the TSC version has not been verified to give reasonably accurate timing. The TSC version must fail any reasonable verifiications except probably for P-state invariant TSCs since the TSC varies and DELAY() makes no attempt to compensate for its variance). If DELAY() is first called before the TSC is initialized, then the debugging code still works for the i8254 but its placement is confusing, and when the counter is changed to the TSC there is no code to debug the change. - timecounters are no better than DELAY() for implementing the delaying, since apart from them possibly not working on cold and/or deadlocked systems, although the upper-level timecounter code is lock-free, the timecounter hardware code might need to use a lock. Again, the i8254 timecounter hardware code uses the clock spinlock. - KTR uses plain printf(), and KTR can produce a lot of output, so the delay should be as short as possible, as for mcount_trylock(), and 1ms is too long. Recursion is a relatively unimportant part of the problem here. Too-long delays are possible in normal operation, when one CPU is in a normal printf() and other CPUs want to do KTR printfs. Serialization of the printf()s is especially important for voluminous concurrent KTR output, but so is printing such output fast. jhb should look at this too. I use KTR less than once a year. > % Index: subr_prf.c > % =================================================================== > % RCS file: /home/ncvs/src/sys/kern/subr_prf.c,v > % retrieving revision 1.130.2.1 > % diff -u -2 -r1.130.2.1 subr_prf.c > % --- subr_prf.c 21 Jan 2009 00:26:45 -0000 1.130.2.1 > % +++ subr_prf.c 15 Jun 2009 05:32:03 -0000 > % @@ -112,4 +112,27 @@ > % &always_console_output, 0, "Always output to console despite > TIOCCONS."); > % % +static int printf_lockcount; > % + > % +static void > % +printf_lock(void) > % +{ > % + int timeout; > % + > % + timeout = 1000; > % + do { > % + if (atomic_cmpset_acq_int(&printf_lockcount, 0, 1)) > % + return; > % + DELAY(1000); > % + } while (--timeout != 0); > % + atomic_add_acq_int(&printf_lockcount, 1); > % +} If the DELAY() is removed, the initial value of `timeout' would need to be (possibly dynamically) calibrated. The timeouts for the panics for spinlocks and threadlocks in kern_mutex.c have similar problems and could benefit from calibration. First they do up to 10 million cpu_spinwait()s. 10 million might be too small or too large. Then they do up to 60 million DELAY(1)s. DELAY() can deadlock as above. 60 million is supposed to give a delay of 60 seconds, but short delays can be very inaccurate (the minimum DELAY() is about 5 us with i8254 hardware on fast CPUs and about 30 us with i8254 hardware on 1990's CPUs), so the timeouts can be more like 5 minutes than 1 minute. A non-dynamically calibrated loop using uncached memory or device accesses has a better chance of working accurately than the non-dynamically calibrated TSC loop in the amd64 and i8254 DELAY()s, since throttling of the TSC is more common than throttling of memory systems. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 22:31:34 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 147E7106564A; Mon, 15 Jun 2009 22:31:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id 89B858FC1C; Mon, 15 Jun 2009 22:31:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5FMVTuZ009255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 08:31:31 +1000 Date: Tue, 16 Jun 2009 08:31:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906151543.n5FFh08t093646@svn.freebsd.org> Message-ID: <20090616081823.R25597@delplex.bde.org> References: <200906151543.n5FFh08t093646@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: r194240 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 22:31:34 -0000 On Mon, 15 Jun 2009, John Baldwin wrote: > Log: > Note that the structures are defined in in the text (using > language from stat(2)) rather than in the synopsis. > > Requested by: bde Thanks. Copying stat(2) is good. I also like having single context-sensitive references in the man page text and no duplication of these references in the SEE ALSO section. It is worse than useless to give a general reference to an enormous man page when you have already described (hopefully completely) the small part of the man page that applies in context. user.h and struct kinfo_file are too large to describe completely here, but there is no man page specifically for them anyway. I can't find even a non-specific man page for them (appropos says nothing). So I would just use the source for them. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 22:38:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A6FE106564A; Mon, 15 Jun 2009 22:38:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 686FF8FC08; Mon, 15 Jun 2009 22:38:06 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FMc6en004099; Mon, 15 Jun 2009 22:38:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FMc68i004094; Mon, 15 Jun 2009 22:38:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906152238.n5FMc68i004094@svn.freebsd.org> From: Andrew Thompson Date: Mon, 15 Jun 2009 22:38: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: r194271 - in head/sys/dev/usb: . net serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 22:38:07 -0000 Author: thompsa Date: Mon Jun 15 22:38:05 2009 New Revision: 194271 URL: http://svn.freebsd.org/changeset/base/194271 Log: Fix usb2_find_descriptor function name. Modified: head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Mon Jun 15 22:07:21 2009 (r194270) +++ head/sys/dev/usb/net/if_cdce.c Mon Jun 15 22:38:05 2009 (r194271) @@ -243,7 +243,7 @@ cdce_attach(device_t dev) sc->sc_data_iface_no = 0; /* not used */ goto alloc_transfers; } - ud = usb2_find_descriptor + ud = usbd_find_descriptor (uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); @@ -319,7 +319,7 @@ alloc_transfers: } } - ued = usb2_find_descriptor + ued = usbd_find_descriptor (uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_ENF, 0 - 1); Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Mon Jun 15 22:07:21 2009 (r194270) +++ head/sys/dev/usb/serial/umodem.c Mon Jun 15 22:38:05 2009 (r194271) @@ -289,7 +289,7 @@ umodem_attach(device_t dev) if ((cmd == NULL) || (cmd->bLength < sizeof(*cmd))) { - cud = usb2_find_descriptor(uaa->device, NULL, + cud = usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); @@ -746,7 +746,7 @@ tr_setup: static void * umodem_get_desc(struct usb_attach_arg *uaa, uint8_t type, uint8_t subtype) { - return (usb2_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, + return (usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, type, 0 - 1, subtype, 0 - 1)); } Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon Jun 15 22:07:21 2009 (r194270) +++ head/sys/dev/usb/usb_device.c Mon Jun 15 22:38:05 2009 (r194271) @@ -2017,7 +2017,7 @@ usbd_get_iface(struct usb_device *udev, } /*------------------------------------------------------------------------* - * usb2_find_descriptor + * usbd_find_descriptor * * This function will lookup the first descriptor that matches the * criteria given by the arguments "type" and "subtype". Descriptors @@ -2032,7 +2032,7 @@ usbd_get_iface(struct usb_device *udev, * Else: A descriptor matching the criteria *------------------------------------------------------------------------*/ void * -usb2_find_descriptor(struct usb_device *udev, void *id, uint8_t iface_index, +usbd_find_descriptor(struct usb_device *udev, void *id, uint8_t iface_index, uint8_t type, uint8_t type_mask, uint8_t subtype, uint8_t subtype_mask) { Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon Jun 15 22:07:21 2009 (r194270) +++ head/sys/dev/usb/usb_device.h Mon Jun 15 22:38:05 2009 (r194271) @@ -247,7 +247,7 @@ usb_error_t usb_suspend_resume(struct us uint8_t do_suspend); void usb_devinfo(struct usb_device *udev, char *dst_ptr, uint16_t dst_len); void usb_free_device(struct usb_device *, uint8_t); -void *usb2_find_descriptor(struct usb_device *udev, void *id, +void *usbd_find_descriptor(struct usb_device *udev, void *id, uint8_t iface_index, uint8_t type, uint8_t type_mask, uint8_t subtype, uint8_t subtype_mask); void usb_linux_free_device(struct usb_device *dev); From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 23:03:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3171106567F; Mon, 15 Jun 2009 23:03:38 +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 A18C88FC2D; Mon, 15 Jun 2009 23:03:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5FN3ctV004584; Mon, 15 Jun 2009 23:03:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5FN3cwP004583; Mon, 15 Jun 2009 23:03:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906152303.n5FN3cwP004583@svn.freebsd.org> From: Xin LI Date: Mon, 15 Jun 2009 23:03: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: r194272 - head/kerberos5/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2009 23:03:39 -0000 Author: delphij Date: Mon Jun 15 23:03:38 2009 New Revision: 194272 URL: http://svn.freebsd.org/changeset/base/194272 Log: Now we have closefrom(). Modified: head/kerberos5/include/config.h Modified: head/kerberos5/include/config.h ============================================================================== --- head/kerberos5/include/config.h Mon Jun 15 22:38:05 2009 (r194271) +++ head/kerberos5/include/config.h Mon Jun 15 23:03:38 2009 (r194272) @@ -139,7 +139,7 @@ static /**/const char *const rcsid[] = { #define HAVE_CHOWN 1 /* Define if you have the function `closefrom'. */ -/* #undef HAVE_CLOSEFROM */ +#define HAVE_CLOSEFROM /* Define to 1 if you have the header file. */ /* #undef HAVE_CONFIG_H */ From owner-svn-src-head@FreeBSD.ORG Mon Jun 15 23:23:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D5A41065674; Mon, 15 Jun 2009 23:23:07 +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 3F9188FC1F; Mon, 15 Jun 2009 23:23:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EA13D46B7F; Mon, 15 Jun 2009 19:23:06 -0400 (EDT) Received: from fiver.baldwin.cx (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C5E5A8A070; Mon, 15 Jun 2009 19:23:05 -0400 (EDT) Message-ID: <4A36D7D9.8050100@FreeBSD.org> Date: Mon, 15 Jun 2009 19:23:05 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200906152038.n5FKctaR001026@svn.freebsd.org> In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 15 Jun 2009 19:23:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 15 Jun 2009 23:23:07 -0000 John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 > > Log: > Add a new 'void closefrom(int lowfd)' system call. When called, it closes > any open file descriptors >= 'lowfd'. It is largely identical to the same > function on other operating systems such as Solaris, DFly, NetBSD, and > OpenBSD. One difference from other *BSD is that this closefrom() does not > fail with any errors. In practice, while the manpages for NetBSD and > OpenBSD claim that they return EINTR, they ignore internal errors from > close() and never return EINTR. DFly does return EINTR, but for the common > use case (closing fd's prior to execve()), the caller really wants all > fd's closed and returning EINTR just forces callers to call closefrom() in > a loop until it stops failing. > > Note that this implementation of closefrom(2) does not make any effort to > resolve userland races with open(2) in other threads. As such, it is not > multithread safe. > > Submitted by: rwatson (initial version) > Reviewed by: rwatson > MFC after: 2 weeks Sorry about the userland build breakage. It looks like Kerberos is fixed already. I expect OpenSSH to also be broken due to its local version of closefrom(). I am kicking off a full world build now to fix any remaining issues (unless someone else beats me to it first). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 00:04:47 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3628710656E2; Tue, 16 Jun 2009 00:04:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id AF4248FC24; Tue, 16 Jun 2009 00:04:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5G04gHi010662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 10:04:43 +1000 Date: Tue, 16 Jun 2009 10:04:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: John Baldwin In-Reply-To: <200906151328.32279.jhb@freebsd.org> Message-ID: <20090616091039.Q25629@delplex.bde.org> References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906120849.07127.jhb@freebsd.org> <20090613094302.I22933@delplex.bde.org> <200906151328.32279.jhb@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, Bruce Evans Subject: Re: svn commit: r193941 - 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: Tue, 16 Jun 2009 00:04:48 -0000 On Mon, 15 Jun 2009, John Baldwin wrote: > On Friday 12 June 2009 8:56:56 pm Bruce Evans wrote: >> On Fri, 12 Jun 2009, John Baldwin wrote: > ... >>> FWIW, the variables were signed before they were changed to unsigned and are now >>> back as signed again. It just seems really odd to have the types not match >>> 'ticks' especially since many of the values are just cached copies of 'ticks'. >> >> No, they were originally u_long and stayed that way until you changed them >> (except possibly for newer variables). The type of `ticks' is just wrong, >> and fixing that would take more work, but there is no reason to propagate >> this bug to new variables. The original version is: > > Gah, I had misremembered the diffs, they were indeed unsigned. Here is my > attempt at trying to fix things then based on my understanding so far: This is about what I want. > - It changes the variables back to unsigned (but u_int instead of unsigned > long). It also changes a few other members to be u_int instead of int such > as the two rtttime members. > - I changed t_starttime in the timewait structure to u_int. > - I changed t_recent in the timewait structure to u_int32_t as it is only > used in relation to other u_int32_t variables. > - I also attempted to fix overflow errors with t_badrxtwin by using > subtraction and casting the result to an int to compare with zero instead > of doing a direct comparison. > - I cast 'ticks' to u_int in the code to compute a new isn. I'm not sure if > this is needed. This shouldn't be needed. The operands of any binary operation are promoted to a common type, and that type should be u_int since one of the operands should have type u_int even if `ticks' doesn't. It only makes sense to cast things both operands are cast in all binary operations where there _might_ , but that would be ugly and too careful. The types should be required to be not _too_ dissimilar (no mixing of ints with u_longs, and no opaque types so that we cannot tell if the types are dissimilar) so that the default promotions work right. > - Some style fixes to remove extra ()'s from 'ticks - t_rcvtime'. > > --- //depot/projects/smpng/sys/netinet/tcp_input.c 2009/06/12 13:45:50 > +++ //depot/user/jhb/socket/netinet/tcp_input.c 2009/06/15 17:22:13 > @@ -1296,7 +1296,7 @@ > * "bad retransmit" recovery. > */ > if (tp->t_rxtshift == 1 && > - ticks < tp->t_badrxtwin) { > + (int)(ticks - tp->t_badrxtwin) < 0) { > TCPSTAT_INC(tcps_sndrexmitbad); > tp->snd_cwnd = tp->snd_cwnd_prev; > tp->snd_ssthresh = This seems to be best for handling t_badrxtwin. I note that you don't cast `ticks' here or in most places. > --- //depot/projects/smpng/sys/netinet/tcp_timer.c 2009/04/14 19:06:19 > +++ //depot/user/jhb/socket/netinet/tcp_timer.c 2009/06/15 17:22:13 > @@ -418,8 +418,8 @@ > * backoff that we would use if retransmitting. > */ > if (tp->t_rxtshift == TCP_MAXRXTSHIFT && > - ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || > - (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { > + (ticks - tp->t_rcvtime >= tcp_maxpersistidle || > + ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { > TCPSTAT_INC(tcps_persistdrop); > tp = tcp_drop(tp, ETIMEDOUT); > goto out; Do we want to keep the non-KNF indentation (1 char extra to line things up)? > --- //depot/projects/smpng/sys/netinet/tcp_timewait.c 2009/06/09 15:15:22 > +++ //depot/user/jhb/socket/netinet/tcp_timewait.c 2009/06/15 17:22:13 > @@ -322,8 +322,10 @@ > tcp_seq new_irs = tw->irs; > > INP_INFO_WLOCK_ASSERT(&V_tcbinfo); > - new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz); > - new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz); > + new_iss += ((u_int)ticks - tw->t_starttime) * > + (ISN_BYTES_PER_SECOND / hz); > + new_irs += ((u_int)ticks - tw->t_starttime) * > + (MS_ISN_BYTES_PER_SECOND / hz); This t_starttime (should be tw_starttime) is now u_int (was u_long), so you don't need the cast here -- the cast has no effect. When t_starttime was u_long, the safest cast would have been of t_starttime down to u_int. > --- //depot/projects/smpng/sys/netinet/tcp_var.h 2009/06/12 13:45:50 > +++ //depot/user/jhb/socket/netinet/tcp_var.h 2009/06/15 17:22:13 > @@ -139,12 +139,12 @@ > > u_int t_maxopd; /* mss plus options */ > > - int t_rcvtime; /* inactivity time */ > - int t_starttime; /* time connection was established */ > - int t_rtttime; /* round trip time */ > + u_int t_rcvtime; /* inactivity time */ > + u_int t_starttime; /* time connection was established */ > + u_int t_rtttime; /* round trip time */ I would prefer the delta-times (like t_rtttime) to remain as ints. Having everything of the same type is safer, and having everything of signed type allows better overflow checking (gcc -ftrapv (*)). Whether ints are actually safer for r_tttime depend on how it is used. Oops, I misread t_rtttime as being the rtt and a delta-time. It seems to be actually an absolute time for the start of rtt measurement. Its comment is thus now just wrong. (*) I bet kernels compiled with -ftrapv don't boot. They need a little from libgcc to compile. I haven't actually tried compiling them. -ftrapv is only documented to trap for overflow on "+-*" binary operations. I can't find anything like it to trap for overflow on other operations (other binary operations starting with division, ,assignment, conversions due to prototypes). gcc -trapv still generates large slow code with libcalls for "+-*" and doesn't generate the much smaller but possibly slower i386 "into" trap. ISTR that "into" only works for very basic operations too. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 00:09:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6A3A1065674; Tue, 16 Jun 2009 00:09:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C515B8FC13; Tue, 16 Jun 2009 00:09:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5G0968v006522; Tue, 16 Jun 2009 00:09:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5G096Mv006521; Tue, 16 Jun 2009 00:09:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200906160009.n5G096Mv006521@svn.freebsd.org> From: Xin LI Date: Tue, 16 Jun 2009 00:09: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: r194274 - head/kerberos5/lib/libroken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 00:09:07 -0000 Author: delphij Date: Tue Jun 16 00:09:06 2009 New Revision: 194274 URL: http://svn.freebsd.org/changeset/base/194274 Log: Disconnect closefrom.c as we have it as a system call. Modified: head/kerberos5/lib/libroken/Makefile Modified: head/kerberos5/lib/libroken/Makefile ============================================================================== --- head/kerberos5/lib/libroken/Makefile Tue Jun 16 00:02:02 2009 (r194273) +++ head/kerberos5/lib/libroken/Makefile Tue Jun 16 00:09:06 2009 (r194274) @@ -5,7 +5,6 @@ INCS= roken.h roken-common.h SRCS= base64.c \ bswap.c \ - closefrom.c \ concat.c \ copyhostent.c \ dumpdata.c \ From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 01:13:01 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EAE6106566C; Tue, 16 Jun 2009 01:13:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 38D678FC14; Tue, 16 Jun 2009 01:13:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5G1CvGw021738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Jun 2009 11:12:59 +1000 Date: Tue, 16 Jun 2009 11:12:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ulf Lilleengen In-Reply-To: <4A367A11.4080202@FreeBSD.org> Message-ID: <20090616100938.R25672@delplex.bde.org> References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> <4A367A11.4080202@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, Marcel Moolenaar , src-committers@FreeBSD.org Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 01:13:02 -0000 On Mon, 15 Jun 2009, Ulf Lilleengen wrote: > Marcel Moolenaar wrote: >> >> On Jun 15, 2009, at 9:18 AM, Ulf Lilleengen wrote: >> >>> Author: lulf >>> Date: Mon Jun 15 16:18:24 2009 >>> New Revision: 194241 >>> URL: http://svn.freebsd.org/changeset/base/194241 >>> >>> Log: >>> - Relax sanitazion requirements in libdisk, as a previous commit >>> enabling this >>> sanitization broke sysinstall on some disks. This was due to the >>> disks >>> reporting a geometry that was incorrectly sanitized by sysinstall. >>> This makes >>> the sanitization consistent with fdisk. >> >> *snip* >> >>> + if (disk->bios_hd > 256) >>> sane = 0; >> >> The number of heads cannot exceed 255. There are only 8-bits >> in which the number of heads is stored. This also applies to >> PC98, BTW. No, the number of heads can be 256 except in certain broken APIs and BIOSes. The broken APIs don't include fdisk tables, since the maximum number of heads isn't stored. Only the maximum head number is stored. Head numbers are 0-based, so their maximum is 1 less than the number of heads. The maximum head number of 255 fits in the 8 bits in an fdisk table. Most of the original int 0x13 BIOS interfaces are similar. E.g., AH = 8 (read drive parameters) returns the maximum for each CHS value. C and H values are 0-based, so their max is one less than their number. S values are bogusly 1-based, so their max is the same as their total. AH = 2 (read sectors) and AH = 3 (write sectors) naturally pass the (current) head number (in an 8-bit register), so they never need to represent 256 in the 8-bit register. The only broken API that I remember the int 0x41 and 0x46 pseudo-interrupts. These may be only de-facto (I can't find them in the Phoenix BIOS book copyright 1987-1991), but before about 1990 the int 0x13 AH=8 interface was often not implemented and int 0x41 and int 0x46 worked better. The IDT entry for ints 0x41 and 0x46 contains a pointer to a table with the following data (0x41 for hard disk 0 and 0x46 for hard disk 1): from the header file for Minix "wini" disk drivers: /* BIOS table layout. */ typedef char wn_biosdrive[16]; #define WN_CYLINDERS(t) (* (unsigned short *) (&(t)[0x0])) #define WN_HEADS(t) (* (unsigned char *) (&(t)[0x2])) #define WN_PRECOMP(t) (* (unsigned short *) (&(t)[0x5])) #define WN_CTLBYTE(t) (* (unsigned char *) (&(t)[0x8])) #define WN_LANDINGZONE(t) (* (unsigned short *) (&(t)[0xc])) #define WN_SECTORS(t) (* (unsigned char *) (&(t)[0xe])) Many or most 1990's BIOSes present precisely this table for you to edit in their setup. They present many possibilities for obselete (even in 1990's) disks from arrays of this table in ROM, and at least 1 modifiable table per disk in CMOS. Since the head number is for the number of heads, and the table entry for it has type unsigned char, 256 heads does't fit, it becomes 0. Non-broken software would unwrap 0 back to 0 256 and just work, but having 256 (virtual) heads is not very useful so configuring it should be avoided. Apparently, some newer BIOSes know that they are non-broken here (or maybe for cylinder numbers), and default to larger numbers. Such defaults should still be avoided in case you want to move the disk to a machine with a BIOS that doesn't support them. I once tried to standardize on the maximum possible number of heads (256), but had to switch to 255 when 256 failed on only some machines. I still use 255 on all machines. With 2000's BIOSes this requires ignoring BIOS defaults and/or selecting so-called LBA mode in BIOS configurations. FreeBSD doesn't know the BIOS defaults anyway; it gives different defaults (except in my version) which I ignore. Many 2000's BIOSes produce defaults for the number of sectors that can't possibly work in fdisk tables since they significantly exceed 63. Selecting LBA mode always avoids this for me (LBA CHS = xxx/255/63). I don't know how misconfigurations from this are usually avoided. > Aha, so I should fix fdisk too then. Thanks. Please don't break fdisk too. There must be a way to set valid but dangerous values, or theoretically invalid but practically working values, if they are representable and are needed for compatibility. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 06:10:28 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 919561065672; Tue, 16 Jun 2009 06:10:28 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (cl-2958.ham-01.de.sixxs.net [IPv6:2001:6f8:900:b8d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 17D508FC1B; Tue, 16 Jun 2009 06:10:27 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.3/8.14.3) with ESMTP id n5G6AQ5S013730; Tue, 16 Jun 2009 10:10:26 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Tue, 16 Jun 2009 10:10:26 +0400 (MSD) From: Maxim Konovalov To: John Baldwin In-Reply-To: <200906152038.n5FKctaR001026@svn.freebsd.org> Message-ID: <20090616100839.P5283@mp2.macomnet.net> References: <200906152038.n5FKctaR001026@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r194262 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern tools/regression/file/closefrom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 06:10:29 -0000 kern/121522 and more or less related kern/19363. On Mon, 15 Jun 2009, 20:38-0000, John Baldwin wrote: > Author: jhb > Date: Mon Jun 15 20:38:55 2009 > New Revision: 194262 > URL: http://svn.freebsd.org/changeset/base/194262 > > Log: > Add a new 'void closefrom(int lowfd)' system call. When called, it closes > any open file descriptors >= 'lowfd'. It is largely identical to the same > function on other operating systems such as Solaris, DFly, NetBSD, and > OpenBSD. One difference from other *BSD is that this closefrom() does not > fail with any errors. In practice, while the manpages for NetBSD and > OpenBSD claim that they return EINTR, they ignore internal errors from > close() and never return EINTR. DFly does return EINTR, but for the common > use case (closing fd's prior to execve()), the caller really wants all > fd's closed and returning EINTR just forces callers to call closefrom() in > a loop until it stops failing. > > Note that this implementation of closefrom(2) does not make any effort to > resolve userland races with open(2) in other threads. As such, it is not > multithread safe. > > Submitted by: rwatson (initial version) > Reviewed by: rwatson > MFC after: 2 weeks > -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 06:33:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35922106566C; Tue, 16 Jun 2009 06:33:28 +0000 (UTC) (envelope-from ulf.lilleengen@gmail.com) Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id 643A68FC22; Tue, 16 Jun 2009 06:33:26 +0000 (UTC) (envelope-from ulf.lilleengen@gmail.com) Received: by ewy8 with SMTP id 8so4788050ewy.43 for ; Mon, 15 Jun 2009 23:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=Uw+4VNIFLnPOwBuG4p2E1QNU6bVogW4IU7WybNPBiwc=; b=h/aw1MJo97UHGlLT1d0OMFOzF7w3HG5uA5j5+tAp+sceJ7ZiY9oKPkuO1mkxqhjl9q 08TXKfPidB5BBuk8y4sRmt9Y/AykxtoMg7N2fhERW+B1ubgTGQCPjjWfFijE6HzMCJiH 7XFr08GOI1m8i7aNNcl7dEmyD1S3AsaYP7bvk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=MF5XCnBKwcuDJuPlrRoqArMg68djPL1jNTbAS46+JwkkWZF8uwVeOrR8Vu5TUiaeDO 7IiZP6MqwVM3Uqf88pTlp1nwTF3fEBHPAufzuqzSFNwzZWEToPPG7fu7B/ACfV8cQ90f tIfOMGYlmkHql2S2X9UCqKSVp+dGQzm5FYWZ4= Received: by 10.210.141.19 with SMTP id o19mr9314997ebd.54.1245134006086; Mon, 15 Jun 2009 23:33:26 -0700 (PDT) Received: from carrot.geeknest.org (z032069.its-s.tudelft.nl [145.94.32.69]) by mx.google.com with ESMTPS id 10sm1311805eyd.37.2009.06.15.23.33.24 (version=SSLv3 cipher=RC4-MD5); Mon, 15 Jun 2009 23:33:25 -0700 (PDT) From: Ulf Lilleengen To: Bruce Evans Date: Tue, 16 Jun 2009 08:33:32 +0200 User-Agent: KMail/1.11.3 (FreeBSD/8.0-CURRENT; KDE/4.2.3; i386; ; ) References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4A367A11.4080202@FreeBSD.org> <20090616100938.R25672@delplex.bde.org> In-Reply-To: <20090616100938.R25672@delplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906160833.33576.lulf@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 06:33:28 -0000 On Tuesday 16 June 2009 03:12:58 Bruce Evans wrote: > On Mon, 15 Jun 2009, Ulf Lilleengen wrote: > > Marcel Moolenaar wrote: > >> On Jun 15, 2009, at 9:18 AM, Ulf Lilleengen wrote: > >>> Author: lulf > >>> Date: Mon Jun 15 16:18:24 2009 > >>> New Revision: 194241 > >>> URL: http://svn.freebsd.org/changeset/base/194241 > >>> > >>> Log: > >>> - Relax sanitazion requirements in libdisk, as a previous commit > >>> enabling this > >>> sanitization broke sysinstall on some disks. This was due to the > >>> disks > >>> reporting a geometry that was incorrectly sanitized by sysinstall. > >>> This makes > >>> the sanitization consistent with fdisk. > >> > >> *snip* > >> > >>> + if (disk->bios_hd > 256) > >>> sane = 0; > >> > >> The number of heads cannot exceed 255. There are only 8-bits > >> in which the number of heads is stored. This also applies to > >> PC98, BTW. > > No, the number of heads can be 256 except in certain broken APIs and > BIOSes. The broken APIs don't include fdisk tables, since the maximum > number of heads isn't stored. Only the maximum head number is stored. > Head numbers are 0-based, so their maximum is 1 less than the number > of heads. The maximum head number of 255 fits in the 8 bits in an > fdisk table. > > Most of the original int 0x13 BIOS interfaces are similar. E.g., AH = 8 > (read drive parameters) returns the maximum for each CHS value. C and > H values are 0-based, so their max is one less than their number. > S values are bogusly 1-based, so their max is the same as their total. > AH = 2 (read sectors) and AH = 3 (write sectors) naturally pass the > (current) head number (in an 8-bit register), so they never need to > represent 256 in the 8-bit register. > > The only broken API that I remember the int 0x41 and 0x46 > pseudo-interrupts. These may be only de-facto (I can't find them in the > Phoenix BIOS book copyright 1987-1991), but before about 1990 the int 0x13 > AH=8 interface was often not implemented and int 0x41 and int 0x46 worked > better. The IDT entry for ints 0x41 and 0x46 contains a pointer to a table > with the following data (0x41 for hard disk 0 and 0x46 for hard disk 1): > from the header file for Minix "wini" disk drivers: > > /* BIOS table layout. */ > typedef char wn_biosdrive[16]; > #define WN_CYLINDERS(t) (* (unsigned short *) (&(t)[0x0])) > #define WN_HEADS(t) (* (unsigned char *) (&(t)[0x2])) > #define WN_PRECOMP(t) (* (unsigned short *) (&(t)[0x5])) > #define WN_CTLBYTE(t) (* (unsigned char *) (&(t)[0x8])) > #define WN_LANDINGZONE(t) (* (unsigned short *) (&(t)[0xc])) > #define WN_SECTORS(t) (* (unsigned char *) (&(t)[0xe])) > > Many or most 1990's BIOSes present precisely this table for you to edit > in their setup. They present many possibilities for obselete (even in > 1990's) disks from arrays of this table in ROM, and at least 1 modifiable > table per disk in CMOS. > > Since the head number is for the number of heads, and the table entry > for it has type unsigned char, 256 heads does't fit, it becomes 0. > Non-broken software would unwrap 0 back to 0 256 and just work, but > having 256 (virtual) heads is not very useful so configuring it > should be avoided. > > Apparently, some newer BIOSes know that they are non-broken here (or > maybe for cylinder numbers), and default to larger numbers. Such > defaults should still be avoided in case you want to move the disk > to a machine with a BIOS that doesn't support them. > > I once tried to standardize on the maximum possible number of heads > (256), but had to switch to 255 when 256 failed on only some machines. > I still use 255 on all machines. With 2000's BIOSes this requires > ignoring BIOS defaults and/or selecting so-called LBA mode in BIOS > configurations. FreeBSD doesn't know the BIOS defaults anyway; it > gives different defaults (except in my version) which I ignore. > > Many 2000's BIOSes produce defaults for the number of sectors that can't > possibly work in fdisk tables since they significantly exceed 63. > Selecting LBA mode always avoids this for me (LBA CHS = xxx/255/63). > I don't know how misconfigurations from this are usually avoided. > > > Aha, so I should fix fdisk too then. Thanks. > > Please don't break fdisk too. There must be a way to set valid but > dangerous values, or theoretically invalid but practically working > values, if they are representable and are needed for compatibility. > > Bruce I'm a bit confused now :) Fdisk allowed 256 as a valid number of heads. Are you saying it should still be allowed? -- Ulf Lilleengen From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 09:26:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220F91065670; Tue, 16 Jun 2009 09:26:40 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D45E78FC25; Tue, 16 Jun 2009 09:26:38 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA02955; Tue, 16 Jun 2009 12:26:06 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4A37652D.7000206@freebsd.org> Date: Tue, 16 Jun 2009 12:26:05 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.21 (X11/20090406) MIME-Version: 1.0 To: Ulf Lilleengen References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4A367A11.4080202@FreeBSD.org> <20090616100938.R25672@delplex.bde.org> <200906160833.33576.lulf@freebsd.org> In-Reply-To: <200906160833.33576.lulf@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 09:26:40 -0000 on 16/06/2009 09:33 Ulf Lilleengen said the following: > > I'm a bit confused now :) > > Fdisk allowed 256 as a valid number of heads. Are you saying it should still > be allowed? I think that Bruce meant exactly that. Maximum head number/id is 255 (minimum head number is 0). Maximum number/count of heads is 256. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 12:05:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB697106564A; Tue, 16 Jun 2009 12:05:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C94CC8FC1D; Tue, 16 Jun 2009 12:05:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GC54ke026711; Tue, 16 Jun 2009 12:05:04 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GC54go026710; Tue, 16 Jun 2009 12:05:04 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906161205.n5GC54go026710@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 16 Jun 2009 12:05: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: r194285 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 12:05:05 -0000 Author: edwin Date: Tue Jun 16 12:05:04 2009 New Revision: 194285 URL: http://svn.freebsd.org/changeset/base/194285 Log: Add support for 256MB Hitachi CF card and 256MB Silicon Systems CF card This patch against RELENG_6 adds two more entries to src/tools/tools/nanobsd/FlashDevice.sub - one for a 256MB Hitachi CF card and one for a 256MB Silicon Systems CF card. Both entries have been verified to work with a Soekris net4801. PR: kern/101228 Submitted by: Henrik Brix Andersen MFC after: 1 week Modified: head/tools/tools/nanobsd/FlashDevice.sub Modified: head/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 05:10:21 2009 (r194284) +++ head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 12:05:04 2009 (r194285) @@ -41,6 +41,19 @@ sub_FlashDevice () { a1=`echo $1 | tr '[:upper:]' '[:lower:]'` a2=`echo $2 | tr '[:upper:]' '[:lower:]'` case $a1 in + hitachi) + case $a2 in + 256|256mb) + NANO_MEDIASIZE=`expr 256204800 / 512` + NANO_HEADS=15 + NANO_SECTS=48 + ;; + *) + echo "Unknown Hitachi Flash capacity" + exit 2 + ;; + esac + ;; integral) # Source: mich@FreeBSD.org case $a2 in @@ -129,6 +142,11 @@ sub_FlashDevice () { ;; siliconsystems) case $a2 in + 256|256mb) + NANO_MEDIASIZE=`expr 260571136 / 512` + NANO_HEADS=16 + NANO_SECTS=32 + ;; 4096|4g) NANO_MEDIASIZE=`expr -e 4224761856 / 512` NANO_HEADS=16 From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 12:09:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 650DC106564A; Tue, 16 Jun 2009 12:09:12 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 532C88FC22; Tue, 16 Jun 2009 12:09:12 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GC9CVf026809; Tue, 16 Jun 2009 12:09:12 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GC9Coq026808; Tue, 16 Jun 2009 12:09:12 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906161209.n5GC9Coq026808@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 16 Jun 2009 12:09: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: r194286 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 12:09:12 -0000 Author: edwin Date: Tue Jun 16 12:09:12 2009 New Revision: 194286 URL: http://svn.freebsd.org/changeset/base/194286 Log: Support for 64 Mb Kodak flash device. PR: misc/115025 Submitted by: Michael W Lucas MFC after: 1 week Modified: head/tools/tools/nanobsd/FlashDevice.sub Modified: head/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 12:05:04 2009 (r194285) +++ head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 12:09:12 2009 (r194286) @@ -68,6 +68,20 @@ sub_FlashDevice () { ;; esac ;; + kodak) + # Source: mwlucas@FreeBSD.org + case $a2 iin + 64|64mb) + NANO_MEDIASIZE=`expr expr 64487424 / 512` + NANO_HEADS=4 + NANO_SECTS=32 + ;; + *) + echo "Unknown Kodak Flash capacity" + exit 2 + ;; + esac + ;; memorycorp) # Source: simon@FreeBSD.org case $a2 in From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 12:33:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54108106564A; Tue, 16 Jun 2009 12:33:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 422368FC1C; Tue, 16 Jun 2009 12:33:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GCXd0h027458; Tue, 16 Jun 2009 12:33:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GCXdLK027457; Tue, 16 Jun 2009 12:33:39 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906161233.n5GCXdLK027457@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 16 Jun 2009 12:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194288 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 12:33:39 -0000 Author: edwin Date: Tue Jun 16 12:33:38 2009 New Revision: 194288 URL: http://svn.freebsd.org/changeset/base/194288 Log: Fix NanoBSD when the data partition size is defined as a negative number. It is possible to ask nanobsd.sh to create a 'data' partition, separate from the system or configuration partitions, and furthermore, by specifying a negative value for its size to request that it use all space unused by those partitions for its own size. Because the two lines of code that calculate how much space is available for this data partition are written in perl-like syntax, the awk code that does the processing performs the calculation incorrectly. [note - this was already fixed by r174936] Furthermore, a comparison later down fails to newfs the partition when the size is negative. PR: misc/127759 Submitted by: Cyrus Rahman MFC after: 1 week Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Tue Jun 16 12:14:57 2009 (r194287) +++ head/tools/tools/nanobsd/nanobsd.sh Tue Jun 16 12:33:38 2009 (r194288) @@ -474,7 +474,7 @@ create_i386_diskimage ( ) ( # XXX: fill from where ? # Create Data slice, if any. - if [ $NANO_DATASIZE -gt 0 ] ; then + if [ $NANO_DATASIZE -ne 0 ] ; then newfs ${NANO_NEWFS} /dev/${MD}s4 # XXX: fill from where ? fi From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 13:31:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0653A106566C; Tue, 16 Jun 2009 13:31:02 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E88D48FC13; Tue, 16 Jun 2009 13:31:01 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GDV1QS028805; Tue, 16 Jun 2009 13:31:01 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GDV1Gc028804; Tue, 16 Jun 2009 13:31:01 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200906161331.n5GDV1Gc028804@svn.freebsd.org> From: Roman Divacky Date: Tue, 16 Jun 2009 13:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194290 - head/contrib/ipfilter/tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 13:31:02 -0000 Author: rdivacky Date: Tue Jun 16 13:31:01 2009 New Revision: 194290 URL: http://svn.freebsd.org/changeset/base/194290 Log: Fix a typo that causes the for loop to exit immediately. There's identical loop a few lines above. Reviewed by: sam Approved by: ed (mentor) Silence from: darrenr (maintainer) Modified: head/contrib/ipfilter/tools/ipfcomp.c Modified: head/contrib/ipfilter/tools/ipfcomp.c ============================================================================== --- head/contrib/ipfilter/tools/ipfcomp.c Tue Jun 16 13:05:34 2009 (r194289) +++ head/contrib/ipfilter/tools/ipfcomp.c Tue Jun 16 13:31:01 2009 (r194290) @@ -382,7 +382,7 @@ extern frentry_t *ipfrule_match_out_%s _ extern frentry_t *ipf_rules_out_%s[%d];\n", grp->fg_name, grp->fg_name, outcount); - for (g = groups; g != g; g = g->fg_next) + for (g = groups; g != grp; g = g->fg_next) if ((strncmp(g->fg_name, grp->fg_name, FR_GROUPLEN) == 0) && g->fg_flags == grp->fg_flags) From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 13:38:23 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8534F10656C0 for ; Tue, 16 Jun 2009 13:38:23 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: from smtp004.apm-internet.net (smtp004.apm-internet.net [85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id D37728FC17 for ; Tue, 16 Jun 2009 13:38:22 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: (qmail 6879 invoked from network); 16 Jun 2009 13:27:06 -0000 Received: from unknown (HELO titania.njm.me.uk) (86.129.200.224) by smtp004.apm-internet.net with SMTP; 16 Jun 2009 13:27:06 -0000 Received: from titania.njm.me.uk (localhost [127.0.0.1]) by titania.njm.me.uk (8.14.3/8.14.3) with ESMTP id n5GDR5fE072694; Tue, 16 Jun 2009 14:27:05 +0100 (BST) (envelope-from njm@njm.me.uk) Received: (from njm@localhost) by titania.njm.me.uk (8.14.3/8.14.3/Submit) id n5GDR5uk072693; Tue, 16 Jun 2009 14:27:05 +0100 (BST) (envelope-from njm@njm.me.uk) Date: Tue, 16 Jun 2009 14:27:05 +0100 From: "N.J. Mann" To: Edwin Groothuis Message-ID: <20090616132705.GA62514@titania.njm.me.uk> References: <200906161209.n5GC9Coq026808@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906161209.n5GC9Coq026808@svn.freebsd.org> X-Operating-System: FreeBSD 7.2-STABLE User-Agent: mutt-NJM (2009-06-13) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194286 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 13:38:24 -0000 In message <200906161209.n5GC9Coq026808@svn.freebsd.org>, Edwin Groothuis (edwin@FreeBSD.org) wrote: > Author: edwin > Date: Tue Jun 16 12:09:12 2009 > New Revision: 194286 > URL: http://svn.freebsd.org/changeset/base/194286 > > Log: > Support for 64 Mb Kodak flash device. > > PR: misc/115025 > Submitted by: Michael W Lucas > MFC after: 1 week > > Modified: > head/tools/tools/nanobsd/FlashDevice.sub > > Modified: head/tools/tools/nanobsd/FlashDevice.sub > ============================================================================== > --- head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 12:05:04 2009 (r194285) > +++ head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 12:09:12 2009 (r194286) > @@ -68,6 +68,20 @@ sub_FlashDevice () { > ;; > esac > ;; > + kodak) > + # Source: mwlucas@FreeBSD.org > + case $a2 iin ^^^ in? Cheers, Nick. -- From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 13:40:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 515291065674; Tue, 16 Jun 2009 13:40:44 +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 0FB638FC21; Tue, 16 Jun 2009 13:40:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9948146B95; Tue, 16 Jun 2009 09:40:43 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 7DE078A073; Tue, 16 Jun 2009 09:40:42 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Tue, 16 Jun 2009 09:27:33 -0400 User-Agent: KMail/1.9.7 References: <200906101827.n5AIRFoR022115@svn.freebsd.org> <200906151328.32279.jhb@freebsd.org> <20090616091039.Q25629@delplex.bde.org> In-Reply-To: <20090616091039.Q25629@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906160927.34285.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 16 Jun 2009 09:40:42 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193941 - 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: Tue, 16 Jun 2009 13:40:45 -0000 On Monday 15 June 2009 8:04:42 pm Bruce Evans wrote: > On Mon, 15 Jun 2009, John Baldwin wrote: > > > On Friday 12 June 2009 8:56:56 pm Bruce Evans wrote: > >> On Fri, 12 Jun 2009, John Baldwin wrote: > > ... > >>> FWIW, the variables were signed before they were changed to unsigned and are now > >>> back as signed again. It just seems really odd to have the types not match > >>> 'ticks' especially since many of the values are just cached copies of 'ticks'. > >> > >> No, they were originally u_long and stayed that way until you changed them > >> (except possibly for newer variables). The type of `ticks' is just wrong, > >> and fixing that would take more work, but there is no reason to propagate > >> this bug to new variables. The original version is: > > > > Gah, I had misremembered the diffs, they were indeed unsigned. Here is my > > attempt at trying to fix things then based on my understanding so far: > > This is about what I want. Ok, I will commit in a bit with some fixes. > > - I cast 'ticks' to u_int in the code to compute a new isn. I'm not sure if > > this is needed. > > This shouldn't be needed. Ok, I've removed it. > > --- //depot/projects/smpng/sys/netinet/tcp_timer.c 2009/04/14 19:06:19 > > +++ //depot/user/jhb/socket/netinet/tcp_timer.c 2009/06/15 17:22:13 > > @@ -418,8 +418,8 @@ > > * backoff that we would use if retransmitting. > > */ > > if (tp->t_rxtshift == TCP_MAXRXTSHIFT && > > - ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || > > - (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { > > + (ticks - tp->t_rcvtime >= tcp_maxpersistidle || > > + ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { > > TCPSTAT_INC(tcps_persistdrop); > > tp = tcp_drop(tp, ETIMEDOUT); > > goto out; > > Do we want to keep the non-KNF indentation (1 char extra to line things up)? It is easier to read with it lined up and in this case I just went with the existing style rather than reindenting. > > --- //depot/projects/smpng/sys/netinet/tcp_var.h 2009/06/12 13:45:50 > > +++ //depot/user/jhb/socket/netinet/tcp_var.h 2009/06/15 17:22:13 > > @@ -139,12 +139,12 @@ > > > > u_int t_maxopd; /* mss plus options */ > > > > - int t_rcvtime; /* inactivity time */ > > - int t_starttime; /* time connection was established */ > > - int t_rtttime; /* round trip time */ > > + u_int t_rcvtime; /* inactivity time */ > > + u_int t_starttime; /* time connection was established */ > > + u_int t_rtttime; /* round trip time */ > > I would prefer the delta-times (like t_rtttime) to remain as ints. Having > everything of the same type is safer, and having everything of signed > type allows better overflow checking (gcc -ftrapv (*)). Whether ints are > actually safer for r_tttime depend on how it is used. Oops, I misread > t_rtttime as being the rtt and a delta-time. It seems to be actually > an absolute time for the start of rtt measurement. Its comment is thus > now just wrong. Ok, I've updated the comment instead and left it as u_int. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 13:52:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C938D1065687; Tue, 16 Jun 2009 13:52:21 +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 B72A28FC20; Tue, 16 Jun 2009 13:52:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GDqL3K029699; Tue, 16 Jun 2009 13:52:21 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GDqLIs029697; Tue, 16 Jun 2009 13:52:21 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906161352.n5GDqLIs029697@svn.freebsd.org> From: Rick Macklem Date: Tue, 16 Jun 2009 13:52: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: r194292 - in head/sys/fs: nfs 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: Tue, 16 Jun 2009 13:52:22 -0000 Author: rmacklem Date: Tue Jun 16 13:52:21 2009 New Revision: 194292 URL: http://svn.freebsd.org/changeset/base/194292 Log: Remove the "int *" typecast for the aresid argument to vn_rdwr() and change the type of the argument from size_t to int. This should avoid issues on 64bit architectures. Suggested by: kib Approved by: kib (mentor) Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue Jun 16 13:39:09 2009 (r194291) +++ head/sys/fs/nfs/nfsport.h Tue Jun 16 13:52:21 2009 (r194292) @@ -628,7 +628,7 @@ int nfsmsleep(void *, void *, int, const * Define whatever it takes to do a vn_rdwr(). */ #define NFSD_RDWR(r, v, b, l, o, s, i, c, a, p) \ - vn_rdwr((r), (v), (b), (l), (o), (s), (i), (c), NULL, (int *)(a), (p)) + vn_rdwr((r), (v), (b), (l), (o), (s), (i), (c), NULL, (a), (p)) /* * Macros for handling memory for different BSDen. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jun 16 13:39:09 2009 (r194291) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Tue Jun 16 13:52:21 2009 (r194292) @@ -3824,7 +3824,7 @@ nfsrv_setupstable(NFSPROC_T *p) struct nfst_rec *tsp; int error, i, tryagain; off_t off = 0; - size_t aresid, len; + int aresid, len; struct timeval curtime; /* From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 14:55:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D6610656D2; Tue, 16 Jun 2009 14:55:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF788FC23; Tue, 16 Jun 2009 14:55:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GEtE6w031381; Tue, 16 Jun 2009 14:55:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GEtE7v031379; Tue, 16 Jun 2009 14:55:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906161455.n5GEtE7v031379@svn.freebsd.org> From: Ed Schouten Date: Tue, 16 Jun 2009 14:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194293 - in head/sys/dev/syscons: . teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 14:55:15 -0000 Author: ed Date: Tue Jun 16 14:55:13 2009 New Revision: 194293 URL: http://svn.freebsd.org/changeset/base/194293 Log: Small fixes to Unicode handling: - Add more mappings for Greek characters and the Euro sign. - Print UTF-8 characters in the log file as hexadecimal. Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/teken/teken.c Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Tue Jun 16 13:52:21 2009 (r194292) +++ head/sys/dev/syscons/scterm-teken.c Tue Jun 16 14:55:13 2009 (r194293) @@ -343,48 +343,53 @@ struct unicp437 { }; static const struct unicp437 cp437table[] = { - { 0x0020, 0x20, 0x5e }, { 0x00a1, 0xad, 0x00 }, - { 0x00a2, 0x9b, 0x00 }, { 0x00a3, 0x9c, 0x00 }, - { 0x00a5, 0x9d, 0x00 }, { 0x00a7, 0x15, 0x00 }, - { 0x00aa, 0xa6, 0x00 }, { 0x00ab, 0xae, 0x00 }, - { 0x00ac, 0xaa, 0x00 }, { 0x00b0, 0xf8, 0x00 }, - { 0x00b1, 0xf1, 0x00 }, { 0x00b2, 0xfd, 0x00 }, - { 0x00b5, 0xe6, 0x00 }, { 0x00b6, 0x14, 0x00 }, - { 0x00b7, 0xfa, 0x00 }, { 0x00ba, 0xa7, 0x00 }, - { 0x00bb, 0xaf, 0x00 }, { 0x00bc, 0xac, 0x00 }, - { 0x00bd, 0xab, 0x00 }, { 0x00bf, 0xa8, 0x00 }, - { 0x00c4, 0x8e, 0x01 }, { 0x00c6, 0x92, 0x00 }, - { 0x00c7, 0x80, 0x00 }, { 0x00c9, 0x90, 0x00 }, - { 0x00d1, 0xa5, 0x00 }, { 0x00d6, 0x99, 0x00 }, - { 0x00dc, 0x9a, 0x00 }, { 0x00df, 0xe1, 0x00 }, - { 0x00e0, 0x85, 0x00 }, { 0x00e1, 0xa0, 0x00 }, - { 0x00e2, 0x83, 0x00 }, { 0x00e4, 0x84, 0x00 }, - { 0x00e5, 0x86, 0x00 }, { 0x00e6, 0x91, 0x00 }, - { 0x00e7, 0x87, 0x00 }, { 0x00e8, 0x8a, 0x00 }, - { 0x00e9, 0x82, 0x00 }, { 0x00ea, 0x88, 0x01 }, - { 0x00ec, 0x8d, 0x00 }, { 0x00ed, 0xa1, 0x00 }, - { 0x00ee, 0x8c, 0x00 }, { 0x00ef, 0x8b, 0x00 }, + { 0x0020, 0x20, 0x5e }, { 0x00a0, 0x20, 0x00 }, + { 0x00a1, 0xad, 0x00 }, { 0x00a2, 0x9b, 0x00 }, + { 0x00a3, 0x9c, 0x00 }, { 0x00a5, 0x9d, 0x00 }, + { 0x00a7, 0x15, 0x00 }, { 0x00aa, 0xa6, 0x00 }, + { 0x00ab, 0xae, 0x00 }, { 0x00ac, 0xaa, 0x00 }, + { 0x00b0, 0xf8, 0x00 }, { 0x00b1, 0xf1, 0x00 }, + { 0x00b2, 0xfd, 0x00 }, { 0x00b5, 0xe6, 0x00 }, + { 0x00b6, 0x14, 0x00 }, { 0x00b7, 0xfa, 0x00 }, + { 0x00ba, 0xa7, 0x00 }, { 0x00bb, 0xaf, 0x00 }, + { 0x00bc, 0xac, 0x00 }, { 0x00bd, 0xab, 0x00 }, + { 0x00bf, 0xa8, 0x00 }, { 0x00c4, 0x8e, 0x01 }, + { 0x00c6, 0x92, 0x00 }, { 0x00c7, 0x80, 0x00 }, + { 0x00c9, 0x90, 0x00 }, { 0x00d1, 0xa5, 0x00 }, + { 0x00d6, 0x99, 0x00 }, { 0x00dc, 0x9a, 0x00 }, + { 0x00df, 0xe1, 0x00 }, { 0x00e0, 0x85, 0x00 }, + { 0x00e1, 0xa0, 0x00 }, { 0x00e2, 0x83, 0x00 }, + { 0x00e4, 0x84, 0x00 }, { 0x00e5, 0x86, 0x00 }, + { 0x00e6, 0x91, 0x00 }, { 0x00e7, 0x87, 0x00 }, + { 0x00e8, 0x8a, 0x00 }, { 0x00e9, 0x82, 0x00 }, + { 0x00ea, 0x88, 0x01 }, { 0x00ec, 0x8d, 0x00 }, + { 0x00ed, 0xa1, 0x00 }, { 0x00ee, 0x8c, 0x00 }, + { 0x00ef, 0x8b, 0x00 }, { 0x00f0, 0xeb, 0x00 }, { 0x00f1, 0xa4, 0x00 }, { 0x00f2, 0x95, 0x00 }, { 0x00f3, 0xa2, 0x00 }, { 0x00f4, 0x93, 0x00 }, { 0x00f6, 0x94, 0x00 }, { 0x00f7, 0xf6, 0x00 }, - { 0x00f9, 0x97, 0x00 }, { 0x00fa, 0xa3, 0x00 }, - { 0x00fb, 0x96, 0x00 }, { 0x00fc, 0x81, 0x00 }, - { 0x00ff, 0x98, 0x00 }, { 0x0192, 0x9f, 0x00 }, - { 0x0393, 0xe2, 0x00 }, { 0x0398, 0xe9, 0x00 }, - { 0x03a3, 0xe4, 0x00 }, { 0x03a6, 0xe8, 0x00 }, - { 0x03a9, 0xea, 0x00 }, { 0x03b1, 0xe0, 0x00 }, - { 0x03b4, 0xeb, 0x00 }, { 0x03b5, 0xee, 0x00 }, + { 0x00f8, 0xed, 0x00 }, { 0x00f9, 0x97, 0x00 }, + { 0x00fa, 0xa3, 0x00 }, { 0x00fb, 0x96, 0x00 }, + { 0x00fc, 0x81, 0x00 }, { 0x00ff, 0x98, 0x00 }, + { 0x0192, 0x9f, 0x00 }, { 0x0393, 0xe2, 0x00 }, + { 0x0398, 0xe9, 0x00 }, { 0x03a3, 0xe4, 0x00 }, + { 0x03a6, 0xe8, 0x00 }, { 0x03a9, 0xea, 0x00 }, + { 0x03b1, 0xe0, 0x01 }, { 0x03b4, 0xeb, 0x00 }, + { 0x03b5, 0xee, 0x00 }, { 0x03bc, 0xe6, 0x00 }, { 0x03c0, 0xe3, 0x00 }, { 0x03c3, 0xe5, 0x00 }, { 0x03c4, 0xe7, 0x00 }, { 0x03c6, 0xed, 0x00 }, - { 0x2010, 0x2d, 0x00 }, { 0x2014, 0x2d, 0x00 }, - { 0x2018, 0x60, 0x00 }, { 0x2019, 0x27, 0x00 }, - { 0x201c, 0x22, 0x00 }, { 0x201d, 0x22, 0x00 }, - { 0x2022, 0x07, 0x00 }, { 0x203c, 0x13, 0x00 }, - { 0x207f, 0xfc, 0x00 }, { 0x20a7, 0x9e, 0x00 }, - { 0x2190, 0x1b, 0x00 }, { 0x2191, 0x18, 0x00 }, - { 0x2192, 0x1a, 0x00 }, { 0x2193, 0x19, 0x00 }, - { 0x2194, 0x1d, 0x00 }, { 0x2195, 0x12, 0x00 }, - { 0x21a8, 0x17, 0x00 }, { 0x2212, 0x2d, 0x00 }, + { 0x03d5, 0xed, 0x00 }, { 0x2010, 0x2d, 0x00 }, + { 0x2014, 0x2d, 0x00 }, { 0x2018, 0x60, 0x00 }, + { 0x2019, 0x27, 0x00 }, { 0x201c, 0x22, 0x00 }, + { 0x201d, 0x22, 0x00 }, { 0x2022, 0x07, 0x00 }, + { 0x203c, 0x13, 0x00 }, { 0x207f, 0xfc, 0x00 }, + { 0x20a7, 0x9e, 0x00 }, { 0x20ac, 0xee, 0x00 }, + { 0x2126, 0xea, 0x00 }, { 0x2190, 0x1b, 0x00 }, + { 0x2191, 0x18, 0x00 }, { 0x2192, 0x1a, 0x00 }, + { 0x2193, 0x19, 0x00 }, { 0x2194, 0x1d, 0x00 }, + { 0x2195, 0x12, 0x00 }, { 0x21a8, 0x17, 0x00 }, + { 0x2202, 0xeb, 0x00 }, { 0x2208, 0xee, 0x00 }, + { 0x2211, 0xe4, 0x00 }, { 0x2212, 0x2d, 0x00 }, { 0x2219, 0xf9, 0x00 }, { 0x221a, 0xfb, 0x00 }, { 0x221e, 0xec, 0x00 }, { 0x221f, 0x1c, 0x00 }, { 0x2229, 0xef, 0x00 }, { 0x2248, 0xf7, 0x00 }, Modified: head/sys/dev/syscons/teken/teken.c ============================================================================== --- head/sys/dev/syscons/teken/teken.c Tue Jun 16 13:52:21 2009 (r194292) +++ head/sys/dev/syscons/teken/teken.c Tue Jun 16 14:55:13 2009 (r194293) @@ -300,7 +300,7 @@ teken_input_byte(teken_t *t, unsigned ch t->t_utf8_left--; t->t_utf8_partial = (t->t_utf8_partial << 6) | (c & 0x3f); if (t->t_utf8_left == 0) { - teken_printf("Got UTF-8 char %u\n", t->t_utf8_partial); + teken_printf("Got UTF-8 char %x\n", t->t_utf8_partial); teken_input_char(t, t->t_utf8_partial); } } From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 15:13:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E2A106567A; Tue, 16 Jun 2009 15:13:19 +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 3CA228FC1C; Tue, 16 Jun 2009 15:13:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GFDJmO031820; Tue, 16 Jun 2009 15:13:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GFDJVV031818; Tue, 16 Jun 2009 15:13:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161513.n5GFDJVV031818@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 15:13: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: r194295 - head/sys/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: Tue, 16 Jun 2009 15:13:20 -0000 Author: jhb Date: Tue Jun 16 15:13:18 2009 New Revision: 194295 URL: http://svn.freebsd.org/changeset/base/194295 Log: Move (read|write)_cyrix_reg() inlines from specialreg.h to cpufunc.h. specialreg.h now consists solely of register-related macros. Modified: head/sys/i386/include/cpufunc.h head/sys/i386/include/specialreg.h Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Tue Jun 16 15:09:17 2009 (r194294) +++ head/sys/i386/include/cpufunc.h Tue Jun 16 15:13:18 2009 (r194295) @@ -620,6 +620,20 @@ load_dr7(u_int dr7) __asm __volatile("movl %0,%%dr7" : : "r" (dr7)); } +static __inline u_char +read_cyrix_reg(u_char reg) +{ + outb(0x22, reg); + return inb(0x23); +} + +static __inline void +write_cyrix_reg(u_char reg, u_char data) +{ + outb(0x22, reg); + outb(0x23, data); +} + static __inline register_t intr_disable(void) { @@ -702,6 +716,7 @@ u_int rdr5(void); u_int rdr6(void); u_int rdr7(void); uint64_t rdtsc(void); +u_char read_cyrix_reg(u_char reg); u_int read_eflags(void); u_int rfs(void); uint64_t rgdt(void); @@ -710,6 +725,7 @@ uint64_t ridt(void); u_short rldt(void); u_short rtr(void); void wbinvd(void); +void write_cyrix_reg(u_char reg, u_char data); void write_eflags(u_int ef); void wrmsr(u_int msr, uint64_t newval); Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Tue Jun 16 15:09:17 2009 (r194294) +++ head/sys/i386/include/specialreg.h Tue Jun 16 15:13:18 2009 (r194295) @@ -575,20 +575,4 @@ #define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */ #define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */ -#ifndef LOCORE -static __inline u_char -read_cyrix_reg(u_char reg) -{ - outb(0x22, reg); - return inb(0x23); -} - -static __inline void -write_cyrix_reg(u_char reg, u_char data) -{ - outb(0x22, reg); - outb(0x23, data); -} -#endif - #endif /* !_MACHINE_SPECIALREG_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 15:13:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2B710656BB; Tue, 16 Jun 2009 15:13:46 +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 4793F8FC17; Tue, 16 Jun 2009 15:13:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GFDkCX031866; Tue, 16 Jun 2009 15:13:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GFDkNA031861; Tue, 16 Jun 2009 15:13:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906161513.n5GFDkNA031861@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Jun 2009 15:13: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: r194296 - in head/sys: gnu/fs/ext2fs kern ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2009 15:13:47 -0000 Author: kib Date: Tue Jun 16 15:13:45 2009 New Revision: 194296 URL: http://svn.freebsd.org/changeset/base/194296 Log: Do not use casts (int *)0 and (struct thread *)0 for the arguments of vn_rdwr, use NULL. Reviewed by: jhb MFC after: 1 week Modified: head/sys/gnu/fs/ext2fs/ext2_lookup.c head/sys/gnu/fs/ext2fs/ext2_vnops.c head/sys/kern/kern_acct.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/gnu/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_lookup.c Tue Jun 16 15:13:18 2009 (r194295) +++ head/sys/gnu/fs/ext2fs/ext2_lookup.c Tue Jun 16 15:13:45 2009 (r194296) @@ -1048,8 +1048,8 @@ ext2_checkpath(source, target, cred) } error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, (int *)0, - (struct thread *)0); + IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, + NULL); if (error != 0) break; namlen = dirbuf.dotdot_type; /* like ufs little-endian */ Modified: head/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Jun 16 15:13:18 2009 (r194295) +++ head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Jun 16 15:13:45 2009 (r194296) @@ -1048,8 +1048,7 @@ abortit: error = vn_rdwr(UIO_READ, fvp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - tcnp->cn_cred, NOCRED, (int *)0, - (struct thread *)0); + tcnp->cn_cred, NOCRED, NULL, NULL); if (error == 0) { /* Like ufs little-endian: */ namlen = dirbuf.dotdot_type; @@ -1066,8 +1065,7 @@ abortit: (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_SYNC | IO_NOMACCHECK, tcnp->cn_cred, - NOCRED, (int *)0, - (struct thread *)0); + NOCRED, NULL, NULL); cache_purge(fdvp); } } @@ -1203,7 +1201,7 @@ ext2_mkdir(ap) error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)&dirtemplate, sizeof (dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_SYNC | IO_NOMACCHECK, cnp->cn_cred, NOCRED, - (int *)0, (struct thread *)0); + NULL, NULL); if (error) { dp->i_nlink--; dp->i_flag |= IN_CHANGE; @@ -1340,7 +1338,7 @@ ext2_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - ap->a_cnp->cn_cred, NOCRED, (int *)0, (struct thread *)0); + ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); return (error); Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Tue Jun 16 15:13:18 2009 (r194295) +++ head/sys/kern/kern_acct.c Tue Jun 16 15:13:45 2009 (r194296) @@ -436,7 +436,7 @@ acct_process(struct thread *td) vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); ret = vn_rdwr(UIO_WRITE, acct_vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, acct_cred, NOCRED, - (int *)0, td); + NULL, td); VFS_UNLOCK_GIANT(vfslocked); sx_sunlock(&acct_sx); return (ret); Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Tue Jun 16 15:13:18 2009 (r194295) +++ head/sys/ufs/ufs/ufs_lookup.c Tue Jun 16 15:13:45 2009 (r194296) @@ -1247,7 +1247,7 @@ ufs_dir_dd_ino(struct vnode *vp, struct return (ENOTDIR); error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, - IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, (int *)0, NULL); + IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, NULL); if (error != 0) return (error); #if (BYTE_ORDER == LITTLE_ENDIAN) Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Jun 16 15:13:18 2009 (r194295) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Jun 16 15:13:45 2009 (r194296) @@ -1849,7 +1849,7 @@ ufs_symlink(ap) } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, - ap->a_cnp->cn_cred, NOCRED, (int *)0, (struct thread *)0); + ap->a_cnp->cn_cred, NOCRED, NULL, NULL); if (error) vput(vp); return (error); From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 15:30:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 088F21065670; Tue, 16 Jun 2009 15:30:11 +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 B4F2E8FC1D; Tue, 16 Jun 2009 15:30:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GFUASx032273; Tue, 16 Jun 2009 15:30:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GFUAhE032270; Tue, 16 Jun 2009 15:30:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161530.n5GFUAhE032270@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 15:30: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: r194297 - in head: crypto/openssh secure/lib/libssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 15:30:11 -0000 Author: jhb Date: Tue Jun 16 15:30:10 2009 New Revision: 194297 URL: http://svn.freebsd.org/changeset/base/194297 Log: Use the closefrom(2) system call. Reviewed by: des Modified: head/crypto/openssh/config.h head/crypto/openssh/ssh_namespace.h head/secure/lib/libssh/Makefile Modified: head/crypto/openssh/config.h ============================================================================== --- head/crypto/openssh/config.h Tue Jun 16 15:13:45 2009 (r194296) +++ head/crypto/openssh/config.h Tue Jun 16 15:30:10 2009 (r194297) @@ -211,7 +211,7 @@ #define HAVE_CLOCK_T 1 /* Define to 1 if you have the `closefrom' function. */ -/* #undef HAVE_CLOSEFROM */ +#define HAVE_CLOSEFROM 1 /* Define if gai_strerror() returns const char * */ #define HAVE_CONST_GAI_STRERROR_PROTO 1 Modified: head/crypto/openssh/ssh_namespace.h ============================================================================== --- head/crypto/openssh/ssh_namespace.h Tue Jun 16 15:13:45 2009 (r194296) +++ head/crypto/openssh/ssh_namespace.h Tue Jun 16 15:30:10 2009 (r194297) @@ -153,7 +153,6 @@ #define ciphers_valid ssh_ciphers_valid #define cleanhostname ssh_cleanhostname #define cleanup_exit ssh_cleanup_exit -#define closefrom ssh_closefrom #define colon ssh_colon #define compat_cipher_proposal ssh_compat_cipher_proposal #define compat_datafellows ssh_compat_datafellows Modified: head/secure/lib/libssh/Makefile ============================================================================== --- head/secure/lib/libssh/Makefile Tue Jun 16 15:13:45 2009 (r194296) +++ head/secure/lib/libssh/Makefile Tue Jun 16 15:30:10 2009 (r194297) @@ -19,7 +19,7 @@ SRCS= acss.c authfd.c authfile.c bufaux. # compiled directly into sshd instead. # Portability layer -SRCS+= bsd-closefrom.c bsd-misc.c fmt_scaled.c getrrsetbyname.c \ +SRCS+= bsd-misc.c fmt_scaled.c getrrsetbyname.c \ openssl-compat.c port-tun.c strtonum.c vis.c xcrypt.c xmmap.c # FreeBSD additions SRCS+= version.c From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 16:38:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A68161065670; Tue, 16 Jun 2009 16:38:54 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9490C8FC24; Tue, 16 Jun 2009 16:38:54 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GGcsrQ033651; Tue, 16 Jun 2009 16:38:54 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GGcsRQ033650; Tue, 16 Jun 2009 16:38:54 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200906161638.n5GGcsRQ033650@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 16 Jun 2009 16:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194298 - 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: Tue, 16 Jun 2009 16:38:55 -0000 Author: kan Date: Tue Jun 16 16:38:54 2009 New Revision: 194298 URL: http://svn.freebsd.org/changeset/base/194298 Log: FreeBSD returns main object handle from dlopen(NULL, ...) calls. dlsym seaches using this handle are expected to look for symbol definitions in all objects loaded at the program start time along with all objects currently in RTLD_GLOBAL scope. Discussed with: kib Reported by: Maho NAKATA MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jun 16 15:30:10 2009 (r194297) +++ head/libexec/rtld-elf/rtld.c Tue Jun 16 16:38:54 2009 (r194298) @@ -2130,6 +2130,16 @@ do_dlsym(void *handle, const char *name, /* Search main program and all libraries loaded by it. */ def = symlook_list(name, hash, &list_main, &defobj, ve, flags, &donelist); + + /* + * We do not distinguish between 'main' object an global scope. + * If symbol is not defined by objects loaded at startup, continue + * search among dynamically loaded objects with RTLD_GLOBAL + * scope. + */ + if (def == NULL) + def = symlook_list(name, hash, &list_global, &defobj, ve, + flags, &donelist); } else { Needed_Entry fake; From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 16:45:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7FC1065676; Tue, 16 Jun 2009 16:45:40 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by mx1.freebsd.org (Postfix) with ESMTP id 229938FC19; Tue, 16 Jun 2009 16:45:40 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KLC008BKBVL5C20@asmtp017.mac.com>; Tue, 16 Jun 2009 09:45:31 -0700 (PDT) Message-id: <22247382-39CF-438A-8B65-C00ECFE196FE@mac.com> From: Marcel Moolenaar To: Ulf Lilleengen In-reply-to: <200906160833.33576.lulf@freebsd.org> Date: Tue, 16 Jun 2009 09:45:21 -0700 References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <4A367A11.4080202@FreeBSD.org> <20090616100938.R25672@delplex.bde.org> <200906160833.33576.lulf@freebsd.org> X-Mailer: Apple Mail (2.935.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 16:45:40 -0000 On Jun 15, 2009, at 11:33 PM, Ulf Lilleengen wrote: > > I'm a bit confused now :) What bde@ said is that 255 is the max number of heads that is supported everywhere. 256 may work but is not always supported. Some web page states that DOS and Windows 95/98 don't support 256 heads(1). (1) http://web.inter.nl.net/hcc/J.Steunebrink/bioslim.htm#4GB -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 17:27:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6E01065719; Tue, 16 Jun 2009 17:27:52 +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 5C5A08FC1A; Tue, 16 Jun 2009 17:27:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 0F67246B90; Tue, 16 Jun 2009 13:27:52 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0F9ED8A073; Tue, 16 Jun 2009 13:27:51 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Date: Tue, 16 Jun 2009 13:17:21 -0400 User-Agent: KMail/1.9.7 References: <200906151618.n5FGIO0o094444@svn.freebsd.org> <200906160833.33576.lulf@freebsd.org> <22247382-39CF-438A-8B65-C00ECFE196FE@mac.com> In-Reply-To: <22247382-39CF-438A-8B65-C00ECFE196FE@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906161317.22430.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 16 Jun 2009 13:27:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Ulf Lilleengen Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 17:27:53 -0000 On Tuesday 16 June 2009 12:45:21 pm Marcel Moolenaar wrote: > > On Jun 15, 2009, at 11:33 PM, Ulf Lilleengen wrote: > > > > I'm a bit confused now :) > > What bde@ said is that 255 is the max number of heads that is > supported everywhere. 256 may work but is not always > supported. Some web page states that DOS and Windows 95/98 > don't support 256 heads(1). > > (1) http://web.inter.nl.net/hcc/J.Steunebrink/bioslim.htm#4GB There was a bug in the BIOS for 2940 Adaptec SCSI controllers IIRC where it would actually hit an internal divide-by-zero bug if it encountered an MBR table with an entry where the head was 255 (it did a + 1 to get the number of heads so it could work out C/H/S the MBR was expecting). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 17:48:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0887106564A; Tue, 16 Jun 2009 17:48:08 +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 ACE088FC16; Tue, 16 Jun 2009 17:48:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GHm8AM035149; Tue, 16 Jun 2009 17:48:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GHm8lE035148; Tue, 16 Jun 2009 17:48:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161748.n5GHm8lE035148@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 17:48: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: r194300 - in head/sys/cddl/contrib/opensolaris: common/atomic/amd64 common/atomic/i386 common/atomic/ia64 common/atomic/sparc64 uts/common/rpc uts/common/zmod X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 17:48:09 -0000 Author: jhb Date: Tue Jun 16 17:48:08 2009 New Revision: 194300 URL: http://svn.freebsd.org/changeset/base/194300 Log: Remove confusing mergeinfo caused by renaming files. Modified: head/sys/cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S (props changed) head/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S (props changed) head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S (props changed) head/sys/cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S (props changed) head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr.c (props changed) head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_array.c (props changed) head/sys/cddl/contrib/opensolaris/uts/common/rpc/opensolaris_xdr_mem.c (props changed) head/sys/cddl/contrib/opensolaris/uts/common/zmod/opensolaris_crc32.c (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 18:58:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D04661065677; Tue, 16 Jun 2009 18:58:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD8DC8FC1B; Tue, 16 Jun 2009 18:58:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GIwoW1040863; Tue, 16 Jun 2009 18:58:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GIwoM8040861; Tue, 16 Jun 2009 18:58:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161858.n5GIwoM8040861@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 18: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: r194303 - 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: Tue, 16 Jun 2009 18:58:51 -0000 Author: jhb Date: Tue Jun 16 18:58:50 2009 New Revision: 194303 URL: http://svn.freebsd.org/changeset/base/194303 Log: - Change members of tcpcb that cache values of ticks from int to u_int: t_rcvtime, t_starttime, t_rtttime, t_bw_rtttime, ts_recent_age, t_badrxtwin. - Change t_recent in struct timewait from u_long to u_int32_t to match the type of the field it shadows from tcpcb: ts_recent. - Change t_starttime in struct timewait from u_long to u_int to match the t_starttime field in tcpcb. Requested by: bde (1, 3) Modified: head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Jun 16 18:22:34 2009 (r194302) +++ head/sys/netinet/tcp_usrreq.c Tue Jun 16 18:58:50 2009 (r194303) @@ -1823,11 +1823,11 @@ db_print_tcpcb(struct tcpcb *tp, const c tp->snd_recover); db_print_indent(indent); - db_printf("t_maxopd: %u t_rcvtime: %d t_startime: %d\n", + db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); - db_printf("t_rttime: %d t_rtsq: 0x%08x t_bw_rtttime: %d\n", + db_printf("t_rttime: %u t_rtsq: 0x%08x t_bw_rtttime: %u\n", tp->t_rtttime, tp->t_rtseq, tp->t_bw_rtttime); db_print_indent(indent); @@ -1854,7 +1854,7 @@ db_print_tcpcb(struct tcpcb *tp, const c tp->snd_scale, tp->rcv_scale, tp->request_r_scale); db_print_indent(indent); - db_printf("ts_recent: %u ts_recent_age: %d\n", + db_printf("ts_recent: %u ts_recent_age: %u\n", tp->ts_recent, tp->ts_recent_age); db_print_indent(indent); @@ -1863,7 +1863,7 @@ db_print_tcpcb(struct tcpcb *tp, const c db_print_indent(indent); db_printf("snd_ssthresh_prev: %lu snd_recover_prev: 0x%08x " - "t_badrxtwin: %d\n", tp->snd_ssthresh_prev, + "t_badrxtwin: %u\n", tp->snd_ssthresh_prev, tp->snd_recover_prev, tp->t_badrxtwin); db_print_indent(indent); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Jun 16 18:22:34 2009 (r194302) +++ head/sys/netinet/tcp_var.h Tue Jun 16 18:58:50 2009 (r194303) @@ -139,12 +139,12 @@ struct tcpcb { u_int t_maxopd; /* mss plus options */ - int t_rcvtime; /* inactivity time */ - int t_starttime; /* time connection was established */ - int t_rtttime; /* round trip time */ + u_int t_rcvtime; /* inactivity time */ + u_int t_starttime; /* time connection was established */ + u_int t_rtttime; /* RTT measurement start time */ tcp_seq t_rtseq; /* sequence number being timed */ - int t_bw_rtttime; /* used for bandwidth calculation */ + u_int t_bw_rtttime; /* used for bandwidth calculation */ tcp_seq t_bw_rtseq; /* used for bandwidth calculation */ int t_rxtcur; /* current retransmit value (ticks) */ @@ -167,7 +167,7 @@ struct tcpcb { u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_int32_t ts_recent; /* timestamp echo data */ - int ts_recent_age; /* when last updated */ + u_int ts_recent_age; /* when last updated */ u_int32_t ts_offset; /* our timestamp offset */ tcp_seq last_ack_sent; @@ -175,7 +175,7 @@ struct tcpcb { u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ - int t_badrxtwin; /* window for retransmit recovery */ + u_int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ int snd_numholes; /* number of holes seen by sender */ @@ -306,9 +306,9 @@ struct tcptw { u_short last_win; /* cached window value */ u_short tw_so_options; /* copy of so_options */ struct ucred *tw_cred; /* user credentials */ - u_long t_recent; + u_int32_t t_recent; u_int32_t ts_offset; /* our timestamp offset */ - u_long t_starttime; + u_int t_starttime; int tw_time; TAILQ_ENTRY(tcptw) tw_2msl; }; From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 19:00:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530E61065674; Tue, 16 Jun 2009 19:00: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 41A638FC18; Tue, 16 Jun 2009 19:00:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GJ0D64040961; Tue, 16 Jun 2009 19:00:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GJ0Dr7040960; Tue, 16 Jun 2009 19:00:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161900.n5GJ0Dr7040960@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 19:00: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: r194304 - 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: Tue, 16 Jun 2009 19:00:13 -0000 Author: jhb Date: Tue Jun 16 19:00:12 2009 New Revision: 194304 URL: http://svn.freebsd.org/changeset/base/194304 Log: Fix edge cases with ticks wrapping from INT_MAX to INT_MIN in the handling of the per-tcpcb t_badtrxtwin. Submitted by: bde Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jun 16 18:58:50 2009 (r194303) +++ head/sys/netinet/tcp_input.c Tue Jun 16 19:00:12 2009 (r194304) @@ -1296,7 +1296,7 @@ tcp_do_segment(struct mbuf *m, struct tc * "bad retransmit" recovery. */ if (tp->t_rxtshift == 1 && - ticks < tp->t_badrxtwin) { + (int)(ticks - tp->t_badrxtwin) < 0) { TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = @@ -2253,7 +2253,7 @@ process_ACK: * original cwnd and ssthresh, and proceed to transmit where * we left off. */ - if (tp->t_rxtshift == 1 && ticks < tp->t_badrxtwin) { + if (tp->t_rxtshift == 1 && (int)(ticks - tp->t_badrxtwin) < 0) { TCPSTAT_INC(tcps_sndrexmitbad); tp->snd_cwnd = tp->snd_cwnd_prev; tp->snd_ssthresh = tp->snd_ssthresh_prev; From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 19:00:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5291065672; Tue, 16 Jun 2009 19:00:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2EDE8FC23; Tue, 16 Jun 2009 19:00:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GJ0mFe041093; Tue, 16 Jun 2009 19:00:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GJ0m2e041091; Tue, 16 Jun 2009 19:00:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906161900.n5GJ0m2e041091@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Jun 2009 19:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194305 - 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: Tue, 16 Jun 2009 19:00:49 -0000 Author: jhb Date: Tue Jun 16 19:00:48 2009 New Revision: 194305 URL: http://svn.freebsd.org/changeset/base/194305 Log: Trim extra sets of ()'s. Requested by: bde Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Jun 16 19:00:12 2009 (r194304) +++ head/sys/netinet/tcp_output.c Tue Jun 16 19:00:48 2009 (r194305) @@ -172,7 +172,7 @@ tcp_output(struct tcpcb *tp) * to send, then transmit; otherwise, investigate further. */ idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una); - if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) { + if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) { /* * We have been idle for "a while" and no acks are * expected to clock out any data we send -- Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Jun 16 19:00:12 2009 (r194304) +++ head/sys/netinet/tcp_timer.c Tue Jun 16 19:00:48 2009 (r194305) @@ -254,7 +254,7 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - (ticks - tp->t_rcvtime) <= tcp_maxidle) + ticks - tp->t_rcvtime <= tcp_maxidle) callout_reset(&tp->t_timers->tt_2msl, tcp_keepintvl, tcp_timer_2msl, tp); else @@ -318,7 +318,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if ((ticks - tp->t_rcvtime) >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) goto dropit; /* * Send a packet designed to force a response @@ -418,8 +418,8 @@ tcp_timer_persist(void *xtp) * backoff that we would use if retransmitting. */ if (tp->t_rxtshift == TCP_MAXRXTSHIFT && - ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle || - (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { + (ticks - tp->t_rcvtime >= tcp_maxpersistidle || + ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { TCPSTAT_INC(tcps_persistdrop); tp = tcp_drop(tp, ETIMEDOUT); goto out; From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 20:20:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F567106564A; Tue, 16 Jun 2009 20:20:00 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id C77EA8FC19; Tue, 16 Jun 2009 20:19:59 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.3/8.14.3) with ESMTP id n5GKJwif061573; Wed, 17 Jun 2009 00:19:58 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Wed, 17 Jun 2009 00:19:58 +0400 (MSD) From: Dmitry Morozovsky To: Alexander Kabaev In-Reply-To: <200906161638.n5GGcsRQ033650@svn.freebsd.org> Message-ID: References: <200906161638.n5GGcsRQ033650@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (woozle.rinet.ru [0.0.0.0]); Wed, 17 Jun 2009 00:19:58 +0400 (MSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r194298 - 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: Tue, 16 Jun 2009 20:20:00 -0000 On Tue, 16 Jun 2009, Alexander Kabaev wrote: AK> Author: kan AK> Date: Tue Jun 16 16:38:54 2009 AK> New Revision: 194298 AK> URL: http://svn.freebsd.org/changeset/base/194298 AK> AK> Log: AK> FreeBSD returns main object handle from dlopen(NULL, ...) calls. AK> dlsym seaches using this handle are expected to look for symbol AK> definitions in all objects loaded at the program start time along AK> with all objects currently in RTLD_GLOBAL scope. AK> AK> Discussed with: kib AK> Reported by: Maho NAKATA AK> MFC after: 2 weeks AK> AK> Modified: AK> head/libexec/rtld-elf/rtld.c AK> AK> Modified: head/libexec/rtld-elf/rtld.c AK> ============================================================================== AK> --- head/libexec/rtld-elf/rtld.c Tue Jun 16 15:30:10 2009 (r194297) AK> +++ head/libexec/rtld-elf/rtld.c Tue Jun 16 16:38:54 2009 (r194298) AK> @@ -2130,6 +2130,16 @@ do_dlsym(void *handle, const char *name, AK> /* Search main program and all libraries loaded by it. */ AK> def = symlook_list(name, hash, &list_main, &defobj, ve, flags, AK> &donelist); AK> + AK> + /* AK> + * We do not distinguish between 'main' object an global scope. ~~~~~~~~~ typo? AK> + * If symbol is not defined by objects loaded at startup, continue AK> + * search among dynamically loaded objects with RTLD_GLOBAL AK> + * scope. AK> + */ AK> + if (def == NULL) AK> + def = symlook_list(name, hash, &list_global, &defobj, ve, AK> + flags, &donelist); AK> } else { AK> Needed_Entry fake; AK> AK> _______________________________________________ AK> svn-src-all@freebsd.org mailing list AK> http://lists.freebsd.org/mailman/listinfo/svn-src-all AK> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" AK> -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 20:55:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3B1106564A; Tue, 16 Jun 2009 20:55:27 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from k7.mavetju.org (ppp113-58.static.internode.on.net [150.101.113.58]) by mx1.freebsd.org (Postfix) with ESMTP id E9E6D8FC14; Tue, 16 Jun 2009 20:55:26 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by k7.mavetju.org (Postfix, from userid 1001) id B0261450D1; Wed, 17 Jun 2009 06:55:25 +1000 (EST) Date: Wed, 17 Jun 2009 06:55:25 +1000 From: Edwin Groothuis To: "N.J. Mann" Message-ID: <20090616205525.GA24536@mavetju.org> References: <200906161209.n5GC9Coq026808@svn.freebsd.org> <20090616132705.GA62514@titania.njm.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090616132705.GA62514@titania.njm.me.uk> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r194286 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 20:55:27 -0000 > > + case $a2 iin > ^^^ > in? Fixed, thanks! Edwin -- Edwin Groothuis Website: http://www.mavetju.org/ edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/ From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 20:58:25 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EB9F1065673; Tue, 16 Jun 2009 20:58:25 +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 A196A8FC12; Tue, 16 Jun 2009 20:58:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id n5GKudvi092182; Tue, 16 Jun 2009 14:56:39 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 16 Jun 2009 14:57:03 -0600 (MDT) Message-Id: <20090616.145703.1670762949.imp@bsdimp.com> To: brde@optusnet.com.au From: "M. Warner Losh" In-Reply-To: <20090616100938.R25672@delplex.bde.org> References: <4931048A-B398-4957-B0B2-5B8BC0810F44@mac.com> <4A367A11.4080202@FreeBSD.org> <20090616100938.R25672@delplex.bde.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, xcllnt@mac.com, src-committers@FreeBSD.org, ulf.lilleengen@gmail.com Subject: Re: svn commit: r194241 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 20:58:25 -0000 In message: <20090616100938.R25672@delplex.bde.org> Bruce Evans writes: : > Aha, so I should fix fdisk too then. Thanks. : : Please don't break fdisk too. There must be a way to set valid but : dangerous values, or theoretically invalid but practically working : values, if they are representable and are needed for compatibility. Yes. There's many versions of Linux that are difficult to co-exist with because the sanity checks choke on the values that Linux used... Warner From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 22:45:36 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA43F10657B4; Tue, 16 Jun 2009 22:45:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1347B8FC13; Tue, 16 Jun 2009 22:45:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GMjXKT054338; Tue, 16 Jun 2009 22:45:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GMjXPZ054337; Tue, 16 Jun 2009 22:45:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906162245.n5GMjXPZ054337@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 16 Jun 2009 22:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194310 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 22:45:37 -0000 Author: edwin Date: Tue Jun 16 22:45:33 2009 New Revision: 194310 URL: http://svn.freebsd.org/changeset/base/194310 Log: iiin -> in Submitted by: "N.J. Mann" Modified: head/tools/tools/nanobsd/FlashDevice.sub Modified: head/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 22:39:57 2009 (r194309) +++ head/tools/tools/nanobsd/FlashDevice.sub Tue Jun 16 22:45:33 2009 (r194310) @@ -70,7 +70,7 @@ sub_FlashDevice () { ;; kodak) # Source: mwlucas@FreeBSD.org - case $a2 iin + case $a2 in 64|64mb) NANO_MEDIASIZE=`expr expr 64487424 / 512` NANO_HEADS=4 From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 23:00:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0C54106564A; Tue, 16 Jun 2009 23:00:26 +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 8F6088FC14; Tue, 16 Jun 2009 23:00:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GN0QdN054770; Tue, 16 Jun 2009 23:00:26 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GN0QKF054768; Tue, 16 Jun 2009 23:00:26 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906162300.n5GN0QKF054768@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 16 Jun 2009 23: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: r194312 - head/sys/modules/acpi/acpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 23:00:27 -0000 Author: jkim Date: Tue Jun 16 23:00:26 2009 New Revision: 194312 URL: http://svn.freebsd.org/changeset/base/194312 Log: Sync acpi(4) kld module Makefile with conf/options. Modified: head/sys/modules/acpi/acpi/Makefile Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Tue Jun 16 22:55:10 2009 (r194311) +++ head/sys/modules/acpi/acpi/Makefile Tue Jun 16 23:00:26 2009 (r194312) @@ -79,12 +79,12 @@ DBSRC+= dmresrcs.c dmutils.c dmwalk.c .if KTR CFLAGS+=-DKTR .endif +.if ACPI_MAX_TASKS +CFLAGS+=-DACPI_MAX_TASKS +.endif .if ACPI_MAX_THREADS CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_THREADS} .endif -.if ACPI_NO_SEMAPHORES -CFLAGS+=-DACPI_NO_SEMAPHORES -.endif .if ACPI_DEBUG CFLAGS+=-DACPI_DEBUG SRCS+= ${DBSRC} From owner-svn-src-head@FreeBSD.ORG Tue Jun 16 23:02:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE75A106566C; Tue, 16 Jun 2009 23:02: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 AD78E8FC21; Tue, 16 Jun 2009 23:02:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GN2kmt054852; Tue, 16 Jun 2009 23:02:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5GN2kOf054850; Tue, 16 Jun 2009 23:02:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200906162302.n5GN2kOf054850@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 16 Jun 2009 23:02: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: r194313 - head/sys/modules/acpi/acpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 16 Jun 2009 23:02:47 -0000 Author: jkim Date: Tue Jun 16 23:02:46 2009 New Revision: 194313 URL: http://svn.freebsd.org/changeset/base/194313 Log: Fix a typo from the previous commit. Modified: head/sys/modules/acpi/acpi/Makefile Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Tue Jun 16 23:00:26 2009 (r194312) +++ head/sys/modules/acpi/acpi/Makefile Tue Jun 16 23:02:46 2009 (r194313) @@ -80,7 +80,7 @@ DBSRC+= dmresrcs.c dmutils.c dmwalk.c CFLAGS+=-DKTR .endif .if ACPI_MAX_TASKS -CFLAGS+=-DACPI_MAX_TASKS +CFLAGS+=-DACPI_MAX_TASKS=${ACPI_MAX_TASKS} .endif .if ACPI_MAX_THREADS CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_THREADS} From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 01:55:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3000D106566B; Wed, 17 Jun 2009 01:55:43 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BCC78FC13; Wed, 17 Jun 2009 01:55:43 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H1thLj058655; Wed, 17 Jun 2009 01:55:43 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H1tgQO058649; Wed, 17 Jun 2009 01:55:43 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200906170155.n5H1tgQO058649@svn.freebsd.org> From: Attilio Rao Date: Wed, 17 Jun 2009 01:55: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: r194317 - in head: . share/man/man9 sys/conf sys/kern sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 01:55:43 -0000 Author: attilio Date: Wed Jun 17 01:55:42 2009 New Revision: 194317 URL: http://svn.freebsd.org/changeset/base/194317 Log: Introduce support for adaptive spinning in lockmgr. Actually, as it did receive few tuning, the support is disabled by default, but it can opt-in with the option ADAPTIVE_LOCKMGRS. Due to the nature of lockmgrs, adaptive spinning needs to be selectively enabled for any interested lockmgr. The support is bi-directional, or, in other ways, it will work in both cases if the lock is held in read or write way. In particular, the read path is passible of further tunning using the sysctls debug.lockmgr.retries and debug.lockmgr.loops . Ideally, such sysctls should be axed or compiled out before release. Addictionally note that adaptive spinning doesn't cope well with LK_SLEEPFAIL. The reason is that many (and probabilly all) consumers of LK_SLEEPFAIL are mainly interested in knowing if the interlock was dropped or not in order to reacquire it and re-test initial conditions. This directly interacts with adaptive spinning because lockmgr needs to drop the interlock while spinning in order to avoid a deadlock (further details in the comments inside the patch). Final note: finding someone willing to help on tuning this with relevant workloads would be either very important and appreciated. Tested by: jeff, pho Requested by: many Modified: head/UPDATING head/share/man/man9/lock.9 head/sys/conf/options head/sys/kern/kern_lock.c head/sys/sys/lockmgr.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jun 17 00:35:21 2009 (r194316) +++ head/UPDATING Wed Jun 17 01:55:42 2009 (r194317) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090616: + The compiling option ADAPTIVE_LOCKMGRS has been introduced. + This option compiles in the support for adaptive spinning for lockmgrs + which want to enable it. The lockinit() function now accepts the + flag LK_ADAPTIVE in order to make the lock object subject to + adaptive spinning when both held in write and read mode. + 20090613: The layout of the structure returned by IEEE80211_IOC_STA_INFO has changed. User applications that use this ioctl need to be Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Wed Jun 17 00:35:21 2009 (r194316) +++ head/share/man/man9/lock.9 Wed Jun 17 01:55:42 2009 (r194317) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 05, 2009 +.Dd June 16, 2009 .Dt LOCK 9 .Os .Sh NAME @@ -96,6 +96,9 @@ The timeout value passed to .It Fa flags The flags the lock is to be initialized with: .Bl -tag -width ".Dv LK_CANRECURSE" +.It Dv LK_ADAPTIVE +Enable adaptive spinning for this lock if the kernel is compiled with the +ADAPTIVE_LOCKMGRS option. .It Dv LK_CANRECURSE Allow recursive exclusive locks. .It Dv LK_NOPROFILE Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jun 17 00:35:21 2009 (r194316) +++ head/sys/conf/options Wed Jun 17 01:55:42 2009 (r194317) @@ -60,6 +60,7 @@ KDB_UNATTENDED opt_kdb.h SYSCTL_DEBUG opt_sysctl.h # Miscellaneous options. +ADAPTIVE_LOCKMGRS ALQ AUDIT opt_global.h CODA_COMPAT_5 opt_coda.h Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Wed Jun 17 00:35:21 2009 (r194316) +++ head/sys/kern/kern_lock.c Wed Jun 17 01:55:42 2009 (r194317) @@ -26,6 +26,7 @@ * DAMAGE. */ +#include "opt_adaptive_lockmgrs.h" #include "opt_ddb.h" #include "opt_kdtrace.h" @@ -34,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -43,6 +45,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_LOCKS #include #endif +#include #include #include @@ -51,7 +54,10 @@ __FBSDID("$FreeBSD$"); #include #endif -CTASSERT((LK_NOSHARE & LO_CLASSFLAGS) == LK_NOSHARE); +CTASSERT(((LK_ADAPTIVE | LK_NOSHARE) & LO_CLASSFLAGS) == + (LK_ADAPTIVE | LK_NOSHARE)); +CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & + ~(LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS))); #define SQ_EXCLUSIVE_QUEUE 0 #define SQ_SHARED_QUEUE 1 @@ -106,6 +112,7 @@ CTASSERT((LK_NOSHARE & LO_CLASSFLAGS) == #define LK_CAN_SHARE(x) \ (((x) & LK_SHARE) && (((x) & LK_EXCLUSIVE_WAITERS) == 0 || \ + ((x) & LK_EXCLUSIVE_SPINNERS) == 0 || \ curthread->td_lk_slocks || (curthread->td_pflags & TDP_DEADLKTREAT))) #define LK_TRYOP(x) \ ((x) & LK_NOWAIT) @@ -115,6 +122,10 @@ CTASSERT((LK_NOSHARE & LO_CLASSFLAGS) == #define LK_TRYWIT(x) \ (LK_TRYOP(x) ? LOP_TRYLOCK : 0) +#define LK_CAN_ADAPT(lk, f) \ + (((lk)->lock_object.lo_flags & LK_ADAPTIVE) != 0 && \ + ((f) & LK_SLEEPFAIL) == 0) + #define lockmgr_disowned(lk) \ (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == LK_KERNPROC) @@ -145,6 +156,14 @@ struct lock_class lock_class_lockmgr = { #endif }; +#ifdef ADAPTIVE_LOCKMGRS +static u_int alk_retries = 10; +static u_int alk_loops = 10000; +SYSCTL_NODE(_debug, OID_AUTO, lockmgr, CTLFLAG_RD, NULL, "lockmgr debugging"); +SYSCTL_UINT(_debug_lockmgr, OID_AUTO, retries, CTLFLAG_RW, &alk_retries, 0, ""); +SYSCTL_UINT(_debug_lockmgr, OID_AUTO, loops, CTLFLAG_RW, &alk_loops, 0, ""); +#endif + static __inline struct thread * lockmgr_xholder(struct lock *lk) { @@ -233,9 +252,9 @@ wakeupshlk(struct lock *lk, const char * * lock quickly. */ if ((x & LK_ALL_WAITERS) == 0) { - MPASS(x == LK_SHARERS_LOCK(1)); - if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1), - LK_UNLOCKED)) + MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == + LK_SHARERS_LOCK(1)); + if (atomic_cmpset_ptr(&lk->lk_lock, x, LK_UNLOCKED)) break; continue; } @@ -245,7 +264,7 @@ wakeupshlk(struct lock *lk, const char * * path in order to handle wakeups correctly. */ sleepq_lock(&lk->lock_object); - x = lk->lk_lock & LK_ALL_WAITERS; + x = lk->lk_lock & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); v = LK_UNLOCKED; /* @@ -256,7 +275,8 @@ wakeupshlk(struct lock *lk, const char * queue = SQ_EXCLUSIVE_QUEUE; v |= (x & LK_SHARED_WAITERS); } else { - MPASS(x == LK_SHARED_WAITERS); + MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == + LK_SHARED_WAITERS); queue = SQ_SHARED_QUEUE; } @@ -326,7 +346,7 @@ lockinit(struct lock *lk, int pri, const iflags |= LO_WITNESS; if (flags & LK_QUIET) iflags |= LO_QUIET; - iflags |= flags & LK_NOSHARE; + iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE); lk->lk_lock = LK_UNLOCKED; lk->lk_recurse = 0; @@ -359,6 +379,10 @@ __lockmgr_args(struct lock *lk, u_int fl uint64_t waittime = 0; int contested = 0; #endif +#ifdef ADAPTIVE_LOCKMGRS + volatile struct thread *owner; + u_int i, spintries = 0; +#endif error = 0; tid = (uintptr_t)curthread; @@ -436,6 +460,59 @@ __lockmgr_args(struct lock *lk, u_int fl break; } +#ifdef ADAPTIVE_LOCKMGRS + /* + * If the owner is running on another CPU, spin until + * the owner stops running or the state of the lock + * changes. + */ + if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && + LK_HOLDER(x) != LK_KERNPROC) { + owner = (struct thread *)LK_HOLDER(x); + if (LOCK_LOG_TEST(&lk->lock_object, 0)) + CTR3(KTR_LOCK, + "%s: spinning on %p held by %p", + __func__, lk, owner); + + /* + * If we are holding also an interlock drop it + * in order to avoid a deadlock if the lockmgr + * owner is adaptively spinning on the + * interlock itself. + */ + if (flags & LK_INTERLOCK) { + class->lc_unlock(ilk); + flags &= ~LK_INTERLOCK; + } + GIANT_SAVE(); + while (LK_HOLDER(lk->lk_lock) == + (uintptr_t)owner && TD_IS_RUNNING(owner)) + cpu_spinwait(); + } else if (LK_CAN_ADAPT(lk, flags) && + (x & LK_SHARE) !=0 && LK_SHARERS(x) && + spintries < alk_retries) { + if (flags & LK_INTERLOCK) { + class->lc_unlock(ilk); + flags &= ~LK_INTERLOCK; + } + GIANT_SAVE(); + spintries++; + for (i = 0; i < alk_loops; i++) { + if (LOCK_LOG_TEST(&lk->lock_object, 0)) + CTR4(KTR_LOCK, + "%s: shared spinning on %p with %u and %u", + __func__, lk, spintries, i); + x = lk->lk_lock; + if ((x & LK_SHARE) == 0 || + LK_CAN_SHARE(x) != 0) + break; + cpu_spinwait(); + } + if (i != alk_loops) + continue; + } +#endif + /* * Acquire the sleepqueue chain lock because we * probabilly will need to manipulate waiters flags. @@ -452,6 +529,24 @@ __lockmgr_args(struct lock *lk, u_int fl continue; } +#ifdef ADAPTIVE_LOCKMGRS + /* + * The current lock owner might have started executing + * on another CPU (or the lock could have changed + * owner) while we were waiting on the turnstile + * chain lock. If so, drop the turnstile lock and try + * again. + */ + if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && + LK_HOLDER(x) != LK_KERNPROC) { + owner = (struct thread *)LK_HOLDER(x); + if (TD_IS_RUNNING(owner)) { + sleepq_release(&lk->lock_object); + continue; + } + } +#endif + /* * Try to set the LK_SHARED_WAITERS flag. If we fail, * loop back and retry. @@ -497,13 +592,15 @@ __lockmgr_args(struct lock *lk, u_int fl break; case LK_UPGRADE: _lockmgr_assert(lk, KA_SLOCKED, file, line); - x = lk->lk_lock & LK_ALL_WAITERS; + v = lk->lk_lock; + x = v & LK_ALL_WAITERS; + v &= LK_EXCLUSIVE_SPINNERS; /* * Try to switch from one shared lock to an exclusive one. * We need to preserve waiters flags during the operation. */ - if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x, + if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, tid | x)) { LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, line); @@ -575,13 +672,69 @@ __lockmgr_args(struct lock *lk, u_int fl break; } +#ifdef ADAPTIVE_LOCKMGRS + /* + * If the owner is running on another CPU, spin until + * the owner stops running or the state of the lock + * changes. + */ + x = lk->lk_lock; + if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && + LK_HOLDER(x) != LK_KERNPROC) { + owner = (struct thread *)LK_HOLDER(x); + if (LOCK_LOG_TEST(&lk->lock_object, 0)) + CTR3(KTR_LOCK, + "%s: spinning on %p held by %p", + __func__, lk, owner); + + /* + * If we are holding also an interlock drop it + * in order to avoid a deadlock if the lockmgr + * owner is adaptively spinning on the + * interlock itself. + */ + if (flags & LK_INTERLOCK) { + class->lc_unlock(ilk); + flags &= ~LK_INTERLOCK; + } + GIANT_SAVE(); + while (LK_HOLDER(lk->lk_lock) == + (uintptr_t)owner && TD_IS_RUNNING(owner)) + cpu_spinwait(); + } else if (LK_CAN_ADAPT(lk, flags) && + (x & LK_SHARE) != 0 && LK_SHARERS(x) && + spintries < alk_retries) { + if ((x & LK_EXCLUSIVE_SPINNERS) == 0 && + !atomic_cmpset_ptr(&lk->lk_lock, x, + x | LK_EXCLUSIVE_SPINNERS)) + continue; + if (flags & LK_INTERLOCK) { + class->lc_unlock(ilk); + flags &= ~LK_INTERLOCK; + } + GIANT_SAVE(); + spintries++; + for (i = 0; i < alk_loops; i++) { + if (LOCK_LOG_TEST(&lk->lock_object, 0)) + CTR4(KTR_LOCK, + "%s: shared spinning on %p with %u and %u", + __func__, lk, spintries, i); + if ((lk->lk_lock & + LK_EXCLUSIVE_SPINNERS) == 0) + break; + cpu_spinwait(); + } + if (i != alk_loops) + continue; + } +#endif + /* * Acquire the sleepqueue chain lock because we * probabilly will need to manipulate waiters flags. */ sleepq_lock(&lk->lock_object); x = lk->lk_lock; - v = x & LK_ALL_WAITERS; /* * if the lock has been released while we spun on @@ -592,6 +745,24 @@ __lockmgr_args(struct lock *lk, u_int fl continue; } +#ifdef ADAPTIVE_LOCKMGRS + /* + * The current lock owner might have started executing + * on another CPU (or the lock could have changed + * owner) while we were waiting on the turnstile + * chain lock. If so, drop the turnstile lock and try + * again. + */ + if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && + LK_HOLDER(x) != LK_KERNPROC) { + owner = (struct thread *)LK_HOLDER(x); + if (TD_IS_RUNNING(owner)) { + sleepq_release(&lk->lock_object); + continue; + } + } +#endif + /* * The lock can be in the state where there is a * pending queue of waiters, but still no owner. @@ -601,7 +772,9 @@ __lockmgr_args(struct lock *lk, u_int fl * claim lock ownership and return, preserving waiters * flags. */ - if (x == (LK_UNLOCKED | v)) { + v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); + if ((x & ~v) == LK_UNLOCKED) { + v &= ~LK_EXCLUSIVE_SPINNERS; if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, tid | v)) { sleepq_release(&lk->lock_object); @@ -666,7 +839,9 @@ __lockmgr_args(struct lock *lk, u_int fl * In order to preserve waiters flags, just spin. */ for (;;) { - x = lk->lk_lock & LK_ALL_WAITERS; + x = lk->lk_lock; + MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); + x &= LK_ALL_WAITERS; if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid | x, LK_SHARERS_LOCK(1) | x)) break; @@ -712,7 +887,7 @@ __lockmgr_args(struct lock *lk, u_int fl break; sleepq_lock(&lk->lock_object); - x = lk->lk_lock & LK_ALL_WAITERS; + x = lk->lk_lock; v = LK_UNLOCKED; /* @@ -720,11 +895,13 @@ __lockmgr_args(struct lock *lk, u_int fl * preference in order to avoid deadlock with * shared runners up. */ + MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); if (x & LK_EXCLUSIVE_WAITERS) { queue = SQ_EXCLUSIVE_QUEUE; v |= (x & LK_SHARED_WAITERS); } else { - MPASS(x == LK_SHARED_WAITERS); + MPASS((x & LK_ALL_WAITERS) == + LK_SHARED_WAITERS); queue = SQ_SHARED_QUEUE; } @@ -777,7 +954,6 @@ __lockmgr_args(struct lock *lk, u_int fl */ sleepq_lock(&lk->lock_object); x = lk->lk_lock; - v = x & LK_ALL_WAITERS; /* * if the lock has been released while we spun on @@ -788,8 +964,9 @@ __lockmgr_args(struct lock *lk, u_int fl continue; } - if (x == (LK_UNLOCKED | v)) { - v = x; + v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); + if ((x & ~v) == LK_UNLOCKED) { + v = (x & ~LK_EXCLUSIVE_SPINNERS); if (v & LK_EXCLUSIVE_WAITERS) { queue = SQ_EXCLUSIVE_QUEUE; v &= ~LK_EXCLUSIVE_WAITERS; @@ -902,7 +1079,9 @@ _lockmgr_disown(struct lock *lk, const c * In order to preserve waiters flags, just spin. */ for (;;) { - x = lk->lk_lock & LK_ALL_WAITERS; + x = lk->lk_lock; + MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); + x &= LK_ALL_WAITERS; if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid | x, LK_KERNPROC | x)) return; @@ -933,6 +1112,8 @@ lockmgr_printinfo(struct lock *lk) printf(" with exclusive waiters pending\n"); if (x & LK_SHARED_WAITERS) printf(" with shared waiters pending\n"); + if (x & LK_EXCLUSIVE_SPINNERS) + printf(" with exclusive spinners pending\n"); STACK_PRINT(lk); } @@ -1094,5 +1275,10 @@ db_show_lockmgr(struct lock_object *lock default: db_printf("none\n"); } + db_printf(" spinners: "); + if (lk->lk_lock & LK_EXCLUSIVE_SPINNERS) + db_printf("exclusive\n"); + else + db_printf("none\n"); } #endif Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Wed Jun 17 00:35:21 2009 (r194316) +++ head/sys/sys/lockmgr.h Wed Jun 17 01:55:42 2009 (r194317) @@ -39,13 +39,14 @@ #define LK_SHARE 0x01 #define LK_SHARED_WAITERS 0x02 #define LK_EXCLUSIVE_WAITERS 0x04 +#define LK_EXCLUSIVE_SPINNERS 0x08 #define LK_ALL_WAITERS \ (LK_SHARED_WAITERS | LK_EXCLUSIVE_WAITERS) #define LK_FLAGMASK \ - (LK_SHARE | LK_ALL_WAITERS) + (LK_SHARE | LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS) #define LK_HOLDER(x) ((x) & ~LK_FLAGMASK) -#define LK_SHARERS_SHIFT 3 +#define LK_SHARERS_SHIFT 4 #define LK_SHARERS(x) (LK_HOLDER(x) >> LK_SHARERS_SHIFT) #define LK_SHARERS_LOCK(x) ((x) << LK_SHARERS_SHIFT | LK_SHARE) #define LK_ONE_SHARER (1 << LK_SHARERS_SHIFT) @@ -141,6 +142,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_NOSHARE 0x000008 #define LK_NOWITNESS 0x000010 #define LK_QUIET 0x000020 +#define LK_ADAPTIVE 0x000040 /* * Additional attributes to be used in lockmgr(). From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 02:42:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B54EE106564A; Wed, 17 Jun 2009 02:42:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id CF4078FC17; Wed, 17 Jun 2009 02:41:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5H2fsVb014510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Jun 2009 12:41:55 +1000 Date: Wed, 17 Jun 2009 12:41:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <200906161858.n5GIwoM8040861@svn.freebsd.org> Message-ID: <20090617124103.P1530@besplex.bde.org> References: <200906161858.n5GIwoM8040861@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: r194303 - 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: Wed, 17 Jun 2009 02:42:01 -0000 On Tue, 16 Jun 2009, John Baldwin wrote: > Author: jhb > Date: Tue Jun 16 18:58:50 2009 > New Revision: 194303 > URL: http://svn.freebsd.org/changeset/base/194303 > > Log: > - Change members of tcpcb that cache values of ticks from int to u_int: > t_rcvtime, t_starttime, t_rtttime, t_bw_rtttime, ts_recent_age, > t_badrxtwin. > - Change t_recent in struct timewait from u_long to u_int32_t to match > the type of the field it shadows from tcpcb: ts_recent. > - Change t_starttime in struct timewait from u_long to u_int to match > the t_starttime field in tcpcb. > > Requested by: bde (1, 3) Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 02:51:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10A13106564A; Wed, 17 Jun 2009 02:51:17 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD4D88FC14; Wed, 17 Jun 2009 02:51:16 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H2pGGk059855; Wed, 17 Jun 2009 02:51:16 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H2pGLg059852; Wed, 17 Jun 2009 02:51:16 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906170251.n5H2pGLg059852@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 02:51: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: r194319 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 02:51:17 -0000 Author: sam Date: Wed Jun 17 02:51:16 2009 New Revision: 194319 URL: http://svn.freebsd.org/changeset/base/194319 Log: add ixp4xx_write_feature_bits Modified: head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/ixp425/ixp425var.h Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Wed Jun 17 02:20:26 2009 (r194318) +++ head/sys/arm/xscale/ixp425/ixp425.c Wed Jun 17 02:51:16 2009 (r194319) @@ -85,6 +85,12 @@ ixp4xx_read_feature_bits(void) return bits; } +void +ixp4xx_write_feature_bits(uint32_t v) +{ + IXPREG(IXP425_EXP_VBASE + EXP_FCTRL_OFFSET) = ~v; +} + struct arm32_dma_range * bus_dma_get_range(void) { Modified: head/sys/arm/xscale/ixp425/ixp425var.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425var.h Wed Jun 17 02:20:26 2009 (r194318) +++ head/sys/arm/xscale/ixp425/ixp425var.h Wed Jun 17 02:51:16 2009 (r194319) @@ -101,6 +101,7 @@ void ixp425_mem_bs_init(bus_space_tag_t, uint32_t ixp425_sdram_size(void); uint32_t ixp435_ddram_size(void); uint32_t ixp4xx_read_feature_bits(void); +void ixp4xx_write_feature_bits(uint32_t); int ixp425_md_route_interrupt(device_t, device_t, int); void ixp425_md_attach(device_t); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 02:53:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9C351065674; Wed, 17 Jun 2009 02:53:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7CCB8FC19; Wed, 17 Jun 2009 02:53:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H2r5bW059982; Wed, 17 Jun 2009 02:53:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H2r5Tc059980; Wed, 17 Jun 2009 02:53:05 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906170253.n5H2r5Tc059980@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 02:53: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: r194321 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 02:53:06 -0000 Author: sam Date: Wed Jun 17 02:53:05 2009 New Revision: 194321 URL: http://svn.freebsd.org/changeset/base/194321 Log: o correct default miibase for NPE-B and NPE-C; these values are normally taken from the hints file so this should have no effect o set the port address "just in case" o add NPE-A support to the tx done qmgr callback Modified: head/sys/arm/xscale/ixp425/if_npe.c Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Wed Jun 17 02:52:35 2009 (r194320) +++ head/sys/arm/xscale/ixp425/if_npe.c Wed Jun 17 02:53:05 2009 (r194321) @@ -153,9 +153,9 @@ struct npe_softc { * multi-port processing. It may be better to handle * all traffic through one Q (as done by the Intel drivers). * - * Note that the PHY's are accessible only from MAC A - * on the IXP425. This and other platform-specific - * assumptions probably need to be handled through hints. + * Note that the PHY's are accessible only from MAC B on the + * IXP425 and from MAC C on other devices. This and other + * platform-specific assumptions are handled with hints. */ static const struct { uint32_t macbase; @@ -177,7 +177,7 @@ static const struct { }, [NPE_B] = { .macbase = IXP425_MAC_B_HWBASE, - .miibase = IXP425_MAC_C_HWBASE, + .miibase = IXP425_MAC_B_HWBASE, .phy = 0, .rx_qid = 4, .rx_freeqid = 27, @@ -186,7 +186,7 @@ static const struct { }, [NPE_C] = { .macbase = IXP425_MAC_C_HWBASE, - .miibase = IXP425_MAC_C_HWBASE, + .miibase = IXP425_MAC_B_HWBASE, .phy = 1, .rx_qid = 12, .rx_freeqid = 28, @@ -239,6 +239,7 @@ static int npeioctl(struct ifnet * ifp, static int npe_setrxqosentry(struct npe_softc *, int classix, int trafclass, int qid); +static int npe_setportaddress(struct npe_softc *, const uint8_t mac[]); static int npe_setfirewallmode(struct npe_softc *, int onoff); static int npe_updatestats(struct npe_softc *); #if 0 @@ -666,7 +667,7 @@ npe_mac_reset(struct npe_softc *sc) static int npe_activate(device_t dev) { - struct npe_softc * sc = device_get_softc(dev); + struct npe_softc *sc = device_get_softc(dev); int error, i, macbase, miibase; /* @@ -1024,7 +1025,7 @@ npe_txdone(int qid, void *arg) struct txdone *td, q[NPE_MAX]; uint32_t entry; - /* XXX no NPE-A support */ + q[NPE_A].tail = &q[NPE_A].head; q[NPE_A].count = 0; q[NPE_B].tail = &q[NPE_B].head; q[NPE_B].count = 0; q[NPE_C].tail = &q[NPE_C].head; q[NPE_C].count = 0; /* XXX max # at a time? */ @@ -1043,6 +1044,8 @@ npe_txdone(int qid, void *arg) td->count++; } + if (q[NPE_A].count) + npe_txdone_finish(npes[NPE_A], &q[NPE_A]); if (q[NPE_B].count) npe_txdone_finish(npes[NPE_B], &q[NPE_B]); if (q[NPE_C].count) @@ -1252,6 +1255,7 @@ if (ifp->if_drv_flags & IFF_DRV_RUNNING) WR4(sc, NPE_MAC_RX_CNTRL2, 0); npe_setmac(sc, IF_LLADDR(ifp)); + npe_setportaddress(sc, IF_LLADDR(ifp)); npe_setmcast(sc); npe_startxmit(sc); @@ -1552,6 +1556,22 @@ npe_setrxqosentry(struct npe_softc *sc, } static int +npe_setportaddress(struct npe_softc *sc, const uint8_t mac[ETHER_ADDR_LEN]) +{ + uint32_t msg[2]; + + msg[0] = (NPE_SETPORTADDRESS << 24) + | (sc->sc_npeid << 20) + | (mac[0] << 8) + | (mac[1] << 0); + msg[1] = (mac[2] << 24) + | (mac[3] << 16) + | (mac[4] << 8) + | (mac[5] << 0); + return ixpnpe_sendandrecvmsg_sync(sc->sc_npe, msg, msg); +} + +static int npe_setfirewallmode(struct npe_softc *sc, int onoff) { uint32_t msg[2]; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 02:55:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 273E2106564A; Wed, 17 Jun 2009 02:55:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F238FC15; Wed, 17 Jun 2009 02:55:54 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H2trLe060086; Wed, 17 Jun 2009 02:55:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H2trDa060084; Wed, 17 Jun 2009 02:55:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906170255.n5H2trDa060084@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 02:55: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: r194322 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 02:55:54 -0000 Author: sam Date: Wed Jun 17 02:55:53 2009 New Revision: 194322 URL: http://svn.freebsd.org/changeset/base/194322 Log: remove IAL vestige for defining the max data/instruction memory size; instead of defining them according to ixp46x add new defines so we can do this at run time Modified: head/sys/arm/xscale/ixp425/ixp425_npereg.h Modified: head/sys/arm/xscale/ixp425/ixp425_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed Jun 17 02:53:05 2009 (r194321) +++ head/sys/arm/xscale/ixp425/ixp425_npereg.h Wed Jun 17 02:55:53 2009 (r194322) @@ -95,7 +95,6 @@ /* * Instruction and Data Memory Size (in words) for each NPE */ -#ifndef __ixp46X #define IX_NPEDL_INS_MEMSIZE_WORDS_NPEA 4096 #define IX_NPEDL_INS_MEMSIZE_WORDS_NPEB 2048 #define IX_NPEDL_INS_MEMSIZE_WORDS_NPEC 2048 @@ -103,15 +102,9 @@ #define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEA 2048 #define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEB 2048 #define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEC 2048 -#else -#define IX_NPEDL_INS_MEMSIZE_WORDS_NPEA 4096 -#define IX_NPEDL_INS_MEMSIZE_WORDS_NPEB 4096 -#define IX_NPEDL_INS_MEMSIZE_WORDS_NPEC 4096 -#define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEA 4096 -#define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEB 4096 -#define IX_NPEDL_DATA_MEMSIZE_WORDS_NPEC 4096 -#endif +#define IXP46X_NPEDL_INS_MEMSIZE_WORDS 4096 +#define IXP46X_NPEDL_DATA_MEMSIZE_WORDS 4096 /* BAR offsets */ #define IX_NPEDL_REG_OFFSET_EXAD 0x00000000 /* Execution Address */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 03:09:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BAA106564A; Wed, 17 Jun 2009 03:09:14 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E329F8FC16; Wed, 17 Jun 2009 03:09:13 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H39D53060685; Wed, 17 Jun 2009 03:09:13 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H39Drr060683; Wed, 17 Jun 2009 03:09:13 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906170309.n5H39Drr060683@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 03:09: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: r194325 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 03:09:14 -0000 Author: sam Date: Wed Jun 17 03:09:13 2009 New Revision: 194325 URL: http://svn.freebsd.org/changeset/base/194325 Log: correct data/instruction memory sizes for non-ixp425 parts (these are only used to bounds-check writes when loading firmware) Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Jun 17 03:08:55 2009 (r194324) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Jun 17 03:09:13 2009 (r194325) @@ -306,8 +306,14 @@ ixpnpe_attach(device_t dev, int npeid) sc->sc_nrefs = 1; sc->sc_size = config->size; - sc->insMemSize = config->ins_memsize; /* size of instruction memory */ - sc->dataMemSize = config->data_memsize; /* size of data memory */ + if (cpu_is_ixp42x()) { + /* NB: instruction/data memory sizes are NPE-dependent */ + sc->insMemSize = config->ins_memsize; + sc->dataMemSize = config->data_memsize; + } else { + sc->insMemSize = IXP46X_NPEDL_INS_MEMSIZE_WORDS; + sc->dataMemSize = IXP46X_NPEDL_DATA_MEMSIZE_WORDS; + } if (bus_space_map(sc->sc_iot, config->base, sc->sc_size, 0, &sc->sc_ioh)) panic("%s: Cannot map registers", device_get_name(dev)); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 04:15:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C7961065675; Wed, 17 Jun 2009 04:15:20 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABC98FC1B; Wed, 17 Jun 2009 04:15:20 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H4FJdk062183; Wed, 17 Jun 2009 04:15:19 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H4FJpd062181; Wed, 17 Jun 2009 04:15:19 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906170415.n5H4FJpd062181@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 17 Jun 2009 04:15: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: r194329 - head/sys/dev/usb/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 04:15:20 -0000 Author: weongyo Date: Wed Jun 17 04:15:19 2009 New Revision: 194329 URL: http://svn.freebsd.org/changeset/base/194329 Log: reorders the sequence when the device is detached. After detaching the interface is completed then it'll process other parts to avoid a race condition. Pointed by: jhb Modified: head/sys/dev/usb/wlan/if_uath.c Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Wed Jun 17 03:29:00 2009 (r194328) +++ head/sys/dev/usb/wlan/if_uath.c Wed Jun 17 04:15:19 2009 (r194329) @@ -513,14 +513,17 @@ uath_detach(device_t dev) if (!device_is_attached(dev)) return (0); + UATH_LOCK(sc); sc->sc_flags |= UATH_FLAG_INVALID; + UATH_UNLOCK(sc); + + ieee80211_ifdetach(ic); uath_stop(ifp); callout_drain(&sc->stat_ch); callout_drain(&sc->watchdog_ch); usbd_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); - ieee80211_ifdetach(ic); /* free buffers */ UATH_LOCK(sc); @@ -1857,7 +1860,8 @@ uath_raw_xmit(struct ieee80211_node *ni, struct uath_softc *sc = ifp->if_softc; /* prevent management frames from being sent if we're not ready */ - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if ((sc->sc_flags & UATH_FLAG_INVALID) || + !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { m_freem(m); ieee80211_free_node(ni); return (ENETDOWN); @@ -1907,6 +1911,11 @@ uath_set_channel(struct ieee80211com *ic struct uath_softc *sc = ifp->if_softc; UATH_LOCK(sc); + if ((sc->sc_flags & UATH_FLAG_INVALID) || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + UATH_UNLOCK(sc); + return; + } (void)uath_switch_channel(sc, ic->ic_curchan); UATH_UNLOCK(sc); } @@ -1923,6 +1932,11 @@ uath_update_mcast(struct ifnet *ifp) struct uath_softc *sc = ifp->if_softc; UATH_LOCK(sc); + if ((sc->sc_flags & UATH_FLAG_INVALID) || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + UATH_UNLOCK(sc); + return; + } /* * this is for avoiding the race condition when we're try to * connect to the AP with WPA. @@ -1938,6 +1952,11 @@ uath_update_promisc(struct ifnet *ifp) struct uath_softc *sc = ifp->if_softc; UATH_LOCK(sc); + if ((sc->sc_flags & UATH_FLAG_INVALID) || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + UATH_UNLOCK(sc); + return; + } if (sc->sc_flags & UATH_FLAG_INITDONE) { uath_set_rxfilter(sc, UATH_FILTER_RX_UCAST | UATH_FILTER_RX_MCAST | @@ -2649,7 +2668,8 @@ uath_data_rxeof(struct usb_xfer *xfer, s } /* there are a lot more fields in the RX descriptor */ - if (ieee80211_radiotap_active(ic)) { + if ((sc->sc_flags & UATH_FLAG_INVALID) == 0 && + ieee80211_radiotap_active(ic)) { struct uath_rx_radiotap_header *tap = &sc->sc_rxtap; uint32_t tsf_hi = be32toh(desc->tstamp_high); uint32_t tsf_lo = be32toh(desc->tstamp_low); @@ -2717,6 +2737,11 @@ setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ + if (sc->sc_flags & UATH_FLAG_INVALID) { + if (m != NULL) + m_freem(m); + return; + } UATH_UNLOCK(sc); if (m != NULL && desc != NULL) { wh = mtod(m, struct ieee80211_frame *); @@ -2769,7 +2794,8 @@ uath_data_txeof(struct usb_xfer *xfer, s */ if (data->m) { m = data->m; - if (m->m_flags & M_TXCB) { + if (m->m_flags & M_TXCB && + (sc->sc_flags & UATH_FLAG_INVALID) == 0) { /* XXX status? */ ieee80211_process_callback(data->ni, m, 0); } @@ -2777,7 +2803,8 @@ uath_data_txeof(struct usb_xfer *xfer, s data->m = NULL; } if (data->ni) { - ieee80211_free_node(data->ni); + if ((sc->sc_flags & UATH_FLAG_INVALID) == 0) + ieee80211_free_node(data->ni); data->ni = NULL; } sc->sc_tx_timer = 0; @@ -2831,7 +2858,8 @@ setup: if (data == NULL) goto setup; if (data->ni != NULL) { - ieee80211_free_node(data->ni); + if ((sc->sc_flags & UATH_FLAG_INVALID) == 0) + ieee80211_free_node(data->ni); data->ni = NULL; ifp->if_oerrors++; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 04:23:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A87371065675; Wed, 17 Jun 2009 04:23:37 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96CB38FC15; Wed, 17 Jun 2009 04:23:37 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H4NbEM062369; Wed, 17 Jun 2009 04:23:37 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H4NbLT062367; Wed, 17 Jun 2009 04:23:37 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200906170423.n5H4NbLT062367@svn.freebsd.org> From: Weongyo Jeong Date: Wed, 17 Jun 2009 04:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194330 - head/sys/modules/wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 04:23:38 -0000 Author: weongyo Date: Wed Jun 17 04:23:37 2009 New Revision: 194330 URL: http://svn.freebsd.org/changeset/base/194330 Log: adds opt_inet6.h to fix a error during compiling wlan as a module. Reviewed by: sam Modified: head/sys/modules/wlan/Makefile Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Wed Jun 17 04:15:19 2009 (r194329) +++ head/sys/modules/wlan/Makefile Wed Jun 17 04:23:37 2009 (r194330) @@ -10,7 +10,8 @@ SRCS= ieee80211.c ieee80211_crypto.c iee ieee80211_radiotap.c ieee80211_regdomain.c ieee80211_ht.c \ ieee80211_adhoc.c ieee80211_hostap.c ieee80211_monitor.c \ ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_ipx.h opt_wlan.h opt_ddb.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ + opt_ddb.h .if !defined(KERNBUILDDIR) opt_wlan.h: From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 04:57:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8561E106566C; Wed, 17 Jun 2009 04:57:33 +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 745988FC25; Wed, 17 Jun 2009 04:57:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H4vXAL063044; Wed, 17 Jun 2009 04:57:33 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H4vXOm063041; Wed, 17 Jun 2009 04:57:33 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906170457.n5H4vXOm063041@svn.freebsd.org> From: Alan Cox Date: Wed, 17 Jun 2009 04:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194331 - 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: Wed, 17 Jun 2009 04:57:34 -0000 Author: alc Date: Wed Jun 17 04:57:32 2009 New Revision: 194331 URL: http://svn.freebsd.org/changeset/base/194331 Log: Make the maintenance of a page's valid bits by contigmalloc() more like kmem_alloc() and kmem_malloc(). Specifically, defer the setting of the page's valid bits until contigmapping() when the mapping is known to be successful. Modified: head/sys/vm/vm_contig.c head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Wed Jun 17 04:23:37 2009 (r194330) +++ head/sys/vm/vm_contig.c Wed Jun 17 04:57:32 2009 (r194331) @@ -218,6 +218,7 @@ contigmapping(vm_page_t m, vm_pindex_t n OFF_TO_IDX(tmp_addr - VM_MIN_KERNEL_ADDRESS)); if ((flags & M_ZERO) && !(m[i].flags & PG_ZERO)) pmap_zero_page(&m[i]); + m[i].valid = VM_PAGE_BITS_ALL; tmp_addr += PAGE_SIZE; } VM_OBJECT_UNLOCK(object); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Jun 17 04:23:37 2009 (r194330) +++ head/sys/vm/vm_phys.c Wed Jun 17 04:57:32 2009 (r194331) @@ -691,14 +691,16 @@ done: ("vm_phys_alloc_contig: page %p has unexpected queue %d", m, m->queue)); m_object = m->object; - if ((m->flags & PG_CACHED) != 0) + if ((m->flags & PG_CACHED) != 0) { + m->valid = 0; vm_page_cache_remove(m); - else { + } else { KASSERT(VM_PAGE_IS_FREE(m), ("vm_phys_alloc_contig: page %p is not free", m)); + KASSERT(m->valid == 0, + ("vm_phys_alloc_contig: free page %p is valid", m)); cnt.v_free_count--; } - m->valid = VM_PAGE_BITS_ALL; if (m->flags & PG_ZERO) vm_page_zero_count--; /* Don't clear the PG_ZERO flag; we'll need it later. */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 06:25:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B81106564A; Wed, 17 Jun 2009 06:25:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 244848FC08; Wed, 17 Jun 2009 06:25:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H6PkJV064673; Wed, 17 Jun 2009 06:25:46 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H6PktF064671; Wed, 17 Jun 2009 06:25:46 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906170625.n5H6PktF064671@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 17 Jun 2009 06:25: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: r194332 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 06:25:46 -0000 Author: edwin Date: Wed Jun 17 06:25:45 2009 New Revision: 194332 URL: http://svn.freebsd.org/changeset/base/194332 Log: When copy+paste goes wrong... Remove duplicate "expr". Submitted by: danfe@ Modified: head/tools/tools/nanobsd/FlashDevice.sub Modified: head/tools/tools/nanobsd/FlashDevice.sub ============================================================================== --- head/tools/tools/nanobsd/FlashDevice.sub Wed Jun 17 04:57:32 2009 (r194331) +++ head/tools/tools/nanobsd/FlashDevice.sub Wed Jun 17 06:25:45 2009 (r194332) @@ -72,7 +72,7 @@ sub_FlashDevice () { # Source: mwlucas@FreeBSD.org case $a2 in 64|64mb) - NANO_MEDIASIZE=`expr expr 64487424 / 512` + NANO_MEDIASIZE=`expr 64487424 / 512` NANO_HEADS=4 NANO_SECTS=32 ;; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 06:41:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DFF41065672; Wed, 17 Jun 2009 06:41:10 +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 6C9D78FC21; Wed, 17 Jun 2009 06:41:10 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H6fAH6064963; Wed, 17 Jun 2009 06:41:10 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H6fAXa064961; Wed, 17 Jun 2009 06:41:10 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906170641.n5H6fAXa064961@svn.freebsd.org> From: Ulf Lilleengen Date: Wed, 17 Jun 2009 06:41: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: r194333 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 06:41:11 -0000 Author: lulf Date: Wed Jun 17 06:41:10 2009 New Revision: 194333 URL: http://svn.freebsd.org/changeset/base/194333 Log: - Back out the previous change in order to maintain compatibility. Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Wed Jun 17 06:25:45 2009 (r194332) +++ head/sbin/fdisk/fdisk.c Wed Jun 17 06:41:10 2009 (r194333) @@ -1066,8 +1066,8 @@ process_geometry(CMD *command) warnx("ERROR line %d: number of heads not specified", current_line_number); status = 0; - } else if (dos_heads > 255) { - warnx("ERROR line %d: number of heads must be within (1-255)", + } else if (dos_heads > 256) { + warnx("ERROR line %d: number of heads must be within (1-256)", current_line_number); status = 0; } From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 06:47:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A17D3106566C; Wed, 17 Jun 2009 06:47:05 +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 9030F8FC1A; Wed, 17 Jun 2009 06:47:05 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H6l5x2065164; Wed, 17 Jun 2009 06:47:05 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H6l5XD065162; Wed, 17 Jun 2009 06:47:05 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200906170647.n5H6l5XD065162@svn.freebsd.org> From: Ulf Lilleengen Date: Wed, 17 Jun 2009 06:47: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: r194334 - head/lib/libdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 06:47:06 -0000 Author: lulf Date: Wed Jun 17 06:47:05 2009 New Revision: 194334 URL: http://svn.freebsd.org/changeset/base/194334 Log: - Allow a higher value for the number of heads. Its better to do this and allow a few bad systems to run than to be completely strict about it. Modified: head/lib/libdisk/change.c Modified: head/lib/libdisk/change.c ============================================================================== --- head/lib/libdisk/change.c Wed Jun 17 06:41:10 2009 (r194333) +++ head/lib/libdisk/change.c Wed Jun 17 06:47:05 2009 (r194334) @@ -36,7 +36,7 @@ Sanitize_Bios_Geom(struct disk *disk) if (disk->bios_cyl >= 65536) sane = 0; - if (disk->bios_hd >= 256) + if (disk->bios_hd > 256) sane = 0; #ifdef PC98 if (disk->bios_sect >= 256) From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 07:11:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCBCF106564A; Wed, 17 Jun 2009 07:11:38 +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 90E138FC13; Wed, 17 Jun 2009 07:11:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5H7BcT5065808; Wed, 17 Jun 2009 07:11:38 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5H7Bca3065806; Wed, 17 Jun 2009 07:11:38 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906170711.n5H7Bca3065806@svn.freebsd.org> From: Alan Cox Date: Wed, 17 Jun 2009 07:11: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: r194337 - 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: Wed, 17 Jun 2009 07:11:39 -0000 Author: alc Date: Wed Jun 17 07:11:38 2009 New Revision: 194337 URL: http://svn.freebsd.org/changeset/base/194337 Log: Pass the size of the mapping to contigmapping() as a "vm_size_t" rather than a "vm_pindex_t". A "vm_size_t" is more convenient for it to use. Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Wed Jun 17 07:05:36 2009 (r194336) +++ head/sys/vm/vm_contig.c Wed Jun 17 07:11:38 2009 (r194337) @@ -194,35 +194,31 @@ vm_page_release_contig(vm_page_t m, vm_p * before they are mapped. */ static void * -contigmapping(vm_page_t m, vm_pindex_t npages, int flags) +contigmapping(vm_map_t map, vm_size_t size, vm_page_t m, int flags) { vm_object_t object = kernel_object; - vm_map_t map = kernel_map; vm_offset_t addr, tmp_addr; - vm_pindex_t i; vm_map_lock(map); - if (vm_map_findspace(map, vm_map_min(map), npages << PAGE_SHIFT, &addr) - != KERN_SUCCESS) { + if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { vm_map_unlock(map); return (NULL); } vm_object_reference(object); vm_map_insert(map, object, addr - VM_MIN_KERNEL_ADDRESS, - addr, addr + (npages << PAGE_SHIFT), VM_PROT_ALL, VM_PROT_ALL, 0); + addr, addr + size, VM_PROT_ALL, VM_PROT_ALL, 0); vm_map_unlock(map); - tmp_addr = addr; VM_OBJECT_LOCK(object); - for (i = 0; i < npages; i++) { - vm_page_insert(&m[i], object, + for (tmp_addr = addr; tmp_addr < addr + size; tmp_addr += PAGE_SIZE) { + vm_page_insert(m, object, OFF_TO_IDX(tmp_addr - VM_MIN_KERNEL_ADDRESS)); - if ((flags & M_ZERO) && !(m[i].flags & PG_ZERO)) - pmap_zero_page(&m[i]); - m[i].valid = VM_PAGE_BITS_ALL; - tmp_addr += PAGE_SIZE; + if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; + m++; } VM_OBJECT_UNLOCK(object); - vm_map_wire(map, addr, addr + (npages << PAGE_SHIFT), + vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); return ((void *)addr); } @@ -242,7 +238,8 @@ contigmalloc( unsigned long npgs; int actl, actmax, inactl, inactmax, tries; - npgs = round_page(size) >> PAGE_SHIFT; + size = round_page(size); + npgs = size >> PAGE_SHIFT; tries = 0; retry: pages = vm_phys_alloc_contig(npgs, low, high, alignment, boundary); @@ -270,7 +267,7 @@ again: } ret = NULL; } else { - ret = contigmapping(pages, npgs, flags); + ret = contigmapping(kernel_map, size, pages, flags); if (ret == NULL) vm_page_release_contig(pages, npgs); else From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 10:23:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CE17106564A; Wed, 17 Jun 2009 10:23:26 +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 308F68FC13; Wed, 17 Jun 2009 10:23:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HANPFQ070276; Wed, 17 Jun 2009 10:23:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HANPEF070273; Wed, 17 Jun 2009 10:23:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906171023.n5HANPEF070273@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2009 10:23: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: r194342 - in head/sys/mips: adm5120 idt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 10:23:26 -0000 Author: bz Date: Wed Jun 17 10:23:25 2009 New Revision: 194342 URL: http://svn.freebsd.org/changeset/base/194342 Log: Make compile again using the correct prototype for the device shutdown method. Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/idt/if_kr.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Wed Jun 17 10:15:06 2009 (r194341) +++ head/sys/mips/adm5120/if_admsw.c Wed Jun 17 10:23:25 2009 (r194342) @@ -133,8 +133,6 @@ static int admsw_ioctl(struct ifnet *, u static void admsw_init(void *); static void admsw_stop(struct ifnet *, int); -static void admsw_shutdown(void *); - static void admsw_reset(struct admsw_softc *); static void admsw_set_filter(struct admsw_softc *); @@ -153,6 +151,7 @@ static int admsw_intr(void *); static int admsw_probe(device_t dev); static int admsw_attach(device_t dev); static int admsw_detach(device_t dev); +static int admsw_shutdown(device_t dev); static void admsw_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) @@ -571,14 +570,17 @@ admsw_detach(device_t dev) * * Make sure the interface is stopped at reboot time. */ -static void -admsw_shutdown(void *arg) +static int +admsw_shutdown(device_t dev) { - struct admsw_softc *sc = arg; + struct admsw_softc *sc; int i; + sc = device_get_softc(dev); for (i = 0; i < SW_DEVS; i++) admsw_stop(sc->sc_ifnet[i], 1); + + return (0); } /* Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Wed Jun 17 10:15:06 2009 (r194341) +++ head/sys/mips/idt/if_kr.c Wed Jun 17 10:23:25 2009 (r194342) @@ -89,7 +89,7 @@ static void kr_reset(struct kr_softc *); static int kr_resume(device_t); static int kr_rx_ring_init(struct kr_softc *); static int kr_tx_ring_init(struct kr_softc *); -static void kr_shutdown(device_t); +static int kr_shutdown(device_t); static void kr_start(struct ifnet *); static void kr_start_locked(struct ifnet *); static void kr_stop(struct kr_softc *); @@ -392,7 +392,7 @@ kr_resume(device_t dev) return 0; } -static void +static int kr_shutdown(device_t dev) { struct kr_softc *sc; @@ -402,6 +402,8 @@ kr_shutdown(device_t dev) KR_LOCK(sc); kr_stop(sc); KR_UNLOCK(sc); + + return (0); } static int From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 10:26:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85FC1065672; Wed, 17 Jun 2009 10:26:37 +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 A6CB08FC08; Wed, 17 Jun 2009 10:26:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HAQbaw072161; Wed, 17 Jun 2009 10:26:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HAQbZJ072159; Wed, 17 Jun 2009 10:26:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906171026.n5HAQbZJ072159@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2009 10:26: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: r194343 - head/sys/mips/idt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 10:26:38 -0000 Author: bz Date: Wed Jun 17 10:26:37 2009 New Revision: 194343 URL: http://svn.freebsd.org/changeset/base/194343 Log: Make compile again using proper protoypes for pcib_read/write_config DEVMETHOD. Modified: head/sys/mips/idt/idtpci.c Modified: head/sys/mips/idt/idtpci.c ============================================================================== --- head/sys/mips/idt/idtpci.c Wed Jun 17 10:23:25 2009 (r194342) +++ head/sys/mips/idt/idtpci.c Wed Jun 17 10:26:37 2009 (r194343) @@ -287,7 +287,7 @@ idtpci_maxslots(device_t dev) } static uint32_t -idtpci_read_config(device_t dev, int bus, int slot, int func, int reg, +idtpci_read_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, int bytes) { uint32_t data; @@ -343,7 +343,7 @@ idtpci_read_config(device_t dev, int bus } static void -idtpci_write_config(device_t dev, int bus, int slot, int func, int reg, +idtpci_write_config(device_t dev, u_int bus, u_int slot, u_int func, u_int reg, uint32_t data, int bytes) { bus_addr_t addr; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 10:48:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351BD106566B; Wed, 17 Jun 2009 10:48:33 +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 235B98FC13; Wed, 17 Jun 2009 10:48:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HAmWMQ072699; Wed, 17 Jun 2009 10:48:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HAmWhh072697; Wed, 17 Jun 2009 10:48:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906171048.n5HAmWhh072697@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2009 10:48: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: r194344 - 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: Wed, 17 Jun 2009 10:48:33 -0000 Author: bz Date: Wed Jun 17 10:48:32 2009 New Revision: 194344 URL: http://svn.freebsd.org/changeset/base/194344 Log: Add a .cvsignore file and along with that put an svn:ignore proprty on the directory like we have for all other target architectures. Discussed with: imp (kind of) Added: head/sys/mips/conf/.cvsignore (contents, props changed) Modified: head/sys/mips/conf/ (props changed) Added: head/sys/mips/conf/.cvsignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/.cvsignore Wed Jun 17 10:48:32 2009 (r194344) @@ -0,0 +1 @@ +[A-Za-z0-9]* From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 12:34:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5732C1065695; Wed, 17 Jun 2009 12:34:57 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44D168FC1A; Wed, 17 Jun 2009 12:34:57 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HCYvJQ075593; Wed, 17 Jun 2009 12:34:57 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HCYv4b075588; Wed, 17 Jun 2009 12:34:57 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200906171234.n5HCYv4b075588@svn.freebsd.org> From: Randall Stewart Date: Wed, 17 Jun 2009 12:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194355 - 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: Wed, 17 Jun 2009 12:34:57 -0000 Author: rrs Date: Wed Jun 17 12:34:56 2009 New Revision: 194355 URL: http://svn.freebsd.org/changeset/base/194355 Log: Changes to the NR-Sack code so that: 1) All bit disappears 2) The two sets of gaps (nr and non-nr) are disjointed, you don't have gaps struck in both places. This adjusts us to coorespond to the new draft. Still to-do, cleanup the code so that there are only one set of sack routines (original NR-Sack done by E cloned all sack code). Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed Jun 17 12:27:00 2009 (r194354) +++ head/sys/netinet/sctp.h Wed Jun 17 12:34:56 2009 (r194355) @@ -415,9 +415,6 @@ struct sctp_error_unrecognized_chunk { /* ECN Nonce: SACK Chunk Specific Flags */ #define SCTP_SACK_NONCE_SUM 0x01 -/* EY nr_sack all bit - All bit is the 2nd LSB of nr_sack chunk flags*/ -/* if All bit is set in an nr-sack chunk, then all nr gap acks gap acks*/ -#define SCTP_NR_SACK_ALL_BIT 0x02 /* CMT DAC algorithm SACK flag */ #define SCTP_SACK_CMT_DAC 0x80 Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jun 17 12:27:00 2009 (r194354) +++ head/sys/netinet/sctp_indata.c Wed Jun 17 12:34:56 2009 (r194355) @@ -45,6 +45,24 @@ __FBSDID("$FreeBSD$"); #include #include +#define SCTP_CALC_TSN_TO_GAP(gap, tsn, mapping_tsn) do { \ + if ((compare_with_wrap(tsn, mapping_tsn, MAX_TSN)) || \ + (tsn == mapping_tsn)) { \ + gap = tsn - mapping_tsn; \ + } else { \ + gap = (MAX_TSN - mapping_tsn) + tsn + 1; \ + } \ + } while(0) + +#define SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc) do { \ + if (asoc->mapping_array_base_tsn == asoc->nr_mapping_array_base_tsn) { \ + SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, nr_gap); \ + } else {\ + int lgap; \ + SCTP_CALC_TSN_TO_GAP(lgap, tsn, asoc->mapping_array_base_tsn); \ + SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, lgap); \ + } \ + } while(0) /* * NOTES: On the outbound side of things I need to check the sack timer to @@ -423,12 +441,7 @@ abandon: if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { nr_tsn = chk->rec.data.TSN_seq; - if ((compare_with_wrap(nr_tsn, asoc->nr_mapping_array_base_tsn, MAX_TSN)) || - (nr_tsn == asoc->nr_mapping_array_base_tsn)) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { /* @@ -445,6 +458,7 @@ abandon: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } @@ -510,14 +524,10 @@ abandon: * NR */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { + printf("Impossible NR gap calculation?\n"); /* * EY The * 1st @@ -552,6 +562,7 @@ abandon: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) @@ -682,14 +693,10 @@ protocol_error: * chk->rec.data.TSN_seq */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { + printf("Impossible nr_tsn set 2?\n"); /* * EY The 1st should never happen, as in * process_a_data_chunk method this check @@ -703,6 +710,7 @@ protocol_error: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } @@ -739,14 +747,10 @@ protocol_error: * chk->rec.data.TSN_seq */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { + printf("Impossible nr TSN set 3?\n"); /* * EY The 1st should never * happen, as in @@ -763,6 +767,7 @@ protocol_error: */ } else { SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) @@ -1613,11 +1618,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } /* Calculate the number of TSN's between the base and this TSN */ - if (tsn >= asoc->mapping_array_base_tsn) { - gap = tsn - asoc->mapping_array_base_tsn; - } else { - gap = (MAX_TSN - asoc->mapping_array_base_tsn) + tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); if (gap >= (SCTP_MAPPING_ARRAY << 3)) { /* Can't hold the bit in the mapping at max array, toss it */ return (0); @@ -1752,6 +1753,7 @@ sctp_process_a_data_chunk(struct sctp_tc if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); + SCTP_REVERSE_OUT_TSN_PRES(gap, tsn, asoc); } if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) { /* we have a new high score */ @@ -1948,6 +1950,7 @@ sctp_process_a_data_chunk(struct sctp_tc /* EY - not %100 sure about the lock thing */ SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc); if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = tsn; } @@ -2025,6 +2028,7 @@ failed_express_del: /* EY - not %100 sure about the lock thing */ SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc); if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = tsn; } @@ -2291,6 +2295,7 @@ failed_pdapi_express_del: } SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc); if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = tsn; } @@ -2400,6 +2405,7 @@ finish_express_del: asoc->peer_supports_nr_sack && (SCTP_BASE_SYSCTL(sctp_do_drain) == 0)) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, tsn, asoc); if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { asoc->highest_tsn_inside_nr_map = tsn; } @@ -5725,11 +5731,7 @@ sctp_kick_prsctp_reorder_queue(struct sc */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { /* @@ -5739,12 +5741,12 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } - if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, nr_gap)) /* * printf("In @@ -5829,12 +5831,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * chk->rec.data.TSN_seq */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { - nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; - } else { - nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; - } + SCTP_CALC_TSN_TO_GAP(nr_gap, nr_tsn, asoc->nr_mapping_array_base_tsn); if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { /* @@ -5844,12 +5841,11 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); + SCTP_REVERSE_OUT_TSN_PRES(nr_gap, nr_tsn, asoc); if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } - - if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, nr_gap)) /* * printf("In @@ -6062,15 +6058,7 @@ sctp_handle_forward_tsn(struct sctp_tcb * now we know the new TSN is more advanced, let's find the actual * gap */ - if ((compare_with_wrap(new_cum_tsn, asoc->mapping_array_base_tsn, - MAX_TSN)) || - (new_cum_tsn == asoc->mapping_array_base_tsn)) { - gap = new_cum_tsn - asoc->mapping_array_base_tsn; - } else { - /* try to prevent underflow here */ - gap = new_cum_tsn + (MAX_TSN - asoc->mapping_array_base_tsn) + 1; - } - + SCTP_CALC_TSN_TO_GAP(gap, new_cum_tsn, asoc->mapping_array_base_tsn); if (gap >= m_size) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) { sctp_log_map(0, 0, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); @@ -6131,14 +6119,11 @@ sctp_handle_forward_tsn(struct sctp_tcb } else { SCTP_TCB_LOCK_ASSERT(stcb); for (i = 0; i <= gap; i++) { - SCTP_SET_TSN_PRESENT(asoc->mapping_array, i); - /* - * EY if drain is off then every gap-ack is an - * nr-gap-ack - */ if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack && SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); + } else { + SCTP_SET_TSN_PRESENT(asoc->mapping_array, i); } } /* @@ -6847,7 +6832,7 @@ sctp_handle_nr_sack_segments(struct mbuf struct sctp_gap_ack_block *frag, block; struct sctp_nr_gap_ack_block *nr_frag, nr_block; struct sctp_tmit_chunk *tp1; - uint32_t i, j, all_bit; + uint32_t i, j; int wake_him = 0; uint32_t theTSN; int num_frs = 0; @@ -6858,8 +6843,6 @@ sctp_handle_nr_sack_segments(struct mbuf uint32_t last_frag_high; uint32_t last_nr_frag_high; - all_bit = ch->ch.chunk_flags & SCTP_NR_SACK_ALL_BIT; - /* * @@@ JRI : TODO: This flag is not used anywhere .. remove? */ @@ -6963,12 +6946,12 @@ sctp_handle_nr_sack_segments(struct mbuf */ if (tp1->sent < SCTP_DATAGRAM_RESEND) { /*- - * If it is less than RESEND, it is - * now no-longer in flight. - * Higher values may already be set - * via previous Gap Ack Blocks... - * i.e. ACKED or RESEND. - */ + * If it is less than RESEND, it is + * now no-longer in flight. + * Higher values may already be set + * via previous Gap Ack Blocks... + * i.e. ACKED or RESEND. + */ if (compare_with_wrap(tp1->rec.data.TSN_seq, *biggest_newly_acked_tsn, MAX_TSN)) { *biggest_newly_acked_tsn = tp1->rec.data.TSN_seq; @@ -7123,39 +7106,6 @@ sctp_handle_nr_sack_segments(struct mbuf tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - /* - * EY - if all bit is set - * then this TSN is - * nr_marked - */ - if (all_bit) { - if (tp1->sent != SCTP_FORWARD_TSN_SKIP) - tp1->sent = SCTP_DATAGRAM_NR_MARKED; - /* - * TAILQ_REMOVE(&asoc - * ->sent_queue, - * tp1, sctp_next); - */ - if (tp1->data) { - /* - * sa_ignore - * NO_NULL_CH - * K - */ - sctp_free_bufspace(stcb, asoc, tp1, 1); - sctp_m_freem(tp1->data); - } - tp1->data = NULL; - /* - * asoc->sent_queue_c - * nt--; - */ - /* - * sctp_free_a_chunk( - * stcb, tp1); - */ - wake_him++; - } } break; } /* if (tp1->TSN_seq == theTSN) */ @@ -7180,120 +7130,105 @@ sctp_handle_nr_sack_segments(struct mbuf *biggest_newly_acked_tsn, last_tsn, SCTP_FR_LOG_BIGGEST_TSNS); } - /* - * EY - if all bit is not set then there should be other loops to - * identify nr TSNs - */ - if (!all_bit) { + nr_frag = (struct sctp_nr_gap_ack_block *)sctp_m_getptr(m, *offset, + sizeof(struct sctp_nr_gap_ack_block), (uint8_t *) & nr_block); + *offset += sizeof(nr_block); - nr_frag = (struct sctp_nr_gap_ack_block *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_nr_gap_ack_block), (uint8_t *) & nr_block); - *offset += sizeof(nr_block); + if (nr_frag == NULL) { + return; + } + tp1 = NULL; + last_nr_frag_high = 0; - if (nr_frag == NULL) { - return; - } - tp1 = NULL; - last_nr_frag_high = 0; + for (i = 0; i < num_nr_seg; i++) { - for (i = 0; i < num_nr_seg; i++) { + nr_frag_strt = ntohs(nr_frag->start); + nr_frag_end = ntohs(nr_frag->end); - nr_frag_strt = ntohs(nr_frag->start); - nr_frag_end = ntohs(nr_frag->end); + /* some sanity checks on the nr fargment offsets */ + if (nr_frag_strt > nr_frag_end) { + /* this one is malformed, skip */ + nr_frag++; + continue; + } + /* mark acked dgs and find out the highestTSN being acked */ + if (tp1 == NULL) { + tp1 = TAILQ_FIRST(&asoc->sent_queue); - /* some sanity checks on the nr fargment offsets */ - if (nr_frag_strt > nr_frag_end) { - /* this one is malformed, skip */ - nr_frag++; - continue; - } + /* save the locations of the last frags */ + last_nr_frag_high = nr_frag_end + last_tsn; + } else { /* - * mark acked dgs and find out the highestTSN being - * acked + * now lets see if we need to reset the queue due to + * a out-of-order SACK fragment */ - if (tp1 == NULL) { - tp1 = TAILQ_FIRST(&asoc->sent_queue); - - /* save the locations of the last frags */ - last_nr_frag_high = nr_frag_end + last_tsn; + if (compare_with_wrap(nr_frag_strt + last_tsn, + last_nr_frag_high, MAX_TSN)) { + /* + * if the new frag starts after the last TSN + * frag covered, we are ok and this one is + * beyond the last one + */ + ; } else { /* - * now lets see if we need to reset the - * queue due to a out-of-order SACK fragment + * ok, they have reset us, so we need to + * reset the queue this will cause extra + * hunting but hey, they chose the + * performance hit when they failed to order + * there gaps.. */ - if (compare_with_wrap(nr_frag_strt + last_tsn, - last_nr_frag_high, MAX_TSN)) { - /* - * if the new frag starts after the - * last TSN frag covered, we are ok - * and this one is beyond the last - * one - */ - ; - } else { - /* - * ok, they have reset us, so we - * need to reset the queue this will - * cause extra hunting but hey, they - * chose the performance hit when - * they failed to order there gaps.. - */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - } - last_nr_frag_high = nr_frag_end + last_tsn; + tp1 = TAILQ_FIRST(&asoc->sent_queue); } + last_nr_frag_high = nr_frag_end + last_tsn; + } - for (j = nr_frag_strt + last_tsn; (compare_with_wrap((nr_frag_end + last_tsn), j, MAX_TSN)); j++) { - while (tp1) { - if (tp1->rec.data.TSN_seq == j) { - if (tp1->sent != SCTP_DATAGRAM_UNSENT) { - if (tp1->sent != SCTP_FORWARD_TSN_SKIP) - tp1->sent = SCTP_DATAGRAM_NR_MARKED; - /* - * TAILQ_REMOVE(&asoc - * ->sent_queue, - * tp1, sctp_next); - */ - if (tp1->data) { - /* - * sa_ignore - * NO_NULL_CH - * K - */ - sctp_free_bufspace(stcb, asoc, tp1, 1); - sctp_m_freem(tp1->data); - } - tp1->data = NULL; - /* - * asoc->sent_queue_c - * nt--; - */ + for (j = nr_frag_strt + last_tsn; (compare_with_wrap((nr_frag_end + last_tsn), j, MAX_TSN)); j++) { + while (tp1) { + if (tp1->rec.data.TSN_seq == j) { + if (tp1->sent != SCTP_DATAGRAM_UNSENT) { + if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + tp1->sent = SCTP_DATAGRAM_NR_MARKED; + /* + * TAILQ_REMOVE(&asoc->sent_q + * ueue, tp1, sctp_next); + */ + if (tp1->data) { /* - * sctp_free_a_chunk( - * stcb, tp1); + * sa_ignore + * NO_NULL_CHK */ - wake_him++; + sctp_free_bufspace(stcb, asoc, tp1, 1); + sctp_m_freem(tp1->data); } - break; - } /* if (tp1->TSN_seq == j) */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, j, - MAX_TSN)) - break; - tp1 = TAILQ_NEXT(tp1, sctp_next); - } /* end while (tp1) */ + tp1->data = NULL; + /* asoc->sent_queue_cnt--; */ + /* + * sctp_free_a_chunk(stcb, + * tp1); + */ + wake_him++; + } + break; + } /* if (tp1->TSN_seq == j) */ + if (compare_with_wrap(tp1->rec.data.TSN_seq, j, + MAX_TSN)) + break; + tp1 = TAILQ_NEXT(tp1, sctp_next); + } /* end while (tp1) */ - } /* end for (j = nrFragStart */ + } /* end for (j = nrFragStart */ - nr_frag = (struct sctp_nr_gap_ack_block *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_nr_gap_ack_block), (uint8_t *) & nr_block); - *offset += sizeof(nr_block); - if (nr_frag == NULL) { - break; - } - } /* end of if(!all_bit) */ + nr_frag = (struct sctp_nr_gap_ack_block *)sctp_m_getptr(m, *offset, + sizeof(struct sctp_nr_gap_ack_block), (uint8_t *) & nr_block); + *offset += sizeof(nr_block); + if (nr_frag == NULL) { + break; + } } + /* * EY- wake up the socket if things have been removed from the sent * queue @@ -7405,7 +7340,7 @@ sctp_handle_nr_sack(struct mbuf *m, int int win_probe_recovery = 0; int win_probe_recovered = 0; struct sctp_nets *net = NULL; - int nonce_sum_flag, ecn_seg_sums = 0, all_bit; + int nonce_sum_flag, ecn_seg_sums = 0; int done_once; uint8_t reneged_all = 0; uint8_t cmt_dac_flag; @@ -7448,11 +7383,8 @@ sctp_handle_nr_sack(struct mbuf *m, int stcb->asoc.cumack_log_at = 0; } #endif - all_bit = ch->ch.chunk_flags & SCTP_NR_SACK_ALL_BIT; num_seg = ntohs(nr_sack->num_gap_ack_blks); num_nr_seg = ntohs(nr_sack->num_nr_gap_ack_blks); - if (all_bit) - num_seg = num_nr_seg; a_rwnd = rwnd; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_SACK_ARRIVALS_ENABLE) { @@ -7485,14 +7417,8 @@ sctp_handle_nr_sack(struct mbuf *m, int int off_to_dup, iii; uint32_t *dupdata, dblock; - /* EY! gotta be careful here */ - if (all_bit) { - off_to_dup = (num_nr_seg * sizeof(struct sctp_nr_gap_ack_block)) + - sizeof(struct sctp_nr_sack_chunk); - } else { - off_to_dup = (num_seg * sizeof(struct sctp_gap_ack_block)) + - (num_nr_seg * sizeof(struct sctp_nr_gap_ack_block)) + sizeof(struct sctp_nr_sack_chunk); - } + off_to_dup = (num_seg * sizeof(struct sctp_gap_ack_block)) + + (num_nr_seg * sizeof(struct sctp_nr_gap_ack_block)) + sizeof(struct sctp_nr_sack_chunk); if ((off_to_dup + (num_dup * sizeof(uint32_t))) <= nr_sack_length) { dupdata = (uint32_t *) sctp_m_getptr(m, off_to_dup, sizeof(uint32_t), (uint8_t *) & dblock); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Jun 17 12:27:00 2009 (r194354) +++ head/sys/netinet/sctp_input.c Wed Jun 17 12:34:56 2009 (r194355) @@ -4656,7 +4656,7 @@ process_control_chunks: int abort_now = 0; uint32_t a_rwnd, cum_ack; uint16_t num_seg, num_nr_seg; - int nonce_sum_flag, all_bit; + int nonce_sum_flag; if ((stcb == NULL) || (chk_length < sizeof(struct sctp_nr_sack_chunk))) { SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size on nr_sack chunk, too small\n"); @@ -4685,17 +4685,9 @@ process_control_chunks: } nr_sack = (struct sctp_nr_sack_chunk *)ch; nonce_sum_flag = ch->chunk_flags & SCTP_SACK_NONCE_SUM; - all_bit = ch->chunk_flags & SCTP_NR_SACK_ALL_BIT; cum_ack = ntohl(nr_sack->nr_sack.cum_tsn_ack); num_seg = ntohs(nr_sack->nr_sack.num_gap_ack_blks); - /* - * EY -if All bit is set, then there are as - * many gaps as nr_gaps - */ - if (all_bit) { - num_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); - } num_nr_seg = ntohs(nr_sack->nr_sack.num_nr_gap_ack_blks); a_rwnd = (uint32_t) ntohl(nr_sack->nr_sack.a_rwnd); SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK process cum_ack:%x num_seg:%d a_rwnd:%d\n", Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jun 17 12:27:00 2009 (r194354) +++ head/sys/netinet/sctp_output.c Wed Jun 17 12:34:56 2009 (r194355) @@ -10375,13 +10375,6 @@ sctp_send_nr_sack(struct sctp_tcb *stcb) nr_sack->ch.chunk_flags |= (asoc->cmt_dac_pkts_rcvd << 6); asoc->cmt_dac_pkts_rcvd = 0; } - /* - * EY - this is a never reneging receiver, that makes all gaps are - * nr-gaps, set the All bit - */ - if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { - nr_sack->ch.chunk_flags |= SCTP_NR_SACK_ALL_BIT; - } #ifdef SCTP_ASOCLOG_OF_TSNS stcb->asoc.cumack_logsnt[stcb->asoc.cumack_log_atsnt] = asoc->cumulative_tsn; stcb->asoc.cumack_log_atsnt++; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 12:43:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680791065689; Wed, 17 Jun 2009 12:43:04 +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 566488FC19; Wed, 17 Jun 2009 12:43:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HCh4MF075779; Wed, 17 Jun 2009 12:43:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HCh4so075777; Wed, 17 Jun 2009 12:43:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906171243.n5HCh4so075777@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 17 Jun 2009 12:43: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: r194356 - 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, 17 Jun 2009 12:43:05 -0000 Author: kib Date: Wed Jun 17 12:43:04 2009 New Revision: 194356 URL: http://svn.freebsd.org/changeset/base/194356 Log: Decrement state->ls_threads when vnode appeared to be doomed. Reported and tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Wed Jun 17 12:34:56 2009 (r194355) +++ head/sys/kern/kern_lockf.c Wed Jun 17 12:43:04 2009 (r194356) @@ -646,6 +646,8 @@ lf_advlockasync(struct vop_advlockasync_ */ VI_LOCK(vp); if (vp->v_iflag & VI_DOOMED) { + state->ls_threads--; + wakeup(state); VI_UNLOCK(vp); sx_xunlock(&state->ls_lock); lf_free_lock(lock); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 12:44:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 987EE106564A; Wed, 17 Jun 2009 12:44:12 +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 7D4D18FC0C; Wed, 17 Jun 2009 12:44:12 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HCiCPZ075855; Wed, 17 Jun 2009 12:44:12 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HCiCdW075848; Wed, 17 Jun 2009 12:44:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906171244.n5HCiCdW075848@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2009 12:44: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: r194357 - in head/sys: fs/nfs net netinet netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 12:44:13 -0000 Author: bz Date: Wed Jun 17 12:44:11 2009 New Revision: 194357 URL: http://svn.freebsd.org/changeset/base/194357 Log: Add the explicit include of vimage.h to another five .c files still missing it. Remove the "hidden" kernel only include of vimage.h from ip_var.h added with the very first Vimage commit r181803 to avoid further kernel poisoning. Modified: head/sys/fs/nfs/nfsport.h head/sys/net/if_enc.c head/sys/net/if_gre.c head/sys/netinet/in_proto.c head/sys/netinet/ip_var.h head/sys/netipsec/xform_tcp.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/fs/nfs/nfsport.h Wed Jun 17 12:44:11 2009 (r194357) @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/net/if_enc.c Wed Jun 17 12:44:11 2009 (r194357) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/net/if_gre.c Wed Jun 17 12:44:11 2009 (r194357) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/netinet/in_proto.c Wed Jun 17 12:44:11 2009 (r194357) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/netinet/ip_var.h Wed Jun 17 12:44:11 2009 (r194357) @@ -34,9 +34,6 @@ #define _NETINET_IP_VAR_H_ #include -#ifdef _KERNEL -#include -#endif /* * Overlay for ip header used by other protocols (tcp, udp). Modified: head/sys/netipsec/xform_tcp.c ============================================================================== --- head/sys/netipsec/xform_tcp.c Wed Jun 17 12:43:04 2009 (r194356) +++ head/sys/netipsec/xform_tcp.c Wed Jun 17 12:44:11 2009 (r194357) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 12:47:28 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42918106566B; Wed, 17 Jun 2009 12:47: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 30FD48FC20; Wed, 17 Jun 2009 12:47:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HClScR075964; Wed, 17 Jun 2009 12:47:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HClSGs075962; Wed, 17 Jun 2009 12:47:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200906171247.n5HClSGs075962@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 17 Jun 2009 12:47: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: r194358 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 12:47:28 -0000 Author: kib Date: Wed Jun 17 12:47:27 2009 New Revision: 194358 URL: http://svn.freebsd.org/changeset/base/194358 Log: For dotdot lookup in nfs_lookup, inline the vn_vget_ino() to prevent operating on the unmounted mount point and freed mount data in case of forced unmount performed while dvp is unlocked to nget the target vnode. Add missed calls to m_freem(mrep) there on error exits [1]. Submitted by: rmacklem [1] Tested by: pho MFC after: 2 weeks Modified: head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Wed Jun 17 12:44:11 2009 (r194357) +++ head/sys/nfsclient/nfs_vnops.c Wed Jun 17 12:47:27 2009 (r194358) @@ -924,6 +924,7 @@ nfs_lookup(struct vop_lookup_args *ap) struct componentname *cnp = ap->a_cnp; struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; + struct mount *mp = dvp->v_mount; struct vattr vattr; int flags = cnp->cn_flags; struct vnode *newvp; @@ -933,17 +934,17 @@ nfs_lookup(struct vop_lookup_args *ap) long len; nfsfh_t *fhp; struct nfsnode *np; - int error = 0, attrflag, fhsize; + int error = 0, attrflag, fhsize, ltype; int v3 = NFS_ISV3(dvp); struct thread *td = cnp->cn_thread; *vpp = NULLVP; - if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && + if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) return (EROFS); if (dvp->v_type != VDIR) return (ENOTDIR); - nmp = VFSTONFS(dvp->v_mount); + nmp = VFSTONFS(mp); np = VTONFS(dvp); if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) { *vpp = NULLVP; @@ -1022,7 +1023,7 @@ nfs_lookup(struct vop_lookup_args *ap) m_freem(mrep); return (EISDIR); } - error = nfs_nget(dvp->v_mount, fhp, fhsize, &np, LK_EXCLUSIVE); + error = nfs_nget(mp, fhp, fhsize, &np, LK_EXCLUSIVE); if (error) { m_freem(mrep); return (error); @@ -1040,17 +1041,45 @@ nfs_lookup(struct vop_lookup_args *ap) } if (flags & ISDOTDOT) { + ltype = VOP_ISLOCKED(dvp); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + VOP_UNLOCK(dvp, 0); + error = vfs_busy(mp, 0); + vn_lock(dvp, ltype | LK_RETRY); + if (error == 0 && (dvp->v_iflag & VI_DOOMED)) { + vfs_unbusy(mp); + error = ENOENT; + } + if (error != 0) { + m_freem(mrep); + return (error); + } + } VOP_UNLOCK(dvp, 0); - error = nfs_nget(dvp->v_mount, fhp, fhsize, &np, cnp->cn_lkflags); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); - if (error) + error = nfs_nget(mp, fhp, fhsize, &np, cnp->cn_lkflags); + if (error == 0) + newvp = NFSTOV(np); + vfs_unbusy(mp); + vn_lock(dvp, ltype | LK_RETRY); + if (dvp->v_iflag & VI_DOOMED) { + if (error == 0) { + if (newvp == dvp) + vrele(newvp); + else + vput(newvp); + } + error = ENOENT; + } + if (error) { + m_freem(mrep); return (error); - newvp = NFSTOV(np); + } } else if (NFS_CMPFH(np, fhp, fhsize)) { VREF(dvp); newvp = dvp; } else { - error = nfs_nget(dvp->v_mount, fhp, fhsize, &np, cnp->cn_lkflags); + error = nfs_nget(mp, fhp, fhsize, &np, cnp->cn_lkflags); if (error) { m_freem(mrep); return (error); @@ -1089,7 +1118,7 @@ nfsmout: * VWRITE) here instead of just checking * MNT_RDONLY. */ - if (dvp->v_mount->mnt_flag & MNT_RDONLY) + if (mp->mnt_flag & MNT_RDONLY) return (EROFS); cnp->cn_flags |= SAVENAME; return (EJUSTRETURN); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 13:00:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3EDF106566B; Wed, 17 Jun 2009 13:00:25 +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 40BDB8FC0C; Wed, 17 Jun 2009 13:00:25 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2D393.dip.t-dialin.net [217.226.211.147]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 5F7408444EC; Wed, 17 Jun 2009 15:00:19 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 48993C6D72; Wed, 17 Jun 2009 15:00:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1245243616; bh=vX8wb5+G45Xsk78GSV1H4NUoi4iBvNJXNfaZuryc/o4=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=Vgc3eLuNjahE1L8voxlROeUGLtZbXYa+QDbmigxefWBKi050QTrTYeHpH1ajyBWj/ u6emU8sORyqNgHxjG2ZlkYmApcXo8bA7p1KRNqdQQpIfP+UhVXpUbrbu7VjJRRD3fi x0GlKC9y/4wv9jTzSYEllqQTZaONEjUVrOZBXLwCu8tFIskjPEoQZwjEBAQXfvXOmu J5xaLiwczY3MF+Tm1FNFnapgO2XL0rJfcJeVPmQY9TH4AC55QiDBjdjqCIH6kLF9qd VDckSMM1xXtaWmvAfMlpNnBVyEfxuwhDe31Q2Bx0RinjBagtYhsBVF99tsDiCzqepg velaLnU2rUzNw== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n5HD0FMW048543; Wed, 17 Jun 2009 15:00:15 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Wed, 17 Jun 2009 15:00:15 +0200 Message-ID: <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Wed, 17 Jun 2009 15:00:15 +0200 From: Alexander Leidinger To: Alexander Motin References: <200904292117.n3TLHIpt093110@svn.freebsd.org> In-Reply-To: <200904292117.n3TLHIpt093110@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 5F7408444EC.037ED X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1245848421.20595@R6+KGyj8pS1Lev9sJwRtVg X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191674 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 13:00:26 -0000 Quoting Alexander Motin (from Wed, 29 Apr 2009 21:17:18 +0000 (UTC)): > Author: mav > Date: Wed Apr 29 21:17:18 2009 > New Revision: 191674 > URL: http://svn.freebsd.org/changeset/base/191674 > > Log: > Add experimental support for SATA interface power management. > Feature is controlled by hint.ata.X.pm_level tunable: > 0 - PM disabled, old behaviour, default. > 1 - device is allowed to initiate PM state change, host is passive. > 2 - host initiates PARTIAL state transition every time port is idle. > 3 - host initiates SLUMBER state transition every time port is idle. Did I miss a man-page update for this? If yes, where is it, I would have expected it in ata(4). > PARTIAL state has up to 100us (50us for me) wakeup latency, but for my > ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms (3.5ms > for me) wakeup latency, but saves 0.8W of power. > > Modes 2 and 3 are implemented only for AHCI driver now. Does this mean it is for SATA devices only, or is this a feature of the complete controller (ICH5 in my case) and also works with PATA drives? Bye, Alexander. -- BOFH excuse #345: Having to manually track the satellite http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 13:10:31 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D308F106566B; Wed, 17 Jun 2009 13:10:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id DD4B98FC1D; Wed, 17 Jun 2009 13:10:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 245993056; Wed, 17 Jun 2009 16:10:26 +0300 Message-ID: <4A38EB41.2080206@FreeBSD.org> Date: Wed, 17 Jun 2009 16:10:25 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Alexander Leidinger References: <200904292117.n3TLHIpt093110@svn.freebsd.org> <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> In-Reply-To: <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191674 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 13:10:32 -0000 Alexander Leidinger wrote: > Quoting Alexander Motin (from Wed, 29 Apr 2009 > 21:17:18 +0000 (UTC)): > >> Author: mav >> Date: Wed Apr 29 21:17:18 2009 >> New Revision: 191674 >> URL: http://svn.freebsd.org/changeset/base/191674 >> >> Log: >> Add experimental support for SATA interface power management. >> Feature is controlled by hint.ata.X.pm_level tunable: >> 0 - PM disabled, old behaviour, default. >> 1 - device is allowed to initiate PM state change, host is passive. >> 2 - host initiates PARTIAL state transition every time port is idle. >> 3 - host initiates SLUMBER state transition every time port is idle. > > Did I miss a man-page update for this? If yes, where is it, I would have > expected it in ata(4). There is none yet. >> PARTIAL state has up to 100us (50us for me) wakeup latency, but for my >> ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms >> (3.5ms >> for me) wakeup latency, but saves 0.8W of power. >> >> Modes 2 and 3 are implemented only for AHCI driver now. > > Does this mean it is for SATA devices only, or is this a feature of the > complete controller (ICH5 in my case) and also works with PATA drives? This feature is SATA-specific by definition. AFAIK there is no bus power management in PATA. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 14:10:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59CB106566C; Wed, 17 Jun 2009 14:10:18 +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 D3C068FC1C; Wed, 17 Jun 2009 14:10:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HEAIv4077941; Wed, 17 Jun 2009 14:10:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HEAImS077939; Wed, 17 Jun 2009 14:10:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906171410.n5HEAImS077939@svn.freebsd.org> From: Rick Macklem Date: Wed, 17 Jun 2009 14:10: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: r194363 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 14:10:19 -0000 Author: rmacklem Date: Wed Jun 17 14:10:18 2009 New Revision: 194363 URL: http://svn.freebsd.org/changeset/base/194363 Log: Fix handling of ".." in nfs_lookup() for the forced dismount case by cribbing the change made to the regular nfs client in r194358. Approved by: kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 14:00:56 2009 (r194362) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 14:10:18 2009 (r194363) @@ -992,22 +992,23 @@ nfs_lookup(struct vop_lookup_args *ap) struct componentname *cnp = ap->a_cnp; struct vnode *dvp = ap->a_dvp; struct vnode **vpp = ap->a_vpp; + struct mount *mp = dvp->v_mount; int flags = cnp->cn_flags; struct vnode *newvp; struct nfsmount *nmp; struct nfsnode *np; - int error = 0, attrflag, dattrflag; + int error = 0, attrflag, dattrflag, ltype; struct thread *td = cnp->cn_thread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; *vpp = NULLVP; - if ((flags & ISLASTCN) && (dvp->v_mount->mnt_flag & MNT_RDONLY) && + if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) return (EROFS); if (dvp->v_type != VDIR) return (ENOTDIR); - nmp = VFSTONFS(dvp->v_mount); + nmp = VFSTONFS(mp); np = VTONFS(dvp); /* For NFSv4, wait until any remove is done. */ @@ -1073,7 +1074,7 @@ nfs_lookup(struct vop_lookup_args *ap) } if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && (flags & ISLASTCN) && error == ENOENT) { - if (dvp->v_mount->mnt_flag & MNT_RDONLY) + if (mp->mnt_flag & MNT_RDONLY) error = EROFS; else error = EJUSTRETURN; @@ -1093,8 +1094,7 @@ nfs_lookup(struct vop_lookup_args *ap) FREE((caddr_t)nfhp, M_NFSFH); return (EISDIR); } - error = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, td, &np, - NULL); + error = nfscl_nget(mp, dvp, nfhp, cnp, td, &np, NULL); if (error) return (error); newvp = NFSTOV(np); @@ -1106,14 +1106,37 @@ nfs_lookup(struct vop_lookup_args *ap) return (0); } - if ((flags & ISDOTDOT)) { + if (flags & ISDOTDOT) { + ltype = VOP_ISLOCKED(dvp); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) { + VOP_UNLOCK(dvp, 0); + error = vfs_busy(mp, 0); + vn_lock(dvp, ltype | LK_RETRY); + if (error == 0 && (dvp->v_iflag & VI_DOOMED)) { + vfs_unbusy(mp); + error = ENOENT; + } + if (error != 0) + return (error); + } VOP_UNLOCK(dvp, 0); - error = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, td, &np, - NULL); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); - if (error) + error = nfscl_nget(mp, dvp, nfhp, cnp, td, &np, NULL); + if (error == 0) + newvp = NFSTOV(np); + vfs_unbusy(mp); + vn_lock(dvp, ltype | LK_RETRY); + if (dvp->v_iflag & VI_DOOMED) { + if (error == 0) { + if (newvp == dvp) + vrele(newvp); + else + vput(newvp); + } + error = ENOENT; + } + if (error != 0) return (error); - newvp = NFSTOV(np); if (attrflag) (void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); @@ -1125,8 +1148,7 @@ nfs_lookup(struct vop_lookup_args *ap) (void) nfscl_loadattrcache(&newvp, &nfsva, NULL, NULL, 0, 1); } else { - error = nfscl_nget(dvp->v_mount, dvp, nfhp, cnp, td, &np, - NULL); + error = nfscl_nget(mp, dvp, nfhp, cnp, td, &np, NULL); if (error) return (error); newvp = NFSTOV(np); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 14:32:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB181065687; Wed, 17 Jun 2009 14:32:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 690268FC18; Wed, 17 Jun 2009 14:32:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HEW8Xg078401; Wed, 17 Jun 2009 14:32:08 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HEW847078399; Wed, 17 Jun 2009 14:32:08 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200906171432.n5HEW847078399@svn.freebsd.org> From: Jamie Gritton Date: Wed, 17 Jun 2009 14:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194364 - head/usr.sbin/jls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 14:32:09 -0000 Author: jamie Date: Wed Jun 17 14:32:08 2009 New Revision: 194364 URL: http://svn.freebsd.org/changeset/base/194364 Log: Use the right jail parameters for -v (cpuset has changed to cpuset.id). Reported by: netchild Approved by: bz (mentor) Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Wed Jun 17 14:10:18 2009 (r194363) +++ head/usr.sbin/jls/jls.c Wed Jun 17 14:32:08 2009 (r194364) @@ -141,7 +141,7 @@ main(int argc, char **argv) add_param("path", NULL, PARAM_USER); add_param("name", NULL, PARAM_USER); add_param("dying", NULL, PARAM_USER); - add_param("cpuset", NULL, PARAM_USER); + add_param("cpuset.id", NULL, PARAM_USER); add_param("ip4.addr", NULL, PARAM_USER); add_param("ip6.addr", NULL, PARAM_USER | PARAM_OPT); } else { From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 14:47:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D23A1065679; Wed, 17 Jun 2009 14:47:07 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BCA68FC12; Wed, 17 Jun 2009 14:47:07 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HEl636078848; Wed, 17 Jun 2009 14:47:06 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HEl6Qg078846; Wed, 17 Jun 2009 14:47:06 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200906171447.n5HEl6Qg078846@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 17 Jun 2009 14:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194366 - head/usr.bin/ncal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 14:47:08 -0000 Author: ume Date: Wed Jun 17 14:47:06 2009 New Revision: 194366 URL: http://svn.freebsd.org/changeset/base/194366 Log: Fix column width of weekday names for multibyte locales. Noticed by: nyan Discussed with: matusita, takawata MFC after: 1 week Modified: head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Wed Jun 17 14:45:58 2009 (r194365) +++ head/usr.bin/ncal/ncal.c Wed Jun 17 14:47:06 2009 (r194366) @@ -446,13 +446,18 @@ printmonth(int y, int m, int jd_flag) { struct monthlines month; struct weekdays wds; - int i; + int i, len; mkmonth(y, m - 1, jd_flag, &month); mkweekdays(&wds); printf(" %ls %d\n", month.name, y); - for (i = 0; i != 7; i++) - wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); + for (i = 0; i != 7; i++) { + len = wcslen(wds.names[i]); + if (wcswidth(wds.names[i], len) == len) + wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); + else + wprintf(L"%.1ls%s\n", wds.names[i], month.lines[i]); + } if (flag_weeks) printf(" %s\n", month.weeks); } @@ -830,7 +835,7 @@ mkmonthb(int y, int m, int jd_flag, stru void mkweekdays(struct weekdays *wds) { - int i, len; + int i, len, width = 0; struct tm tm; wchar_t buf[20]; @@ -839,11 +844,15 @@ mkweekdays(struct weekdays *wds) for (i = 0; i != 7; i++) { tm.tm_wday = (i+1) % 7; wcsftime(buf, sizeof(buf), L"%a", &tm); - len = wcslen(buf); - if (len > 2) - len = 2; - wcscpy(wds->names[i], L" "); - wcsncpy(wds->names[i] + 2 - len, buf, len); + for (len = wcslen(buf); len > 0; --len) { + if ((width = wcswidth(buf, len)) <= 2) + break; + } + wmemset(wds->names[i], L'\0', 4); + if (width == 1) + wds->names[i][0] = L' '; + wcsncat(wds->names[i], buf, len); + wcsncat(wds->names[i], L" ", 3 - wcswidth(wds->names[i], 2)); } } From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 15:01:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DD11065686; Wed, 17 Jun 2009 15:01:01 +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 676A98FC12; Wed, 17 Jun 2009 15:01:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HF11Wm079238; Wed, 17 Jun 2009 15:01:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HF114t079229; Wed, 17 Jun 2009 15:01:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906171501.n5HF114t079229@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 17 Jun 2009 15:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194368 - in head/sys: compat/linux fs/nfsclient kern net netinet netinet6 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 15:01:01 -0000 Author: bz Date: Wed Jun 17 15:01:01 2009 New Revision: 194368 URL: http://svn.freebsd.org/changeset/base/194368 Log: Add explicit includes for jail.h to the files that need them and remove the "hidden" one from vimage.h. Modified: head/sys/compat/linux/linux_ioctl.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/kern/kern_sysctl.c head/sys/net/bpf.c head/sys/net/if_tun.c head/sys/netinet/tcp_subr.c head/sys/netinet6/in6_proto.c head/sys/sys/vimage.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/compat/linux/linux_ioctl.c Wed Jun 17 15:01:01 2009 (r194368) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jun 17 15:01:01 2009 (r194368) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/kern/kern_sysctl.c Wed Jun 17 15:01:01 2009 (r194368) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/net/bpf.c Wed Jun 17 15:01:01 2009 (r194368) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/net/if_tun.c ============================================================================== --- head/sys/net/if_tun.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/net/if_tun.c Wed Jun 17 15:01:01 2009 (r194368) @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/netinet/tcp_subr.c Wed Jun 17 15:01:01 2009 (r194368) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #ifdef INET6 Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/netinet6/in6_proto.c Wed Jun 17 15:01:01 2009 (r194368) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/sys/vimage.h ============================================================================== --- head/sys/sys/vimage.h Wed Jun 17 14:50:41 2009 (r194367) +++ head/sys/sys/vimage.h Wed Jun 17 15:01:01 2009 (r194368) @@ -35,9 +35,6 @@ #include #include -#ifdef VIMAGE -#include -#endif /* Interim userspace API. */ struct vi_req { From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 15:47:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8A61065675; Wed, 17 Jun 2009 15:47:32 +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 C03528FC2C; Wed, 17 Jun 2009 15:47:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 74A9C46C1F; Wed, 17 Jun 2009 11:47:32 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 52BD68A073; Wed, 17 Jun 2009 11:47:31 -0400 (EDT) From: John Baldwin To: Jeff Roberson Date: Wed, 17 Jun 2009 11:47:26 -0400 User-Agent: KMail/1.9.7 References: <200901290922.n0T9MuJ4047351@svn.freebsd.org> In-Reply-To: <200901290922.n0T9MuJ4047351@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906171147.26968.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 17 Jun 2009 11:47:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187880 - in head/sys: amd64/amd64 amd64/include i386/i386 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: Wed, 17 Jun 2009 15:47:34 -0000 On Thursday 29 January 2009 4:22:56 am Jeff Roberson wrote: > Author: jeff > Date: Thu Jan 29 09:22:56 2009 > New Revision: 187880 > URL: http://svn.freebsd.org/changeset/base/187880 > > Log: > - Allocate apic vectors on a per-cpu basis. This allows us to allocate > more irqs as we have more cpus. This is principally useful on systems > with msi devices which may want many irqs per-cpu. > > Discussed with: jhb > Sponsored by: Nokia It turns out that this completely breaks devices using multiple MSI (not MSI-X) messages. In MSI-X each interrupt has a separate address and data register, so each one can have an independent IDT vector and CPU. This is not the case with MSI. With MSI you only have a single address and data register set. If you have multiple messages, the OS is required to leave the bottom N (log_2 (count)) bits set to zero and the individual message is encoded by via those bottom N bits. This requires that multiple MSI messages be treated as a single group that all go to the same CPU. Furthermore, the block of IDT vectors for the group has to be aligned on an N bit boundary. This was the purpose of the apic_alloc_vectors() function you removed. I think that part of the change will need to be reverted. msi_alloc() will probably need to preallocate vectors again rather than deferring them to msi_enable_intr(). Also, we can move MSI groups around. I had changes in a p4 tree to basically fail to bind messages that weren't the first message in such a group. Those can be revived for this purpose. I think it is currently accidentally working for mav@'s AHCI tests because he does a bus_setup_intr() of all the interrupts in sequence during attach. That causes the IDT vectors to happen to all be contiguous on CPU 0 during boot. It would fail if the driver was kldloaded. Also, he must currently just be very lucky that the first IDT vector he allocates is properly aligned. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 16:34:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D45E106564A; Wed, 17 Jun 2009 16:34:40 +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 5ABF38FC0A; Wed, 17 Jun 2009 16:34:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HGYeBc081355; Wed, 17 Jun 2009 16:34:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HGYejl081352; Wed, 17 Jun 2009 16:34:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200906171634.n5HGYejl081352@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 17 Jun 2009 16:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194374 - in head/sys/powerpc: include 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, 17 Jun 2009 16:34:40 -0000 Author: nwhitehorn Date: Wed Jun 17 16:34:40 2009 New Revision: 194374 URL: http://svn.freebsd.org/changeset/base/194374 Log: Teach cpu_est_clockrate() about the G5's slightly different PMC. This allows the boot messages to include the CPU speed and makes possible the forthcoming cpufreq support for the PPC 970. Modified: head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Wed Jun 17 16:28:02 2009 (r194373) +++ head/sys/powerpc/include/spr.h Wed Jun 17 16:34:40 2009 (r194374) @@ -127,6 +127,8 @@ #define SPR_SPRG5 0x115 /* 4.. SPR General 5 */ #define SPR_SPRG6 0x116 /* 4.. SPR General 6 */ #define SPR_SPRG7 0x117 /* 4.. SPR General 7 */ +#define SPR_SCOMC 0x114 /* ... SCOM Address Register (970) */ +#define SPR_SCOMD 0x115 /* ... SCOM Data Register (970) */ #define SPR_ASR 0x118 /* ... Address Space Register (PPC64) */ #define SPR_EAR 0x11a /* .68 External Access Register */ #define SPR_PVR 0x11f /* 468 Processor Version Register */ @@ -302,6 +304,20 @@ #define SPR_DVC1 0x3b6 /* 4.. Data Value Compare 1 */ #define SPR_DVC2 0x3b7 /* 4.. Data Value Compare 2 */ #define SPR_MMCR0 0x3b8 /* .6. Monitor Mode Control Register 0 */ + +#define SPR_970MMCR0 0x31b /* ... Monitor Mode Control Register 0 (PPC 970) */ +#define SPR_970MMCR1 0x31e /* ... Monitor Mode Control Register 1 (PPC 970) */ +#define SPR_970MMCRA 0x312 /* ... Monitor Mode Control Register 2 (PPC 970) */ +#define SPR_970MMCR0 0x31b /* ... Monitor Mode Control Register 0 (PPC 970) */ +#define SPR_970PMC1 0x313 /* ... PMC 1 */ +#define SPR_970PMC2 0x314 /* ... PMC 2 */ +#define SPR_970PMC3 0x315 /* ... PMC 3 */ +#define SPR_970PMC4 0x316 /* ... PMC 4 */ +#define SPR_970PMC5 0x317 /* ... PMC 5 */ +#define SPR_970PMC6 0x318 /* ... PMC 6 */ +#define SPR_970PMC7 0x319 /* ... PMC 7 */ +#define SPR_970PMC8 0x31a /* ... PMC 8 */ + #define SPR_MMCR0_FC 0x80000000 /* Freeze counters */ #define SPR_MMCR0_FCS 0x40000000 /* Freeze counters in supervisor mode */ #define SPR_MMCR0_FCP 0x20000000 /* Freeze counters in user mode */ @@ -320,6 +336,8 @@ #define SPR_MMCR0_TRIGGER 0x00002000 /* Trigger */ #define SPR_MMCR0_PMC1SEL(x) ((x) << 6) /* PMC1 selector */ #define SPR_MMCR0_PMC2SEL(x) ((x) << 0) /* PMC2 selector */ +#define SPR_970MMCR0_PMC1SEL(x) ((x) << 6) /* PMC1 selector (970) */ +#define SPR_970MMCR0_PMC2SEL(x) ((x) << 1) /* PMC2 selector (970) */ #define SPR_SGR 0x3b9 /* 4.. Storage Guarded Register */ #define SPR_PMC1 0x3b9 /* .6. Performance Counter Register 1 */ #define SPR_DCWR 0x3ba /* 4.. Data Cache Write-through Register */ @@ -566,13 +584,18 @@ /* Performance counter declarations */ #define PMC_OVERFLOW 0x80000000 /* Counter has overflowed */ -/* The first five countable [non-]events are common to all the PMC's */ +/* The first five countable [non-]events are common to many PMC's */ #define PMCN_NONE 0 /* Count nothing */ #define PMCN_CYCLES 1 /* Processor cycles */ #define PMCN_ICOMP 2 /* Instructions completed */ #define PMCN_TBLTRANS 3 /* TBL bit transitions */ #define PCMN_IDISPATCH 4 /* Instructions dispatched */ +/* Similar things for the 970 PMC direct counters */ +#define PMC970N_NONE 0x8 /* Count nothing */ +#define PMC970N_CYCLES 0xf /* Processor cycles */ +#define PMC970N_ICOMP 0x9 /* Instructions completed */ + #if defined(AIM) #define SPR_ESR 0x3d4 /* 4.. Exception Syndrome Register */ Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Wed Jun 17 16:28:02 2009 (r194373) +++ head/sys/powerpc/powerpc/cpu.c Wed Jun 17 16:34:40 2009 (r194374) @@ -277,6 +277,12 @@ cpu_setup(u_int cpuid) if (bootverbose) cpu_print_cacheinfo(cpuid, vers); break; + case IBM970: + case IBM970FX: + case IBM970MP: + cpu_print_speed(); + printf("\n"); + break; default: printf("\n"); break; @@ -299,8 +305,11 @@ int cpu_est_clockrate(int cpu_id, uint64_t *cps) { uint16_t vers; + register_t msr; vers = mfpvr() >> 16; + msr = mfmsr(); + mtmsr(msr & ~PSL_EE); switch (vers) { case MPC7450: @@ -315,11 +324,33 @@ cpu_est_clockrate(int cpu_id, uint64_t * mtspr(SPR_MMCR0, SPR_MMCR0_FC); mtspr(SPR_PMC1, 0); mtspr(SPR_MMCR0, SPR_MMCR0_PMC1SEL(PMCN_CYCLES)); - DELAY(100000); - *cps = (mfspr(SPR_PMC1) * 10) + 4999; + DELAY(1000); + *cps = (mfspr(SPR_PMC1) * 1000) + 4999; + mtspr(SPR_MMCR0, SPR_MMCR0_FC); + + mtmsr(msr); + return (0); + case IBM970: + case IBM970FX: + case IBM970MP: + isync(); + mtspr(SPR_970MMCR0, SPR_MMCR0_FC); + isync(); + mtspr(SPR_970MMCR1, 0); + mtspr(SPR_970MMCRA, 0); + mtspr(SPR_970PMC1, 0); + mtspr(SPR_970MMCR0, + SPR_970MMCR0_PMC1SEL(PMC970N_CYCLES)); + isync(); + DELAY(1000); + powerpc_sync(); + mtspr(SPR_970MMCR0, SPR_MMCR0_FC); + *cps = (mfspr(SPR_970PMC1) * 1000) + 4999; + + mtmsr(msr); return (0); } - + return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 17:19:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7A9106566B; Wed, 17 Jun 2009 17:19:49 +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 38DCF8FC1B; Wed, 17 Jun 2009 17:19:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HHJnT3082443; Wed, 17 Jun 2009 17:19:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HHJnS1082440; Wed, 17 Jun 2009 17:19:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906171719.n5HHJnS1082440@svn.freebsd.org> From: Alan Cox Date: Wed, 17 Jun 2009 17:19: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: r194376 - 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: Wed, 17 Jun 2009 17:19:49 -0000 Author: alc Date: Wed Jun 17 17:19:48 2009 New Revision: 194376 URL: http://svn.freebsd.org/changeset/base/194376 Log: Refactor contigmalloc() into two functions: a simple front-end that deals with the malloc tag and calls a new back-end, kmem_alloc_contig(), that allocates the pages and maps them. The motivations for this change are two-fold: (1) A cache mode parameter will be added to kmem_alloc_contig(). In other words, kmem_alloc_contig() will be extended to support the allocation of memory with caller-specified caching. (2) The UMA allocation function that is used by the two jumbo frames zones can use kmem_alloc_contig() in place of contigmalloc() and thereby avoid having free jumbo frames held by the zone counted as live malloc()ed memory. Modified: head/sys/vm/vm_contig.c head/sys/vm/vm_extern.h Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Wed Jun 17 16:56:21 2009 (r194375) +++ head/sys/vm/vm_contig.c Wed Jun 17 17:19:48 2009 (r194376) @@ -193,7 +193,7 @@ vm_page_release_contig(vm_page_t m, vm_p * specified through the given flags, then the pages are zeroed * before they are mapped. */ -static void * +static vm_offset_t contigmapping(vm_map_t map, vm_size_t size, vm_page_t m, int flags) { vm_object_t object = kernel_object; @@ -202,7 +202,7 @@ contigmapping(vm_map_t map, vm_size_t si vm_map_lock(map); if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { vm_map_unlock(map); - return (NULL); + return (0); } vm_object_reference(object); vm_map_insert(map, object, addr - VM_MIN_KERNEL_ADDRESS, @@ -220,7 +220,7 @@ contigmapping(vm_map_t map, vm_size_t si VM_OBJECT_UNLOCK(object); vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); - return ((void *)addr); + return (addr); } void * @@ -234,6 +234,19 @@ contigmalloc( unsigned long boundary) { void *ret; + + ret = (void *)kmem_alloc_contig(kernel_map, size, flags, low, high, + alignment, boundary); + if (ret != NULL) + malloc_type_allocated(type, round_page(size)); + return (ret); +} + +vm_offset_t +kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, unsigned long alignment, unsigned long boundary) +{ + vm_offset_t ret; vm_page_t pages; unsigned long npgs; int actl, actmax, inactl, inactmax, tries; @@ -265,13 +278,11 @@ again: tries++; goto retry; } - ret = NULL; + ret = 0; } else { - ret = contigmapping(kernel_map, size, pages, flags); - if (ret == NULL) + ret = contigmapping(map, size, pages, flags); + if (ret == 0) vm_page_release_contig(pages, npgs); - else - malloc_type_allocated(type, npgs << PAGE_SHIFT); } return (ret); } Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Wed Jun 17 16:56:21 2009 (r194375) +++ head/sys/vm/vm_extern.h Wed Jun 17 17:19:48 2009 (r194376) @@ -44,6 +44,9 @@ struct vnode; int kernacc(void *, int, int); vm_offset_t kmem_alloc(vm_map_t, vm_size_t); +vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, + vm_paddr_t low, vm_paddr_t high, unsigned long alignment, + unsigned long boundary); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); vm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t); void kmem_free(vm_map_t, vm_offset_t, vm_size_t); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 17:57:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C436C106566C; Wed, 17 Jun 2009 17:57:52 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B21DC8FC08; Wed, 17 Jun 2009 17:57:52 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HHvqIQ083419; Wed, 17 Jun 2009 17:57:52 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HHvqu0083417; Wed, 17 Jun 2009 17:57:52 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906171757.n5HHvqu0083417@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 17:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194378 - head/sys/arm/xscale/ixp425 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 17:57:53 -0000 Author: sam Date: Wed Jun 17 17:57:52 2009 New Revision: 194378 URL: http://svn.freebsd.org/changeset/base/194378 Log: Add workaround to get IXP435 NPE-A working: reseting NPE-A after NPE-C causes both to become inoperative; this apparently was done by the original IAL code as a workaround for IMEM parity errors which we've not seen so just disable the reset. Note this problem does not occur on IXP425 boards. The linux driver does fuse-resets on each NPE but in the order NPE-A < NPE-B < NPE-C (when probing for which NPE's are present/operational); we may want to switch to a similar scheme but for now disable the resets until we see an issue. Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Jun 17 17:31:45 2009 (r194377) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Jun 17 17:57:52 2009 (r194378) @@ -804,20 +804,34 @@ static const uint32_t ixNpeDlCtxtRegRese IX_NPEDL_CTXT_REG_RESET_CINDEX, }; -#define IX_NPEDL_RESET_NPE_PARITY 0x0800 #define IX_NPEDL_PARITY_BIT_MASK 0x3F00FFFF #define IX_NPEDL_CONFIG_CTRL_REG_MASK 0x3F3FFFFF +#if 0 +/* + * Reset the NPE and its coprocessor using the + * fuse bits in the feature control register. + */ +static void +npe_reset(int npeid) +{ + uint32_t mask = EXP_FCTRL_NPEA << npeid; + uint32_t v; + + v = ixp4xx_read_feature_bits(); + ixp4xx_write_feature_bits(v &~ mask); + /* un-fuse and un-reset the NPE & coprocessor */ + ixp4xx_write_feature_bits(v | mask); +} +#endif + static int npe_cpu_reset(struct ixpnpe_softc *sc) { #define N(a) (sizeof(a) / sizeof(a[0])) - struct ixp425_softc *sa = - device_get_softc(device_get_parent(sc->sc_dev)); uint32_t ctxtReg; /* identifies Context Store reg (0-3) */ uint32_t regAddr; uint32_t regVal; - uint32_t resetNpeParity; uint32_t ixNpeConfigCtrlRegVal; int i, error = 0; @@ -935,33 +949,15 @@ npe_cpu_reset(struct ixpnpe_softc *sc) /* Reset the Watch-count register */ npe_reg_write(sc, IX_NPEDL_REG_OFFSET_WC, 0); - +#if 0 /* * WR IXA00055043 - Remove IMEM Parity Introduced by NPE Reset Operation + * XXX Removed because it breaks IXP435 operation; e.g. on Gateworks + * XXX 2358 boards reseting NPE-A after NPE-C is running causes both + * XXX npe's to stop working */ - - /* - * Reset the NPE and its coprocessor - to reset internal - * states and remove parity error. Note this makes no - * sense based on the documentation. The feature control - * register always reads back as 0 on the ixp425 and further - * the bit definition of NPEA/NPEB is off by 1 according to - * the Intel documention--so we're blindly following the - * Intel code w/o any real understanding. - */ - regVal = EXP_BUS_READ_4(sa, EXP_FCTRL_OFFSET); - DPRINTFn(2, sc->sc_dev, "%s: FCTRL 0x%x\n", __func__, regVal); - resetNpeParity = - IX_NPEDL_RESET_NPE_PARITY << (1 + device_get_unit(sc->sc_dev)); - DPRINTFn(2, sc->sc_dev, "%s: FCTRL fuse parity, write 0x%x\n", - __func__, regVal | resetNpeParity); - EXP_BUS_WRITE_4(sa, EXP_FCTRL_OFFSET, regVal | resetNpeParity); - - /* un-fuse and un-reset the NPE & coprocessor */ - DPRINTFn(2, sc->sc_dev, "%s: FCTRL unfuse parity, write 0x%x\n", - __func__, regVal & resetNpeParity); - EXP_BUS_WRITE_4(sa, EXP_FCTRL_OFFSET, regVal &~ resetNpeParity); - + npe_reset(sc->sc_npeid); +#endif /* * Call NpeMgr function to stop the NPE again after the Feature Control * has unfused and Un-Reset the NPE and its associated Coprocessors. From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 17:58:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21AD51065678; Wed, 17 Jun 2009 17:58:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 104638FC16; Wed, 17 Jun 2009 17:58:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HHwIBL083472; Wed, 17 Jun 2009 17:58:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HHwIlH083470; Wed, 17 Jun 2009 17:58:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906171758.n5HHwIlH083470@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 17:58: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: r194379 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 17:58:19 -0000 Author: sam Date: Wed Jun 17 17:58:18 2009 New Revision: 194379 URL: http://svn.freebsd.org/changeset/base/194379 Log: enable npe-a now that it works Modified: head/sys/arm/conf/CAMBRIA.hints Modified: head/sys/arm/conf/CAMBRIA.hints ============================================================================== --- head/sys/arm/conf/CAMBRIA.hints Wed Jun 17 17:57:52 2009 (r194378) +++ head/sys/arm/conf/CAMBRIA.hints Wed Jun 17 17:58:18 2009 (r194379) @@ -21,11 +21,11 @@ hint.npe.0.npeid="C" hint.npe.0.mac="C" hint.npe.0.mii="C" hint.npe.0.phy=1 -#hint.npe.1.at="ixp0" -#hint.npe.1.npeid="A" -#hint.npe.1.mac="A" -#hint.npe.1.mii="C" -#hint.npe.1.phy=2 +hint.npe.1.at="ixp0" +hint.npe.1.npeid="A" +hint.npe.1.mac="A" +hint.npe.1.mii="C" +hint.npe.1.phy=2 # FLASH hint.cfi.0.at="ixp0" From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 17:59:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F1F3106564A; Wed, 17 Jun 2009 17:59:37 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F186D8FC18; Wed, 17 Jun 2009 17:59:36 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HHxaUg083538; Wed, 17 Jun 2009 17:59:36 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HHxaiT083536; Wed, 17 Jun 2009 17:59:36 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200906171759.n5HHxaiT083536@svn.freebsd.org> From: Sam Leffler Date: Wed, 17 Jun 2009 17:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194380 - head/tools/tools/nanobsd/gateworks X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 17:59:37 -0000 Author: sam Date: Wed Jun 17 17:59:36 2009 New Revision: 194380 URL: http://svn.freebsd.org/changeset/base/194380 Log: update usb config; the old stack is gone Modified: head/tools/tools/nanobsd/gateworks/G2358 Modified: head/tools/tools/nanobsd/gateworks/G2358 ============================================================================== --- head/tools/tools/nanobsd/gateworks/G2358 Wed Jun 17 17:58:18 2009 (r194379) +++ head/tools/tools/nanobsd/gateworks/G2358 Wed Jun 17 17:59:36 2009 (r194380) @@ -113,16 +113,17 @@ options AH_SUPPORT_AR5416 #device cryptodev #device hifn # NB: Soekris minipci card known to work -# NB: must use old usb stack; new one does not work -makeoptions WITH_LEGACY # NB: required to get includes -device ousb -#options USB_DEBUG -device oohci -device oehci -device ougen +# NB: 2 USB 2.0 ports standard +device usb +options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +#options USB_DEBUG +device ehci +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) -device oaxe +#device ural +#device zyd +#device wlan_amrr -device umass -device scbus # SCSI bus (required for SCSI) -device da # Direct Access (disks) +device axe From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 18:44:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93EDA106566C; Wed, 17 Jun 2009 18:44:15 +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 822B88FC1A; Wed, 17 Jun 2009 18:44:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HIiFPV084604; Wed, 17 Jun 2009 18:44:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HIiFJd084602; Wed, 17 Jun 2009 18:44:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171844.n5HIiFJd084602@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 18:44: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: r194383 - 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, 17 Jun 2009 18:44:16 -0000 Author: jhb Date: Wed Jun 17 18:44:15 2009 New Revision: 194383 URL: http://svn.freebsd.org/changeset/base/194383 Log: - NOSTD results in lkmressys being used instead of lkmssys. - Mark nfsclnt as UNIMPL. It should have been NOSTD instead of NOIMPL back when it lived in nfsclient.ko, but it was removed from that a long time ago. Modified: head/sys/kern/syscalls.master Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Jun 17 18:42:13 2009 (r194382) +++ head/sys/kern/syscalls.master Wed Jun 17 18:44:15 2009 (r194383) @@ -28,7 +28,7 @@ ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically -; compiled in; sysent entry will be filled with lkmsys +; compiled in; sysent entry will be filled with lkmressys ; so the SYSCALL_MODULE macro works ; NOARGS same as STD except do not create structure in sys/sysproto.h ; NODEF same as STD except only have the entry in the syscall table @@ -668,7 +668,7 @@ int attrnamespace, \ const char *attrname); } 374 AUE_NULL STD { int __setugid(int flag); } -375 AUE_NULL NOIMPL { int nfsclnt(int flag, caddr_t argp); } +375 AUE_NULL UNIMPL nfsclnt 376 AUE_EACCESS STD { int eaccess(char *path, int flags); } 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT STD { int nmount(struct iovec *iovp, \ From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 18:46:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9502D106566C; Wed, 17 Jun 2009 18:46:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68AF88FC08; Wed, 17 Jun 2009 18:46:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HIkEgp084691; Wed, 17 Jun 2009 18:46:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HIkErI084688; Wed, 17 Jun 2009 18:46:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171846.n5HIkErI084688@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 18:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194384 - 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, 17 Jun 2009 18:46:15 -0000 Author: jhb Date: Wed Jun 17 18:46:14 2009 New Revision: 194384 URL: http://svn.freebsd.org/changeset/base/194384 Log: Remove the now-unused NOIMPL flag. It serves no useful purpose given the existing UNIMPL and NOSTD types. Modified: head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Jun 17 18:44:15 2009 (r194383) +++ head/sys/kern/makesyscalls.sh Wed Jun 17 18:46:14 2009 (r194384) @@ -326,7 +326,7 @@ s/\$//g } $3 == "STD" || $3 == "NODEF" || $3 == "NOARGS" || $3 == "NOPROTO" \ - || $3 == "NOIMPL" || $3 == "NOSTD" { + || $3 == "NOSTD" { parseline() printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp @@ -375,10 +375,7 @@ s/\$//g } printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 - if ($3 == "NOIMPL") { - printf("%s },", "nosys, AUE_NULL, NULL, 0, 0, 0") > sysent - column = column + length("nosys") + length("AUE_NULL") + 3 - } else if ($3 == "NOSTD") { + if ($3 == "NOSTD") { printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0") > sysent column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Jun 17 18:44:15 2009 (r194383) +++ head/sys/kern/syscalls.master Wed Jun 17 18:46:14 2009 (r194384) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT, -; NODEF, NOARGS, NOPROTO, NOIMPL, NOSTD, COMPAT4 +; NODEF, NOARGS, NOPROTO, NOSTD, COMPAT4 ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 18:52:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1871065670; Wed, 17 Jun 2009 18:52: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 0A4F08FC08; Wed, 17 Jun 2009 18:52:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HIqgiw084898; Wed, 17 Jun 2009 18:52:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HIqgD5084896; Wed, 17 Jun 2009 18:52:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171852.n5HIqgD5084896@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 18:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194386 - 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: Wed, 17 Jun 2009 18:52:43 -0000 Author: jhb Date: Wed Jun 17 18:52:42 2009 New Revision: 194386 URL: http://svn.freebsd.org/changeset/base/194386 Log: Retire the unused stub for the nfsclnt() system call. Modified: head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Jun 17 18:50:15 2009 (r194385) +++ head/lib/libc/sys/Symbol.map Wed Jun 17 18:52:42 2009 (r194386) @@ -196,7 +196,6 @@ FBSD_1.0 { nanosleep; netbsd_lchown; netbsd_msync; - nfsclnt; nfssvc; nfstat; nlstat; @@ -748,8 +747,6 @@ FBSDprivate_1.0 { __sys_netbsd_lchown; _netbsd_msync; __sys_netbsd_msync; - _nfsclnt; - __sys_nfsclnt; _nfssvc; __sys_nfssvc; _nfstat; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 18:55:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46098106564A; Wed, 17 Jun 2009 18:55:30 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19A7F8FC14; Wed, 17 Jun 2009 18:55:30 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HItTox084995; Wed, 17 Jun 2009 18:55:29 GMT (envelope-from snb@svn.freebsd.org) Received: (from snb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HItT1G084993; Wed, 17 Jun 2009 18:55:29 GMT (envelope-from snb@svn.freebsd.org) Message-Id: <200906171855.n5HItT1G084993@svn.freebsd.org> From: Sean Nicholas Barkas Date: Wed, 17 Jun 2009 18:55: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: r194387 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 18:55:31 -0000 Author: snb Date: Wed Jun 17 18:55:29 2009 New Revision: 194387 URL: http://svn.freebsd.org/changeset/base/194387 Log: Keep dirhash tailq locked throughout the entirety of ufsdirhash_destroy() to fix a potential race pointed out by pjd. Also use TAILQ_FOREACH_SAFE to iterate over dirhashes in ufsdirhash_lowmem(), so that we can continue iterating even after a dirhash is destroyed. Suggested by: pjd Tested by: pho Approved by: dwmalone (mentor) Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 17 18:52:42 2009 (r194386) +++ head/sys/ufs/ufs/ufs_dirhash.c Wed Jun 17 18:55:29 2009 (r194387) @@ -1191,16 +1191,14 @@ ufsdirhash_destroy(struct dirhash *dh) mem = dh->dh_memreq; dh->dh_memreq = 0; - /* Unlock everything, free the detached memory. */ + /* Unlock dirhash and free the detached memory. */ ufsdirhash_release(dh); - DIRHASHLIST_UNLOCK(); for (i = 0; i < narrays; i++) DIRHASH_BLKFREE(hash[i]); free(hash, M_DIRHASH); free(blkfree, M_DIRHASH); /* Account for the returned memory. */ - DIRHASHLIST_LOCK(); ufs_dirhashmem -= mem; return (mem); @@ -1247,7 +1245,7 @@ ufsdirhash_recycle(int wanted) static void ufsdirhash_lowmem() { - struct dirhash *dh; + struct dirhash *dh, *dh_temp; int memfreed = 0; /* XXX: this 10% may need to be adjusted */ int memwanted = ufs_dirhashmem / 10; @@ -1259,8 +1257,7 @@ ufsdirhash_lowmem() * Delete dirhashes not used for more than ufs_dirhashreclaimage * seconds. If we can't get a lock on the dirhash, it will be skipped. */ - for (dh = TAILQ_FIRST(&ufsdirhash_list); dh != NULL; dh = - TAILQ_NEXT(dh, dh_list)) { + TAILQ_FOREACH_SAFE(dh, &ufsdirhash_list, dh_list, dh_temp) { if (!sx_try_xlock(&dh->dh_lock)) continue; if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) @@ -1275,11 +1272,14 @@ ufsdirhash_lowmem() * of the dirhash list. The ones closest to the head should be the * oldest. */ - for (dh = TAILQ_FIRST(&ufsdirhash_list); memfreed < memwanted && - dh !=NULL; dh = TAILQ_NEXT(dh, dh_list)) { - if (!sx_try_xlock(&dh->dh_lock)) - continue; - memfreed += ufsdirhash_destroy(dh); + if (memfreed < memwanted) { + TAILQ_FOREACH_SAFE(dh, &ufsdirhash_list, dh_list, dh_temp) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + memfreed += ufsdirhash_destroy(dh); + if (memfreed >= memwanted) + break; + } } DIRHASHLIST_UNLOCK(); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 19:50:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEA97106564A; Wed, 17 Jun 2009 19:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB0738FC14; Wed, 17 Jun 2009 19:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HJoccq086251; Wed, 17 Jun 2009 19:50:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HJocFM086247; Wed, 17 Jun 2009 19:50:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171950.n5HJocFM086247@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 19:50: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: r194390 - in head/sys: compat/freebsd32 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, 17 Jun 2009 19:50:39 -0000 Author: jhb Date: Wed Jun 17 19:50:38 2009 New Revision: 194390 URL: http://svn.freebsd.org/changeset/base/194390 Log: - Add the ability to mix multiple flags seperated by pipe ('|') characters in the type field of system call tables. Specifically, one can now use the 'NO*' types as flags in addition to the 'COMPAT*' types. For example, to tag 'COMPAT*' system calls as living in a KLD via NOSTD. The COMPAT* type is required to be listed first in this case. - Add new functions 'type()' and 'flag()' to the embedded awk script in makesyscalls.sh that return true if a requested flag is found in the type field ($3). The flag() function checks all of the flags in the field, but type() only checks the first flag. type() is meant to be used in the top-level "switch" statement and flag() should be used otherwise. - Retire the CPT_NOA type, it is now replaced with "COMPAT|NOARGS" using the flags approach. - Tweak the comment descriptions of COMPAT[46] system calls so that they say "freebsd[46] foo" rather than "old foo". - Document the COMPAT6 type. - Sync comments in compat32 syscall table with the master table. Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Jun 17 19:40:53 2009 (r194389) +++ head/sys/compat/freebsd32/syscalls.master Wed Jun 17 19:50:38 2009 (r194390) @@ -5,15 +5,17 @@ ; System call name/number master file. ; Processed to created init_sysent.c, syscalls.c and syscall.h. -; Columns: number audit type nargs name alt{name,tag,rtyp}/comments +; Columns: number audit type name alt{name,tag,rtyp}/comments ; number system call number, must be in order ; audit the audit event associated with the system call ; A value of AUE_NULL means no auditing, but it also means that ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT, -; NODEF, NOARGS, NOPROTO, NOIMPL, NOSTD, COMPAT4 +; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, +; LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; The COMPAT* options may be combined with one or more NO* +; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different @@ -25,11 +27,12 @@ ; STD always included ; COMPAT included on COMPAT #ifdef ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) +; COMPAT6 included on COMPAT4 #ifdef (FreeBSD 6 compat) ; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically -; compiled in; sysent entry will be filled with lkmsys +; compiled in; sysent entry will be filled with lkmressys ; so the SYSCALL_MODULE macro works ; NOARGS same as STD except do not create structure in sys/sysproto.h ; NODEF same as STD except only have the entry in the syscall table Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Jun 17 19:40:53 2009 (r194389) +++ head/sys/kern/makesyscalls.sh Wed Jun 17 19:50:38 2009 (r194390) @@ -213,6 +213,19 @@ s/\$//g print exit 1 } + # Returns true if the type "name" is the first flag in the type field + function type(name, flags, n) { + n = split($3, flags, /\|/) + return (n > 0 && flags[1] == name) + } + # Returns true if the flag "name" is set in the type field + function flag(name, flags, i, n) { + n = split($3, flags, /\|/) + for (i = 1; i <= n; i++) + if (flags[i] == name) + return 1 + return 0 + } function align_sysent_comment(column) { printf("\t") > sysent column = column + 8 - column % 8 @@ -241,7 +254,7 @@ s/\$//g rettype="int" end=NF } - if ($3 == "NODEF") { + if (flag("NODEF")) { auditev="AUE_NULL" funcname=$4 argssize = "AS(" $6 ")" @@ -267,11 +280,11 @@ s/\$//g funcalias = funcname if (argalias == "") { argalias = funcname "_args" - if ($3 == "COMPAT") + if (flag("COMPAT")) argalias = "o" argalias - if ($3 == "COMPAT4") + if (flag("COMPAT4")) argalias = "freebsd4_" argalias - if ($3 == "COMPAT6") + if (flag("COMPAT6")) argalias = "freebsd6_" argalias } f++ @@ -325,8 +338,8 @@ s/\$//g flags = "0"; } - $3 == "STD" || $3 == "NODEF" || $3 == "NOARGS" || $3 == "NOPROTO" \ - || $3 == "NOSTD" { + type("STD") || type("NODEF") || type("NOARGS") || type("NOPROTO") \ + || type("NOSTD") { parseline() printf("\t/* %s */\n\tcase %d: {\n", funcname, syscall) > systrace printf("\t/* %s */\n\tcase %d:\n", funcname, syscall) > systracetmp @@ -352,8 +365,8 @@ s/\$//g } printf("\t\t*n_args = %d;\n\t\tbreak;\n\t}\n", argc) > systrace printf("\t\tbreak;\n") > systracetmp - if (argc != 0 && $3 != "NOARGS" && $3 != "NOPROTO" && \ - $3 != "NODEF") { + if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ + !flag("NODEF")) { printf("struct %s {\n", argalias) > sysarg for (i = 1; i <= argc; i++) printf("\tchar %s_l_[PADL_(%s)]; " \ @@ -363,10 +376,10 @@ s/\$//g argname[i], argtype[i]) > sysarg printf("};\n") > sysarg } - else if ($3 != "NOARGS" && $3 != "NOPROTO" && $3 != "NODEF") + else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF")) printf("struct %s {\n\tregister_t dummy;\n};\n", argalias) > sysarg - if ($3 != "NOPROTO" && $3 != "NODEF") { + if (!flag("NOPROTO") && !flag("NODEF")) { printf("%s\t%s(struct thread *, struct %s *)", rettype, funcname, argalias) > sysdcl printf(";\n") > sysdcl @@ -375,7 +388,7 @@ s/\$//g } printf("\t{ %s, (sy_call_t *)", argssize) > sysent column = 8 + 2 + length(argssize) + 15 - if ($3 == "NOSTD") { + if (flag("NOSTD")) { printf("%s },", "lkmressys, AUE_NULL, NULL, 0, 0, 0") > sysent column = column + length("lkmressys") + length("AUE_NULL") + 3 } else { @@ -386,7 +399,7 @@ s/\$//g printf("/* %d = %s */\n", syscall, funcalias) > sysent printf("\t\"%s\",\t\t\t/* %d = %s */\n", funcalias, syscall, funcalias) > sysnames - if ($3 != "NODEF") { + if (!flag("NODEF")) { printf("#define\t%s%s\t%d\n", syscallprefix, funcalias, syscall) > syshdr printf(" \\\n\t%s.o", funcalias) > sysmk @@ -394,28 +407,32 @@ s/\$//g syscall++ next } - $3 == "COMPAT" || $3 == "COMPAT4" || $3 == "COMPAT6" || $3 == "CPT_NOA" { - if ($3 == "COMPAT" || $3 == "CPT_NOA") { + type("COMPAT") || type("COMPAT4") || type("COMPAT6") { + if (flag("COMPAT")) { ncompat++ out = syscompat outdcl = syscompatdcl wrap = "compat" prefix = "o" - } else if ($3 == "COMPAT4") { + descr = "old" + } else if (flag("COMPAT4")) { ncompat4++ out = syscompat4 outdcl = syscompat4dcl wrap = "compat4" prefix = "freebsd4_" - } else if ($3 == "COMPAT6") { + descr = "freebsd4" + } else if (flag("COMPAT6")) { ncompat6++ out = syscompat6 outdcl = syscompat6dcl wrap = "compat6" prefix = "freebsd6_" + descr = "freebsd6" } parseline() - if (argc != 0 && $3 != "CPT_NOA") { + if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ + !flag("NODEF")) { printf("struct %s {\n", argalias) > out for (i = 1; i <= argc; i++) printf("\tchar %s_l_[PADL_(%s)]; %s %s; " \ @@ -425,22 +442,32 @@ s/\$//g argname[i], argtype[i]) > out printf("};\n") > out } - else if($3 != "CPT_NOA") + else if (!flag("NOARGS") && !flag("NOPROTO") && !flag("NODEF")) printf("struct %s {\n\tregister_t dummy;\n};\n", argalias) > sysarg - printf("%s\t%s%s(struct thread *, struct %s *);\n", - rettype, prefix, funcname, argalias) > outdcl - printf("\t{ %s(%s,%s), %s, NULL, 0, 0, %s },", - wrap, argssize, funcname, auditev, flags) > sysent - align_sysent_comment(8 + 9 + \ - length(argssize) + 1 + length(funcname) + length(auditev) + length(flags) + 4) - printf("/* %d = old %s */\n", syscall, funcalias) > sysent - printf("\t\"%s.%s\",\t\t/* %d = old %s */\n", - wrap, funcalias, syscall, funcalias) > sysnames - if ($3 == "COMPAT" || $3 == "CPT_NOA") { + if (!flag("NOPROTO") && !flag("NODEF")) { + printf("%s\t%s%s(struct thread *, struct %s *);\n", + rettype, prefix, funcname, argalias) > outdcl + } + if (flag("NOSTD")) { + printf("\t{ %s, (sy_call_t *)%s, %s, NULL, 0, 0, 0 },", + "0", "lkmressys", "AUE_NULL") > sysent + align_sysent_comment(8 + 2 + length("0") + 15 + \ + length("lkmressys") + length("AUE_NULL") + 3) + } else { + printf("\t{ %s(%s,%s), %s, NULL, 0, 0, %s },", + wrap, argssize, funcname, auditev, flags) > sysent + align_sysent_comment(8 + 9 + length(argssize) + 1 + \ + length(funcname) + length(auditev) + \ + length(flags) + 4) + } + printf("/* %d = %s %s */\n", syscall, descr, funcalias) > sysent + printf("\t\"%s.%s\",\t\t/* %d = %s %s */\n", + wrap, funcalias, syscall, descr, funcalias) > sysnames + if (flag("COMPAT")) { printf("\t\t\t\t/* %d is old %s */\n", syscall, funcalias) > syshdr - } else { + } else if (!flag("NODEF")) { printf("#define\t%s%s%s\t%d\n", syscallprefix, prefix, funcalias, syscall) > syshdr printf(" \\\n\t%s%s.o", prefix, funcalias) > sysmk @@ -448,7 +475,7 @@ s/\$//g syscall++ next } - $3 == "LIBCOMPAT" { + type("LIBCOMPAT") { ncompat++ parseline() printf("%s\to%s();\n", rettype, funcname) > syscompatdcl @@ -465,7 +492,7 @@ s/\$//g syscall++ next } - $3 == "OBSOL" { + type("OBSOL") { printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },") > sysent align_sysent_comment(34) printf("/* %d = obsolete %s */\n", syscall, comment) > sysent @@ -476,7 +503,7 @@ s/\$//g syscall++ next } - $3 == "UNIMPL" { + type("UNIMPL") { printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 },\t\t\t/* %d = %s */\n", syscall, comment) > sysent printf("\t\"#%d\",\t\t\t/* %d = %s */\n", Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Jun 17 19:40:53 2009 (r194389) +++ head/sys/kern/syscalls.master Wed Jun 17 19:50:38 2009 (r194390) @@ -11,8 +11,10 @@ ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL, COMPAT, CPT_NOA, LIBCOMPAT, -; NODEF, NOARGS, NOPROTO, NOSTD, COMPAT4 +; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, +; LIBCOMPAT, NODEF, NOARGS, NOPROTO, NOSTD +; The COMPAT* options may be combined with one or more NO* +; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different @@ -24,6 +26,7 @@ ; STD always included ; COMPAT included on COMPAT #ifdef ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) +; COMPAT6 included on COMPAT4 #ifdef (FreeBSD 6 compat) ; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only @@ -214,7 +217,7 @@ int protocol); } 98 AUE_CONNECT STD { int connect(int s, caddr_t name, \ int namelen); } -99 AUE_ACCEPT CPT_NOA { int accept(int s, caddr_t name, \ +99 AUE_ACCEPT COMPAT|NOARGS { int accept(int s, caddr_t name, \ int *anamelen); } accept accept_args int 100 AUE_GETPRIORITY STD { int getpriority(int which, int who); } 101 AUE_SEND COMPAT { int send(int s, caddr_t buf, int len, \ @@ -258,7 +261,7 @@ struct timezone *tzp); } 123 AUE_FCHOWN STD { int fchown(int fd, int uid, int gid); } 124 AUE_FCHMOD STD { int fchmod(int fd, int mode); } -125 AUE_RECVFROM CPT_NOA { int recvfrom(int s, caddr_t buf, \ +125 AUE_RECVFROM COMPAT|NOARGS { int recvfrom(int s, caddr_t buf, \ size_t len, int flags, caddr_t from, int \ *fromlenaddr); } recvfrom recvfrom_args \ int @@ -294,7 +297,7 @@ 148 AUE_QUOTACTL STD { int quotactl(char *path, int cmd, int uid, \ caddr_t arg); } 149 AUE_O_QUOTA COMPAT { int quota(void); } -150 AUE_GETSOCKNAME CPT_NOA { int getsockname(int fdec, \ +150 AUE_GETSOCKNAME COMPAT|NOARGS { int getsockname(int fdec, \ caddr_t asa, int *alen); } getsockname \ getsockname_args int From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 19:53:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6DF1065670; Wed, 17 Jun 2009 19:53:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAF158FC13; Wed, 17 Jun 2009 19:53:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HJrKXR086332; Wed, 17 Jun 2009 19:53:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HJrKl9086329; Wed, 17 Jun 2009 19:53:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171953.n5HJrKl9086329@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 19:53: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: r194391 - head/sys/i386/ibcs2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 19:53:21 -0000 Author: jhb Date: Wed Jun 17 19:53:20 2009 New Revision: 194391 URL: http://svn.freebsd.org/changeset/base/194391 Log: Regen for added flags field. Modified: head/sys/i386/ibcs2/ibcs2_isc_sysent.c head/sys/i386/ibcs2/ibcs2_xenix_sysent.c Modified: head/sys/i386/ibcs2/ibcs2_isc_sysent.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_isc_sysent.c Wed Jun 17 19:50:38 2009 (r194390) +++ head/sys/i386/ibcs2/ibcs2_isc_sysent.c Wed Jun 17 19:53:20 2009 (r194391) @@ -18,25 +18,25 @@ /* The casts are bogus but will do for now. */ struct sysent isc_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 1 = isc_setostype */ - { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0 }, /* 2 = ibcs2_rename */ - { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0 }, /* 3 = ibcs2_sigaction */ - { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0 }, /* 4 = ibcs2_sigprocmask */ - { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0 }, /* 5 = ibcs2_sigpending */ - { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 6 = getgroups */ - { AS(setgroups_args), (sy_call_t *)setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 7 = setgroups */ - { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0 }, /* 8 = ibcs2_pathconf */ - { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0 }, /* 9 = ibcs2_fpathconf */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 10 = nosys */ - { AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0 }, /* 11 = ibcs2_wait */ - { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0 }, /* 12 = setsid */ - { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0 }, /* 13 = getpid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 14 = isc_adduser */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 15 = isc_setuser */ - { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0 }, /* 16 = ibcs2_sysconf */ - { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 17 = ibcs2_sigsuspend */ - { AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0 }, /* 18 = ibcs2_symlink */ - { AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0 }, /* 19 = ibcs2_readlink */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 20 = isc_getmajor */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 0 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 1 = isc_setostype */ + { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0 }, /* 2 = ibcs2_rename */ + { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 3 = ibcs2_sigaction */ + { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0 }, /* 4 = ibcs2_sigprocmask */ + { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 5 = ibcs2_sigpending */ + { AS(getgroups_args), (sy_call_t *)getgroups, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 6 = getgroups */ + { AS(setgroups_args), (sy_call_t *)setgroups, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 7 = setgroups */ + { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0 }, /* 8 = ibcs2_pathconf */ + { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0 }, /* 9 = ibcs2_fpathconf */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 10 = nosys */ + { AS(ibcs2_wait_args), (sy_call_t *)ibcs2_wait, AUE_WAIT4, NULL, 0, 0, 0 }, /* 11 = ibcs2_wait */ + { 0, (sy_call_t *)setsid, AUE_SETSID, NULL, 0, 0, 0 }, /* 12 = setsid */ + { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0 }, /* 13 = getpid */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 14 = isc_adduser */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 15 = isc_setuser */ + { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0 }, /* 16 = ibcs2_sysconf */ + { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = ibcs2_sigsuspend */ + { AS(ibcs2_symlink_args), (sy_call_t *)ibcs2_symlink, AUE_SYMLINK, NULL, 0, 0, 0 }, /* 18 = ibcs2_symlink */ + { AS(ibcs2_readlink_args), (sy_call_t *)ibcs2_readlink, AUE_READLINK, NULL, 0, 0, 0 }, /* 19 = ibcs2_readlink */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 20 = isc_getmajor */ }; Modified: head/sys/i386/ibcs2/ibcs2_xenix_sysent.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_xenix_sysent.c Wed Jun 17 19:50:38 2009 (r194390) +++ head/sys/i386/ibcs2/ibcs2_xenix_sysent.c Wed Jun 17 19:53:20 2009 (r194391) @@ -17,61 +17,61 @@ /* The casts are bogus but will do for now. */ struct sysent xenix_sysent[] = { - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 0 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 1 = xenix_xlocking */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 2 = xenix_creatsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 3 = xenix_opensem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 4 = xenix_sigsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 5 = xenix_waitsem */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 6 = xenix_nbwaitsem */ - { AS(xenix_rdchk_args), (sy_call_t *)xenix_rdchk, AUE_NULL, NULL, 0, 0 }, /* 7 = xenix_rdchk */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 8 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 9 = nosys */ - { AS(xenix_chsize_args), (sy_call_t *)xenix_chsize, AUE_FTRUNCATE, NULL, 0, 0 }, /* 10 = xenix_chsize */ - { AS(xenix_ftime_args), (sy_call_t *)xenix_ftime, AUE_NULL, NULL, 0, 0 }, /* 11 = xenix_ftime */ - { AS(xenix_nap_args), (sy_call_t *)xenix_nap, AUE_NULL, NULL, 0, 0 }, /* 12 = xenix_nap */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 13 = xenix_sdget */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 14 = xenix_sdfree */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 15 = xenix_sdenter */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 16 = xenix_sdleave */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 17 = xenix_sdgetv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 18 = xenix_sdwaitv */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 19 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 20 = nosys */ - { 0, (sy_call_t *)xenix_scoinfo, AUE_NULL, NULL, 0, 0 }, /* 21 = xenix_scoinfo */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 22 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 23 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 24 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 25 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 26 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 27 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 28 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 29 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 30 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 31 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 32 = xenix_proctl */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 33 = xenix_execseg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 34 = xenix_unexecseg */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 35 = nosys */ - { AS(select_args), (sy_call_t *)select, AUE_SELECT, NULL, 0, 0 }, /* 36 = select */ - { AS(xenix_eaccess_args), (sy_call_t *)xenix_eaccess, AUE_EACCESS, NULL, 0, 0 }, /* 37 = xenix_eaccess */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 38 = xenix_paccess */ - { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0 }, /* 39 = ibcs2_sigaction */ - { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0 }, /* 40 = ibcs2_sigprocmask */ - { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0 }, /* 41 = ibcs2_sigpending */ - { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0 }, /* 42 = ibcs2_sigsuspend */ - { AS(ibcs2_getgroups_args), (sy_call_t *)ibcs2_getgroups, AUE_GETGROUPS, NULL, 0, 0 }, /* 43 = ibcs2_getgroups */ - { AS(ibcs2_setgroups_args), (sy_call_t *)ibcs2_setgroups, AUE_SETGROUPS, NULL, 0, 0 }, /* 44 = ibcs2_setgroups */ - { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0 }, /* 45 = ibcs2_sysconf */ - { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0 }, /* 46 = ibcs2_pathconf */ - { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0 }, /* 47 = ibcs2_fpathconf */ - { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0 }, /* 48 = ibcs2_rename */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 49 = nosys */ - { AS(xenix_utsname_args), (sy_call_t *)xenix_utsname, AUE_NULL, NULL, 0, 0 }, /* 50 = xenix_utsname */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 51 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 52 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 53 = nosys */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 54 = nosys */ - { AS(getitimer_args), (sy_call_t *)getitimer, AUE_GETITIMER, NULL, 0, 0 }, /* 55 = getitimer */ - { AS(setitimer_args), (sy_call_t *)setitimer, AUE_SETITIMER, NULL, 0, 0 }, /* 56 = setitimer */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 0 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 1 = xenix_xlocking */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 2 = xenix_creatsem */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 3 = xenix_opensem */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 4 = xenix_sigsem */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 5 = xenix_waitsem */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 6 = xenix_nbwaitsem */ + { AS(xenix_rdchk_args), (sy_call_t *)xenix_rdchk, AUE_NULL, NULL, 0, 0, 0 }, /* 7 = xenix_rdchk */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 8 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 9 = nosys */ + { AS(xenix_chsize_args), (sy_call_t *)xenix_chsize, AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 10 = xenix_chsize */ + { AS(xenix_ftime_args), (sy_call_t *)xenix_ftime, AUE_NULL, NULL, 0, 0, 0 }, /* 11 = xenix_ftime */ + { AS(xenix_nap_args), (sy_call_t *)xenix_nap, AUE_NULL, NULL, 0, 0, 0 }, /* 12 = xenix_nap */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 13 = xenix_sdget */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 14 = xenix_sdfree */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 15 = xenix_sdenter */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 16 = xenix_sdleave */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = xenix_sdgetv */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 18 = xenix_sdwaitv */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 19 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 20 = nosys */ + { 0, (sy_call_t *)xenix_scoinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 21 = xenix_scoinfo */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 22 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 23 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 24 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 25 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 26 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 27 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 28 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 29 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 30 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 31 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 32 = xenix_proctl */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 33 = xenix_execseg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 34 = xenix_unexecseg */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 35 = nosys */ + { AS(select_args), (sy_call_t *)select, AUE_SELECT, NULL, 0, 0, 0 }, /* 36 = select */ + { AS(xenix_eaccess_args), (sy_call_t *)xenix_eaccess, AUE_EACCESS, NULL, 0, 0, 0 }, /* 37 = xenix_eaccess */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 38 = xenix_paccess */ + { AS(ibcs2_sigaction_args), (sy_call_t *)ibcs2_sigaction, AUE_NULL, NULL, 0, 0, 0 }, /* 39 = ibcs2_sigaction */ + { AS(ibcs2_sigprocmask_args), (sy_call_t *)ibcs2_sigprocmask, AUE_NULL, NULL, 0, 0, 0 }, /* 40 = ibcs2_sigprocmask */ + { AS(ibcs2_sigpending_args), (sy_call_t *)ibcs2_sigpending, AUE_NULL, NULL, 0, 0, 0 }, /* 41 = ibcs2_sigpending */ + { AS(ibcs2_sigsuspend_args), (sy_call_t *)ibcs2_sigsuspend, AUE_NULL, NULL, 0, 0, 0 }, /* 42 = ibcs2_sigsuspend */ + { AS(ibcs2_getgroups_args), (sy_call_t *)ibcs2_getgroups, AUE_GETGROUPS, NULL, 0, 0, 0 }, /* 43 = ibcs2_getgroups */ + { AS(ibcs2_setgroups_args), (sy_call_t *)ibcs2_setgroups, AUE_SETGROUPS, NULL, 0, 0, 0 }, /* 44 = ibcs2_setgroups */ + { AS(ibcs2_sysconf_args), (sy_call_t *)ibcs2_sysconf, AUE_NULL, NULL, 0, 0, 0 }, /* 45 = ibcs2_sysconf */ + { AS(ibcs2_pathconf_args), (sy_call_t *)ibcs2_pathconf, AUE_PATHCONF, NULL, 0, 0, 0 }, /* 46 = ibcs2_pathconf */ + { AS(ibcs2_fpathconf_args), (sy_call_t *)ibcs2_fpathconf, AUE_FPATHCONF, NULL, 0, 0, 0 }, /* 47 = ibcs2_fpathconf */ + { AS(ibcs2_rename_args), (sy_call_t *)ibcs2_rename, AUE_RENAME, NULL, 0, 0, 0 }, /* 48 = ibcs2_rename */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 49 = nosys */ + { AS(xenix_utsname_args), (sy_call_t *)xenix_utsname, AUE_NULL, NULL, 0, 0, 0 }, /* 50 = xenix_utsname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 51 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 52 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 53 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 54 = nosys */ + { AS(getitimer_args), (sy_call_t *)getitimer, AUE_GETITIMER, NULL, 0, 0, 0 }, /* 55 = getitimer */ + { AS(setitimer_args), (sy_call_t *)setitimer, AUE_SETITIMER, NULL, 0, 0, 0 }, /* 56 = setitimer */ }; From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 19:53:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEB91065670; Wed, 17 Jun 2009 19:53:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB338FC26; Wed, 17 Jun 2009 19:53:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HJrlhv086383; Wed, 17 Jun 2009 19:53:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HJrllq086372; Wed, 17 Jun 2009 19:53:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906171953.n5HJrllq086372@svn.freebsd.org> From: John Baldwin Date: Wed, 17 Jun 2009 19:53: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: r194392 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 19:53:48 -0000 Author: jhb Date: Wed Jun 17 19:53:47 2009 New Revision: 194392 URL: http://svn.freebsd.org/changeset/base/194392 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #define FREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ const char *freebsd32_syscallnames[] = { @@ -25,7 +25,7 @@ const char *freebsd32_syscallnames[] = { "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "break", /* 17 = break */ - "compat4.freebsd32_getfsstat", /* 18 = old freebsd32_getfsstat */ + "compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */ "obs_olseek", /* 19 = obsolete olseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ @@ -164,8 +164,8 @@ const char *freebsd32_syscallnames[] = { "#154", /* 154 = nlm_syscall */ "#155", /* 155 = nfssvc */ "obs_ogetdirentries", /* 156 = obsolete ogetdirentries */ - "compat4.freebsd32_statfs", /* 157 = old freebsd32_statfs */ - "compat4.freebsd32_fstatfs", /* 158 = old freebsd32_fstatfs */ + "compat4.freebsd32_statfs", /* 157 = freebsd4 freebsd32_statfs */ + "compat4.freebsd32_fstatfs", /* 158 = freebsd4 freebsd32_fstatfs */ "#159", /* 159 = nosys */ "#160", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ @@ -180,8 +180,8 @@ const char *freebsd32_syscallnames[] = { "freebsd32_msgsys", /* 170 = freebsd32_msgsys */ "freebsd32_shmsys", /* 171 = freebsd32_shmsys */ "#172", /* 172 = nosys */ - "compat6.freebsd32_pread", /* 173 = old freebsd32_pread */ - "compat6.freebsd32_pwrite", /* 174 = old freebsd32_pwrite */ + "compat6.freebsd32_pread", /* 173 = freebsd6 freebsd32_pread */ + "compat6.freebsd32_pwrite", /* 174 = freebsd6 freebsd32_pwrite */ "#175", /* 175 = nosys */ "ntp_adjtime", /* 176 = ntp_adjtime */ "#177", /* 177 = sfork */ @@ -204,11 +204,11 @@ const char *freebsd32_syscallnames[] = { "getrlimit", /* 194 = getrlimit */ "setrlimit", /* 195 = setrlimit */ "freebsd32_getdirentries", /* 196 = freebsd32_getdirentries */ - "compat6.freebsd32_mmap", /* 197 = old freebsd32_mmap */ + "compat6.freebsd32_mmap", /* 197 = freebsd6 freebsd32_mmap */ "__syscall", /* 198 = __syscall */ - "compat6.freebsd32_lseek", /* 199 = old freebsd32_lseek */ - "compat6.freebsd32_truncate", /* 200 = old freebsd32_truncate */ - "compat6.freebsd32_ftruncate", /* 201 = old freebsd32_ftruncate */ + "compat6.freebsd32_lseek", /* 199 = freebsd6 freebsd32_lseek */ + "compat6.freebsd32_truncate", /* 200 = freebsd6 freebsd32_truncate */ + "compat6.freebsd32_ftruncate", /* 201 = freebsd6 freebsd32_ftruncate */ "freebsd32_sysctl", /* 202 = freebsd32_sysctl */ "mlock", /* 203 = mlock */ "munlock", /* 204 = munlock */ @@ -304,7 +304,7 @@ const char *freebsd32_syscallnames[] = { "#294", /* 294 = nosys */ "#295", /* 295 = nosys */ "#296", /* 296 = nosys */ - "compat4.freebsd32_fhstatfs", /* 297 = old freebsd32_fhstatfs */ + "compat4.freebsd32_fhstatfs", /* 297 = freebsd4 freebsd32_fhstatfs */ "fhopen", /* 298 = fhopen */ "fhstat", /* 299 = fhstat */ "modnext", /* 300 = modnext */ @@ -343,15 +343,15 @@ const char *freebsd32_syscallnames[] = { "sched_get_priority_min", /* 333 = sched_get_priority_min */ "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ "utrace", /* 335 = utrace */ - "compat4.freebsd32_sendfile", /* 336 = old freebsd32_sendfile */ + "compat4.freebsd32_sendfile", /* 336 = freebsd4 freebsd32_sendfile */ "kldsym", /* 337 = kldsym */ "freebsd32_jail", /* 338 = freebsd32_jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ - "compat4.freebsd32_sigaction", /* 342 = old freebsd32_sigaction */ + "compat4.freebsd32_sigaction", /* 342 = freebsd4 freebsd32_sigaction */ "sigpending", /* 343 = sigpending */ - "compat4.freebsd32_sigreturn", /* 344 = old freebsd32_sigreturn */ + "compat4.freebsd32_sigreturn", /* 344 = freebsd4 freebsd32_sigreturn */ "freebsd32_sigtimedwait", /* 345 = freebsd32_sigtimedwait */ "freebsd32_sigwaitinfo", /* 346 = freebsd32_sigwaitinfo */ "__acl_get_file", /* 347 = __acl_get_file */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #include "opt_compat.h" @@ -56,7 +56,7 @@ struct sysent freebsd32_sysent[] = { { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0, 0 }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0 }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0 }, /* 18 = old freebsd32_getfsstat */ + { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0 }, /* 18 = freebsd4 freebsd32_getfsstat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 19 = obsolete olseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0 }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0 }, /* 21 = mount */ @@ -195,8 +195,8 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 154 = nlm_syscall */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 155 = nfssvc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 156 = obsolete ogetdirentries */ - { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0, 0 }, /* 157 = old freebsd32_statfs */ - { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0, 0 }, /* 158 = old freebsd32_fstatfs */ + { compat4(AS(freebsd4_freebsd32_statfs_args),freebsd32_statfs), AUE_STATFS, NULL, 0, 0, 0 }, /* 157 = freebsd4 freebsd32_statfs */ + { compat4(AS(freebsd4_freebsd32_fstatfs_args),freebsd32_fstatfs), AUE_FSTATFS, NULL, 0, 0, 0 }, /* 158 = freebsd4 freebsd32_fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 159 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0, 0 }, /* 161 = getfh */ @@ -211,8 +211,8 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_msgsys_args), (sy_call_t *)freebsd32_msgsys, AUE_MSGSYS, NULL, 0, 0, 0 }, /* 170 = freebsd32_msgsys */ { AS(freebsd32_shmsys_args), (sy_call_t *)freebsd32_shmsys, AUE_SHMSYS, NULL, 0, 0, 0 }, /* 171 = freebsd32_shmsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 172 = nosys */ - { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0, 0 }, /* 173 = old freebsd32_pread */ - { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0, 0 }, /* 174 = old freebsd32_pwrite */ + { compat6(AS(freebsd6_freebsd32_pread_args),freebsd32_pread), AUE_PREAD, NULL, 0, 0, 0 }, /* 173 = freebsd6 freebsd32_pread */ + { compat6(AS(freebsd6_freebsd32_pwrite_args),freebsd32_pwrite), AUE_PWRITE, NULL, 0, 0, 0 }, /* 174 = freebsd6 freebsd32_pwrite */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 175 = nosys */ { AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0, 0 }, /* 176 = ntp_adjtime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 177 = sfork */ @@ -235,11 +235,11 @@ struct sysent freebsd32_sysent[] = { { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0, 0 }, /* 194 = getrlimit */ { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0, 0 }, /* 195 = setrlimit */ { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 196 = freebsd32_getdirentries */ - { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0, 0 }, /* 197 = old freebsd32_mmap */ + { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0, 0 }, /* 197 = freebsd6 freebsd32_mmap */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 198 = __syscall */ - { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0 }, /* 199 = old freebsd32_lseek */ - { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 200 = old freebsd32_truncate */ - { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 201 = old freebsd32_ftruncate */ + { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0 }, /* 199 = freebsd6 freebsd32_lseek */ + { compat6(AS(freebsd6_freebsd32_truncate_args),freebsd32_truncate), AUE_TRUNCATE, NULL, 0, 0, 0 }, /* 200 = freebsd6 freebsd32_truncate */ + { compat6(AS(freebsd6_freebsd32_ftruncate_args),freebsd32_ftruncate), AUE_FTRUNCATE, NULL, 0, 0, 0 }, /* 201 = freebsd6 freebsd32_ftruncate */ { AS(freebsd32_sysctl_args), (sy_call_t *)freebsd32_sysctl, AUE_SYSCTL, NULL, 0, 0, 0 }, /* 202 = freebsd32_sysctl */ { AS(mlock_args), (sy_call_t *)mlock, AUE_MLOCK, NULL, 0, 0, 0 }, /* 203 = mlock */ { AS(munlock_args), (sy_call_t *)munlock, AUE_MUNLOCK, NULL, 0, 0, 0 }, /* 204 = munlock */ @@ -335,7 +335,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 294 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 295 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0, 0 }, /* 297 = old freebsd32_fhstatfs */ + { compat4(AS(freebsd4_freebsd32_fhstatfs_args),freebsd32_fhstatfs), AUE_FHSTATFS, NULL, 0, 0, 0 }, /* 297 = freebsd4 freebsd32_fhstatfs */ { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0, 0 }, /* 298 = fhopen */ { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0, 0 }, /* 299 = fhstat */ { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0, 0 }, /* 300 = modnext */ @@ -374,15 +374,15 @@ struct sysent freebsd32_sysent[] = { { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0, 0 }, /* 333 = sched_get_priority_min */ { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0 }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, 0 }, /* 336 = old freebsd32_sendfile */ + { compat4(AS(freebsd4_freebsd32_sendfile_args),freebsd32_sendfile), AUE_SENDFILE, NULL, 0, 0, 0 }, /* 336 = freebsd4 freebsd32_sendfile */ { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0, 0 }, /* 337 = kldsym */ { AS(freebsd32_jail_args), (sy_call_t *)freebsd32_jail, AUE_JAIL, NULL, 0, 0, 0 }, /* 338 = freebsd32_jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0 }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, 0 }, /* 342 = old freebsd32_sigaction */ + { compat4(AS(freebsd4_freebsd32_sigaction_args),freebsd32_sigaction), AUE_SIGACTION, NULL, 0, 0, 0 }, /* 342 = freebsd4 freebsd32_sigaction */ { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 344 = old freebsd32_sigreturn */ + { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 344 = freebsd4 freebsd32_sigreturn */ { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, 0 }, /* 345 = freebsd32_sigtimedwait */ { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 346 = freebsd32_sigwaitinfo */ { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0, 0 }, /* 347 = __acl_get_file */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/kern/init_sysent.c Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #include "opt_compat.h" @@ -46,7 +46,7 @@ struct sysent sysent[] = { { AS(chmod_args), (sy_call_t *)chmod, AUE_CHMOD, NULL, 0, 0, 0 }, /* 15 = chmod */ { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0 }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0 }, /* 17 = break */ - { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0 }, /* 18 = old getfsstat */ + { compat4(AS(freebsd4_getfsstat_args),getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0 }, /* 18 = freebsd4 getfsstat */ { compat(AS(olseek_args),lseek), AUE_LSEEK, NULL, 0, 0, 0 }, /* 19 = old lseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0 }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0 }, /* 21 = mount */ @@ -185,14 +185,14 @@ struct sysent sysent[] = { { AS(nlm_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 154 = nlm_syscall */ { AS(nfssvc_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0 }, /* 155 = nfssvc */ { compat(AS(ogetdirentries_args),getdirentries), AUE_GETDIRENTRIES, NULL, 0, 0, 0 }, /* 156 = old getdirentries */ - { compat4(AS(freebsd4_statfs_args),statfs), AUE_STATFS, NULL, 0, 0, 0 }, /* 157 = old statfs */ - { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0, 0 }, /* 158 = old fstatfs */ + { compat4(AS(freebsd4_statfs_args),statfs), AUE_STATFS, NULL, 0, 0, 0 }, /* 157 = freebsd4 statfs */ + { compat4(AS(freebsd4_fstatfs_args),fstatfs), AUE_FSTATFS, NULL, 0, 0, 0 }, /* 158 = freebsd4 fstatfs */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 159 = nosys */ { AS(lgetfh_args), (sy_call_t *)lgetfh, AUE_LGETFH, NULL, 0, 0, 0 }, /* 160 = lgetfh */ { AS(getfh_args), (sy_call_t *)getfh, AUE_NFS_GETFH, NULL, 0, 0, 0 }, /* 161 = getfh */ - { compat4(AS(freebsd4_getdomainname_args),getdomainname), AUE_SYSCTL, NULL, 0, 0, 0 }, /* 162 = old getdomainname */ - { compat4(AS(freebsd4_setdomainname_args),setdomainname), AUE_SYSCTL, NULL, 0, 0, 0 }, /* 163 = old setdomainname */ - { compat4(AS(freebsd4_uname_args),uname), AUE_NULL, NULL, 0, 0, 0 }, /* 164 = old uname */ + { compat4(AS(freebsd4_getdomainname_args),getdomainname), AUE_SYSCTL, NULL, 0, 0, 0 }, /* 162 = freebsd4 getdomainname */ + { compat4(AS(freebsd4_setdomainname_args),setdomainname), AUE_SYSCTL, NULL, 0, 0, 0 }, /* 163 = freebsd4 setdomainname */ + { compat4(AS(freebsd4_uname_args),uname), AUE_NULL, NULL, 0, 0, 0 }, /* 164 = freebsd4 uname */ { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0, 0 }, /* 165 = sysarch */ { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0, 0 }, /* 166 = rtprio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 167 = nosys */ @@ -325,7 +325,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 294 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 295 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 296 = nosys */ - { compat4(AS(freebsd4_fhstatfs_args),fhstatfs), AUE_FHSTATFS, NULL, 0, 0, 0 }, /* 297 = old fhstatfs */ + { compat4(AS(freebsd4_fhstatfs_args),fhstatfs), AUE_FHSTATFS, NULL, 0, 0, 0 }, /* 297 = freebsd4 fhstatfs */ { AS(fhopen_args), (sy_call_t *)fhopen, AUE_FHOPEN, NULL, 0, 0, 0 }, /* 298 = fhopen */ { AS(fhstat_args), (sy_call_t *)fhstat, AUE_FHSTAT, NULL, 0, 0, 0 }, /* 299 = fhstat */ { AS(modnext_args), (sy_call_t *)modnext, AUE_NULL, NULL, 0, 0, 0 }, /* 300 = modnext */ @@ -364,15 +364,15 @@ struct sysent sysent[] = { { AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min, AUE_NULL, NULL, 0, 0, 0 }, /* 333 = sched_get_priority_min */ { AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval, AUE_NULL, NULL, 0, 0, 0 }, /* 334 = sched_rr_get_interval */ { AS(utrace_args), (sy_call_t *)utrace, AUE_NULL, NULL, 0, 0, 0 }, /* 335 = utrace */ - { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, 0 }, /* 336 = old sendfile */ + { compat4(AS(freebsd4_sendfile_args),sendfile), AUE_SENDFILE, NULL, 0, 0, 0 }, /* 336 = freebsd4 sendfile */ { AS(kldsym_args), (sy_call_t *)kldsym, AUE_NULL, NULL, 0, 0, 0 }, /* 337 = kldsym */ { AS(jail_args), (sy_call_t *)jail, AUE_JAIL, NULL, 0, 0, 0 }, /* 338 = jail */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 339 = pioctl */ { AS(sigprocmask_args), (sy_call_t *)sigprocmask, AUE_SIGPROCMASK, NULL, 0, 0, 0 }, /* 340 = sigprocmask */ { AS(sigsuspend_args), (sy_call_t *)sigsuspend, AUE_SIGSUSPEND, NULL, 0, 0, 0 }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, 0 }, /* 342 = old sigaction */ + { compat4(AS(freebsd4_sigaction_args),sigaction), AUE_SIGACTION, NULL, 0, 0, 0 }, /* 342 = freebsd4 sigaction */ { AS(sigpending_args), (sy_call_t *)sigpending, AUE_SIGPENDING, NULL, 0, 0, 0 }, /* 343 = sigpending */ - { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 344 = old sigreturn */ + { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, 0 }, /* 344 = freebsd4 sigreturn */ { AS(sigtimedwait_args), (sy_call_t *)sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, 0 }, /* 345 = sigtimedwait */ { AS(sigwaitinfo_args), (sy_call_t *)sigwaitinfo, AUE_NULL, NULL, 0, 0, 0 }, /* 346 = sigwaitinfo */ { AS(__acl_get_file_args), (sy_call_t *)__acl_get_file, AUE_NULL, NULL, 0, 0, 0 }, /* 347 = __acl_get_file */ @@ -403,7 +403,7 @@ struct sysent sysent[] = { { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, 0 }, /* 372 = extattr_get_fd */ { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, 0 }, /* 373 = extattr_delete_fd */ { AS(__setugid_args), (sy_call_t *)__setugid, AUE_NULL, NULL, 0, 0, 0 }, /* 374 = __setugid */ - { AS(nfsclnt_args), (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 375 = nfsclnt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 375 = nfsclnt */ { AS(eaccess_args), (sy_call_t *)eaccess, AUE_EACCESS, NULL, 0, 0, 0 }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 377 = afs_syscall */ { AS(nmount_args), (sy_call_t *)nmount, AUE_NMOUNT, NULL, 0, 0, 0 }, /* 378 = nmount */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/kern/syscalls.c Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ const char *syscallnames[] = { @@ -25,7 +25,7 @@ const char *syscallnames[] = { "chmod", /* 15 = chmod */ "chown", /* 16 = chown */ "break", /* 17 = break */ - "compat4.getfsstat", /* 18 = old getfsstat */ + "compat4.getfsstat", /* 18 = freebsd4 getfsstat */ "compat.lseek", /* 19 = old lseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ @@ -164,14 +164,14 @@ const char *syscallnames[] = { "nlm_syscall", /* 154 = nlm_syscall */ "nfssvc", /* 155 = nfssvc */ "compat.getdirentries", /* 156 = old getdirentries */ - "compat4.statfs", /* 157 = old statfs */ - "compat4.fstatfs", /* 158 = old fstatfs */ + "compat4.statfs", /* 157 = freebsd4 statfs */ + "compat4.fstatfs", /* 158 = freebsd4 fstatfs */ "#159", /* 159 = nosys */ "lgetfh", /* 160 = lgetfh */ "getfh", /* 161 = getfh */ - "compat4.getdomainname", /* 162 = old getdomainname */ - "compat4.setdomainname", /* 163 = old setdomainname */ - "compat4.uname", /* 164 = old uname */ + "compat4.getdomainname", /* 162 = freebsd4 getdomainname */ + "compat4.setdomainname", /* 163 = freebsd4 setdomainname */ + "compat4.uname", /* 164 = freebsd4 uname */ "sysarch", /* 165 = sysarch */ "rtprio", /* 166 = rtprio */ "#167", /* 167 = nosys */ @@ -304,7 +304,7 @@ const char *syscallnames[] = { "#294", /* 294 = nosys */ "#295", /* 295 = nosys */ "#296", /* 296 = nosys */ - "compat4.fhstatfs", /* 297 = old fhstatfs */ + "compat4.fhstatfs", /* 297 = freebsd4 fhstatfs */ "fhopen", /* 298 = fhopen */ "fhstat", /* 299 = fhstat */ "modnext", /* 300 = modnext */ @@ -343,15 +343,15 @@ const char *syscallnames[] = { "sched_get_priority_min", /* 333 = sched_get_priority_min */ "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ "utrace", /* 335 = utrace */ - "compat4.sendfile", /* 336 = old sendfile */ + "compat4.sendfile", /* 336 = freebsd4 sendfile */ "kldsym", /* 337 = kldsym */ "jail", /* 338 = jail */ "#339", /* 339 = pioctl */ "sigprocmask", /* 340 = sigprocmask */ "sigsuspend", /* 341 = sigsuspend */ - "compat4.sigaction", /* 342 = old sigaction */ + "compat4.sigaction", /* 342 = freebsd4 sigaction */ "sigpending", /* 343 = sigpending */ - "compat4.sigreturn", /* 344 = old sigreturn */ + "compat4.sigreturn", /* 344 = freebsd4 sigreturn */ "sigtimedwait", /* 345 = sigtimedwait */ "sigwaitinfo", /* 346 = sigwaitinfo */ "__acl_get_file", /* 347 = __acl_get_file */ @@ -382,7 +382,7 @@ const char *syscallnames[] = { "extattr_get_fd", /* 372 = extattr_get_fd */ "extattr_delete_fd", /* 373 = extattr_delete_fd */ "__setugid", /* 374 = __setugid */ - "nfsclnt", /* 375 = nfsclnt */ + "#375", /* 375 = nfsclnt */ "eaccess", /* 376 = eaccess */ "#377", /* 377 = afs_syscall */ "nmount", /* 378 = nmount */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/kern/systrace_args.c Wed Jun 17 19:53:47 2009 (r194392) @@ -2031,14 +2031,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* nfsclnt */ - case 375: { - struct nfsclnt_args *p = params; - iarg[0] = p->flag; /* int */ - uarg[1] = (intptr_t) p->argp; /* caddr_t */ - *n_args = 2; - break; - } /* eaccess */ case 376: { struct eaccess_args *p = params; @@ -6351,19 +6343,6 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; - /* nfsclnt */ - case 375: - switch(ndx) { - case 0: - p = "int"; - break; - case 1: - p = "caddr_t"; - break; - default: - break; - }; - break; /* eaccess */ case 376: switch(ndx) { Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/sys/syscall.h Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #define SYS_syscall 0 @@ -305,7 +305,6 @@ #define SYS_extattr_get_fd 372 #define SYS_extattr_delete_fd 373 #define SYS___setugid 374 -#define SYS_nfsclnt 375 #define SYS_eaccess 376 #define SYS_nmount 378 #define SYS___mac_get_proc 384 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/sys/syscall.mk Wed Jun 17 19:53:47 2009 (r194392) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 194390 2009-06-17 19:50:38Z jhb MIASM = \ syscall.o \ exit.o \ @@ -254,7 +254,6 @@ MIASM = \ extattr_get_fd.o \ extattr_delete_fd.o \ __setugid.o \ - nfsclnt.o \ eaccess.o \ nmount.o \ __mac_get_proc.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Jun 17 19:53:20 2009 (r194391) +++ head/sys/sys/sysproto.h Wed Jun 17 19:53:47 2009 (r194392) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 194262 2009-06-15 20:38:55Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 194390 2009-06-17 19:50:38Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1080,10 +1080,6 @@ struct extattr_delete_fd_args { struct __setugid_args { char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; -struct nfsclnt_args { - char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; - char argp_l_[PADL_(caddr_t)]; caddr_t argp; char argp_r_[PADR_(caddr_t)]; -}; struct eaccess_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; @@ -1879,7 +1875,6 @@ int extattr_set_fd(struct thread *, stru int extattr_get_fd(struct thread *, struct extattr_get_fd_args *); int extattr_delete_fd(struct thread *, struct extattr_delete_fd_args *); int __setugid(struct thread *, struct __setugid_args *); -int nfsclnt(struct thread *, struct nfsclnt_args *); int eaccess(struct thread *, struct eaccess_args *); int nmount(struct thread *, struct nmount_args *); int __mac_get_proc(struct thread *, struct __mac_get_proc_args *); @@ -2476,7 +2471,6 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_extattr_get_fd AUE_EXTATTR_GET_FD #define SYS_AUE_extattr_delete_fd AUE_EXTATTR_DELETE_FD #define SYS_AUE___setugid AUE_NULL -#define SYS_AUE_nfsclnt AUE_NULL #define SYS_AUE_eaccess AUE_EACCESS #define SYS_AUE_nmount AUE_NMOUNT #define SYS_AUE___mac_get_proc AUE_NULL From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 20:12:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 859C5106564A; Wed, 17 Jun 2009 20:12:23 +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 596A98FC16; Wed, 17 Jun 2009 20:12:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HKCNkH086810; Wed, 17 Jun 2009 20:12:23 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HKCNDd086808; Wed, 17 Jun 2009 20:12:23 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906172012.n5HKCNDd086808@svn.freebsd.org> From: Alan Cox Date: Wed, 17 Jun 2009 20:12: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: r194393 - 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: Wed, 17 Jun 2009 20:12:24 -0000 Author: alc Date: Wed Jun 17 20:12:23 2009 New Revision: 194393 URL: http://svn.freebsd.org/changeset/base/194393 Log: Eliminate unnecessary forward declarations. Modified: head/sys/vm/vm_extern.h Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Wed Jun 17 19:53:47 2009 (r194392) +++ head/sys/vm/vm_extern.h Wed Jun 17 20:12:23 2009 (r194393) @@ -33,11 +33,8 @@ #ifndef _VM_EXTERN_H_ #define _VM_EXTERN_H_ -struct buf; struct proc; struct vmspace; -struct vmtotal; -struct mount; struct vnode; #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 21:58:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 786741065694; Wed, 17 Jun 2009 21:58:32 +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 65C348FC22; Wed, 17 Jun 2009 21:58:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HLwWUw089642; Wed, 17 Jun 2009 21:58:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HLwWE4089640; Wed, 17 Jun 2009 21:58:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906172158.n5HLwWE4089640@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Jun 2009 21:58: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: r194406 - 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: Wed, 17 Jun 2009 21:58:33 -0000 Author: jilles Date: Wed Jun 17 21:58:32 2009 New Revision: 194406 URL: http://svn.freebsd.org/changeset/base/194406 Log: Properly flush input after an error in backquotes in interactive mode. For parsing an old-style backquote substitution (`...`), a string "file" is used to store the contents of the substitution (with the special backslash processing done). If an error occurs, the shell cleans up all these files (returning to the top level) and flush the top level file. Erroneously, it first flushed the current file and then cleaned up all extra files, so that the top level file (i.e. the terminal) was not flushed. Example (in interactive mode): echo `for` echo This should not be printed Also noticeable in (in interactive mode): echo `(` The old version prints an extraneous prompt. Approved by: ed (mentor) Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Wed Jun 17 21:52:39 2009 (r194405) +++ head/bin/sh/input.c Wed Jun 17 21:58:32 2009 (r194406) @@ -118,9 +118,9 @@ INIT { } RESET { + popallfiles(); if (exception != EXSHELLPROC) parselleft = parsenleft = 0; /* clear input buffer */ - popallfiles(); } SHELLPROC { From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 22:50:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B658106568D; Wed, 17 Jun 2009 22:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 589F88FC0C; Wed, 17 Jun 2009 22:50:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HMoQSP090667; Wed, 17 Jun 2009 22:50:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HMoQZV090661; Wed, 17 Jun 2009 22:50:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906172250.n5HMoQZV090661@svn.freebsd.org> From: Rick Macklem Date: Wed, 17 Jun 2009 22:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194407 - in head/sys: nfsserver nlm rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 17 Jun 2009 22:50:26 -0000 Author: rmacklem Date: Wed Jun 17 22:50:26 2009 New Revision: 194407 URL: http://svn.freebsd.org/changeset/base/194407 Log: Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on the SVCXPTR structure returned by them, it was possible for the structure to be free'd before svc_reg() had been completed using the structure. This patch acquires a reference count on the newly created structure that is returned by svc_[dg|vc|tli|tp]_create(). It also adds the appropriate SVC_RELEASE() calls to the callers, except the experimental nfs subsystem. The latter will be committed separately. Submitted by: dfr Tested by: pho Approved by: kib (mentor) Modified: head/sys/nfsserver/nfs_srvkrpc.c head/sys/nlm/nlm_prot_impl.c head/sys/rpc/svc.c head/sys/rpc/svc_generic.c head/sys/rpc/svc_vc.c Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Wed Jun 17 21:58:32 2009 (r194406) +++ head/sys/nfsserver/nfs_srvkrpc.c Wed Jun 17 22:50:26 2009 (r194407) @@ -467,6 +467,7 @@ nfssvc_addsock(struct file *fp, struct t fp->f_data = NULL; svc_reg(xprt, NFS_PROG, NFS_VER2, nfssvc_program, NULL); svc_reg(xprt, NFS_PROG, NFS_VER3, nfssvc_program, NULL); + SVC_RELEASE(xprt); } return (0); Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Wed Jun 17 21:58:32 2009 (r194406) +++ head/sys/nlm/nlm_prot_impl.c Wed Jun 17 22:50:26 2009 (r194407) @@ -1389,7 +1389,7 @@ nlm_register_services(SVCPOOL *pool, int return (EINVAL); } - xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK); + xprts = malloc(addr_count * sizeof(SVCXPRT *), M_NLM, M_WAITOK|M_ZERO); for (i = 0; i < version_count; i++) { for (j = 0; j < addr_count; j++) { /* @@ -1447,6 +1447,10 @@ nlm_register_services(SVCPOOL *pool, int } error = 0; out: + for (j = 0; j < addr_count; j++) { + if (xprts[j]) + SVC_RELEASE(xprts[j]); + } free(xprts, M_NLM); return (error); } Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Wed Jun 17 21:58:32 2009 (r194406) +++ head/sys/rpc/svc.c Wed Jun 17 22:50:26 2009 (r194407) @@ -276,6 +276,7 @@ xprt_register(SVCXPRT *xprt) { SVCPOOL *pool = xprt->xp_pool; + SVC_ACQUIRE(xprt); mtx_lock(&pool->sp_lock); xprt->xp_registered = TRUE; xprt->xp_active = FALSE; Modified: head/sys/rpc/svc_generic.c ============================================================================== --- head/sys/rpc/svc_generic.c Wed Jun 17 21:58:32 2009 (r194406) +++ head/sys/rpc/svc_generic.c Wed Jun 17 22:50:26 2009 (r194407) @@ -120,8 +120,10 @@ svc_create( /* It was not found. Now create a new one */ xprt = svc_tp_create(pool, dispatch, prognum, versnum, NULL, nconf); - if (xprt) + if (xprt) { num++; + SVC_RELEASE(xprt); + } } } __rpc_endconf(handle); @@ -179,6 +181,7 @@ svc_tp_create( (unsigned)prognum, (unsigned)versnum, nconf->nc_netid); xprt_unregister(xprt); + SVC_RELEASE(xprt); return (NULL); } return (xprt); Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Wed Jun 17 21:58:32 2009 (r194406) +++ head/sys/rpc/svc_vc.c Wed Jun 17 22:50:26 2009 (r194407) @@ -324,6 +324,7 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st struct socket *so = NULL; struct sockaddr *sa = NULL; int error; + SVCXPRT *new_xprt; /* * The socket upcall calls xprt_active() which will eventually @@ -383,10 +384,14 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st /* * svc_vc_create_conn will call xprt_register - we don't need - * to do anything with the new connection. + * to do anything with the new connection except derefence it. */ - if (!svc_vc_create_conn(xprt->xp_pool, so, sa)) + new_xprt = svc_vc_create_conn(xprt->xp_pool, so, sa); + if (!new_xprt) { soclose(so); + } else { + SVC_RELEASE(new_xprt); + } free(sa, M_SONAME); From owner-svn-src-head@FreeBSD.ORG Wed Jun 17 22:55:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5D6D1065672; Wed, 17 Jun 2009 22:55:59 +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 D3AAE8FC08; Wed, 17 Jun 2009 22:55:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5HMtx5j090808; Wed, 17 Jun 2009 22:55:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5HMtxcT090805; Wed, 17 Jun 2009 22:55:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200906172255.n5HMtxcT090805@svn.freebsd.org> From: Rick Macklem Date: Wed, 17 Jun 2009 22:55: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: r194408 - in head/sys/fs: nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2009 22:56:00 -0000 Author: rmacklem Date: Wed Jun 17 22:55:59 2009 New Revision: 194408 URL: http://svn.freebsd.org/changeset/base/194408 Log: Add the SVC_RELEASE(xprt), as required by r194407. Approved by: kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Wed Jun 17 22:50:26 2009 (r194407) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Wed Jun 17 22:55:59 2009 (r194408) @@ -194,6 +194,7 @@ nfscbd_addsock(struct file *fp) fp->f_data = NULL; svc_reg(xprt, NFS_CALLBCKPROG, NFSV4_CBVERS, nfscb_program, NULL); + SVC_RELEASE(xprt); } return (0); Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Jun 17 22:50:26 2009 (r194407) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Jun 17 22:55:59 2009 (r194408) @@ -372,6 +372,7 @@ nfsrvd_addsock(struct file *fp) if (nfs_maxvers >= NFS_VER4) svc_reg(xprt, NFS_PROG, NFS_VER4, nfssvc_program, NULL); + SVC_RELEASE(xprt); } return (0); From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 02:51:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C9D51065670; Thu, 18 Jun 2009 02:51:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id DBE688FC14; Thu, 18 Jun 2009 02:51:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au (c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n5I2pQ4Y011458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Jun 2009 12:51:34 +1000 Date: Thu, 18 Jun 2009 12:51:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ulf Lilleengen In-Reply-To: <200906170641.n5H6fAXa064961@svn.freebsd.org> Message-ID: <20090618104415.H27191@delplex.bde.org> References: <200906170641.n5H6fAXa064961@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: r194333 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 02:51:38 -0000 On Wed, 17 Jun 2009, Ulf Lilleengen wrote: > Log: > - Back out the previous change in order to maintain compatibility. Thanks. This even maintains compatibility with fdisk's own man page, since you didn't change that to say 255 instead of 256. I'm not sure about the corresponding change in sysinstall^Wlibdisk. Wizard mode is needed to check what is happening, but is not the default. Linux cfdisk (a 2005 version) doesn't permit 256 heads, at least when the number of heads is specificed on the command line. Its man page is missing documentation of the limits -- it only says that 255 and 16 are reasonable values for the number. Linux fdisk has the same man page as Linux cfdisk. It allows 256 heads at least in 'x' interactive mode and documents the limits of 1-256 heads in the prompt for changing the number there. It also allows specifying 257 or even a completly garbage number of heads (> 2**^64) on the command line, but when the number exceeds 255 it silently changes it to 255. So Linux [c]fdisk apparently allows 256 heads iff it is set in interactive mode. There is another dubious 255 in fdisk.c, together with mounds of other bugs: % static void % print_params() % { % printf("parameters extracted from in-core disklabel are:\n"); % printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n" % ,cyls,heads,sectors,cylsecs); % if((dos_sectors > 63) || (dos_cyls > 1023) || (dos_heads > 255)) % printf("Figures below won't work with BIOS for partitions not in cyl 1\n"); % printf("parameters to be used for BIOS calculations are:\n"); % printf("cylinders=%d heads=%d sectors/track=%d (%d blks/cyl)\n\n" % ,dos_cyls,dos_heads,dos_sectors,dos_cylsecs); % } This function is mostly wrong: - The values are now _never_ extracted from the in-core disklabel. They are normally wrong ones extracted from the firmware. The firmware ones are logically wrong in this context and are usually practically wrong too (except for sectors = 63 and cyls = irrelevant). The values used to be normally extracted from the (in-core = virtual) disklabel, and the ones there used to be extracted from existing entries in the partition table, mainly so as to get correct values here and in other implementations of fdisk (so as to centralize the code), but this has been axed. - all disks larger than 503MB have parameters that "won't work [...]". Thus the warning is printed for all disks less than about 15 years old, unless you type in bogus parameters to shut it up. (You can type in a bogus number of cylinders without affecting much.) It will still be printed initially. - dos_sectors > 63 causes problems beginning at cyl 0 head 1, not for cyls != 1 as stated - dos_cyls > 1023 causes problems beginning at cyl 1024, not for cyls != 1 as stated - dos_heads = 256 shouldn't cause any problems. It may, but not the ones stated. - dos_heads > 256 causes problems beginning at cyl 1, not for cyls != 1 as stated (cylinders are based at 0, so cyl 1 should mean the second cylinder). - "Figures" that are stated not to work may work, and probably mostly do now, since the CHS values in partition tables aren't really needed. dos_cyls > 1023 has been mostly working for about 15 years now, ever since exceeding it became the usual case. This used to be handled by requiring conventional garbage instead of the unrepresentable values >= 1024, and/or by never actually using the CHS values when they are inconsistent with the LBA values. The latter method should work for all garbage CHS values. FreeBSD fdisk might have been responsible for creating many garbage CHS values, by supplying bad "firmware" defaults which the user accepts. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 04:06:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A07A106566B for ; Thu, 18 Jun 2009 04:06:16 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outo.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8DA8FC17 for ; Thu, 18 Jun 2009 04:06:15 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 60FF7B755D; Wed, 17 Jun 2009 21:06:15 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id F05542D600D; Wed, 17 Jun 2009 21:06:14 -0700 (PDT) Message-ID: <4A39BD36.5020901@elischer.org> Date: Wed, 17 Jun 2009 21:06:14 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Bruce Evans References: <200906170641.n5H6fAXa064961@svn.freebsd.org> <20090618104415.H27191@delplex.bde.org> In-Reply-To: <20090618104415.H27191@delplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Ulf Lilleengen , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r194333 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 04:06:16 -0000 Bruce Evans wrote: > There is another dubious 255 in fdisk.c, together with mounds of other > bugs: > > % static void Don't be surprised.. I ported this from Mach 2.5 in 1992 and it had a different way of representing disks.. From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 05:56:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BE3D1065670; Thu, 18 Jun 2009 05:56:25 +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 3A7B98FC14; Thu, 18 Jun 2009 05:56:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5I5uPdW000211; Thu, 18 Jun 2009 05:56:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5I5uPo6000208; Thu, 18 Jun 2009 05:56:25 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906180556.n5I5uPo6000208@svn.freebsd.org> From: Alan Cox Date: Thu, 18 Jun 2009 05:56: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: r194425 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 05:56:26 -0000 Author: alc Date: Thu Jun 18 05:56:24 2009 New Revision: 194425 URL: http://svn.freebsd.org/changeset/base/194425 Log: Fix some of the style errors in *getpages(). Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/nfsclient/nfs_bio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Thu Jun 18 05:56:12 2009 (r194424) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Jun 18 05:56:24 2009 (r194425) @@ -198,7 +198,7 @@ ncl_getpages(struct vop_getpages_args *a if ((object = vp->v_object) == NULL) { ncl_printf("nfs_getpages: called with non-merged cache vnode??\n"); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } if (newnfs_directio_enable && !newnfs_directio_allow_mmap) { @@ -206,7 +206,7 @@ ncl_getpages(struct vop_getpages_args *a if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { mtx_unlock(&np->n_mtx); ncl_printf("nfs_getpages: called on non-cacheable vnode??\n"); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } else mtx_unlock(&np->n_mtx); } @@ -227,23 +227,18 @@ ncl_getpages(struct vop_getpages_args *a * allow the pager to zero-out the blanks. Partially valid pages * can only occur at the file EOF. */ - - { - vm_page_t m = pages[ap->a_reqpage]; - - VM_OBJECT_LOCK(object); - if (m->valid != 0) { - vm_page_lock_queues(); - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) - vm_page_free(pages[i]); - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(object); - return(0); + VM_OBJECT_LOCK(object); + if (pages[ap->a_reqpage]->valid != 0) { + vm_page_lock_queues(); + for (i = 0; i < npages; ++i) { + if (i != ap->a_reqpage) + vm_page_free(pages[i]); } + vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); + return (0); } + VM_OBJECT_UNLOCK(object); /* * We use only the kva address for the buffer, but this is extremely @@ -281,7 +276,7 @@ ncl_getpages(struct vop_getpages_args *a } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } /* @@ -347,7 +342,7 @@ ncl_getpages(struct vop_getpages_args *a } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); - return 0; + return (0); } /* Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Thu Jun 18 05:56:12 2009 (r194424) +++ head/sys/nfsclient/nfs_bio.c Thu Jun 18 05:56:24 2009 (r194425) @@ -101,7 +101,7 @@ nfs_getpages(struct vop_getpages_args *a if ((object = vp->v_object) == NULL) { nfs_printf("nfs_getpages: called with non-merged cache vnode??\n"); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } if (nfs_directio_enable && !nfs_directio_allow_mmap) { @@ -109,7 +109,7 @@ nfs_getpages(struct vop_getpages_args *a if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { mtx_unlock(&np->n_mtx); nfs_printf("nfs_getpages: called on non-cacheable vnode??\n"); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } else mtx_unlock(&np->n_mtx); } @@ -130,23 +130,18 @@ nfs_getpages(struct vop_getpages_args *a * allow the pager to zero-out the blanks. Partially valid pages * can only occur at the file EOF. */ - - { - vm_page_t m = pages[ap->a_reqpage]; - - VM_OBJECT_LOCK(object); - if (m->valid != 0) { - vm_page_lock_queues(); - for (i = 0; i < npages; ++i) { - if (i != ap->a_reqpage) - vm_page_free(pages[i]); - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(object); - return(0); + VM_OBJECT_LOCK(object); + if (pages[ap->a_reqpage]->valid != 0) { + vm_page_lock_queues(); + for (i = 0; i < npages; ++i) { + if (i != ap->a_reqpage) + vm_page_free(pages[i]); } + vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); + return (0); } + VM_OBJECT_UNLOCK(object); /* * We use only the kva address for the buffer, but this is extremely @@ -184,7 +179,7 @@ nfs_getpages(struct vop_getpages_args *a } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); - return VM_PAGER_ERROR; + return (VM_PAGER_ERROR); } /* @@ -250,7 +245,7 @@ nfs_getpages(struct vop_getpages_args *a } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(object); - return 0; + return (0); } /* From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 07:27:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B87E106566B; Thu, 18 Jun 2009 07:27:12 +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 0A9E28FC0C; Thu, 18 Jun 2009 07:27:12 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5I7RBQo002234; Thu, 18 Jun 2009 07:27:11 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5I7RBVn002232; Thu, 18 Jun 2009 07:27:11 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906180727.n5I7RBVn002232@svn.freebsd.org> From: Alan Cox Date: Thu, 18 Jun 2009 07:27: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: r194429 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 07:27:12 -0000 Author: alc Date: Thu Jun 18 07:27:11 2009 New Revision: 194429 URL: http://svn.freebsd.org/changeset/base/194429 Log: Add support for UMA_SLAB_KERNEL to page_free(). (While I'm here remove an unnecessary newline character from the end of two panic messages.) Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 18 06:09:47 2009 (r194428) +++ head/sys/vm/uma_core.c Thu Jun 18 07:27:11 2009 (r194429) @@ -1061,8 +1061,10 @@ page_free(void *mem, int size, u_int8_t if (flags & UMA_SLAB_KMEM) map = kmem_map; + else if (flags & UMA_SLAB_KERNEL) + map = kernel_map; else - panic("UMA: page_free used with invalid flags %d\n", flags); + panic("UMA: page_free used with invalid flags %d", flags); kmem_free(map, (vm_offset_t)mem, size); } @@ -1352,7 +1354,7 @@ keg_ctor(void *mem, int size, void *udat printf("zone %s ipers %d rsize %d size %d\n", zone->uz_name, keg->uk_ipers, keg->uk_rsize, keg->uk_size); - panic("UMA slab won't fit.\n"); + panic("UMA slab won't fit."); } } From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 07:40:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969D8106566B; Thu, 18 Jun 2009 07:40:53 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 55A748FC16; Thu, 18 Jun 2009 07:40:53 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A60246D41C; Thu, 18 Jun 2009 09:40:52 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 7DA27844E2; Thu, 18 Jun 2009 09:40:52 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Edwin Groothuis References: <200906071326.n57DQvSG095104@svn.freebsd.org> Date: Thu, 18 Jun 2009 09:40:52 +0200 In-Reply-To: <200906071326.n57DQvSG095104@svn.freebsd.org> (Edwin Groothuis's message of "Sun, 7 Jun 2009 13:26:57 +0000 (UTC)") Message-ID: <86iqiudm63.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193635 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 07:40:54 -0000 Edwin Groothuis writes: > Author: edwin > Date: Sun Jun 7 13:26:57 2009 > New Revision: 193635 > URL: http://svn.freebsd.org/changeset/base/193635 > > Log: > Welcome to a default installed /etc/ntp.conf Great, now mergemaster blew away my ntp.conf and installed this one instead. Apparently, it thinks AUTO_UPGRADE means it's fine to overwrite an existing file with a new one... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 10:39:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1709F106566B; Thu, 18 Jun 2009 10:39:09 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 042D38FC1E; Thu, 18 Jun 2009 10:39:09 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IAd8IZ008982; Thu, 18 Jun 2009 10:39:08 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IAd8rZ008980; Thu, 18 Jun 2009 10:39:08 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200906181039.n5IAd8rZ008980@svn.freebsd.org> From: Nick Hibma Date: Thu, 18 Jun 2009 10:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194431 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 10:39:09 -0000 Author: n_hibma Date: Thu Jun 18 10:39:08 2009 New Revision: 194431 URL: http://svn.freebsd.org/changeset/base/194431 Log: Allow building world into a separate dir (for reuse in multiple images): - buildworld and buildkernel are built into MAKEOBJDIRPREFIX - installworld and installkernel are performed on NANO_OBJ. No change of functionality if MAKEOBJDIRPREFIX is not set. If it is sea,t clean_world deletes NANO_OBJ instead of NANO_WORLDDIR. By starting nanobsd.sh with the -b option the existing world can be reused to build a new world reducing time and disk space considerably. While there: - Fix two cases where (in comments) MAKEOBJDIRPREFIX should have been NANO_DISKIMGDIR. - Simplify an 'if (not wrong); then true; else action; fi' into 'if wrong; then action; fi'. 'if ! false; then echo hello; fi' produces hello. Note: Make sure you use NANO_OBJ were you use MAKEOBJDIRPREFIX now in your nanobsd.conf files if you want to split out. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 09:55:26 2009 (r194430) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 10:39:08 2009 (r194431) @@ -51,7 +51,6 @@ NANO_PACKAGE_LIST="*" # Object tree directory # default is subdir of /usr/obj -# XXX: MAKEOBJDIRPREFIX handling... ? #NANO_OBJ="" # The directory to put the final images @@ -147,21 +146,19 @@ NANO_ARCH=i386 clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then - true - else + if ! rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then chflags -R noschg ${MAKEOBJDIRPREFIX} - rm -rf ${MAKEOBJDIRPREFIX} + rm -r ${MAKEOBJDIRPREFIX} fi mkdir -p ${MAKEOBJDIRPREFIX} printenv > ${MAKEOBJDIRPREFIX}/_.env ) make_conf_build ( ) ( - pprint 2 "Construct build make.conf ($NANO_MAKE_CONF)" + pprint 2 "Construct build make.conf ($NANO_MAKE_CONF_BUILD)" - echo "${CONF_WORLD}" > ${NANO_MAKE_CONF} - echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF} + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} + echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( @@ -170,7 +167,7 @@ build_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ - __MAKE_CONF=${NANO_MAKE_CONF} buildworld \ + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 ) @@ -188,62 +185,70 @@ build_kernel ( ) ( unset TARGET_CPUTYPE unset TARGET_BIG_ENDIAN env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - __MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} KERNCONF=`basename ${NANO_KERNEL}` \ + > ${NANO_OBJ}/_.bk 2>&1 ) ) clean_world ( ) ( - pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then - true + if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then + pprint 2 "Clean and create object directory (${NANO_OBJ})" + if ! rm -rf ${NANO_OBJ} > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_OBJ} + rm -r ${NANO_OBJ} + fi + mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} + printenv > ${NANO_OBJ}/_.env else - chflags -R noschg ${NANO_WORLDDIR}/ - rm -rf ${NANO_WORLDDIR}/ + pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" + if ! rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_WORLDDIR} + rm -rf ${NANO_WORLDDIR} + fi + mkdir -p ${NANO_WORLDDIR} fi - mkdir -p ${NANO_WORLDDIR}/ ) make_conf_install ( ) ( - pprint 2 "Construct install make.conf ($NANO_MAKE_CONF)" + pprint 2 "Construct install make.conf ($NANO_MAKE_CONF_INSTALL)" - echo "${CONF_WORLD}" > ${NANO_MAKE_CONF} - echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF} + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} + echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} ) install_world ( ) ( pprint 2 "installworld" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.iw" + pprint 3 "log: ${NANO_OBJ}/_.iw" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} installworld \ + ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ DESTDIR=${NANO_WORLDDIR} \ - > ${MAKEOBJDIRPREFIX}/_.iw 2>&1 + > ${NANO_OBJ}/_.iw 2>&1 chflags -R noschg ${NANO_WORLDDIR} ) install_etc ( ) ( pprint 2 "install /etc" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.etc" + pprint 3 "log: ${NANO_OBJ}/_.etc" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} distribution \ + ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ - > ${MAKEOBJDIRPREFIX}/_.etc 2>&1 + > ${NANO_OBJ}/_.etc 2>&1 ) install_kernel ( ) ( pprint 2 "install kernel" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.ik" + pprint 3 "log: ${NANO_OBJ}/_.ik" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ - __MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${MAKEOBJDIRPREFIX}/_.ik 2>&1 + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} KERNCONF=`basename ${NANO_KERNEL}` \ + > ${NANO_OBJ}/_.ik 2>&1 ) run_customize() ( @@ -252,9 +257,9 @@ run_customize() ( for c in $NANO_CUSTOMIZE do pprint 2 "customize \"$c\"" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.cust.$c" + pprint 3 "log: ${NANO_OBJ}/_.cust.$c" pprint 4 "`type $c`" - ( $c ) > ${MAKEOBJDIRPREFIX}/_.cust.$c 2>&1 + ( $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 done ) @@ -264,15 +269,15 @@ run_late_customize() ( for c in $NANO_LATE_CUSTOMIZE do pprint 2 "late customize \"$c\"" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.late_cust.$c" + pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" pprint 4 "`type $c`" - ( $c ) > ${MAKEOBJDIRPREFIX}/_.late_cust.$c 2>&1 + ( $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 done ) setup_nanobsd ( ) ( pprint 2 "configure nanobsd setup" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.dl" + pprint 3 "log: ${NANO_OBJ}/_.dl" ( cd ${NANO_WORLDDIR} @@ -312,7 +317,7 @@ setup_nanobsd ( ) ( rm tmp || true ln -s var/tmp tmp - ) > ${MAKEOBJDIRPREFIX}/_.dl 2>&1 + ) > ${NANO_OBJ}/_.dl 2>&1 ) setup_nanobsd_etc ( ) ( @@ -348,7 +353,7 @@ prune_usr() ( create_i386_diskimage ( ) ( pprint 2 "build diskimage" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.di" + pprint 3 "log: ${NANO_OBJ}/_.di" ( echo $NANO_MEDIASIZE $NANO_IMAGES \ @@ -417,10 +422,10 @@ create_i386_diskimage ( ) ( # for booting the image from a USB device to work. print "a 1" } - ' > ${MAKEOBJDIRPREFIX}/_.fdisk + ' > ${NANO_OBJ}/_.fdisk IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} - MNT=${MAKEOBJDIRPREFIX}/_.mnt + MNT=${NANO_OBJ}/_.mnt mkdir -p ${MNT} if [ "${NANO_MD_BACKING}" = "swap" ] ; then @@ -429,14 +434,14 @@ create_i386_diskimage ( ) ( else echo "Creating md backing file..." dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \ - count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` + seek=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` count=0 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` fi trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${MAKEOBJDIRPREFIX}/_.fdisk ${MD} + fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. @@ -446,27 +451,26 @@ create_i386_diskimage ( ) ( # Create first image newfs ${NANO_NEWFS} /dev/${MD}s1a - mount /dev/${MD}s1a ${MNT} + mount -o async /dev/${MD}s1a ${MNT} df -i ${MNT} echo "Copying worlddir..." ( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} ) df -i ${MNT} echo "Generating mtree..." - ( cd ${MNT} && mtree -c ) > ${MAKEOBJDIRPREFIX}/_.mtree - ( cd ${MNT} && du -k ) > ${MAKEOBJDIRPREFIX}/_.du + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du umount ${MNT} if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k + dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k mount /dev/${MD}s2a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/g" $f done umount ${MNT} - fi # Create Config slice @@ -474,7 +478,7 @@ create_i386_diskimage ( ) ( # XXX: fill from where ? # Create Data slice, if any. - if [ $NANO_DATASIZE -ne 0 ] ; then + if [ $NANO_DATASIZE -gt 0 ] ; then newfs ${NANO_NEWFS} /dev/${MD}s4 # XXX: fill from where ? fi @@ -485,16 +489,16 @@ create_i386_diskimage ( ) ( fi echo "Writing out _.disk.image..." - dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k mdconfig -d -u $MD - ) > ${MAKEOBJDIRPREFIX}/_.di 2>&1 + ) > ${NANO_OBJ}/_.di 2>&1 ) last_orders () ( # Redefine this function with any last orders you may have # after the build completed, for instance to copy the finished # image to a more convenient place: - # cp ${MAKEOBJDIRPREFIX}/_.disk.image /home/ftp/pub/nanobsd.disk + # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk ) ####################################################################### @@ -751,19 +755,13 @@ fi ####################################################################### # Setup and Export Internal variables # -if [ "x${NANO_OBJ}" = "x" ] ; then - MAKEOBJDIRPREFIX=/usr/obj/nanobsd.${NANO_NAME}/ - NANO_OBJ=${MAKEOBJDIRPREFIX} -else - MAKEOBJDIRPREFIX=${NANO_OBJ} -fi - -if [ "x${NANO_DISKIMGDIR}" = "x" ] ; then - NANO_DISKIMGDIR=${MAKEOBJDIRPREFIX} -fi - -NANO_WORLDDIR=${MAKEOBJDIRPREFIX}/_.w -NANO_MAKE_CONF=${MAKEOBJDIRPREFIX}/make.conf +test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}/ +test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} +test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} + +NANO_WORLDDIR=${NANO_OBJ}/_.w +NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build +NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install if [ -d ${NANO_TOOLS} ] ; then true @@ -791,7 +789,8 @@ export NANO_DRIVE export NANO_HEADS export NANO_IMAGES export NANO_IMGNAME -export NANO_MAKE_CONF +export NANO_MAKE_CONF_BUILD +export NANO_MAKE_CONF_INSTALL export NANO_MEDIASIZE export NANO_NAME export NANO_NEWFS @@ -840,7 +839,7 @@ prune_usr run_late_customize if $do_image ; then create_${NANO_ARCH}_diskimage - echo "# Created NanoBSD disk image: ${MAKEOBJDIRPREFIX}/${NANO_IMGNAME}" + echo "# Created NanoBSD disk image: ${NANO_DISKIMGDIR}/${NANO_IMGNAME}" else pprint 2 "Skipping image build (as instructed)" fi From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 11:12:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49BF41065670; Thu, 18 Jun 2009 11:12:11 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D88A8FC08; Thu, 18 Jun 2009 11:12:11 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IBCBao009704; Thu, 18 Jun 2009 11:12:11 GMT (envelope-from cokane@svn.freebsd.org) Received: (from cokane@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IBCAnE009702; Thu, 18 Jun 2009 11:12:11 GMT (envelope-from cokane@svn.freebsd.org) Message-Id: <200906181112.n5IBCAnE009702@svn.freebsd.org> From: Coleman Kane Date: Thu, 18 Jun 2009 11:12: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: r194432 - 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, 18 Jun 2009 11:12:11 -0000 Author: cokane Date: Thu Jun 18 11:12:10 2009 New Revision: 194432 URL: http://svn.freebsd.org/changeset/base/194432 Log: Replace use of ic->ic_flags with vap->iv_flags to operate on per-vap flags for ndis 802.11 work. Submitted by: Paul B. Mahol Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Thu Jun 18 10:39:08 2009 (r194431) +++ head/sys/dev/if_ndis/if_ndis.c Thu Jun 18 11:12:10 2009 (r194432) @@ -2277,6 +2277,7 @@ ndis_setstate_80211(sc) struct ndis_softc *sc; { struct ieee80211com *ic; + struct ieee80211vap *vap; ndis_80211_macaddr bssid; ndis_80211_config config; int rval = 0, len; @@ -2285,6 +2286,7 @@ ndis_setstate_80211(sc) ifp = sc->ifp; ic = ifp->if_l2com; + vap = TAILQ_FIRST(&ic->ic_vaps); if (!NDIS_INITIALIZED(sc)) { DPRINTF(("%s: NDIS not initialized\n", __func__)); @@ -2313,7 +2315,7 @@ ndis_setstate_80211(sc) /* Set power management */ len = sizeof(arg); - if (ic->ic_flags & IEEE80211_F_PMGTON) + if (vap->iv_flags & IEEE80211_F_PMGTON) arg = NDIS_80211_POWERMODE_FAST_PSP; else arg = NDIS_80211_POWERMODE_CAM; @@ -2737,9 +2739,9 @@ ndis_getstate_80211(sc) device_printf(sc->ndis_dev, "get power mode failed: %d\n", rval); if (arg == NDIS_80211_POWERMODE_CAM) - ic->ic_flags &= ~IEEE80211_F_PMGTON; + vap->iv_flags &= ~IEEE80211_F_PMGTON; else - ic->ic_flags |= IEEE80211_F_PMGTON; + vap->iv_flags |= IEEE80211_F_PMGTON; } /* Get TX power */ @@ -2776,7 +2778,7 @@ ndis_getstate_80211(sc) device_printf (sc->ndis_dev, "get authmode status failed: %d\n", rval); else { - ic->ic_flags &= ~IEEE80211_F_WPA; + vap->iv_flags &= ~IEEE80211_F_WPA; switch(arg) { case NDIS_80211_AUTHMODE_OPEN: ni->ni_authmode = IEEE80211_AUTH_OPEN; @@ -2791,12 +2793,12 @@ ndis_getstate_80211(sc) case NDIS_80211_AUTHMODE_WPAPSK: case NDIS_80211_AUTHMODE_WPANONE: ni->ni_authmode = IEEE80211_AUTH_WPA; - ic->ic_flags |= IEEE80211_F_WPA1; + vap->iv_flags |= IEEE80211_F_WPA1; break; case NDIS_80211_AUTHMODE_WPA2: case NDIS_80211_AUTHMODE_WPA2PSK: ni->ni_authmode = IEEE80211_AUTH_WPA; - ic->ic_flags |= IEEE80211_F_WPA2; + vap->iv_flags |= IEEE80211_F_WPA2; break; default: ni->ni_authmode = IEEE80211_AUTH_NONE; @@ -2812,9 +2814,9 @@ ndis_getstate_80211(sc) "get wep status failed: %d\n", rval); if (arg == NDIS_80211_WEPSTAT_ENABLED) - ic->ic_flags |= IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC; + vap->iv_flags |= IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC; else - ic->ic_flags &= ~(IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC); + vap->iv_flags &= ~(IEEE80211_F_PRIVACY|IEEE80211_F_DROPUNENC); return; } From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 11:12:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 176EB106566B; Thu, 18 Jun 2009 11:12:12 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B8C8FC0A; Thu, 18 Jun 2009 11:12:12 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IBCBrK009740; Thu, 18 Jun 2009 11:12:11 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IBCB6J009738; Thu, 18 Jun 2009 11:12:11 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <200906181112.n5IBCB6J009738@svn.freebsd.org> From: Ivan Voras Date: Thu, 18 Jun 2009 11:12: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: r194433 - head/sys/geom/label X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 11:12:12 -0000 Author: ivoras Date: Thu Jun 18 11:12:11 2009 New Revision: 194433 URL: http://svn.freebsd.org/changeset/base/194433 Log: Fix tabs, slightly improve comments. Approved by: gnn (mentor) (original) Noticed by: stas Modified: head/sys/geom/label/g_label_gpt.c Modified: head/sys/geom/label/g_label_gpt.c ============================================================================== --- head/sys/geom/label/g_label_gpt.c Thu Jun 18 11:12:10 2009 (r194432) +++ head/sys/geom/label/g_label_gpt.c Thu Jun 18 11:12:11 2009 (r194433) @@ -41,16 +41,16 @@ __FBSDID("$FreeBSD$"); #define PART_CLASS_NAME "PART" #define SCHEME_NAME "GPT" -#define G_LABEL_GPT_VOLUME_DIR "gpt" -#define G_LABEL_GPT_ID_DIR "gptid" +#define G_LABEL_GPT_VOLUME_DIR "gpt" +#define G_LABEL_GPT_ID_DIR "gptid" -/* also defined in geom/part/g_part_gpt.c */ +/* XXX: Also defined in geom/part/g_part_gpt.c */ struct g_part_gpt_entry { struct g_part_entry base; struct gpt_ent ent; }; -/* shamelessly stolen from g_part_gpt.c */ +/* XXX: Shamelessly stolen from g_part_gpt.c */ static void sbuf_nprintf_utf16(struct sbuf *sb, uint16_t *str, size_t len) { @@ -109,7 +109,7 @@ g_label_gpt_taste(struct g_consumer *cp, tp = (struct g_part_table *)pp->geom->softc; label[0] = '\0'; - /* We taste only partitions from GPART */ + /* We taste only partitions handled by GPART */ if (strncmp(pp->geom->class->name, PART_CLASS_NAME, sizeof(PART_CLASS_NAME))) return; /* and only GPT */ @@ -119,11 +119,11 @@ g_label_gpt_taste(struct g_consumer *cp, part_gpt_entry = (struct g_part_gpt_entry *)pp->private; /* - * create sbuf with biggest possible size - * we need max. 4 bytes for every 2-byte utf16 char + * Create sbuf with biggest possible size. + * We need max. 4 bytes for every 2-byte utf16 char. */ lbl = sbuf_new(NULL, NULL, sizeof(part_gpt_entry->ent.ent_name) << 1, SBUF_FIXEDLEN); - /* size ist the number of characters, not bytes */ + /* Size is the number of characters, not bytes */ sbuf_nprintf_utf16(lbl, part_gpt_entry->ent.ent_name, sizeof(part_gpt_entry->ent.ent_name) >> 1); sbuf_finish(lbl); strlcpy(label, sbuf_data(lbl), size); @@ -142,7 +142,7 @@ g_label_gpt_uuid_taste(struct g_consumer tp = (struct g_part_table *)pp->geom->softc; label[0] = '\0'; - /* we taste only partitions from GPART */ + /* We taste only partitions handled by GPART */ if (strncmp(pp->geom->class->name, PART_CLASS_NAME, sizeof(PART_CLASS_NAME))) return; /* and only GPT */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 11:35:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 177511065670; Thu, 18 Jun 2009 11:35:30 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF95E8FC08; Thu, 18 Jun 2009 11:35:29 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IBZTOn010335; Thu, 18 Jun 2009 11:35:29 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IBZT5N010333; Thu, 18 Jun 2009 11:35:29 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200906181135.n5IBZT5N010333@svn.freebsd.org> From: Nick Hibma Date: Thu, 18 Jun 2009 11:35: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: r194437 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 11:35:30 -0000 Author: n_hibma Date: Thu Jun 18 11:35:29 2009 New Revision: 194437 URL: http://svn.freebsd.org/changeset/base/194437 Log: Reverse some stuff I accidentally committed in the previous commit: - creation of sparse files to speed up the build process. This was discussed with phk 2 years ago and he disagreed with this change. - handling of negative data partition sizes. Can I have the ... green pointy hat, please? Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 11:17:12 2009 (r194436) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 11:35:29 2009 (r194437) @@ -434,7 +434,7 @@ create_i386_diskimage ( ) ( else echo "Creating md backing file..." dd if=/dev/zero of=${IMG} bs=${NANO_SECTS}b \ - seek=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` count=0 + count=`expr ${NANO_MEDIASIZE} / ${NANO_SECTS}` MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` fi @@ -451,7 +451,7 @@ create_i386_diskimage ( ) ( # Create first image newfs ${NANO_NEWFS} /dev/${MD}s1a - mount -o async /dev/${MD}s1a ${MNT} + mount /dev/${MD}s1a ${MNT} df -i ${MNT} echo "Copying worlddir..." ( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} ) @@ -464,7 +464,7 @@ create_i386_diskimage ( ) ( if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd conv=sparse if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k + dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k mount /dev/${MD}s2a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do @@ -478,7 +478,7 @@ create_i386_diskimage ( ) ( # XXX: fill from where ? # Create Data slice, if any. - if [ $NANO_DATASIZE -gt 0 ] ; then + if [ $NANO_DATASIZE -ne 0 ] ; then newfs ${NANO_NEWFS} /dev/${MD}s4 # XXX: fill from where ? fi @@ -489,7 +489,7 @@ create_i386_diskimage ( ) ( fi echo "Writing out _.disk.image..." - dd conv=sparse if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k mdconfig -d -u $MD ) > ${NANO_OBJ}/_.di 2>&1 ) From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 13:27:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEF1106566B; Thu, 18 Jun 2009 13:27:51 +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 B2DB68FC0C; Thu, 18 Jun 2009 13:27:50 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2D1B3.dip.t-dialin.net [217.226.209.179]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 3F8208444EC; Thu, 18 Jun 2009 15:27:44 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id D045A21DA5C; Thu, 18 Jun 2009 15:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1245331661; bh=LD6o66pRBqwSJxt3xL7gnzfASiZ9Zhp3SHzRIOZMjH4=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=L5ot/cQKNfvDQ+qUwcsVk+U/cXvjtfeZTQ9O1gErIBqKtMtaFwxw9QbIVNQLPHV8D Euf57iYM4pTcc5AJRSOkuRPyMKdBsVWzo1aFt4xi/mJiPGqQbkAC7ldDz23AsPuJ4G jobSVjsKrP2LYmZXan+qtEF7aYkey/mx4EfnoSyX3LQ3rFb4ENq70JioRoGEynYaDu onR4lnVQxd0LRfoWRfCg7oVQ5b4YBQWeiO1L7Z1DXdRA2zha4CiDA6b+ygdkDao+ty GexJ5mHDcLpEFGHiGg9tmjWduEvZ7ya4RIXVTTdHI+0VKamRU5veaQgMiRyOw5S+SB XWVi6xw+nVjiw== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n5IDReU8043454; Thu, 18 Jun 2009 15:27:40 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 18 Jun 2009 15:27:40 +0200 Message-ID: <20090618152740.1806764x8heftjv0@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 18 Jun 2009 15:27:40 +0200 From: Alexander Leidinger To: Alexander Motin References: <200904292117.n3TLHIpt093110@svn.freebsd.org> <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> <4A38EB41.2080206@FreeBSD.org> In-Reply-To: <4A38EB41.2080206@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 3F8208444EC.8FCC6 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1245936465.87037@HyX01byIpivtOWEmpCdvoA X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191674 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 13:27:52 -0000 Quoting Alexander Motin (from Wed, 17 Jun 2009 16:10:25 +0300): > Alexander Leidinger wrote: >> Quoting Alexander Motin (from Wed, 29 Apr 2009 >> 21:17:18 +0000 (UTC)): >>> PARTIAL state has up to 100us (50us for me) wakeup latency, but for my >>> ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms >>> (3.5ms >>> for me) wakeup latency, but saves 0.8W of power. >>> >>> Modes 2 and 3 are implemented only for AHCI driver now. >> >> Does this mean it is for SATA devices only, or is this a feature of the >> complete controller (ICH5 in my case) and also works with PATA drives? > > This feature is SATA-specific by definition. AFAIK there is no bus power > management in PATA. What happens if such a setting is made for a pata channel, will the system ignore it? The idea of the question is: can I just add those hints for all my ata channels on a remote system without getting into trouble? Bye, Alexander. -- While you're chewing, think of STEVEN SPIELBERG'S bank account ... his will have the same effect as two "STARCH BLOCKERS"! http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 13:31:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E65E106566B; Thu, 18 Jun 2009 13:31:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 152958FC0A; Thu, 18 Jun 2009 13:31:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 246109277; Thu, 18 Jun 2009 16:31:18 +0300 Message-ID: <4A3A41A6.3080404@FreeBSD.org> Date: Thu, 18 Jun 2009 16:31:18 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: Alexander Leidinger References: <200904292117.n3TLHIpt093110@svn.freebsd.org> <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> <4A38EB41.2080206@FreeBSD.org> <20090618152740.1806764x8heftjv0@webmail.leidinger.net> In-Reply-To: <20090618152740.1806764x8heftjv0@webmail.leidinger.net> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191674 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 13:31:24 -0000 Alexander Leidinger wrote: > Quoting Alexander Motin (from Wed, 17 Jun 2009 > 16:10:25 +0300): > >> Alexander Leidinger wrote: >>> Quoting Alexander Motin (from Wed, 29 Apr 2009 >>> 21:17:18 +0000 (UTC)): > >>>> PARTIAL state has up to 100us (50us for me) wakeup latency, but >>>> for my >>>> ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms >>>> (3.5ms >>>> for me) wakeup latency, but saves 0.8W of power. >>>> >>>> Modes 2 and 3 are implemented only for AHCI driver now. >>> >>> Does this mean it is for SATA devices only, or is this a feature of the >>> complete controller (ICH5 in my case) and also works with PATA drives? >> >> This feature is SATA-specific by definition. AFAIK there is no bus power >> management in PATA. > > What happens if such a setting is made for a pata channel, will the > system ignore it? The idea of the question is: can I just add those > hints for all my ata channels on a remote system without getting into > trouble? You can. Nothing happen. It will just set variable that is used only by SATA and AHCI code. PATA does not use it. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 13:56:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7DDF106564A; Thu, 18 Jun 2009 13:56:10 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B641F8FC0A; Thu, 18 Jun 2009 13:56:10 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IDuAJO013221; Thu, 18 Jun 2009 13:56:10 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IDuAQi013219; Thu, 18 Jun 2009 13:56:10 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200906181356.n5IDuAQi013219@svn.freebsd.org> From: Nick Hibma Date: Thu, 18 Jun 2009 13:56: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: r194440 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 13:56:11 -0000 Author: n_hibma Date: Thu Jun 18 13:56:10 2009 New Revision: 194440 URL: http://svn.freebsd.org/changeset/base/194440 Log: - Don't hard code _.disk.full. Use the variable. - _.bk should be created in MAKEOBJDIRPREFIX as well - Remove a misplaced and unnecessary message. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 12:04:32 2009 (r194439) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Jun 18 13:56:10 2009 (r194440) @@ -186,7 +186,7 @@ build_kernel ( ) ( unset TARGET_BIG_ENDIAN env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${NANO_OBJ}/_.bk 2>&1 + > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) ) @@ -484,7 +484,7 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then - echo "Writing out _.disk.full..." + echo "Writing out ${NANO_IMGNAME}..." dd if=/dev/${MD} of=${IMG} bs=64k fi @@ -839,7 +839,6 @@ prune_usr run_late_customize if $do_image ; then create_${NANO_ARCH}_diskimage - echo "# Created NanoBSD disk image: ${NANO_DISKIMGDIR}/${NANO_IMGNAME}" else pprint 2 "Skipping image build (as instructed)" fi From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 14:10:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B80F1065676; Thu, 18 Jun 2009 14:10:56 +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 9B4808FC0A; Thu, 18 Jun 2009 14:10:55 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2D1B3.dip.t-dialin.net [217.226.209.179]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 2C26F8444EC; Thu, 18 Jun 2009 16:10:18 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id E02F0BF5D7; Thu, 18 Jun 2009 16:10:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1245334215; bh=PGS/JB5pILRRk2Yx/efloybKsQiZSlPO80gi4cMw4hY=; h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding; b=qcSY/bsCcJfk/GSICFMHghyhMv4LsBuGMCwZoL2NBHgOzP9g1OZhjuK+maK0oCwBg P9AY4bY61E0JH67sSw0Z42lT5hIMqEeezQ5Abe3fWWXjGDyhmku/pe8ti+FEhd4lbG KGf+lbMLeCL5bqcgxDeFe02rOSyAVKxc45Vvuiota8Eh2a9OliAksaCXFKnVlvowlf 6QNHZXwovA5zeOlII1dimiafZqE+kOLOjRbMr2glVBCn66JYlz5Ij2EjhZXG71PcAT CK6tVbbEoCCKOcrzs201+RpvfoV6/0Nk4gM1oWoaDnIWQ5tMbkMI60GFvezAF/35Tv afzGdNZlg7ZSw== Received: (from www@localhost) by webmail.leidinger.net (8.14.3/8.13.8/Submit) id n5IEAEY0051252; Thu, 18 Jun 2009 16:10:14 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Thu, 18 Jun 2009 16:10:14 +0200 Message-ID: <20090618161014.20533fy9f9hs0ukg@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Thu, 18 Jun 2009 16:10:14 +0200 From: Alexander Leidinger To: Alexander Motin References: <200904292117.n3TLHIpt093110@svn.freebsd.org> <20090617150015.18455ggwluk5bcgs@webmail.leidinger.net> <4A38EB41.2080206@FreeBSD.org> <20090618152740.1806764x8heftjv0@webmail.leidinger.net> <4A3A41A6.3080404@FreeBSD.org> In-Reply-To: <4A3A41A6.3080404@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.3.3 / FreeBSD-8.0 X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 2C26F8444EC.B5B36 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1245939025.67024@TokX7ngn4QMZBluO7prYWw X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191674 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 14:10:56 -0000 Quoting Alexander Motin (from Thu, 18 Jun 2009 16:31:18 +0300): > Alexander Leidinger wrote: >> Quoting Alexander Motin (from Wed, 17 Jun 2009 >> 16:10:25 +0300): >> >>> Alexander Leidinger wrote: >>>> Quoting Alexander Motin (from Wed, 29 Apr 2009 >>>> 21:17:18 +0000 (UTC)): >> >>>>> PARTIAL state has up to 100us (50us for me) wakeup latency, but >>>>> for my >>>>> ICH8M saves 0.5W of power per drive. SLUMBER state has up to 10ms >>>>> (3.5ms >>>>> for me) wakeup latency, but saves 0.8W of power. >>>>> >>>>> Modes 2 and 3 are implemented only for AHCI driver now. >>>> >>>> Does this mean it is for SATA devices only, or is this a feature of the >>>> complete controller (ICH5 in my case) and also works with PATA drives? >>> >>> This feature is SATA-specific by definition. AFAIK there is no bus power >>> management in PATA. >> >> What happens if such a setting is made for a pata channel, will the >> system ignore it? The idea of the question is: can I just add those >> hints for all my ata channels on a remote system without getting into >> trouble? > > You can. Nothing happen. It will just set variable that is used only by > SATA and AHCI code. PATA does not use it. Ok, thanks! I'm going to try this now. Bye, Alexander. -- Creativity is no substitute for knowing what you are doing. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 16:40:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3ECA106566C; Thu, 18 Jun 2009 16:40:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B27D08FC1B; Thu, 18 Jun 2009 16:40:00 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IGe00l016954; Thu, 18 Jun 2009 16:40:00 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IGe0fa016952; Thu, 18 Jun 2009 16:40:00 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200906181640.n5IGe0fa016952@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 18 Jun 2009 16:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194447 - head/usr.bin/ncal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 16:40:01 -0000 Author: ume Date: Thu Jun 18 16:40:00 2009 New Revision: 194447 URL: http://svn.freebsd.org/changeset/base/194447 Log: Since the width is always 2, it is enough to put just one trailing space is enough. MFC after: 1 week Modified: head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Thu Jun 18 15:57:57 2009 (r194446) +++ head/usr.bin/ncal/ncal.c Thu Jun 18 16:40:00 2009 (r194447) @@ -844,7 +844,7 @@ mkweekdays(struct weekdays *wds) for (i = 0; i != 7; i++) { tm.tm_wday = (i+1) % 7; wcsftime(buf, sizeof(buf), L"%a", &tm); - for (len = wcslen(buf); len > 0; --len) { + for (len = 2; len > 0; --len) { if ((width = wcswidth(buf, len)) <= 2) break; } @@ -852,7 +852,7 @@ mkweekdays(struct weekdays *wds) if (width == 1) wds->names[i][0] = L' '; wcsncat(wds->names[i], buf, len); - wcsncat(wds->names[i], L" ", 3 - wcswidth(wds->names[i], 2)); + wcsncat(wds->names[i], L" ", 1); } } From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 17:10:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4124D106564A; Thu, 18 Jun 2009 17:10:44 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 250248FC1D; Thu, 18 Jun 2009 17:10:44 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IHAioE017567; Thu, 18 Jun 2009 17:10:44 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IHAihc017562; Thu, 18 Jun 2009 17:10:44 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200906181710.n5IHAihc017562@svn.freebsd.org> From: Alexander Kabaev Date: Thu, 18 Jun 2009 17:10: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: r194448 - in head: include/rpc lib/libc/rpc usr.sbin/mountd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 17:10:44 -0000 Author: kan Date: Thu Jun 18 17:10:43 2009 New Revision: 194448 URL: http://svn.freebsd.org/changeset/base/194448 Log: Re-do r192913 in less intrusive way. Only do IP_RECVDSTADDR/IP_SENDSRCADDR dace for UPDv4 sockets bound to INADDR_ANY. Move the code to set IP_RECVDSTADDR/IP_SENDSRCADDR into svc_dg.c, so that both TLI and non-TLI users will be using it. Back out my previous commit to mountd. Turns out the problem was affecting more than one binary so it needs to me addressed in generic rpc code in libc in order to fix them all. Reported by: lstewart Tested by: lstewart Modified: head/include/rpc/svc_dg.h head/lib/libc/rpc/svc_dg.c head/lib/libc/rpc/svc_generic.c head/usr.sbin/mountd/mountd.c Modified: head/include/rpc/svc_dg.h ============================================================================== --- head/include/rpc/svc_dg.h Thu Jun 18 16:40:00 2009 (r194447) +++ head/include/rpc/svc_dg.h Thu Jun 18 17:10:43 2009 (r194448) @@ -46,6 +46,7 @@ struct svc_dg_data { XDR su_xdrs; /* XDR handle */ char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */ void *su_cache; /* cached data, NULL if none */ + struct netbuf su_srcaddr; /* dst address of last msg */ }; #define __rpcb_get_dg_xidp(x) (&((struct svc_dg_data *)(x)->xp_p2)->su_xid) Modified: head/lib/libc/rpc/svc_dg.c ============================================================================== --- head/lib/libc/rpc/svc_dg.c Thu Jun 18 16:40:00 2009 (r194447) +++ head/lib/libc/rpc/svc_dg.c Thu Jun 18 17:10:43 2009 (r194448) @@ -97,8 +97,9 @@ int svc_dg_enablecache(SVCXPRT *, u_int) */ static const char svc_dg_str[] = "svc_dg_create: %s"; static const char svc_dg_err1[] = "could not get transport information"; -static const char svc_dg_err2[] = " transport does not support data transfer"; +static const char svc_dg_err2[] = "transport does not support data transfer"; static const char svc_dg_err3[] = "getsockname failed"; +static const char svc_dg_err4[] = "cannot set IP_RECVDSTADDR"; static const char __no_mem_str[] = "out of memory"; SVCXPRT * @@ -156,6 +157,23 @@ svc_dg_create(fd, sendsize, recvsize) xprt->xp_ltaddr.len = slen; memcpy(xprt->xp_ltaddr.buf, &ss, slen); + if (ss.ss_family == AF_INET) { + struct sockaddr_in *sin; + static const int true_value = 1; + + sin = (struct sockaddr_in *)(void *)&ss; + if (sin->sin_addr.s_addr == INADDR_ANY) { + su->su_srcaddr.buf = mem_alloc(sizeof (ss)); + su->su_srcaddr.maxlen = sizeof (ss); + + if (_setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, + &true_value, sizeof(true_value))) { + warnx(svc_dg_str, svc_dg_err4); + goto freedata_nowarn; + } + } + } + xprt_register(xprt); return (xprt); freedata: @@ -197,13 +215,15 @@ svc_dg_recvfrom(int fd, char *buf, int b msg.msg_iovlen = 1; msg.msg_namelen = *raddrlen; msg.msg_name = (char *)raddr; - msg.msg_control = (caddr_t)tmp; - msg.msg_controllen = CMSG_LEN(sizeof(*lin)); + if (laddr != NULL) { + msg.msg_control = (caddr_t)tmp; + msg.msg_controllen = CMSG_LEN(sizeof(*lin)); + } rlen = _recvmsg(fd, &msg, 0); if (rlen >= 0) *raddrlen = msg.msg_namelen; - if (rlen == -1 || !laddr || + if (rlen == -1 || laddr == NULL || msg.msg_controllen < sizeof(struct cmsghdr) || msg.msg_flags & MSG_CTRUNC) return rlen; @@ -214,18 +234,19 @@ svc_dg_recvfrom(int fd, char *buf, int b cmsg->cmsg_type == IP_RECVDSTADDR) { have_lin = TRUE; memcpy(&lin->sin_addr, - (struct in_addr *)CMSG_DATA(cmsg), sizeof(struct in_addr)); + (struct in_addr *)CMSG_DATA(cmsg), + sizeof(struct in_addr)); break; } } - if (!have_lin) - return rlen; - lin->sin_family = AF_INET; lin->sin_port = 0; *laddrlen = sizeof(struct sockaddr_in); + if (!have_lin) + lin->sin_addr.s_addr = INADDR_ANY; + return rlen; } @@ -246,7 +267,7 @@ again: alen = sizeof (struct sockaddr_storage); rlen = svc_dg_recvfrom(xprt->xp_fd, rpc_buffer(xprt), su->su_iosz, (struct sockaddr *)(void *)&ss, &alen, - (struct sockaddr *)xprt->xp_ltaddr.buf, &xprt->xp_ltaddr.len); + (struct sockaddr *)su->su_srcaddr.buf, &su->su_srcaddr.len); if (rlen == -1 && errno == EINTR) goto again; if (rlen == -1 || (rlen < (ssize_t)(4 * sizeof (u_int32_t)))) @@ -300,7 +321,8 @@ svc_dg_sendto(int fd, char *buf, int buf msg.msg_namelen = raddrlen; msg.msg_name = (char *)raddr; - if (laddr->sa_family == AF_INET && lin->s_addr != INADDR_ANY) { + if (laddr != NULL && laddr->sa_family == AF_INET && + lin->s_addr != INADDR_ANY) { msg.msg_control = (caddr_t)tmp; msg.msg_controllen = CMSG_LEN(sizeof(*lin)); cmsg = CMSG_FIRSTHDR(&msg); @@ -346,8 +368,8 @@ svc_dg_reply(xprt, msg) if (svc_dg_sendto(xprt->xp_fd, rpc_buffer(xprt), slen, (struct sockaddr *)xprt->xp_rtaddr.buf, (socklen_t)xprt->xp_rtaddr.len, - (struct sockaddr *)xprt->xp_ltaddr.buf, - xprt->xp_ltaddr.len) == (ssize_t) slen) { + (struct sockaddr *)su->su_srcaddr.buf, + (socklen_t)su->su_srcaddr.len) == (ssize_t) slen) { stat = TRUE; if (su->su_cache) cache_set(xprt, slen); @@ -393,6 +415,8 @@ svc_dg_destroy(xprt) (void)_close(xprt->xp_fd); XDR_DESTROY(&(su->su_xdrs)); (void) mem_free(rpc_buffer(xprt), su->su_iosz); + if (su->su_srcaddr.buf) + (void) mem_free(su->su_srcaddr.buf, su->su_srcaddr.maxlen); (void) mem_free(su, sizeof (*su)); if (xprt->xp_rtaddr.buf) (void) mem_free(xprt->xp_rtaddr.buf, xprt->xp_rtaddr.maxlen); Modified: head/lib/libc/rpc/svc_generic.c ============================================================================== --- head/lib/libc/rpc/svc_generic.c Thu Jun 18 16:40:00 2009 (r194447) +++ head/lib/libc/rpc/svc_generic.c Thu Jun 18 17:10:43 2009 (r194448) @@ -199,7 +199,6 @@ svc_tli_create(fd, nconf, bindaddr, send struct __rpc_sockinfo si; struct sockaddr_storage ss; socklen_t slen; - static const int true_value = 1; if (fd == RPC_ANYFD) { if (nconf == NULL) { @@ -226,14 +225,6 @@ svc_tli_create(fd, nconf, bindaddr, send } } - if (si.si_af == AF_INET && si.si_socktype == SOCK_DGRAM) { - if (_setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, - &true_value, sizeof(true_value))) { - warnx("svc_tli_create: cannot set IP_RECVDSTADDR"); - return (NULL); - } - } - /* * If the fd is unbound, try to bind it. */ Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu Jun 18 16:40:00 2009 (r194447) +++ head/usr.sbin/mountd/mountd.c Thu Jun 18 17:10:43 2009 (r194448) @@ -568,13 +568,6 @@ create_service(struct netconfig *nconf) continue; } } - if (si.si_socktype == SOCK_DGRAM && - setsockopt(fd, IPPROTO_IP, IP_RECVDSTADDR, &one, - sizeof one) < 0) { - syslog(LOG_ERR, - "can't disable v4-in-v6 on IPv6 socket"); - exit(1); - } break; case AF_INET6: if (inet_pton(AF_INET6, hosts[nhostsbak], From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 17:44:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A08106566C; Thu, 18 Jun 2009 17:44: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 36A588FC0A; Thu, 18 Jun 2009 17:44:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IHihdC018448; Thu, 18 Jun 2009 17:44:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IHih1N018447; Thu, 18 Jun 2009 17:44:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906181744.n5IHih1N018447@svn.freebsd.org> From: John Baldwin Date: Thu, 18 Jun 2009 17:44: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: r194453 - in head: cddl/contrib/opensolaris sys/cddl/contrib/opensolaris X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 17:44:43 -0000 Author: jhb Date: Thu Jun 18 17:44:42 2009 New Revision: 194453 URL: http://svn.freebsd.org/changeset/base/194453 Log: Bootstrap mergeinfo for the OpenSolaris contrib bits. Modified: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 17:59:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CB561065672; Thu, 18 Jun 2009 17:59:05 +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 3B71F8FC16; Thu, 18 Jun 2009 17:59:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IHx5K6018753; Thu, 18 Jun 2009 17:59:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IHx5EL018751; Thu, 18 Jun 2009 17:59:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200906181759.n5IHx5EL018751@svn.freebsd.org> From: Alan Cox Date: Thu, 18 Jun 2009 17:59: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: r194454 - 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: Thu, 18 Jun 2009 17:59:05 -0000 Author: alc Date: Thu Jun 18 17:59:04 2009 New Revision: 194454 URL: http://svn.freebsd.org/changeset/base/194454 Log: Utilize the new function kmem_alloc_contig() to implement the UMA back-end allocator for the jumbo frames zones. This change has two benefits: (1) a custom back-end deallocator is no longer required. UMA's standard deallocator suffices. (2) It eliminates a potentially confusing artifact of using contigmalloc(): The malloc(9) statistics contain bogus information about the usage of jumbo frames. Specifically, the malloc(9) statistics report all jumbo frames in use whereas the UMA zone statistics report the "truth" about the number in use vs. the number free. Modified: head/sys/kern/kern_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Thu Jun 18 17:44:42 2009 (r194453) +++ head/sys/kern/kern_mbuf.c Thu Jun 18 17:59:04 2009 (r194454) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -232,9 +234,6 @@ static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, u_int8_t *, int); -static void mbuf_jumbo_free(void *, int, u_int8_t); - -static MALLOC_DEFINE(M_JUMBOFRAME, "jumboframes", "mbuf jumbo frame buffers"); /* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); @@ -296,7 +295,6 @@ mbuf_init(void *dummy) if (nmbjumbo9 > 0) uma_zone_set_max(zone_jumbo9, nmbjumbo9); uma_zone_set_allocf(zone_jumbo9, mbuf_jumbo_alloc); - uma_zone_set_freef(zone_jumbo9, mbuf_jumbo_free); zone_jumbo16 = uma_zcreate(MBUF_JUMBO16_MEM_NAME, MJUM16BYTES, mb_ctor_clust, mb_dtor_clust, @@ -309,7 +307,6 @@ mbuf_init(void *dummy) if (nmbjumbo16 > 0) uma_zone_set_max(zone_jumbo16, nmbjumbo16); uma_zone_set_allocf(zone_jumbo16, mbuf_jumbo_alloc); - uma_zone_set_freef(zone_jumbo16, mbuf_jumbo_free); zone_ext_refcnt = uma_zcreate(MBUF_EXTREFCNT_MEM_NAME, sizeof(u_int), NULL, NULL, @@ -358,18 +355,8 @@ mbuf_jumbo_alloc(uma_zone_t zone, int by /* Inform UMA that this allocator uses kernel_map/object. */ *flags = UMA_SLAB_KERNEL; - return (contigmalloc(bytes, M_JUMBOFRAME, wait, (vm_paddr_t)0, - ~(vm_paddr_t)0, 1, 0)); -} - -/* - * UMA backend page deallocator for the jumbo frame zones. - */ -static void -mbuf_jumbo_free(void *mem, int size, u_int8_t flags) -{ - - contigfree(mem, size, M_JUMBOFRAME); + return ((void *)kmem_alloc_contig(kernel_map, bytes, wait, + (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0)); } /* From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 18:34:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 866BC106566C for ; Thu, 18 Jun 2009 18:34:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1B18FC13 for ; Thu, 18 Jun 2009 18:34:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 20381 invoked by uid 399); 18 Jun 2009 18:34:39 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 18 Jun 2009 18:34:39 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4A3A88BD.5030703@FreeBSD.org> Date: Thu, 18 Jun 2009 11:34:37 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.21 (X11/20090423) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200906071326.n57DQvSG095104@svn.freebsd.org> <86iqiudm63.fsf@ds4.des.no> In-Reply-To: <86iqiudm63.fsf@ds4.des.no> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Edwin Groothuis Subject: Re: svn commit: r193635 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 18 Jun 2009 18:34:45 -0000 Dag-Erling Smørgrav wrote: > Edwin Groothuis writes: >> Author: edwin >> Date: Sun Jun 7 13:26:57 2009 >> New Revision: 193635 >> URL: http://svn.freebsd.org/changeset/base/193635 >> >> Log: >> Welcome to a default installed /etc/ntp.conf > > Great, now mergemaster blew away my ntp.conf and installed this one > instead. Apparently, it thinks AUTO_UPGRADE means it's fine to > overwrite an existing file with a new one... Yes, that's exactly what the option means. The problem comes in because it's a new file, which means that there is no record of it in the mtree file, so it does not show up as "changed." The problem is compounded by the fact that this is the first time I can remember that we've introduced a new file in the base that has the same name as a commonly (pre-)existing file that most users would have in /etc (as opposed to having it in /usr/local). Suggestions on how to deal with this issue are welcome. Please follow up on -current or -hackers. FWIW, this is one of the reasons that I resisted the idea of using mtree for this function, and continue to resist the idea of the -U option being the default. There is no way that I can see to have mtree list the files that have _not_ changed, which would be the safest way to implement this option. If someone wants to implement that option for mtree I will gladly update the -U option in mergemaster. (Looking at doing the change in mtree myself is "on the list," but it's way down there ...) Meanwhile I'm sure you were able to restore from backups, and there is always mergemaster's -P option .... Doug -- This .signature sanitized for your protection From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 20:42:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 474C51065673; Thu, 18 Jun 2009 20:42:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33E3F8FC1F; Thu, 18 Jun 2009 20:42:38 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IKgcE6022370; Thu, 18 Jun 2009 20:42:38 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IKgc3t022366; Thu, 18 Jun 2009 20:42:38 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200906182042.n5IKgc3t022366@svn.freebsd.org> From: Andrew Thompson Date: Thu, 18 Jun 2009 20:42: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: r194459 - in head/sys: arm/arm arm/include vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 20:42:38 -0000 Author: thompsa Date: Thu Jun 18 20:42:37 2009 New Revision: 194459 URL: http://svn.freebsd.org/changeset/base/194459 Log: Track the kernel mapping of a physical page by a new entry in vm_page structure. When the page is shared, the kernel mapping becomes a special type of managed page to force the cache off the page mappings. This is needed to avoid stale entries on all ARM VIVT caches, and VIPT caches with cache color issue. Submitted by: Mark Tinguely Reviewed by: alc Tested by: Grzegorz Bernacki, thompsa Modified: head/sys/arm/arm/pmap.c head/sys/arm/include/pmap.h head/sys/vm/vm_phys.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Thu Jun 18 19:58:05 2009 (r194458) +++ head/sys/arm/arm/pmap.c Thu Jun 18 20:42:37 2009 (r194459) @@ -200,8 +200,7 @@ static pv_entry_t pmap_get_pv_entry(void static void pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t, int); -static __inline void pmap_fix_cache(struct vm_page *, pmap_t, - vm_offset_t); +static void pmap_fix_cache(struct vm_page *, pmap_t, vm_offset_t); static void pmap_alloc_l1(pmap_t); static void pmap_free_l1(pmap_t); static void pmap_use_l1(pmap_t); @@ -406,7 +405,7 @@ int pmap_needs_pte_sync; #define pmap_is_current(pm) ((pm) == pmap_kernel() || \ curproc->p_vmspace->vm_map.pmap == (pm)) -static uma_zone_t pvzone; +static uma_zone_t pvzone = NULL; uma_zone_t l2zone; static uma_zone_t l2table_zone; static vm_offset_t pmap_kernel_l2dtable_kva; @@ -1451,6 +1450,7 @@ pmap_fix_cache(struct vm_page *pg, pmap_ * kernel writable or kernel readable with writable user entry */ if ((kwritable && entries) || + (kwritable > 1) || ((kwritable != writable) && kentries && (pv->pv_pmap == pmap_kernel() || (pv->pv_flags & PVF_WRITE) || @@ -1472,7 +1472,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_ continue; } /* user is no longer sharable and writable */ - if (pm != pmap_kernel() && (pv->pv_pmap == pm) && + if (pm != pmap_kernel() && + (pv->pv_pmap == pm || pv->pv_pmap == pmap_kernel()) && !pmwc && (pv->pv_flags & PVF_NC)) { pv->pv_flags &= ~(PVF_NC | PVF_MWC); @@ -1674,7 +1675,29 @@ pmap_enter_pv(struct vm_page *pg, struct vm_offset_t va, u_int flags) { + int km; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + + if (pg->md.pv_kva) { + /* PMAP_ASSERT_LOCKED(pmap_kernel()); */ + pve->pv_pmap = pmap_kernel(); + pve->pv_va = pg->md.pv_kva; + pve->pv_flags = PVF_WRITE | PVF_UNMAN; + pg->md.pv_kva = 0; + + TAILQ_INSERT_HEAD(&pg->md.pv_list, pve, pv_list); + TAILQ_INSERT_HEAD(&pm->pm_pvlist, pve, pv_plist); + if ((km = PMAP_OWNED(pmap_kernel()))) + PMAP_UNLOCK(pmap_kernel()); + vm_page_unlock_queues(); + if ((pve = pmap_get_pv_entry()) == NULL) + panic("pmap_kenter_internal: no pv entries"); + vm_page_lock_queues(); + if (km) + PMAP_LOCK(pmap_kernel()); + } + PMAP_ASSERT_LOCKED(pm); pve->pv_pmap = pm; pve->pv_va = va; @@ -1742,6 +1765,7 @@ static void pmap_nuke_pv(struct vm_page *pg, pmap_t pm, struct pv_entry *pve) { + struct pv_entry *pv; mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_ASSERT_LOCKED(pm); TAILQ_REMOVE(&pg->md.pv_list, pve, pv_list); @@ -1766,6 +1790,20 @@ pmap_nuke_pv(struct vm_page *pg, pmap_t vm_page_flag_clear(pg, PG_WRITEABLE); } } + pv = TAILQ_FIRST(&pg->md.pv_list); + if (pv != NULL && (pv->pv_flags & PVF_UNMAN) && + TAILQ_NEXT(pv, pv_list) == NULL) { + pg->md.pv_kva = pv->pv_va; + /* a recursive pmap_nuke_pv */ + TAILQ_REMOVE(&pg->md.pv_list, pv, pv_list); + TAILQ_REMOVE(&pm->pm_pvlist, pv, pv_plist); + if (pv->pv_flags & PVF_WIRED) + --pm->pm_stats.wired_count; + pg->md.pvh_attrs &= ~PVF_REF; + pg->md.pvh_attrs &= ~PVF_MOD; + vm_page_flag_clear(pg, PG_WRITEABLE); + pmap_free_pv_entry(pv); + } } static struct pv_entry * @@ -1784,6 +1822,9 @@ pmap_remove_pv(struct vm_page *pg, pmap_ pve = TAILQ_NEXT(pve, pv_list); } + if (pve == NULL && pg->md.pv_kva == va) + pg->md.pv_kva = 0; + return(pve); /* return removed pve */ } /* @@ -2711,8 +2752,8 @@ pmap_remove_pages(pmap_t pmap) cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); for (pv = TAILQ_FIRST(&pmap->pm_pvlist); pv; pv = npv) { - if (pv->pv_flags & PVF_WIRED) { - /* The page is wired, cannot remove it now. */ + if (pv->pv_flags & PVF_WIRED || pv->pv_flags & PVF_UNMAN) { + /* Cannot remove wired or unmanaged pages now. */ npv = TAILQ_NEXT(pv, pv_plist); continue; } @@ -2822,6 +2863,9 @@ pmap_kenter_internal(vm_offset_t va, vm_ struct l2_bucket *l2b; pt_entry_t *pte; pt_entry_t opte; + struct pv_entry *pve; + vm_page_t m; + PDEBUG(1, printf("pmap_kenter: va = %08x, pa = %08x\n", (uint32_t) va, (uint32_t) pa)); @@ -2835,10 +2879,7 @@ pmap_kenter_internal(vm_offset_t va, vm_ PDEBUG(1, printf("pmap_kenter: pte = %08x, opte = %08x, npte = %08x\n", (uint32_t) pte, opte, *pte)); if (l2pte_valid(opte)) { - cpu_dcache_wbinv_range(va, PAGE_SIZE); - cpu_l2cache_wbinv_range(va, PAGE_SIZE); - cpu_tlb_flushD_SE(va); - cpu_cpwait(); + pmap_kremove(va); } else { if (opte == 0) l2b->l2b_occupancy++; @@ -2850,6 +2891,33 @@ pmap_kenter_internal(vm_offset_t va, vm_ if (flags & KENTER_USER) *pte |= L2_S_PROT_U; PTE_SYNC(pte); + + /* kernel direct mappings can be shared, so use a pv_entry + * to ensure proper caching. + * + * The pvzone is used to delay the recording of kernel + * mappings until the VM is running. + * + * This expects the physical memory to have vm_page_array entry. + */ + if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa))) { + vm_page_lock_queues(); + if (!TAILQ_EMPTY(&m->md.pv_list) || m->md.pv_kva) { + /* release vm_page lock for pv_entry UMA */ + vm_page_unlock_queues(); + if ((pve = pmap_get_pv_entry()) == NULL) + panic("pmap_kenter_internal: no pv entries"); + vm_page_lock_queues(); + PMAP_LOCK(pmap_kernel()); + pmap_enter_pv(m, pve, pmap_kernel(), va, + PVF_WRITE | PVF_UNMAN); + pmap_fix_cache(m, pmap_kernel(), va); + PMAP_UNLOCK(pmap_kernel()); + } else { + m->md.pv_kva = va; + } + vm_page_unlock_queues(); + } } void @@ -2886,6 +2954,9 @@ pmap_kremove(vm_offset_t va) { struct l2_bucket *l2b; pt_entry_t *pte, opte; + struct pv_entry *pve; + vm_page_t m; + vm_offset_t pa; l2b = pmap_get_l2_bucket(pmap_kernel(), va); if (!l2b) @@ -2894,6 +2965,25 @@ pmap_kremove(vm_offset_t va) pte = &l2b->l2b_kva[l2pte_index(va)]; opte = *pte; if (l2pte_valid(opte)) { + /* pa = vtophs(va) taken from pmap_extract() */ + switch (opte & L2_TYPE_MASK) { + case L2_TYPE_L: + pa = (opte & L2_L_FRAME) | (va & L2_L_OFFSET); + break; + default: + pa = (opte & L2_S_FRAME) | (va & L2_S_OFFSET); + break; + } + /* note: should never have to remove an allocation + * before the pvzone is initialized. + */ + vm_page_lock_queues(); + PMAP_LOCK(pmap_kernel()); + if (pvzone != NULL && (m = vm_phys_paddr_to_vm_page(pa)) && + (pve = pmap_remove_pv(m, pmap_kernel(), va))) + pmap_free_pv_entry(pve); + PMAP_UNLOCK(pmap_kernel()); + vm_page_unlock_queues(); cpu_dcache_wbinv_range(va, PAGE_SIZE); cpu_l2cache_wbinv_range(va, PAGE_SIZE); cpu_tlb_flushD_SE(va); @@ -3137,16 +3227,24 @@ pmap_remove_all(vm_page_t m) cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); } - l2b = pmap_get_l2_bucket(pv->pv_pmap, pv->pv_va); - KASSERT(l2b != NULL, ("No l2 bucket")); - ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; - *ptep = 0; - PTE_SYNC_CURRENT(pv->pv_pmap, ptep); - pmap_free_l2_bucket(pv->pv_pmap, l2b, 1); - if (pv->pv_flags & PVF_WIRED) - pv->pv_pmap->pm_stats.wired_count--; - pv->pv_pmap->pm_stats.resident_count--; - flags |= pv->pv_flags; + if (pv->pv_flags & PVF_UNMAN) { + /* remove the pv entry, but do not remove the mapping + * and remember this is a kernel mapped page + */ + m->md.pv_kva = pv->pv_va; + } else { + /* remove the mapping and pv entry */ + l2b = pmap_get_l2_bucket(pv->pv_pmap, pv->pv_va); + KASSERT(l2b != NULL, ("No l2 bucket")); + ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + *ptep = 0; + PTE_SYNC_CURRENT(pv->pv_pmap, ptep); + pmap_free_l2_bucket(pv->pv_pmap, l2b, 1); + if (pv->pv_flags & PVF_WIRED) + pv->pv_pmap->pm_stats.wired_count--; + pv->pv_pmap->pm_stats.resident_count--; + flags |= pv->pv_flags; + } pmap_nuke_pv(m, pv->pv_pmap, pv); PMAP_UNLOCK(pv->pv_pmap); pmap_free_pv_entry(pv); @@ -3428,25 +3526,19 @@ do_l2b_alloc: * It is part of our managed memory so we * must remove it from the PV list */ - pve = pmap_remove_pv(opg, pmap, va); - if (m && (m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) && - pve) - pmap_free_pv_entry(pve); - else if (!pve && - !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS))) - pve = pmap_get_pv_entry(); - KASSERT(pve != NULL || m->flags & (PG_UNMANAGED | - PG_FICTITIOUS), ("No pv")); - oflags = pve->pv_flags; - + if ((pve = pmap_remove_pv(opg, pmap, va))) { + + /* note for patch: the oflags/invalidation was moved + * because PG_FICTITIOUS pages could free the pve + */ + oflags = pve->pv_flags; /* * If the old mapping was valid (ref/mod * emulation creates 'invalid' mappings * initially) then make sure to frob * the cache. */ - if ((oflags & PVF_NC) == 0 && - l2pte_valid(opte)) { + if ((oflags & PVF_NC) == 0 && l2pte_valid(opte)) { if (PV_BEEN_EXECD(oflags)) { pmap_idcache_wbinv_range(pmap, va, PAGE_SIZE); @@ -3456,15 +3548,43 @@ do_l2b_alloc: PAGE_SIZE, TRUE, (oflags & PVF_WRITE) == 0); } - } - } else if (m && !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS))) - if ((pve = pmap_get_pv_entry()) == NULL) { - panic("pmap_enter: no pv entries"); - } - if (m && !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS))) { + } + + /* free/allocate a pv_entry for UNMANAGED pages if + * this physical page is not/is already mapped. + */ + + if (m && ((m->flags & PG_FICTITIOUS) || + ((m->flags & PG_UNMANAGED) && + !m->md.pv_kva && + TAILQ_EMPTY(&m->md.pv_list)))) { + pmap_free_pv_entry(pve); + pve = NULL; + } + } else if (m && !(m->flags & PG_FICTITIOUS) && + (!(m->flags & PG_UNMANAGED) || m->md.pv_kva || + !TAILQ_EMPTY(&m->md.pv_list))) + pve = pmap_get_pv_entry(); + } else if (m && !(m->flags & PG_FICTITIOUS) && + (!(m->flags & PG_UNMANAGED) || m->md.pv_kva || + !TAILQ_EMPTY(&m->md.pv_list))) + pve = pmap_get_pv_entry(); + + if (m && !(m->flags & PG_FICTITIOUS)) { KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva, - ("pmap_enter: managed mapping within the clean submap")); - pmap_enter_pv(m, pve, pmap, va, nflags); + ("pmap_enter: managed mapping within the clean submap")); + if (m->flags & PG_UNMANAGED) { + if (!TAILQ_EMPTY(&m->md.pv_list) || + m->md.pv_kva) { + KASSERT(pve != NULL, ("No pv")); + nflags |= PVF_UNMAN; + pmap_enter_pv(m, pve, pmap, va, nflags); + } else + m->md.pv_kva = va; + } else { + KASSERT(pve != NULL, ("No pv")); + pmap_enter_pv(m, pve, pmap, va, nflags); + } } } /* Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Thu Jun 18 19:58:05 2009 (r194458) +++ head/sys/arm/include/pmap.h Thu Jun 18 20:42:37 2009 (r194459) @@ -94,6 +94,7 @@ struct pv_entry; struct md_page { int pvh_attrs; + vm_offset_t pv_kva; /* first kernel VA mapping */ TAILQ_HEAD(,pv_entry) pv_list; }; @@ -494,6 +495,7 @@ void pmap_use_minicache(vm_offset_t, vm_ #define PVF_EXEC 0x10 /* mapping is executable */ #define PVF_NC 0x20 /* mapping is non-cacheable */ #define PVF_MWC 0x40 /* mapping is used multiple times in userland */ +#define PVF_UNMAN 0x80 /* mapping is unmanaged */ void vector_page_setprot(int); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Thu Jun 18 19:58:05 2009 (r194458) +++ head/sys/vm/vm_phys.c Thu Jun 18 20:42:37 2009 (r194459) @@ -382,8 +382,7 @@ vm_phys_paddr_to_vm_page(vm_paddr_t pa) if (pa >= seg->start && pa < seg->end) return (&seg->first_page[atop(pa - seg->start)]); } - panic("vm_phys_paddr_to_vm_page: paddr %#jx is not in any segment", - (uintmax_t)pa); + return (NULL); } /* From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 20:56:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9153C106568D; Thu, 18 Jun 2009 20:56:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 654098FC12; Thu, 18 Jun 2009 20:56:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IKuMoR022575; Thu, 18 Jun 2009 20:56:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5IKuMdw022573; Thu, 18 Jun 2009 20:56:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200906182056.n5IKuMdw022573@svn.freebsd.org> From: John Baldwin Date: Thu, 18 Jun 2009 20:56: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: r194460 - 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: Thu, 18 Jun 2009 20:56:23 -0000 Author: jhb Date: Thu Jun 18 20:56:22 2009 New Revision: 194460 URL: http://svn.freebsd.org/changeset/base/194460 Log: Fix a deadlock in the getpeername() method for UNIX domain sockets. Instead of locking the local unp followed by the remote unp, use the same locking model as accept() and read lock the global link lock followed by the remote unp while fetching the remote sockaddr. Reported by: Mel Flynn mel.flynn of mailing.thruhere.net Reviewed by: rwatson MFC after: 1 week Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jun 18 20:42:37 2009 (r194459) +++ head/sys/kern/uipc_usrreq.c Thu Jun 18 20:56:22 2009 (r194460) @@ -671,7 +671,7 @@ uipc_peeraddr(struct socket *so, struct KASSERT(unp != NULL, ("uipc_peeraddr: unp == NULL")); *nam = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK); - UNP_PCB_LOCK(unp); + UNP_LINK_RLOCK(); /* * XXX: It seems that this test always fails even when connection is * established. So, this else clause is added as workaround to @@ -681,7 +681,7 @@ uipc_peeraddr(struct socket *so, struct if (unp2 != NULL) { UNP_PCB_LOCK(unp2); if (unp2->unp_addr != NULL) - sa = (struct sockaddr *) unp->unp_conn->unp_addr; + sa = (struct sockaddr *) unp2->unp_addr; else sa = &sun_noname; bcopy(sa, *nam, sa->sa_len); @@ -690,7 +690,7 @@ uipc_peeraddr(struct socket *so, struct sa = &sun_noname; bcopy(sa, *nam, sa->sa_len); } - UNP_PCB_UNLOCK(unp); + UNP_LINK_RUNLOCK(); return (0); } @@ -850,7 +850,7 @@ uipc_send(struct socket *so, int flags, * return the slightly counter-intuitive but otherwise * correct error that the socket is not connected. * - * Locking here must be done carefully: the inkage lock + * Locking here must be done carefully: the linkage lock * prevents interconnections between unpcbs from changing, so * we can traverse from unp to unp2 without acquiring unp's * lock. Socket buffer locks follow unpcb locks, so we can From owner-svn-src-head@FreeBSD.ORG Thu Jun 18 21:15:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68BB0106564A; Thu, 18 Jun 2009 21:15:41 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56FAA8FC15; Thu, 18 Jun 2009 21:15:41 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5ILFfpc022875; Thu, 18 Jun 2009 21:15:41 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5ILFfD7022873; Thu, 18 Jun 2009 21:15:41 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200906182115.n5ILFfD7022873@svn.freebsd.org> From: Rui Paulo Date: Thu, 18 Jun 2009 21:15: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: r194461 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 21:15:41 -0000 Author: rpaulo Date: Thu Jun 18 21:15:41 2009 New Revision: 194461 URL: http://svn.freebsd.org/changeset/base/194461 Log: ieee80211_dwds_mcast(): check the correct mbuf ptr after encap. Modified: head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Thu Jun 18 20:56:22 2009 (r194460) +++ head/sys/net80211/ieee80211_wds.c Thu Jun 18 21:15:41 2009 (r194461) @@ -282,7 +282,7 @@ ieee80211_dwds_mcast(struct ieee80211vap * Encapsulate the packet in prep for transmission. */ mcopy = ieee80211_encap(vap, ni, mcopy); - if (m == NULL) { + if (mcopy == NULL) { /* NB: stat+msg handled in ieee80211_encap */ ieee80211_free_node(ni); continue; From owner-svn-src-head@FreeBSD.ORG Fri Jun 19 07:18:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4099E1065673; Fri, 19 Jun 2009 07:18:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F44F8FC15; Fri, 19 Jun 2009 07:18:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5J7IkFL034285; Fri, 19 Jun 2009 07:18:46 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5J7Ikun034283; Fri, 19 Jun 2009 07:18:46 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906190718.n5J7Ikun034283@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 19 Jun 2009 07:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194474 - head/release/picobsd/mfs_tree/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2009 07:18:46 -0000 Author: edwin Date: Fri Jun 19 07:18:45 2009 New Revision: 194474 URL: http://svn.freebsd.org/changeset/base/194474 Log: The "original" PR said that there were two issues with the motd (Eyes of the daemon not synced and the motd not displayed properly on black-on-white screens): The first one was not valid anymore since the text and logo were swapped already, the second one is fixed by resetting the whole colourscheme instead of only the background colour. (also removed svn:keywords from motd since it doesn't have the string $FreeBSD$ in it) PR: misc/15876 Submitted by: peter.jeremy@ALCATEL.COM.AU MFC after: 1 week Modified: head/release/picobsd/mfs_tree/etc/motd (contents, props changed) Modified: head/release/picobsd/mfs_tree/etc/motd ============================================================================== --- head/release/picobsd/mfs_tree/etc/motd Fri Jun 19 05:18:43 2009 (r194473) +++ head/release/picobsd/mfs_tree/etc/motd Fri Jun 19 07:18:45 2009 (r194474) @@ -3,7 +3,7 @@ )\_)\ Welcome to PicoBSD (o,o) __ \~/ - -->====\ + -->====\ ~~ d d ============================================================== From owner-svn-src-head@FreeBSD.ORG Fri Jun 19 11:52:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 522AC1065678; Fri, 19 Jun 2009 11:52:08 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4056C8FC0C; Fri, 19 Jun 2009 11:52:08 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JBq8jV042676; Fri, 19 Jun 2009 11:52:08 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JBq8uE042674; Fri, 19 Jun 2009 11:52:08 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200906191152.n5JBq8uE042674@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 19 Jun 2009 11:52: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: r194485 - head/share/zoneinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: 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, 19 Jun 2009 11:52:08 -0000 Author: edwin Date: Fri Jun 19 11:52:07 2009 New Revision: 194485 URL: http://svn.freebsd.org/changeset/base/194485 Log: MFV of r194480 - Official start of Bangladesh DST. Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/asia Modified: head/share/zoneinfo/asia ============================================================================== --- head/share/zoneinfo/asia Fri Jun 19 11:31:07 2009 (r194484) +++ head/share/zoneinfo/asia Fri Jun 19 11:52:07 2009 (r194485) @@ -1,5 +1,5 @@ #
-# @(#)asia	8.34
+# @(#)asia	8.35
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -165,9 +165,12 @@ Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# 
 # http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
 # 
 
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Bang	2009	only	-	Jan	1	0:00	0	-
-Rule	Bang	2009	only	-	Jun	20	0:00	1:00	S
+# From A. N. M. Kamrus Saadat (2009-06-15):
+# Finally we've got the official mail regarding DST start time where DST start 
+# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh 
+# Telecommunication Regulatory Commission). 
+#
+# No DST end date has been announced yet.
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
@@ -176,8 +179,8 @@ Zone	Asia/Dhaka	6:01:40 -	LMT	1890
 			5:30	-	IST	1942 Sep
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	2009 # Bangladesh Time
-			6:00	Bang	BD%sT
+			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
+			6:00	1:00	BDST
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 15:52:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0D9B01065674;
	Fri, 19 Jun 2009 15:52:36 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D51B98FC08;
	Fri, 19 Jun 2009 15:52:35 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JFqZgO047707;
	Fri, 19 Jun 2009 15:52:35 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JFqZcG047705;
	Fri, 19 Jun 2009 15:52:35 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906191552.n5JFqZcG047705@svn.freebsd.org>
From: Brooks Davis 
Date: Fri, 19 Jun 2009 15:52: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: r194493 - head/usr.bin/catman
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 15:52:36 -0000

Author: brooks
Date: Fri Jun 19 15:52:35 2009
New Revision: 194493
URL: http://svn.freebsd.org/changeset/base/194493

Log:
  When checking if we can write to a file, use access() instead of a
  manual permission check based on stat output.  Also, get rid of the
  executability check since it is not used.
  
  MFC after:	2 weeks

Modified:
  head/usr.bin/catman/catman.c

Modified: head/usr.bin/catman/catman.c
==============================================================================
--- head/usr.bin/catman/catman.c	Fri Jun 19 15:31:40 2009	(r194492)
+++ head/usr.bin/catman/catman.c	Fri Jun 19 15:52:35 2009	(r194493)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #define TEST_FILE	0x04
 #define TEST_READABLE	0x08
 #define TEST_WRITABLE	0x10
-#define TEST_EXECUTABLE	0x20
 
 static int verbose;		/* -v flag: be verbose with warnings */
 static int pretend;		/* -n, -p flags: print out what would be done
@@ -92,9 +91,6 @@ static const char *locale_device[] = {
 #define	GZCAT_CMD	"z"
 enum Ziptype {NONE, BZIP, GZIP};
 
-static uid_t uid;
-static gid_t gids[NGROUPS_MAX];
-static int ngids;
 static int starting_dir;
 static char tmp_file[MAXPATHLEN];
 struct stat test_st;
@@ -320,23 +316,10 @@ test_path(char *name, time_t *mod_time)
 		result |= TEST_DIR;
 	else if (S_ISREG(test_st.st_mode))
 		result |= TEST_FILE;
-	if (test_st.st_uid == uid) {
-		test_st.st_mode >>= 6;
-	} else {
-		int i;
-		for (i = 0; i < ngids; i++) {
-			if (test_st.st_gid == gids[i]) {
-				test_st.st_mode >>= 3;
-				break;
-			}
-		}
-	}
-	if (test_st.st_mode & S_IROTH)
+	if (access(name, R_OK))
 		result |= TEST_READABLE;
-	if (test_st.st_mode & S_IWOTH)
+	if (access(name, W_OK))
 		result |= TEST_WRITABLE;
-	if (test_st.st_mode & S_IXOTH)
-		result |= TEST_EXECUTABLE;
 	return result;
 }
 
@@ -759,14 +742,6 @@ main(int argc, char **argv)
 {
 	int opt;
 
-	if ((uid = getuid()) == 0) {
-		fprintf(stderr, "don't run %s as root, use:\n   echo", argv[0]);
-		for (optind = 0; optind < argc; optind++) {
-			fprintf(stderr, " %s", argv[optind]);
-		}
-		fprintf(stderr, " | nice -5 su -m man\n");
-		exit(1);
-	}
 	while ((opt = getopt(argc, argv, "vnfLrh")) != -1) {
 		switch (opt) {
 		case 'f':
@@ -789,7 +764,6 @@ main(int argc, char **argv)
 			/* NOTREACHED */
 		}
 	}
-	ngids = getgroups(NGROUPS_MAX, gids);
 	if ((starting_dir = open(".", 0)) < 0) {
 		err(1, ".");
 	}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 15:58:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 976811065670;
	Fri, 19 Jun 2009 15:58:25 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 818198FC18;
	Fri, 19 Jun 2009 15:58:25 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JFwPOl047894;
	Fri, 19 Jun 2009 15:58:25 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JFwPSW047880;
	Fri, 19 Jun 2009 15:58:25 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906191558.n5JFwPSW047880@svn.freebsd.org>
From: Brooks Davis 
Date: Fri, 19 Jun 2009 15:58: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: r194494 - in head: lib/libc/gen lib/libc/rpc
	lib/libc/sys usr.bin/id usr.bin/newgrp usr.bin/quota
	usr.sbin/chown usr.sbin/chroot usr.sbin/jail usr.sbin/jexec
	usr.sbin/lpr/lpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 15:58:26 -0000

Author: brooks
Date: Fri Jun 19 15:58:24 2009
New Revision: 194494
URL: http://svn.freebsd.org/changeset/base/194494

Log:
  In preparation for raising NGROUPS and NGROUPS_MAX, change base
  system callers of getgroups(), getgrouplist(), and setgroups() to
  allocate buffers dynamically.  Specifically, allocate a buffer of size
  sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow).
  
  This (or similar gymnastics) is required for the code to actually follow
  the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime
  and where getgroups may return {NGROUPS_MAX}+1 results on systems like
  FreeBSD which include the primary group.
  
  In id(1), don't pointlessly add the primary group to the list of all
  groups, it is always the first result from getgroups().  In principle
  the old code was more portable, but this was only done in one of the two
  places where getgroups() was called to the overall effect was pointless.
  
  Document the actual POSIX requirements in the getgroups(2) and
  setgroups(2) manpages.  We do not yet support a dynamic NGROUPS, but we
  may in the future.
  
  MFC after:	2 weeks

Modified:
  head/lib/libc/gen/initgroups.3
  head/lib/libc/gen/initgroups.c
  head/lib/libc/rpc/auth_unix.c
  head/lib/libc/sys/getgroups.2
  head/lib/libc/sys/setgroups.2
  head/usr.bin/id/id.c
  head/usr.bin/newgrp/newgrp.c
  head/usr.bin/quota/quota.c
  head/usr.sbin/chown/chown.c
  head/usr.sbin/chroot/chroot.c
  head/usr.sbin/jail/jail.c
  head/usr.sbin/jexec/jexec.c
  head/usr.sbin/lpr/lpc/lpc.c

Modified: head/lib/libc/gen/initgroups.3
==============================================================================
--- head/lib/libc/gen/initgroups.3	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/lib/libc/gen/initgroups.3	Fri Jun 19 15:58:24 2009	(r194494)
@@ -65,6 +65,13 @@ function may fail and set
 .Va errno
 for any of the errors specified for the library function
 .Xr setgroups 2 .
+It may also return:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+The
+.Fn initgroups
+function was unable to allocate temporary storage.
+.El
 .Sh SEE ALSO
 .Xr setgroups 2 ,
 .Xr getgrouplist 3

Modified: head/lib/libc/gen/initgroups.c
==============================================================================
--- head/lib/libc/gen/initgroups.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/lib/libc/gen/initgroups.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -35,10 +35,12 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
 #include "namespace.h"
 #include 
 #include "un-namespace.h"
+#include 
+#include 
+#include 
 #include 
 
 int
@@ -46,14 +48,21 @@ initgroups(uname, agroup)
 	const char *uname;
 	gid_t agroup;
 {
-	int ngroups;
+	int ngroups, ret;
+	long ngroups_max;
+	gid_t *groups;
+
 	/*
-	 * Provide space for one group more than NGROUPS to allow
+	 * Provide space for one group more than possible to allow
 	 * setgroups to fail and set errno.
 	 */
-	gid_t groups[NGROUPS + 1];
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 2;
+	if ((groups = malloc(sizeof(*groups) * ngroups_max)) == NULL)
+		return (ENOMEM);
 
-	ngroups = NGROUPS + 1;
+	ngroups = (int)ngroups_max;
 	getgrouplist(uname, agroup, groups, &ngroups);
-	return (setgroups(ngroups, groups));
+	ret = setgroups(ngroups, groups);
+	free(groups);
+	return (ret);
 }

Modified: head/lib/libc/rpc/auth_unix.c
==============================================================================
--- head/lib/libc/rpc/auth_unix.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/lib/libc/rpc/auth_unix.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -185,23 +185,29 @@ authunix_create(machname, uid, gid, len,
 AUTH *
 authunix_create_default()
 {
-	int len;
+	int ngids;
+	long ngids_max;
 	char machname[MAXHOSTNAMELEN + 1];
 	uid_t uid;
 	gid_t gid;
-	gid_t gids[NGROUPS_MAX];
+	gid_t *gids;
+
+	ngids_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	gids = malloc(sizeof(gid_t) * ngids_max);
+	if (gids == NULL)
+		return (NULL);
 
 	if (gethostname(machname, sizeof machname) == -1)
 		abort();
 	machname[sizeof(machname) - 1] = 0;
 	uid = geteuid();
 	gid = getegid();
-	if ((len = getgroups(NGROUPS_MAX, gids)) < 0)
+	if ((ngids = getgroups(ngids_max, gids)) < 0)
 		abort();
-	if (len > NGRPS)
-		len = NGRPS;
+	if (ngids > NGRPS)
+		ngids = NGRPS;
 	/* XXX: interface problem; those should all have been unsigned */
-	return (authunix_create(machname, (int)uid, (int)gid, len,
+	return (authunix_create(machname, (int)uid, (int)gid, ngids,
 	    (int *)gids));
 }
 

Modified: head/lib/libc/sys/getgroups.2
==============================================================================
--- head/lib/libc/sys/getgroups.2	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/lib/libc/sys/getgroups.2	Fri Jun 19 15:58:24 2009	(r194494)
@@ -58,10 +58,7 @@ The
 system call
 returns the actual number of groups returned in
 .Fa gidset .
-No more than
-.Dv NGROUPS_MAX
-will ever
-be returned.
+At least one and as many as {NGROUPS_MAX}+1 values may be returned.
 If
 .Fa gidsetlen
 is zero,
@@ -92,6 +89,11 @@ an invalid address.
 .Sh SEE ALSO
 .Xr setgroups 2 ,
 .Xr initgroups 3
+.Sh STANDARDS
+The
+.Fn getgroups
+system call conforms to
+.St -p1003.1-2008 .
 .Sh HISTORY
 The
 .Fn getgroups

Modified: head/lib/libc/sys/setgroups.2
==============================================================================
--- head/lib/libc/sys/setgroups.2	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/lib/libc/sys/setgroups.2	Fri Jun 19 15:58:24 2009	(r194494)
@@ -53,9 +53,7 @@ The
 argument
 indicates the number of entries in the array and must be no
 more than
-.Dv NGROUPS ,
-as defined in
-.In sys/param.h .
+.Dv {NGROUPS_MAX}+1 .
 .Pp
 Only the super-user may set a new group list.
 .Sh RETURN VALUES
@@ -71,7 +69,7 @@ The caller is not the super-user.
 The number specified in the
 .Fa ngroups
 argument is larger than the
-.Dv NGROUPS
+.Dv {NGROUPS_MAX}+1
 limit.
 .It Bq Er EFAULT
 The address specified for

Modified: head/usr.bin/id/id.c
==============================================================================
--- head/usr.bin/id/id.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.bin/id/id.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -258,7 +258,8 @@ id_print(struct passwd *pw, int use_ggl,
 	gid_t gid, egid, lastgid;
 	uid_t uid, euid;
 	int cnt, ngroups;
-	gid_t groups[NGROUPS + 1];
+	long ngroups_max;
+	gid_t *groups;
 	const char *fmt;
 
 	if (pw != NULL) {
@@ -270,12 +271,16 @@ id_print(struct passwd *pw, int use_ggl,
 		gid = getgid();
 	}
 
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+		err(1, "malloc");
+
 	if (use_ggl && pw != NULL) {
-		ngroups = NGROUPS + 1;
+		ngroups = ngroups_max;
 		getgrouplist(pw->pw_name, gid, groups, &ngroups);
 	}
 	else {
-		ngroups = getgroups(NGROUPS + 1, groups);
+		ngroups = getgroups(ngroups_max, groups);
 	}
 
 	if (pw != NULL)
@@ -306,6 +311,7 @@ id_print(struct passwd *pw, int use_ggl,
 		lastgid = gid;
 	}
 	printf("\n");
+	free(groups);
 }
 
 #ifdef USE_BSM_AUDIT
@@ -361,15 +367,19 @@ group(struct passwd *pw, int nflag)
 {
 	struct group *gr;
 	int cnt, id, lastid, ngroups;
-	gid_t groups[NGROUPS + 1];
+	long ngroups_max;
+	gid_t *groups;
 	const char *fmt;
 
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	if ((groups = malloc(sizeof(gid_t) * (ngroups_max))) == NULL)
+		err(1, "malloc");
+
 	if (pw) {
-		ngroups = NGROUPS + 1;
+		ngroups = ngroups_max;
 		(void) getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
 	} else {
-		groups[0] = getgid();
-		ngroups = getgroups(NGROUPS, groups + 1) + 1;
+		ngroups = getgroups(ngroups_max, groups);
 	}
 	fmt = nflag ? "%s" : "%u";
 	for (lastid = -1, cnt = 0; cnt < ngroups; ++cnt) {
@@ -389,6 +399,7 @@ group(struct passwd *pw, int nflag)
 		lastid = id;
 	}
 	(void)printf("\n");
+	free(groups);
 }
 
 void

Modified: head/usr.bin/newgrp/newgrp.c
==============================================================================
--- head/usr.bin/newgrp/newgrp.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.bin/newgrp/newgrp.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -146,8 +146,8 @@ restoregrps(void)
 static void
 addgroup(const char *grpname)
 {
-	gid_t grps[NGROUPS_MAX];
-	long lgid;
+	gid_t *grps;
+	long lgid, ngrps_max;
 	int dbmember, i, ngrps;
 	gid_t egid;
 	struct group *grp;
@@ -185,7 +185,10 @@ addgroup(const char *grpname)
 		}
 	}
 
-	if ((ngrps = getgroups(NGROUPS_MAX, (gid_t *)grps)) < 0) {
+	ngrps_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	if ((grps = malloc(sizeof(gid_t) * ngrps_max)) == NULL)
+		err(1, "malloc");
+	if ((ngrps = getgroups(ngrps_max, (gid_t *)grps)) < 0) {
 		warn("getgroups");
 		return;
 	}
@@ -217,7 +220,7 @@ addgroup(const char *grpname)
 
 	/* Add old effective gid to supp. list if it does not exist. */
 	if (egid != grp->gr_gid && !inarray(egid, grps, ngrps)) {
-		if (ngrps == NGROUPS_MAX)
+		if (ngrps == ngrps_max)
 			warnx("too many groups");
 		else {
 			grps[ngrps++] = egid;
@@ -231,6 +234,7 @@ addgroup(const char *grpname)
 		}
 	}
 
+	free(grps);
 }
 
 static int

Modified: head/usr.bin/quota/quota.c
==============================================================================
--- head/usr.bin/quota/quota.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.bin/quota/quota.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -117,7 +117,8 @@ int
 main(int argc, char *argv[])
 {
 	int ngroups; 
-	gid_t mygid, gidset[NGROUPS];
+	long ngroups_max;
+	gid_t mygid, *gidset;
 	int i, ch, gflag = 0, uflag = 0, errflag = 0;
 
 	while ((ch = getopt(argc, argv, "f:ghlrquv")) != -1) {
@@ -159,13 +160,18 @@ main(int argc, char *argv[])
 			errflag += showuid(getuid());
 		if (gflag) {
 			mygid = getgid();
-			ngroups = getgroups(NGROUPS, gidset);
+			ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+			if ((gidset = malloc(sizeof(gid_t) * ngroups_max))
+			    == NULL)
+				err(1, "malloc");
+			ngroups = getgroups(ngroups_max, gidset);
 			if (ngroups < 0)
 				err(1, "getgroups");
 			errflag += showgid(mygid);
 			for (i = 0; i < ngroups; i++)
 				if (gidset[i] != mygid)
 					errflag += showgid(gidset[i]);
+			free(gidset);
 		}
 		return(errflag);
 	}

Modified: head/usr.sbin/chown/chown.c
==============================================================================
--- head/usr.sbin/chown/chown.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.sbin/chown/chown.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -269,7 +269,8 @@ chownerr(const char *file)
 {
 	static uid_t euid = -1;
 	static int ngroups = -1;
-	gid_t groups[NGROUPS_MAX];
+	static long ngroups_max;
+	gid_t *groups;
 
 	/* Check for chown without being root. */
 	if (errno != EPERM || (uid != (uid_t)-1 &&
@@ -281,7 +282,10 @@ chownerr(const char *file)
 	/* Check group membership; kernel just returns EPERM. */
 	if (gid != (gid_t)-1 && ngroups == -1 &&
 	    euid == (uid_t)-1 && (euid = geteuid()) != 0) {
-		ngroups = getgroups(NGROUPS_MAX, groups);
+		ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+		if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+			err(1, "malloc");
+		ngroups = getgroups(ngroups_max, groups);
 		while (--ngroups >= 0 && gid != groups[ngroups]);
 		if (ngroups < 0) {
 			warnx("you are not a member of group %s", gname);

Modified: head/usr.sbin/chroot/chroot.c
==============================================================================
--- head/usr.sbin/chroot/chroot.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.sbin/chroot/chroot.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -69,9 +69,10 @@ main(argc, argv)
 	struct passwd	*pw;
 	char		*endp, *p;
 	const char	*shell;
-	gid_t		gid, gidlist[NGROUPS_MAX];
+	gid_t		gid, *gidlist;
 	uid_t		uid;
 	int		ch, gids;
+	long		ngroups_max;
 
 	gid = 0;
 	uid = 0;
@@ -117,8 +118,11 @@ main(argc, argv)
 		}
 	}
 
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	if ((gidlist = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+		err(1, "malloc");
 	for (gids = 0;
-	    (p = strsep(&grouplist, ",")) != NULL && gids < NGROUPS_MAX; ) {
+	    (p = strsep(&grouplist, ",")) != NULL && gids < ngroups_max; ) {
 		if (*p == '\0')
 			continue;
 
@@ -135,7 +139,7 @@ main(argc, argv)
 		}
 		gids++;
 	}
-	if (p != NULL && gids == NGROUPS_MAX)
+	if (p != NULL && gids == ngroups_max)
 		errx(1, "too many supplementary groups provided");
 
 	if (user != NULL) {

Modified: head/usr.sbin/jail/jail.c
==============================================================================
--- head/usr.sbin/jail/jail.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.sbin/jail/jail.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -104,7 +104,7 @@ extern char **environ;
 	lcap = login_getpwclass(pwd);					\
 	if (lcap == NULL)						\
 		err(1, "getpwclass: %s", username);			\
-	ngroups = NGROUPS;						\
+	ngroups = ngroups_max;						\
 	if (getgrouplist(username, pwd->pw_gid, groups, &ngroups) != 0)	\
 		err(1, "getgrouplist: %s", username);			\
 } while (0)
@@ -115,10 +115,11 @@ main(int argc, char **argv)
 	login_cap_t *lcap = NULL;
 	struct iovec rparams[2];
 	struct passwd *pwd = NULL;
-	gid_t groups[NGROUPS];
+	gid_t *groups;
 	size_t sysvallen;
 	int ch, cmdarg, i, jail_set_flags, jid, ngroups, sysval;
 	int hflag, iflag, Jflag, lflag, rflag, uflag, Uflag;
+	long ngroups_max;
 	unsigned pi;
 	char *ep, *jailname, *securelevel, *username, *JidFile;
 	char errmsg[ERRMSG_SIZE], enforce_statfs[4];
@@ -132,6 +133,10 @@ main(int argc, char **argv)
 	jailname = securelevel = username = JidFile = cleanenv = NULL;
 	fp = NULL;
 
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;	
+	if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+		err(1, "malloc");
+
 	while ((ch = getopt(argc, argv, "cdhilmn:r:s:u:U:J:")) != -1) {
 		switch (ch) {
 		case 'd':

Modified: head/usr.sbin/jexec/jexec.c
==============================================================================
--- head/usr.sbin/jexec/jexec.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.sbin/jexec/jexec.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -59,7 +59,7 @@ static void	usage(void);
 	lcap = login_getpwclass(pwd);					\
 	if (lcap == NULL)						\
 		err(1, "getpwclass: %s", username);			\
-	ngroups = NGROUPS;						\
+	ngroups = ngroups_max;						\
 	if (getgrouplist(username, pwd->pw_gid, groups, &ngroups) != 0)	\
 		err(1, "getgrouplist: %s", username);			\
 } while (0)
@@ -71,12 +71,17 @@ main(int argc, char *argv[])
 	int jid;
 	login_cap_t *lcap = NULL;
 	struct passwd *pwd = NULL;
-	gid_t groups[NGROUPS];
+	gid_t *groups = NULL;
 	int ch, ngroups, uflag, Uflag;
+	long ngroups_max;
 	char *ep, *username;
 	ch = uflag = Uflag = 0;
 	username = NULL;
 
+	ngroups_max = sysconf(_SC_NGROUPS_MAX) + 1;
+	if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+		err(1, "malloc");
+
 	while ((ch = getopt(argc, argv, "nu:U:")) != -1) {
 		switch (ch) {
 		case 'n':

Modified: head/usr.sbin/lpr/lpc/lpc.c
==============================================================================
--- head/usr.sbin/lpr/lpc/lpc.c	Fri Jun 19 15:52:35 2009	(r194493)
+++ head/usr.sbin/lpr/lpc/lpc.c	Fri Jun 19 15:58:24 2009	(r194494)
@@ -356,7 +356,8 @@ ingroup(const char *grname)
 {
 	static struct group *gptr=NULL;
 	static int ngroups = 0;
-	static gid_t groups[NGROUPS];
+	static long ngroups_max;
+	static gid_t *groups;
 	register gid_t gid;
 	register int i;
 
@@ -365,7 +366,10 @@ ingroup(const char *grname)
 			warnx("warning: unknown group '%s'", grname);
 			return(0);
 		}
-		ngroups = getgroups(NGROUPS, groups);
+		ngroups_max = sysconf(_SC_NGROUPS_MAX);
+		if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
+			err(1, "malloc");
+		ngroups = getgroups(ngroups_max, groups);
 		if (ngroups < 0)
 			err(1, "getgroups");
 	}

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 17:07:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9571D1065676;
	Fri, 19 Jun 2009 17:07:38 +0000 (UTC)
	(envelope-from brian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 81EC78FC17;
	Fri, 19 Jun 2009 17:07:38 +0000 (UTC)
	(envelope-from brian@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JH7cht049394;
	Fri, 19 Jun 2009 17:07:38 GMT (envelope-from brian@svn.freebsd.org)
Received: (from brian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JH7c2Q049387;
	Fri, 19 Jun 2009 17:07:38 GMT (envelope-from brian@svn.freebsd.org)
Message-Id: <200906191707.n5JH7c2Q049387@svn.freebsd.org>
From: Brian Somers 
Date: Fri, 19 Jun 2009 17:07: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: r194497 - in head/usr.sbin/pkg_install: add create info
	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: Fri, 19 Jun 2009 17:07:39 -0000

Author: brian
Date: Fri Jun 19 17:07:38 2009
New Revision: 194497
URL: http://svn.freebsd.org/changeset/base/194497

Log:
  When running pkg_add -r, check & install our dependencies for each
  package rather than expecting our top level package to get all of
  the dependencies correct.
  
  Previously, the code depended on the top level package having all
  of the pkgdep lines in +CONTENTS correct and in the right order,
  but that doesn't always happen due to code such as this (in
  security/gnutls/Makefile):
  
      .if (defined(WITH_LZO) || exists(${LOCALBASE}/lib/liblzo2.so)) && !defined(WITHOUT_LZO)
      LIB_DEPENDS+=           lzo2:${PORTSDIR}/archivers/lzo2
      ....
  
  With such conditional dependencies, my 'sophox-packages' package won't
  install.  The dependency tree looks like this:
  
      sophox-packages
        ...
        x11/gnome2
          x11/gnome-applets
            net/libgweather
              devel/libsoup
                security/gnutls
                  security/libgcrypt
                    security/libgpg-error
        ...
        x11/gnome2
          archivers/file-roller
            archivers/gtar
              archivers/lzop
                archivers/lzo2
        ...
  
  gnutls doesn't depend on lzo2 initially, but lzo2 is dragged into the
  mix via other dependencies and is built by the initial 'make'.  The
  subsequent package generation for gnutls adds a pkgdep line for lzo2
  to gnutls' +CONTENTS but the pkgdeps in sophox-packages' +CONTENTS
  has gnutls *before* lzo2.
  
  As a result, sophox-packages cannot install; gnutls fails because lzo2
  is missing, 82 more packages fail because gnutls is missing and the
  whole thing spirals into a super-confusing mess!
  
  MFC after:	3 weeks

Modified:
  head/usr.sbin/pkg_install/add/perform.c
  head/usr.sbin/pkg_install/create/perform.c
  head/usr.sbin/pkg_install/info/perform.c
  head/usr.sbin/pkg_install/lib/lib.h
  head/usr.sbin/pkg_install/lib/pen.c
  head/usr.sbin/pkg_install/lib/url.c

Modified: head/usr.sbin/pkg_install/add/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/add/perform.c	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/add/perform.c	Fri Jun 19 17:07:38 2009	(r194497)
@@ -52,9 +52,6 @@ pkg_perform(char **pkgs)
     return err_cnt;
 }
 
-static Package Plist;
-static char *Home;
-
 /*
  * This is seriously ugly code following.  Written very fast!
  * [And subsequently made even worse..  Sigh!  This code was just born
@@ -63,10 +60,12 @@ static char *Home;
 static int
 pkg_do(char *pkg)
 {
+    Package Plist;
     char pkg_fullname[FILENAME_MAX];
     char playpen[FILENAME_MAX];
     char extract_contents[FILENAME_MAX];
-    char *where_to, *extract;
+    char *extract;
+    const char *where_to;
     FILE *cfile;
     int code;
     PackingList p;
@@ -87,6 +86,8 @@ pkg_do(char *pkg)
     strcpy(playpen, FirstPen);
     inPlace = 0;
 
+    memset(&Plist, '\0', sizeof(Plist));
+
     /* Are we coming in for a second pass, everything already extracted? */
     if (!pkg) {
 	fgets(playpen, FILENAME_MAX, stdin);
@@ -102,11 +103,10 @@ pkg_do(char *pkg)
     else {
 	/* Is it an ftp://foo.bar.baz/file.t[bg]z specification? */
 	if (isURL(pkg)) {
-	    if (!(Home = fileGetURL(NULL, pkg, KeepPackage))) {
+	    if (!(where_to = fileGetURL(NULL, pkg, KeepPackage))) {
 		warnx("unable to fetch '%s' by URL", pkg);
 		return 1;
 	    }
-	    where_to = Home;
 	    strcpy(pkg_fullname, pkg);
 	    cfile = fopen(CONTENTS_FNAME, "r");
 	    if (!cfile) {
@@ -135,13 +135,11 @@ pkg_do(char *pkg)
 		extract = NULL;
 		sb.st_size = 100000;	/* Make up a plausible average size */
 	    }
-	    Home = make_playpen(playpen, sb.st_size * 4);
-	    if (!Home)
+	    if (!(where_to = make_playpen(playpen, sb.st_size * 4)))
 		errx(1, "unable to make playpen for %lld bytes", (long long)sb.st_size * 4);
-	    where_to = Home;
 	    /* Since we can call ourselves recursively, keep notes on where we came from */
 	    if (!getenv("_TOP"))
-		setenv("_TOP", Home, 1);
+		setenv("_TOP", where_to, 1);
 	    if (unpack(pkg_fullname, extract)) {
 		warnx(
 	"unable to extract table of contents file from '%s' - not a package?",
@@ -280,6 +278,42 @@ pkg_do(char *pkg)
 	    warnx("-f specified; proceeding anyway");
     }
 
+    /*
+     * Before attempting to do the slave mode bit, ensure that we've
+     * downloaded & processed everything we need.
+     * It's possible that we haven't already installed all of our
+     * dependencies if the dependency list was misgenerated due to
+     * other dynamic dependencies or if a dependency was added to a
+     * package without all REQUIRED_BY packages being regenerated.
+     */
+    for (p = pkg ? Plist.head : NULL; p; p = p->next) {
+	const char *ext;
+	char *deporigin;
+
+	if (p->type != PLIST_PKGDEP)
+	    continue;
+	deporigin = (p->next->type == PLIST_DEPORIGIN) ? p->next->name : NULL;
+
+	if (isinstalledpkg(p->name) <= 0 &&
+	    !(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)) {
+	    char subpkg[FILENAME_MAX], *sep;
+
+	    strlcpy(subpkg, pkg, sizeof subpkg);
+	    if ((sep = strrchr(subpkg, '/')) != NULL) {
+		*sep = '\0';
+		if ((sep = strrchr(subpkg, '/')) != NULL) {
+		    *sep = '\0';
+		    strlcat(subpkg, "/All/", sizeof subpkg);
+		    strlcat(subpkg, p->name, sizeof subpkg);
+		    if ((ext = strrchr(pkg, '.')) == NULL)
+			ext = ".tbz";
+		    strlcat(subpkg, ext, sizeof subpkg);
+		    pkg_do(subpkg);
+		}
+	    }
+	}
+    }
+
     /* Now check the packing list for dependencies */
     for (p = Plist.head; p ; p = p->next) {
 	char *deporigin;
@@ -295,7 +329,8 @@ pkg_do(char *pkg)
 	}
 	if (isinstalledpkg(p->name) <= 0 &&
 	    !(deporigin != NULL && matchbyorigin(deporigin, NULL) != NULL)) {
-	    char path[FILENAME_MAX], *cp = NULL;
+	    char path[FILENAME_MAX];
+	    const char *cp = NULL;
 
 	    if (!Fake) {
 		char prefixArg[2 + MAXPATHLEN]; /* "-P" + Prefix */
@@ -333,7 +368,7 @@ pkg_do(char *pkg)
 		}
 		else if ((cp = fileGetURL(pkg, p->name, KeepPackage)) != NULL) {
 		    if (Verbose)
-			printf("Finished loading %s over FTP.\n", p->name);
+			printf("Finished loading %s via a URL\n", p->name);
 		    if (!fexists("+CONTENTS")) {
 			warnx("autoloaded package %s has no +CONTENTS file?",
 				p->name);
@@ -645,7 +680,8 @@ cleanup(int sig)
 	    printf("Signal %d received, cleaning up..\n", sig);
     	if (!Fake && zapLogDir && LogDir[0])
 	    vsystem("%s -rf %s", REMOVE_CMD, LogDir);
-    	leave_playpen();
+    	while (leave_playpen())
+	    ;
     }
     if (sig)
 	exit(1);

Modified: head/usr.sbin/pkg_install/create/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/create/perform.c	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/create/perform.c	Fri Jun 19 17:07:38 2009	(r194497)
@@ -39,11 +39,10 @@ static void make_dist(const char *, cons
 static int create_from_installed_recursive(const char *, const char *);
 static int create_from_installed(const char *, const char *, const char *);
 
-static char *home;
-
 int
 pkg_perform(char **pkgs)
 {
+    static const char *home;
     char *pkg = *pkgs;		/* Only one arg to create */
     char *cp;
     FILE *pkg_in, *fp;

Modified: head/usr.sbin/pkg_install/info/perform.c
==============================================================================
--- head/usr.sbin/pkg_install/info/perform.c	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/info/perform.c	Fri Jun 19 17:07:38 2009	(r194497)
@@ -85,8 +85,6 @@ pkg_perform(char **pkgs)
     return err_cnt;
 }
 
-static char *Home;
-
 static int
 pkg_do(char *pkg)
 {
@@ -96,7 +94,7 @@ pkg_do(char *pkg)
     Package plist;
     FILE *fp;
     struct stat sb;
-    char *cp = NULL;
+    const char *cp = NULL;
     int code = 0;
 
     if (isURL(pkg)) {
@@ -138,7 +136,7 @@ pkg_do(char *pkg)
 	        code = 1;
 	        goto bail;
 	    }
-	    Home = make_playpen(PlayPen, sb.st_size / 2);
+	    make_playpen(PlayPen, sb.st_size / 2);
 	    if (unpack(fname, "'+*'")) {
 		warnx("error during unpacking, no info for '%s' available", pkg);
 		code = 1;

Modified: head/usr.sbin/pkg_install/lib/lib.h
==============================================================================
--- head/usr.sbin/pkg_install/lib/lib.h	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/lib/lib.h	Fri Jun 19 17:07:38 2009	(r194497)
@@ -159,9 +159,9 @@ STAILQ_HEAD(reqr_by_head, reqr_by_entry)
 int		vsystem(const char *, ...);
 char		*vpipe(const char *, ...);
 void		cleanup(int);
-char		*make_playpen(char *, off_t);
+const char	*make_playpen(char *, off_t);
 char		*where_playpen(void);
-void		leave_playpen(void);
+int		leave_playpen(void);
 off_t		min_free(const char *);
 
 /* String */
@@ -183,7 +183,7 @@ Boolean		isfile(const char *);
 Boolean		isempty(const char *);
 Boolean		issymlink(const char *);
 Boolean		isURL(const char *);
-char		*fileGetURL(const char *, const char *, int);
+const char	*fileGetURL(const char *, const char *, int);
 char		*fileFindByPath(const char *, const char *);
 char		*fileGetContents(const char *);
 void		write_file(const char *, const char *);

Modified: head/usr.sbin/pkg_install/lib/pen.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/pen.c	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/lib/pen.c	Fri Jun 19 17:07:38 2009	(r194497)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 
 /* For keeping track of where we are */
 static char PenLocation[FILENAME_MAX];
-static char Previous[FILENAME_MAX];
 
 char *
 where_playpen(void)
@@ -76,12 +75,14 @@ find_play_pen(char *pen, off_t sz)
 static char *pstack[MAX_STACK];
 static int pdepth = -1;
 
-static void
+static const char *
 pushPen(const char *pen)
 {
     if (++pdepth == MAX_STACK)
 	errx(2, "%s: stack overflow.\n", __func__);
     pstack[pdepth] = strdup(pen);
+
+    return pstack[pdepth];
 }
 
 static void
@@ -99,10 +100,11 @@ popPen(char *pen)
  * Make a temporary directory to play in and chdir() to it, returning
  * pathname of previous working directory.
  */
-char *
+const char *
 make_playpen(char *pen, off_t sz)
 {
     char humbuf1[6], humbuf2[6];
+    char cwd[FILENAME_MAX];
 
     if (!find_play_pen(pen, sz))
 	return NULL;
@@ -134,7 +136,7 @@ make_playpen(char *pen, off_t sz)
 	     "with more space and\ntry the command again", __func__, pen);
     }
 
-    if (!getcwd(Previous, FILENAME_MAX)) {
+    if (!getcwd(cwd, FILENAME_MAX)) {
 	upchuck("getcwd");
 	return NULL;
     }
@@ -144,34 +146,35 @@ make_playpen(char *pen, off_t sz)
 	errx(2, "%s: can't chdir to '%s'", __func__, pen);
     }
 
-    if (PenLocation[0])
-	pushPen(PenLocation);
-
     strcpy(PenLocation, pen);
-    return Previous;
+    return pushPen(cwd);
 }
 
 /* Convenience routine for getting out of playpen */
-void
+int
 leave_playpen()
 {
+    static char left[FILENAME_MAX];
     void (*oldsig)(int);
 
+    if (!PenLocation[0])
+	return 0;
+
     /* Don't interrupt while we're cleaning up */
     oldsig = signal(SIGINT, SIG_IGN);
-    if (Previous[0]) {
-	if (chdir(Previous) == FAIL) {
-	    cleanup(0);
-	    errx(2, "%s: can't chdir back to '%s'", __func__, Previous);
-	}
-	Previous[0] = '\0';
-    }
-    if (PenLocation[0]) {
-	if (PenLocation[0] == '/' && vsystem("/bin/rm -rf %s", PenLocation))
-	    warnx("couldn't remove temporary dir '%s'", PenLocation);
-	popPen(PenLocation);
+    strcpy(left, PenLocation);
+    popPen(PenLocation);
+
+    if (chdir(PenLocation) == FAIL) {
+	cleanup(0);
+	errx(2, "%s: can't chdir back to '%s'", __func__, PenLocation);
     }
+
+    if (left[0] == '/' && vsystem("/bin/rm -rf %s", left))
+	warnx("couldn't remove temporary dir '%s'", left);
     signal(SIGINT, oldsig);
+
+    return 1;
 }
 
 off_t

Modified: head/usr.sbin/pkg_install/lib/url.c
==============================================================================
--- head/usr.sbin/pkg_install/lib/url.c	Fri Jun 19 17:07:15 2009	(r194496)
+++ head/usr.sbin/pkg_install/lib/url.c	Fri Jun 19 17:07:38 2009	(r194497)
@@ -32,10 +32,11 @@ __FBSDID("$FreeBSD$");
  * Try and fetch a file by URL, returning the directory name for where
  * it's unpacked, if successful.
  */
-char *
+const char *
 fileGetURL(const char *base, const char *spec, int keep_package)
 {
-    char *cp, *rp, *tmp;
+    const char *rp;
+    char *cp, *tmp;
     char fname[FILENAME_MAX];
     char pen[FILENAME_MAX];
     char pkg[FILENAME_MAX];

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 17:10:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 85F7B106564A;
	Fri, 19 Jun 2009 17:10:36 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6FBE98FC08;
	Fri, 19 Jun 2009 17:10:36 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JHAawe049528;
	Fri, 19 Jun 2009 17:10:36 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JHAaql049507;
	Fri, 19 Jun 2009 17:10:36 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906191710.n5JHAaql049507@svn.freebsd.org>
From: Brooks Davis 
Date: Fri, 19 Jun 2009 17:10:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194498 - in head: . lib/libc/rpc lib/libkvm
	sys/compat/linux sys/fs/nfs sys/fs/nfsclient sys/fs/nfsserver
	sys/fs/portalfs sys/fs/unionfs sys/i386/ibcs2 sys/kern
	sys/netinet/ipfw sys/nf...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 17:10:37 -0000

Author: brooks
Date: Fri Jun 19 17:10:35 2009
New Revision: 194498
URL: http://svn.freebsd.org/changeset/base/194498

Log:
  Rework the credential code to support larger values of NGROUPS and
  NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
  and 1023 respectively.  (Previously they were equal, but under a close
  reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it
  is the number of supplemental groups, not total number of groups.)
  
  The bulk of the change consists of converting the struct ucred member
  cr_groups from a static array to a pointer.  Do the equivalent in
  kinfo_proc.
  
  Introduce new interfaces crcopysafe() and crsetgroups() for duplicating
  a process credential before modifying it and for setting group lists
  respectively.  Both interfaces take care for the details of allocating
  groups array. crsetgroups() takes care of truncating the group list
  to the current maximum (NGROUPS) if necessary.  In the future,
  crsetgroups() may be responsible for insuring invariants such as sorting
  the supplemental groups to allow groupmember() to be implemented as a
  binary search.
  
  Because we can not change struct xucred without breaking application
  ABIs, we leave it alone and introduce a new XU_NGROUPS value which is
  always 16 and is to be used or NGRPS as appropriate for things such as
  NFS which need to use no more than 16 groups.  When feasible, truncate
  the group list rather than generating an error.
  
  Minor changes:
    - Reduce the number of hand rolled versions of groupmember().
    - Do not assign to both cr_gid and cr_groups[0].
    - Modify ipfw to cache ucreds instead of part of their contents since
      they are immutable once referenced by more than one entity.
  
  Submitted by:	Isilon Systems (initial implementation)
  X-MFC after:	never
  PR:		bin/113398 kern/133867

Modified:
  head/UPDATING
  head/lib/libc/rpc/netname.c
  head/lib/libc/rpc/netnamer.c
  head/lib/libkvm/kvm_proc.c
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/linux/linux_uid16.c
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsserver/nfs_nfsdport.c
  head/sys/fs/nfsserver/nfs_nfsdstate.c
  head/sys/fs/portalfs/portal.h
  head/sys/fs/portalfs/portal_vnops.c
  head/sys/fs/unionfs/union_vnops.c
  head/sys/i386/ibcs2/ibcs2_misc.c
  head/sys/kern/kern_exec.c
  head/sys/kern/kern_proc.c
  head/sys/kern/kern_prot.c
  head/sys/kern/vfs_export.c
  head/sys/netinet/ipfw/ip_fw2.c
  head/sys/nfsserver/nfs_srvsock.c
  head/sys/nfsserver/nfs_srvsubs.c
  head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
  head/sys/rpc/svc_auth.c
  head/sys/rpc/svc_auth_unix.c
  head/sys/sys/param.h
  head/sys/sys/syslimits.h
  head/sys/sys/ucred.h
  head/sys/sys/user.h
  head/sys/ufs/ufs/ufs_vnops.c
  head/usr.sbin/mount_portalfs/portald.h
  head/usr.sbin/mountd/mountd.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/UPDATING	Fri Jun 19 17:10:35 2009	(r194498)
@@ -22,6 +22,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
 	to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20090619:
+	NGROUPS_MAX and NGROUPS have been increased from 16 to 1023
+	and 1024 respectively.  As long as no more than 16 groups per
+	process are used, no changes should be visible.  When more
+	than 16 groups are used, old binaries may fail if they call
+	getgroups() or getgrouplist() with statically sized storage.
+	Recompiling will work around this, but applications should be
+	modified to use dynamically allocated storage for group arrays
+	as POSIX.1-2008 does not cap an implementation's number of
+	supported groups at NGROUPS_MAX+1 as previous versions did.
+
+	NFS and portalfs mounts may also be affected as the list of
+	groups is truncated to 16.  Users of NFS who use more than 16
+	groups, should take care that negative group permissions are not
+	used on the exported file systems as they will not be reliable
+	unless a GSSAPI based authentication method is used.
+
 20090616:
 	The compiling option ADAPTIVE_LOCKMGRS has been introduced.
 	This option compiles in the support for adaptive spinning for lockmgrs

Modified: head/lib/libc/rpc/netname.c
==============================================================================
--- head/lib/libc/rpc/netname.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/lib/libc/rpc/netname.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -61,9 +61,6 @@ __FBSDID("$FreeBSD$");
 #ifndef MAXHOSTNAMELEN
 #define MAXHOSTNAMELEN 256
 #endif
-#ifndef NGROUPS
-#define NGROUPS 16
-#endif
 
 #define TYPE_BIT(type)  (sizeof (type) * CHAR_BIT)
 

Modified: head/lib/libc/rpc/netnamer.c
==============================================================================
--- head/lib/libc/rpc/netnamer.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/lib/libc/rpc/netnamer.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -66,10 +66,6 @@ static char    *NETIDFILE = "/etc/netid"
 static int getnetid( char *, char * );
 static int _getgroups( char *, gid_t * );
 
-#ifndef NGROUPS
-#define NGROUPS 16
-#endif
-
 /*
  * Convert network-name into unix credential
  */
@@ -104,7 +100,7 @@ netname2user(netname, uidp, gidp, gidlen
 			return (0);
 		}
 		*gidp = (gid_t) atol(p);
-		for (gidlen = 0; gidlen < NGROUPS; gidlen++) {
+		for (gidlen = 0; gidlen < NGRPS; gidlen++) {
 			p = strsep(&res, "\n,");
 			if (p == NULL)
 				break;
@@ -157,7 +153,7 @@ netname2user(netname, uidp, gidp, gidlen
 static int
 _getgroups(uname, groups)
 	char           *uname;
-	gid_t          groups[NGROUPS];
+	gid_t          groups[NGRPS];
 {
 	gid_t           ngroups = 0;
 	struct group *grp;
@@ -169,7 +165,7 @@ _getgroups(uname, groups)
 	while ((grp = getgrent())) {
 		for (i = 0; grp->gr_mem[i]; i++)
 			if (!strcmp(grp->gr_mem[i], uname)) {
-				if (ngroups == NGROUPS) {
+				if (ngroups == NGRPS) {
 #ifdef DEBUG
 					fprintf(stderr,
 				"initgroups: %s is in too many groups\n", uname);

Modified: head/lib/libkvm/kvm_proc.c
==============================================================================
--- head/lib/libkvm/kvm_proc.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/lib/libkvm/kvm_proc.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -146,8 +146,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn
 			kp->ki_rgid = ucred.cr_rgid;
 			kp->ki_svgid = ucred.cr_svgid;
 			kp->ki_ngroups = ucred.cr_ngroups;
-			bcopy(ucred.cr_groups, kp->ki_groups,
-			    NGROUPS * sizeof(gid_t));
+			kp->ki_groups = ucred.cr_groups;
 			kp->ki_uid = ucred.cr_uid;
 			if (ucred.cr_prison != NULL) {
 				if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) {

Modified: head/sys/compat/linux/linux_misc.c
==============================================================================
--- head/sys/compat/linux/linux_misc.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/compat/linux/linux_misc.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -1132,7 +1132,7 @@ int
 linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
 {
 	struct ucred *newcred, *oldcred;
-	l_gid_t linux_gidset[NGROUPS];
+	l_gid_t *linux_gidset;
 	gid_t *bsd_gidset;
 	int ngrp, error;
 	struct proc *p;
@@ -1140,13 +1140,14 @@ linux_setgroups(struct thread *td, struc
 	ngrp = args->gidsetsize;
 	if (ngrp < 0 || ngrp >= NGROUPS)
 		return (EINVAL);
+	linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
 	error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t));
 	if (error)
-		return (error);
+		goto out;
 	newcred = crget();
 	p = td->td_proc;
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 	/*
 	 * cr_groups[0] holds egid. Setting the whole set from
@@ -1157,10 +1158,9 @@ linux_setgroups(struct thread *td, struc
 	if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS, 0)) != 0) {
 		PROC_UNLOCK(p);
 		crfree(newcred);
-		return (error);
+		goto out;
 	}
 
-	crcopy(newcred, oldcred);
 	if (ngrp > 0) {
 		newcred->cr_ngroups = ngrp + 1;
 
@@ -1177,14 +1177,17 @@ linux_setgroups(struct thread *td, struc
 	p->p_ucred = newcred;
 	PROC_UNLOCK(p);
 	crfree(oldcred);
-	return (0);
+	error = 0;
+out:
+	free(linux_gidset, M_TEMP);
+	return (error);
 }
 
 int
 linux_getgroups(struct thread *td, struct linux_getgroups_args *args)
 {
 	struct ucred *cred;
-	l_gid_t linux_gidset[NGROUPS];
+	l_gid_t *linux_gidset;
 	gid_t *bsd_gidset;
 	int bsd_gidsetsz, ngrp, error;
 
@@ -1207,13 +1210,16 @@ linux_getgroups(struct thread *td, struc
 		return (EINVAL);
 
 	ngrp = 0;
+	linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
+	    M_TEMP, M_WAITOK);
 	while (ngrp < bsd_gidsetsz) {
 		linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
 		ngrp++;
 	}
 
-	if ((error = copyout(linux_gidset, args->grouplist,
-	    ngrp * sizeof(l_gid_t))))
+	error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t));
+	free(linux_gidset, M_TEMP);
+	if (error)
 		return (error);
 
 	td->td_retval[0] = ngrp;

Modified: head/sys/compat/linux/linux_uid16.c
==============================================================================
--- head/sys/compat/linux/linux_uid16.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/compat/linux/linux_uid16.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -98,7 +98,7 @@ int
 linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
 {
 	struct ucred *newcred, *oldcred;
-	l_gid16_t linux_gidset[NGROUPS];
+	l_gid16_t *linux_gidset;
 	gid_t *bsd_gidset;
 	int ngrp, error;
 	struct proc *p;
@@ -111,13 +111,14 @@ linux_setgroups16(struct thread *td, str
 	ngrp = args->gidsetsize;
 	if (ngrp < 0 || ngrp >= NGROUPS)
 		return (EINVAL);
+	linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
 	error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
 	if (error)
 		return (error);
 	newcred = crget();
 	p = td->td_proc;
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 	/*
 	 * cr_groups[0] holds egid. Setting the whole set from
@@ -128,10 +129,9 @@ linux_setgroups16(struct thread *td, str
 	if ((error = priv_check_cred(oldcred, PRIV_CRED_SETGROUPS, 0)) != 0) {
 		PROC_UNLOCK(p);
 		crfree(newcred);
-		return (error);
+		goto out;
 	}
 
-	crcopy(newcred, oldcred);
 	if (ngrp > 0) {
 		newcred->cr_ngroups = ngrp + 1;
 
@@ -149,14 +149,17 @@ linux_setgroups16(struct thread *td, str
 	p->p_ucred = newcred;
 	PROC_UNLOCK(p);
 	crfree(oldcred);
-	return (0);
+	error = 0;
+out:
+	free(linux_gidset, M_TEMP);
+	return (error);
 }
 
 int
 linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args)
 {
 	struct ucred *cred;
-	l_gid16_t linux_gidset[NGROUPS];
+	l_gid16_t *linux_gidset;
 	gid_t *bsd_gidset;
 	int bsd_gidsetsz, ngrp, error;
 
@@ -184,12 +187,15 @@ linux_getgroups16(struct thread *td, str
 		return (EINVAL);
 
 	ngrp = 0;
+	linux_gidset = malloc(bsd_gidsetsz * sizeof(*linux_gidset),
+	    M_TEMP, M_WAITOK);
 	while (ngrp < bsd_gidsetsz) {
 		linux_gidset[ngrp] = bsd_gidset[ngrp + 1];
 		ngrp++;
 	}
 
 	error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t));
+	free(linux_gidset, M_TEMP);
 	if (error)
 		return (error);
 

Modified: head/sys/fs/nfs/nfs_commonport.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonport.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/nfs/nfs_commonport.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -220,14 +220,9 @@ nfsrv_lookupfilename(struct nameidata *n
 void
 newnfs_copycred(struct nfscred *nfscr, struct ucred *cr)
 {
-	int ngroups, i;
 
 	cr->cr_uid = nfscr->nfsc_uid;
-	ngroups = (nfscr->nfsc_ngroups < NGROUPS) ?
-	    nfscr->nfsc_ngroups : NGROUPS;
-	for (i = 0; i < ngroups; i++)
-		cr->cr_groups[i] = nfscr->nfsc_groups[i];
-	cr->cr_ngroups = ngroups;
+	crsetgroups(cr, nfscr->nfsc_ngroups, nfscr->nfsc_groups);
 }
 
 /*

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/nfsclient/nfs_clport.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -976,14 +976,12 @@ nfscl_getmyip(struct nfsmount *nmp, int 
 void
 newnfs_copyincred(struct ucred *cr, struct nfscred *nfscr)
 {
-	int ngroups, i;
+	int i;
 
 	nfscr->nfsc_uid = cr->cr_uid;
-	ngroups = (cr->cr_ngroups > NGROUPS) ? NGROUPS :
-	    cr->cr_ngroups;
-	for (i = 0; i < ngroups; i++)
+	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
+	for (i = 0; i < nfscr->nfsc_ngroups; i++)
 		nfscr->nfsc_groups[i] = cr->cr_groups[i];
-	nfscr->nfsc_ngroups = ngroups;
 }
 
 

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -2360,7 +2360,6 @@ int
 nfsd_excred(struct nfsrv_descript *nd, struct nfsexstuff *exp,
     struct ucred *credanon)
 {
-	int i;
 	int error = 0;
 
 	/*
@@ -2403,9 +2402,8 @@ nfsd_excred(struct nfsrv_descript *nd, s
 	     (nd->nd_flag & ND_AUTHNONE))) {
 		nd->nd_cred->cr_uid = credanon->cr_uid;
 		nd->nd_cred->cr_gid = credanon->cr_gid;
-		for (i = 0; i < credanon->cr_ngroups && i < NGROUPS; i++)
-			nd->nd_cred->cr_groups[i] = credanon->cr_groups[i];
-		nd->nd_cred->cr_ngroups = i;
+		crsetgroups(nd->nd_cred, credanon->cr_ngroups,
+		    credanon->cr_groups);
 	}
 	return (0);
 }

Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdstate.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/nfsserver/nfs_nfsdstate.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -3577,7 +3577,6 @@ nfsrv_docallback(struct nfsclient *clp, 
 	nd->nd_repstat = 0;
 	cred->cr_uid = clp->lc_uid;
 	cred->cr_gid = clp->lc_gid;
-	cred->cr_groups[0] = clp->lc_gid;
 	callback = clp->lc_callback;
 	NFSUNLOCKSTATE();
 	cred->cr_ngroups = 1;

Modified: head/sys/fs/portalfs/portal.h
==============================================================================
--- head/sys/fs/portalfs/portal.h	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/portalfs/portal.h	Fri Jun 19 17:10:35 2009	(r194498)
@@ -43,7 +43,7 @@ struct portal_cred {
 	int		pcr_flag;		/* File open mode */
 	uid_t		pcr_uid;		/* From ucred */
 	short		pcr_ngroups;		/* From ucred */
-	gid_t		pcr_groups[NGROUPS];	/* From ucred */
+	gid_t		pcr_groups[XU_NGROUPS];	/* From ucred */
 };
 
 #ifdef _KERNEL

Modified: head/sys/fs/portalfs/portal_vnops.c
==============================================================================
--- head/sys/fs/portalfs/portal_vnops.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/portalfs/portal_vnops.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -311,8 +311,9 @@ portal_open(ap)
 
 	pcred.pcr_flag = ap->a_mode;
 	pcred.pcr_uid = ap->a_cred->cr_uid;
-	pcred.pcr_ngroups = ap->a_cred->cr_ngroups;
-	bcopy(ap->a_cred->cr_groups, pcred.pcr_groups, NGROUPS * sizeof(gid_t));
+	pcred.pcr_ngroups = MIN(ap->a_cred->cr_ngroups, XU_NGROUPS);
+	bcopy(ap->a_cred->cr_groups, pcred.pcr_groups,
+	    pcred.pcr_ngroups * sizeof(gid_t));
 	aiov[0].iov_base = (caddr_t) &pcred;
 	aiov[0].iov_len = sizeof(pcred);
 	aiov[1].iov_base = pt->pt_arg;

Modified: head/sys/fs/unionfs/union_vnops.c
==============================================================================
--- head/sys/fs/unionfs/union_vnops.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/fs/unionfs/union_vnops.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -638,7 +638,6 @@ unionfs_check_corrected_access(accmode_t
 	uid_t		uid;	/* upper side vnode's uid */
 	gid_t		gid;	/* upper side vnode's gid */
 	u_short		vmode;	/* upper side vnode's mode */
-	gid_t          *gp;
 	u_short		mask;
 
 	mask = 0;
@@ -659,17 +658,14 @@ unionfs_check_corrected_access(accmode_t
 
 	/* check group */
 	count = 0;
-	gp = cred->cr_groups;
-	for (; count < cred->cr_ngroups; count++, gp++) {
-		if (gid == *gp) {
-			if (accmode & VEXEC)
-				mask |= S_IXGRP;
-			if (accmode & VREAD)
-				mask |= S_IRGRP;
-			if (accmode & VWRITE)
-				mask |= S_IWGRP;
-			return ((vmode & mask) == mask ? 0 : EACCES);
-		}
+	if (groupmember(gid, cred)) {
+		if (accmode & VEXEC)
+			mask |= S_IXGRP;
+		if (accmode & VREAD)
+			mask |= S_IRGRP;
+		if (accmode & VWRITE)
+			mask |= S_IWGRP;
+		return ((vmode & mask) == mask ? 0 : EACCES);
 	}
 
 	/* check other */

Modified: head/sys/i386/ibcs2/ibcs2_misc.c
==============================================================================
--- head/sys/i386/ibcs2/ibcs2_misc.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/i386/ibcs2/ibcs2_misc.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -657,24 +657,29 @@ ibcs2_getgroups(td, uap)
 	struct thread *td;
 	struct ibcs2_getgroups_args *uap;
 {
-	ibcs2_gid_t iset[NGROUPS_MAX];
-	gid_t gp[NGROUPS_MAX];
+	ibcs2_gid_t *iset;
+	gid_t *gp;
 	u_int i, ngrp;
 	int error;
 
 	if (uap->gidsetsize < 0)
 		return (EINVAL);
 	ngrp = MIN(uap->gidsetsize, NGROUPS_MAX);
+	gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK);
 	error = kern_getgroups(td, &ngrp, gp);
 	if (error)
-		return (error);
+		goto out;
 	if (uap->gidsetsize > 0) {
+		iset = malloc(ngrp * sizeof(*iset), M_TEMP, M_WAITOK);
 		for (i = 0; i < ngrp; i++)
 			iset[i] = (ibcs2_gid_t)gp[i];
 		error = copyout(iset, uap->gidset, ngrp * sizeof(ibcs2_gid_t));
+		free(iset, M_TEMP);
 	}
 	if (error == 0)
 		td->td_retval[0] = ngrp;
+out:
+	free(gp, M_TEMP);
 	return (error);
 }
 
@@ -683,21 +688,31 @@ ibcs2_setgroups(td, uap)
 	struct thread *td;
 	struct ibcs2_setgroups_args *uap;
 {
-	ibcs2_gid_t iset[NGROUPS_MAX];
-	gid_t gp[NGROUPS_MAX];
+	ibcs2_gid_t *iset;
+	gid_t *gp;
 	int error, i;
 
 	if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS_MAX)
 		return (EINVAL);
-	if (uap->gidsetsize && uap->gidset) {
+	if (uap->gidsetsize && uap->gidset == NULL)
+		return (EINVAL);
+	gp = malloc(uap->gidsetsize * sizeof(*gp), M_TEMP, M_WAITOK);
+	if (uap->gidsetsize) {
+		iset = malloc(uap->gidsetsize * sizeof(*iset), M_TEMP, M_WAITOK);
 		error = copyin(uap->gidset, iset, sizeof(ibcs2_gid_t) *
 		    uap->gidsetsize);
-		if (error)
-			return (error);
+		if (error) {
+			free(iset, M_TEMP);
+			goto out;
+		}
 		for (i = 0; i < uap->gidsetsize; i++)
 			gp[i] = (gid_t)iset[i];
 	}
-	return (kern_setgroups(td, uap->gidsetsize, gp));
+
+	error = kern_setgroups(td, uap->gidsetsize, gp);
+out:
+	free(gp, M_TEMP);
+	return (error);
 }
 
 int

Modified: head/sys/kern/kern_exec.c
==============================================================================
--- head/sys/kern/kern_exec.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/kern/kern_exec.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -579,6 +579,7 @@ interpret:
 	 * reset.
 	 */
 	PROC_LOCK(p);
+	oldcred = crcopysafe(p, newcred);
 	if (sigacts_shared(p->p_sigacts)) {
 		oldsigacts = p->p_sigacts;
 		PROC_UNLOCK(p);
@@ -629,7 +630,6 @@ interpret:
 	 * XXXMAC: For the time being, use NOSUID to also prohibit
 	 * transitions on the file system.
 	 */
-	oldcred = p->p_ucred;
 	credential_changing = 0;
 	credential_changing |= (attr.va_mode & S_ISUID) && oldcred->cr_uid !=
 	    attr.va_uid;
@@ -683,7 +683,6 @@ interpret:
 		/*
 		 * Set the new credentials.
 		 */
-		crcopy(newcred, oldcred);
 		if (attr.va_mode & S_ISUID)
 			change_euid(newcred, euip);
 		if (attr.va_mode & S_ISGID)
@@ -723,7 +722,6 @@ interpret:
 		 */
 		if (oldcred->cr_svuid != oldcred->cr_uid ||
 		    oldcred->cr_svgid != oldcred->cr_gid) {
-			crcopy(newcred, oldcred);
 			change_svuid(newcred, newcred->cr_uid);
 			change_svgid(newcred, newcred->cr_gid);
 			p->p_ucred = newcred;

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/kern/kern_proc.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -730,10 +730,8 @@ fill_kinfo_proc_only(struct proc *p, str
 		kp->ki_uid = cred->cr_uid;
 		kp->ki_ruid = cred->cr_ruid;
 		kp->ki_svuid = cred->cr_svuid;
-		/* XXX bde doesn't like KI_NGROUPS */
-		kp->ki_ngroups = min(cred->cr_ngroups, KI_NGROUPS);
-		bcopy(cred->cr_groups, kp->ki_groups,
-		    kp->ki_ngroups * sizeof(gid_t));
+		kp->ki_ngroups = cred->cr_ngroups;
+		kp->ki_groups = cred->cr_groups;
 		kp->ki_rgid = cred->cr_rgid;
 		kp->ki_svgid = cred->cr_svgid;
 		kp->ki_cr_flags = cred->cr_flags;

Modified: head/sys/kern/kern_prot.c
==============================================================================
--- head/sys/kern/kern_prot.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/kern/kern_prot.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -82,6 +82,11 @@ static MALLOC_DEFINE(M_CRED, "cred", "cr
 
 SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW, 0, "BSD security policy");
 
+static void crextend(struct ucred *cr, int n);
+static void crsetgroups_locked(struct ucred *cr, int ngrp,
+    gid_t *groups);
+
+
 #ifndef _SYS_SYSPROTO_H_
 struct getpid_args {
 	int	dummy;
@@ -276,18 +281,21 @@ struct getgroups_args {
 int
 getgroups(struct thread *td, register struct getgroups_args *uap)
 {
-	gid_t groups[NGROUPS];
+	gid_t *groups;
 	u_int ngrp;
 	int error;
 
 	ngrp = MIN(uap->gidsetsize, NGROUPS);
+	groups = malloc(ngrp * sizeof(*groups), M_TEMP, M_WAITOK);
 	error = kern_getgroups(td, &ngrp, groups);
 	if (error)
-		return (error);
+		goto out;
 	if (uap->gidsetsize > 0)
 		error = copyout(groups, uap->gidset, ngrp * sizeof(gid_t));
 	if (error == 0)
 		td->td_retval[0] = ngrp;
+out:
+	free(groups, M_TEMP);
 	return (error);
 }
 
@@ -486,7 +494,10 @@ setuid(struct thread *td, struct setuid_
 	newcred = crget();
 	uip = uifind(uid);
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	/*
+	 * Copy credentials so other references do not see our changes.
+	 */
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setuid(oldcred, uid);
@@ -521,10 +532,6 @@ setuid(struct thread *td, struct setuid_
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETUID, 0)) != 0)
 		goto fail;
 
-	/*
-	 * Copy credentials so other references do not see our changes.
-	 */
-	crcopy(newcred, oldcred);
 #ifdef _POSIX_SAVED_IDS
 	/*
 	 * Do we have "appropriate privileges" (are we root or uid == euid)
@@ -598,7 +605,10 @@ seteuid(struct thread *td, struct seteui
 	newcred = crget();
 	euip = uifind(euid);
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	/*
+	 * Copy credentials so other references do not see our changes.
+	 */
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_seteuid(oldcred, euid);
@@ -612,8 +622,7 @@ seteuid(struct thread *td, struct seteui
 		goto fail;
 
 	/*
-	 * Everything's okay, do it.  Copy credentials so other references do
-	 * not see our changes.
+	 * Everything's okay, do it.
 	 */
 	crcopy(newcred, oldcred);
 	if (oldcred->cr_uid != euid) {
@@ -651,7 +660,7 @@ setgid(struct thread *td, struct setgid_
 	AUDIT_ARG(gid, gid);
 	newcred = crget();
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setgid(oldcred, gid);
@@ -680,7 +689,6 @@ setgid(struct thread *td, struct setgid_
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETGID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 #ifdef _POSIX_SAVED_IDS
 	/*
 	 * Do we have "appropriate privileges" (are we root or gid == egid)
@@ -750,7 +758,7 @@ setegid(struct thread *td, struct setegi
 	AUDIT_ARG(egid, egid);
 	newcred = crget();
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setegid(oldcred, egid);
@@ -763,7 +771,6 @@ setegid(struct thread *td, struct setegi
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETEGID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 	if (oldcred->cr_groups[0] != egid) {
 		change_egid(newcred, egid);
 		setsugid(p);
@@ -789,15 +796,19 @@ struct setgroups_args {
 int
 setgroups(struct thread *td, struct setgroups_args *uap)
 {
-	gid_t groups[NGROUPS];
+	gid_t *groups = NULL;
 	int error;
 
 	if (uap->gidsetsize > NGROUPS)
 		return (EINVAL);
+	groups = malloc(uap->gidsetsize * sizeof(gid_t), M_TEMP, M_WAITOK);
 	error = copyin(uap->gidset, groups, uap->gidsetsize * sizeof(gid_t));
 	if (error)
-		return (error);
-	return (kern_setgroups(td, uap->gidsetsize, groups));
+		goto out;
+	error = kern_setgroups(td, uap->gidsetsize, groups);
+out:
+	free(groups, M_TEMP);
+	return (error);
 }
 
 int
@@ -811,8 +822,9 @@ kern_setgroups(struct thread *td, u_int 
 		return (EINVAL);
 	AUDIT_ARG(groupset, groups, ngrp);
 	newcred = crget();
+	crextend(newcred, ngrp);
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setgroups(oldcred, ngrp, groups);
@@ -824,11 +836,6 @@ kern_setgroups(struct thread *td, u_int 
 	if (error)
 		goto fail;
 
-	/*
-	 * XXX A little bit lazy here.  We could test if anything has
-	 * changed before crcopy() and setting P_SUGID.
-	 */
-	crcopy(newcred, oldcred);
 	if (ngrp < 1) {
 		/*
 		 * setgroups(0, NULL) is a legitimate way of clearing the
@@ -838,8 +845,7 @@ kern_setgroups(struct thread *td, u_int 
 		 */
 		newcred->cr_ngroups = 1;
 	} else {
-		bcopy(groups, newcred->cr_groups, ngrp * sizeof(gid_t));
-		newcred->cr_ngroups = ngrp;
+		crsetgroups_locked(newcred, ngrp, groups);
 	}
 	setsugid(p);
 	p->p_ucred = newcred;
@@ -877,7 +883,7 @@ setreuid(register struct thread *td, str
 	euip = uifind(euid);
 	ruip = uifind(ruid);
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setreuid(oldcred, ruid, euid);
@@ -892,7 +898,6 @@ setreuid(register struct thread *td, str
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETREUID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 	if (euid != (uid_t)-1 && oldcred->cr_uid != euid) {
 		change_euid(newcred, euip);
 		setsugid(p);
@@ -942,7 +947,7 @@ setregid(register struct thread *td, str
 	AUDIT_ARG(rgid, rgid);
 	newcred = crget();
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setregid(oldcred, rgid, egid);
@@ -957,7 +962,6 @@ setregid(register struct thread *td, str
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETREGID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 	if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) {
 		change_egid(newcred, egid);
 		setsugid(p);
@@ -1013,7 +1017,7 @@ setresuid(register struct thread *td, st
 	euip = uifind(euid);
 	ruip = uifind(ruid);
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setresuid(oldcred, ruid, euid, suid);
@@ -1033,7 +1037,6 @@ setresuid(register struct thread *td, st
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETRESUID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 	if (euid != (uid_t)-1 && oldcred->cr_uid != euid) {
 		change_euid(newcred, euip);
 		setsugid(p);
@@ -1090,7 +1093,7 @@ setresgid(register struct thread *td, st
 	AUDIT_ARG(sgid, sgid);
 	newcred = crget();
 	PROC_LOCK(p);
-	oldcred = p->p_ucred;
+	oldcred = crcopysafe(p, newcred);
 
 #ifdef MAC
 	error = mac_cred_check_setresgid(oldcred, rgid, egid, sgid);
@@ -1110,7 +1113,6 @@ setresgid(register struct thread *td, st
 	    (error = priv_check_cred(oldcred, PRIV_CRED_SETRESGID, 0)) != 0)
 		goto fail;
 
-	crcopy(newcred, oldcred);
 	if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) {
 		change_egid(newcred, egid);
 		setsugid(p);
@@ -1780,6 +1782,7 @@ crget(void)
 #ifdef MAC
 	mac_cred_init(cr);
 #endif
+	crextend(cr, XU_NGROUPS);
 	return (cr);
 }
 
@@ -1829,6 +1832,7 @@ crfree(struct ucred *cr)
 #ifdef MAC
 		mac_cred_destroy(cr);
 #endif
+		free(cr->cr_groups, M_CRED);
 		free(cr, M_CRED);
 	}
 }
@@ -1854,6 +1858,7 @@ crcopy(struct ucred *dest, struct ucred 
 	bcopy(&src->cr_startcopy, &dest->cr_startcopy,
 	    (unsigned)((caddr_t)&src->cr_endcopy -
 		(caddr_t)&src->cr_startcopy));
+	crsetgroups(dest, src->cr_ngroups, src->cr_groups);
 	uihold(dest->cr_uidinfo);
 	uihold(dest->cr_ruidinfo);
 	prison_hold(dest->cr_prison);
@@ -1888,12 +1893,16 @@ crdup(struct ucred *cr)
 void
 cru2x(struct ucred *cr, struct xucred *xcr)
 {
+	int ngroups;
 
 	bzero(xcr, sizeof(*xcr));
 	xcr->cr_version = XUCRED_VERSION;
 	xcr->cr_uid = cr->cr_uid;
-	xcr->cr_ngroups = cr->cr_ngroups;
-	bcopy(cr->cr_groups, xcr->cr_groups, sizeof(cr->cr_groups));
+
+	ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
+	xcr->cr_ngroups = ngroups;
+	bcopy(cr->cr_groups, xcr->cr_groups,
+	    ngroups * sizeof(*cr->cr_groups));
 }
 
 /*
@@ -1915,6 +1924,97 @@ cred_update_thread(struct thread *td)
 		crfree(cred);
 }
 
+struct ucred *
+crcopysafe(struct proc *p, struct ucred *cr)
+{
+	struct ucred *oldcred;
+	int groups;
+
+	PROC_LOCK_ASSERT(p, MA_OWNED);
+
+	oldcred = p->p_ucred;
+	while (cr->cr_agroups < oldcred->cr_agroups) {
+		groups = oldcred->cr_agroups;
+		PROC_UNLOCK(p);
+		crextend(cr, groups);
+		PROC_LOCK(p);
+		oldcred = p->p_ucred;
+	}
+	crcopy(cr, oldcred);
+
+	return (oldcred);
+}
+
+/*
+ * Extend the passed in credential to hold n items.
+ */
+static void
+crextend(struct ucred *cr, int n)
+{
+	int cnt;
+
+	/* Truncate? */
+	if (n <= cr->cr_agroups)
+		return;
+
+	/*
+	 * We extend by 2 each time since we're using a power of two
+	 * allocator until we need enough groups to fill a page.
+	 * Once we're allocating multiple pages, only allocate as many
+	 * as we actually need.  The case of processes needing a
+	 * non-power of two number of pages seems more likely than
+	 * a real world process that adds thousands of groups one at a
+	 * time.
+	 */
+	if ( n < PAGE_SIZE / sizeof(gid_t) ) {
+		if (cr->cr_agroups == 0)
+			cnt = MINALLOCSIZE / sizeof(gid_t);
+		else
+			cnt = cr->cr_agroups * 2;
+
+		while (cnt < n)
+			cnt *= 2;
+	} else
+		cnt = roundup2(n, PAGE_SIZE / sizeof(gid_t));
+
+	/* Free the old array. */
+	if (cr->cr_groups)
+		free(cr->cr_groups, M_CRED);
+
+	cr->cr_groups = malloc(cnt * sizeof(gid_t), M_CRED, M_WAITOK | M_ZERO);
+	cr->cr_agroups = cnt;
+}
+
+/*
+ * Copy groups in to a credential, preserving any necessicary invariants
+ * (i.e. sorting in the future).  crextend() must have been called
+ * before hand to ensure sufficient space is available.  If 
+ */
+static void
+crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups)
+{
+	
+	KASSERT(cr->cr_agroups >= ngrp, ("cr_ngroups is too small"));
+
+	bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t));
+	cr->cr_ngroups = ngrp;
+}
+
+/*
+ * Copy groups in to a credential after expanding it if required.
+ * Truncate the list to NGROUPS if it is too large.
+ */
+void
+crsetgroups(struct ucred *cr, int ngrp, gid_t *groups)
+{
+
+	if (ngrp > NGROUPS)
+		ngrp = NGROUPS;
+
+	crextend(cr, ngrp);
+	crsetgroups_locked(cr, ngrp, groups);
+}
+
 /*
  * Get login name, if available.
  */

Modified: head/sys/kern/vfs_export.c
==============================================================================
--- head/sys/kern/vfs_export.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/kern/vfs_export.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -120,9 +120,8 @@ vfs_hang_addrlist(struct mount *mp, stru
 		np->netc_exflags = argp->ex_flags;
 		np->netc_anon = crget();
 		np->netc_anon->cr_uid = argp->ex_anon.cr_uid;
-		np->netc_anon->cr_ngroups = argp->ex_anon.cr_ngroups;
-		bcopy(argp->ex_anon.cr_groups, np->netc_anon->cr_groups,
-		    sizeof(np->netc_anon->cr_groups));
+		crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups,
+		    argp->ex_anon.cr_groups);
 		np->netc_numsecflavors = argp->ex_numsecflavors;
 		bcopy(argp->ex_secflavors, np->netc_secflavors,
 		    sizeof(np->netc_secflavors));
@@ -205,9 +204,8 @@ vfs_hang_addrlist(struct mount *mp, stru
 	np->netc_exflags = argp->ex_flags;
 	np->netc_anon = crget();
 	np->netc_anon->cr_uid = argp->ex_anon.cr_uid;
-	np->netc_anon->cr_ngroups = argp->ex_anon.cr_ngroups;
-	bcopy(argp->ex_anon.cr_groups, np->netc_anon->cr_groups,
-	    sizeof(np->netc_anon->cr_groups));
+	crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups,
+	    np->netc_anon->cr_groups);
 	np->netc_numsecflavors = argp->ex_numsecflavors;
 	bcopy(argp->ex_secflavors, np->netc_secflavors,
 	    sizeof(np->netc_secflavors));

Modified: head/sys/netinet/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netinet/ipfw/ip_fw2.c	Fri Jun 19 17:07:38 2009	(r194497)
+++ head/sys/netinet/ipfw/ip_fw2.c	Fri Jun 19 17:10:35 2009	(r194498)
@@ -135,19 +135,6 @@ static uma_zone_t ipfw_dyn_rule_zone;
 struct ip_fw *ip_fw_default_rule;
 
 /*
- * Data structure to cache our ucred related
- * information. This structure only gets used if
- * the user specified UID/GID based constraints in
- * a firewall rule.
- */
-struct ip_fw_ugid {
-	gid_t		fw_groups[NGROUPS];
-	int		fw_ngroups;
-	uid_t		fw_uid;
-	int		fw_prid;
-};
-
-/*
  * list of rules for layer 3
  */
 #ifdef VIMAGE_GLOBALS
@@ -2009,22 +1996,10 @@ dump_table(struct ip_fw_chain *ch, ipfw_
 	return (0);
 }
 
-static void
-fill_ugid_cache(struct inpcb *inp, struct ip_fw_ugid *ugp)
-{
-	struct ucred *cr;
-
-	cr = inp->inp_cred;
-	ugp->fw_prid = jailed(cr) ? cr->cr_prison->pr_id : -1;
-	ugp->fw_uid = cr->cr_uid;
-	ugp->fw_ngroups = cr->cr_ngroups;
-	bcopy(cr->cr_groups, ugp->fw_groups, sizeof(ugp->fw_groups));
-}
-
 static int
 check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif,
     struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip,
-    u_int16_t src_port, struct ip_fw_ugid *ugp, int *ugid_lookupp,
+    u_int16_t src_port, struct ucred **uc, int *ugid_lookupp,
     struct inpcb *inp)
 {
 	INIT_VNET_INET(curvnet);
@@ -2032,7 +2007,6 @@ check_uidgid(ipfw_insn_u32 *insn, int pr
 	int wildcard;
 	struct inpcb *pcb;
 	int match;
-	gid_t *gp;
 
 	/*
 	 * Check to see if the UDP or TCP stack supplied us with
@@ -2042,7 +2016,7 @@ check_uidgid(ipfw_insn_u32 *insn, int pr
 	if (inp && *ugid_lookupp == 0) {
 		INP_LOCK_ASSERT(inp);
 		if (inp->inp_socket != NULL) {
-			fill_ugid_cache(inp, ugp);
+			*uc = crhold(inp->inp_cred);
 			*ugid_lookupp = 1;
 		} else
 			*ugid_lookupp = -1;
@@ -2075,7 +2049,7 @@ check_uidgid(ipfw_insn_u32 *insn, int pr
 				dst_ip, htons(dst_port),
 				wildcard, NULL);
 		if (pcb != NULL) {
-			fill_ugid_cache(pcb, ugp);
+			*uc = crhold(inp->inp_cred);
 			*ugid_lookupp = 1;
 		}
 		INP_INFO_RUNLOCK(pi);
@@ -2091,16 +2065,11 @@ check_uidgid(ipfw_insn_u32 *insn, int pr
 		}
 	} 
 	if (insn->o.opcode == O_UID)
-		match = (ugp->fw_uid == (uid_t)insn->d[0]);
-	else if (insn->o.opcode == O_GID) {
-		for (gp = ugp->fw_groups;
-			gp < &ugp->fw_groups[ugp->fw_ngroups]; gp++)
-			if (*gp == (gid_t)insn->d[0]) {
-				match = 1;
-				break;
-			}
-	} else if (insn->o.opcode == O_JAIL)
-		match = (ugp->fw_prid == (int)insn->d[0]);
+		match = ((*uc)->cr_uid == (uid_t)insn->d[0]);
+	else if (insn->o.opcode == O_GID)
+		match = groupmember((gid_t)insn->d[0], *uc);
+	else if (insn->o.opcode == O_JAIL)
+		match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]);
 	return match;
 }
 
@@ -2178,8 +2147,8 @@ ipfw_chk(struct ip_fw_args *args)

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

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 17:42:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB8F3106568F
	for ; Fri, 19 Jun 2009 17:42:39 +0000 (UTC)
	(envelope-from julian@elischer.org)
Received: from outA.internet-mail-service.net (outa.internet-mail-service.net
	[216.240.47.224])
	by mx1.freebsd.org (Postfix) with ESMTP id ACF478FC2A
	for ; Fri, 19 Jun 2009 17:42:39 +0000 (UTC)
	(envelope-from julian@elischer.org)
Received: from idiom.com (mx0.idiom.com [216.240.32.160])
	by out.internet-mail-service.net (Postfix) with ESMTP id 099A5B9812;
	Fri, 19 Jun 2009 10:43:03 -0700 (PDT)
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38])
	by idiom.com (Postfix) with ESMTP id E12B02D600F;
	Fri, 19 Jun 2009 10:42:38 -0700 (PDT)
Message-ID: <4A3BCE0E.9050107@elischer.org>
Date: Fri, 19 Jun 2009 10:42:38 -0700
From: Julian Elischer 
User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
MIME-Version: 1.0
To: Brooks Davis 
References: <200906191710.n5JHAaql049507@svn.freebsd.org>
In-Reply-To: <200906191710.n5JHAaql049507@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; 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: r194498 - in head: . lib/libc/rpc lib/libkvm
 sys/compat/linux
 sys/fs/nfs sys/fs/nfsclient sys/fs/nfsserver sys/fs/portalfs sys/fs/unionfs
 sys/i386/ibcs2 sys/kern sys/netinet/ipfw sys/nf...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 17:42:40 -0000

Brooks Davis wrote:
> Author: brooks
> Date: Fri Jun 19 17:10:35 2009
> New Revision: 194498
> URL: http://svn.freebsd.org/changeset/base/194498
> 
> Log:
>   Rework the credential code to support larger values of NGROUPS and
>   NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
[...]


should ucred(9) be updated in some way?


From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 17:54:52 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D6081065672;
	Fri, 19 Jun 2009 17:54:52 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net
	[IPv6:2001:4830:1200:a1::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 16CD68FC0C;
	Fri, 19 Jun 2009 17:54:51 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (localhost [127.0.0.1])
	by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n5JHswcd069524; 
	Fri, 19 Jun 2009 12:54:58 -0500 (CDT)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: (from brooks@localhost)
	by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n5JHswlH069523;
	Fri, 19 Jun 2009 12:54:58 -0500 (CDT) (envelope-from brooks)
Date: Fri, 19 Jun 2009 12:54:58 -0500
From: Brooks Davis 
To: Julian Elischer 
Message-ID: <20090619175458.GA68815@lor.one-eyed-alien.net>
References: <200906191710.n5JHAaql049507@svn.freebsd.org>
	<4A3BCE0E.9050107@elischer.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4"
Content-Disposition: inline
In-Reply-To: <4A3BCE0E.9050107@elischer.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(lor.one-eyed-alien.net [127.0.0.1]);
	Fri, 19 Jun 2009 12:54:58 -0500 (CDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Brooks Davis , src-committers@FreeBSD.org
Subject: Re: svn commit: r194498 - in head: . lib/libc/rpc lib/libkvm
	sys/compat/linux sys/fs/nfs sys/fs/nfsclient sys/fs/nfsserver
	sys/fs/portalfs sys/fs/unionfs sys/i386/ibcs2 sys/kern
	sys/netinet/ipfw sys/nf...
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 17:54:53 -0000


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

On Fri, Jun 19, 2009 at 10:42:38AM -0700, Julian Elischer wrote:
> Brooks Davis wrote:
>> Author: brooks
>> Date: Fri Jun 19 17:10:35 2009
>> New Revision: 194498
>> URL: http://svn.freebsd.org/changeset/base/194498
>>=20
>> Log:
>>   Rework the credential code to support larger values of NGROUPS and
>>   NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024
> [...]
>=20
>=20
> should ucred(9) be updated in some way?

Yup, totally missed that one.  I'll get something worked up.

-- Brooks

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

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

iD8DBQFKO9DxXY6L6fI4GtQRAp4pAKDV3z+rnH511J0i8IzrP2++HllocgCdEu2V
DPUkyyZ2n6XrV6kRTpDdUmg=
=Sys+
-----END PGP SIGNATURE-----

--YiEDa0DAkWCtVeE4--

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 19:16:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07F3A106564A;
	Fri, 19 Jun 2009 19:16:36 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D03EB8FC08;
	Fri, 19 Jun 2009 19:16:35 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JJGZVr052989;
	Fri, 19 Jun 2009 19:16:35 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JJGZng052987;
	Fri, 19 Jun 2009 19:16:35 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906191916.n5JJGZng052987@svn.freebsd.org>
From: Brooks Davis 
Date: Fri, 19 Jun 2009 19:16: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: r194507 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 19 Jun 2009 19:16:36 -0000

Author: brooks
Date: Fri Jun 19 19:16:35 2009
New Revision: 194507
URL: http://svn.freebsd.org/changeset/base/194507

Log:
  Document crcopysafe() and crsetgroups().
  
  Reminded by:	julian

Modified:
  head/share/man/man9/ucred.9

Modified: head/share/man/man9/ucred.9
==============================================================================
--- head/share/man/man9/ucred.9	Fri Jun 19 19:12:14 2009	(r194506)
+++ head/share/man/man9/ucred.9	Fri Jun 19 19:16:35 2009	(r194507)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 3, 2002
+.Dd June 19, 2009
 .Dt UCRED 9
 .Os
 .Sh NAME
@@ -54,8 +54,12 @@
 .Ft void
 .Fn crcopy "struct ucred *dest" "struct ucred *src"
 .Ft "struct ucred *"
+.Fn crcopysafe "struct proc *p" "struct ucred *cr"
+.Ft "struct ucred *"
 .Fn crdup "struct ucred *cr"
 .Ft void
+.Fn crsetgroups "struct ucred *cr" "int ngrp" "gid_t *groups"
+.Ft void
 .Fn cru2x "struct ucred *cr" "struct xucred *xcr"
 .Ft void
 .Fn cred_update_thread "struct thread *td"
@@ -98,6 +102,18 @@ by calling
 .Xr uihold 9 .
 .Pp
 The
+.Fn crcopysafe
+function copies the current credential associated with the process
+.Fa p
+into the newly allocated credential
+.Fa cr .
+The process lock on
+.Fa p
+must be held and will be dropped and reacquired as needed to allocate
+group storage space in
+.Fa cr .
+.Pp
+The
 .Fn crdup
 function allocates memory for a new structure and copies the
 contents of
@@ -107,6 +123,20 @@ The actual copying is performed by
 .Fn crcopy .
 .Pp
 The
+.Fn crsetgroups
+function sets the
+.Va cr_groups
+and
+.Va cr_ngroups
+variables and allocates space as needed.
+It also truncates the group list to the current maximum number of
+groups.
+No other mechanism should be used to modify the
+.Va cr_groups
+array except for updating the primary group via assignment to
+.Va cr_groups[0] .
+.Pp
+The
 .Fn cru2x
 function converts a
 .Vt ucred
@@ -133,9 +163,10 @@ function sets the credentials of
 to that of its process, freeing its old credential if required.
 .Sh RETURN VALUES
 .Fn crget ,
-.Fn crhold
+.Fn crhold ,
+.Fn crdup ,
 and
-.Fn crdup
+.Fn crcopysafe
 all return a pointer to a
 .Vt ucred
 structure.
@@ -152,9 +183,10 @@ structure contains extensible fields.
 This means that the correct protocol must always be followed to create
 a fresh and writable credential structure: new credentials must always
 be derived from existing credentials using
-.Fn crget
+.Fn crget ,
+.Fn crcopy ,
 and
-.Fn crcopy .
+.Fn crcopysafe .
 .Pp
 In the common case, credentials required for access control decisions are
 used in a read-only manner.

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 19:28:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58463106564A;
	Fri, 19 Jun 2009 19:28:22 +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 46C2E8FC0A;
	Fri, 19 Jun 2009 19:28:22 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JJSLwj053241;
	Fri, 19 Jun 2009 19:28:21 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JJSL2s053239;
	Fri, 19 Jun 2009 19:28:21 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200906191928.n5JJSL2s053239@svn.freebsd.org>
From: Xin LI 
Date: Fri, 19 Jun 2009 19:28:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194508 - head/usr.bin/gzip
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 19:28:22 -0000

Author: delphij
Date: Fri Jun 19 19:28:21 2009
New Revision: 194508
URL: http://svn.freebsd.org/changeset/base/194508

Log:
  Two fixes for SMALL case when compiling with WARNS=6:
  
   - Reduce scope where return value can be referenced.
   - Add a dummy access to timestamp to silence warning.
  
  Submitted by:	Mingyan Guo 

Modified:
  head/usr.bin/gzip/gzip.c

Modified: head/usr.bin/gzip/gzip.c
==============================================================================
--- head/usr.bin/gzip/gzip.c	Fri Jun 19 19:16:35 2009	(r194507)
+++ head/usr.bin/gzip/gzip.c	Fri Jun 19 19:28:21 2009	(r194508)
@@ -1297,7 +1297,7 @@ file_uncompress(char *file, char *outfil
 	ssize_t rbytes;
 	unsigned char header1[4];
 	enum filetype method;
-	int rv, fd, ofd, zfd = -1;
+	int fd, ofd, zfd = -1;
 #ifndef SMALL
 	time_t timestamp = 0;
 	unsigned char name[PATH_MAX + 1];
@@ -1344,6 +1344,7 @@ file_uncompress(char *file, char *outfil
 #ifndef SMALL
 	if (method == FT_GZIP && Nflag) {
 		unsigned char ts[4];	/* timestamp */
+		int rv;
 
 		rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
 		if (rv >= 0 && (size_t)rv < sizeof ts)
@@ -1966,6 +1967,8 @@ print_list(int fd, off_t out, const char
 	}
 	in_tot += in;
 	out_tot += out;
+#else
+	(void)&ts;	/* XXX */
 #endif
 	printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in);
 	print_ratio(in, out, stdout);

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 20:31:45 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59504106564A;
	Fri, 19 Jun 2009 20:31:45 +0000 (UTC)
	(envelope-from csjp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 46BFC8FC19;
	Fri, 19 Jun 2009 20:31:45 +0000 (UTC)
	(envelope-from csjp@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JKVi6r054540;
	Fri, 19 Jun 2009 20:31:44 GMT (envelope-from csjp@svn.freebsd.org)
Received: (from csjp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JKViNs054536;
	Fri, 19 Jun 2009 20:31:44 GMT (envelope-from csjp@svn.freebsd.org)
Message-Id: <200906192031.n5JKViNs054536@svn.freebsd.org>
From: "Christian S.J. Peron" 
Date: Fri, 19 Jun 2009 20:31: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: r194512 - in head: sys/net usr.bin/netstat
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 19 Jun 2009 20:31:45 -0000

Author: csjp
Date: Fri Jun 19 20:31:44 2009
New Revision: 194512
URL: http://svn.freebsd.org/changeset/base/194512

Log:
  Implement the -z (zero counters) option for the various bpf counters.
  Add necessary changes to the kernel for this (basically introduce a
  bpf_zero_counters() function).  As well, update the man page.
  
  MFC after:	1 month
  Discussed with:	rwatson

Modified:
  head/sys/net/bpf.c
  head/usr.bin/netstat/bpf.c
  head/usr.bin/netstat/netstat.1

Modified: head/sys/net/bpf.c
==============================================================================
--- head/sys/net/bpf.c	Fri Jun 19 20:05:34 2009	(r194511)
+++ head/sys/net/bpf.c	Fri Jun 19 20:31:44 2009	(r194512)
@@ -2032,6 +2032,35 @@ bpf_drvinit(void *unused)
 
 }
 
+/*
+ * Zero out the various packet counters associated with all of the bpf
+ * descriptors.  At some point, we will probably want to get a bit more
+ * granular and allow the user to specify descriptors to be zeroed.
+ */
+static void
+bpf_zero_counters(void)
+{
+	struct bpf_if *bp;
+	struct bpf_d *bd;
+
+	mtx_lock(&bpf_mtx);
+	LIST_FOREACH(bp, &bpf_iflist, bif_next) {
+		BPFIF_LOCK(bp);
+		LIST_FOREACH(bd, &bp->bif_dlist, bd_next) {
+			BPFD_LOCK(bd);
+			bd->bd_rcount = 0;
+			bd->bd_dcount = 0;
+			bd->bd_fcount = 0;
+			bd->bd_wcount = 0;
+			bd->bd_wfcount = 0;
+			bd->bd_zcopy = 0;
+			BPFD_UNLOCK(bd);
+		}
+		BPFIF_UNLOCK(bp);
+	}
+	mtx_unlock(&bpf_mtx);
+}
+
 static void
 bpfstats_fill_xbpf(struct xbpf_d *d, struct bpf_d *bd)
 {
@@ -2066,7 +2095,7 @@ bpfstats_fill_xbpf(struct xbpf_d *d, str
 static int
 bpf_stats_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	struct xbpf_d *xbdbuf, *xbd;
+	struct xbpf_d *xbdbuf, *xbd, zerostats;
 	int index, error;
 	struct bpf_if *bp;
 	struct bpf_d *bd;
@@ -2080,6 +2109,21 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS)
 	error = priv_check(req->td, PRIV_NET_BPF);
 	if (error)
 		return (error);
+	/*
+	 * Check to see if the user is requesting that the counters be
+	 * zeroed out.  Explicitly check that the supplied data is zeroed,
+	 * as we aren't allowing the user to set the counters currently.
+	 */
+	if (req->newptr != NULL) {
+		if (req->newlen != sizeof(zerostats))
+			return (EINVAL);
+		bzero(&zerostats, sizeof(zerostats));
+		xbd = req->newptr;
+		if (bcmp(xbd, &zerostats, sizeof(*xbd)) != 0)
+			return (EINVAL);
+		bpf_zero_counters();
+		return (0);
+	}
 	if (req->oldptr == NULL)
 		return (SYSCTL_OUT(req, 0, bpf_bpfd_cnt * sizeof(*xbd)));
 	if (bpf_bpfd_cnt == 0)

Modified: head/usr.bin/netstat/bpf.c
==============================================================================
--- head/usr.bin/netstat/bpf.c	Fri Jun 19 20:05:34 2009	(r194511)
+++ head/usr.bin/netstat/bpf.c	Fri Jun 19 20:31:44 2009	(r194512)
@@ -91,10 +91,17 @@ bpf_flags(struct xbpf_d *bd, char *flagb
 void
 bpf_stats(char *ifname)
 {
-	struct xbpf_d *d, *bd;
+	struct xbpf_d *d, *bd, zerostat;
 	char *pname, flagbuf[12];
 	size_t size;
 
+	if (zflag) {
+		bzero(&zerostat, sizeof(zerostat));
+		if (sysctlbyname("net.bpf.stats", NULL, NULL,
+		    &zerostat, sizeof(zerostat)) < 0)
+			warn("failed to zero bpf counters");
+		return;
+	}
 	if (sysctlbyname("net.bpf.stats", NULL, &size,
 	    NULL, 0) < 0) {
 		warn("net.bpf.stats");

Modified: head/usr.bin/netstat/netstat.1
==============================================================================
--- head/usr.bin/netstat/netstat.1	Fri Jun 19 20:05:34 2009	(r194511)
+++ head/usr.bin/netstat/netstat.1	Fri Jun 19 20:31:44 2009	(r194512)
@@ -198,6 +198,7 @@ The network manages a private pool of me
 .Bk -words
 .Nm
 .Fl B
+.Op Fl z
 .Op Fl I Ar interface
 .Ek
 .Xc

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 21:01:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 72AB910656C6;
	Fri, 19 Jun 2009 21:01:55 +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 488568FC22;
	Fri, 19 Jun 2009 21:01:55 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JL1tA0055172;
	Fri, 19 Jun 2009 21:01:55 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JL1tMG055170;
	Fri, 19 Jun 2009 21:01:55 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200906192101.n5JL1tMG055170@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 19 Jun 2009 21:01: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: r194513 - head/sys/netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 19 Jun 2009 21:01:56 -0000

Author: bz
Date: Fri Jun 19 21:01:55 2009
New Revision: 194513
URL: http://svn.freebsd.org/changeset/base/194513

Log:
  Move setting of ports from NAT-T below key_getsah() and actually
  below key_setsaval().
  Without that, the lookup for the SA had failed as we were looking for
  a SA with the new, updated port numbers instead of the old ones and
  were comparing the ports in key_cmpsaidx().
  This makes updating the remote -> local SA on the initiator work again.
  
  Problem introduced with:	p4 changeset 152114

Modified:
  head/sys/netipsec/key.c

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Fri Jun 19 20:31:44 2009	(r194512)
+++ head/sys/netipsec/key.c	Fri Jun 19 21:01:55 2009	(r194513)
@@ -4991,6 +4991,7 @@ key_update(so, m, mhp)
 	struct sadb_address *src0, *dst0;
 #ifdef IPSEC_NAT_T
 	struct sadb_x_nat_t_type *type;
+	struct sadb_x_nat_t_port *sport, *dport;
 	struct sadb_address *iaddr, *raddr;
 	struct sadb_x_nat_t_frag *frag;
 #endif
@@ -5066,7 +5067,6 @@ key_update(so, m, mhp)
 	if (mhp->ext[SADB_X_EXT_NAT_T_TYPE] != NULL &&
 	    mhp->ext[SADB_X_EXT_NAT_T_SPORT] != NULL &&
 	    mhp->ext[SADB_X_EXT_NAT_T_DPORT] != NULL) {
-		struct sadb_x_nat_t_port *sport, *dport;
 
 		if (mhp->extlen[SADB_X_EXT_NAT_T_TYPE] < sizeof(*type) ||
 		    mhp->extlen[SADB_X_EXT_NAT_T_SPORT] < sizeof(*sport) ||
@@ -5082,15 +5082,9 @@ key_update(so, m, mhp)
 		    mhp->ext[SADB_X_EXT_NAT_T_SPORT];
 		dport = (struct sadb_x_nat_t_port *)
 		    mhp->ext[SADB_X_EXT_NAT_T_DPORT];
-
-		if (sport)
-			KEY_PORTTOSADDR(&saidx.src,
-			    sport->sadb_x_nat_t_port_port);
-		if (dport)
-			KEY_PORTTOSADDR(&saidx.dst,
-			    dport->sadb_x_nat_t_port_port);
 	} else {
 		type = 0;
+		sport = dport = 0;
 	}
 	if (mhp->ext[SADB_X_EXT_NAT_T_OAI] != NULL &&
 	    mhp->ext[SADB_X_EXT_NAT_T_OAR] != NULL) {
@@ -5193,6 +5187,13 @@ key_update(so, m, mhp)
 	if (type)
 		sav->natt_type = type->sadb_x_nat_t_type_type;
 
+	if (sport)
+		KEY_PORTTOSADDR(&sav->sah->saidx.src,
+		    sport->sadb_x_nat_t_port_port);
+	if (dport)
+		KEY_PORTTOSADDR(&sav->sah->saidx.dst,
+		    dport->sadb_x_nat_t_port_port);
+
 #if 0
 	/*
 	 * In case SADB_X_EXT_NAT_T_FRAG was not given, leave it at 0.

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 21:14:39 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E05B10656D1;
	Fri, 19 Jun 2009 21:14:39 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6177C8FC0A;
	Fri, 19 Jun 2009 21:14:39 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JLEdQC055484;
	Fri, 19 Jun 2009 21:14:39 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JLEd4W055481;
	Fri, 19 Jun 2009 21:14:39 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906192114.n5JLEd4W055481@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 19 Jun 2009 21:14: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: r194515 - in head/sys: kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 19 Jun 2009 21:14:40 -0000

Author: kmacy
Date: Fri Jun 19 21:14:39 2009
New Revision: 194515
URL: http://svn.freebsd.org/changeset/base/194515

Log:
  define helper routines for deferred mbuf initialization

Modified:
  head/sys/kern/kern_mbuf.c
  head/sys/sys/mbuf.h

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Fri Jun 19 21:11:09 2009	(r194514)
+++ head/sys/kern/kern_mbuf.c	Fri Jun 19 21:14:39 2009	(r194515)
@@ -645,6 +645,32 @@ mb_ctor_pack(void *mem, int size, void *
 	return (0);
 }
 
+int
+m_pkthdr_init(struct mbuf *m, int how)
+{
+#ifdef MAC
+	int error;
+#endif
+	m->m_data = m->m_pktdat;
+	SLIST_INIT(&m->m_pkthdr.tags);
+	m->m_pkthdr.rcvif = NULL;
+	m->m_pkthdr.header = NULL;
+	m->m_pkthdr.len = 0;
+	m->m_pkthdr.flowid = 0;
+	m->m_pkthdr.csum_flags = 0;
+	m->m_pkthdr.csum_data = 0;
+	m->m_pkthdr.tso_segsz = 0;
+	m->m_pkthdr.ether_vtag = 0;
+#ifdef MAC
+	/* If the label init fails, fail the alloc */
+	error = mac_mbuf_init(m, how);
+	if (error)
+		return (error);
+#endif
+
+	return (0);
+}
+
 /*
  * This is the protocol drain routine.
  *

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h	Fri Jun 19 21:11:09 2009	(r194514)
+++ head/sys/sys/mbuf.h	Fri Jun 19 21:14:39 2009	(r194515)
@@ -366,12 +366,15 @@ static __inline struct mbuf	*m_gethdr(in
 static __inline struct mbuf	*m_getjcl(int how, short type, int flags,
 				    int size);
 static __inline struct mbuf	*m_getclr(int how, short type);	/* XXX */
+static __inline int		 m_init(struct mbuf *m, uma_zone_t zone,
+				    int size, int how, short type, int flags);
 static __inline struct mbuf	*m_free(struct mbuf *m);
 static __inline void		 m_clget(struct mbuf *m, int how);
 static __inline void		*m_cljget(struct mbuf *m, int how, int size);
 static __inline void		 m_chtype(struct mbuf *m, short new_type);
 void				 mb_free_ext(struct mbuf *);
 static __inline struct mbuf	*m_last(struct mbuf *m);
+int				 m_pkthdr_init(struct mbuf *m, int how);
 
 static __inline int
 m_gettype(int size)
@@ -433,6 +436,33 @@ m_getzone(int size)
 	return (zone);
 }
 
+/*
+ * Initialize an mbuf with linear storage.
+ *
+ * Inline because the consumer text overhead will be roughly the same to
+ * initialize or call a function with this many parameters and M_PKTHDR
+ * should go away with constant propagation for !MGETHDR.
+ */
+static __inline int
+m_init(struct mbuf *m, uma_zone_t zone, int size, int how, short type,
+    int flags)
+{
+	int error;
+
+	m->m_next = NULL;
+	m->m_nextpkt = NULL;
+	m->m_data = m->m_dat;
+	m->m_len = 0;
+	m->m_flags = flags;
+	m->m_type = type;
+	if (flags & M_PKTHDR) {
+		if ((error = m_pkthdr_init(m, how)) != 0)
+			return (error);
+	}
+
+	return (0);
+}
+
 static __inline struct mbuf *
 m_get(int how, short type)
 {

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 22:09:55 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 80957106564A;
	Fri, 19 Jun 2009 22:09:55 +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 6E6328FC0A;
	Fri, 19 Jun 2009 22:09:55 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JM9ttV056727;
	Fri, 19 Jun 2009 22:09:55 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JM9tVK056725;
	Fri, 19 Jun 2009 22:09:55 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200906192209.n5JM9tVK056725@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 19 Jun 2009 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: r194516 - 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: Fri, 19 Jun 2009 22:09:56 -0000

Author: jilles
Date: Fri Jun 19 22:09:55 2009
New Revision: 194516
URL: http://svn.freebsd.org/changeset/base/194516

Log:
  Fix some issues with quoted output and shorten it in some cases.
  
  Output quoted suitable for re-input to the shell occurs in
  various cases such as 'set', 'trap'.
  
  Bugfix: *, ? and [ must be quoted (except sole [)
  Bugfix: ~ and # must be quoted (really only sometimes, but keep it simple)
  Bugfix: space, tab and newline must always be quoted
  Shortening: other IFS characters do not need quoting
  Bugfix: send to correct output file, not hard-coded stdout
  Shortening: avoid unnecessary '' with \'
  
  Approved by:	ed (mentor)

Modified:
  head/bin/sh/output.c

Modified: head/bin/sh/output.c
==============================================================================
--- head/bin/sh/output.c	Fri Jun 19 21:14:39 2009	(r194515)
+++ head/bin/sh/output.c	Fri Jun 19 22:09:55 2009	(r194516)
@@ -133,32 +133,38 @@ void
 outqstr(const char *p, struct output *file)
 {
 	char ch;
+	int inquotes;
 
 	if (p[0] == '\0') {
 		outstr("''", file);
 		return;
 	}
-	if (p[strcspn(p, "|&;<>()$`\\\"'")] == '\0' && (!ifsset() ||
-	    p[strcspn(p, ifsval())] == '\0')) {
+	/* Caller will handle '=' if necessary */
+	if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#")] == '\0' ||
+			strcmp(p, "[") == 0) {
 		outstr(p, file);
 		return;
 	}
 
-	out1c('\'');
+	inquotes = 0;
 	while ((ch = *p++) != '\0') {
 		switch (ch) {
 		case '\'':
-			/*
-			 * Can't quote single quotes inside single quotes;
-			 * close them, write escaped single quote, open again.
-			 */
-			outstr("'\\''", file);
+			/* Can't quote single quotes inside single quotes. */
+			if (inquotes)
+				outc('\'', file);
+			inquotes = 0;
+			outstr("\\'", file);
 			break;
 		default:
+			if (!inquotes)
+				outc('\'', file);
+			inquotes = 1;
 			outc(ch, file);
 		}
 	}
-	out1c('\'');
+	if (inquotes)
+		outc('\'', file);
 }
 
 STATIC char out_junk[16];

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 22:16:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36F78106566C;
	Fri, 19 Jun 2009 22:16:00 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 09CBC8FC08;
	Fri, 19 Jun 2009 22:16:00 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JMFxo8056889;
	Fri, 19 Jun 2009 22:15:59 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JMFxtt056887;
	Fri, 19 Jun 2009 22:15:59 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200906192215.n5JMFxtt056887@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 19 Jun 2009 22:15: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: r194517 - in head/tools/regression/bin/sh: builtins
	errors
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 22:16:00 -0000

Author: jilles
Date: Fri Jun 19 22:15:59 2009
New Revision: 194517
URL: http://svn.freebsd.org/changeset/base/194517

Log:
  Add tests for r194406 and r194516.
  
  Approved by:	ed (mentor)

Added:
  head/tools/regression/bin/sh/builtins/trap2.0   (contents, props changed)
  head/tools/regression/bin/sh/errors/backquote-error1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/trap2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/trap2.0	Fri Jun 19 22:15:59 2009	(r194517)
@@ -0,0 +1,52 @@
+# $FreeBSD$
+# This is really a test for outqstr(), which is readily accessible via trap.
+
+runtest()
+{
+	teststring=$1
+	trap -- "$teststring" USR1
+	traps=$(trap)
+	if [ "$teststring" != "-" ] && [ -z "$traps" ]; then
+		# One possible reading of POSIX requires the above to return an
+		# empty string because backquote commands are executed in a
+		# subshell and subshells shall reset traps. However, an example
+		# in the normative description of the trap builtin shows the
+		# same usage as here, it is useful and our /bin/sh allows it.
+		echo '$(trap) is broken'
+		exit 1
+	fi
+	trap - USR1
+	eval "$traps"
+	traps2=$(trap)
+	if [ "$traps" != "$traps2" ]; then
+		echo "Mismatch for '$teststring'"
+		exit 1
+	fi
+}
+
+runtest 'echo'
+runtest 'echo hi'
+runtest "'echo' 'hi'"
+runtest '"echo" $PATH'
+runtest '\echo "$PATH"'
+runtest ' 0'
+runtest '0 '
+runtest ' 1'
+runtest '1 '
+i=1
+while [ $i -le 127 ]; do
+	c=$(printf \\"$(printf %o $i)")
+	if [ $i -lt 48 ] || [ $i -gt 57 ]; then
+		runtest "$c"
+	fi
+	runtest " $c$c"
+	runtest "a$c"
+	i=$((i+1))
+done
+IFS=,
+runtest ' '
+runtest ','
+unset IFS
+runtest ' '
+
+exit 0

Added: head/tools/regression/bin/sh/errors/backquote-error1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/errors/backquote-error1.0	Fri Jun 19 22:15:59 2009	(r194517)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+echo 'echo `for` echo ".BAD"CODE.' | sh -i 2>&1 | grep -q BADCODE && exit 1
+exit 0

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 23:11:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 95F4B106564A;
	Fri, 19 Jun 2009 23:11:20 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 840368FC13;
	Fri, 19 Jun 2009 23:11:20 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JNBKxc057919;
	Fri, 19 Jun 2009 23:11:20 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JNBKev057917;
	Fri, 19 Jun 2009 23:11:20 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906192311.n5JNBKev057917@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 19 Jun 2009 23:11: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: r194518 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 19 Jun 2009 23:11:21 -0000

Author: kmacy
Date: Fri Jun 19 23:11:20 2009
New Revision: 194518
URL: http://svn.freebsd.org/changeset/base/194518

Log:
  add helper function for flushing software queues

Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Fri Jun 19 22:15:59 2009	(r194517)
+++ head/sys/net/if_var.h	Fri Jun 19 23:11:20 2009	(r194518)
@@ -586,13 +586,27 @@ drbr_enqueue(struct ifnet *ifp, struct b
 }
 
 static __inline void
-drbr_free(struct buf_ring *br, struct malloc_type *type)
+drbr_flush(struct ifnet *ifp, struct buf_ring *br)
 {
 	struct mbuf *m;
 
+#ifdef ALTQ
+	if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) {
+		while (!IFQ_IS_EMPTY(&ifp->if_snd)) {
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+			m_freem(m);
+		}
+	}
+#endif	
 	while ((m = buf_ring_dequeue_sc(br)) != NULL)
 		m_freem(m);
+}
+
+static __inline void
+drbr_free(struct buf_ring *br, struct malloc_type *type)
+{
 
+	drbr_flush(NULL, br);
 	buf_ring_free(br, type);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Fri Jun 19 23:34:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8BE4E1065675;
	Fri, 19 Jun 2009 23:34:32 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7790F8FC17;
	Fri, 19 Jun 2009 23:34:32 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5JNYWvp058509;
	Fri, 19 Jun 2009 23:34:32 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5JNYWji058504;
	Fri, 19 Jun 2009 23:34:32 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906192334.n5JNYWji058504@svn.freebsd.org>
From: Kip Macy 
Date: Fri, 19 Jun 2009 23:34: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: r194521 - in head/sys: conf dev/cxgb dev/cxgb/common
	dev/cxgb/sys modules/cxgb/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 19 Jun 2009 23:34:33 -0000

Author: kmacy
Date: Fri Jun 19 23:34:32 2009
New Revision: 194521
URL: http://svn.freebsd.org/changeset/base/194521

Log:
  Greatly simplify cxgb by removing almost all of the custom mbuf management logic
  
  - remove mbuf iovec - useful, but adds too much complexity when isolated to
     the driver
  
  - remove driver private caching - insufficient benefit over UMA to justify
    the added complexity and maintenance overhead
  
  - remove separate logic for managing multiple transmit queues, with the
    new drbr routines the control flow can be made to much more closely resemble
    legacy drivers
  
  - remove dedicated service threads, with per-cpu callouts one can get the same
    benefit much more simply by registering a callout 1 tick in the future if there
    are still buffered packets
  
  - remove embedded mbuf usage - Jeffr's changes will (I hope) soon be integrated
    greatly reducing the overhead of using kernel APIs for reference counting
    clusters
  
  - add hysteresis to descriptor coalescing logic
  
  - add coalesce threshold sysctls to allow users to decide at run-time
    between optimizing for forwarding / UDP or optimizing for TCP
  
  - add once per second watchdog to effectively close the very rare races
    occurring from coalescing
  
  - incorporate Navdeep's changes to the initialization path required to
    convert port and adapter locks back to ordinary mutexes (silencing BPF
    LOR complaints)
  
  - enable prefetches in get_packet and tx cleaning
  
  Reviewed by:	navdeep@
  MFC after:	2 weeks

Deleted:
  head/sys/dev/cxgb/cxgb_multiq.c
  head/sys/dev/cxgb/sys/cxgb_support.c
Modified:
  head/sys/conf/files
  head/sys/dev/cxgb/common/cxgb_t3_cpl.h
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_osdep.h
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/sys/mvec.h
  head/sys/dev/cxgb/sys/uipc_mvec.c
  head/sys/modules/cxgb/cxgb/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Jun 19 23:30:09 2009	(r194520)
+++ head/sys/conf/files	Fri Jun 19 23:34:32 2009	(r194521)
@@ -756,8 +756,6 @@ dev/cxgb/cxgb_offload.c		optional cxgb p
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/cxgb_sge.c		optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
-dev/cxgb/cxgb_multiq.c		optional cxgb pci \
-	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_mc5.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/common/cxgb_vsc7323.c	optional cxgb pci \
@@ -776,8 +774,6 @@ dev/cxgb/common/cxgb_tn1010.c	optional c
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"	
 dev/cxgb/sys/uipc_mvec.c	optional cxgb pci \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
-dev/cxgb/sys/cxgb_support.c	optional cxgb pci \
-	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cxgb/cxgb_t3fw.c		optional cxgb cxgb_t3fw \
 	compile-with "${NORMAL_C} -I$S/dev/cxgb"
 dev/cy/cy.c			optional cy

Modified: head/sys/dev/cxgb/common/cxgb_t3_cpl.h
==============================================================================
--- head/sys/dev/cxgb/common/cxgb_t3_cpl.h	Fri Jun 19 23:30:09 2009	(r194520)
+++ head/sys/dev/cxgb/common/cxgb_t3_cpl.h	Fri Jun 19 23:34:32 2009	(r194521)
@@ -237,10 +237,21 @@ struct rss_header {
 
 #ifndef CHELSIO_FW
 struct work_request_hdr {
-	__be32 wr_hi;
-	__be32 wr_lo;
+	union {
+		struct {
+			__be32 wr_hi;
+			__be32 wr_lo;
+		} ilp32;
+		struct {
+			__be64 wr_hilo;
+		} lp64;
+	} u;
 };
 
+#define	wrh_hi		u.ilp32.wr_hi
+#define	wrh_lo		u.ilp32.wr_lo
+#define	wrh_hilo	u.lp64.wr_hilo
+
 /* wr_hi fields */
 #define S_WR_SGE_CREDITS    0
 #define M_WR_SGE_CREDITS    0xFF
@@ -817,8 +828,7 @@ struct cpl_peer_close {
 };
 
 struct tx_data_wr {
-	__be32 wr_hi;
-	__be32 wr_lo;
+	WR_HDR;
 	__be32 len;
 	__be32 flags;
 	__be32 sndseq;
@@ -936,8 +946,7 @@ struct cpl_rdma_ec_status {
 };
 
 struct mngt_pktsched_wr {
-	__be32 wr_hi;
-	__be32 wr_lo;
+	WR_HDR;
 	__u8  mngt_opcode;
 	__u8  rsvd[7];
 	__u8  sched;

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==============================================================================
--- head/sys/dev/cxgb/cxgb_adapter.h	Fri Jun 19 23:30:09 2009	(r194520)
+++ head/sys/dev/cxgb/cxgb_adapter.h	Fri Jun 19 23:34:32 2009	(r194521)
@@ -35,7 +35,6 @@ $FreeBSD$
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -63,8 +62,6 @@ $FreeBSD$
 #include 
 #endif
 
-#define USE_SX
-
 struct adapter;
 struct sge_qset;
 extern int cxgb_debug;
@@ -82,22 +79,9 @@ extern int cxgb_debug;
 		mtx_destroy((lock));					\
 	} while (0)
 
-#define SX_INIT(lock, lockname) \
-	do { \
-		printf("initializing %s at %s:%d\n", lockname, __FILE__, __LINE__); \
-		sx_init((lock), lockname);		\
-	} while (0)
-
-#define SX_DESTROY(lock) \
-	do { \
-		printf("destroying %s at %s:%d\n", (lock)->lock_object.lo_name, __FILE__, __LINE__); \
-		sx_destroy((lock));					\
-	} while (0)
 #else
 #define MTX_INIT mtx_init
 #define MTX_DESTROY mtx_destroy
-#define SX_INIT sx_init
-#define SX_DESTROY sx_destroy
 #endif
 
 enum {
@@ -110,20 +94,17 @@ struct port_info {
 	struct adapter	*adapter;
 	struct ifnet	*ifp;
 	int		if_flags;
+	int		flags;
 	const struct port_type_info *port_type;
 	struct cphy	phy;
 	struct cmac	mac;
 	struct link_config link_config;
 	struct ifmedia	media;
-#ifdef USE_SX	
-	struct sx	lock;
-#else	
 	struct mtx	lock;
-#endif	
-	uint8_t		port_id;
-	uint8_t		tx_chan;
-	uint8_t		txpkt_intf;
-	uint8_t         first_qset;
+	uint32_t	port_id;
+	uint32_t	tx_chan;
+	uint32_t	txpkt_intf;
+	uint32_t        first_qset;
 	uint32_t	nqsets;
 	int		link_fault;
 
@@ -135,19 +116,30 @@ struct port_info {
 #define PORT_NAME_LEN 32
 	char            lockbuf[PORT_LOCK_NAME_LEN];
 	char            namebuf[PORT_NAME_LEN];
-};
+} __aligned(L1_CACHE_BYTES);
 
-enum {				/* adapter flags */
+enum {
+	/* adapter flags */
 	FULL_INIT_DONE	= (1 << 0),
 	USING_MSI	= (1 << 1),
 	USING_MSIX	= (1 << 2),
 	QUEUES_BOUND	= (1 << 3),
-	FW_UPTODATE     = (1 << 4),
-	TPS_UPTODATE    = (1 << 5),
+	FW_UPTODATE	= (1 << 4),
+	TPS_UPTODATE	= (1 << 5),
 	CXGB_SHUTDOWN	= (1 << 6),
 	CXGB_OFLD_INIT	= (1 << 7),
-	TP_PARITY_INIT  = (1 << 8),
+	TP_PARITY_INIT	= (1 << 8),
+	CXGB_BUSY	= (1 << 9),
+
+	/* port flags */
+	DOOMED		= (1 << 0),
 };
+#define IS_DOOMED(p)	(p->flags & DOOMED)
+#define SET_DOOMED(p)	do {p->flags |= DOOMED;} while (0)
+#define DOOMED(p)	(p->flags & DOOMED)
+#define IS_BUSY(sc)	(sc->flags & CXGB_BUSY)
+#define SET_BUSY(sc)	do {sc->flags |= CXGB_BUSY;} while (0)
+#define CLR_BUSY(sc)	do {sc->flags &= ~CXGB_BUSY;} while (0)
 
 #define FL_Q_SIZE	4096
 #define JUMBO_Q_SIZE	1024
@@ -205,10 +197,6 @@ struct sge_rspq {
 	uint32_t	rspq_dump_count;
 };
 
-#ifndef DISABLE_MBUF_IOVEC
-#define rspq_mbuf rspq_mh.mh_head
-#endif
-
 struct rx_desc;
 struct rx_sw_desc;
 
@@ -253,7 +241,6 @@ struct sge_txq {
 	bus_addr_t	phys_addr;
 	struct task     qresume_task;
 	struct task     qreclaim_task;
-	struct port_info *port;
 	uint32_t	cntxt_id;
 	uint64_t	stops;
 	uint64_t	restarts;
@@ -261,26 +248,21 @@ struct sge_txq {
 	bus_dmamap_t	desc_map;
 	bus_dma_tag_t   entry_tag;
 	struct mbuf_head sendq;
-	/*
-	 * cleanq should really be an buf_ring to avoid extra
-	 * mbuf touches
-	 */
-	struct mbuf_head cleanq;	
+
 	struct buf_ring *txq_mr;
 	struct ifaltq	*txq_ifq;
-	struct mbuf     *immpkt;
-
+	struct callout	txq_timer;
+	struct callout	txq_watchdog;
+	uint64_t        txq_coalesced;
 	uint32_t        txq_drops;
 	uint32_t        txq_skipped;
-	uint32_t        txq_coalesced;
 	uint32_t        txq_enqueued;
 	uint32_t	txq_dump_start;
 	uint32_t	txq_dump_count;
-	unsigned long   txq_frees;
-	struct mtx      lock;
+	uint64_t	txq_direct_packets;
+	uint64_t	txq_direct_bytes;	
+	uint64_t	txq_frees;
 	struct sg_ent  txq_sgl[TX_MAX_SEGS / 2 + 1];
-	#define TXQ_NAME_LEN  32
-	char            lockbuf[TXQ_NAME_LEN];
 };
      	
 
@@ -297,6 +279,8 @@ enum {
 #define QS_EXITING              0x1
 #define QS_RUNNING              0x2
 #define QS_BOUND                0x4
+#define	QS_FLUSHING		0x8
+#define	QS_TIMEOUT		0x10
 
 struct sge_qset {
 	struct sge_rspq		rspq;
@@ -309,10 +293,10 @@ struct sge_qset {
 	uint64_t                port_stats[SGE_PSTAT_MAX];
 	struct port_info        *port;
 	int                     idx; /* qset # */
-	int                     qs_cpuid;
 	int                     qs_flags;
+	int			coalescing;
 	struct cv		qs_cv;
-	struct mtx		qs_mtx;
+	struct mtx		lock;
 #define QS_NAME_LEN 32
 	char                    namebuf[QS_NAME_LEN];
 };
@@ -328,7 +312,7 @@ struct adapter {
 	device_t		dev;
 	int			flags;
 	TAILQ_ENTRY(adapter)    adapter_entry;
-	
+
 	/* PCI register resources */
 	int			regs_rid;
 	struct resource		*regs_res;
@@ -401,11 +385,7 @@ struct adapter {
 	char                    port_types[MAX_NPORTS + 1];
 	uint32_t                open_device_map;
 	uint32_t                registered_device_map;
-#ifdef USE_SX
-	struct sx               lock;
-#else	
 	struct mtx              lock;
-#endif	
 	driver_intr_t           *cxgb_intr;
 	int                     msi_count;
 
@@ -422,31 +402,17 @@ struct t3_rx_mode {
 	struct port_info        *port;
 };
 
-
 #define MDIO_LOCK(adapter)	mtx_lock(&(adapter)->mdio_lock)
 #define MDIO_UNLOCK(adapter)	mtx_unlock(&(adapter)->mdio_lock)
 #define ELMR_LOCK(adapter)	mtx_lock(&(adapter)->elmer_lock)
 #define ELMR_UNLOCK(adapter)	mtx_unlock(&(adapter)->elmer_lock)
 
 
-#ifdef USE_SX
-#define PORT_LOCK(port)		     sx_xlock(&(port)->lock);
-#define PORT_UNLOCK(port)	     sx_xunlock(&(port)->lock);
-#define PORT_LOCK_INIT(port, name)   SX_INIT(&(port)->lock, name)
-#define PORT_LOCK_DEINIT(port)       SX_DESTROY(&(port)->lock)
-#define PORT_LOCK_ASSERT_OWNED(port) sx_assert(&(port)->lock, SA_LOCKED)
-
-#define ADAPTER_LOCK(adap)	           sx_xlock(&(adap)->lock);
-#define ADAPTER_UNLOCK(adap)	           sx_xunlock(&(adap)->lock);
-#define ADAPTER_LOCK_INIT(adap, name)      SX_INIT(&(adap)->lock, name)
-#define ADAPTER_LOCK_DEINIT(adap)          SX_DESTROY(&(adap)->lock)
-#define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) sx_assert(&(adap)->lock, SA_UNLOCKED)
-#define ADAPTER_LOCK_ASSERT_OWNED(adap) sx_assert(&(adap)->lock, SA_LOCKED)
-#else
 #define PORT_LOCK(port)		     mtx_lock(&(port)->lock);
 #define PORT_UNLOCK(port)	     mtx_unlock(&(port)->lock);
 #define PORT_LOCK_INIT(port, name)   mtx_init(&(port)->lock, name, 0, MTX_DEF)
 #define PORT_LOCK_DEINIT(port)       mtx_destroy(&(port)->lock)
+#define PORT_LOCK_ASSERT_NOTOWNED(port) mtx_assert(&(port)->lock, MA_NOTOWNED)
 #define PORT_LOCK_ASSERT_OWNED(port) mtx_assert(&(port)->lock, MA_OWNED)
 
 #define ADAPTER_LOCK(adap)	mtx_lock(&(adap)->lock);
@@ -455,7 +421,6 @@ struct t3_rx_mode {
 #define ADAPTER_LOCK_DEINIT(adap) mtx_destroy(&(adap)->lock)
 #define ADAPTER_LOCK_ASSERT_NOTOWNED(adap) mtx_assert(&(adap)->lock, MA_NOTOWNED)
 #define ADAPTER_LOCK_ASSERT_OWNED(adap) mtx_assert(&(adap)->lock, MA_OWNED)
-#endif
 
 
 static __inline uint32_t
@@ -555,14 +520,11 @@ void t3_sge_stop(adapter_t *);
 void t3b_intr(void *data);
 void t3_intr_msi(void *data);
 void t3_intr_msix(void *data);
-int t3_encap(struct sge_qset *, struct mbuf **, int);
 
 int t3_sge_init_adapter(adapter_t *);
 int t3_sge_reset_adapter(adapter_t *);
 int t3_sge_init_port(struct port_info *);
-void t3_sge_deinit_sw(adapter_t *);
-void t3_free_tx_desc(struct sge_txq *q, int n);
-void t3_free_tx_desc_all(struct sge_txq *q);
+void t3_free_tx_desc(struct sge_qset *qs, int n, int qid);
 
 void t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int ethpad);
 
@@ -615,13 +577,8 @@ static inline int offload_running(adapte
         return isset(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT);
 }
 
-int cxgb_pcpu_enqueue_packet(struct ifnet *ifp, struct mbuf *m);
-int cxgb_pcpu_transmit(struct ifnet *ifp, struct mbuf *m);
-void cxgb_pcpu_shutdown_threads(struct adapter *sc);
-void cxgb_pcpu_startup_threads(struct adapter *sc);
-
-int process_responses(adapter_t *adap, struct sge_qset *qs, int budget);
-void t3_free_qset(adapter_t *sc, struct sge_qset *q);
+void cxgb_tx_watchdog(void *arg);
+int cxgb_transmit(struct ifnet *ifp, struct mbuf *m);
+void cxgb_qflush(struct ifnet *ifp);
 void cxgb_start(struct ifnet *ifp);
-void refill_fl_service(adapter_t *adap, struct sge_fl *fl);
 #endif

Modified: head/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_main.c	Fri Jun 19 23:30:09 2009	(r194520)
+++ head/sys/dev/cxgb/cxgb_main.c	Fri Jun 19 23:34:32 2009	(r194521)
@@ -84,10 +84,12 @@ __FBSDID("$FreeBSD$");
 
 static int cxgb_setup_interrupts(adapter_t *);
 static void cxgb_teardown_interrupts(adapter_t *);
+static int cxgb_begin_op(struct port_info *, const char *);
+static int cxgb_begin_detach(struct port_info *);
+static int cxgb_end_op(struct port_info *);
 static void cxgb_init(void *);
-static void cxgb_init_locked(struct port_info *);
-static void cxgb_stop_locked(struct port_info *);
-static void cxgb_set_rxmode(struct port_info *);
+static int cxgb_init_synchronized(struct port_info *);
+static int cxgb_uninit_synchronized(struct port_info *);
 static int cxgb_ioctl(struct ifnet *, unsigned long, caddr_t);
 static int cxgb_media_change(struct ifnet *);
 static int cxgb_ifm_type(int);
@@ -96,7 +98,6 @@ static int setup_sge_qsets(adapter_t *);
 static void cxgb_async_intr(void *);
 static void cxgb_ext_intr_handler(void *, int);
 static void cxgb_tick_handler(void *, int);
-static void cxgb_down_locked(struct adapter *sc);
 static void cxgb_tick(void *);
 static void setup_rss(adapter_t *sc);
 
@@ -114,7 +115,6 @@ static int cxgb_get_regs_len(void);
 static int offload_open(struct port_info *pi);
 static void touch_bars(device_t dev);
 static int offload_close(struct t3cdev *tdev);
-static void cxgb_link_start(struct port_info *p);
 int t3_detect_link_fault(adapter_t *adapter, int port_id);
 
 static device_method_t cxgb_controller_methods[] = {
@@ -722,29 +722,47 @@ cxgb_free(struct adapter *sc)
 	sc->flags |= CXGB_SHUTDOWN;
 	ADAPTER_UNLOCK(sc);
 
-	cxgb_pcpu_shutdown_threads(sc);
-
-	ADAPTER_LOCK(sc);
-	cxgb_down_locked(sc);
-	ADAPTER_UNLOCK(sc);
-	
-	t3_sge_deinit_sw(sc);
 	/*
-	 * Wait for last callout
+	 * Make sure all child devices are gone.
 	 */
-	
-	DELAY(hz*100);
-
 	bus_generic_detach(sc->dev);
-
 	for (i = 0; i < (sc)->params.nports; i++) {
 		if (sc->portdev[i] &&
 		    device_delete_child(sc->dev, sc->portdev[i]) != 0)
 			device_printf(sc->dev, "failed to delete child port\n");
 	}
 
-	cxgb_teardown_interrupts(sc);
+	/*
+	 * At this point, it is as if cxgb_port_detach has run on all ports, and
+	 * cxgb_down has run on the adapter.  All interrupts have been silenced,
+	 * all open devices have been closed.
+	 */
+	KASSERT(sc->open_device_map == 0, ("%s: device(s) still open (%x)",
+					   __func__, sc->open_device_map));
+	for (i = 0; i < sc->params.nports; i++) {
+		KASSERT(sc->port[i].ifp == NULL, ("%s: port %i undead!",
+						  __func__, i));
+	}
 
+	/*
+	 * Finish off the adapter's callouts.
+	 */
+	callout_drain(&sc->cxgb_tick_ch);
+	callout_drain(&sc->sge_timer_ch);
+
+	/*
+	 * Release resources grabbed under FULL_INIT_DONE by cxgb_up.  The
+	 * sysctls are cleaned up by the kernel linker.
+	 */
+	if (sc->flags & FULL_INIT_DONE) {
+ 		t3_free_sge_resources(sc);
+ 		sc->flags &= ~FULL_INIT_DONE;
+ 	}
+
+	/*
+	 * Release all interrupt resources.
+	 */
+	cxgb_teardown_interrupts(sc);
 #ifdef MSI_SUPPORTED
 	if (sc->flags & (USING_MSI | USING_MSIX)) {
 		device_printf(sc->dev, "releasing msi message(s)\n");
@@ -759,26 +777,26 @@ cxgb_free(struct adapter *sc)
 	}
 #endif
 
+	/*
+	 * Free the adapter's taskqueue.
+	 */
 	if (sc->tq != NULL) {
 		taskqueue_free(sc->tq);
 		sc->tq = NULL;
 	}
 	
 	if (is_offload(sc)) {
+		clrbit(&sc->registered_device_map, OFFLOAD_DEVMAP_BIT);
 		cxgb_adapter_unofld(sc);
-		if (isset(&sc->open_device_map,	OFFLOAD_DEVMAP_BIT))
-			offload_close(&sc->tdev);
-		else
-			printf("cxgb_free: DEVMAP_BIT not set\n");
-	} else
-		printf("not offloading set\n");	
+	}
+
 #ifdef notyet
 	if (sc->flags & CXGB_OFLD_INIT)
 		cxgb_offload_deactivate(sc);
 #endif
 	free(sc->filters, M_DEVBUF);
 	t3_sge_free(sc);
-	
+
 	cxgb_offload_exit();
 
 	if (sc->udbs_res != NULL)
@@ -1052,10 +1070,9 @@ cxgb_port_attach(device_t dev)
 	}
 
 	ether_ifattach(ifp, p->hw_addr);
+	ifp->if_transmit = cxgb_transmit;
+	ifp->if_qflush = cxgb_qflush;
 
-#ifdef IFNET_MULTIQUEUE
-	ifp->if_transmit = cxgb_pcpu_transmit;
-#endif
 	/*
 	 * Only default to jumbo frames on 10GigE
 	 */
@@ -1112,15 +1129,8 @@ cxgb_port_attach(device_t dev)
 		ifmedia_set(&p->media, IFM_ETHER | IFM_AUTO);
 	}	
 
-	/* Get the latest mac address, User can use a LAA */
-	bcopy(IF_LLADDR(p->ifp), p->hw_addr, ETHER_ADDR_LEN);
 	t3_sge_init_port(p);
 
-#if defined(LINK_ATTACH)	
-	cxgb_link_start(p);
-	t3_link_changed(sc, p->port_id);
-#endif
-
 	return (err);
 }
 
@@ -1130,46 +1140,38 @@ cxgb_port_attach(device_t dev)
  * removing the device from the view of the kernel, i.e. from all 
  * interfaces lists etc.  This routine is only called when the driver is 
  * being unloaded, not when the link goes down.
- * 
  */
 static int
 cxgb_port_detach(device_t dev)
 {
 	struct port_info *p;
 	struct adapter *sc;
+	int i;
 
 	p = device_get_softc(dev);
 	sc = p->adapter;
 
+	cxgb_begin_detach(p);
+
 	if (p->port_cdev != NULL)
 		destroy_dev(p->port_cdev);
-	
+
+	cxgb_uninit_synchronized(p);
 	ether_ifdetach(p->ifp);
 
-	PORT_LOCK(p);
-	if (p->ifp->if_drv_flags & IFF_DRV_RUNNING) 
-		cxgb_stop_locked(p);
-	PORT_UNLOCK(p);
-	
-	callout_drain(&sc->cxgb_tick_ch);
-	callout_drain(&sc->sge_timer_ch);
-	
-	if (sc->tq != NULL) {
-		printf("draining slow intr\n");
-		
-		taskqueue_drain(sc->tq, &sc->slow_intr_task);
-			printf("draining ext intr\n");	
-		taskqueue_drain(sc->tq, &sc->ext_intr_task);
-		printf("draining tick task\n");
-		taskqueue_drain(sc->tq, &sc->tick_task);
+	for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
+		struct sge_qset *qs = &sc->sge.qs[i];
+		struct sge_txq *txq = &qs->txq[TXQ_ETH];
+
+		callout_drain(&txq->txq_watchdog);
+		callout_drain(&txq->txq_timer);
 	}
 
-	/*
-	 * the lock may be acquired in ifdetach
-	 */
 	PORT_LOCK_DEINIT(p);
 	if_free(p->ifp);
-	
+	p->ifp = NULL;
+
+	cxgb_end_op(p);
 	return (0);
 }
 
@@ -1276,12 +1278,16 @@ t3_os_link_changed(adapter_t *adapter, i
      int duplex, int fc)
 {
 	struct port_info *pi = &adapter->port[port_id];
+	struct ifnet *ifp = pi->ifp;
+
+	/* no race with detach, so ifp should always be good */
+	KASSERT(ifp, ("%s: if detached.", __func__));
 
 	if (link_status) {
-		pi->ifp->if_baudrate = IF_Mbps(speed);
-		if_link_state_change(pi->ifp, LINK_STATE_UP);
+		ifp->if_baudrate = IF_Mbps(speed);
+		if_link_state_change(ifp, LINK_STATE_UP);
 	} else
-		if_link_state_change(pi->ifp, LINK_STATE_DOWN);
+		if_link_state_change(ifp, LINK_STATE_DOWN);
 }
 
 /**
@@ -1325,13 +1331,13 @@ t3_os_ext_intr_handler(adapter_t *sc)
 	 * interrupts in the meantime and let the task reenable them when
 	 * it's done.
 	 */
-	ADAPTER_LOCK(sc);
 	if (sc->slow_intr_mask) {
+		ADAPTER_LOCK(sc);
 		sc->slow_intr_mask &= ~F_T3DBG;
 		t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask);
 		taskqueue_enqueue(sc->tq, &sc->ext_intr_task);
+		ADAPTER_UNLOCK(sc);
 	}
-	ADAPTER_UNLOCK(sc);
 }
 
 void
@@ -1348,21 +1354,19 @@ t3_os_set_hw_addr(adapter_t *adapter, in
 	bcopy(hw_addr, adapter->port[port_idx].hw_addr, ETHER_ADDR_LEN);
 }
 
-/**
- *	link_start - enable a port
- *	@p: the port to enable
- *
- *	Performs the MAC and PHY actions needed to enable a port.
+/*
+ * Programs the XGMAC based on the settings in the ifnet.  These settings
+ * include MTU, MAC address, mcast addresses, etc.
  */
 static void
-cxgb_link_start(struct port_info *p)
+cxgb_update_mac_settings(struct port_info *p)
 {
-	struct ifnet *ifp;
+	struct ifnet *ifp = p->ifp;
 	struct t3_rx_mode rm;
 	struct cmac *mac = &p->mac;
 	int mtu, hwtagging;
 
-	ifp = p->ifp;
+	PORT_LOCK_ASSERT_OWNED(p);
 
 	bcopy(IF_LLADDR(ifp), p->hw_addr, ETHER_ADDR_LEN);
 
@@ -1372,15 +1376,11 @@ cxgb_link_start(struct port_info *p)
 
 	hwtagging = (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0;
 
-	t3_init_rx_mode(&rm, p);
-	if (!mac->multiport) 
-		t3_mac_reset(mac);
 	t3_mac_set_mtu(mac, mtu);
 	t3_set_vlan_accel(p->adapter, 1 << p->tx_chan, hwtagging);
 	t3_mac_set_address(mac, 0, p->hw_addr);
+	t3_init_rx_mode(&rm, p);
 	t3_mac_set_rx_mode(mac, &rm);
-	t3_link_start(&p->phy, mac, &p->link_config);
-	t3_mac_enable(mac, MAC_DIRECTION_RX | MAC_DIRECTION_TX);
 }
 
 
@@ -1415,7 +1415,7 @@ init_tp_parity(struct adapter *adap)
 		req = mtod(m, struct cpl_smt_write_req *);
 		m->m_len = m->m_pkthdr.len = sizeof(*req);
 		memset(req, 0, sizeof(*req));
-		req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+		req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
 		OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, i));
 		req->iff = i;
 		t3_mgmt_tx(adap, m);
@@ -1428,7 +1428,7 @@ init_tp_parity(struct adapter *adap)
 		req = mtod(m, struct cpl_l2t_write_req *);
 		m->m_len = m->m_pkthdr.len = sizeof(*req);
 		memset(req, 0, sizeof(*req));
-		req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+		req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
 		OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, i));
 		req->params = htonl(V_L2T_W_IDX(i));
 		t3_mgmt_tx(adap, m);
@@ -1441,7 +1441,7 @@ init_tp_parity(struct adapter *adap)
 		req = mtod(m, struct cpl_rte_write_req *);
 		m->m_len = m->m_pkthdr.len = sizeof(*req);
 		memset(req, 0, sizeof(*req));
-		req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+		req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
 		OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RTE_WRITE_REQ, i));
 		req->l2t_idx = htonl(V_L2T_W_IDX(i));
 		t3_mgmt_tx(adap, m);
@@ -1451,7 +1451,7 @@ init_tp_parity(struct adapter *adap)
 	greq = mtod(m, struct cpl_set_tcb_field *);
 	m->m_len = m->m_pkthdr.len = sizeof(*greq);
 	memset(greq, 0, sizeof(*greq));
-	greq->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+	greq->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
 	OPCODE_TID(greq) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, 0));
 	greq->mask = htobe64(1);
 	t3_mgmt_tx(adap, m);
@@ -1532,7 +1532,7 @@ write_smt_entry(struct adapter *adapter,
 	req = mtod(m, struct cpl_smt_write_req *);
 	m->m_pkthdr.len = m->m_len = sizeof(struct cpl_smt_write_req);
 	
-	req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+	req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
 	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SMT_WRITE_REQ, idx));
 	req->mtu_idx = NMTUS - 1;  /* should be 0 but there's a T3 bug */
 	req->iff = idx;
@@ -1559,10 +1559,8 @@ init_smt(struct adapter *adapter)
 static void
 init_port_mtus(adapter_t *adapter)
 {
-	unsigned int mtus = adapter->port[0].ifp->if_mtu;
+	unsigned int mtus = ETHERMTU | (ETHERMTU << 16);
 
-	if (adapter->port[1].ifp)
-		mtus |= adapter->port[1].ifp->if_mtu << 16;
 	t3_write_reg(adapter, A_TP_MTU_PORT_TABLE, mtus);
 }
 
@@ -1576,7 +1574,7 @@ send_pktsched_cmd(struct adapter *adap, 
 	m = m_gethdr(M_DONTWAIT, MT_DATA);
 	if (m) {	
 		req = mtod(m, struct mngt_pktsched_wr *);
-		req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT));
+		req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT));
 		req->mngt_opcode = FW_MNGTOPCODE_PKTSCHED_SET;
 		req->sched = sched;
 		req->idx = qidx;
@@ -1593,7 +1591,6 @@ bind_qsets(adapter_t *sc)
 {
 	int i, j;
 
-	cxgb_pcpu_startup_threads(sc);
 	for (i = 0; i < (sc)->params.nports; ++i) {
 		const struct port_info *pi = adap2pinfo(sc, i);
 
@@ -1717,14 +1714,20 @@ cxgb_up(struct adapter *sc)
 {
 	int err = 0;
 
+	ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
+	KASSERT(sc->open_device_map == 0, ("%s: device(s) already open (%x)",
+					   __func__, sc->open_device_map));
+
 	if ((sc->flags & FULL_INIT_DONE) == 0) {
 
 		if ((sc->flags & FW_UPTODATE) == 0)
 			if ((err = upgrade_fw(sc)))
 				goto out;
+
 		if ((sc->flags & TPS_UPTODATE) == 0)
 			if ((err = update_tpsram(sc)))
 				goto out;
+
 		err = t3_init_hw(sc, 0);
 		if (err)
 			goto out;
@@ -1756,78 +1759,53 @@ cxgb_up(struct adapter *sc)
 		sc->flags |= TP_PARITY_INIT;
 
 	if (sc->flags & TP_PARITY_INIT) {
-		t3_write_reg(sc, A_TP_INT_CAUSE,
-				F_CMCACHEPERR | F_ARPLUTPERR);
+		t3_write_reg(sc, A_TP_INT_CAUSE, F_CMCACHEPERR | F_ARPLUTPERR);
 		t3_write_reg(sc, A_TP_INT_ENABLE, 0x7fbfffff);
 	}
-
 	
 	if (!(sc->flags & QUEUES_BOUND)) {
 		bind_qsets(sc);
 		sc->flags |= QUEUES_BOUND;		
 	}
+
+	t3_sge_reset_adapter(sc);
 out:
 	return (err);
 }
 
-
 /*
- * Bring down the interface but do not free any resources.
+ * Called when the last open device is closed.  Does NOT undo all of cxgb_up's
+ * work.  Specifically, the resources grabbed under FULL_INIT_DONE are released
+ * during controller_detach, not here.
  */
 static void
-cxgb_down_locked(struct adapter *sc)
+cxgb_down(struct adapter *sc)
 {
-	
+	ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
+
 	t3_sge_stop(sc);
 	t3_intr_disable(sc);
-
-	callout_stop(&sc->cxgb_tick_ch);
-	callout_stop(&sc->sge_timer_ch);
 }
 
 static int
 offload_open(struct port_info *pi)
 {
-	struct adapter *adapter = pi->adapter;
-	struct t3cdev *tdev = &adapter->tdev;
+	struct adapter *sc = pi->adapter;
+	struct t3cdev *tdev = &sc->tdev;
 
-	int adap_up = adapter->open_device_map & PORT_MASK;
-	int err = 0;
+	ADAPTER_LOCK_ASSERT_NOTOWNED(sc);
 
-	if (atomic_cmpset_int(&adapter->open_device_map,
-		(adapter->open_device_map & ~(1<open_device_map | (1<open_device_map, OFFLOAD_DEVMAP_BIT);
 
-	if (!isset(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT)) 
-		printf("offload_open: DEVMAP_BIT did not get set 0x%x\n",
-		    adapter->open_device_map);
-	ADAPTER_LOCK(pi->adapter); 
-	if (!adap_up)
-		err = cxgb_up(adapter);
-	ADAPTER_UNLOCK(pi->adapter);
-	if (err)
-		return (err);
-
-	t3_tp_set_offload_mode(adapter, 1);
+	t3_tp_set_offload_mode(sc, 1);
 	tdev->lldev = pi->ifp;
-
-	init_port_mtus(adapter);
-	t3_load_mtus(adapter, adapter->params.mtus, adapter->params.a_wnd,
-		     adapter->params.b_wnd,
-		     adapter->params.rev == 0 ?
-		       adapter->port[0].ifp->if_mtu : 0xffff);
-	init_smt(adapter);
-	/* Call back all registered clients */
+	init_port_mtus(sc);
+	t3_load_mtus(sc, sc->params.mtus, sc->params.a_wnd, sc->params.b_wnd,
+		     sc->params.rev == 0 ?  sc->port[0].ifp->if_mtu : 0xffff);
+	init_smt(sc);
 	cxgb_add_clients(tdev);
 
-	/* restore them in case the offload module has changed them */
-	if (err) {
-		t3_tp_set_offload_mode(adapter, 0);
-		clrbit(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT);
-		cxgb_set_dummy_ops(tdev);
-	}
-	return (err);
+	return (0);
 }
 
 static int
@@ -1844,147 +1822,220 @@ offload_close(struct t3cdev *tdev)
 	tdev->lldev = NULL;
 	cxgb_set_dummy_ops(tdev);
 	t3_tp_set_offload_mode(adapter, 0);
+
 	clrbit(&adapter->open_device_map, OFFLOAD_DEVMAP_BIT);
 
-	ADAPTER_LOCK(adapter);
-	if (!adapter->open_device_map)
-		cxgb_down_locked(adapter);
+	return (0);
+}
+
+/*
+ * Begin a synchronized operation.  If this call succeeds, it is guaranteed that
+ * no one will remove the port or its ifp from underneath the caller.  Caller is
+ * also granted exclusive access to open_device_map.
+ *
+ * operation here means init, uninit, detach, and ioctl service.
+ *
+ * May fail.
+ * EINTR (ctrl-c pressed during ifconfig for example).
+ * ENXIO (port is about to detach - due to kldunload for example).
+ */
+int
+cxgb_begin_op(struct port_info *p, const char *wmsg)
+{
+	int rc = 0;
+	struct adapter *sc = p->adapter;
+
+	ADAPTER_LOCK(sc);
+
+	while (!IS_DOOMED(p) && IS_BUSY(sc)) {
+		if (mtx_sleep(&sc->flags, &sc->lock, PCATCH, wmsg, 0)) {
+			rc = EINTR;
+			goto done;
+		}
+	}
+
+	if (IS_DOOMED(p))
+		rc = ENXIO;
+	else if (!IS_BUSY(sc))
+		SET_BUSY(sc);
+	else {
+		KASSERT(0, ("%s: port %d, p->flags = %x , sc->flags = %x",
+			    __func__, p->port_id, p->flags, sc->flags));
+		rc = EDOOFUS;
+	}
+
+done:
+	ADAPTER_UNLOCK(sc);
+	return (rc);
+}
 
-	ADAPTER_UNLOCK(adapter);
+/*
+ * End a synchronized operation.  Read comment block above cxgb_begin_op.
+ */
+int
+cxgb_end_op(struct port_info *p)
+{
+	struct adapter *sc = p->adapter;
+
+	ADAPTER_LOCK(sc);
+	KASSERT(IS_BUSY(sc), ("%s: not busy.", __func__));
+	CLR_BUSY(sc);
+	wakeup_one(&sc->flags);
+	ADAPTER_UNLOCK(sc);
 
 	return (0);
 }
 
+/*
+ * Prepare for port detachment.  Detach is a special kind of synchronized
+ * operation.  Also read comment before cxgb_begin_op.
+ */
+static int
+cxgb_begin_detach(struct port_info *p)
+{
+	struct adapter *sc = p->adapter;
 
+	/*
+	 * Inform those waiting for this port that it is going to be destroyed
+	 * and they should not continue further.  (They'll return with ENXIO).
+	 */
+	ADAPTER_LOCK(sc);
+	SET_DOOMED(p);
+	wakeup(&sc->flags);
+	ADAPTER_UNLOCK(sc);
+
+	/*
+	 * Wait for in-progress operations.
+	 */
+	ADAPTER_LOCK(sc);
+	while (IS_BUSY(sc)) {
+		mtx_sleep(&sc->flags, &sc->lock, 0, "cxgbdtch", 0);
+	}
+	SET_BUSY(sc);
+	ADAPTER_UNLOCK(sc);
+
+	return (0);
+}
+
+/*
+ * if_init for cxgb ports.
+ */
 static void
 cxgb_init(void *arg)
 {
 	struct port_info *p = arg;
 
-	PORT_LOCK(p);
-	cxgb_init_locked(p);
-	PORT_UNLOCK(p);
+	if (cxgb_begin_op(p, "cxgbinit"))
+		return;
+
+	cxgb_init_synchronized(p);
+	cxgb_end_op(p);
 }
 
-static void
-cxgb_init_locked(struct port_info *p)
+static int
+cxgb_init_synchronized(struct port_info *p)
 {
-	struct ifnet *ifp;
-	adapter_t *sc = p->adapter;
-	int err;
-
-	PORT_LOCK_ASSERT_OWNED(p);
-	ifp = p->ifp;
+	struct adapter *sc = p->adapter;
+	struct ifnet *ifp = p->ifp;
+	struct cmac *mac = &p->mac;
+	int i, rc;
 
-	ADAPTER_LOCK(p->adapter);
-	if ((sc->open_device_map == 0) && (err = cxgb_up(sc))) {
-		ADAPTER_UNLOCK(p->adapter);
-		cxgb_stop_locked(p);
-		return;
-	}
-	if (p->adapter->open_device_map == 0) {
-		t3_intr_clear(sc);
-	}
-	setbit(&p->adapter->open_device_map, p->port_id);
-	ADAPTER_UNLOCK(p->adapter);
+	if (sc->open_device_map == 0) {
+		if ((rc = cxgb_up(sc)) != 0)
+			return (rc);
 
-	if (is_offload(sc) && !ofld_disable) {
-		err = offload_open(p);
-		if (err)
+		if (is_offload(sc) && !ofld_disable && offload_open(p))
 			log(LOG_WARNING,
 			    "Could not initialize offload capabilities\n");
 	}
 
-	device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id);
+	PORT_LOCK(p);
 	t3_port_intr_enable(sc, p->port_id);
+	if (!mac->multiport) 
+		t3_mac_reset(mac);
+	cxgb_update_mac_settings(p);
+	t3_link_start(&p->phy, mac, &p->link_config);

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

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 00:04:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE8E91065674;
	Sat, 20 Jun 2009 00:04:48 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CCC398FC14;
	Sat, 20 Jun 2009 00:04:48 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5K04mEe059160;
	Sat, 20 Jun 2009 00:04:48 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5K04mND059158;
	Sat, 20 Jun 2009 00:04:48 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <200906200004.n5K04mND059158@svn.freebsd.org>
From: Navdeep Parhar 
Date: Sat, 20 Jun 2009 00:04:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194522 - 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, 20 Jun 2009 00:04:49 -0000

Author: np
Date: Sat Jun 20 00:04:48 2009
New Revision: 194522
URL: http://svn.freebsd.org/changeset/base/194522

Log:
  Make puc(4) aware of this 2 port serial card based on NetMos 9835:
  
  puc0@pci0:4:1:0:       class=0x070002 card=0x00021000 chip=0x98359710 rev=0x01 hdr=0x00
  
  Reviewed by:	marcel@
  Approved by:	gnn (mentor)

Modified:
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/pucdata.c
==============================================================================
--- head/sys/dev/puc/pucdata.c	Fri Jun 19 23:34:32 2009	(r194521)
+++ head/sys/dev/puc/pucdata.c	Sat Jun 20 00:04:48 2009	(r194522)
@@ -784,6 +784,12 @@ const struct puc_cfg puc_pci_devices[] =
 	    PUC_PORT_1S, 0x10, 4, 0,
 	},
 
+	{   0x9710, 0x9835, 0x1000, 2,
+	    "NetMos NM9835 based 2-port serial",
+	    DEFAULT_RCLK,
+	    PUC_PORT_2S, 0x10, 4, 0,
+	},
+
 	{   0x9710, 0x9835, 0xffff, 0,
 	    "NetMos NM9835 Dual UART and 1284 Printer port",
 	    DEFAULT_RCLK,

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 00:54:57 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 795C0106566C;
	Sat, 20 Jun 2009 00:54:57 +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 676348FC13;
	Sat, 20 Jun 2009 00:54:57 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5K0svJd060185;
	Sat, 20 Jun 2009 00:54:57 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5K0svPK060182;
	Sat, 20 Jun 2009 00:54:57 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906200054.n5K0svPK060182@svn.freebsd.org>
From: Rick Macklem 
Date: Sat, 20 Jun 2009 00:54:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194523 - in head/sys/fs: nfs nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 00:54:57 -0000

Author: rmacklem
Date: Sat Jun 20 00:54:57 2009
New Revision: 194523
URL: http://svn.freebsd.org/changeset/base/194523

Log:
  Change the size of the nfsc_groups[] array in the experimental nfs
  client to RPCAUTH_UNIXGIDS + 1 (17), since that is what can go on
  the wire for AUTH_SYS authentication.
  
  Reviewed by:	brooks
  Approved by:	kib (mentor)

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfs/nfs.h
==============================================================================
--- head/sys/fs/nfs/nfs.h	Sat Jun 20 00:04:48 2009	(r194522)
+++ head/sys/fs/nfs/nfs.h	Sat Jun 20 00:54:57 2009	(r194523)
@@ -404,13 +404,13 @@ typedef struct {
 		(b)->bits[1] = NFSATTRBIT_REFERRAL1; } while (0)
 
 /*
- * Store uid, gid creds that handle maps to.
- * Since some BSDen define cr_gid as cr_groups[0], I'll just keep them
- * all in nfsc_groups[NGROUPS + 1].
+ * Store uid, gid creds that were used when the stateid was acquired.
+ * The RPC layer allows RPCAUTH_UNIXGIDS + 1 groups to go out on the wire,
+ * so that's how many gets stored here.
  */
 struct nfscred {
 	uid_t 		nfsc_uid;
-	gid_t		nfsc_groups[NGROUPS + 1];
+	gid_t		nfsc_groups[RPCAUTH_UNIXGIDS + 1];
 	int		nfsc_ngroups;
 };
 

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Sat Jun 20 00:04:48 2009	(r194522)
+++ head/sys/fs/nfsclient/nfs_clport.c	Sat Jun 20 00:54:57 2009	(r194523)
@@ -979,7 +979,7 @@ newnfs_copyincred(struct ucred *cr, stru
 	int i;
 
 	nfscr->nfsc_uid = cr->cr_uid;
-	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
+	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, RPCAUTH_UNIXGIDS + 1);
 	for (i = 0; i < nfscr->nfsc_ngroups; i++)
 		nfscr->nfsc_groups[i] = cr->cr_groups[i];
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 03:57:10 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A112A106564A;
	Sat, 20 Jun 2009 03:57:10 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au
	[211.29.132.186])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C4518FC12;
	Sat, 20 Jun 2009 03:57:09 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from c122-106-159-184.carlnfd1.nsw.optusnet.com.au
	(c122-106-159-184.carlnfd1.nsw.optusnet.com.au [122.106.159.184])
	by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	n5K3v6pa018946
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 20 Jun 2009 13:57:08 +1000
Date: Sat, 20 Jun 2009 13:57:07 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Brooks Davis 
In-Reply-To: <200906191552.n5JFqZcG047705@svn.freebsd.org>
Message-ID: <20090620130238.N29302@delplex.bde.org>
References: <200906191552.n5JFqZcG047705@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: r194493 - head/usr.bin/catman
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 03:57:11 -0000

On Fri, 19 Jun 2009, Brooks Davis wrote:

> Log:
>  When checking if we can write to a file, use access() instead of a
>  manual permission check based on stat output.  Also, get rid of the
>  executability check since it is not used.

This seems to add some security holes.  From "man assert | col -bx":

%%%
SECURITY CONSIDERATIONS
      The access() system call is a potential security hole due to race condi-
      tions and should never be used.  Set-user-ID and set-group-ID applica-
      tions should restore the effective user or group ID, and perform actions
      directly rather than use access() to simulate access checks for the real
      user or group ID.	The eaccess() system call likewise may be subject to
      races if used inappropriately.
%%%

catman isn't setuid in FreeBSD, so this doesn't exactly apply.  I think it
does manual permission checking so as to support it being setuid on other
systems.  It seems wrong to remove this support, provided it is actually
correct.

> Modified: head/usr.bin/catman/catman.c
> ==============================================================================
> --- head/usr.bin/catman/catman.c	Fri Jun 19 15:31:40 2009	(r194492)
> +++ head/usr.bin/catman/catman.c	Fri Jun 19 15:52:35 2009	(r194493)
> @@ -759,14 +742,6 @@ main(int argc, char **argv)
> {
> 	int opt;
>
> -	if ((uid = getuid()) == 0) {
> -		fprintf(stderr, "don't run %s as root, use:\n   echo", argv[0]);
> -		for (optind = 0; optind < argc; optind++) {
> -			fprintf(stderr, " %s", argv[optind]);
> -		}
> -		fprintf(stderr, " | nice -5 su -m man\n");
> -		exit(1);
> -	}
> 	while ((opt = getopt(argc, argv, "vnfLrh")) != -1) {
> 		switch (opt) {
> 		case 'f':

Surely it is wrong to remove the enforcement of not running as root?

FreeBSD seems to have removed all setuidness for saving of cat pages,
resulting in saving of cat pages not actually working unless they
are created by user man, either by user man viewing man pages or
by su'ing to man to run catman as used to be commanded above, and
then not subsequently clobbered by user root, either by user root
viewing modified man pages or by running catman as root as used to
be disallowed above.  I see the following brokenness starting with
an empty /usr/share/man/cat1:
- "man cp" as user bde doesn't save the cat page
- "man cp" as user man saves the cat page, with correct ownwership "man"
   After removing the cat page:
- "man cp" as user root saves the cat page, with incorrect ownwership "root"
   After changing the man page:
- "man cp" as user bde displays the new man page but cannot save it
- "man cp" as either user man or (of course) user root displays the new
   man page and saves it.  Not too bad -- man(1) can replace the cat page
   owned by root because user man owns the directory.  The mechanism is
   that man(1) does a blind rename(2) of a temporary cat file.

man(1) was last setuid in 2002.  The log message for making it non-setuid
explains why catman needs to be run to partially recover lost functionality:

%%%
RCS file: /home/ncvs/src/gnu/usr.bin/man/man/Makefile,v
Working file: Makefile
head: 1.33
...
----------------------------
revision 1.33
date: 2002/01/15 14:11:05;  author: ru;  state: Exp;  lines: +1 -4
branches:  1.33.30;  1.33.32;  1.33.34;
Do not install man(1) setuid ``man''.

The catpaging and setuidness features of man(1) combined make
it vulnerable to a number of security attacks.  Specifically,
it was possible to overwrite system catpages with arbitrarily
contents by either setting up a symlink to a directory holding
system catpages, or by writing custom -mdoc or -man groff(1)
macro packages and setting up GROFF_TMAC_PATH in environment
to point to them.  (See PR below for details).

This means man(1) can no longer create system catpages on a
regular user's behalf.  (It is still able to if the user has
write permissions to the directory holding catpages, e.g.,
user's own manpages, or if the running user is ``root''.)

To create and install catpages during ``make world'', please
set MANBUILDCAT=YES in /etc/make.conf.  To rebuild catpages
on a weekly basis, please set weekly_catman_enable="YES" in
/etc/periodic.conf.

PR:		bin/32791
----------------------------
%%%

I've never seen a machine that actually runs catman.  I remove the
cat directories on all my machines to prevent any saving of cat
pages.  All FreeBSD cluster machines that I checked (just 3) have
0, 1 and 2 saved cat pages.  This shows shows that catman isn't run
on them and that root rarely looks at man pages on them.

Since catman must be run to create cat pages other than ones with
incorrect ownership obtained by root looking at man pages, it might
as always run as root.  User man and cat directories owned by user
man would become completely useless instead of just useless.

Bruce

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 05:36:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B9DD106564A;
	Sat, 20 Jun 2009 05:36:54 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EDF6E8FC14;
	Sat, 20 Jun 2009 05:36:53 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5K5ar7A065687;
	Sat, 20 Jun 2009 05:36:53 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5K5arb0065685;
	Sat, 20 Jun 2009 05:36:53 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <200906200536.n5K5arb0065685@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 20 Jun 2009 05:36: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: r194524 - head/sys/ia64/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 05:36:54 -0000

Author: marcel
Date: Sat Jun 20 05:36:53 2009
New Revision: 194524
URL: http://svn.freebsd.org/changeset/base/194524

Log:
  Drop the high FP state of an exiting thread in cpu_thread_exit() and
  not in cpu_exit(). The latter is called after td_md.md_highfp_mtx
  has been destroyed, which results in a race condition when another
  thread wants to use the high FP registers on the CPU that still has
  the high FP registers in question.

Modified:
  head/sys/ia64/ia64/vm_machdep.c

Modified: head/sys/ia64/ia64/vm_machdep.c
==============================================================================
--- head/sys/ia64/ia64/vm_machdep.c	Sat Jun 20 00:54:57 2009	(r194523)
+++ head/sys/ia64/ia64/vm_machdep.c	Sat Jun 20 05:36:53 2009	(r194524)
@@ -99,6 +99,9 @@
 void
 cpu_thread_exit(struct thread *td)
 {
+
+	/* Throw away the high FP registers. */
+	ia64_highfp_drop(td);
 }
 
 void
@@ -319,10 +322,6 @@ cpu_set_fork_handler(td, func, arg)
 void
 cpu_exit(struct thread *td)
 {
-
-	/* XXX: Should this be in cpu_thread_exit() instead? */
-	/* Throw away the high FP registers. */
-	ia64_highfp_drop(td);
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 06:02:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B6198106564A;
	Sat, 20 Jun 2009 06:02:21 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A41D18FC14;
	Sat, 20 Jun 2009 06:02:21 +0000 (UTC)
	(envelope-from kientzle@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5K62Lt6066198;
	Sat, 20 Jun 2009 06:02:21 GMT
	(envelope-from kientzle@svn.freebsd.org)
Received: (from kientzle@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5K62Lfl066196;
	Sat, 20 Jun 2009 06:02:21 GMT
	(envelope-from kientzle@svn.freebsd.org)
Message-Id: <200906200602.n5K62Lfl066196@svn.freebsd.org>
From: Tim Kientzle 
Date: Sat, 20 Jun 2009 06:02: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: r194525 - head/lib/libarchive
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 06:02:22 -0000

Author: kientzle
Date: Sat Jun 20 06:02:21 2009
New Revision: 194525
URL: http://svn.freebsd.org/changeset/base/194525

Log:
  Fix "tar --options=iso9660:joliet" and other uses
  of format-specific options.

Modified:
  head/lib/libarchive/archive_read.c

Modified: head/lib/libarchive/archive_read.c
==============================================================================
--- head/lib/libarchive/archive_read.c	Sat Jun 20 05:36:53 2009	(r194524)
+++ head/lib/libarchive/archive_read.c	Sat Jun 20 06:02:21 2009	(r194525)
@@ -117,6 +117,7 @@ archive_read_set_format_options(struct a
 	struct archive_read *a;
 	struct archive_format_descriptor *format;
 	char key[64], val[64];
+	char *valp;
 	size_t i;
 	int len, r;
 
@@ -135,10 +136,10 @@ archive_read_set_format_options(struct a
 
 		while ((len = __archive_parse_options(s, format->name,
 		    sizeof(key), key, sizeof(val), val)) > 0) {
-			if (val[0] == '\0')
-				r = format->options(a, key, NULL);
-			else
-				r = format->options(a, key, val);
+			valp = val[0] == '\0' ? NULL : val;
+			a->format = format;
+			r = format->options(a, key, valp);
+			a->format = NULL;
 			if (r == ARCHIVE_FATAL)
 				return (r);
 			s += len;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 08:46:40 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6485106566C;
	Sat, 20 Jun 2009 08:46:40 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C4A658FC13;
	Sat, 20 Jun 2009 08:46:40 +0000 (UTC)
	(envelope-from stas@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5K8keG3069265;
	Sat, 20 Jun 2009 08:46:40 GMT (envelope-from stas@svn.freebsd.org)
Received: (from stas@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5K8keO7069263;
	Sat, 20 Jun 2009 08:46:40 GMT (envelope-from stas@svn.freebsd.org)
Message-Id: <200906200846.n5K8keO7069263@svn.freebsd.org>
From: Stanislav Sedov 
Date: Sat, 20 Jun 2009 08:46: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: r194526 - head/usr.sbin/nfscbd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 08:46:41 -0000

Author: stas
Date: Sat Jun 20 08:46:40 2009
New Revision: 194526
URL: http://svn.freebsd.org/changeset/base/194526

Log:
  - Include rpcv2.h before other NFS includes. That allows nfscbd to
    compile.

Modified:
  head/usr.sbin/nfscbd/nfscbd.c

Modified: head/usr.sbin/nfscbd/nfscbd.c
==============================================================================
--- head/usr.sbin/nfscbd/nfscbd.c	Sat Jun 20 06:02:21 2009	(r194525)
+++ head/usr.sbin/nfscbd/nfscbd.c	Sat Jun 20 08:46:40 2009	(r194526)
@@ -45,10 +45,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 10:06:11 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0BA2E106566C;
	Sat, 20 Jun 2009 10:06:11 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EE4038FC0C;
	Sat, 20 Jun 2009 10:06:10 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KA6AkR070964;
	Sat, 20 Jun 2009 10:06:10 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KA6Arv070962;
	Sat, 20 Jun 2009 10:06:10 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200906201006.n5KA6Arv070962@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Sat, 20 Jun 2009 10:06: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: r194528 - head/lib/libpam/modules/pam_unix
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 10:06:11 -0000

Author: des
Date: Sat Jun 20 10:06:10 2009
New Revision: 194528
URL: http://svn.freebsd.org/changeset/base/194528

Log:
  Reword.
  
  MFC after:	1 week

Modified:
  head/lib/libpam/modules/pam_unix/pam_unix.8

Modified: head/lib/libpam/modules/pam_unix/pam_unix.8
==============================================================================
--- head/lib/libpam/modules/pam_unix/pam_unix.8	Sat Jun 20 08:54:03 2009	(r194527)
+++ head/lib/libpam/modules/pam_unix/pam_unix.8	Sat Jun 20 10:06:10 2009	(r194528)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2007
+.Dd June 20, 2009
 .Dt PAM_UNIX 8
 .Os
 .Sh NAME
@@ -106,9 +106,7 @@ except that if the previously obtained p
 the user is prompted for another password.
 .It Cm auth_as_self
 This option will require the user
-to authenticate himself as the user
-given by
-.Xr getlogin 2 ,
+to authenticate themselves as themselves,
 not as the account they are attempting to access.
 This is primarily for services like
 .Xr su 1 ,

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 10:10:01 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35569106566C;
	Sat, 20 Jun 2009 10:10:01 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 205B98FC24;
	Sat, 20 Jun 2009 10:10:01 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KAA1do071067;
	Sat, 20 Jun 2009 10:10:01 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KAA1wX071066;
	Sat, 20 Jun 2009 10:10:01 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <200906201010.n5KAA1wX071066@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Sat, 20 Jun 2009 10:10:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194529 - head/lib/libpam/modules/pam_unix
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 10:10:01 -0000

Author: des
Date: Sat Jun 20 10:09:59 2009
New Revision: 194529
URL: http://svn.freebsd.org/changeset/base/194529

Log:
  Rewrap; this was getting painful.  Translators can ignore this.
  
  MFC after:	1 week

Modified:
  head/lib/libpam/modules/pam_unix/pam_unix.8

Modified: head/lib/libpam/modules/pam_unix/pam_unix.8
==============================================================================
--- head/lib/libpam/modules/pam_unix/pam_unix.8	Sat Jun 20 10:06:10 2009	(r194528)
+++ head/lib/libpam/modules/pam_unix/pam_unix.8	Sat Jun 20 10:09:59 2009	(r194529)
@@ -52,8 +52,7 @@ The
 authentication service module for PAM,
 .Nm
 provides functionality for three PAM categories:
-authentication,
-account management, and password management.
+authentication, account management, and password management.
 In terms of the
 .Ar module-type
 parameter, they are the
@@ -66,14 +65,13 @@ It also provides a null function for ses
 .Ss Ux Ss Authentication Module
 The
 .Ux
-authentication component
-provides functions to verify the identity of a user
+authentication component provides functions to verify the identity of
+a user
 .Pq Fn pam_sm_authenticate ,
 which obtains the relevant
 .Xr passwd 5
 entry.
-It prompts the user for a password
-and verifies that this is correct with
+It prompts the user for a password and verifies that this is correct with
 .Xr crypt 3 .
 .Pp
 The following options may be passed to the authentication module:
@@ -84,64 +82,46 @@ debugging information at
 .Dv LOG_DEBUG
 level.
 .It Cm use_first_pass
-If the authentication module
-is not the first in the stack,
-and a previous module
-obtained the user's password,
-that password is used
-to authenticate the user.
-If this fails,
-the authentication module returns failure
-without prompting the user for a password.
-This option has no effect
-if the authentication module
-is the first in the stack,
-or if no previous modules
-obtained the user's password.
+If the authentication module is not the first in the stack, and a
+previous module obtained the user's password, that password is used to
+authenticate the user.
+If this fails, the authentication module returns failure without
+prompting the user for a password.
+This option has no effect if the authentication module is the first in
+the stack, or if no previous modules obtained the user's password.
 .It Cm try_first_pass
 This option is similar to the
 .Cm use_first_pass
-option,
-except that if the previously obtained password fails,
-the user is prompted for another password.
+option, except that if the previously obtained password fails, the
+user is prompted for another password.
 .It Cm auth_as_self
-This option will require the user
-to authenticate themselves as themselves,
-not as the account they are attempting to access.
+This option will require the user to authenticate themselves as
+themselves, not as the account they are attempting to access.
 This is primarily for services like
 .Xr su 1 ,
-where the user's ability to retype
-their own password
-might be deemed sufficient.
+where the user's ability to retype their own password might be deemed
+sufficient.
 .It Cm nullok
-If the password database
-has no password
-for the entity being authenticated,
-then this option
-will forgo password prompting,
-and silently allow authentication to succeed.
+If the password database has no password for the entity being
+authenticated, then this option will forgo password prompting, and
+silently allow authentication to succeed.
 .It Cm local_pass
-Use only the local password database,
-even if NIS is in use.
-This will cause an authentication failure
-if the system is configured
+Use only the local password database, even if NIS is in use.
+This will cause an authentication failure if the system is configured
 to only use NIS.
 .It Cm nis_pass
 Use only the NIS password database.
-This will cause an authentication failure
-if the system is not configured
-to use NIS.
+This will cause an authentication failure if the system is not
+configured to use NIS.
 .El
 .Ss Ux Ss Account Management Module
 The
 .Ux
-account management component
-provides a function to perform account management,
+account management component provides a function to perform account
+management,
 .Fn pam_sm_acct_mgmt .
-The function verifies
-that the authenticated user
-is allowed to log into the local user account
-by checking the following criteria:
+The function verifies that the authenticated user is allowed to log
+into the local user account by checking the following criteria:
 .Bl -dash -offset indent
 .It
 locked status of the account compatible with
@@ -166,8 +146,8 @@ level.
 .Ss Ux Ss Password Management Module
 The
 .Ux
-password management component
-provides a function to perform password management,
+password management component provides a function to perform password
+management,
 .Fn pam_sm_chauthtok .
 The function changes
 the user's password.
@@ -181,17 +161,14 @@ debugging information at
 level.
 .It Cm no_warn
 suppress warning messages to the user.
-These messages include
-reasons why the user's
-authentication attempt was declined.
+These messages include reasons why the user's authentication attempt
+was declined.
 .It Cm local_pass
-forces the password module
-to change a local password
-in favour of a NIS one.
+forces the password module to change a local password in favour of a
+NIS one.
 .It Cm nis_pass
-forces the password module
-to change a NIS password
-in favour of a local one.
+forces the password module to change a NIS password in favour of a
+local one.
 .El
 .Sh FILES
 .Bl -tag -width ".Pa /etc/master.passwd" -compact

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 14:16:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8D8F81065670;
	Sat, 20 Jun 2009 14:16:41 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A8EF8FC14;
	Sat, 20 Jun 2009 14:16:41 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KEGf4o078156;
	Sat, 20 Jun 2009 14:16:41 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KEGfUl078153;
	Sat, 20 Jun 2009 14:16:41 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200906201416.n5KEGfUl078153@svn.freebsd.org>
From: Alexander Kabaev 
Date: Sat, 20 Jun 2009 14:16: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: r194531 - 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: Sat, 20 Jun 2009 14:16:42 -0000

Author: kan
Date: Sat Jun 20 14:16:41 2009
New Revision: 194531
URL: http://svn.freebsd.org/changeset/base/194531

Log:
  Allow order of initialization of loaded shared objects to be
  altered through their .init code. This might happen if init
  vector calls dlopen on its own and that dlopen causes some not
  yet initialized object to be initialized earlier as part of that
  dlopened DAG.
  
  Do not reset module reference counts to zero on final fini vector
  run when process is exiting. Just add an additional parameter to
  force fini vector invocation regardless of current reference count
  value if object was not destructed yet. This allows dlclose called
  from fini vector to proceed normally instead of failing with handle
  validation error.
  
  Reviewed by:	kib
  Reported by:	venki kaps

Modified:
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld.h

Modified: head/libexec/rtld-elf/rtld.c
==============================================================================
--- head/libexec/rtld-elf/rtld.c	Sat Jun 20 12:02:56 2009	(r194530)
+++ head/libexec/rtld-elf/rtld.c	Sat Jun 20 14:16:41 2009	(r194531)
@@ -107,15 +107,14 @@ static int load_needed_objects(Obj_Entry
 static int load_preload_objects(void);
 static Obj_Entry *load_object(const char *, const Obj_Entry *);
 static Obj_Entry *obj_from_addr(const void *);
-static void objlist_call_fini(Objlist *, int *lockstate);
-static void objlist_call_init(Objlist *, int *lockstate);
+static void objlist_call_fini(Objlist *, bool, int *);
+static void objlist_call_init(Objlist *, int *);
 static void objlist_clear(Objlist *);
 static Objlist_Entry *objlist_find(Objlist *, const Obj_Entry *);
 static void objlist_init(Objlist *);
 static void objlist_push_head(Objlist *, Obj_Entry *);
 static void objlist_push_tail(Objlist *, Obj_Entry *);
 static void objlist_remove(Objlist *, Obj_Entry *);
-static void objlist_remove_unref(Objlist *);
 static void *path_enumerate(const char *, path_enum_proc, void *);
 static int relocate_objects(Obj_Entry *, bool, Obj_Entry *);
 static int rtld_dirname(const char *, char *);
@@ -136,9 +135,9 @@ static void unlink_object(Obj_Entry *);
 static void unload_object(Obj_Entry *);
 static void unref_dag(Obj_Entry *);
 static void ref_dag(Obj_Entry *);
-static int origin_subst_one(char **res, const char *real, const char *kw,
-  const char *subst, char *may_free);
-static char *origin_subst(const char *real, const char *origin_path);
+static int origin_subst_one(char **, const char *, const char *,
+  const char *, char *);
+static char *origin_subst(const char *, const char *);
 static int  rtld_verify_versions(const Objlist *);
 static int  rtld_verify_object_versions(Obj_Entry *);
 static void object_add_name(Obj_Entry *, const char *);
@@ -1379,9 +1378,9 @@ initlist_add_neededs(Needed_Entry *neede
 static void
 initlist_add_objects(Obj_Entry *obj, Obj_Entry **tail, Objlist *list)
 {
-    if (obj->init_done)
+    if (obj->init_scanned || obj->init_done)
 	return;
-    obj->init_done = true;
+    obj->init_scanned = true;
 
     /* Recursively process the successor objects. */
     if (&obj->next != tail)
@@ -1396,8 +1395,10 @@ initlist_add_objects(Obj_Entry *obj, Obj
 	objlist_push_tail(list, obj);
 
     /* Add the object to the global fini list in the reverse order. */
-    if (obj->fini != (Elf_Addr)NULL)
+    if (obj->fini != (Elf_Addr)NULL && !obj->on_fini_list) {
 	objlist_push_head(&list_fini, obj);
+	obj->on_fini_list = true;
+    }
 }
 
 #ifndef FPTR_TARGET
@@ -1600,9 +1601,9 @@ obj_from_addr(const void *addr)
  * non-NULL fini functions.
  */
 static void
-objlist_call_fini(Objlist *list, int *lockstate)
+objlist_call_fini(Objlist *list, bool force, int *lockstate)
 {
-    Objlist_Entry *elm;
+    Objlist_Entry *elm, *elm_tmp;
     char *saved_msg;
 
     /*
@@ -1610,17 +1611,22 @@ objlist_call_fini(Objlist *list, int *lo
      * call into the dynamic linker and overwrite it.
      */
     saved_msg = errmsg_save();
-    wlock_release(rtld_bind_lock, *lockstate);
-    STAILQ_FOREACH(elm, list, link) {
-	if (elm->obj->refcount == 0) {
+    STAILQ_FOREACH_SAFE(elm, list, link, elm_tmp) {
+	if (elm->obj->refcount == 0 || force) {
 	    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);
+	    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)
+	    	free(elm);
 	}
     }
-    *lockstate = wlock_acquire(rtld_bind_lock);
     errmsg_restore(saved_msg);
 }
 
@@ -1633,22 +1639,39 @@ static void
 objlist_call_init(Objlist *list, int *lockstate)
 {
     Objlist_Entry *elm;
+    Obj_Entry *obj;
     char *saved_msg;
 
     /*
+     * Clean init_scanned flag so that objects can be rechecked and
+     * possibly initialized earlier if any of vectors called below
+     * cause the change by using dlopen.
+     */
+    for (obj = obj_list;  obj != NULL;  obj = obj->next)
+	obj->init_scanned = false;
+
+    /*
      * Preserve the current error message since an init function might
      * call into the dynamic linker and overwrite it.
      */
     saved_msg = errmsg_save();
-    wlock_release(rtld_bind_lock, *lockstate);
     STAILQ_FOREACH(elm, list, link) {
+	if (elm->obj->init_done) /* Initialized early. */
+	    continue;
 	dbg("calling init function for %s at %p", elm->obj->path,
 	    (void *)elm->obj->init);
 	LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init, 0, 0,
 	    elm->obj->path);
+	/*
+	 * Race: other thread might try to use this object before current
+	 * one completes the initilization. Not much can be done here
+	 * without better locking.
+	 */
+	elm->obj->init_done = true;
+    	wlock_release(rtld_bind_lock, *lockstate);
 	call_initfini_pointer(elm->obj, elm->obj->init);
+	*lockstate = wlock_acquire(rtld_bind_lock);
     }
-    *lockstate = wlock_acquire(rtld_bind_lock);
     errmsg_restore(saved_msg);
 }
 
@@ -1713,27 +1736,6 @@ objlist_remove(Objlist *list, Obj_Entry 
 }
 
 /*
- * Remove all of the unreferenced objects from "list".
- */
-static void
-objlist_remove_unref(Objlist *list)
-{
-    Objlist newlist;
-    Objlist_Entry *elm;
-
-    STAILQ_INIT(&newlist);
-    while (!STAILQ_EMPTY(list)) {
-	elm = STAILQ_FIRST(list);
-	STAILQ_REMOVE_HEAD(list, link);
-	if (elm->obj->refcount == 0)
-	    free(elm);
-	else
-	    STAILQ_INSERT_TAIL(&newlist, elm, link);
-    }
-    *list = newlist;
-}
-
-/*
  * Relocate newly-loaded shared objects.  The argument is a pointer to
  * the Obj_Entry for the first such object.  All objects from the first
  * to the end of the list of objects are relocated.  Returns 0 on success,
@@ -1808,15 +1810,11 @@ relocate_objects(Obj_Entry *first, bool 
 static void
 rtld_exit(void)
 {
-    Obj_Entry *obj;
     int	lockstate;
 
     lockstate = wlock_acquire(rtld_bind_lock);
     dbg("rtld_exit()");
-    /* Clear all the reference counts so the fini functions will be called. */
-    for (obj = obj_list;  obj != NULL;  obj = obj->next)
-	obj->refcount = 0;
-    objlist_call_fini(&list_fini, &lockstate);
+    objlist_call_fini(&list_fini, true, &lockstate);
     /* No need to remove the items from the list, since we are exiting. */
     if (!libmap_disable)
         lm_fini();
@@ -1936,8 +1934,7 @@ dlclose(void *handle)
 	 * The object is no longer referenced, so we must unload it.
 	 * First, call the fini functions.
 	 */
-	objlist_call_fini(&list_fini, &lockstate);
-	objlist_remove_unref(&list_fini);
+	objlist_call_fini(&list_fini, false, &lockstate);
 
 	/* Finish cleaning up the newly-unreferenced objects. */
 	GDB_STATE(RT_DELETE,&root->linkmap);
@@ -2132,7 +2129,7 @@ do_dlsym(void *handle, const char *name,
 			       &donelist);
 
 	    /*
-	     * We do not distinguish between 'main' object an global scope.
+	     * We do not distinguish between 'main' object and global scope.
 	     * If symbol is not defined by objects loaded at startup, continue
 	     * search among dynamically loaded objects with RTLD_GLOBAL
 	     * scope.

Modified: head/libexec/rtld-elf/rtld.h
==============================================================================
--- head/libexec/rtld-elf/rtld.h	Sat Jun 20 12:02:56 2009	(r194530)
+++ head/libexec/rtld-elf/rtld.h	Sat Jun 20 14:16:41 2009	(r194531)
@@ -218,9 +218,11 @@ typedef struct Struct_Obj_Entry {
     bool phdr_alloc : 1;	/* Phdr is allocated and needs to be freed. */
     bool z_origin : 1;		/* Process rpath and soname tokens */
     bool z_nodelete : 1;	/* Do not unload the object and dependencies */
-    bool ref_nodel : 1;		/* refcount increased to prevent dlclose */
+    bool ref_nodel : 1;		/* Refcount increased to prevent dlclose */
+    bool init_scanned: 1;	/* Object is already on init list. */
+    bool on_fini_list: 1;	/* Object is already on fini list. */
 
-    struct link_map linkmap;	/* for GDB and dlinfo() */
+    struct link_map linkmap;	/* For GDB and dlinfo() */
     Objlist dldags;		/* Object belongs to these dlopened DAGs (%) */
     Objlist dagmembers;		/* DAG has these members (%) */
     dev_t dev;			/* Object's filesystem's device */

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 14:50:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9719A1065674;
	Sat, 20 Jun 2009 14:50:32 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 84BA98FC1A;
	Sat, 20 Jun 2009 14:50:32 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KEoW8j078823;
	Sat, 20 Jun 2009 14:50:32 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KEoWfi078819;
	Sat, 20 Jun 2009 14:50:32 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906201450.n5KEoWfi078819@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 20 Jun 2009 14:50: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: r194532 - in head/sys: fs/devfs kern sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 14:50:33 -0000

Author: ed
Date: Sat Jun 20 14:50:32 2009
New Revision: 194532
URL: http://svn.freebsd.org/changeset/base/194532

Log:
  Improve nested jail awareness of devfs by handling credentials.
  
  Now that we start to use credentials on character devices more often
  (because of MPSAFE TTY), move the prison-checks that are in place in the
  TTY code into devfs.
  
  Instead of strictly comparing the prisons, use the more common
  prison_check() function to compare credentials. This means that
  pseudo-terminals are only visible in devfs by processes within the same
  jail and parent jails.
  
  Even though regular users in parent jails can now interact with
  pseudo-terminals from child jails, this seems to be the right approach.
  These processes are also capable of interacting with the jailed
  processes anyway, through signals for example.
  
  Reviewed by:	kib, rwatson (older version)

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/kern/tty.c
  head/sys/sys/priv.h

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Sat Jun 20 14:16:41 2009	(r194531)
+++ head/sys/fs/devfs/devfs_vnops.c	Sat Jun 20 14:50:32 2009	(r194532)
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -706,6 +707,22 @@ devfs_kqfilter_f(struct file *fp, struct
 	return (error);
 }
 
+static inline int
+devfs_prison_check(struct devfs_dirent *de, struct ucred *tcr)
+{
+	struct cdev_priv *cdp;
+	struct ucred *dcr;
+
+	cdp = de->de_cdp;
+	if (cdp == NULL)
+		return (0);
+	dcr = cdp->cdp_c.si_cred;
+	if (dcr == NULL)
+		return (0);
+
+	return (prison_check(tcr, dcr));
+}
+
 static int
 devfs_lookupx(struct vop_lookup_args *ap, int *dm_unlock)
 {
@@ -831,6 +848,9 @@ devfs_lookupx(struct vop_lookup_args *ap
 		return (ENOENT);
 	}
 
+	if (devfs_prison_check(de, td->td_ucred))
+		return (ENOENT);
+
 	if ((cnp->cn_nameiop == DELETE) && (flags & ISLASTCN)) {
 		error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, td);
 		if (error)
@@ -1106,6 +1126,8 @@ devfs_readdir(struct vop_readdir_args *a
 		KASSERT(dd->de_cdp != (void *)0xdeadc0de, ("%s %d\n", __func__, __LINE__));
 		if (dd->de_flags & DE_WHITEOUT)
 			continue;
+		if (devfs_prison_check(dd, ap->a_cred))
+			continue;
 		if (dd->de_dirent->d_type == DT_DIR)
 			de = dd->de_dir;
 		else

Modified: head/sys/kern/tty.c
==============================================================================
--- head/sys/kern/tty.c	Sat Jun 20 14:16:41 2009	(r194531)
+++ head/sys/kern/tty.c	Sat Jun 20 14:50:32 2009	(r194532)
@@ -219,13 +219,6 @@ ttydev_open(struct cdev *dev, int oflags
 	struct tty *tp = dev->si_drv1;
 	int error = 0;
 
-	/* Disallow access when the TTY belongs to a different prison. */
-	if (dev->si_cred != NULL &&
-	    dev->si_cred->cr_prison != td->td_ucred->cr_prison &&
-	    priv_check(td, PRIV_TTY_PRISON)) {
-		return (EPERM);
-	}
-
 	tty_lock(tp);
 	if (tty_gone(tp)) {
 		/* Device is already gone. */

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Sat Jun 20 14:16:41 2009	(r194531)
+++ head/sys/sys/priv.h	Sat Jun 20 14:50:32 2009	(r194532)
@@ -211,7 +211,6 @@
 #define	PRIV_TTY_DRAINWAIT	251	/* Set tty drain wait time. */
 #define	PRIV_TTY_DTRWAIT	252	/* Set DTR wait on tty. */
 #define	PRIV_TTY_EXCLUSIVE	253	/* Override tty exclusive flag. */
-#define	PRIV_TTY_PRISON		254	/* Can open pts across jails. */
 #define	PRIV_TTY_STI		255	/* Simulate input on another tty. */
 #define	PRIV_TTY_SETA		256	/* Set tty termios structure. */
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 15:54:36 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 58FB11065675;
	Sat, 20 Jun 2009 15:54:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 466D28FC3E;
	Sat, 20 Jun 2009 15:54:36 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KFsaMa080047;
	Sat, 20 Jun 2009 15:54:36 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KFsab0080044;
	Sat, 20 Jun 2009 15:54:36 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906201554.n5KFsab0080044@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 20 Jun 2009 15:54:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194534 - in head/sys/security: mac_biba mac_lomac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 15:54:36 -0000

Author: ed
Date: Sat Jun 20 15:54:35 2009
New Revision: 194534
URL: http://svn.freebsd.org/changeset/base/194534

Log:
  Chase the removal of PRIV_TTY_PRISON in the mac(9) modules.
  
  Reported by:	kib
  Pointy hat to:	me

Modified:
  head/sys/security/mac_biba/mac_biba.c
  head/sys/security/mac_lomac/mac_lomac.c

Modified: head/sys/security/mac_biba/mac_biba.c
==============================================================================
--- head/sys/security/mac_biba/mac_biba.c	Sat Jun 20 15:51:26 2009	(r194533)
+++ head/sys/security/mac_biba/mac_biba.c	Sat Jun 20 15:54:35 2009	(r194534)
@@ -1789,7 +1789,6 @@ biba_priv_check(struct ucred *cred, int 
 	case PRIV_TTY_DRAINWAIT:
 	case PRIV_TTY_DTRWAIT:
 	case PRIV_TTY_EXCLUSIVE:
-	case PRIV_TTY_PRISON:
 	case PRIV_TTY_STI:
 	case PRIV_TTY_SETA:
 

Modified: head/sys/security/mac_lomac/mac_lomac.c
==============================================================================
--- head/sys/security/mac_lomac/mac_lomac.c	Sat Jun 20 15:51:26 2009	(r194533)
+++ head/sys/security/mac_lomac/mac_lomac.c	Sat Jun 20 15:54:35 2009	(r194534)
@@ -1781,7 +1781,6 @@ lomac_priv_check(struct ucred *cred, int
 	case PRIV_TTY_DRAINWAIT:
 	case PRIV_TTY_DTRWAIT:
 	case PRIV_TTY_EXCLUSIVE:
-	case PRIV_TTY_PRISON:
 	case PRIV_TTY_STI:
 	case PRIV_TTY_SETA:
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 16:30:32 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7A0F310656BE;
	Sat, 20 Jun 2009 16:30:32 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 652E08FC17;
	Sat, 20 Jun 2009 16:30:32 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KGUWrF080827;
	Sat, 20 Jun 2009 16:30:32 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KGUWK7080825;
	Sat, 20 Jun 2009 16:30:32 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906201630.n5KGUWK7080825@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 20 Jun 2009 16:30: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: r194536 - head/share/man/man4
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 16:30:33 -0000

Author: ed
Date: Sat Jun 20 16:30:32 2009
New Revision: 194536
URL: http://svn.freebsd.org/changeset/base/194536

Log:
  Improve sentence and add reference to openpty(3). Add missing newlines.

Modified:
  head/share/man/man4/pts.4

Modified: head/share/man/man4/pts.4
==============================================================================
--- head/share/man/man4/pts.4	Sat Jun 20 15:58:23 2009	(r194535)
+++ head/share/man/man4/pts.4	Sat Jun 20 16:30:32 2009	(r194536)
@@ -148,11 +148,14 @@ pseudo-terminals implementation are:
 .Pp
 .Bl -tag -width ".Pa /dev/pts/[num]"
 .It Pa /dev/ptmx
-Control device, returns a file descriptor to a new master pseudo-terminal
-when opened. This device should not be opened directly. It's only
-available for binary compatibility. New devices should only be created
-though
-.Xr posix_openpt 2 .
+Control device, returns a file descriptor to a new master
+pseudo-terminal when opened.
+This device should not be opened directly.
+It's only available for binary compatibility.
+New devices should only be allocated with
+.Xr posix_openpt 2
+and
+.Xr openpty 3 .
 .It Pa /dev/pts/[num]
 Pseudo-terminal slave devices.
 .El

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 16:37:25 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 015E3106564A;
	Sat, 20 Jun 2009 16:37:25 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E3BC78FC16;
	Sat, 20 Jun 2009 16:37:24 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KGbOWH080980;
	Sat, 20 Jun 2009 16:37:24 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KGbOh2080978;
	Sat, 20 Jun 2009 16:37:24 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200906201637.n5KGbOh2080978@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 20 Jun 2009 16:37: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: r194537 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 16:37:25 -0000

Author: rnoland
Date: Sat Jun 20 16:37:24 2009
New Revision: 194537
URL: http://svn.freebsd.org/changeset/base/194537

Log:
  Don't panic if drm_rmmap is called with a NULL map pointer.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_bufs.c

Modified: head/sys/dev/drm/drm_bufs.c
==============================================================================
--- head/sys/dev/drm/drm_bufs.c	Sat Jun 20 16:30:32 2009	(r194536)
+++ head/sys/dev/drm/drm_bufs.c	Sat Jun 20 16:37:24 2009	(r194537)
@@ -296,6 +296,9 @@ void drm_rmmap(struct drm_device *dev, d
 {
 	DRM_SPINLOCK_ASSERT(&dev->dev_lock);
 
+	if (map == NULL)
+		return;
+
 	TAILQ_REMOVE(&dev->maplist, map, link);
 
 	switch (map->type) {

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 16:39:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 27BC81065672;
	Sat, 20 Jun 2009 16:39:26 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 163ED8FC0C;
	Sat, 20 Jun 2009 16:39:26 +0000 (UTC) (envelope-from ed@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KGdP2p081116;
	Sat, 20 Jun 2009 16:39:25 GMT (envelope-from ed@svn.freebsd.org)
Received: (from ed@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KGdPhO081114;
	Sat, 20 Jun 2009 16:39:25 GMT (envelope-from ed@svn.freebsd.org)
Message-Id: <200906201639.n5KGdPhO081114@svn.freebsd.org>
From: Ed Schouten 
Date: Sat, 20 Jun 2009 16:39: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: r194538 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 16:39:26 -0000

Author: ed
Date: Sat Jun 20 16:39:25 2009
New Revision: 194538
URL: http://svn.freebsd.org/changeset/base/194538

Log:
  Add placeholder to prevent reuse of privilege 254.
  
  Requested by:	rwatson

Modified:
  head/sys/sys/priv.h

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Sat Jun 20 16:37:24 2009	(r194537)
+++ head/sys/sys/priv.h	Sat Jun 20 16:39:25 2009	(r194538)
@@ -211,6 +211,7 @@
 #define	PRIV_TTY_DRAINWAIT	251	/* Set tty drain wait time. */
 #define	PRIV_TTY_DTRWAIT	252	/* Set DTR wait on tty. */
 #define	PRIV_TTY_EXCLUSIVE	253	/* Override tty exclusive flag. */
+#define	_PRIV_TTY_PRISON	254	/* Removed. */
 #define	PRIV_TTY_STI		255	/* Simulate input on another tty. */
 #define	PRIV_TTY_SETA		256	/* Set tty termios structure. */
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 16:40:48 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B4CC1065670;
	Sat, 20 Jun 2009 16:40:48 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5F1698FC17;
	Sat, 20 Jun 2009 16:40:48 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KGemk0081184;
	Sat, 20 Jun 2009 16:40:48 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KGemmF081182;
	Sat, 20 Jun 2009 16:40:48 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200906201640.n5KGemmF081182@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 20 Jun 2009 16:40:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194539 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 16:40:49 -0000

Author: rnoland
Date: Sat Jun 20 16:40:48 2009
New Revision: 194539
URL: http://svn.freebsd.org/changeset/base/194539

Log:
  realloc() behaves identically to malloc when passed a NULL object pointer
  
  If an error does occur we would have left max_context with an incorrect
  value.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_context.c

Modified: head/sys/dev/drm/drm_context.c
==============================================================================
--- head/sys/dev/drm/drm_context.c	Sat Jun 20 16:39:25 2009	(r194538)
+++ head/sys/dev/drm/drm_context.c	Sat Jun 20 16:40:48 2009	(r194539)
@@ -72,34 +72,23 @@ int drm_ctxbitmap_next(struct drm_device
 	}
 
 	set_bit(bit, dev->ctx_bitmap);
-	DRM_DEBUG("drm_ctxbitmap_next bit : %d\n", bit);
+	DRM_DEBUG("bit : %d\n", bit);
 	if ((bit+1) > dev->max_context) {
-		dev->max_context = (bit+1);
-		if (dev->context_sareas != NULL) {
-			drm_local_map_t **ctx_sareas;
-
-			ctx_sareas = realloc(dev->context_sareas,
-			    dev->max_context * sizeof(*dev->context_sareas),
-			    DRM_MEM_SAREA, M_NOWAIT);
-			if (ctx_sareas == NULL) {
-				clear_bit(bit, dev->ctx_bitmap);
-				DRM_UNLOCK();
-				return -1;
-			}
-			dev->context_sareas = ctx_sareas;
-			dev->context_sareas[bit] = NULL;
-		} else {
-			/* max_context == 1 at this point */
-			dev->context_sareas = malloc(dev->max_context * 
-			    sizeof(*dev->context_sareas), DRM_MEM_SAREA,
-			    M_NOWAIT);
-			if (dev->context_sareas == NULL) {
-				clear_bit(bit, dev->ctx_bitmap);
-				DRM_UNLOCK();
-				return -1;
-			}
-			dev->context_sareas[bit] = NULL;
+		drm_local_map_t **ctx_sareas;
+		int max_ctx = (bit+1);
+
+		ctx_sareas = realloc(dev->context_sareas,
+		    max_ctx * sizeof(*dev->context_sareas),
+		    DRM_MEM_SAREA, M_NOWAIT);
+		if (ctx_sareas == NULL) {
+			clear_bit(bit, dev->ctx_bitmap);
+			DRM_DEBUG("failed to allocate bit : %d\n", bit);
+			DRM_UNLOCK();
+			return -1;
 		}
+		dev->max_context = max_ctx;
+		dev->context_sareas = ctx_sareas;
+		dev->context_sareas[bit] = NULL;
 	}
 	DRM_UNLOCK();
 	return bit;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 16:45:14 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B9AAE106564A;
	Sat, 20 Jun 2009 16:45:14 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9E1D88FC24;
	Sat, 20 Jun 2009 16:45:14 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KGjES9081305;
	Sat, 20 Jun 2009 16:45:14 GMT (envelope-from rnoland@svn.freebsd.org)
Received: (from rnoland@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KGjEeG081301;
	Sat, 20 Jun 2009 16:45:14 GMT (envelope-from rnoland@svn.freebsd.org)
Message-Id: <200906201645.n5KGjEeG081301@svn.freebsd.org>
From: Robert Noland 
Date: Sat, 20 Jun 2009 16:45:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 16:45:15 -0000

Author: rnoland
Date: Sat Jun 20 16:45:14 2009
New Revision: 194540
URL: http://svn.freebsd.org/changeset/base/194540

Log:
  The G45 docs indicate that all G4X chips use the new framecount register.
  
  Intel agrees with my reading of the docs, make it so for all G4X chips.
  
  The new register also has a 32 bit width as opposed to 24 bits.  Fix
  things up so that the counters roll over properly.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/i915_dma.c
  head/sys/dev/drm/i915_drv.h
  head/sys/dev/drm/i915_irq.c

Modified: head/sys/dev/drm/i915_dma.c
==============================================================================
--- head/sys/dev/drm/i915_dma.c	Sat Jun 20 16:40:48 2009	(r194539)
+++ head/sys/dev/drm/i915_dma.c	Sat Jun 20 16:45:14 2009	(r194540)
@@ -871,10 +871,13 @@ int i915_driver_load(struct drm_device *
 	ret = drm_addmap(dev, base, size, _DRM_REGISTERS,
 	    _DRM_KERNEL | _DRM_DRIVER, &dev_priv->mmio_map);
 
-	if (IS_GM45(dev))
-		dev->driver->get_vblank_counter = gm45_get_vblank_counter;
-	else
+	if (IS_G4X(dev)) {
+		dev->driver->get_vblank_counter = g45_get_vblank_counter;
+		dev->max_vblank_count = 0xffffffff; /* 32 bits of frame count */
+	} else {
 		dev->driver->get_vblank_counter = i915_get_vblank_counter;
+		dev->max_vblank_count = 0x00ffffff; /* 24 bits of frame count */
+	}
 
 #ifdef I915_HAVE_GEM
 	i915_gem_load(dev);

Modified: head/sys/dev/drm/i915_drv.h
==============================================================================
--- head/sys/dev/drm/i915_drv.h	Sat Jun 20 16:40:48 2009	(r194539)
+++ head/sys/dev/drm/i915_drv.h	Sat Jun 20 16:45:14 2009	(r194540)
@@ -453,7 +453,7 @@ extern int i915_vblank_pipe_get(struct d
 extern int i915_enable_vblank(struct drm_device *dev, int crtc);
 extern void i915_disable_vblank(struct drm_device *dev, int crtc);
 extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
-extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc);
+extern u32 g45_get_vblank_counter(struct drm_device *dev, int crtc);
 extern int i915_vblank_swap(struct drm_device *dev, void *data,
 			    struct drm_file *file_priv);
 

Modified: head/sys/dev/drm/i915_irq.c
==============================================================================
--- head/sys/dev/drm/i915_irq.c	Sat Jun 20 16:40:48 2009	(r194539)
+++ head/sys/dev/drm/i915_irq.c	Sat Jun 20 16:45:14 2009	(r194540)
@@ -177,7 +177,7 @@ u32 i915_get_vblank_counter(struct drm_d
 	return count;
 }
 
-u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
+u32 g45_get_vblank_counter(struct drm_device *dev, int pipe)
 {
 	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
 	int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45;
@@ -516,8 +516,6 @@ int i915_driver_irq_postinstall(struct d
 
 	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
 
-	dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
-
 	/* Unmask the interrupts that we always want on. */
 	dev_priv->irq_mask_reg = ~I915_INTERRUPT_ENABLE_FIX;
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:11:08 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C45C5106564A;
	Sat, 20 Jun 2009 17:11:07 +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 B20268FC0C;
	Sat, 20 Jun 2009 17:11:07 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KHB7MG081830;
	Sat, 20 Jun 2009 17:11:07 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KHB71u081828;
	Sat, 20 Jun 2009 17:11:07 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906201711.n5KHB71u081828@svn.freebsd.org>
From: Rick Macklem 
Date: Sat, 20 Jun 2009 17:11: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: r194541 - in head/sys/fs: nfs nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:11:09 -0000

Author: rmacklem
Date: Sat Jun 20 17:11:07 2009
New Revision: 194541
URL: http://svn.freebsd.org/changeset/base/194541

Log:
  Replace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build.
  
  Approved by:	kib (mentor)

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfs/nfs.h
==============================================================================
--- head/sys/fs/nfs/nfs.h	Sat Jun 20 16:45:14 2009	(r194540)
+++ head/sys/fs/nfs/nfs.h	Sat Jun 20 17:11:07 2009	(r194541)
@@ -405,12 +405,12 @@ typedef struct {
 
 /*
  * Store uid, gid creds that were used when the stateid was acquired.
- * The RPC layer allows RPCAUTH_UNIXGIDS + 1 groups to go out on the wire,
+ * The RPC layer allows NFS_MAXGRPS + 1 groups to go out on the wire,
  * so that's how many gets stored here.
  */
 struct nfscred {
 	uid_t 		nfsc_uid;
-	gid_t		nfsc_groups[RPCAUTH_UNIXGIDS + 1];
+	gid_t		nfsc_groups[NFS_MAXGRPS + 1];
 	int		nfsc_ngroups;
 };
 

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Sat Jun 20 16:45:14 2009	(r194540)
+++ head/sys/fs/nfsclient/nfs_clport.c	Sat Jun 20 17:11:07 2009	(r194541)
@@ -979,7 +979,7 @@ newnfs_copyincred(struct ucred *cr, stru
 	int i;
 
 	nfscr->nfsc_uid = cr->cr_uid;
-	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, RPCAUTH_UNIXGIDS + 1);
+	nfscr->nfsc_ngroups = MIN(cr->cr_ngroups, NFS_MAXGRPS + 1);
 	for (i = 0; i < nfscr->nfsc_ngroups; i++)
 		nfscr->nfsc_groups[i] = cr->cr_groups[i];
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:15:53 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE319106566C;
	Sat, 20 Jun 2009 17:15:53 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from mail.netplex.net (mail.netplex.net [204.213.176.10])
	by mx1.freebsd.org (Postfix) with ESMTP id 784308FC17;
	Sat, 20 Jun 2009 17:15:53 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11])
	by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id
	n5KGueU7029065; Sat, 20 Jun 2009 12:56:40 -0400 (EDT)
X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net)
X-Greylist: Message whitelisted by DRAC access database, not delayed by
	milter-greylist-4.0 (mail.netplex.net [204.213.176.10]);
	Sat, 20 Jun 2009 12:56:40 -0400 (EDT)
Date: Sat, 20 Jun 2009 12:56:40 -0400 (EDT)
From: Daniel Eischen 
X-X-Sender: eischen@sea.ntplx.net
To: Robert Noland 
In-Reply-To: <200906201645.n5KGjEeG081301@svn.freebsd.org>
Message-ID: 
References: <200906201645.n5KGjEeG081301@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: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Daniel Eischen 
List-Id: 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, 20 Jun 2009 17:15:54 -0000

On Sat, 20 Jun 2009, Robert Noland wrote:

> Author: rnoland
> Date: Sat Jun 20 16:45:14 2009
> New Revision: 194540
> URL: http://svn.freebsd.org/changeset/base/194540
>
> Log:
>  The G45 docs indicate that all G4X chips use the new framecount register.
>
>  Intel agrees with my reading of the docs, make it so for all G4X chips.
>
>  The new register also has a 32 bit width as opposed to 24 bits.  Fix
>  things up so that the counters roll over properly.

Could this possibly fix the problem I'm seeing with the screen being
garbage after a logout from KDE 3.x (using kdm)?  Everything works
fine after logging in, but when you log out, the screen is left with
garbage/lots of vertical striping.  This only happened after upgrading
my system (and all ports) to Xorg 7.4, worked just fine before that.

agp0:  on vgapci0
agp0: detected 7932k stolen memory
agp0: aperture size is 256M
vgapci1:  mem 0xdff80000-0xdfffffff at device  2.1 on pci0

-- 
DE

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:16:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 625831065673;
	Sat, 20 Jun 2009 17:16:29 +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 4FFE38FC18;
	Sat, 20 Jun 2009 17:16:29 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KHGTCD081958;
	Sat, 20 Jun 2009 17:16:29 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KHGTKh081956;
	Sat, 20 Jun 2009 17:16:29 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <200906201716.n5KHGTKh081956@svn.freebsd.org>
From: Rick Macklem 
Date: Sat, 20 Jun 2009 17:16: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: r194542 - head/sys/rpc/rpcsec_gss
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:16:30 -0000

Author: rmacklem
Date: Sat Jun 20 17:16:29 2009
New Revision: 194542
URL: http://svn.freebsd.org/changeset/base/194542

Log:
  Delete the declaration of an unused variable so that it will build.
  
  Approved by:	rwatson (mentor)

Modified:
  head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c

Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Sat Jun 20 17:11:07 2009	(r194541)
+++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c	Sat Jun 20 17:16:29 2009	(r194542)
@@ -429,7 +429,6 @@ rpc_gss_svc_getcred(struct svc_req *req,
 	struct svc_rpc_gss_cookedcred *cc;
 	struct svc_rpc_gss_client *client;
 	rpc_gss_ucred_t *uc;
-	int i;
 
 	if (req->rq_cred.oa_flavor != RPCSEC_GSS)
 		return (FALSE);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:28:38 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0E5A106566C;
	Sat, 20 Jun 2009 17:28: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 9F0548FC16;
	Sat, 20 Jun 2009 17:28:38 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KHSc9W082208;
	Sat, 20 Jun 2009 17:28:38 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KHSchr082206;
	Sat, 20 Jun 2009 17:28:38 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201728.n5KHSchr082206@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 17:28:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194543 - head/sys/netatalk
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:28:39 -0000

Author: rwatson
Date: Sat Jun 20 17:28:38 2009
New Revision: 194543
URL: http://svn.freebsd.org/changeset/base/194543

Log:
  Don't lock sockets around calls to mac_socket_create_mbuf() -- policies
  are now expected to acquire the socket lock if they require them.
  
  Obtained from:	TrustedBSD Project

Modified:
  head/sys/netatalk/ddp_output.c

Modified: head/sys/netatalk/ddp_output.c
==============================================================================
--- head/sys/netatalk/ddp_output.c	Sat Jun 20 17:16:29 2009	(r194542)
+++ head/sys/netatalk/ddp_output.c	Sat Jun 20 17:28:38 2009	(r194543)
@@ -51,9 +51,7 @@ ddp_output(struct mbuf *m, struct socket
 	struct ddpcb *ddp = sotoddpcb(so);
 
 #ifdef MAC
-	SOCK_LOCK(so);
 	mac_socket_create_mbuf(so, m);
-	SOCK_UNLOCK(so);
 #endif
 
 	M_PREPEND(m, sizeof(struct ddpehdr), M_DONTWAIT);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:40:00 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 205541065673;
	Sat, 20 Jun 2009 17:40:00 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id 77BB48FC40;
	Sat, 20 Jun 2009 17:39:58 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua
	[212.40.38.100])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA18797;
	Sat, 20 Jun 2009 20:39:56 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1] helo=edge.pp.kiev.ua)
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1MI4Xk-000P6S-1g; Sat, 20 Jun 2009 20:39:56 +0300
Message-ID: <4A3D1EEA.9060005@freebsd.org>
Date: Sat, 20 Jun 2009 20:39:54 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.21 (X11/20090406)
MIME-Version: 1.0
To: Daniel Eischen 
References: <200906201645.n5KGjEeG081301@svn.freebsd.org>
	
In-Reply-To: 
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Robert Noland 
Subject: Re: svn commit: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:40:00 -0000

on 20/06/2009 19:56 Daniel Eischen said the following:
> On Sat, 20 Jun 2009, Robert Noland wrote:
> 
>> Author: rnoland
>> Date: Sat Jun 20 16:45:14 2009
>> New Revision: 194540
>> URL: http://svn.freebsd.org/changeset/base/194540
>>
>> Log:
>>  The G45 docs indicate that all G4X chips use the new framecount
>> register.
>>
>>  Intel agrees with my reading of the docs, make it so for all G4X chips.
>>
>>  The new register also has a 32 bit width as opposed to 24 bits.  Fix
>>  things up so that the counters roll over properly.
> 
> Could this possibly fix the problem I'm seeing with the screen being
> garbage after a logout from KDE 3.x (using kdm)?  Everything works
> fine after logging in, but when you log out, the screen is left with
> garbage/lots of vertical striping.  This only happened after upgrading
> my system (and all ports) to Xorg 7.4, worked just fine before that.
> 
> agp0:  on vgapci0
> agp0: detected 7932k stolen memory
> agp0: aperture size is 256M
> vgapci1:  mem 0xdff80000-0xdfffffff at device 
> 2.1 on pci0

I had similar symptoms. In my case this was cause X server crashing?
Do you see the same. If yes, there might be a recipe for cure.


-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:42:54 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86BBE106566C;
	Sat, 20 Jun 2009 17:42:54 +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 74C268FC19;
	Sat, 20 Jun 2009 17:42:54 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KHgsCO082501;
	Sat, 20 Jun 2009 17:42:54 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KHgs7H082499;
	Sat, 20 Jun 2009 17:42:54 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201742.n5KHgs7H082499@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 17:42:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194544 - head/sys/netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:42:55 -0000

Author: rwatson
Date: Sat Jun 20 17:42:53 2009
New Revision: 194544
URL: http://svn.freebsd.org/changeset/base/194544

Log:
  Invoke the MAC Framework's mac_socket_create_mbuf() entry point when
  generating IPX output for raw and datagram IPX sockets.
  
  Obtained from:	TrustedBSD Project

Modified:
  head/sys/netipx/ipx_usrreq.c

Modified: head/sys/netipx/ipx_usrreq.c
==============================================================================
--- head/sys/netipx/ipx_usrreq.c	Sat Jun 20 17:28:38 2009	(r194543)
+++ head/sys/netipx/ipx_usrreq.c	Sat Jun 20 17:42:53 2009	(r194544)
@@ -90,6 +90,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 /*
  * IPX protocol implementation.
  */
@@ -577,6 +579,9 @@ ipx_send(struct socket *so, int flags, s
 	 * used by ipx_pcbconnect() and ipx_pcbdisconnect(), just the IPX
 	 * pcb lock.
 	 */
+#ifdef MAC
+	mac_socket_create_mbuf(so, m);
+#endif
 	if (nam != NULL) {
 		IPX_LIST_LOCK();
 		IPX_LOCK(ipxp);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:44:04 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 609FC1065670;
	Sat, 20 Jun 2009 17:44:04 +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 4EE618FC1C;
	Sat, 20 Jun 2009 17:44:04 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KHi4vh082574;
	Sat, 20 Jun 2009 17:44:04 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KHi4ft082572;
	Sat, 20 Jun 2009 17:44:04 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201744.n5KHi4ft082572@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 17:44: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: r194545 - head/sys/netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:44:04 -0000

Author: rwatson
Date: Sat Jun 20 17:44:04 2009
New Revision: 194545
URL: http://svn.freebsd.org/changeset/base/194545

Log:
  Invoke the MAC Framework's mac_socket_create_mbuf() entry point when
  generating IPX output for SPX sockets.
  
  Obtained from:	TrustedBSD Project

Modified:
  head/sys/netipx/spx_usrreq.c

Modified: head/sys/netipx/spx_usrreq.c
==============================================================================
--- head/sys/netipx/spx_usrreq.c	Sat Jun 20 17:42:53 2009	(r194544)
+++ head/sys/netipx/spx_usrreq.c	Sat Jun 20 17:44:04 2009	(r194545)
@@ -89,6 +89,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 /*
  * SPX protocol implementation.
  */
@@ -813,6 +815,10 @@ send:
 	if (so->so_options & SO_DEBUG || traceallspxs)
 		spx_trace(SA_OUTPUT, cb->s_state, cb, si, 0);
 
+#ifdef MAC
+	mac_socket_create_mbuf(so, m);
+#endif
+
 	if (so->so_options & SO_DONTROUTE)
 		error = ipx_outputfl(m, NULL, IPX_ROUTETOIF);
 	else

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 17:56:17 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84C6B1065676;
	Sat, 20 Jun 2009 17:56:17 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140])
	by mx1.freebsd.org (Postfix) with ESMTP id E53418FC0C;
	Sat, 20 Jun 2009 17:56:15 +0000 (UTC) (envelope-from avg@freebsd.org)
Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua
	[212.40.38.100])
	by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA18892;
	Sat, 20 Jun 2009 20:56:14 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1] helo=edge.pp.kiev.ua)
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1MI4nW-000P7h-6N; Sat, 20 Jun 2009 20:56:14 +0300
Message-ID: <4A3D22BD.1040200@freebsd.org>
Date: Sat, 20 Jun 2009 20:56:13 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.21 (X11/20090406)
MIME-Version: 1.0
To: Daniel Eischen 
References: <200906201645.n5KGjEeG081301@svn.freebsd.org>
	
	<4A3D1EEA.9060005@freebsd.org>
In-Reply-To: <4A3D1EEA.9060005@freebsd.org>
X-Enigmail-Version: 0.95.7
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Robert Noland 
Subject: Re: svn commit: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 17:56:18 -0000

on 20/06/2009 20:39 Andriy Gapon said the following:
> on 20/06/2009 19:56 Daniel Eischen said the following:
>> On Sat, 20 Jun 2009, Robert Noland wrote:
>>
>>> Author: rnoland
>>> Date: Sat Jun 20 16:45:14 2009
>>> New Revision: 194540
>>> URL: http://svn.freebsd.org/changeset/base/194540
>>>
>>> Log:
>>>  The G45 docs indicate that all G4X chips use the new framecount
>>> register.
>>>
>>>  Intel agrees with my reading of the docs, make it so for all G4X chips.
>>>
>>>  The new register also has a 32 bit width as opposed to 24 bits.  Fix
>>>  things up so that the counters roll over properly.
>> Could this possibly fix the problem I'm seeing with the screen being
>> garbage after a logout from KDE 3.x (using kdm)?  Everything works
>> fine after logging in, but when you log out, the screen is left with
>> garbage/lots of vertical striping.  This only happened after upgrading
>> my system (and all ports) to Xorg 7.4, worked just fine before that.
>>
>> agp0:  on vgapci0
>> agp0: detected 7932k stolen memory
>> agp0: aperture size is 256M
>> vgapci1:  mem 0xdff80000-0xdfffffff at device 
>> 2.1 on pci0
> 
> I had similar symptoms. In my case this was cause X server crashing?
                                              ^^^^^^^ - "caused by"
> Do you see the same. If yes, there might be a recipe for cure.
                    ^^^ - "?"
Very fat fingers today.

-- 
Andriy Gapon

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:03:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB3321065740;
	Sat, 20 Jun 2009 18:03:18 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194])
	by mx1.freebsd.org (Postfix) with ESMTP id 3F6FF8FC1A;
	Sat, 20 Jun 2009 18:03:17 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
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 n5KHfwC5024244
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 20 Jun 2009 20:41:59 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id
	n5KHfw5S025554; Sat, 20 Jun 2009 20:41:58 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n5KHfwgO025553; 
	Sat, 20 Jun 2009 20:41:58 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 20 Jun 2009 20:41:58 +0300
From: Kostik Belousov 
To: Ed Schouten 
Message-ID: <20090620174158.GG2884@deviant.kiev.zoral.com.ua>
References: <200906201639.n5KGdPhO081114@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="lHGcFxmlz1yfXmOs"
Content-Disposition: inline
In-Reply-To: <200906201639.n5KGdPhO081114@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.1 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r194538 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 18:03:20 -0000


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

On Sat, Jun 20, 2009 at 04:39:25PM +0000, Ed Schouten wrote:
> Author: ed
> Date: Sat Jun 20 16:39:25 2009
> New Revision: 194538
> URL: http://svn.freebsd.org/changeset/base/194538
>=20
> Log:
>   Add placeholder to prevent reuse of privilege 254.
>  =20
>   Requested by:	rwatson
>=20
> Modified:
>   head/sys/sys/priv.h
>=20
> Modified: head/sys/sys/priv.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/sys/priv.h	Sat Jun 20 16:37:24 2009	(r194537)
> +++ head/sys/sys/priv.h	Sat Jun 20 16:39:25 2009	(r194538)
> @@ -211,6 +211,7 @@
>  #define	PRIV_TTY_DRAINWAIT	251	/* Set tty drain wait time. */
>  #define	PRIV_TTY_DTRWAIT	252	/* Set DTR wait on tty. */
>  #define	PRIV_TTY_EXCLUSIVE	253	/* Override tty exclusive flag. */
> +#define	_PRIV_TTY_PRISON	254	/* Removed. */
>  #define	PRIV_TTY_STI		255	/* Simulate input on another tty. */
>  #define	PRIV_TTY_SETA		256	/* Set tty termios structure. */
> =20
Names starting with two underscores or underscore and upper-case letter
are reserved to the C language implementation. We should not use it
in the code.

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

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

iEYEARECAAYFAko9H2YACgkQC3+MBN1Mb4h/nQCfSKAlDu3erBu9bvDiHrEIaDrz
2vMAnAwo6nYWtA7rgXfROAyH7HvtMTrw
=ruKs
-----END PGP SIGNATURE-----

--lHGcFxmlz1yfXmOs--

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:13:20 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B084106564A;
	Sat, 20 Jun 2009 18:13:20 +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 688138FC0A;
	Sat, 20 Jun 2009 18:13:20 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIDKQs083129;
	Sat, 20 Jun 2009 18:13:20 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIDKVA083127;
	Sat, 20 Jun 2009 18:13:20 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201813.n5KIDKVA083127@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 18:13:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r194546 - head/tools/regression/netipx/spxloopback
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 18:13:20 -0000

Author: rwatson
Date: Sat Jun 20 18:13:20 2009
New Revision: 194546
URL: http://svn.freebsd.org/changeset/base/194546

Log:
  Up the scale of the SPX loopback check a bit: use much larger data sizes
  so that we need to do segmentation.

Modified:
  head/tools/regression/netipx/spxloopback/spxloopback.c

Modified: head/tools/regression/netipx/spxloopback/spxloopback.c
==============================================================================
--- head/tools/regression/netipx/spxloopback/spxloopback.c	Sat Jun 20 17:44:04 2009	(r194545)
+++ head/tools/regression/netipx/spxloopback/spxloopback.c	Sat Jun 20 18:13:20 2009	(r194546)
@@ -46,11 +46,7 @@
 #include 
 
 #define	IPX_ENDPOINT	"0xbebe.1.0x8a13"
-#define	PACKETLEN	128
-
-#if 0
-#define	SPX_SUPPORTS_SENDTO_WITH_CONNECT
-#endif
+#define	PACKETLEN	16 * (1024 * 1024)
 
 static void
 packet_fill(u_char *packet)
@@ -62,61 +58,40 @@ packet_fill(u_char *packet)
 }
 
 static int
-packet_check(u_char *packet)
+packet_check(u_char *packet, size_t totlen, ssize_t len)
 {
-	int i;
+	size_t i;
 
-	for (i = 0; i < PACKETLEN; i++) {
+	for (i = totlen; i < totlen + len; i++) {
 		if (packet[i] != (i & 0xff))
 			return (-1);
 	}
 	return (0);
 }
 
-#ifdef SPX_SUPPORTS_SENDTO_WITH_CONNECT
-static void
-my_sendto(int sock, const char *who, pid_t pid, struct sockaddr *sa,
-    socklen_t sa_len)
-{
-	u_char packet[PACKETLEN];
-	ssize_t len;
-	int error;
-
-	packet_fill(packet);
-	len = sendto(sock, packet, sizeof(packet), 0, sa, sa_len);
-	if (len < 0) {
-		error = errno;
-		(void)kill(pid, SIGTERM);
-		errno = error;
-		err(-1, "%s: sendto()", who);
-	}
-	if (len != sizeof(packet)) {
-		(void)kill(pid, SIGTERM);
-		errx(-1, "%s: sendto(): short send (%d length, %d sent)",
-		    who, sizeof(packet), len);
-	}
-}
-#endif
-
 static void
 my_send(int sock, const char *who, pid_t pid)
 {
 	u_char packet[PACKETLEN];
 	ssize_t len;
+	size_t totlen;
 	int error;
 
+	totlen = 0;
 	packet_fill(packet);
-	len = send(sock, packet, sizeof(packet), 0);
-	if (len < 0) {
-		error = errno;
-		(void)kill(pid, SIGTERM);
-		errno = error;
-		err(-1, "%s: send()", who);
-	}
-	if (len != sizeof(packet)) {
-		(void)kill(pid, SIGTERM);
-		errx(-1, "%s: send(): short send (%d length, %d sent)", who,
-		    sizeof(packet), len);
+	while (totlen < PACKETLEN) {
+		len = send(sock, packet + totlen, PACKETLEN - totlen, 0);
+		if (len < 0) {
+			error = errno;
+			(void)kill(pid, SIGTERM);
+			errno = error;
+			err(-1, "%s: send()", who);
+		}
+		if (len == 0) {
+			(void)kill(pid, SIGTERM);
+			errx(-1, "%s: send(): EOF", who);
+		}
+		totlen += len;
 	}
 }
 
@@ -125,24 +100,28 @@ my_recv(int sock, const char *who, pid_t
 {
 	u_char packet[PACKETLEN];
 	ssize_t len;
+	size_t totlen;
 	int error;
 
+	totlen = 0;
 	bzero(packet, sizeof(packet));
-	len = recv(sock, packet, sizeof(packet), 0);
-	if (len < 0) {
-		errno = error;
-		(void)kill(pid, SIGTERM);
-		errno = error;
-		err(-1, "%s: recv()", who);
-	}
-	if (len != sizeof(packet)) {
-		(void)kill(pid, SIGTERM);
-		errx(-1, "%s: recv(): got %d expected %d", who, len,
-		    sizeof(packet));
-	}
-	if (packet_check(packet) < 0) {
-		(void)kill(pid, SIGTERM);
-		errx(-1, "%s: recv(): got bad data", who);
+	while (totlen < PACKETLEN) {
+		len = recv(sock, packet + totlen, sizeof(packet) - totlen, 0);
+		if (len < 0) {
+			errno = error;
+			(void)kill(pid, SIGTERM);
+			errno = error;
+			err(-1, "%s: recv()", who);
+		}
+		if (len == 0) {
+			(void)kill(pid, SIGTERM);
+			errx(-1, "%s: recv(): EOF", who);
+		}
+		if (packet_check(packet, totlen, len) < 0) {
+			(void)kill(pid, SIGTERM);
+			errx(-1, "%s: recv(): got bad data", who);
+		}
+		totlen += len;
 	}
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:24:26 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 273A31065670;
	Sat, 20 Jun 2009 18:24:26 +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 149218FC19;
	Sat, 20 Jun 2009 18:24:26 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIOPud083360;
	Sat, 20 Jun 2009 18:24:25 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIOPLf083355;
	Sat, 20 Jun 2009 18:24:25 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201824.n5KIOPLf083355@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 18:24: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: r194547 - head/sys/netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 18:24:26 -0000

Author: rwatson
Date: Sat Jun 20 18:24:25 2009
New Revision: 194547
URL: http://svn.freebsd.org/changeset/base/194547

Log:
  Rework SPX segment reassembly, which was originally based on our TCP
  reassembly but failed to be modernized over time:
  
  - Use queue(9).
  - Specifically allocate queue entries of type M_SPXREASSQ to point at
    member mbufs, rather than casting mbuf data to 'spx_q'.
  - Maintain the mbuf pointer as part of the queue entry so that we can
    later free the mbuf without using dtom().

Modified:
  head/sys/netipx/spx.h
  head/sys/netipx/spx_reass.c
  head/sys/netipx/spx_usrreq.c
  head/sys/netipx/spx_var.h

Modified: head/sys/netipx/spx.h
==============================================================================
--- head/sys/netipx/spx.h	Sat Jun 20 18:13:20 2009	(r194546)
+++ head/sys/netipx/spx.h	Sat Jun 20 18:24:25 2009	(r194547)
@@ -91,8 +91,9 @@ struct spx {
 	struct spxhdr 	si_s;
 } __packed;
 struct spx_q {
-	struct spx_q	*si_next;
-	struct spx_q	*si_prev;
+	struct mbuf		*sq_msi;
+	struct spx		*sq_si;
+	LIST_ENTRY(spx_q)	 sq_entry;
 };
 #define SI(x)	((struct spx *)x)
 #define si_sum	si_i.ipx_sum
@@ -114,7 +115,7 @@ struct spx_q {
  * SPX control block, one per connection
  */
 struct spxpcb {
-	struct	spx_q	s_q;		/* queue for out-of-order receipt */
+	LIST_HEAD(, spx_q)	s_q;	/* queue for out-of-order receipt */
 	struct	ipxpcb	*s_ipxpcb;	/* backpointer to internet pcb */
 	u_char	s_state;
 	u_char	s_flags;

Modified: head/sys/netipx/spx_reass.c
==============================================================================
--- head/sys/netipx/spx_reass.c	Sat Jun 20 18:13:20 2009	(r194546)
+++ head/sys/netipx/spx_reass.c	Sat Jun 20 18:24:25 2009	(r194547)
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -92,24 +93,7 @@ __FBSDID("$FreeBSD$");
 static int	spx_use_delack = 0;
 static int	spxrexmtthresh = 3;
 
-static __inline void
-spx_insque(struct spx_q *element, struct spx_q *head)
-{
-
-	element->si_next = head->si_next;
-	element->si_prev = head;
-	head->si_next = element;
-	element->si_next->si_prev = element;
-}
- 
-static void
-spx_remque(struct spx_q *element)
-{
-
-	element->si_next->si_prev = element->si_prev;
-	element->si_prev->si_next = element->si_next;
-	element->si_prev = NULL;
-}
+MALLOC_DEFINE(M_SPXREASSQ, "spxreassq", "SPX reassembly queue entry");
 
 /*
  * Flesh pending queued segments on SPX close.
@@ -117,15 +101,12 @@ spx_remque(struct spx_q *element)
 void
 spx_reass_flush(struct spxpcb *cb)
 {
-	struct spx_q *s;
-	struct mbuf *m;
+	struct spx_q *q;
 
-	s = cb->s_q.si_next;
-	while (s != &(cb->s_q)) {
-		s = s->si_next;
-		spx_remque(s);
-		m = dtom(s);
-		m_freem(m);
+	while ((q = LIST_FIRST(&cb->s_q)) != NULL) {
+		LIST_REMOVE(q, sq_entry);
+		m_freem(q->sq_msi);
+		free(q, M_SPXREASSQ);
 	}
 }
 
@@ -136,7 +117,7 @@ void
 spx_reass_init(struct spxpcb *cb)
 {
 
-	cb->s_q.si_next = cb->s_q.si_prev = &cb->s_q;
+	LIST_INIT(&cb->s_q);
 }
 
 /*
@@ -145,9 +126,9 @@ spx_reass_init(struct spxpcb *cb)
  * suppresses duplicates.
  */
 int
-spx_reass(struct spxpcb *cb, struct spx *si)
+spx_reass(struct spxpcb *cb, struct mbuf *msi, struct spx *si)
 {
-	struct spx_q *q;
+	struct spx_q *q, *q_new, *q_temp;
 	struct mbuf *m;
 	struct socket *so = cb->s_ipxpcb->ipxp_socket;
 	char packetp = cb->s_flags & SF_HI;
@@ -352,17 +333,26 @@ update_window:
 	 * Loop through all packets queued up to insert in appropriate
 	 * sequence.
 	 */
-	for (q = cb->s_q.si_next; q != &cb->s_q; q = q->si_next) {
-		if (si->si_seq == SI(q)->si_seq) {
+	q_new = malloc(sizeof(*q_new), M_SPXREASSQ, M_NOWAIT | M_ZERO);
+	if (q_new == NULL)
+		return (1);
+	q_new->sq_si = si;
+	q_new->sq_msi = msi;
+	LIST_FOREACH(q, &cb->s_q, sq_entry) {
+		if (si->si_seq == q->sq_si->si_seq) {
+			free(q_new, M_SPXREASSQ);
 			spxstat.spxs_rcvduppack++;
 			return (1);
 		}
-		if (SSEQ_LT(si->si_seq, SI(q)->si_seq)) {
+		if (SSEQ_LT(si->si_seq, q->sq_si->si_seq)) {
 			spxstat.spxs_rcvoopack++;
 			break;
 		}
 	}
-	spx_insque((struct spx_q *)si, q->si_prev);
+	if (q != NULL)
+		LIST_INSERT_BEFORE(q, q_new, sq_entry);
+	else
+		LIST_INSERT_HEAD(&cb->s_q, q_new, sq_entry);
 
 	/*
 	 * If this packet is urgent, inform process
@@ -381,25 +371,31 @@ present:
 	 * and present all acknowledged data to user; if in packet interface
 	 * mode, show packet headers.
 	 */
-	for (q = cb->s_q.si_next; q != &cb->s_q; q = q->si_next) {
-		  if (SI(q)->si_seq == cb->s_ack) {
+	LIST_FOREACH_SAFE(q, &cb->s_q, sq_entry, q_temp) {
+		struct spx *qsi;
+		struct mbuf *mqsi;
+
+		qsi = q->sq_si;
+		mqsi = q->sq_msi;
+		if (qsi->si_seq == cb->s_ack) {
 			cb->s_ack++;
-			m = dtom(q);
-			if (SI(q)->si_cc & SPX_OB) {
+			if (qsi->si_cc & SPX_OB) {
 				cb->s_oobflags &= ~SF_IOOB;
 				if (so->so_rcv.sb_cc)
 					so->so_oobmark = so->so_rcv.sb_cc;
 				else
 					so->so_rcv.sb_state |= SBS_RCVATMARK;
 			}
-			q = q->si_prev;
-			spx_remque(q->si_next);
+			LIST_REMOVE(q, sq_entry);
+			free(q, M_SPXREASSQ);
 			wakeup = 1;
 			spxstat.spxs_rcvpack++;
 #ifdef SF_NEWCALL
 			if (cb->s_flags2 & SF_NEWCALL) {
-				struct spxhdr *sp = mtod(m, struct spxhdr *);
+				struct spxhdr *sp =
+				    mtod(mqsi, struct spxhdr *);
 				u_char dt = sp->spx_dt;
+
 				spx_newchecks[4]++;
 				if (dt != cb->s_rhdr.spx_dt) {
 					struct mbuf *mm =
@@ -417,31 +413,32 @@ present:
 					}
 				}
 				if (sp->spx_cc & SPX_OB) {
-					MCHTYPE(m, MT_OOBDATA);
+					MCHTYPE(mqsi, MT_OOBDATA);
 					spx_newchecks[1]++;
 					so->so_oobmark = 0;
 					so->so_rcv.sb_state &= ~SBS_RCVATMARK;
 				}
 				if (packetp == 0) {
-					m->m_data += SPINC;
-					m->m_len -= SPINC;
-					m->m_pkthdr.len -= SPINC;
+					mqsi->m_data += SPINC;
+					mqsi->m_len -= SPINC;
+					mqsi->m_pkthdr.len -= SPINC;
 				}
 				if ((sp->spx_cc & SPX_EM) || packetp) {
-					sbappendrecord_locked(&so->so_rcv, m);
+					sbappendrecord_locked(&so->so_rcv,
+					    mqsi);
 					spx_newchecks[9]++;
 				} else
-					sbappend_locked(&so->so_rcv, m);
+					sbappend_locked(&so->so_rcv, mqsi);
 			} else
 #endif
 			if (packetp)
-				sbappendrecord_locked(&so->so_rcv, m);
+				sbappendrecord_locked(&so->so_rcv, mqsi);
 			else {
-				cb->s_rhdr = *mtod(m, struct spxhdr *);
-				m->m_data += SPINC;
-				m->m_len -= SPINC;
-				m->m_pkthdr.len -= SPINC;
-				sbappend_locked(&so->so_rcv, m);
+				cb->s_rhdr = *mtod(mqsi, struct spxhdr *);
+				mqsi->m_data += SPINC;
+				mqsi->m_len -= SPINC;
+				mqsi->m_pkthdr.len -= SPINC;
+				sbappend_locked(&so->so_rcv, mqsi);
 			}
 		  } else
 			break;

Modified: head/sys/netipx/spx_usrreq.c
==============================================================================
--- head/sys/netipx/spx_usrreq.c	Sat Jun 20 18:13:20 2009	(r194546)
+++ head/sys/netipx/spx_usrreq.c	Sat Jun 20 18:24:25 2009	(r194547)
@@ -378,7 +378,7 @@ spx_input(struct mbuf *m, struct ipxpcb 
 	m->m_pkthdr.len -= sizeof(struct ipx);
 	m->m_data += sizeof(struct ipx);
 
-	if (spx_reass(cb, si))
+	if (spx_reass(cb, m, si))
 		m_freem(m);
 	if (cb->s_force || (cb->s_flags & (SF_ACKNOW|SF_WIN|SF_RXT)))
 		spx_output(cb, NULL);

Modified: head/sys/netipx/spx_var.h
==============================================================================
--- head/sys/netipx/spx_var.h	Sat Jun 20 18:13:20 2009	(r194546)
+++ head/sys/netipx/spx_var.h	Sat Jun 20 18:24:25 2009	(r194547)
@@ -152,7 +152,7 @@ extern struct spx_istat	spx_istat;
 extern u_short	spx_newchecks[50];
 
 int	spx_output(struct spxpcb *cb, struct mbuf *m0);
-int	spx_reass(struct spxpcb *cb, struct spx *si);
+int	spx_reass(struct spxpcb *cb, struct mbuf *msi, struct spx *si);
 void	spx_reass_flush(struct spxpcb *cb);
 void	spx_reass_init(struct spxpcb *cb);
 #endif

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:24:29 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B42F2106564A;
	Sat, 20 Jun 2009 18:24:29 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A28038FC1A;
	Sat, 20 Jun 2009 18:24:29 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIOTtY083396;
	Sat, 20 Jun 2009 18:24:29 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIOTGV083394;
	Sat, 20 Jun 2009 18:24:29 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906201824.n5KIOTGV083394@svn.freebsd.org>
From: Brooks Davis 
Date: Sat, 20 Jun 2009 18:24: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: r194548 - head/usr.bin/catman
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 18:24:30 -0000

Author: brooks
Date: Sat Jun 20 18:24:29 2009
New Revision: 194548
URL: http://svn.freebsd.org/changeset/base/194548

Log:
  Restore the check against running as root that I accidentally removed in
  r194493.

Modified:
  head/usr.bin/catman/catman.c

Modified: head/usr.bin/catman/catman.c
==============================================================================
--- head/usr.bin/catman/catman.c	Sat Jun 20 18:24:25 2009	(r194547)
+++ head/usr.bin/catman/catman.c	Sat Jun 20 18:24:29 2009	(r194548)
@@ -91,6 +91,7 @@ static const char *locale_device[] = {
 #define	GZCAT_CMD	"z"
 enum Ziptype {NONE, BZIP, GZIP};
 
+static uid_t uid;
 static int starting_dir;
 static char tmp_file[MAXPATHLEN];
 struct stat test_st;
@@ -742,6 +743,14 @@ main(int argc, char **argv)
 {
 	int opt;
 
+	if ((uid = getuid()) == 0) {
+		fprintf(stderr, "don't run %s as root, use:\n   echo", argv[0]);
+		for (optind = 0; optind < argc; optind++) {
+			fprintf(stderr, " %s", argv[optind]);
+		}
+		fprintf(stderr, " | nice -5 su -m man\n");
+		exit(1);
+	}
 	while ((opt = getopt(argc, argv, "vnfLrh")) != -1) {
 		switch (opt) {
 		case 'f':

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:27:19 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C3AD1106566C;
	Sat, 20 Jun 2009 18:27:19 +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 B21AC8FC14;
	Sat, 20 Jun 2009 18:27:19 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIRJfY083488;
	Sat, 20 Jun 2009 18:27:19 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIRJFD083486;
	Sat, 20 Jun 2009 18:27:19 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906201827.n5KIRJFD083486@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 18:27: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: r194549 - head/sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 18:27:20 -0000

Author: rwatson
Date: Sat Jun 20 18:27:19 2009
New Revision: 194549
URL: http://svn.freebsd.org/changeset/base/194549

Log:
  Remove definition of dtom(), which converted a data pointer into a
  pointer to the containing mbuf.  This eliminates a strong assumption
  about the layout of network buffer memory, giving us greater
  flexibility to revise mbuf semantics in the future.

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h	Sat Jun 20 18:24:29 2009	(r194548)
+++ head/sys/sys/mbuf.h	Sat Jun 20 18:27:19 2009	(r194549)
@@ -60,12 +60,12 @@
 
 #ifdef _KERNEL
 /*-
- * Macros for type conversion:
+ * Macro for type conversion: convert mbuf pointer to data pointer of correct
+ * type:
+ *
  * mtod(m, t)	-- Convert mbuf pointer to data pointer of correct type.
- * dtom(x)	-- Convert data pointer within mbuf to mbuf pointer (XXX).
  */
 #define	mtod(m, t)	((t)((m)->m_data))
-#define	dtom(x)		((struct mbuf *)((intptr_t)(x) & ~(MSIZE-1)))
 
 /*
  * Argument structure passed to UMA routines during mbuf and packet

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:37:18 2009
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D08C91065757;
	Sat, 20 Jun 2009 18:37:18 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net
	[IPv6:2001:4830:1200:a1::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 498CE8FC12;
	Sat, 20 Jun 2009 18:37:18 +0000 (UTC)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: from lor.one-eyed-alien.net (localhost [127.0.0.1])
	by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n5KIbTPX079999; 
	Sat, 20 Jun 2009 13:37:29 -0500 (CDT)
	(envelope-from brooks@lor.one-eyed-alien.net)
Received: (from brooks@localhost)
	by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n5KIbTpP079998;
	Sat, 20 Jun 2009 13:37:29 -0500 (CDT) (envelope-from brooks)
Date: Sat, 20 Jun 2009 13:37:29 -0500
From: Brooks Davis 
To: Bruce Evans 
Message-ID: <20090620183728.GA72393@lor.one-eyed-alien.net>
References: <200906191552.n5JFqZcG047705@svn.freebsd.org>
	<20090620130238.N29302@delplex.bde.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM"
Content-Disposition: inline
In-Reply-To: <20090620130238.N29302@delplex.bde.org>
User-Agent: Mutt/1.5.17 (2007-11-01)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(lor.one-eyed-alien.net [127.0.0.1]);
	Sat, 20 Jun 2009 13:37:29 -0500 (CDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Brooks Davis , src-committers@FreeBSD.org
Subject: Re: svn commit: r194493 - head/usr.bin/catman
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 18:37:19 -0000


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

On Sat, Jun 20, 2009 at 01:57:07PM +1000, Bruce Evans wrote:
> On Fri, 19 Jun 2009, Brooks Davis wrote:
>=20
>> Log:
>>  When checking if we can write to a file, use access() instead of a
>>  manual permission check based on stat output.  Also, get rid of the
>>  executability check since it is not used.
>=20
> This seems to add some security holes.  From "man assert | col -bx":
>
> %%%
> SECURITY CONSIDERATIONS
>      The access() system call is a potential security hole due to race co=
ndi-
>      tions and should never be used.  Set-user-ID and set-group-ID applic=
a-
>      tions should restore the effective user or group ID, and perform act=
ions
>      directly rather than use access() to simulate access checks for the =
real
>      user or group ID.	The eaccess() system call likewise may be subject =
to
>      races if used inappropriately.
> %%%

The code I replaced was effectivly a hand rolled version of access() based
on examining stat(1) results.  I think both are equivalently wrong from
a security perspective.

> catman isn't setuid in FreeBSD, so this doesn't exactly apply.  I think it
> does manual permission checking so as to support it being setuid on other
> systems.  It seems wrong to remove this support, provided it is actually
> correct.
>=20
>> Modified: head/usr.bin/catman/catman.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/usr.bin/catman/catman.c	Fri Jun 19 15:31:40 2009	(r194492)
>> +++ head/usr.bin/catman/catman.c	Fri Jun 19 15:52:35 2009	(r194493)
>> @@ -759,14 +742,6 @@ main(int argc, char **argv)
>> {
>> 	int opt;
>>=20
>> -	if ((uid =3D getuid()) =3D=3D 0) {
>> -		fprintf(stderr, "don't run %s as root, use:\n   echo", argv[0]);
>> -		for (optind =3D 0; optind < argc; optind++) {
>> -			fprintf(stderr, " %s", argv[optind]);
>> -		}
>> -		fprintf(stderr, " | nice -5 su -m man\n");
>> -		exit(1);
>> -	}
>> 	while ((opt =3D getopt(argc, argv, "vnfLrh")) !=3D -1) {
>> 		switch (opt) {
>> 		case 'f':
>=20
> Surely it is wrong to remove the enforcement of not running as root?

Yes that was an error, I've restored that check.  Thanks for the catch.

-- Brooks

> FreeBSD seems to have removed all setuidness for saving of cat pages,
> resulting in saving of cat pages not actually working unless they
> are created by user man, either by user man viewing man pages or
> by su'ing to man to run catman as used to be commanded above, and
> then not subsequently clobbered by user root, either by user root
> viewing modified man pages or by running catman as root as used to
> be disallowed above.  I see the following brokenness starting with
> an empty /usr/share/man/cat1:
> - "man cp" as user bde doesn't save the cat page
> - "man cp" as user man saves the cat page, with correct ownwership "man"
>   After removing the cat page:
> - "man cp" as user root saves the cat page, with incorrect ownwership "ro=
ot"
>   After changing the man page:
> - "man cp" as user bde displays the new man page but cannot save it
> - "man cp" as either user man or (of course) user root displays the new
>   man page and saves it.  Not too bad -- man(1) can replace the cat page
>   owned by root because user man owns the directory.  The mechanism is
>   that man(1) does a blind rename(2) of a temporary cat file.
>=20
> man(1) was last setuid in 2002.  The log message for making it non-setuid
> explains why catman needs to be run to partially recover lost functionali=
ty:
>=20
> %%%
> RCS file: /home/ncvs/src/gnu/usr.bin/man/man/Makefile,v
> Working file: Makefile
> head: 1.33
> ...
> ----------------------------
> revision 1.33
> date: 2002/01/15 14:11:05;  author: ru;  state: Exp;  lines: +1 -4
> branches:  1.33.30;  1.33.32;  1.33.34;
> Do not install man(1) setuid ``man''.
>=20
> The catpaging and setuidness features of man(1) combined make
> it vulnerable to a number of security attacks.  Specifically,
> it was possible to overwrite system catpages with arbitrarily
> contents by either setting up a symlink to a directory holding
> system catpages, or by writing custom -mdoc or -man groff(1)
> macro packages and setting up GROFF_TMAC_PATH in environment
> to point to them.  (See PR below for details).
>=20
> This means man(1) can no longer create system catpages on a
> regular user's behalf.  (It is still able to if the user has
> write permissions to the directory holding catpages, e.g.,
> user's own manpages, or if the running user is ``root''.)
>=20
> To create and install catpages during ``make world'', please
> set MANBUILDCAT=3DYES in /etc/make.conf.  To rebuild catpages
> on a weekly basis, please set weekly_catman_enable=3D"YES" in
> /etc/periodic.conf.
>=20
> PR:		bin/32791
> ----------------------------
> %%%
>=20
> I've never seen a machine that actually runs catman.  I remove the
> cat directories on all my machines to prevent any saving of cat
> pages.  All FreeBSD cluster machines that I checked (just 3) have
> 0, 1 and 2 saved cat pages.  This shows shows that catman isn't run
> on them and that root rarely looks at man pages on them.
>=20
> Since catman must be run to create cat pages other than ones with
> incorrect ownership obtained by root looking at man pages, it might
> as always run as root.  User man and cat directories owned by user
> man would become completely useless instead of just useless.
>=20
> Bruce
>=20

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

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

iD8DBQFKPSxoXY6L6fI4GtQRAjzHAJ9phoUaYrUu8IRDs1TKjwxAVOCcqQCfaCJ6
groE7ez5e0lgPUVY+vyeNsc=
=8vKe
-----END PGP SIGNATURE-----

--cWoXeonUoKmBZSoM--

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:52:02 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67593106566C;
	Sat, 20 Jun 2009 18:52:02 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55B618FC08;
	Sat, 20 Jun 2009 18:52:02 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIq26s084128;
	Sat, 20 Jun 2009 18:52:02 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIq2dL084126;
	Sat, 20 Jun 2009 18:52:02 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906201852.n5KIq2dL084126@svn.freebsd.org>
From: Brooks Davis 
Date: Sat, 20 Jun 2009 18:52: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: r194552 - head/sys/i386/ibcs2
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 18:52:02 -0000

Author: brooks
Date: Sat Jun 20 18:52:02 2009
New Revision: 194552
URL: http://svn.freebsd.org/changeset/base/194552

Log:
  Use NGROUPS instead of NGROUPS_MAX as the limits on setgroups and
  getgroups for ibcs emulation.  It seems vanishingly likely any
  programs will actually be affected since they probably assume a much
  lower value and use a static array size.

Modified:
  head/sys/i386/ibcs2/ibcs2_misc.c

Modified: head/sys/i386/ibcs2/ibcs2_misc.c
==============================================================================
--- head/sys/i386/ibcs2/ibcs2_misc.c	Sat Jun 20 18:39:18 2009	(r194551)
+++ head/sys/i386/ibcs2/ibcs2_misc.c	Sat Jun 20 18:52:02 2009	(r194552)
@@ -664,7 +664,7 @@ ibcs2_getgroups(td, uap)
 
 	if (uap->gidsetsize < 0)
 		return (EINVAL);
-	ngrp = MIN(uap->gidsetsize, NGROUPS_MAX);
+	ngrp = MIN(uap->gidsetsize, NGROUPS);
 	gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK);
 	error = kern_getgroups(td, &ngrp, gp);
 	if (error)
@@ -692,7 +692,7 @@ ibcs2_setgroups(td, uap)
 	gid_t *gp;
 	int error, i;
 
-	if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS_MAX)
+	if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS)
 		return (EINVAL);
 	if (uap->gidsetsize && uap->gidset == NULL)
 		return (EINVAL);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 18:57:15 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 86F9F1065670;
	Sat, 20 Jun 2009 18:57:15 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3FB5D8FC08;
	Sat, 20 Jun 2009 18:57:15 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KIvFJY084271;
	Sat, 20 Jun 2009 18:57:15 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KIvFHx084267;
	Sat, 20 Jun 2009 18:57:15 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906201857.n5KIvFHx084267@svn.freebsd.org>
From: Kip Macy 
Date: Sat, 20 Jun 2009 18:57: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: r194553 - in head/sys/dev/cxgb: . 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, 20 Jun 2009 18:57:16 -0000

Author: kmacy
Date: Sat Jun 20 18:57:14 2009
New Revision: 194553
URL: http://svn.freebsd.org/changeset/base/194553

Log:
  - fix dma map handling for !x86 case
  - fix allocation failure handing in refill_fl

Modified:
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgb/sys/mvec.h
  head/sys/dev/cxgb/sys/uipc_mvec.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Sat Jun 20 18:52:02 2009	(r194552)
+++ head/sys/dev/cxgb/cxgb_sge.c	Sat Jun 20 18:57:14 2009	(r194553)
@@ -714,6 +714,7 @@ refill_fl(adapter_t *sc, struct sge_fl *
 			if (q->zone = zone_pack)
 				uma_zfree(q->zone, cl);
 			m_free(m);
+			goto done;
 		}
 #else
 		cb_arg.seg.ds_addr = pmap_kextract((vm_offset_t)cl);
@@ -1157,7 +1158,7 @@ retry:
 	m0 = *m;
 	pktlen = m0->m_pkthdr.len;
 #if defined(__i386__) || defined(__amd64__)
-	if (busdma_map_sg_collapse(txq, txsd, m, segs, nsegs) == 0) {
+	if (busdma_map_sg_collapse(txq, txsd->map, m, segs, nsegs) == 0) {
 		goto done;
 	} else
 #endif
@@ -1411,11 +1412,11 @@ t3_encap(struct sge_qset *qs, struct mbu
 		tso_info = V_LSO_MSS(m0->m_pkthdr.tso_segsz);
 #endif
 	if (m0->m_nextpkt != NULL) {
-		busdma_map_sg_vec(txq, txsd, m0, segs, &nsegs);
+		busdma_map_sg_vec(txq, txsd->map, m0, segs, &nsegs);
 		ndesc = 1;
 		mlen = 0;
 	} else {
- 		if ((err = busdma_map_sg_collapse(txq, txsd, &m0, segs, &nsegs))) {
+ 		if ((err = busdma_map_sg_collapse(txq, txsd->map, &m0, segs, &nsegs))) {
 			if (cxgb_debug)
 				printf("failed ... err=%d\n", err);
 			return (err);

Modified: head/sys/dev/cxgb/sys/mvec.h
==============================================================================
--- head/sys/dev/cxgb/sys/mvec.h	Sat Jun 20 18:52:02 2009	(r194552)
+++ head/sys/dev/cxgb/sys/mvec.h	Sat Jun 20 18:57:14 2009	(r194553)
@@ -43,7 +43,7 @@
 #define m_ulp_mode	m_pkthdr.tso_segsz	/* upper level protocol	*/
 
 static __inline void
-busdma_map_mbuf_fast(struct sge_txq *txq, struct tx_sw_desc *txsd,
+busdma_map_mbuf_fast(struct sge_txq *txq, bus_dmamap_t map,
     struct mbuf *m, bus_dma_segment_t *seg)
 {
 #if defined(__i386__) || defined(__amd64__)
@@ -52,14 +52,15 @@ busdma_map_mbuf_fast(struct sge_txq *txq
 #else
 	int nsegstmp;
 
-	bus_dmamap_load_mbuf_sg(txq->entry_tag, txsd->map, m, seg,
+	bus_dmamap_load_mbuf_sg(txq->entry_tag, map, m, seg,
 		    &nsegstmp, 0);
 #endif
 }
 
-int busdma_map_sg_collapse(struct sge_txq *txq, struct tx_sw_desc *txsd,
+int busdma_map_sg_collapse(struct sge_txq *txq, bus_dmamap_t map,
     struct mbuf **m, bus_dma_segment_t *segs, int *nsegs);
-void busdma_map_sg_vec(struct sge_txq *txq, struct tx_sw_desc *txsd, struct mbuf *m, bus_dma_segment_t *segs, int *nsegs);
+void busdma_map_sg_vec(struct sge_txq *txq, bus_dmamap_t map,
+    struct mbuf *m, bus_dma_segment_t *segs, int *nsegs);
 static __inline int
 busdma_map_sgl(bus_dma_segment_t *vsegs, bus_dma_segment_t *segs, int count) 
 {

Modified: head/sys/dev/cxgb/sys/uipc_mvec.c
==============================================================================
--- head/sys/dev/cxgb/sys/uipc_mvec.c	Sat Jun 20 18:52:02 2009	(r194552)
+++ head/sys/dev/cxgb/sys/uipc_mvec.c	Sat Jun 20 18:57:14 2009	(r194553)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 int
-busdma_map_sg_collapse(struct sge_txq *txq, struct tx_sw_desc *txsd,
+busdma_map_sg_collapse(struct sge_txq *txq, bus_dmamap_t map,
 	struct mbuf **m, bus_dma_segment_t *segs, int *nsegs)
 {
 	struct mbuf *n = *m;
@@ -73,7 +73,7 @@ retry:
 	psegs = segs;
 	seg_count = 0;
 	if (n->m_next == NULL) {
-		busdma_map_mbuf_fast(txq, txsd, n, segs);
+		busdma_map_mbuf_fast(txq, map, n, segs);
 		*nsegs = 1;
 		return (0);
 	}
@@ -84,13 +84,13 @@ retry:
 		 */
 		if (__predict_true(n->m_len != 0)) {
 			seg_count++;
-			busdma_map_mbuf_fast(txq, txsd, n, psegs);
+			busdma_map_mbuf_fast(txq, map, n, psegs);
 			psegs++;
 		}
 		n = n->m_next;
 	}
 #else
-	err = bus_dmamap_load_mbuf_sg(txq->entry_tag, txsd->map, m, segs,
+	err = bus_dmamap_load_mbuf_sg(txq->entry_tag, map, m, segs,
 		    &seg_count, 0);
 #endif	
 	if (seg_count == 0) {
@@ -122,11 +122,11 @@ err_out:	
 }
 
 void
-busdma_map_sg_vec(struct sge_txq *txq, struct tx_sw_desc *txsd,
+busdma_map_sg_vec(struct sge_txq *txq, bus_dmamap_t map,
     struct mbuf *m, bus_dma_segment_t *segs, int *nsegs)
 {
 
 	for (*nsegs = 0; m != NULL ; segs++, *nsegs += 1, m = m->m_nextpkt)
-		busdma_map_mbuf_fast(txq, txsd, m, segs);
+		busdma_map_mbuf_fast(txq, map, m, segs);
 }
 

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 19:05:18 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 65509106564A;
	Sat, 20 Jun 2009 19:05:18 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from mail.netplex.net (mail.netplex.net [204.213.176.10])
	by mx1.freebsd.org (Postfix) with ESMTP id 20A388FC13;
	Sat, 20 Jun 2009 19:05:17 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11])
	by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id
	n5KJ5GZd026169; Sat, 20 Jun 2009 15:05:16 -0400 (EDT)
X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net)
X-Greylist: Message whitelisted by DRAC access database, not delayed by
	milter-greylist-4.0 (mail.netplex.net [204.213.176.10]);
	Sat, 20 Jun 2009 15:05:16 -0400 (EDT)
Date: Sat, 20 Jun 2009 15:05:16 -0400 (EDT)
From: Daniel Eischen 
X-X-Sender: eischen@sea.ntplx.net
To: Andriy Gapon 
In-Reply-To: <4A3D1EEA.9060005@freebsd.org>
Message-ID: 
References: <200906201645.n5KGjEeG081301@svn.freebsd.org>
	
	<4A3D1EEA.9060005@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, Robert Noland 
Subject: Re: svn commit: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Daniel Eischen 
List-Id: 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, 20 Jun 2009 19:05:18 -0000

On Sat, 20 Jun 2009, Andriy Gapon wrote:

> on 20/06/2009 19:56 Daniel Eischen said the following:
>> On Sat, 20 Jun 2009, Robert Noland wrote:
>>
>>> Author: rnoland
>>> Date: Sat Jun 20 16:45:14 2009
>>> New Revision: 194540
>>> URL: http://svn.freebsd.org/changeset/base/194540
>>>
>>> Log:
>>>  The G45 docs indicate that all G4X chips use the new framecount
>>> register.
>>>
>>>  Intel agrees with my reading of the docs, make it so for all G4X chips.
>>>
>>>  The new register also has a 32 bit width as opposed to 24 bits.  Fix
>>>  things up so that the counters roll over properly.
>>
>> Could this possibly fix the problem I'm seeing with the screen being
>> garbage after a logout from KDE 3.x (using kdm)?  Everything works
>> fine after logging in, but when you log out, the screen is left with
>> garbage/lots of vertical striping.  This only happened after upgrading
>> my system (and all ports) to Xorg 7.4, worked just fine before that.
>>
>> agp0:  on vgapci0
>> agp0: detected 7932k stolen memory
>> agp0: aperture size is 256M
>> vgapci1:  mem 0xdff80000-0xdfffffff at device
>> 2.1 on pci0
>
> I had similar symptoms. In my case this was cause X server crashing?
> Do you see the same. If yes, there might be a recipe for cure.

Possibly, I don't recall if the X server crashed after logout.
Ctrl-Alt-F1, then Ctrl-Alt-Del to reboot was the only way to
recover, sometimes a hard reset was required.  I guess I'll
have to try this change to see if it resolves my problem.

-- 
DE

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 19:09:41 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD45A1065676;
	Sat, 20 Jun 2009 19:09:41 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ABE848FC18;
	Sat, 20 Jun 2009 19:09:41 +0000 (UTC)
	(envelope-from kmacy@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KJ9fEh084567;
	Sat, 20 Jun 2009 19:09:41 GMT (envelope-from kmacy@svn.freebsd.org)
Received: (from kmacy@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KJ9fJp084565;
	Sat, 20 Jun 2009 19:09:41 GMT (envelope-from kmacy@svn.freebsd.org)
Message-Id: <200906201909.n5KJ9fJp084565@svn.freebsd.org>
From: Kip Macy 
Date: Sat, 20 Jun 2009 19:09: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: r194554 - head/sys/dev/cxgb
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 19:09:42 -0000

Author: kmacy
Date: Sat Jun 20 19:09:41 2009
New Revision: 194554
URL: http://svn.freebsd.org/changeset/base/194554

Log:
  fix typo in conditional

Modified:
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Sat Jun 20 18:57:14 2009	(r194553)
+++ head/sys/dev/cxgb/cxgb_sge.c	Sat Jun 20 19:09:41 2009	(r194554)
@@ -711,7 +711,7 @@ refill_fl(adapter_t *sc, struct sge_fl *
 		    cl, q->buf_size, refill_fl_cb, &cb_arg, 0);
 		
 		if (err != 0 || cb_arg.error) {
-			if (q->zone = zone_pack)
+			if (q->zone == zone_pack)
 				uma_zfree(q->zone, cl);
 			m_free(m);
 			goto done;

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 19:24:56 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2DEEF1065672;
	Sat, 20 Jun 2009 19:24:56 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195])
	by mx1.freebsd.org (Postfix) with ESMTP id DED5E8FC13;
	Sat, 20 Jun 2009 19:24:55 +0000 (UTC)
	(envelope-from rnoland@FreeBSD.org)
Received: from [192.168.1.4] (adsl-149-142-42.bna.bellsouth.net
	[70.149.142.42]) (authenticated bits=0)
	by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n5KJ7W8U044551
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 20 Jun 2009 15:07:41 -0400 (EDT)
	(envelope-from rnoland@FreeBSD.org)
From: Robert Noland 
To: Daniel Eischen 
In-Reply-To: 
References: <200906201645.n5KGjEeG081301@svn.freebsd.org>
	
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-Fnj2LJHqUTlU4jU5hRMp"
Organization: FreeBSD
Date: Sat, 20 Jun 2009 14:07:24 -0500
Message-Id: <1245524845.1724.10.camel@balrog.2hip.net>
Mime-Version: 1.0
X-Mailer: Evolution 2.26.2 FreeBSD GNOME Team Port 
X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PBL,
	RDNS_DYNAMIC,SPF_SOFTFAIL autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 19:24:56 -0000


--=-Fnj2LJHqUTlU4jU5hRMp
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sat, 2009-06-20 at 12:56 -0400, Daniel Eischen wrote:
> On Sat, 20 Jun 2009, Robert Noland wrote:
>=20
> > Author: rnoland
> > Date: Sat Jun 20 16:45:14 2009
> > New Revision: 194540
> > URL: http://svn.freebsd.org/changeset/base/194540
> >
> > Log:
> >  The G45 docs indicate that all G4X chips use the new framecount regist=
er.
> >
> >  Intel agrees with my reading of the docs, make it so for all G4X chips=
.
> >
> >  The new register also has a 32 bit width as opposed to 24 bits.  Fix
> >  things up so that the counters roll over properly.
>=20
> Could this possibly fix the problem I'm seeing with the screen being
> garbage after a logout from KDE 3.x (using kdm)?  Everything works
> fine after logging in, but when you log out, the screen is left with
> garbage/lots of vertical striping.  This only happened after upgrading
> my system (and all ports) to Xorg 7.4, worked just fine before that.
>=20
> agp0:  on vgapci0
> agp0: detected 7932k stolen memory
> agp0: aperture size is 256M
> vgapci1:  mem 0xdff80000-0xdfffffff at device  2.=
1 on pci0

No, this only change only effects g45 chips, which would have been
incorrectly handling the hardware vblank counter.  It will have no
impact on 945.  I'm trying to pull changes that are definite wins from
my Intel branch right now.  I don't think that I have seen the symptoms
that you describe on my 945, except when it is resuming from suspend.  I
do only run gnome on it though, it is far too slow to do kde as well...
I'm trying to fix up the interrupt handling in a less invasive way than
I did previously, but even that should only effect 965+ with msi
enabled.

robert.

--=20
Robert Noland 
FreeBSD

--=-Fnj2LJHqUTlU4jU5hRMp
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

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

iEUEABECAAYFAko9M2wACgkQM4TrQ4qfROOEMQCWOPNXOCtdWu2tb9tWbK8X1BbP
YwCghzvVFvG2ojnVJyBVkcVFc87g6Hs=
=trgL
-----END PGP SIGNATURE-----

--=-Fnj2LJHqUTlU4jU5hRMp--


From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 20:22:12 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7C92F106564A;
	Sat, 20 Jun 2009 20:22:12 +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 6AF788FC1D;
	Sat, 20 Jun 2009 20:22:12 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KKMC20085902;
	Sat, 20 Jun 2009 20:22:12 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KKMCet085900;
	Sat, 20 Jun 2009 20:22:12 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906202022.n5KKMCet085900@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 20:22: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: r194555 - head/usr.sbin/getpmac
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 20:22:13 -0000

Author: rwatson
Date: Sat Jun 20 20:22:11 2009
New Revision: 194555
URL: http://svn.freebsd.org/changeset/base/194555

Log:
  If the label being printed by getpmac(8) is empty, then don't print a
  carriage return.
  
  Obtained from:	TrustedBSD Project
  MFC after:	3 days

Modified:
  head/usr.sbin/getpmac/getpmac.c

Modified: head/usr.sbin/getpmac/getpmac.c
==============================================================================
--- head/usr.sbin/getpmac/getpmac.c	Sat Jun 20 19:09:41 2009	(r194554)
+++ head/usr.sbin/getpmac/getpmac.c	Sat Jun 20 20:22:11 2009	(r194555)
@@ -119,7 +119,8 @@ main(int argc, char *argv[])
 		exit(EX_DATAERR);
 	}
 
-	printf("%s\n", string);
+	if (strlen(string) > 0)
+		printf("%s\n", string);
 		
 	mac_free(label);
 	free(string);

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 20:24:31 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C7891065670;
	Sat, 20 Jun 2009 20:24:31 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from mail.netplex.net (mail.netplex.net [204.213.176.10])
	by mx1.freebsd.org (Postfix) with ESMTP id EF2078FC0A;
	Sat, 20 Jun 2009 20:24:30 +0000 (UTC)
	(envelope-from deischen@freebsd.org)
Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11])
	by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id
	n5KKOTXH000309; Sat, 20 Jun 2009 16:24:29 -0400 (EDT)
X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net)
X-Greylist: Message whitelisted by DRAC access database, not delayed by
	milter-greylist-4.0 (mail.netplex.net [204.213.176.10]);
	Sat, 20 Jun 2009 16:24:29 -0400 (EDT)
Date: Sat, 20 Jun 2009 16:24:29 -0400 (EDT)
From: Daniel Eischen 
X-X-Sender: eischen@sea.ntplx.net
To: Robert Noland 
In-Reply-To: <1245524845.1724.10.camel@balrog.2hip.net>
Message-ID: 
References: <200906201645.n5KGjEeG081301@svn.freebsd.org> 
	
	<1245524845.1724.10.camel@balrog.2hip.net>
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: r194540 - head/sys/dev/drm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: Daniel Eischen 
List-Id: 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, 20 Jun 2009 20:24:31 -0000

On Sat, 20 Jun 2009, Robert Noland wrote:

> On Sat, 2009-06-20 at 12:56 -0400, Daniel Eischen wrote:
>> On Sat, 20 Jun 2009, Robert Noland wrote:
>>
>>> Author: rnoland
>>> Date: Sat Jun 20 16:45:14 2009
>>> New Revision: 194540
>>> URL: http://svn.freebsd.org/changeset/base/194540
>>>
>>> Log:
>>>  The G45 docs indicate that all G4X chips use the new framecount register.
>>>
>>>  Intel agrees with my reading of the docs, make it so for all G4X chips.
>>>
>>>  The new register also has a 32 bit width as opposed to 24 bits.  Fix
>>>  things up so that the counters roll over properly.
>>
>> Could this possibly fix the problem I'm seeing with the screen being
>> garbage after a logout from KDE 3.x (using kdm)?  Everything works
>> fine after logging in, but when you log out, the screen is left with
>> garbage/lots of vertical striping.  This only happened after upgrading
>> my system (and all ports) to Xorg 7.4, worked just fine before that.
>>
>> agp0:  on vgapci0
>> agp0: detected 7932k stolen memory
>> agp0: aperture size is 256M
>> vgapci1:  mem 0xdff80000-0xdfffffff at device  2.1 on pci0
>
> No, this only change only effects g45 chips, which would have been
> incorrectly handling the hardware vblank counter.  It will have no
> impact on 945.  I'm trying to pull changes that are definite wins from
> my Intel branch right now.  I don't think that I have seen the symptoms
> that you describe on my 945, except when it is resuming from suspend.  I
> do only run gnome on it though, it is far too slow to do kde as well...
> I'm trying to fix up the interrupt handling in a less invasive way than
> I did previously, but even that should only effect 965+ with msi
> enabled.

I have not tried GNOME, but mine does work fine with plain old xdm
and twm.  It has been happily running for year(s) with previous
Xorg/KDE and drm.

-- 
DE

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 20:29:21 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D39331065687;
	Sat, 20 Jun 2009 20:29:21 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A73D38FC21;
	Sat, 20 Jun 2009 20:29:21 +0000 (UTC)
	(envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KKTLZb086047;
	Sat, 20 Jun 2009 20:29:21 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KKTLDx086045;
	Sat, 20 Jun 2009 20:29:21 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <200906202029.n5KKTLDx086045@svn.freebsd.org>
From: Brooks Davis 
Date: Sat, 20 Jun 2009 20:29: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: r194556 - head/sys/kern
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 20 Jun 2009 20:29:22 -0000

Author: brooks
Date: Sat Jun 20 20:29:21 2009
New Revision: 194556
URL: http://svn.freebsd.org/changeset/base/194556

Log:
  Change crsetgroups_locked() (called by crsetgroups()) to sort the
  supplemental groups using insertion sort.  Use this property in
  groupmember() to let us use a binary search instead of the previous
  linear search.

Modified:
  head/sys/kern/kern_prot.c

Modified: head/sys/kern/kern_prot.c
==============================================================================
--- head/sys/kern/kern_prot.c	Sat Jun 20 20:22:11 2009	(r194555)
+++ head/sys/kern/kern_prot.c	Sat Jun 20 20:29:21 2009	(r194556)
@@ -86,7 +86,6 @@ static void crextend(struct ucred *cr, i
 static void crsetgroups_locked(struct ucred *cr, int ngrp,
     gid_t *groups);
 
-
 #ifndef _SYS_SYSPROTO_H_
 struct getpid_args {
 	int	dummy;
@@ -1248,13 +1247,30 @@ __setugid(struct thread *td, struct __se
 int
 groupmember(gid_t gid, struct ucred *cred)
 {
-	register gid_t *gp;
-	gid_t *egp;
+	int l;
+	int h;
+	int m;
+
+	if (cred->cr_groups[0] == gid)
+		return(1);
+
+	/*
+	 * If gid was not our primary group, perform a binary search
+	 * of the supplemental groups.  This is possible because we
+	 * sort the groups in crsetgroups().
+	 */
+	l = 1;
+	h = cred->cr_ngroups;
+	while (l < h) {
+		m = l + ((h - l) / 2);
+		if (cred->cr_groups[m] < gid)
+			l = m + 1; 
+		else
+			h = m; 
+	}
+	if ((l < cred->cr_ngroups) && (cred->cr_groups[l] == gid))
+		return (1);
 
-	egp = &(cred->cr_groups[cred->cr_ngroups]);
-	for (gp = cred->cr_groups; gp < egp; gp++)
-		if (*gp == gid)
-			return (1);
 	return (0);
 }
 
@@ -1986,18 +2002,37 @@ crextend(struct ucred *cr, int n)
 }
 
 /*
- * Copy groups in to a credential, preserving any necessicary invariants
- * (i.e. sorting in the future).  crextend() must have been called
- * before hand to ensure sufficient space is available.  If 
+ * Copy groups in to a credential, preserving any necessary invariants.
+ * Currently this includes the sorting of all supplemental gids.
+ * crextend() must have been called before hand to ensure sufficient
+ * space is available.
  */
 static void
 crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups)
 {
+	int i;
+	int j;
+	gid_t g;
 	
 	KASSERT(cr->cr_agroups >= ngrp, ("cr_ngroups is too small"));
 
 	bcopy(groups, cr->cr_groups, ngrp * sizeof(gid_t));
 	cr->cr_ngroups = ngrp;
+
+	/*
+	 * Sort all groups except cr_groups[0] to allow groupmember to
+	 * perform a binary search.
+	 *
+	 * XXX: If large numbers of groups become common this should
+	 * be replaced with shell sort like linux uses or possibly
+	 * heap sort.
+	 */
+	for (i = 2; i < ngrp; i++) {
+		g = cr->cr_groups[i];
+		for (j = i-1; j >= 1 && g < cr->cr_groups[j]; j--)
+			cr->cr_groups[j + 1] = cr->cr_groups[j];
+		cr->cr_groups[j + 1] = g;
+	}
 }
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 20:35:51 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 487CD1065752;
	Sat, 20 Jun 2009 20:35:51 +0000 (UTC)
	(envelope-from remko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0CDEF8FC15;
	Sat, 20 Jun 2009 20:35:51 +0000 (UTC)
	(envelope-from remko@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KKZoYK086241;
	Sat, 20 Jun 2009 20:35:50 GMT (envelope-from remko@svn.freebsd.org)
Received: (from remko@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KKZoPP086239;
	Sat, 20 Jun 2009 20:35:50 GMT (envelope-from remko@svn.freebsd.org)
Message-Id: <200906202035.n5KKZoPP086239@svn.freebsd.org>
From: Remko Lodder 
Date: Sat, 20 Jun 2009 20:35: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: r194558 - head/tools/tools/tinybsd
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 20:35:51 -0000

Author: remko
Date: Sat Jun 20 20:35:50 2009
New Revision: 194558
URL: http://svn.freebsd.org/changeset/base/194558

Log:
  Add architecture support for TinyBSD
  
  PR:		135301
  Submitted by:	Olivier Cochard-Labbe 
  Reviewed by:	Jean Milanez Melo  (maintainer)
  Approved by:	imp (mentor, implicit)
  MFC after:	1 week

Modified:
  head/tools/tools/tinybsd/tinybsd

Modified: head/tools/tools/tinybsd/tinybsd
==============================================================================
--- head/tools/tools/tinybsd/tinybsd	Sat Jun 20 20:35:42 2009	(r194557)
+++ head/tools/tools/tinybsd/tinybsd	Sat Jun 20 20:35:50 2009	(r194558)
@@ -19,6 +19,8 @@ BASEFILE="tinybsd.basefiles"
 PORTSFILE="tinybsd.ports"
 PORTSDIR=/usr/ports
 DEFINSTARGS="-o 0 -g 0 -m 555"
+TINYARCH=$(uname -p)
+
 TS="=====>"
 
 splitarg1 () {
@@ -331,7 +333,7 @@ install_ports() {
 
 make_kernel() {
 	echo "${TS} Building customized tiny beastie kernel... "
-	cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/i386/conf
+	cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/${TINYARCH}/conf
 	cd /usr/src
 	make buildkernel KERNCONF=${KERNCONF} || exit 1
 	gzip -9 /usr/obj/usr/src/sys/${KERNCONF}/kernel
@@ -339,7 +341,7 @@ make_kernel() {
 	install ${DEFINSTARGS} \
 	  /usr/obj/usr/src/sys/${KERNCONF}/modules/usr/src/sys/modules/acpi/acpi/acpi.ko \
 	    ${WORKDIR}/boot/kernel
-	install -o 0 -g 0 -m 444 /sys/i386/conf/GENERIC.hints ${WORKDIR}/boot/device.hints
+	install -o 0 -g 0 -m 444 /sys/${TINYARCH}/conf/GENERIC.hints ${WORKDIR}/boot/device.hints
 }
 
 copy_libraries() {

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 20:44:28 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 78939106564A;
	Sat, 20 Jun 2009 20:44:28 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 66AA28FC0C;
	Sat, 20 Jun 2009 20:44:28 +0000 (UTC)
	(envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KKiSPv086463;
	Sat, 20 Jun 2009 20:44:28 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KKiSY4086461;
	Sat, 20 Jun 2009 20:44:28 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <200906202044.n5KKiSY4086461@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 20 Jun 2009 20:44: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: r194560 - 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, 20 Jun 2009 20:44:28 -0000

Author: jilles
Date: Sat Jun 20 20:44:27 2009
New Revision: 194560
URL: http://svn.freebsd.org/changeset/base/194560

Log:
  Fix race condition in noclobber option.
  
  Formerly, it was possible for the file to be created between the check if it
  existed and the open; the contents would then be lost.
  
  Because this must use O_EXCL, noclobber > will not create a file through a
  symlink anymore. This agrees with behaviour of other shells.
  
  Approved by:	ed (mentor) (implicit)

Modified:
  head/bin/sh/redir.c

Modified: head/bin/sh/redir.c
==============================================================================
--- head/bin/sh/redir.c	Sat Jun 20 20:36:51 2009	(r194559)
+++ head/bin/sh/redir.c	Sat Jun 20 20:44:27 2009	(r194560)
@@ -188,13 +188,25 @@ movefd:
 			error("cannot create %s: %s", fname, strerror(errno));
 		goto movefd;
 	case NTO:
-		fname = redir->nfile.expfname;
-		if (Cflag && stat(fname, &sb) != -1 && S_ISREG(sb.st_mode))
-			error("cannot create %s: %s", fname,
-			    strerror(EEXIST));
-		if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
-			error("cannot create %s: %s", fname, strerror(errno));
-		goto movefd;
+		if (Cflag) {
+			fname = redir->nfile.expfname;
+			if (stat(fname, &sb) == -1) {
+				if ((f = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0)
+					error("cannot create %s: %s", fname, strerror(errno));
+			} else if (!S_ISREG(sb.st_mode)) {
+				if ((f = open(fname, O_WRONLY, 0666)) < 0)
+					error("cannot create %s: %s", fname, strerror(errno));
+				if (fstat(f, &sb) != -1 && S_ISREG(sb.st_mode)) {
+					close(f);
+					error("cannot create %s: %s", fname,
+					    strerror(EEXIST));
+				}
+			} else
+				error("cannot create %s: %s", fname,
+				    strerror(EEXIST));
+			goto movefd;
+		}
+		/* FALLTHROUGH */
 	case NCLOBBER:
 		fname = redir->nfile.expfname;
 		if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)

From owner-svn-src-head@FreeBSD.ORG  Sat Jun 20 23:38:22 2009
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1CB381065679;
	Sat, 20 Jun 2009 23:38: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 A30498FC15;
	Sat, 20 Jun 2009 23:38:21 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5KNcLYU089688;
	Sat, 20 Jun 2009 23:38:21 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5KNcLvS089685;
	Sat, 20 Jun 2009 23:38:21 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200906202338.n5KNcLvS089685@svn.freebsd.org>
From: Robert Watson 
Date: Sat, 20 Jun 2009 23:38: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: r194561 - head/sys/netipx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: 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, 20 Jun 2009 23:38:22 -0000

Author: rwatson
Date: Sat Jun 20 23:38:21 2009
New Revision: 194561
URL: http://svn.freebsd.org/changeset/base/194561

Log:
  Implement socket delivery MAC checks for IPX/SPX.
  
  Obtained from:	TrustedBSD Project
  MFC after:	3 days

Modified:
  head/sys/netipx/ipx_usrreq.c
  head/sys/netipx/spx_usrreq.c

Modified: head/sys/netipx/ipx_usrreq.c
==============================================================================
--- head/sys/netipx/ipx_usrreq.c	Sat Jun 20 20:44:27 2009	(r194560)
+++ head/sys/netipx/ipx_usrreq.c	Sat Jun 20 23:38:21 2009	(r194561)
@@ -187,6 +187,12 @@ ipx_input(struct mbuf *m, struct ipxpcb 
 		m->m_pkthdr.len -= sizeof(struct ipx);
 		m->m_data += sizeof(struct ipx);
 	}
+#ifdef MAC
+	if (mac_socket_check_deliver(ipxp->ipxp_socket, m) != 0) {
+		m_freem(m);
+		return;
+	}
+#endif
 	if (sbappendaddr(&ipxp->ipxp_socket->so_rcv,
 	    (struct sockaddr *)&ipx_ipx, m, NULL) == 0)
 		m_freem(m);

Modified: head/sys/netipx/spx_usrreq.c
==============================================================================
--- head/sys/netipx/spx_usrreq.c	Sat Jun 20 20:44:27 2009	(r194560)
+++ head/sys/netipx/spx_usrreq.c	Sat Jun 20 23:38:21 2009	(r194561)
@@ -225,6 +225,11 @@ spx_input(struct mbuf *m, struct ipxpcb 
 	so = ipxp->ipxp_socket;
 	KASSERT(so != NULL, ("spx_input: so == NULL"));
 
+#ifdef MAC
+	if (mac_socket_check_deliver(so, m) != 0)
+		goto drop;
+#endif
+
 	if (so->so_options & SO_DEBUG || traceallspxs) {
 		ostate = cb->s_state;
 		spx_savesi = *si;