From owner-svn-src-projects@FreeBSD.ORG Sun May 22 02:13:56 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B60E106564A; Sun, 22 May 2011 02:13:56 +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 4C19D8FC16; Sun, 22 May 2011 02:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4M2DunF054607; Sun, 22 May 2011 02:13:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4M2DuZm054605; Sun, 22 May 2011 02:13:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105220213.p4M2DuZm054605@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 May 2011 02:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222168 - projects/pseries/powerpc/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 02:13:56 -0000 Author: nwhitehorn Date: Sun May 22 02:13:55 2011 New Revision: 222168 URL: http://svn.freebsd.org/changeset/base/222168 Log: IBM firmware is odd. Make RTAS initialization actually work correctly on SLOF systems. Modified: projects/pseries/powerpc/ofw/rtas.c Modified: projects/pseries/powerpc/ofw/rtas.c ============================================================================== --- projects/pseries/powerpc/ofw/rtas.c Sun May 22 01:07:54 2011 (r222167) +++ projects/pseries/powerpc/ofw/rtas.c Sun May 22 02:13:55 2011 (r222168) @@ -73,11 +73,15 @@ rtas_setup(void *junk) { ihandle_t rtasi; cell_t rtas_size = 0, rtas_ptr; + char path[31]; int result; - rtasi = OF_open("/rtas"); rtas = OF_finddevice("/rtas"); - if (rtasi == 0 || rtas == -1) + if (rtas == -1) + return; + OF_package_to_path(rtas, path, sizeof(path)); + rtasi = OF_open(path); + if (rtasi == -1 || rtasi == 0) return; mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0); @@ -116,7 +120,7 @@ rtas_setup(void *junk) (cell_t)rtas_private_data, &rtas_ptr); OF_close(rtasi); - if (result == -1) { + if (result != 0) { rtas = 0; rtas_ptr = 0; printf("Error initializing RTAS\n"); @@ -188,7 +192,7 @@ rtas_call_method(cell_t token, int nargs } args; int n, result; - if (!rtas_exists() || nargs > 6) + if (!rtas_exists() || nargs + nreturns > 12) return (-1); args.token = token; From owner-svn-src-projects@FreeBSD.ORG Sun May 22 02:18:18 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C769D1065672; Sun, 22 May 2011 02:18:18 +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 51BB58FC16; Sun, 22 May 2011 02:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4M2IIdr054767; Sun, 22 May 2011 02:18:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4M2IIIK054764; Sun, 22 May 2011 02:18:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105220218.p4M2IIIK054764@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 May 2011 02:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222169 - in projects/pseries: conf powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 02:18:18 -0000 Author: nwhitehorn Date: Sun May 22 02:18:18 2011 New Revision: 222169 URL: http://svn.freebsd.org/changeset/base/222169 Log: Add a driver for simple RTAS services. This supports the RTAS time of day clock interface, as well as power-off and reboot. Other potential features that could be added here are RTAS LED annunciator support, NVRAM access, etc. Added: projects/pseries/powerpc/pseries/rtas_dev.c Modified: projects/pseries/conf/files.powerpc Modified: projects/pseries/conf/files.powerpc ============================================================================== --- projects/pseries/conf/files.powerpc Sun May 22 02:13:55 2011 (r222168) +++ projects/pseries/conf/files.powerpc Sun May 22 02:18:18 2011 (r222169) @@ -211,7 +211,8 @@ powerpc/ps3/ps3-hvcall.S optional ps3 sc powerpc/pseries/phyp-hvcall.S optional pseries powerpc64 powerpc/pseries/mmu_phyp.c optional pseries powerpc64 powerpc/pseries/platform_chrp.c optional pseries -powerpc/pseries/rtas_pci.c optional pseries +powerpc/pseries/rtas_dev.c optional pseries +powerpc/pseries/rtas_pci.c optional pseries pci powerpc/psim/iobus.c optional psim powerpc/psim/ata_iobus.c optional ata psim powerpc/psim/openpic_iobus.c optional psim Added: projects/pseries/powerpc/pseries/rtas_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/pseries/powerpc/pseries/rtas_dev.c Sun May 22 02:18:18 2011 (r222169) @@ -0,0 +1,173 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * 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: projects/pseries/powerpc/powermac/rtasdev.c 193156 2009-05-31 09:01:23Z nwhitehorn $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "clock_if.h" + +static int rtasdev_probe(device_t); +static int rtasdev_attach(device_t); +/* clock interface */ +static int rtas_gettime(device_t dev, struct timespec *ts); +static int rtas_settime(device_t dev, struct timespec *ts); + +static void rtas_shutdown(void *arg, int howto); + +static device_method_t rtasdev_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rtasdev_probe), + DEVMETHOD(device_attach, rtasdev_attach), + + /* clock interface */ + DEVMETHOD(clock_gettime, rtas_gettime), + DEVMETHOD(clock_settime, rtas_settime), + + { 0, 0 }, +}; + +static driver_t rtasdev_driver = { + "rtas", + rtasdev_methods, + 0 +}; + +static devclass_t rtasdev_devclass; + +DRIVER_MODULE(rtasdev, nexus, rtasdev_driver, rtasdev_devclass, 0, 0); + +static int +rtasdev_probe(device_t dev) +{ + const char *name = ofw_bus_get_name(dev); + + if (strcmp(name, "rtas") != 0) + return (ENXIO); + if (!rtas_exists()) + return (ENXIO); + + device_set_desc(dev, "Run-Time Abstraction Services"); + return (0); +} + +static int +rtasdev_attach(device_t dev) +{ + if (rtas_token_lookup("get-time-of-day") != -1) + clock_register(dev, 2000); + + EVENTHANDLER_REGISTER(shutdown_final, rtas_shutdown, NULL, + SHUTDOWN_PRI_LAST); + + return (0); +} + +static int +rtas_gettime(device_t dev, struct timespec *ts) { + struct clocktime ct; + cell_t tod[8]; + cell_t token; + int error; + + token = rtas_token_lookup("get-time-of-day"); + if (token == -1) + return (ENXIO); + error = rtas_call_method(token, 0, 8, &tod[0], &tod[1], &tod[2], + &tod[3], &tod[4], &tod[5], &tod[6], &tod[7]); + if (error < 0) + return (ENXIO); + if (tod[0] != 0) + return ((tod[0] == -1) ? ENXIO : EAGAIN); + + ct.year = tod[1]; + ct.mon = tod[2]; + ct.day = tod[3]; + ct.hour = tod[4]; + ct.min = tod[5]; + ct.sec = tod[6]; + ct.nsec = tod[7]; + + return (clock_ct_to_ts(&ct, ts)); +} + +static int +rtas_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + cell_t token, status; + int error; + + token = rtas_token_lookup("set-time-of-day"); + if (token == -1) + return (ENXIO); + + clock_ts_to_ct(ts, &ct); + error = rtas_call_method(token, 7, 1, ct.year, ct.mon, ct.day, ct.hour, + ct.min, ct.min, ct.sec, ct.nsec, &status); + if (error < 0) + return (ENXIO); + if (status != 0) + return (((int)status < 0) ? ENXIO : EAGAIN); + + return (0); +} + +static void +rtas_shutdown(void *arg, int howto) +{ + cell_t token, status; + + if (howto & RB_HALT) { + token = rtas_token_lookup("power-off"); + if (token == -1) + return; + + rtas_call_method(token, 2, 1, 0, 0, &status); + } else { + token = rtas_token_lookup("system-reboot"); + if (token == -1) + return; + + rtas_call_method(token, 0, 1, &status); + } +} + From owner-svn-src-projects@FreeBSD.ORG Sun May 22 03:18:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1094106564A; Sun, 22 May 2011 03:18:25 +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 B22B48FC1A; Sun, 22 May 2011 03:18:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4M3IPon056842; Sun, 22 May 2011 03:18:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4M3IPRM056840; Sun, 22 May 2011 03:18:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105220318.p4M3IPRM056840@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 May 2011 03:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222170 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 03:18:25 -0000 Author: nwhitehorn Date: Sun May 22 03:18:25 2011 New Revision: 222170 URL: http://svn.freebsd.org/changeset/base/222170 Log: Fix a couple typos. Modified: projects/pseries/powerpc/pseries/rtas_dev.c Modified: projects/pseries/powerpc/pseries/rtas_dev.c ============================================================================== --- projects/pseries/powerpc/pseries/rtas_dev.c Sun May 22 02:18:18 2011 (r222169) +++ projects/pseries/powerpc/pseries/rtas_dev.c Sun May 22 03:18:25 2011 (r222170) @@ -118,12 +118,12 @@ rtas_gettime(device_t dev, struct timesp if (tod[0] != 0) return ((tod[0] == -1) ? ENXIO : EAGAIN); - ct.year = tod[1]; - ct.mon = tod[2]; - ct.day = tod[3]; - ct.hour = tod[4]; - ct.min = tod[5]; - ct.sec = tod[6]; + ct.year = tod[1]; + ct.mon = tod[2]; + ct.day = tod[3]; + ct.hour = tod[4]; + ct.min = tod[5]; + ct.sec = tod[6]; ct.nsec = tod[7]; return (clock_ct_to_ts(&ct, ts)); @@ -142,7 +142,7 @@ rtas_settime(device_t dev, struct timesp clock_ts_to_ct(ts, &ct); error = rtas_call_method(token, 7, 1, ct.year, ct.mon, ct.day, ct.hour, - ct.min, ct.min, ct.sec, ct.nsec, &status); + ct.min, ct.sec, ct.nsec, &status); if (error < 0) return (ENXIO); if (status != 0) From owner-svn-src-projects@FreeBSD.ORG Sun May 22 19:58:18 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81756106566B; Sun, 22 May 2011 19:58:18 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68AD08FC19; Sun, 22 May 2011 19:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MJwIQZ088270; Sun, 22 May 2011 19:58:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MJwIPe088265; Sun, 22 May 2011 19:58:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201105221958.p4MJwIPe088265@svn.freebsd.org> From: Sean Bruno Date: Sun, 22 May 2011 19:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222192 - in projects/stable_7_xen/sys: dev/xen/blkfront dev/xen/netfront xen/evtchn xen/xenstore X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 19:58:18 -0000 Author: sbruno Date: Sun May 22 19:58:18 2011 New Revision: 222192 URL: http://svn.freebsd.org/changeset/base/222192 Log: Update from Yahoo BSD 7 branch. This captures updates from FreeBSD -HEAD Obtained from: Yahoo! Inc. Modified: projects/stable_7_xen/sys/dev/xen/blkfront/blkfront.c projects/stable_7_xen/sys/dev/xen/netfront/netfront.c projects/stable_7_xen/sys/xen/evtchn/evtchn.c projects/stable_7_xen/sys/xen/xenstore/xenstore.c Modified: projects/stable_7_xen/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- projects/stable_7_xen/sys/dev/xen/blkfront/blkfront.c Sun May 22 19:56:14 2011 (r222191) +++ projects/stable_7_xen/sys/dev/xen/blkfront/blkfront.c Sun May 22 19:58:18 2011 (r222192) @@ -508,7 +508,7 @@ blkfront_initialize(struct xb_softc *sc) sc->ring_pages = 1; sc->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE); sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->max_request_size = sc->max_request_segments * PAGE_SIZE; + sc->max_request_size = (sc->max_request_segments - 1) * PAGE_SIZE; sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* Modified: projects/stable_7_xen/sys/dev/xen/netfront/netfront.c ============================================================================== --- projects/stable_7_xen/sys/dev/xen/netfront/netfront.c Sun May 22 19:56:14 2011 (r222191) +++ projects/stable_7_xen/sys/dev/xen/netfront/netfront.c Sun May 22 19:58:18 2011 (r222192) @@ -1277,7 +1277,6 @@ xennet_get_responses(struct netfront_inf struct mbuf *m, *m0, *m_prev; grant_ref_t ref = xennet_get_rx_ref(np, *cons); RING_IDX ref_cons = *cons; - int max = 5 /* MAX_TX_REQ_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; int frags = 1; int err = 0; u_long ret; @@ -1425,19 +1424,10 @@ next_skip_queue: } *list = m0; - if (unlikely(frags > max)) { - if (net_ratelimit()) - WPRINTK("Too many frags\n"); - printf("%s: too many frags %d > max %d\n", __func__, frags, - max); - err = E2BIG; - } - *cons += frags; - *pages_flipped_p = pages_flipped; - return err; + return (err); } static void Modified: projects/stable_7_xen/sys/xen/evtchn/evtchn.c ============================================================================== --- projects/stable_7_xen/sys/xen/evtchn/evtchn.c Sun May 22 19:56:14 2011 (r222191) +++ projects/stable_7_xen/sys/xen/evtchn/evtchn.c Sun May 22 19:58:18 2011 (r222192) @@ -615,6 +615,7 @@ static void xenpic_dynirq_enable_sou static void xenpic_dynirq_disable_source(struct intsrc *isrc, int); static void xenpic_dynirq_eoi_source(struct intsrc *isrc); static void xenpic_dynirq_enable_intr(struct intsrc *isrc); +static void xenpic_dynirq_disable_intr(struct intsrc *isrc); static void xenpic_pirq_enable_source(struct intsrc *isrc); static void xenpic_pirq_disable_source(struct intsrc *isrc, int); @@ -626,7 +627,7 @@ static int xenpic_vector(struct int static int xenpic_source_pending(struct intsrc *isrc); static void xenpic_suspend(struct pic* pic); static void xenpic_resume(struct pic* pic); -static void xenpic_assign_cpu(struct intsrc *, u_int apic_id); +static int xenpic_assign_cpu(struct intsrc *, u_int apic_id); struct pic xenpic_dynirq_template = { @@ -645,6 +646,7 @@ struct pic xenpic_pirq_template = { .pic_disable_source = xenpic_pirq_disable_source, .pic_eoi_source = xenpic_pirq_eoi_source, .pic_enable_intr = xenpic_pirq_enable_intr, + .pic_disable_intr = xenpic_dynirq_disable_intr, .pic_vector = xenpic_vector, .pic_source_pending = xenpic_source_pending, .pic_suspend = xenpic_suspend, @@ -702,6 +704,20 @@ xenpic_dynirq_enable_intr(struct intsrc mtx_unlock_spin(&irq_mapping_update_lock); } +static void +xenpic_dynirq_disable_intr(struct intsrc *isrc) +{ + unsigned int irq; + struct xenpic_intsrc *xp; + + xp = (struct xenpic_intsrc *)isrc; + mtx_lock_spin(&irq_mapping_update_lock); + irq = xenpic_vector(isrc); + mask_evtchn(evtchn_from_irq(irq)); + xp->xp_masked = 1; + mtx_unlock_spin(&irq_mapping_update_lock); +} + static void xenpic_dynirq_eoi_source(struct intsrc *isrc) { @@ -752,10 +768,11 @@ xenpic_resume(struct pic* pic) TODO; } -static void +static int xenpic_assign_cpu(struct intsrc *isrc, u_int apic_id) { TODO; + return (EOPNOTSUPP); } void Modified: projects/stable_7_xen/sys/xen/xenstore/xenstore.c ============================================================================== --- projects/stable_7_xen/sys/xen/xenstore/xenstore.c Sun May 22 19:56:14 2011 (r222191) +++ projects/stable_7_xen/sys/xen/xenstore/xenstore.c Sun May 22 19:58:18 2011 (r222192) @@ -1102,7 +1102,6 @@ xs_probe(device_t dev) * Uncontitionally return success. */ device_set_desc(dev, "XenStore"); -printf("xs_probe: Probe retuns 0\n"); return (0); } From owner-svn-src-projects@FreeBSD.ORG Sun May 22 20:19:01 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D73B1106564A; Sun, 22 May 2011 20:19:01 +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 C8D048FC0C; Sun, 22 May 2011 20:19:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MKJ1qQ088945; Sun, 22 May 2011 20:19:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MKJ1gd088943; Sun, 22 May 2011 20:19:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105222019.p4MKJ1gd088943@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 May 2011 20:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222193 - projects/largeSMP/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 20:19:01 -0000 Author: attilio Date: Sun May 22 20:19:01 2011 New Revision: 222193 URL: http://svn.freebsd.org/changeset/base/222193 Log: Fix a bug where the index cpu is just plain wrong, thus the kernel livelocks. Reported by: gonzo Modified: projects/largeSMP/sys/mips/mips/mp_machdep.c Modified: projects/largeSMP/sys/mips/mips/mp_machdep.c ============================================================================== --- projects/largeSMP/sys/mips/mips/mp_machdep.c Sun May 22 19:58:18 2011 (r222192) +++ projects/largeSMP/sys/mips/mips/mp_machdep.c Sun May 22 20:19:01 2011 (r222193) @@ -210,8 +210,9 @@ cpu_mp_setmaxid(void) last = 1; while ((cpu = cpusetobj_ffs(&cpumask)) != 0) { last = cpu; - mp_ncpus++; + cpu--; CPU_CLR(cpu, &cpumask); + mp_ncpus++; } if (mp_ncpus <= 0) mp_ncpus = 1; From owner-svn-src-projects@FreeBSD.ORG Sun May 22 20:24:36 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD2551065674; Sun, 22 May 2011 20:24:36 +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 BE82D8FC18; Sun, 22 May 2011 20:24:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MKOa30089145; Sun, 22 May 2011 20:24:36 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MKOaq7089142; Sun, 22 May 2011 20:24:36 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105222024.p4MKOaq7089142@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 May 2011 20:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222194 - in projects/largeSMP/sys/i386: i386 xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 20:24:36 -0000 Author: attilio Date: Sun May 22 20:24:36 2011 New Revision: 222194 URL: http://svn.freebsd.org/changeset/base/222194 Log: Add a "safety belt" check for lsb setting. I don't think it is really necessary because the cpumask is known to be != 0, but it is just in case. Requested by: kib Modified: projects/largeSMP/sys/i386/i386/pmap.c projects/largeSMP/sys/i386/xen/pmap.c Modified: projects/largeSMP/sys/i386/i386/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/i386/pmap.c Sun May 22 20:19:01 2011 (r222193) +++ projects/largeSMP/sys/i386/i386/pmap.c Sun May 22 20:24:36 2011 (r222194) @@ -1947,6 +1947,7 @@ pmap_lazyfix(pmap_t pmap) /* Find least significant set bit. */ lsb = cpusetobj_ffs(&mask); + MPASS(lsb != 0); lsb--; CPU_SETOF(lsb, &mask); mtx_lock_spin(&smp_ipi_mtx); Modified: projects/largeSMP/sys/i386/xen/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/xen/pmap.c Sun May 22 20:19:01 2011 (r222193) +++ projects/largeSMP/sys/i386/xen/pmap.c Sun May 22 20:24:36 2011 (r222194) @@ -1730,6 +1730,7 @@ pmap_lazyfix(pmap_t pmap) /* Find least significant set bit. */ lsb = cpusetobj_ffs(&mask); + MPASS(lsb != 0); lsb--; CPU_SETOF(lsb, &mask); mtx_lock_spin(&smp_ipi_mtx); From owner-svn-src-projects@FreeBSD.ORG Sun May 22 20:29:48 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DFE7106564A; Sun, 22 May 2011 20:29:48 +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 4F6228FC21; Sun, 22 May 2011 20:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MKTmIm089329; Sun, 22 May 2011 20:29:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MKTmog089327; Sun, 22 May 2011 20:29:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105222029.p4MKTmog089327@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 May 2011 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222195 - projects/largeSMP/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 20:29:48 -0000 Author: attilio Date: Sun May 22 20:29:47 2011 New Revision: 222195 URL: http://svn.freebsd.org/changeset/base/222195 Log: Make cpusetobj_strprint() prepare the string in order to print the least significant cpuset_t word at the outmost right part of the string (more far from the beginning of it). This follows the natural build of bits rappresentation in the words. Modified: projects/largeSMP/sys/kern/kern_cpuset.c Modified: projects/largeSMP/sys/kern/kern_cpuset.c ============================================================================== --- projects/largeSMP/sys/kern/kern_cpuset.c Sun May 22 20:24:36 2011 (r222194) +++ projects/largeSMP/sys/kern/kern_cpuset.c Sun May 22 20:29:47 2011 (r222195) @@ -650,12 +650,12 @@ cpusetobj_strprint(char *buf, const cpus bytesp = 0; bufsiz = CPUSETBUFSIZ; - for (i = 0; i < (_NCPUWORDS - 1); i++) { + for (i = _NCPUWORDS - 1; i > 0; i--) { bytesp = snprintf(tbuf, bufsiz, "%lx, ", set->__bits[i]); bufsiz -= bytesp; tbuf += bytesp; } - snprintf(tbuf, bufsiz, "%lx", set->__bits[_NCPUWORDS - 1]); + snprintf(tbuf, bufsiz, "%lx", set->__bits[0]); return (buf); } From owner-svn-src-projects@FreeBSD.ORG Sun May 22 20:41:11 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85E72106564A; Sun, 22 May 2011 20:41:11 +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 731B08FC0A; Sun, 22 May 2011 20:41:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MKfBSj089785; Sun, 22 May 2011 20:41:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MKfAGl089747; Sun, 22 May 2011 20:41:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105222041.p4MKfAGl089747@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 May 2011 20:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222197 - in projects/largeSMP: bin/ed bin/pax bin/ps bin/sh contrib/top lib/clang sbin/atacontrol sbin/hastd sbin/mount_reiserfs share/examples/diskless share/examples/drivers share/ex... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 20:41:11 -0000 Author: attilio Date: Sun May 22 20:41:10 2011 New Revision: 222197 URL: http://svn.freebsd.org/changeset/base/222197 Log: MFC Added: projects/largeSMP/tools/build/options/WITHOUT_KERNEL_SYMBOLS - copied unchanged from r222195, head/tools/build/options/WITHOUT_KERNEL_SYMBOLS projects/largeSMP/tools/regression/bin/sh/builtins/dot4.0 - copied unchanged from r222195, head/tools/regression/bin/sh/builtins/dot4.0 projects/largeSMP/tools/regression/bin/sh/parameters/positional1.0 - copied unchanged from r222195, head/tools/regression/bin/sh/parameters/positional1.0 projects/largeSMP/tools/regression/bin/sh/parser/alias4.0 - copied unchanged from r222195, head/tools/regression/bin/sh/parser/alias4.0 projects/largeSMP/tools/regression/bin/sh/parser/alias5.0 - copied unchanged from r222195, head/tools/regression/bin/sh/parser/alias5.0 Modified: projects/largeSMP/bin/ed/POSIX projects/largeSMP/bin/pax/ar_io.c projects/largeSMP/bin/pax/ar_subs.c projects/largeSMP/bin/pax/buf_subs.c projects/largeSMP/bin/pax/cpio.c projects/largeSMP/bin/pax/file_subs.c projects/largeSMP/bin/pax/ftree.c projects/largeSMP/bin/pax/options.c projects/largeSMP/bin/pax/pat_rep.c projects/largeSMP/bin/pax/pax.c projects/largeSMP/bin/pax/sel_subs.c projects/largeSMP/bin/pax/tables.c projects/largeSMP/bin/pax/tar.c projects/largeSMP/bin/ps/ps.c projects/largeSMP/bin/sh/eval.c projects/largeSMP/bin/sh/main.c projects/largeSMP/bin/sh/mkinit.c projects/largeSMP/bin/sh/mktokens projects/largeSMP/bin/sh/parser.c projects/largeSMP/bin/sh/parser.h projects/largeSMP/bin/sh/sh.1 projects/largeSMP/lib/clang/clang.build.mk projects/largeSMP/sbin/atacontrol/atacontrol.8 projects/largeSMP/sbin/atacontrol/atacontrol.c projects/largeSMP/sbin/hastd/secondary.c projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.8 projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.c projects/largeSMP/share/examples/diskless/README.TEMPLATING projects/largeSMP/share/examples/drivers/make_device_driver.sh projects/largeSMP/share/examples/libvgl/demo.c projects/largeSMP/share/examples/netgraph/ether.bridge projects/largeSMP/share/examples/netgraph/frame_relay projects/largeSMP/share/examples/netgraph/ngctl projects/largeSMP/share/examples/netgraph/raw projects/largeSMP/share/examples/netgraph/virtual.chain projects/largeSMP/share/examples/netgraph/virtual.lan projects/largeSMP/share/man/man4/aio.4 projects/largeSMP/share/man/man4/ata.4 projects/largeSMP/share/man/man4/coretemp.4 projects/largeSMP/share/man/man4/ichwd.4 projects/largeSMP/share/man/man4/pst.4 projects/largeSMP/share/man/man4/ucycom.4 projects/largeSMP/share/man/man5/reiserfs.5 projects/largeSMP/share/man/man5/src.conf.5 projects/largeSMP/share/man/man9/LOCK_PROFILING.9 projects/largeSMP/share/man/man9/pseudofs.9 projects/largeSMP/share/man/man9/sbuf.9 projects/largeSMP/share/man/man9/zone.9 projects/largeSMP/share/misc/bsd-family-tree projects/largeSMP/share/mk/bsd.own.mk projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/largeSMP/sys/conf/kern.post.mk projects/largeSMP/sys/conf/kmod.mk projects/largeSMP/sys/dev/ath/ath_hal/ah.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/largeSMP/sys/fs/cd9660/cd9660_vfsops.c projects/largeSMP/sys/fs/ext2fs/ext2_vfsops.c projects/largeSMP/sys/fs/hpfs/hpfs_vfsops.c projects/largeSMP/sys/fs/msdosfs/msdosfs_vfsops.c projects/largeSMP/sys/fs/nfsclient/nfs_clvnops.c projects/largeSMP/sys/fs/nfsserver/nfs_nfsdport.c projects/largeSMP/sys/fs/ntfs/ntfs_vfsops.c projects/largeSMP/sys/fs/nullfs/null_vfsops.c projects/largeSMP/sys/fs/tmpfs/tmpfs_vfsops.c projects/largeSMP/sys/fs/udf/udf_vfsops.c projects/largeSMP/sys/fs/unionfs/union_vfsops.c projects/largeSMP/sys/gnu/fs/reiserfs/reiserfs_vfsops.c projects/largeSMP/sys/gnu/fs/xfs/FreeBSD/support/kdb.c projects/largeSMP/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c projects/largeSMP/sys/kern/vfs_default.c projects/largeSMP/sys/kern/vfs_syscalls.c projects/largeSMP/sys/modules/wlan/Makefile projects/largeSMP/sys/net80211/ieee80211_var.h projects/largeSMP/sys/nfsclient/nfs_vnops.c projects/largeSMP/sys/nfsserver/nfs_srvsubs.c projects/largeSMP/sys/nlm/nlm_prot_impl.c projects/largeSMP/sys/sys/mount.h projects/largeSMP/sys/sys/param.h projects/largeSMP/sys/ufs/ffs/ffs_vfsops.c projects/largeSMP/sys/ufs/ufs/ufs_extern.h projects/largeSMP/sys/ufs/ufs/ufs_vfsops.c projects/largeSMP/sys/vm/uma_core.c projects/largeSMP/sys/vm/uma_int.h projects/largeSMP/tools/tools/iso/check-iso3166.pl projects/largeSMP/usr.sbin/makefs/cd9660.c projects/largeSMP/usr.sbin/makefs/cd9660.h projects/largeSMP/usr.sbin/makefs/cd9660/cd9660_eltorito.c projects/largeSMP/usr.sbin/makefs/makefs.8 Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/bin/ed/POSIX ============================================================================== --- projects/largeSMP/bin/ed/POSIX Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/ed/POSIX Sun May 22 20:41:10 2011 (r222197) @@ -75,7 +75,7 @@ DEVIATIONS 2) Since the behavior of `u' (undo) within a `g' (global) command list is not specified by POSIX, it follows the behavior of the SunOS ed: undo forces a global command list to be executed only once, rather than - for each line matching a global pattern. In addtion, each instance of + for each line matching a global pattern. In addition, each instance of `u' within a global command undoes all previous commands (including undo's) in the command list. This seems the best way, since the alternatives are either too complicated to implement or too confusing @@ -83,7 +83,7 @@ DEVIATIONS The global/undo combination is useful for masking errors that would otherwise cause a script to fail. For instance, an ed script - to remove any occurences of either `censor1' or `censor2' might be + to remove any occurrences of either `censor1' or `censor2' might be written as: ed - file <= 0) { @@ -794,7 +794,7 @@ ar_rdsync(void) /* * ar_fow() - * Move the I/O position within the archive foward the specified number of + * Move the I/O position within the archive forward the specified number of * bytes as supported by the device. If we cannot move the requested * number of bytes, return the actual number of bytes moved in skipped. * Return: @@ -813,7 +813,7 @@ ar_fow(off_t sksz, off_t *skipped) return(0); /* - * we cannot move foward at EOF or error + * we cannot move forward at EOF or error */ if (lstrval <= 0) return(lstrval); @@ -822,7 +822,7 @@ ar_fow(off_t sksz, off_t *skipped) * Safer to read forward on devices where it is hard to find the end of * the media without reading to it. With tapes we cannot be sure of the * number of physical blocks to skip (we do not know physical block - * size at this point), so we must only read foward on tapes! + * size at this point), so we must only read forward on tapes! */ if (artyp != ISREG) return(0); @@ -907,7 +907,7 @@ ar_rev(off_t sksz) /* * we may try to go backwards past the start when the archive - * is only a single record. If this hapens and we are on a + * is only a single record. If this happens and we are on a * multi volume archive, we need to go to the end of the * previous volume and continue our movement backwards from * there. @@ -1046,7 +1046,7 @@ get_phys(void) } /* - * read foward to the file mark, then back up in front of the filemark + * read forward to the file mark, then back up in front of the filemark * (this is a bit paranoid, but should be safe to do). */ while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0) Modified: projects/largeSMP/bin/pax/ar_subs.c ============================================================================== --- projects/largeSMP/bin/pax/ar_subs.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/ar_subs.c Sun May 22 20:41:10 2011 (r222197) @@ -854,7 +854,7 @@ copy(void) } /* - * Non standard -Y and -Z flag. When the exisiting file is + * Non standard -Y and -Z flag. When the existing file is * same age or newer skip */ if ((Yflag || Zflag) && ((lstat(arcn->name, &sb) == 0))) { @@ -1096,7 +1096,7 @@ next_head(ARCHD *arcn) } /* - * ok got a valid header, check for trailer if format encodes it in the + * ok got a valid header, check for trailer if format encodes it in * the header. */ if (frmt->inhead && ((*frmt->trail_cpio)(arcn) == 0)) { Modified: projects/largeSMP/bin/pax/buf_subs.c ============================================================================== --- projects/largeSMP/bin/pax/buf_subs.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/buf_subs.c Sun May 22 20:41:10 2011 (r222197) @@ -145,7 +145,7 @@ rd_start(void) } if (wrblksz % BLKMULT) { paxwarn(1, "Write block size %d is not a %d byte multiple", - wrblksz, BLKMULT); + wrblksz, BLKMULT); return(-1); } } @@ -182,13 +182,13 @@ cp_start(void) * the start of the header of the first file added to the archive. The * format specific end read function tells us how many bytes to move * backwards in the archive to be positioned BEFORE the trailer. Two - * different postions have to be adjusted, the O.S. file offset (e.g. the + * different positions have to be adjusted, the O.S. file offset (e.g. the * position of the tape head) and the write point within the data we have * stored in the read (soon to become write) buffer. We may have to move * back several records (the number depends on the size of the archive * record and the size of the format trailer) to read up the record where * the first byte of the trailer is recorded. Trailers may span (and - * overlap) record boundries. + * overlap) record boundaries. * We first calculate which record has the first byte of the trailer. We * move the OS file offset back to the start of this record and read it * up. We set the buffer write pointer to be at this byte (the byte where @@ -196,10 +196,10 @@ cp_start(void) * start of this record so a flush of this buffer will replace the record * in the archive. * A major problem is rewriting this last record. For archives stored - * on disk files, this is trival. However, many devices are really picky + * on disk files, this is trivial. However, many devices are really picky * about the conditions under which they will allow a write to occur. * Often devices restrict the conditions where writes can be made writes, - * so it may not be feasable to append archives stored on all types of + * so it may not be feasible to append archives stored on all types of * devices. * Return: * 0 for success, -1 for failure @@ -365,7 +365,7 @@ rd_sync(void) * pback() * push the data used during the archive id phase back into the I/O * buffer. This is required as we cannot be sure that the header does NOT - * overlap a block boundry (as in the case we are trying to recover a + * overlap a block boundary (as in the case we are trying to recover a * flawed archived). This was not designed to be used for any other * purpose. (What software engineering, HA!) * WARNING: do not even THINK of pback greater than BLKMULT, unless the @@ -382,7 +382,7 @@ pback(char *pt, int cnt) /* * rd_skip() - * skip foward in the archive during an archive read. Used to get quickly + * skip forward in the archive during an archive read. Used to get quickly * past file data and padding for files the user did NOT select. * Return: * 0 if ok, -1 failure, and 1 when EOF on the archive volume was detected. @@ -396,7 +396,7 @@ rd_skip(off_t skcnt) off_t skipped = 0; /* - * consume what data we have in the buffer. If we have to move foward + * consume what data we have in the buffer. If we have to move forward * whole records, we call the low level skip function to see if we can * move within the archive without doing the expensive reads on data we * do not want. @@ -453,7 +453,7 @@ rd_skip(off_t skcnt) * wr_fin() * flush out any data (and pad if required) the last block. We always pad * with zero (even though we do not have to). Padding with 0 makes it a - * lot easier to recover if the archive is damaged. zero paddding SHOULD + * lot easier to recover if the archive is damaged. zero padding SHOULD * BE a requirement.... */ @@ -530,7 +530,7 @@ rd_wrbuf(char *in, int cpcnt) /* * read error, return what we got (or the error if * no data was copied). The caller must know that an - * error occured and has the best knowledge what to + * error occurred and has the best knowledge what to * do with it */ if ((res = cpcnt - incnt) > 0) @@ -584,7 +584,7 @@ wr_skip(off_t skcnt) /* * wr_rdfile() - * fill write buffer with the contents of a file. We are passed an open + * fill write buffer with the contents of a file. We are passed an open * file descriptor to the file and the archive structure that describes the * file we are storing. The variable "left" is modified to contain the * number of bytes of the file we were NOT able to write to the archive. @@ -671,7 +671,7 @@ rd_wrfile(ARCHD *arcn, int ofd, off_t *l int isem = 1; int rem; int sz = MINFBSZ; - struct stat sb; + struct stat sb; u_long crc = 0L; /* @@ -884,7 +884,7 @@ buf_flush(int bufcnt) /* * if we have reached the user specified byte count for each archive - * volume, prompt for the next volume. (The non-standrad -R flag). + * volume, prompt for the next volume. (The non-standard -R flag). * NOTE: If the wrlimit is smaller than wrcnt, we will always write * at least one record. We always round limit UP to next blocksize. */ @@ -944,7 +944,7 @@ buf_flush(int bufcnt) } else if (cnt > 0) { /* * Oh drat we got a partial write! - * if format doesnt care about alignment let it go, + * if format doesn't care about alignment let it go, * we warned the user in ar_write().... but this means * the last record on this volume violates pax spec.... */ Modified: projects/largeSMP/bin/pax/cpio.c ============================================================================== --- projects/largeSMP/bin/pax/cpio.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/cpio.c Sun May 22 20:41:10 2011 (r222197) @@ -627,7 +627,7 @@ vcpio_rd(ARCHD *arcn, char *buf) return(-1); /* - * skip padding. header + filename is aligned to 4 byte boundries + * skip padding. header + filename is aligned to 4 byte boundaries */ if (rd_skip((off_t)(VCPIO_PAD(sizeof(HD_VCPIO) + nsz))) < 0) return(-1); @@ -942,7 +942,7 @@ bcpio_rd(ARCHD *arcn, char *buf) return(-1); /* - * header + file name are aligned to 2 byte boundries, skip if needed + * header + file name are aligned to 2 byte boundaries, skip if needed */ if (rd_skip((off_t)(BCPIO_PAD(sizeof(HD_BCPIO) + nsz))) < 0) return(-1); @@ -989,8 +989,8 @@ bcpio_endrd(void) * bcpio_wr() * copy the data in the ARCHD to buffer in old binary cpio format * There is a real chance of field overflow with this critter. So we - * always check the conversion is ok. nobody in his their right mind - * should write an achive in this format... + * always check that the conversion is ok. nobody in their right mind + * should write an archive in this format... * Return * 0 if file has data to be written after the header, 1 if file has NO * data to write after the header, -1 if archive write failed Modified: projects/largeSMP/bin/pax/file_subs.c ============================================================================== --- projects/largeSMP/bin/pax/file_subs.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/file_subs.c Sun May 22 20:41:10 2011 (r222197) @@ -84,9 +84,9 @@ file_creat(ARCHD *arcn) * works. We have to take special handling when the file does exist. To * detect this, we use O_EXCL. For example when trying to create a * file and a character device or fifo exists with the same name, we - * can accidently open the device by mistake (or block waiting to open) - * If we find that the open has failed, then figure spend the effort to - * figure out why. This strategy was found to have better average + * can accidentally open the device by mistake (or block waiting to + * open). If we find that the open has failed, then spend the effort + * to figure out why. This strategy was found to have better average * performance in common use than checking the file (and the path) * first with lstat. */ @@ -559,7 +559,7 @@ chk_path( char *name, uid_t st_uid, gid_ for(;;) { /* - * work foward from the first / and check each part of the path + * work forward from the first / and check each part of the path */ spt = strchr(spt, '/'); if (spt == NULL) @@ -600,7 +600,7 @@ chk_path( char *name, uid_t st_uid, gid_ (void)set_ids(name, st_uid, st_gid); /* - * make sure the user doen't have some strange umask that + * make sure the user doesn't have some strange umask that * causes this newly created directory to be unusable. We fix * the modes and restore them back to the creation default at * the end of pax @@ -716,11 +716,11 @@ set_pmode(char *fnm, mode_t mode) * uses lseek whenever it detects the input data is all 0 within that * file block. In more detail, the strategy is as follows: * While the input is all zero keep doing an lseek. Keep track of when we - * pass over file block boundries. Only write when we hit a non zero + * pass over file block boundaries. Only write when we hit a non zero * input. once we have written a file block, we continue to write it to * the end (we stop looking at the input). When we reach the start of the * next file block, start checking for zero blocks again. Working on file - * block boundries significantly reduces the overhead when copying files + * block boundaries significantly reduces the overhead when copying files * that are NOT very sparse. This overhead (when compared to a write) is * almost below the measurement resolution on many systems. Without it, * files with holes cannot be safely copied. It does has a side effect as @@ -923,7 +923,7 @@ set_crc(ARCHD *arcn, int fd) /* * safety check. we want to avoid archiving files that are active as - * they can create inconsistant archive copies. + * they can create inconsistent archive copies. */ if (cpcnt != arcn->sb.st_size) paxwarn(1, "File changed size %s", arcn->org_name); Modified: projects/largeSMP/bin/pax/ftree.c ============================================================================== --- projects/largeSMP/bin/pax/ftree.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/ftree.c Sun May 22 20:41:10 2011 (r222197) @@ -101,8 +101,8 @@ ftree_start(void) /* * optional user flags that effect file traversal * -H command line symlink follow only (half follow) - * -L follow sylinks (logical) - * -P do not follow sylinks (physical). This is the default. + * -L follow symlinks (logical) + * -P do not follow symlinks (physical). This is the default. * -X do not cross over mount points * -t preserve access times on files read. * -n select only the first member of a file tree when a match is found Modified: projects/largeSMP/bin/pax/options.c ============================================================================== --- projects/largeSMP/bin/pax/options.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/options.c Sun May 22 20:41:10 2011 (r222197) @@ -887,7 +887,7 @@ tar_options(int argc, char **argv) sawpat = 1; } /* - * if patterns were added, we are doing chdir() + * if patterns were added, we are doing chdir() * on a file-by-file basis, else, just one * global chdir (if any) after opening input. */ Modified: projects/largeSMP/bin/pax/pat_rep.c ============================================================================== --- projects/largeSMP/bin/pax/pat_rep.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/pat_rep.c Sun May 22 20:41:10 2011 (r222197) @@ -397,7 +397,7 @@ pat_sel(ARCHD *arcn) /* * should never happen.... */ - paxwarn(1, "Pattern list inconsistant"); + paxwarn(1, "Pattern list inconsistent"); return(-1); } *ppt = pt->fow; Modified: projects/largeSMP/bin/pax/pax.c ============================================================================== --- projects/largeSMP/bin/pax/pax.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/pax.c Sun May 22 20:41:10 2011 (r222197) @@ -372,7 +372,7 @@ gen_init(void) /* * signal handling to reset stored directory times and modes. Since * we deal with broken pipes via failed writes we ignore it. We also - * deal with any file size limit thorugh failed writes. Cpu time + * deal with any file size limit thorough failed writes. Cpu time * limits are caught and a cleanup is forced. */ if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) || Modified: projects/largeSMP/bin/pax/sel_subs.c ============================================================================== --- projects/largeSMP/bin/pax/sel_subs.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/sel_subs.c Sun May 22 20:41:10 2011 (r222197) @@ -376,7 +376,7 @@ trng_add(char *str) } /* - * by default we only will check file mtime, but usee can specify + * by default we only will check file mtime, but the user can specify * mtime, ctime (inode change time) or both. */ if ((flgpt == NULL) || (*flgpt == '\0')) Modified: projects/largeSMP/bin/pax/tables.c ============================================================================== --- projects/largeSMP/bin/pax/tables.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/tables.c Sun May 22 20:41:10 2011 (r222197) @@ -209,7 +209,7 @@ chk_lnk(ARCHD *arcn) * purg_lnk * remove reference for a file that we may have added to the data base as * a potential source for hard links. We ended up not using the file, so - * we do not want to accidently point another file at it later on. + * we do not want to accidentally point another file at it later on. */ void @@ -306,14 +306,14 @@ lnk_end(void) * An append with an -u must read the archive and store the modification time * for every file on that archive before starting the write phase. It is clear * that this is one HUGE database. To save memory space, the actual file names - * are stored in a scatch file and indexed by an in memory hash table. The + * are stored in a scratch file and indexed by an in memory hash table. The * hash table is indexed by hashing the file path. The nodes in the table store * the length of the filename and the lseek offset within the scratch file * where the actual name is stored. Since there are never any deletions to this * table, fragmentation of the scratch file is never an issue. Lookups seem to * not exhibit any locality at all (files in the database are rarely * looked up more than once...). So caching is just a waste of memory. The - * only limitation is the amount of scatch file space available to store the + * only limitation is the amount of scratch file space available to store the * path names. */ Modified: projects/largeSMP/bin/pax/tar.c ============================================================================== --- projects/largeSMP/bin/pax/tar.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/pax/tar.c Sun May 22 20:41:10 2011 (r222197) @@ -291,7 +291,7 @@ tar_chksm(char *blk, int len) /* * tar_id() * determine if a block given to us is a valid tar header (and not a USTAR - * header). We have to be on the lookout for those pesky blocks of all + * header). We have to be on the lookout for those pesky blocks of all * zero's. * Return: * 0 if a tar header, -1 otherwise Modified: projects/largeSMP/bin/ps/ps.c ============================================================================== --- projects/largeSMP/bin/ps/ps.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/ps/ps.c Sun May 22 20:41:10 2011 (r222197) @@ -219,7 +219,7 @@ main(int argc, char *argv[]) case 'A': /* * Exactly the same as `-ax'. This has been - * added for compatability with SUSv3, but for + * added for compatibility with SUSv3, but for * now it will not be described in the man page. */ nselectors++; Modified: projects/largeSMP/bin/sh/eval.c ============================================================================== --- projects/largeSMP/bin/sh/eval.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/eval.c Sun May 22 20:41:10 2011 (r222197) @@ -714,15 +714,9 @@ evalcommand(union node *cmd, int flags, oexitstatus = exitstatus; exitstatus = 0; for (argp = cmd->ncmd.args ; argp ; argp = argp->narg.next) { - char *p = argp->narg.text; - if (varflag && is_name(*p)) { - do { - p++; - } while (is_in_name(*p)); - if (*p == '=') { - expandarg(argp, &varlist, EXP_VARTILDE); - continue; - } + if (varflag && isassignment(argp->narg.text)) { + expandarg(argp, &varlist, EXP_VARTILDE); + continue; } expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); varflag = 0; Modified: projects/largeSMP/bin/sh/main.c ============================================================================== --- projects/largeSMP/bin/sh/main.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/main.c Sun May 22 20:41:10 2011 (r222197) @@ -281,7 +281,6 @@ readcmdfile(const char *name) static char * find_dot_file(char *basename) { - static char localname[FILENAME_MAX+1]; char *fullname; const char *path = pathval(); struct stat statb; @@ -291,10 +290,14 @@ find_dot_file(char *basename) return basename; while ((fullname = padvance(&path, basename)) != NULL) { - strcpy(localname, fullname); + if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) { + /* + * Don't bother freeing here, since it will + * be freed by the caller. + */ + return fullname; + } stunalloc(fullname); - if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) - return localname; } return basename; } Modified: projects/largeSMP/bin/sh/mkinit.c ============================================================================== --- projects/largeSMP/bin/sh/mkinit.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/mkinit.c Sun May 22 20:41:10 2011 (r222197) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); /* - * A text structure is basicly just a string that grows as more characters + * A text structure is basically just a string that grows as more characters * are added onto the end of it. It is implemented as a linked list of * blocks of characters. The routines addstr and addchar append a string * or a single character, respectively, to a text structure. Writetext Modified: projects/largeSMP/bin/sh/mktokens ============================================================================== --- projects/largeSMP/bin/sh/mktokens Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/mktokens Sun May 22 20:41:10 2011 (r222197) @@ -50,7 +50,6 @@ TPIPE 0 "|" TLP 0 "(" TRP 1 ")" TENDCASE 1 ";;" -TENDBQUOTE 1 "`" TREDIR 0 redirection TWORD 0 word TIF 0 "if" Modified: projects/largeSMP/bin/sh/parser.c ============================================================================== --- projects/largeSMP/bin/sh/parser.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/parser.c Sun May 22 20:41:10 2011 (r222197) @@ -619,6 +619,7 @@ simplecmd(union node **rpp, union node * union node **orig_rpp = rpp; union node *n = NULL; int special; + int savecheckkwd; /* If we don't have any redirections already, then we must reset */ /* rpp to be the address of the local redir variable. */ @@ -634,7 +635,10 @@ simplecmd(union node **rpp, union node * */ orig_rpp = rpp; + savecheckkwd = CHKALIAS; + for (;;) { + checkkwd = savecheckkwd; if (readtoken() == TWORD) { n = (union node *)stalloc(sizeof (struct narg)); n->type = NARG; @@ -642,6 +646,8 @@ simplecmd(union node **rpp, union node * n->narg.backquote = backquotelist; *app = n; app = &n->narg.next; + if (savecheckkwd != 0 && !isassignment(wordtext)) + savecheckkwd = 0; } else if (lasttoken == TREDIR) { *rpp = n = redirnode; rpp = &n->nfile.next; @@ -1859,6 +1865,22 @@ goodname(const char *name) } +int +isassignment(const char *p) +{ + if (!is_name(*p)) + return 0; + p++; + for (;;) { + if (*p == '=') + return 1; + else if (!is_in_name(*p)) + return 0; + p++; + } +} + + /* * Called when an unexpected token is read during the parse. The argument * is the token that is expected, or -1 if more than one type of token can Modified: projects/largeSMP/bin/sh/parser.h ============================================================================== --- projects/largeSMP/bin/sh/parser.h Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/parser.h Sun May 22 20:41:10 2011 (r222197) @@ -80,4 +80,5 @@ extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); int goodname(const char *); +int isassignment(const char *); char *getprompt(void *); Modified: projects/largeSMP/bin/sh/sh.1 ============================================================================== --- projects/largeSMP/bin/sh/sh.1 Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/bin/sh/sh.1 Sun May 22 20:41:10 2011 (r222197) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 20, 2011 +.Dd May 21, 2011 .Dt SH 1 .Os .Sh NAME @@ -506,8 +506,8 @@ The following are keywords: An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a keyword may occur (see above), -and after checking for keywords, the shell +Wherever the command word of a simple command may occur, +and after checking for keywords if a keyword may occur, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called Modified: projects/largeSMP/lib/clang/clang.build.mk ============================================================================== --- projects/largeSMP/lib/clang/clang.build.mk Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/lib/clang/clang.build.mk Sun May 22 20:41:10 2011 (r222197) @@ -15,7 +15,7 @@ CFLAGS+= -O1 TARGET_ARCH?= ${MACHINE_ARCH} # XXX: 8.0, to keep __FreeBSD_cc_version happy -CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" +CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd9.0\" .ifndef LLVM_REQUIRES_EH CXXFLAGS+=-fno-exceptions Modified: projects/largeSMP/sbin/atacontrol/atacontrol.8 ============================================================================== --- projects/largeSMP/sbin/atacontrol/atacontrol.8 Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/sbin/atacontrol/atacontrol.8 Sun May 22 20:41:10 2011 (r222197) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2000,2001,2002 Søren Schmidt +.\" Copyright (c) 2000,2001,2002 Søren Schmidt .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: projects/largeSMP/sbin/atacontrol/atacontrol.c ============================================================================== --- projects/largeSMP/sbin/atacontrol/atacontrol.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/sbin/atacontrol/atacontrol.c Sun May 22 20:41:10 2011 (r222197) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 - 2006 Søren Schmidt + * Copyright (c) 2000 - 2006 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: projects/largeSMP/sbin/hastd/secondary.c ============================================================================== --- projects/largeSMP/sbin/hastd/secondary.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/sbin/hastd/secondary.c Sun May 22 20:41:10 2011 (r222197) @@ -514,6 +514,7 @@ requnpack(struct hast_resource *res, str goto end; } switch (hio->hio_cmd) { + case HIO_FLUSH: case HIO_KEEPALIVE: break; case HIO_READ: Modified: projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.8 ============================================================================== --- projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.8 Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.8 Sun May 22 20:41:10 2011 (r222197) @@ -1,7 +1,7 @@ .\" .\" Copyright (c) 1993,1994 Christopher G. Demetriou .\" Copyright (c) 1999 Semen Ustimenko -.\" Copyright (c) 2005 Jean-Sébastien Pédron +.\" Copyright (c) 2005 Jean-Sébastien Pédron .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.c ============================================================================== --- projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/sbin/mount_reiserfs/mount_reiserfs.c Sun May 22 20:41:10 2011 (r222197) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Jean-Sébastien Pédron + * Copyright (c) 2005 Jean-Sébastien Pédron * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: projects/largeSMP/share/examples/diskless/README.TEMPLATING ============================================================================== --- projects/largeSMP/share/examples/diskless/README.TEMPLATING Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/diskless/README.TEMPLATING Sun May 22 20:41:10 2011 (r222197) @@ -136,7 +136,7 @@ be useful to set up clients and server f should never be overwritten by the templating copy. - TYPICAL CUSTOMIZED CONFIGRATION SOFTLINKS + TYPICAL CUSTOMIZED CONFIGURATION SOFTLINKS The following files typically need to be turned into softlinks to /conf/ME/: @@ -261,9 +261,9 @@ be useful to set up clients and server f identity.pub WHEN INITIALLY CONVERTING A TARGET MACHINE TO USE TEMPLATING, ALWAYS - MAKE A FULL BACKUP OF THE TARGET MACHINE FIRST! You may accidently delete - files on the target during the conversion due to forgetting to enter - items into appropriate .cpignore files on the source. + MAKE A FULL BACKUP OF THE TARGET MACHINE FIRST! You may accidentally + delete files on the target during the conversion due to forgetting to + enter items into appropriate .cpignore files on the source. SECURITY CONSIDERATIONS WITH NFS ROOT EXPORT FROM TEMPLATE MACHINE SECURITY CONSIDERATIONS WITH NFS USR EXPORT FROM TEMPLATE MACHINE Modified: projects/largeSMP/share/examples/drivers/make_device_driver.sh ============================================================================== --- projects/largeSMP/share/examples/drivers/make_device_driver.sh Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/drivers/make_device_driver.sh Sun May 22 20:41:10 2011 (r222197) @@ -485,7 +485,7 @@ ${1}_isa_probe (device_t device) /*rid*/0, membase, memsize); /* * We found one, return non-positive numbers.. - * Return -N if we cant handle it, but not well. + * Return -N if we can't handle it, but not well. * Return -2 if we would LIKE the device. * Return -1 if we want it a lot. * Return 0 if we MUST get the device. Modified: projects/largeSMP/share/examples/libvgl/demo.c ============================================================================== --- projects/largeSMP/share/examples/libvgl/demo.c Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/libvgl/demo.c Sun May 22 20:41:10 2011 (r222197) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1991-1997 Søren Schmidt + * Copyright (c) 1991-1997 Søren Schmidt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,15 +42,15 @@ main(int argc, char **argv) // set graphics mode, here 320x240 256 colors // supported modes are (from ): - // SW_VGA_CG320: std VGA 320x200 256 colors - // SW_VGA_MODEX: Modex VGA 320x240 256 colors - // SW_VGA_VG640: std VGA 640x480 16 colors + // SW_VGA_CG320: std VGA 320x200 256 colors + // SW_VGA_MODEX: Modex VGA 320x240 256 colors + // SW_VGA_VG640: std VGA 640x480 16 colors VGLInit(SW_VGA_MODEX); // initialize mouse and show pointer VGLMouseInit(VGL_MOUSESHOW); - // VGLDisplay is a ptr to a struct Bitmap defined and initialized by + // VGLDisplay is a ptr to a struct Bitmap defined and initialized by // libvgl. The Bitmap points directly to screen memory etc. xsize=VGLDisplay->Xsize; ysize=VGLDisplay->Ysize; @@ -61,7 +61,7 @@ main(int argc, char **argv) VGLClear(tmp, 0); // fill the screen with colored lines - for (y=0; yBitmap[i+256*j] = i%16; @@ -106,12 +106,12 @@ main(int argc, char **argv) // loop around drawing and copying while (++i) { VGLBitmapCopy(VGLDisplay, rand()%xsize, rand()%ysize, - VGLDisplay, rand()%xsize, rand()%ysize, - rand()%xsize, rand()%ysize); + VGLDisplay, rand()%xsize, rand()%ysize, + rand()%xsize, rand()%ysize); VGLLine(VGLDisplay, rand()%xsize, rand()%ysize, rand()%xsize, rand()%ysize, rand()%256); VGLEllipse(VGLDisplay, rand()%xsize, rand()%ysize, - rand()%xsize/2, rand()%ysize/2, rand()%256); + rand()%xsize/2, rand()%ysize/2, rand()%256); rand(); if (i > 1000) break; } @@ -120,4 +120,3 @@ main(int argc, char **argv) VGLEnd(); return 0; } - Modified: projects/largeSMP/share/examples/netgraph/ether.bridge ============================================================================== --- projects/largeSMP/share/examples/netgraph/ether.bridge Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/netgraph/ether.bridge Sun May 22 20:41:10 2011 (r222197) @@ -40,7 +40,7 @@ BRIDGE_NAME="bnet0" # machine as well then set ${LOCAL_IFACES} as well (they may also be # listed in ${BRIDGE_IFACES}). Of course, any ${LOCAL_IFACE} must # be ifconfig(8)ured separately. If you don't want a ${LOCAL_IFACE} -# then assign it the emtpy string. +# then assign it the empty string. BRIDGE_IFACES="de0 fxp0 fxp1" LOCAL_IFACES="fxp0 fxp1" Modified: projects/largeSMP/share/examples/netgraph/frame_relay ============================================================================== --- projects/largeSMP/share/examples/netgraph/frame_relay Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/netgraph/frame_relay Sun May 22 20:41:10 2011 (r222197) @@ -13,13 +13,13 @@ ngctl mkpeer ${CARD}: frame_relay rawdat # Link management protocol node. ngctl mkpeer ${CARD}:rawdata lmi dlci0 auto0 -# Also attach dlci 1023, as it needs both to try autoconfiguring. +# Also attach dlci 1023, as it needs both to try auto-configuring. # The Link management protocol is now alive and probing.. ngctl connect ${CARD}:rawdata ${CARD}:rawdata.dlci0 dlci1023 auto1023 # Attach the DLCI(channel) the Telco has assigned you to -# a node to hadle whatever protocol encapsulation your peer -# is using. In this case rfc1490 encapsulation. +# a node to handle whatever protocol encapsulation your peer +# is using. In this case RFC1490 encapsulation. ngctl mkpeer ${CARD}:rawdata rfc1490 dlci${DLCI} downstream @@ -34,8 +34,8 @@ ngctl mkpeer ${CARD}:rawdata.dlci${DLCI} # Then use ifconfig on interface ng0 as usual # A variant on this whole set might use the 'name' command to make it more -# readable. but it doesn't work if you have multiple lines or dlcis -# e.g. +# readable. But it doesn't work if you have multiple lines or dlcis +# e.g. # ngctl mkpeer ${CARD}: frame_relay rawdata downstream # ngctl name ${CARD}:rawdata mux # ngctl mkpeer mux: lmi dlci0 auto0 Modified: projects/largeSMP/share/examples/netgraph/ngctl ============================================================================== --- projects/largeSMP/share/examples/netgraph/ngctl Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/netgraph/ngctl Sun May 22 20:41:10 2011 (r222197) @@ -46,7 +46,7 @@ # Note that we used ngctl's ``name'' command to do this. However, # the following manually constructed netgraph message would have -# acomplished the exact same thing: +# accomplished the exact same thing: + msg foo name { name="fred" } @@ -85,7 +85,7 @@ # As soon as we sent the message, we got back a response. Here # ngctl is telling us that it received a control message with the -# NGF_RESP (response) flag set, the reponse was to a prior ``getname'' +# NGF_RESP (response) flag set, the response was to a prior ``getname'' # control message, that the originator was the node addressable # as ``fred:''. The message arguments field is then displayed to # us in its ASCII form. In this case, what we get back is a struct Modified: projects/largeSMP/share/examples/netgraph/raw ============================================================================== --- projects/largeSMP/share/examples/netgraph/raw Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/netgraph/raw Sun May 22 20:41:10 2011 (r222197) @@ -6,7 +6,7 @@ CARD=sr0 # create an interface "ng0" and attach it to the sync port. -# The packets had jolly well better be ip because we are not discriminating. +# The packets had jolly well better be IP because we are not discriminating. ngctl mkpeer ${CARD}: iface rawdata inet # if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g. Modified: projects/largeSMP/share/examples/netgraph/virtual.chain ============================================================================== --- projects/largeSMP/share/examples/netgraph/virtual.chain Sun May 22 20:39:07 2011 (r222196) +++ projects/largeSMP/share/examples/netgraph/virtual.chain Sun May 22 20:41:10 2011 (r222197) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2010, Yavuz Gokirmak +# Copyright (c) 2010, Yavuz Gokirmak # # All rights reserved. # @@ -14,7 +14,6 @@ # # $FreeBSD$ # -# # This script creates and connects n router like nodes. Complex wide # area topologies can be created with the help of script. # @@ -25,9 +24,9 @@ # # 0. Make your own copy of this example script. # -# 1. Edit the definition of ${TARGET_TOPOLOGY} to define your virtual +# 1. Edit the definition of ${TARGET_TOPOLOGY} to define your virtual # nodes. Virtual topology definition includes node names and their -# IP address. Target top. sytax: ( name|ip<->name|ip ... ) +# IP address. Target top. syntax: ( name|ip<->name|ip ... ) # Example 1: ( n1|10.0.2.1/30<->n2|10.0.2.2/30 ...) # Example 2: ( n1|2001:b90::14a/125<->n1|2001:b90::14b/125 ...) # @@ -35,21 +34,21 @@ # # 3. Add necessary static route commands for each virtual node. For # example assume you have three virtual nodes connected each other -# llike a chain ( n1 is connected to n2, n2 is connecte to n3 ). -# In order to estabklish connectivity among these virtual nodes, +# like a chain (n1 is connected to n2, n2 is connected to n3). +# In order to establish connectivity among these virtual nodes, # you have to add default routes to node n1 and node n3. Example # static route command is: -# STATIC_ROUTE0="jexec n1 route add -inet default 10.0.2.2" -# STATIC_ROUTE1="jexec n3 route add -inet default 10.0.2.5" -# After defining default routes with above format you have to set +# STATIC_ROUTE0="jexec n1 route add -inet default 10.0.2.2" +# STATIC_ROUTE1="jexec n3 route add -inet default 10.0.2.5" +# After defining default routes with above format you have to set # the total number of static route commands as: # STATIC_ROUTE_CNT=2 # # 4. Stop bridging by running this script with "stop" as the # command line argument. -# -# 5. This cript uses a template file in order to carry information -# between start and stop calls. +# +# 5. This script uses a template file in order to carry information +# between start and stop calls. # In the start call, the netgraph interfaces and jails are created. # At the stop phase, all created objects should be removed. # DO NOT delete the temporary file between the start and stop phases. @@ -84,8 +83,8 @@ # # -# List the names of virtual nodes and their IP addresses. Use ':' -# character to seperate node name from node IP address and netmask. +# List the names of virtual nodes and their IP addresses. Use ':' +# character to separate node name from node IP address and netmask. TARGET_TOPOLOGY="n1|10.0.2.1/30<->n2|10.0.2.2/30 n2|10.0.2.5/30<->n3|10.0.2.6/30 n2|10.0.2.9/30<->n4|10.0.2.10/30" STATIC_ROUTE0="jexec n1 route add -inet default 10.0.2.2" @@ -93,10 +92,10 @@ STATIC_ROUTE1="jexec n3 route add -inet STATIC_ROUTE2="jexec n4 route add -inet default 10.0.2.9" STATIC_ROUTE_CNT=3 -# MAC manifacturer prefix. This can be modified according to needs. -MAC_PREFIX="00:1d:92" +# MAC manufacturer prefix. This can be modified according to needs. +MAC_PREFIX="00:1d:92" -# Temporary file is important for proper execution of script. +# Temporary file is important for proper execution of script. TEMP_FILE="/var/tmp/.virtual.chain.tmp" # Set root directory for jails to be created. @@ -112,7 +111,7 @@ JAIL_PATH="/usr/jails/router" virtual_chain_start() { # Load netgraph KLD's as necessary. - + for KLD in ng_ether ng_bridge ng_eiface; do if ! kldstat -v | grep -qw ${KLD}; then echo -n "Loading ${KLD}.ko... " @@ -122,21 +121,21 @@ virtual_chain_start() { done # Reset all interfaces and jails. If temporary file can not be found - # script assumes that there is no previous configuration. - + # script assumes that there is no previous configuration. + if [ ! -e ${TEMP_FILE} ]; then echo "No previous configuration(${TEMP_FILE}) found to clean-up." else echo -n "Cleaning previous configuration..." virtual_chain_stop echo "done" - fi + fi - # Create temporary file for usage. This file includes generated + # Create temporary file for usage. This file includes generated # interface names and jail names. All bridges, interfaces and jails - # are written to file while created. In clean-up process written - # objects are cleaned (i.e removed) from system. - + # are written to file while created. In clean-up process written + # objects are cleaned (i.e. removed) from system. + if [ -e ${TEMP_FILE} ]; then touch ${TEMP_FILE} fi @@ -144,40 +143,40 @@ virtual_chain_start() { # Attach other interfaces as well. for CONNECTION in ${TARGET_TOPOLOGY}; do - + # Virtual connections are defined in TARGET_TOPOLOGY variable. # They have the form of 'nodeName|IPaddr'. Below two lines split - + PEER1=`echo ${CONNECTION} | awk -F"<->" '{print $1}'` PEER1_NAME=`echo ${PEER1} | awk -F"|" '{print $1}'` PEER1_IP=`echo ${PEER1} | awk -F"|" '{print $2}'` - + PEER2=`echo ${CONNECTION} | awk -F"<->" '{print $2}'` PEER2_NAME=`echo ${PEER2} | awk -F"|" '{print $1}'` PEER2_IP=`echo ${PEER2} | awk -F"|" '{print $2}'` # !!! if not created already.. - # Create virtual node (jail) with given name and using + # Create virtual node (jail) with given name and using # JAIL_PATH as root directory for jail. virtual_chain_create_peer_if_necessary ${PEER1_NAME} virtual_chain_create_peer_if_necessary ${PEER2_NAME} # create an interface for peer with the given peer IP. Get interface - # for future use; you will connect this interface to the other + # for future use; you will connect this interface to the other # peers' (PEER2) interface. virtual_chain_create_interface_with_ip ${PEER1_NAME} ${PEER1_IP} PEER1_INTERFACE=${RET_INTERFACE} - + # create an interface for peer with the given peer IP. Get interface - # for future use; you will connect this interface to the other + # for future use; you will connect this interface to the other # peers' (PEER2) interface. virtual_chain_create_interface_with_ip ${PEER2_NAME} ${PEER2_IP} PEER2_INTERFACE=${RET_INTERFACE} # Connect virtual interface to other interface. Syntax is : *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Sun May 22 21:46:55 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 834EF1065672; Sun, 22 May 2011 21:46:55 +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 722028FC15; Sun, 22 May 2011 21:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4MLkto6092002; Sun, 22 May 2011 21:46:55 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4MLkt2u091999; Sun, 22 May 2011 21:46:55 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105222146.p4MLkt2u091999@svn.freebsd.org> From: Attilio Rao Date: Sun, 22 May 2011 21:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222202 - in projects/largeSMP: contrib/top share/mk sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 21:46:55 -0000 Author: attilio Date: Sun May 22 21:46:55 2011 New Revision: 222202 URL: http://svn.freebsd.org/changeset/base/222202 Log: MFC Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/largeSMP/sys/ufs/ufs/ufs_vfsops.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun May 22 21:35:03 2011 (r222201) +++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun May 22 21:46:55 2011 (r222202) @@ -2069,7 +2069,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int VN_HOLD(*vpp); } ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + err = zfs_vnode_lock(*vpp, flags | LK_RETRY); if (err != 0) *vpp = NULL; return (err); @@ -2096,7 +2096,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int *vpp = ZTOV(zp); ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + err = zfs_vnode_lock(*vpp, flags | LK_RETRY); if (err == 0) vnode_create_vobject(*vpp, zp->z_size, curthread); else Modified: projects/largeSMP/sys/ufs/ufs/ufs_vfsops.c ============================================================================== --- projects/largeSMP/sys/ufs/ufs/ufs_vfsops.c Sun May 22 21:35:03 2011 (r222201) +++ projects/largeSMP/sys/ufs/ufs/ufs_vfsops.c Sun May 22 21:46:55 2011 (r222202) @@ -218,7 +218,7 @@ ufs_fhtovp(mp, ufhp, flags, vpp) struct vnode *nvp; int error; - error = VFS_VGET(mp, ufhp->ufid_ino, LK_EXCLUSIVE, &nvp); + error = VFS_VGET(mp, ufhp->ufid_ino, flags, &nvp); if (error) { *vpp = NULLVP; return (error); From owner-svn-src-projects@FreeBSD.ORG Mon May 23 01:17:30 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC3D106566B; Mon, 23 May 2011 01:17:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCABD8FC08; Mon, 23 May 2011 01:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4N1HU1B098523; Mon, 23 May 2011 01:17:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4N1HUCc098502; Mon, 23 May 2011 01:17:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105230117.p4N1HUCc098502@svn.freebsd.org> From: Attilio Rao Date: Mon, 23 May 2011 01:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222209 - in projects/largeSMP: contrib/binutils/binutils contrib/binutils/gas contrib/binutils/ld contrib/gcc contrib/gcclibs/libiberty contrib/top share/mk sys/amd64/conf sys/conf sys... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2011 01:17:31 -0000 Author: attilio Date: Mon May 23 01:17:30 2011 New Revision: 222209 URL: http://svn.freebsd.org/changeset/base/222209 Log: MFC Modified: projects/largeSMP/contrib/binutils/binutils/objcopy.c projects/largeSMP/contrib/binutils/binutils/readelf.c projects/largeSMP/contrib/binutils/binutils/strings.c projects/largeSMP/contrib/binutils/gas/read.h projects/largeSMP/contrib/binutils/gas/write.c projects/largeSMP/contrib/binutils/ld/ldlang.c projects/largeSMP/contrib/gcc/combine.c projects/largeSMP/contrib/gcc/emit-rtl.c projects/largeSMP/contrib/gcc/function.c projects/largeSMP/contrib/gcc/omp-low.c projects/largeSMP/contrib/gcc/tree-cfg.c projects/largeSMP/contrib/gcc/tree-vect-patterns.c projects/largeSMP/contrib/gcclibs/libiberty/regex.c projects/largeSMP/sys/amd64/conf/GENERIC projects/largeSMP/sys/conf/NOTES projects/largeSMP/sys/kern/kern_cpuset.c projects/largeSMP/sys/kern/kern_ktr.c projects/largeSMP/sys/sparc64/include/ktr.h projects/largeSMP/sys/sys/cpuset.h projects/largeSMP/sys/sys/ktr.h Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/contrib/binutils/binutils/objcopy.c ============================================================================== --- projects/largeSMP/contrib/binutils/binutils/objcopy.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/binutils/objcopy.c Mon May 23 01:17:30 2011 (r222209) @@ -1542,7 +1542,8 @@ copy_object (bfd *ibfd, bfd *obfd) /* Umm, not sure what to do in this case. */ debuglink_vma = 0x1000; - bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma); + (void) bfd_set_section_vma (obfd, gnu_debuglink_section, + debuglink_vma); } } Modified: projects/largeSMP/contrib/binutils/binutils/readelf.c ============================================================================== --- projects/largeSMP/contrib/binutils/binutils/readelf.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/binutils/readelf.c Mon May 23 01:17:30 2011 (r222209) @@ -9701,7 +9701,7 @@ process_archive (char *file_name, FILE * } if ((longnames_size & 1) != 0) - getc (file); + (void) getc (file); got = fread (&arhdr, 1, sizeof arhdr, file); if (got != sizeof arhdr) Modified: projects/largeSMP/contrib/binutils/binutils/strings.c ============================================================================== --- projects/largeSMP/contrib/binutils/binutils/strings.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/binutils/strings.c Mon May 23 01:17:30 2011 (r222209) @@ -593,7 +593,7 @@ print_strings (const char *filename, FIL case 8: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lo ", (unsigned long long) start); + printf ("%7llo ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -608,7 +608,7 @@ print_strings (const char *filename, FIL case 10: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Ld ", (unsigned long long) start); + printf ("%7lld ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -623,7 +623,7 @@ print_strings (const char *filename, FIL case 16: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lx ", (unsigned long long) start); + printf ("%7llx ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG Modified: projects/largeSMP/contrib/binutils/gas/read.h ============================================================================== --- projects/largeSMP/contrib/binutils/gas/read.h Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/gas/read.h Mon May 23 01:17:30 2011 (r222209) @@ -30,7 +30,7 @@ extern char *input_line_pointer; /* -> c #ifdef PERMIT_WHITESPACE #define SKIP_WHITESPACE() \ - ((*input_line_pointer == ' ') ? ++input_line_pointer : 0) + do { if (*input_line_pointer == ' ') ++input_line_pointer; } while (0) #else #define SKIP_WHITESPACE() know(*input_line_pointer != ' ' ) #endif Modified: projects/largeSMP/contrib/binutils/gas/write.c ============================================================================== --- projects/largeSMP/contrib/binutils/gas/write.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/gas/write.c Mon May 23 01:17:30 2011 (r222209) @@ -345,7 +345,7 @@ record_alignment (/* Segment to which al return; if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg)) - bfd_set_section_alignment (stdoutput, seg, align); + (void) bfd_set_section_alignment (stdoutput, seg, align); } int @@ -2247,7 +2247,7 @@ relax_segment (struct frag *segment_frag newf = frag_alloc (ob); obstack_blank_fast (ob, fragP->fr_var); - obstack_finish (ob); + (void) obstack_finish (ob); memcpy (newf, fragP, SIZEOF_STRUCT_FRAG); memcpy (newf->fr_literal, fragP->fr_literal + fragP->fr_fix, Modified: projects/largeSMP/contrib/binutils/ld/ldlang.c ============================================================================== --- projects/largeSMP/contrib/binutils/ld/ldlang.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/binutils/ld/ldlang.c Mon May 23 01:17:30 2011 (r222209) @@ -4274,9 +4274,10 @@ lang_size_sections_1 " section %s\n"), os->name); input = os->children.head->input_section.section; - bfd_set_section_vma (os->bfd_section->owner, - os->bfd_section, - bfd_section_vma (input->owner, input)); + (void) bfd_set_section_vma (os->bfd_section->owner, + os->bfd_section, + bfd_section_vma (input->owner, + input)); os->bfd_section->size = input->size; break; } @@ -4361,7 +4362,7 @@ lang_size_sections_1 os->name, (unsigned long) (newdot - savedot)); } - bfd_set_section_vma (0, os->bfd_section, newdot); + (void) bfd_set_section_vma (0, os->bfd_section, newdot); os->bfd_section->output_offset = 0; } Modified: projects/largeSMP/contrib/gcc/combine.c ============================================================================== --- projects/largeSMP/contrib/gcc/combine.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/combine.c Mon May 23 01:17:30 2011 (r222209) @@ -12442,7 +12442,7 @@ distribute_notes (rtx notes, rtx from_in REG_N_DEATHS (REGNO (XEXP (note, 0)))++; REG_NOTES (place2) = gen_rtx_fmt_ee (GET_CODE (note), - REG_NOTE_KIND (note), + GET_MODE (note), XEXP (note, 0), REG_NOTES (place2)); } Modified: projects/largeSMP/contrib/gcc/emit-rtl.c ============================================================================== --- projects/largeSMP/contrib/gcc/emit-rtl.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/emit-rtl.c Mon May 23 01:17:30 2011 (r222209) @@ -3210,7 +3210,7 @@ try_split (rtx pat, rtx trial, int last) { if (CALL_P (insn)) REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note), + = gen_rtx_EXPR_LIST (GET_MODE (note), XEXP (note, 0), REG_NOTES (insn)); insn = PREV_INSN (insn); @@ -3223,7 +3223,7 @@ try_split (rtx pat, rtx trial, int last) { if (JUMP_P (insn)) REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note), + = gen_rtx_EXPR_LIST (GET_MODE (note), XEXP (note, 0), REG_NOTES (insn)); insn = PREV_INSN (insn); @@ -4589,7 +4589,8 @@ set_unique_reg_note (rtx insn, enum reg_ return note; } - REG_NOTES (insn) = gen_rtx_EXPR_LIST (kind, datum, REG_NOTES (insn)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST ((enum machine_mode) kind, datum, + REG_NOTES (insn)); return REG_NOTES (insn); } @@ -5344,12 +5345,12 @@ emit_copy_of_insn_after (rtx insn, rtx a { if (GET_CODE (link) == EXPR_LIST) REG_NOTES (new) - = copy_insn_1 (gen_rtx_EXPR_LIST (REG_NOTE_KIND (link), + = copy_insn_1 (gen_rtx_EXPR_LIST (GET_MODE (link), XEXP (link, 0), REG_NOTES (new))); else REG_NOTES (new) - = copy_insn_1 (gen_rtx_INSN_LIST (REG_NOTE_KIND (link), + = copy_insn_1 (gen_rtx_INSN_LIST (GET_MODE (link), XEXP (link, 0), REG_NOTES (new))); } Modified: projects/largeSMP/contrib/gcc/function.c ============================================================================== --- projects/largeSMP/contrib/gcc/function.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/function.c Mon May 23 01:17:30 2011 (r222209) @@ -4008,22 +4008,19 @@ stack_protect_epilogue (void) /* Allow the target to compare Y with X without leaking either into a register. */ - switch (HAVE_stack_protect_test != 0) + if (HAVE_stack_protect_test != 0) { - case 1: tmp = gen_stack_protect_test (x, y, label); if (tmp) { emit_insn (tmp); - break; + goto done; } - /* FALLTHRU */ - - default: - emit_cmp_and_jump_insns (x, y, EQ, NULL_RTX, ptr_mode, 1, label); - break; } + emit_cmp_and_jump_insns (x, y, EQ, NULL_RTX, ptr_mode, 1, label); + done: + /* The noreturn predictor has been moved to the tree level. The rtl-level predictors estimate this branch about 20%, which isn't enough to get things moved out of line. Since this is the only extant case of adding Modified: projects/largeSMP/contrib/gcc/omp-low.c ============================================================================== --- projects/largeSMP/contrib/gcc/omp-low.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/omp-low.c Mon May 23 01:17:30 2011 (r222209) @@ -118,7 +118,7 @@ static tree maybe_lookup_decl_in_outer_c /* Find an OpenMP clause of type KIND within CLAUSES. */ static tree -find_omp_clause (tree clauses, enum tree_code kind) +find_omp_clause (tree clauses, enum omp_clause_code kind) { for (; clauses ; clauses = OMP_CLAUSE_CHAIN (clauses)) if (OMP_CLAUSE_CODE (clauses) == kind) Modified: projects/largeSMP/contrib/gcc/tree-cfg.c ============================================================================== --- projects/largeSMP/contrib/gcc/tree-cfg.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/tree-cfg.c Mon May 23 01:17:30 2011 (r222209) @@ -2854,7 +2854,7 @@ bsi_insert_before (block_stmt_iterator * { set_bb_for_stmt (t, i->bb); update_modified_stmts (t); - tsi_link_before (&i->tsi, t, m); + tsi_link_before (&i->tsi, t, (enum tsi_iterator_update) m); } @@ -2867,7 +2867,7 @@ bsi_insert_after (block_stmt_iterator *i { set_bb_for_stmt (t, i->bb); update_modified_stmts (t); - tsi_link_after (&i->tsi, t, m); + tsi_link_after (&i->tsi, t, (enum tsi_iterator_update) m); } Modified: projects/largeSMP/contrib/gcc/tree-vect-patterns.c ============================================================================== --- projects/largeSMP/contrib/gcc/tree-vect-patterns.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcc/tree-vect-patterns.c Mon May 23 01:17:30 2011 (r222209) @@ -487,7 +487,7 @@ vect_pattern_recog_1 ( } else { - enum tree_code vec_mode; + enum machine_mode vec_mode; enum insn_code icode; optab optab; Modified: projects/largeSMP/contrib/gcclibs/libiberty/regex.c ============================================================================== --- projects/largeSMP/contrib/gcclibs/libiberty/regex.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/contrib/gcclibs/libiberty/regex.c Mon May 23 01:17:30 2011 (r222209) @@ -149,7 +149,7 @@ char *realloc (); # include # ifndef bzero # ifndef _LIBC -# define bzero(s, n) (memset (s, '\0', n), (s)) +# define bzero(s, n) ((void) (memset (s, '\0', n), (s))) # else # define bzero(s, n) __bzero (s, n) # endif Modified: projects/largeSMP/sys/amd64/conf/GENERIC ============================================================================== --- projects/largeSMP/sys/amd64/conf/GENERIC Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/amd64/conf/GENERIC Mon May 23 01:17:30 2011 (r222209) @@ -75,6 +75,8 @@ options INVARIANT_SUPPORT # Extra sanit options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options KTR +options KTR_CPUMASK=("0x3") # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: projects/largeSMP/sys/conf/NOTES ============================================================================== --- projects/largeSMP/sys/conf/NOTES Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/conf/NOTES Mon May 23 01:17:30 2011 (r222209) @@ -441,7 +441,7 @@ options KTR options KTR_ENTRIES=1024 options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR -options KTR_CPUMASK=0x3 +options KTR_CPUMASK=("0x3") options KTR_VERBOSE # Modified: projects/largeSMP/sys/kern/kern_cpuset.c ============================================================================== --- projects/largeSMP/sys/kern/kern_cpuset.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/kern/kern_cpuset.c Mon May 23 01:17:30 2011 (r222209) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -660,6 +661,41 @@ cpusetobj_strprint(char *buf, const cpus } /* + * Build a valid cpuset_t object from a string representation. + * It expects an incoming buffer at least sized as CPUSETBUFSIZ. + */ +int +cpusetobj_strscan(cpuset_t *set, const char *buf) +{ + u_int nwords; + int i; + + if (strlen(buf) > CPUSETBUFSIZ - 1) + return (-1); + + /* Allow to pass a shorter version of the mask when necessary. */ + nwords = 1; + for (i = 0; buf[i] != '\0'; i++) + if (buf[i] == ',') + nwords++; + if (nwords > _NCPUWORDS) + return (-1); + + CPU_ZERO(set); + for (i = nwords - 1; i > 0; i--) { + if (!sscanf(buf, "%lx, ", &set->__bits[i])) + return (-1); + buf = strstr(buf, " "); + if (buf == NULL) + return (-1); + buf++; + } + if (!sscanf(buf, "%lx", &set->__bits[0])) + return (-1); + return (0); +} + +/* * Apply an anonymous mask to a single thread. */ int Modified: projects/largeSMP/sys/kern/kern_ktr.c ============================================================================== --- projects/largeSMP/sys/kern/kern_ktr.c Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/kern/kern_ktr.c Mon May 23 01:17:30 2011 (r222209) @@ -40,8 +40,10 @@ __FBSDID("$FreeBSD$"); #include "opt_alq.h" #include +#include #include #include +#include #include #include #include @@ -68,10 +70,6 @@ __FBSDID("$FreeBSD$"); #define KTR_MASK (0) #endif -#ifndef KTR_CPUMASK -#define KTR_CPUMASK (~0) -#endif - #ifndef KTR_TIME #define KTR_TIME get_cyclecount() #endif @@ -84,10 +82,10 @@ FEATURE(ktr, "Kernel support for KTR ker SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options"); -int ktr_cpumask = KTR_CPUMASK; -TUNABLE_INT("debug.ktr.cpumask", &ktr_cpumask); -SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, - &ktr_cpumask, 0, "Bitmask of CPUs on which KTR logging is enabled"); +static char ktr_cpumask[CPUSETBUFSIZ]; +TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask, sizeof(ktr_cpumask)); +SYSCTL_STRING(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, ktr_cpumask, + sizeof(ktr_cpumask), "Bitmask of CPUs on which KTR logging is enabled"); int ktr_mask = KTR_MASK; TUNABLE_INT("debug.ktr.mask", &ktr_mask); @@ -198,6 +196,7 @@ ktr_tracepoint(u_int mask, const char *f u_long arg1, u_long arg2, u_long arg3, u_long arg4, u_long arg5, u_long arg6) { + cpuset_t intern_cpumask; struct ktr_entry *entry; #ifdef KTR_ALQ struct ale *ale = NULL; @@ -212,8 +211,16 @@ ktr_tracepoint(u_int mask, const char *f return; if ((ktr_mask & mask) == 0) return; +#ifndef KTR_CPUMASK + CPU_FILL(&intern_cpumask); +#else + if (ktr_cpumask[0] == '\0') + strncpy(ktr_cpumask, KTR_CPUMASK, sizeof(ktr_cpumask)); + if (cpusetobj_strscan(&intern_cpumask, ktr_cpumask) == -1) + return; +#endif cpu = KTR_CPU; - if (((1 << cpu) & ktr_cpumask) == 0) + if (!CPU_ISSET(cpu, &intern_cpumask)) return; #if defined(KTR_VERBOSE) || defined(KTR_ALQ) td = curthread; Modified: projects/largeSMP/sys/sparc64/include/ktr.h ============================================================================== --- projects/largeSMP/sys/sparc64/include/ktr.h Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/sparc64/include/ktr.h Mon May 23 01:17:30 2011 (r222209) @@ -85,7 +85,9 @@ l2: add r2, 1, r3 ; \ lduw [PCPU(MID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ +#if 0 TEST(ktr_cpumask, r1, r2, r3, l3) ; \ +#endif ATR(desc, r1, r2, r3, l1, l2) #endif /* LOCORE */ Modified: projects/largeSMP/sys/sys/cpuset.h ============================================================================== --- projects/largeSMP/sys/sys/cpuset.h Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/sys/cpuset.h Mon May 23 01:17:30 2011 (r222209) @@ -216,6 +216,7 @@ int cpuset_create_root(struct prison *, int cpuset_setproc_update_set(struct proc *, struct cpuset *); int cpusetobj_ffs(const cpuset_t *); char *cpusetobj_strprint(char *, const cpuset_t *); +int cpusetobj_strscan(cpuset_t *, const char *); #else __BEGIN_DECLS Modified: projects/largeSMP/sys/sys/ktr.h ============================================================================== --- projects/largeSMP/sys/sys/ktr.h Sun May 22 22:28:07 2011 (r222208) +++ projects/largeSMP/sys/sys/ktr.h Mon May 23 01:17:30 2011 (r222209) @@ -107,7 +107,6 @@ struct ktr_entry { u_long ktr_parms[KTR_PARMS]; }; -extern int ktr_cpumask; extern int ktr_mask; extern int ktr_entries; extern int ktr_verbose; From owner-svn-src-projects@FreeBSD.ORG Mon May 23 23:50:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9451D1065670; Mon, 23 May 2011 23:50:21 +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 83D088FC19; Mon, 23 May 2011 23:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4NNoLCs043002; Mon, 23 May 2011 23:50:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4NNoLut042995; Mon, 23 May 2011 23:50:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105232350.p4NNoLut042995@svn.freebsd.org> From: Attilio Rao Date: Mon, 23 May 2011 23:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222235 - in projects/largeSMP/sys: conf kern sparc64/include sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2011 23:50:21 -0000 Author: attilio Date: Mon May 23 23:50:21 2011 New Revision: 222235 URL: http://svn.freebsd.org/changeset/base/222235 Log: Revert a patch that unvolountary sneaked in while I was MFCing. Modified: projects/largeSMP/sys/conf/NOTES projects/largeSMP/sys/kern/kern_cpuset.c projects/largeSMP/sys/kern/kern_ktr.c projects/largeSMP/sys/sparc64/include/ktr.h projects/largeSMP/sys/sys/cpuset.h projects/largeSMP/sys/sys/ktr.h Modified: projects/largeSMP/sys/conf/NOTES ============================================================================== --- projects/largeSMP/sys/conf/NOTES Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/conf/NOTES Mon May 23 23:50:21 2011 (r222235) @@ -441,7 +441,7 @@ options KTR options KTR_ENTRIES=1024 options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR -options KTR_CPUMASK=("0x3") +options KTR_CPUMASK=0x3 options KTR_VERBOSE # Modified: projects/largeSMP/sys/kern/kern_cpuset.c ============================================================================== --- projects/largeSMP/sys/kern/kern_cpuset.c Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/kern/kern_cpuset.c Mon May 23 23:50:21 2011 (r222235) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -661,41 +660,6 @@ cpusetobj_strprint(char *buf, const cpus } /* - * Build a valid cpuset_t object from a string representation. - * It expects an incoming buffer at least sized as CPUSETBUFSIZ. - */ -int -cpusetobj_strscan(cpuset_t *set, const char *buf) -{ - u_int nwords; - int i; - - if (strlen(buf) > CPUSETBUFSIZ - 1) - return (-1); - - /* Allow to pass a shorter version of the mask when necessary. */ - nwords = 1; - for (i = 0; buf[i] != '\0'; i++) - if (buf[i] == ',') - nwords++; - if (nwords > _NCPUWORDS) - return (-1); - - CPU_ZERO(set); - for (i = nwords - 1; i > 0; i--) { - if (!sscanf(buf, "%lx, ", &set->__bits[i])) - return (-1); - buf = strstr(buf, " "); - if (buf == NULL) - return (-1); - buf++; - } - if (!sscanf(buf, "%lx", &set->__bits[0])) - return (-1); - return (0); -} - -/* * Apply an anonymous mask to a single thread. */ int Modified: projects/largeSMP/sys/kern/kern_ktr.c ============================================================================== --- projects/largeSMP/sys/kern/kern_ktr.c Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/kern/kern_ktr.c Mon May 23 23:50:21 2011 (r222235) @@ -40,10 +40,8 @@ __FBSDID("$FreeBSD$"); #include "opt_alq.h" #include -#include #include #include -#include #include #include #include @@ -70,6 +68,10 @@ __FBSDID("$FreeBSD$"); #define KTR_MASK (0) #endif +#ifndef KTR_CPUMASK +#define KTR_CPUMASK (~0) +#endif + #ifndef KTR_TIME #define KTR_TIME get_cyclecount() #endif @@ -82,10 +84,10 @@ FEATURE(ktr, "Kernel support for KTR ker SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options"); -static char ktr_cpumask[CPUSETBUFSIZ]; -TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask, sizeof(ktr_cpumask)); -SYSCTL_STRING(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, ktr_cpumask, - sizeof(ktr_cpumask), "Bitmask of CPUs on which KTR logging is enabled"); +int ktr_cpumask = KTR_CPUMASK; +TUNABLE_INT("debug.ktr.cpumask", &ktr_cpumask); +SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, + &ktr_cpumask, 0, "Bitmask of CPUs on which KTR logging is enabled"); int ktr_mask = KTR_MASK; TUNABLE_INT("debug.ktr.mask", &ktr_mask); @@ -196,7 +198,6 @@ ktr_tracepoint(u_int mask, const char *f u_long arg1, u_long arg2, u_long arg3, u_long arg4, u_long arg5, u_long arg6) { - cpuset_t intern_cpumask; struct ktr_entry *entry; #ifdef KTR_ALQ struct ale *ale = NULL; @@ -211,16 +212,8 @@ ktr_tracepoint(u_int mask, const char *f return; if ((ktr_mask & mask) == 0) return; -#ifndef KTR_CPUMASK - CPU_FILL(&intern_cpumask); -#else - if (ktr_cpumask[0] == '\0') - strncpy(ktr_cpumask, KTR_CPUMASK, sizeof(ktr_cpumask)); - if (cpusetobj_strscan(&intern_cpumask, ktr_cpumask) == -1) - return; -#endif cpu = KTR_CPU; - if (!CPU_ISSET(cpu, &intern_cpumask)) + if (((1 << cpu) & ktr_cpumask) == 0) return; #if defined(KTR_VERBOSE) || defined(KTR_ALQ) td = curthread; Modified: projects/largeSMP/sys/sparc64/include/ktr.h ============================================================================== --- projects/largeSMP/sys/sparc64/include/ktr.h Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/sparc64/include/ktr.h Mon May 23 23:50:21 2011 (r222235) @@ -85,9 +85,7 @@ l2: add r2, 1, r3 ; \ lduw [PCPU(MID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ -#if 0 TEST(ktr_cpumask, r1, r2, r3, l3) ; \ -#endif ATR(desc, r1, r2, r3, l1, l2) #endif /* LOCORE */ Modified: projects/largeSMP/sys/sys/cpuset.h ============================================================================== --- projects/largeSMP/sys/sys/cpuset.h Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/sys/cpuset.h Mon May 23 23:50:21 2011 (r222235) @@ -216,7 +216,6 @@ int cpuset_create_root(struct prison *, int cpuset_setproc_update_set(struct proc *, struct cpuset *); int cpusetobj_ffs(const cpuset_t *); char *cpusetobj_strprint(char *, const cpuset_t *); -int cpusetobj_strscan(cpuset_t *, const char *); #else __BEGIN_DECLS Modified: projects/largeSMP/sys/sys/ktr.h ============================================================================== --- projects/largeSMP/sys/sys/ktr.h Mon May 23 23:35:50 2011 (r222234) +++ projects/largeSMP/sys/sys/ktr.h Mon May 23 23:50:21 2011 (r222235) @@ -107,6 +107,7 @@ struct ktr_entry { u_long ktr_parms[KTR_PARMS]; }; +extern int ktr_cpumask; extern int ktr_mask; extern int ktr_entries; extern int ktr_verbose; From owner-svn-src-projects@FreeBSD.ORG Mon May 23 23:51:01 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2970106566B; Mon, 23 May 2011 23:51:01 +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 A37CB8FC12; Mon, 23 May 2011 23:51:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4NNp10S043064; Mon, 23 May 2011 23:51:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4NNp1P8043062; Mon, 23 May 2011 23:51:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105232351.p4NNp1P8043062@svn.freebsd.org> From: Attilio Rao Date: Mon, 23 May 2011 23:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222236 - projects/largeSMP/sys/amd64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2011 23:51:01 -0000 Author: attilio Date: Mon May 23 23:51:01 2011 New Revision: 222236 URL: http://svn.freebsd.org/changeset/base/222236 Log: Revert a patch that involountary sneaked in while I was MFCing. Modified: projects/largeSMP/sys/amd64/conf/GENERIC Modified: projects/largeSMP/sys/amd64/conf/GENERIC ============================================================================== --- projects/largeSMP/sys/amd64/conf/GENERIC Mon May 23 23:50:21 2011 (r222235) +++ projects/largeSMP/sys/amd64/conf/GENERIC Mon May 23 23:51:01 2011 (r222236) @@ -75,8 +75,6 @@ options INVARIANT_SUPPORT # Extra sanit options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -options KTR -options KTR_CPUMASK=("0x3") # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-projects@FreeBSD.ORG Mon May 23 23:58:03 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 659B310656D5; Mon, 23 May 2011 23:58:03 +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 525FD8FC1D; Mon, 23 May 2011 23:58:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4NNw3Bt043337; Mon, 23 May 2011 23:58:03 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4NNw3fw043315; Mon, 23 May 2011 23:58:03 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105232358.p4NNw3fw043315@svn.freebsd.org> From: Attilio Rao Date: Mon, 23 May 2011 23:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222237 - in projects/largeSMP: contrib/top sbin/hastctl sbin/hastd share/man/man4 share/mk sys/conf sys/dev/acpica sys/dev/msk sys/fs/nfsclient sys/geom/gate sys/kern sys/netinet sys/n... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2011 23:58:03 -0000 Author: attilio Date: Mon May 23 23:58:02 2011 New Revision: 222237 URL: http://svn.freebsd.org/changeset/base/222237 Log: MFC Modified: projects/largeSMP/sbin/hastctl/hastctl.c projects/largeSMP/sbin/hastd/control.c projects/largeSMP/sbin/hastd/hast.h projects/largeSMP/sbin/hastd/primary.c projects/largeSMP/sbin/hastd/secondary.c projects/largeSMP/sbin/hastd/subr.c projects/largeSMP/share/man/man4/msk.4 projects/largeSMP/sys/conf/kern.post.mk projects/largeSMP/sys/conf/kmod.mk projects/largeSMP/sys/conf/newvers.sh projects/largeSMP/sys/dev/acpica/acpi_hpet.c projects/largeSMP/sys/dev/acpica/acpi_timer.c projects/largeSMP/sys/dev/msk/if_msk.c projects/largeSMP/sys/dev/msk/if_mskreg.h projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c projects/largeSMP/sys/geom/gate/g_gate.c projects/largeSMP/sys/kern/kern_environment.c projects/largeSMP/sys/kern/vfs_bio.c projects/largeSMP/sys/netinet/in_pcb.c projects/largeSMP/sys/netinet/in_pcb.h projects/largeSMP/sys/netinet6/in6_pcb.c projects/largeSMP/sys/netinet6/in6_src.c projects/largeSMP/usr.bin/gzip/Makefile projects/largeSMP/usr.bin/gzip/gzip.1 projects/largeSMP/usr.bin/gzip/gzip.c projects/largeSMP/usr.bin/gzip/zdiff projects/largeSMP/usr.bin/gzip/zdiff.1 projects/largeSMP/usr.bin/gzip/zuncompress.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/sbin/hastctl/hastctl.c ============================================================================== --- projects/largeSMP/sbin/hastctl/hastctl.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastctl/hastctl.c Mon May 23 23:58:02 2011 (r222237) @@ -341,6 +341,17 @@ control_status(struct nv *nv) printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); + printf(" statistics:\n"); + printf(" reads: %ju\n", + (uint64_t)nv_get_uint64(nv, "stat_read%u", ii)); + printf(" writes: %ju\n", + (uint64_t)nv_get_uint64(nv, "stat_write%u", ii)); + printf(" deletes: %ju\n", + (uint64_t)nv_get_uint64(nv, "stat_delete%u", ii)); + printf(" flushes: %ju\n", + (uint64_t)nv_get_uint64(nv, "stat_flush%u", ii)); + printf(" activemap updates: %ju\n", + (uint64_t)nv_get_uint64(nv, "stat_activemap_update%u", ii)); } return (ret); } Modified: projects/largeSMP/sbin/hastd/control.c ============================================================================== --- projects/largeSMP/sbin/hastd/control.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastd/control.c Mon May 23 23:58:02 2011 (r222237) @@ -199,6 +199,16 @@ control_status_worker(struct hast_resour "extentsize%u", no); nv_add_uint32(nvout, nv_get_uint32(cnvin, "keepdirty"), "keepdirty%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_read"), + "stat_read%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_write"), + "stat_write%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_delete"), + "stat_delete%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_flush"), + "stat_flush%u", no); + nv_add_uint64(nvout, nv_get_uint64(cnvin, "stat_activemap_update"), + "stat_activemap_update%u", no); end: if (cnvin != NULL) nv_free(cnvin); @@ -446,6 +456,13 @@ ctrl_thread(void *arg) nv_add_uint32(nvout, (uint32_t)0, "keepdirty"); nv_add_uint64(nvout, (uint64_t)0, "dirty"); } + nv_add_uint64(nvout, res->hr_stat_read, "stat_read"); + nv_add_uint64(nvout, res->hr_stat_write, "stat_write"); + nv_add_uint64(nvout, res->hr_stat_delete, + "stat_delete"); + nv_add_uint64(nvout, res->hr_stat_flush, "stat_flush"); + nv_add_uint64(nvout, res->hr_stat_activemap_update, + "stat_activemap_update"); nv_add_int16(nvout, 0, "error"); break; case CONTROL_RELOAD: Modified: projects/largeSMP/sbin/hastd/hast.h ============================================================================== --- projects/largeSMP/sbin/hastd/hast.h Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastd/hast.h Mon May 23 23:58:02 2011 (r222237) @@ -218,6 +218,17 @@ struct hast_resource { /* Locked used to synchronize access to hr_amp. */ pthread_mutex_t hr_amp_lock; + /* Number of BIO_READ requests. */ + uint64_t hr_stat_read; + /* Number of BIO_WRITE requests. */ + uint64_t hr_stat_write; + /* Number of BIO_DELETE requests. */ + uint64_t hr_stat_delete; + /* Number of BIO_FLUSH requests. */ + uint64_t hr_stat_flush; + /* Number of activemap updates. */ + uint64_t hr_stat_activemap_update; + /* Next resource. */ TAILQ_ENTRY(hast_resource) hr_next; }; Modified: projects/largeSMP/sbin/hastd/primary.c ============================================================================== --- projects/largeSMP/sbin/hastd/primary.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastd/primary.c Mon May 23 23:58:02 2011 (r222237) @@ -1117,6 +1117,7 @@ ggate_recv_thread(void *arg) */ switch (ggio->gctl_cmd) { case BIO_READ: + res->hr_stat_read++; pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queue.", hio); @@ -1145,6 +1146,7 @@ ggate_recv_thread(void *arg) QUEUE_INSERT1(hio, send, ncomp); break; case BIO_WRITE: + res->hr_stat_write++; if (res->hr_resuid == 0) { /* * This is first write, initialize localcnt and @@ -1183,12 +1185,21 @@ ggate_recv_thread(void *arg) mtx_lock(&res->hr_amp_lock); if (activemap_write_start(res->hr_amp, ggio->gctl_offset, ggio->gctl_length)) { + res->hr_stat_activemap_update++; (void)hast_activemap_flush(res); } mtx_unlock(&res->hr_amp_lock); /* FALLTHROUGH */ case BIO_DELETE: case BIO_FLUSH: + switch (ggio->gctl_cmd) { + case BIO_DELETE: + res->hr_stat_delete++; + break; + case BIO_FLUSH: + res->hr_stat_flush++; + break; + } pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); Modified: projects/largeSMP/sbin/hastd/secondary.c ============================================================================== --- projects/largeSMP/sbin/hastd/secondary.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastd/secondary.c Mon May 23 23:58:02 2011 (r222237) @@ -612,6 +612,20 @@ recv_thread(void *arg) QUEUE_INSERT(send, hio); continue; } + switch (hio->hio_cmd) { + case HIO_READ: + res->hr_stat_read++; + break; + case HIO_WRITE: + res->hr_stat_write++; + break; + case HIO_DELETE: + res->hr_stat_delete++; + break; + case HIO_FLUSH: + res->hr_stat_flush++; + break; + } reqlog(LOG_DEBUG, 2, -1, hio, "recv: (%p) Got request header: ", hio); if (hio->hio_cmd == HIO_KEEPALIVE) { Modified: projects/largeSMP/sbin/hastd/subr.c ============================================================================== --- projects/largeSMP/sbin/hastd/subr.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sbin/hastd/subr.c Mon May 23 23:58:02 2011 (r222237) @@ -224,7 +224,13 @@ drop_privs(struct hast_resource *res) return (-1); } - if (res == NULL || res->hr_role != HAST_ROLE_PRIMARY) + /* + * Until capsicum doesn't allow ioctl(2) we cannot use it to sandbox + * primary and secondary worker processes, as primary uses GGATE + * ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH. + * For now capsicum is only used to sandbox hastctl. + */ + if (res == NULL) capsicum = (cap_enter() == 0); else capsicum = false; Modified: projects/largeSMP/share/man/man4/msk.4 ============================================================================== --- projects/largeSMP/share/man/man4/msk.4 Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/share/man/man4/msk.4 Mon May 23 23:58:02 2011 (r222237) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 23, 2010 +.Dd May 23, 2011 .Dt MSK 4 .Os .Sh NAME @@ -195,6 +195,8 @@ Marvell Yukon 88E8071 Gigabit Ethernet .It Marvell Yukon 88E8072 Gigabit Ethernet .It +Marvell Yukon 88E8075 Gigabit Ethernet +.It SysKonnect SK-9Sxx Gigabit Ethernet .It SysKonnect SK-9Exx Gigabit Ethernet Modified: projects/largeSMP/sys/conf/kern.post.mk ============================================================================== --- projects/largeSMP/sys/conf/kern.post.mk Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/conf/kern.post.mk Mon May 23 23:58:02 2011 (r222237) @@ -228,7 +228,7 @@ kernel-install: mkdir -p ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} == "yes") + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif .if defined(KERNEL_EXTRA_INSTALL) @@ -241,7 +241,7 @@ kernel-reinstall: @-chflags -R noschg ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} .if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} == "yes") + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif Modified: projects/largeSMP/sys/conf/kmod.mk ============================================================================== --- projects/largeSMP/sys/conf/kmod.mk Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/conf/kmod.mk Mon May 23 23:58:02 2011 (r222237) @@ -286,8 +286,8 @@ realinstall: _kmodinstall _kmodinstall: ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR} -.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ - (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} == "yes") +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && \ + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR} .endif Modified: projects/largeSMP/sys/conf/newvers.sh ============================================================================== --- projects/largeSMP/sys/conf/newvers.sh Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/conf/newvers.sh Mon May 23 23:58:02 2011 (r222237) @@ -139,4 +139,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -echo `expr ${v} + 1` > version +echo $((v + 1)) > version Modified: projects/largeSMP/sys/dev/acpica/acpi_hpet.c ============================================================================== --- projects/largeSMP/sys/dev/acpica/acpi_hpet.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/dev/acpica/acpi_hpet.c Mon May 23 23:58:02 2011 (r222237) @@ -476,7 +476,7 @@ hpet_attach(device_t dev) sc->tc.tc_get_timecount = hpet_get_timecount, sc->tc.tc_counter_mask = ~0u, sc->tc.tc_name = "HPET", - sc->tc.tc_quality = 900, + sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; tc_init(&sc->tc); Modified: projects/largeSMP/sys/dev/acpica/acpi_timer.c ============================================================================== --- projects/largeSMP/sys/dev/acpica/acpi_timer.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/dev/acpica/acpi_timer.c Mon May 23 23:58:02 2011 (r222237) @@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev) if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; - acpi_timer_timecounter.tc_quality = 1000; + acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; Modified: projects/largeSMP/sys/dev/msk/if_msk.c ============================================================================== --- projects/largeSMP/sys/dev/msk/if_msk.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/dev/msk/if_msk.c Mon May 23 23:58:02 2011 (r222237) @@ -221,6 +221,10 @@ static struct msk_product { "Marvell Yukon 88E8071 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436C, "Marvell Yukon 88E8072 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_436D, + "Marvell Yukon 88E8055 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4370, + "Marvell Yukon 88E8075 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4380, "Marvell Yukon 88E8057 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4381, @@ -1030,7 +1034,10 @@ msk_ioctl(struct ifnet *ifp, u_long comm } } ifp->if_mtu = ifr->ifr_mtu; - msk_init_locked(sc_if); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + msk_init_locked(sc_if); + } } MSK_IF_UNLOCK(sc_if); break; @@ -1212,37 +1219,30 @@ msk_phy_power(struct msk_softc *sc, int */ CSR_WRITE_1(sc, B2_Y2_CLK_GATE, val); - val = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); - val &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); + our = CSR_PCI_READ_4(sc, PCI_OUR_REG_1); + our &= ~(PCI_Y2_PHY1_POWD | PCI_Y2_PHY2_POWD); if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { if (sc->msk_hw_rev > CHIP_REV_YU_XL_A1) { /* Deassert Low Power for 1st PHY. */ - val |= PCI_Y2_PHY1_COMA; + our |= PCI_Y2_PHY1_COMA; if (sc->msk_num_port > 1) - val |= PCI_Y2_PHY2_COMA; + our |= PCI_Y2_PHY2_COMA; } } - /* Release PHY from PowerDown/COMA mode. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, val); - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EC_U: - case CHIP_ID_YUKON_EX: - case CHIP_ID_YUKON_FE_P: - case CHIP_ID_YUKON_UL_2: - case CHIP_ID_YUKON_OPT: - CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); - - /* Enable all clocks. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); - our &= (PCI_FORCE_ASPM_REQUEST|PCI_ASPM_GPHY_LINK_DOWN| - PCI_ASPM_INT_FIFO_EMPTY|PCI_ASPM_CLKRUN_REQUEST); + if (sc->msk_hw_id == CHIP_ID_YUKON_EC_U || + sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id >= CHIP_ID_YUKON_FE_P) { + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_4); + val &= (PCI_FORCE_ASPM_REQUEST | + PCI_ASPM_GPHY_LINK_DOWN | PCI_ASPM_INT_FIFO_EMPTY | + PCI_ASPM_CLKRUN_REQUEST); /* Set all bits to 0 except bits 15..12. */ - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, our); - our = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); - our &= PCI_CTL_TIM_VMAIN_AV_MSK; - CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, our); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_4, val); + val = CSR_PCI_READ_4(sc, PCI_OUR_REG_5); + val &= PCI_CTL_TIM_VMAIN_AV_MSK; + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_5, val); CSR_PCI_WRITE_4(sc, PCI_CFG_REG_1, 0); + CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_ON); /* * Disable status race, workaround for * Yukon EC Ultra & Yukon EX. @@ -1251,10 +1251,10 @@ msk_phy_power(struct msk_softc *sc, int val |= GLB_GPIO_STAT_RACE_DIS; CSR_WRITE_4(sc, B2_GP_IO, val); CSR_READ_4(sc, B2_GP_IO); - break; - default: - break; } + /* Release PHY from PowerDown/COMA mode. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_1, our); + for (i = 0; i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, MR_ADDR(i, GMAC_LINK_CTRL), GMLC_RST_SET); @@ -1300,28 +1300,33 @@ mskc_reset(struct msk_softc *sc) bus_addr_t addr; uint16_t status; uint32_t val; - int i; - - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + int i, initram; /* Disable ASF. */ - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { - status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); - /* Clear AHB bridge & microcontroller reset. */ - status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | - Y2_ASF_HCU_CCSR_CPU_RST_MODE); - /* Clear ASF microcontroller state. */ - status &= ~ Y2_ASF_HCU_CCSR_UC_STATE_MSK; - CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); - } else - CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); - CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); - - /* - * Since we disabled ASF, S/W reset is required for Power Management. - */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + if (sc->msk_hw_id >= CHIP_ID_YUKON_XL && + sc->msk_hw_id <= CHIP_ID_YUKON_SUPR) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + status = CSR_READ_2(sc, B28_Y2_ASF_HCU_CCSR); + /* Clear AHB bridge & microcontroller reset. */ + status &= ~(Y2_ASF_HCU_CCSR_AHB_RST | + Y2_ASF_HCU_CCSR_CPU_RST_MODE); + /* Clear ASF microcontroller state. */ + status &= ~Y2_ASF_HCU_CCSR_UC_STATE_MSK; + status &= ~Y2_ASF_HCU_CCSR_CPU_CLK_DIVIDE_MSK; + CSR_WRITE_2(sc, B28_Y2_ASF_HCU_CCSR, status); + CSR_WRITE_4(sc, B28_Y2_CPU_WDOG, 0); + } else + CSR_WRITE_1(sc, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); + CSR_WRITE_2(sc, B0_CTST, Y2_ASF_DISABLE); + /* + * Since we disabled ASF, S/W reset is required for + * Power Management. + */ + CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); + } /* Clear all error bits in the PCI status register. */ status = pci_read_config(sc->msk_dev, PCIR_STATUS, 2); @@ -1362,17 +1367,22 @@ mskc_reset(struct msk_softc *sc) /* Reset GPHY/GMAC Control */ for (i = 0; i < sc->msk_num_port; i++) { /* GPHY Control reset. */ - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); - CSR_WRITE_4(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_SET); + CSR_WRITE_1(sc, MR_ADDR(i, GPHY_CTRL), GPC_RST_CLR); /* GMAC Control reset. */ CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(i, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); } + + if (sc->msk_hw_id == CHIP_ID_YUKON_SUPR && + sc->msk_hw_rev > CHIP_REV_YU_SU_B0) + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, PCI_CLK_MACSEC_DIS); if (sc->msk_hw_id == CHIP_ID_YUKON_OPT && sc->msk_hw_rev == 0) { /* Disable PCIe PHY powerdown(reg 0x80, bit7). */ CSR_WRITE_4(sc, Y2_PEX_PHY_DATA, (0x0080 << 16) | 0x0080); @@ -1396,8 +1406,14 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_STOP); CSR_WRITE_1(sc, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); + initram = 0; + if (sc->msk_hw_id == CHIP_ID_YUKON_XL || + sc->msk_hw_id == CHIP_ID_YUKON_EC || + sc->msk_hw_id == CHIP_ID_YUKON_FE) + initram++; + /* Configure timeout values. */ - for (i = 0; i < sc->msk_num_port; i++) { + for (i = 0; initram > 0 && i < sc->msk_num_port; i++) { CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_SET); CSR_WRITE_2(sc, SELECT_RAM_BUFFER(i, B3_RI_CTRL), RI_RST_CLR); CSR_WRITE_1(sc, SELECT_RAM_BUFFER(i, B3_RI_WTO_R1), @@ -1706,13 +1722,15 @@ mskc_attach(device_t dev) } } + /* Enable all clocks before accessing any registers. */ + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); + CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_hw_id = CSR_READ_1(sc, B2_CHIP_ID); sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || sc->msk_hw_id > CHIP_ID_YUKON_OPT || - sc->msk_hw_id == CHIP_ID_YUKON_SUPR || sc->msk_hw_id == CHIP_ID_YUKON_UNKNOWN) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); @@ -1746,9 +1764,6 @@ mskc_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "int_holdoff", &sc->msk_int_holdoff); - /* Soft reset. */ - CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); - CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); /* Check number of MACs. */ sc->msk_num_port = 1; @@ -1822,6 +1837,11 @@ mskc_attach(device_t dev) sc->msk_clock = 156; /* 156 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_SUPR: + sc->msk_clock = 125; /* 125 MHz */ + sc->msk_pflags |= MSK_FLAG_JUMBO | MSK_FLAG_DESCV2 | + MSK_FLAG_AUTOTX_CSUM; + break; case CHIP_ID_YUKON_UL_2: sc->msk_clock = 125; /* 125 MHz */ sc->msk_pflags |= MSK_FLAG_JUMBO; @@ -2963,6 +2983,7 @@ mskc_resume(device_t dev) MSK_LOCK(sc); + CSR_PCI_WRITE_4(sc, PCI_OUR_REG_3, 0); mskc_reset(sc); for (i = 0; i < sc->msk_num_port; i++) { if (sc->msk_if[i] != NULL && sc->msk_if[i]->msk_ifp != NULL && @@ -3654,37 +3675,24 @@ msk_set_tx_stfwd(struct msk_if_softc *sc ifp = sc_if->msk_ifp; sc = sc_if->msk_softc; - switch (sc->msk_hw_id) { - case CHIP_ID_YUKON_EX: - if (sc->msk_hw_rev == CHIP_REV_YU_EX_A0) - goto yukon_ex_workaround; - if (ifp->if_mtu > ETHERMTU) - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_ENA); - else - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); - break; - default: -yukon_ex_workaround: + if ((sc->msk_hw_id == CHIP_ID_YUKON_EX && + sc->msk_hw_rev != CHIP_REV_YU_EX_A0) || + sc->msk_hw_id >= CHIP_ID_YUKON_SUPR) { + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); + } else { if (ifp->if_mtu > ETHERMTU) { /* Set Tx GMAC FIFO Almost Empty Threshold. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_AE_THR), MSK_ECU_JUMBO_WM << 16 | MSK_ECU_AE_THR); /* Disable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_ENA | TX_STFW_DIS); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_DIS); } else { - /* Enable Store & Forward mode for Tx. */ - CSR_WRITE_4(sc, - MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), - TX_JUMBO_DIS | TX_STFW_ENA); + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), + TX_STFW_ENA); } - break; } } @@ -3737,7 +3745,8 @@ msk_init_locked(struct msk_if_softc *sc_ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_SET); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_RST_CLR); CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_F_LOOPB_OFF); - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), GMC_BYP_MACSECRX_ON | GMC_BYP_MACSECTX_ON | GMC_BYP_RETR_ON); @@ -3932,7 +3941,8 @@ msk_init_locked(struct msk_if_softc *sc_ msk_stop(sc_if); return; } - if (sc->msk_hw_id == CHIP_ID_YUKON_EX) { + if (sc->msk_hw_id == CHIP_ID_YUKON_EX || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { /* Disable flushing of non-ASF packets. */ CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_RX_MACSEC_FLUSH_OFF); Modified: projects/largeSMP/sys/dev/msk/if_mskreg.h ============================================================================== --- projects/largeSMP/sys/dev/msk/if_mskreg.h Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/dev/msk/if_mskreg.h Mon May 23 23:58:02 2011 (r222237) @@ -144,6 +144,8 @@ #define DEVICEID_MRVL_436A 0x436A #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C +#define DEVICEID_MRVL_436D 0x436D +#define DEVICEID_MRVL_4370 0x4370 #define DEVICEID_MRVL_4380 0x4380 #define DEVICEID_MRVL_4381 0x4381 @@ -321,6 +323,9 @@ #define PCI_OS_SPD_X100 2 /* PCI-X 100MHz Bus */ #define PCI_OS_SPD_X133 3 /* PCI-X 133MHz Bus */ +/* PCI_OUR_REG_3 32 bit Our Register 3 (Yukon-ECU only) */ +#define PCI_CLK_MACSEC_DIS BIT_17 /* Disable Clock MACSec. */ + /* PCI_OUR_REG_4 32 bit Our Register 4 (Yukon-ECU only) */ #define PCI_TIMER_VALUE_MSK (0xff<<16) /* Bit 23..16: Timer Value Mask */ #define PCI_FORCE_ASPM_REQUEST BIT_15 /* Force ASPM Request (A1 only) */ @@ -677,6 +682,7 @@ /* ASF Subsystem Registers (Yukon-2 only) */ #define B28_Y2_SMB_CONFIG 0x0e40 /* 32 bit ASF SMBus Config Register */ #define B28_Y2_SMB_CSD_REG 0x0e44 /* 32 bit ASF SMB Control/Status/Data */ +#define B28_Y2_CPU_WDOG 0x0e48 /* 32 bit Watchdog Register */ #define B28_Y2_ASF_IRQ_V_BASE 0x0e60 /* 32 bit ASF IRQ Vector Base */ #define B28_Y2_ASF_STAT_CMD 0x0e68 /* 32 bit ASF Status and Command Reg */ #define B28_Y2_ASF_HCU_CCSR 0x0e68 /* 32 bit ASF HCU CCSR (Yukon EX) */ @@ -918,6 +924,10 @@ #define CHIP_REV_YU_EX_A0 1 /* Chip Rev. for Yukon-2 EX A0 */ #define CHIP_REV_YU_EX_B0 2 /* Chip Rev. for Yukon-2 EX B0 */ +#define CHIP_REV_YU_SU_A0 0 /* Chip Rev. for Yukon-2 SUPR A0 */ +#define CHIP_REV_YU_SU_B0 1 /* Chip Rev. for Yukon-2 SUPR B0 */ +#define CHIP_REV_YU_SU_B1 3 /* Chip Rev. for Yukon-2 SUPR B1 */ + /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ #define Y2_STATUS_LNK2_INAC BIT_7 /* Status Link 2 inactiv (0 = activ) */ #define Y2_CLK_GAT_LNK2_DIS BIT_6 /* Disable clock gating Link 2 */ Modified: projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c Mon May 23 23:58:02 2011 (r222237) @@ -79,6 +79,7 @@ FEATURE(nfscl, "NFSv4 client"); extern int nfscl_ticks; extern struct timeval nfsboottime; extern struct nfsstats newnfsstats; +extern int nfsrv_useacl; MALLOC_DEFINE(M_NEWNFSREQ, "newnfsclient_req", "New NFS request header"); MALLOC_DEFINE(M_NEWNFSMNT, "newnfsmnt", "New NFS mount struct"); @@ -1331,6 +1332,15 @@ mountnfs(struct nfs_args *argp, struct m if (argp->flags & NFSMNT_NFSV3) ncl_fsinfo(nmp, *vpp, cred, td); + /* Mark if the mount point supports NFSv4 ACLs. */ + if ((argp->flags & NFSMNT_NFSV4) != 0 && nfsrv_useacl != 0 && + ret == 0 && + NFSISSET_ATTRBIT(&nfsva.na_suppattr, NFSATTRBIT_ACL)) { + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_NFS4ACLS; + MNT_IUNLOCK(mp); + } + /* * Lose the lock but keep the ref. */ Modified: projects/largeSMP/sys/geom/gate/g_gate.c ============================================================================== --- projects/largeSMP/sys/geom/gate/g_gate.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/geom/gate/g_gate.c Mon May 23 23:58:02 2011 (r222237) @@ -180,6 +180,7 @@ g_gate_start(struct bio *bp) break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: /* XXX: Hack to allow read-only mounts. */ if ((sc->sc_flags & G_GATE_FLAG_READONLY) != 0) { g_io_deliver(bp, EPERM); @@ -580,6 +581,7 @@ g_gate_ioctl(struct cdev *dev, u_long cm switch (bp->bio_cmd) { case BIO_READ: case BIO_DELETE: + case BIO_FLUSH: break; case BIO_WRITE: error = copyout(bp->bio_data, ggio->gctl_data, @@ -643,6 +645,7 @@ start_end: break; case BIO_DELETE: case BIO_WRITE: + case BIO_FLUSH: break; } } Modified: projects/largeSMP/sys/kern/kern_environment.c ============================================================================== --- projects/largeSMP/sys/kern/kern_environment.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/kern/kern_environment.c Mon May 23 23:58:02 2011 (r222237) @@ -225,13 +225,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf("WARNING: too long kenv string, ignoring %s\n", + cp); + continue; + } if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); Modified: projects/largeSMP/sys/kern/vfs_bio.c ============================================================================== --- projects/largeSMP/sys/kern/vfs_bio.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/kern/vfs_bio.c Mon May 23 23:58:02 2011 (r222237) @@ -654,7 +654,7 @@ bufinit(void) * To support extreme low-memory systems, make sure hidirtybuffers cannot * eat up all available buffer space. This occurs when our minimum cannot * be met. We try to size hidirtybuffers to 3/4 our buffer space assuming - * BKVASIZE'd (8K) buffers. + * BKVASIZE'd buffers. */ while ((long)hidirtybuffers * BKVASIZE > 3 * hibufspace / 4) { hidirtybuffers >>= 1; Modified: projects/largeSMP/sys/netinet/in_pcb.c ============================================================================== --- projects/largeSMP/sys/netinet/in_pcb.c Mon May 23 23:51:01 2011 (r222236) +++ projects/largeSMP/sys/netinet/in_pcb.c Mon May 23 23:58:02 2011 (r222237) @@ -2,8 +2,12 @@ * Copyright (c) 1982, 1986, 1991, 1993, 1995 * The Regents of the University of California. * Copyright (c) 2007-2009 Robert N. M. Watson + * Copyright (c) 2010-2011 Juniper Networks, Inc. * All rights reserved. * + * Portions of this software were developed by Robert N. M. Watson under + * contract to Juniper Networks, Inc. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -50,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -287,7 +292,7 @@ in_pcballoc(struct socket *so, struct in #endif INP_WLOCK(inp); inp->inp_gencnt = ++pcbinfo->ipi_gencnt; - inp->inp_refcount = 1; /* Reference from the inpcbinfo */ + refcount_init(&inp->inp_refcount, 1); /* Reference from inpcbinfo */ #if defined(IPSEC) || defined(MAC) out: if (error != 0) { @@ -329,7 +334,7 @@ in_pcbbind(struct inpcb *inp, struct soc #if defined(INET) || defined(INET6) int in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp, u_short *lportp, - struct ucred *cred, int wild) + struct ucred *cred, int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -424,14 +429,14 @@ in_pcb_lport(struct inpcb *inp, struct i #ifdef INET6 if ((inp->inp_vflag & INP_IPV6) != 0) tmpinp = in6_pcblookup_local(pcbinfo, - &inp->in6p_laddr, lport, wild, cred); + &inp->in6p_laddr, lport, lookupflags, cred); #endif #if defined(INET) && defined(INET6) else #endif #ifdef INET tmpinp = in_pcblookup_local(pcbinfo, laddr, - lport, wild, cred); + lport, lookupflags, cred); #endif } while (tmpinp != NULL); @@ -464,7 +469,7 @@ in_pcbbind_setup(struct inpcb *inp, stru struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct in_addr laddr; u_short lport = 0; - int wild = 0, reuseport = (so->so_options & SO_REUSEPORT); + int lookupflags = 0, reuseport = (so->so_options & SO_REUSEPORT); int error; /* @@ -480,7 +485,7 @@ in_pcbbind_setup(struct inpcb *inp, stru if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) - wild = INPLOOKUP_WILDCARD; + lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip4(cred, &laddr)) != 0) return (error); @@ -561,7 +566,7 @@ in_pcbbind_setup(struct inpcb *inp, stru return (EADDRINUSE); } t = in_pcblookup_local(pcbinfo, sin->sin_addr, - lport, wild, cred); + lport, lookupflags, cred); if (t && (t->inp_flags & INP_TIMEWAIT)) { /* * XXXRW: If an incpb has had its timewait @@ -590,7 +595,7 @@ in_pcbbind_setup(struct inpcb *inp, stru if (*lportp != 0) lport = *lportp; if (lport == 0) { - error = in_pcb_lport(inp, &laddr, &lport, cred, wild); + error = in_pcb_lport(inp, &laddr, &lport, cred, lookupflags); if (error != 0) return (error); @@ -1028,56 +1033,18 @@ in_pcbdetach(struct inpcb *inp) } /* - * in_pcbfree_internal() frees an inpcb that has been detached from its - * socket, and whose reference count has reached 0. It will also remove the - * inpcb from any global lists it might remain on. - */ -static void -in_pcbfree_internal(struct inpcb *inp) -{ - struct inpcbinfo *ipi = inp->inp_pcbinfo; - - KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - KASSERT(inp->inp_refcount == 0, ("%s: refcount !0", __func__)); - - INP_INFO_WLOCK_ASSERT(ipi); - INP_WLOCK_ASSERT(inp); - -#ifdef IPSEC - if (inp->inp_sp != NULL) - ipsec_delete_pcbpolicy(inp); -#endif /* IPSEC */ - inp->inp_gencnt = ++ipi->ipi_gencnt; - in_pcbremlists(inp); -#ifdef INET6 - if (inp->inp_vflag & INP_IPV6PROTO) { - ip6_freepcbopts(inp->in6p_outputopts); - if (inp->in6p_moptions != NULL) - ip6_freemoptions(inp->in6p_moptions); - } -#endif - if (inp->inp_options) - (void)m_free(inp->inp_options); -#ifdef INET - if (inp->inp_moptions != NULL) - inp_freemoptions(inp->inp_moptions); -#endif - inp->inp_vflag = 0; - crfree(inp->inp_cred); - -#ifdef MAC - mac_inpcb_destroy(inp); -#endif - INP_WUNLOCK(inp); - uma_zfree(ipi->ipi_zone, inp); -} - -/* * in_pcbref() bumps the reference count on an inpcb in order to maintain * stability of an inpcb pointer despite the inpcb lock being released. This * is used in TCP when the inpcbinfo lock needs to be acquired or upgraded, * but where the inpcb lock is already held. * + * in_pcbref() should be used only to provide brief memory stability, and + * must always be followed by a call to INP_WLOCK() and in_pcbrele() to + * garbage collect the inpcb if it has been in_pcbfree()'d from another + * context. Until in_pcbrele() has returned that the inpcb is still valid, + * lock and rele are the *only* safe operations that may be performed on the + * inpcb. + * * While the inpcb will not be freed, releasing the inpcb lock means that the * connection's state may change, so the caller should be careful to * revalidate any cached state on reacquiring the lock. Drop the reference @@ -1091,7 +1058,7 @@ in_pcbref(struct inpcb *inp) KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__)); - inp->inp_refcount++; + refcount_acquire(&inp->inp_refcount); } /* @@ -1099,47 +1066,108 @@ in_pcbref(struct inpcb *inp) * in_pcbfree() may have been made between in_pcbref() and in_pcbrele(), we * return a flag indicating whether or not the inpcb remains valid. If it is * valid, we return with the inpcb lock held. + * + * Notice that, unlike in_pcbref(), the inpcb lock must be held to drop a + * reference on an inpcb. Historically more work was done here (actually, in + * in_pcbfree_internal()) but has been moved to in_pcbfree() to avoid the + * need for the pcbinfo lock in in_pcbrele(). Deferring the free is entirely + * about memory stability (and continued use of the write lock). */ int -in_pcbrele(struct inpcb *inp) +in_pcbrele_rlocked(struct inpcb *inp) { -#ifdef INVARIANTS - struct inpcbinfo *ipi = inp->inp_pcbinfo; -#endif + struct inpcbinfo *pcbinfo; + + KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__)); + + INP_RLOCK_ASSERT(inp); + + if (refcount_release(&inp->inp_refcount) == 0) + return (0); + + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + + INP_RUNLOCK(inp); + pcbinfo = inp->inp_pcbinfo; + uma_zfree(pcbinfo->ipi_zone, inp); + return (1); +} + +int +in_pcbrele_wlocked(struct inpcb *inp) +{ + struct inpcbinfo *pcbinfo; KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__)); - INP_INFO_WLOCK_ASSERT(ipi); INP_WLOCK_ASSERT(inp); - inp->inp_refcount--; - if (inp->inp_refcount > 0) + if (refcount_release(&inp->inp_refcount) == 0) return (0); - in_pcbfree_internal(inp); + + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); + + INP_WUNLOCK(inp); + pcbinfo = inp->inp_pcbinfo; + uma_zfree(pcbinfo->ipi_zone, inp); return (1); } /* + * Temporary wrapper. + */ +int +in_pcbrele(struct inpcb *inp) +{ + + return (in_pcbrele_wlocked(inp)); +} + +/* * Unconditionally schedule an inpcb to be freed by decrementing its * reference count, which should occur only after the inpcb has been detached * from its socket. If another thread holds a temporary reference (acquired * using in_pcbref()) then the free is deferred until that reference is - * released using in_pcbrele(), but the inpcb is still unlocked. + * released using in_pcbrele(), but the inpcb is still unlocked. Almost all + * work, including removal from global lists, is done in this context, where + * the pcbinfo lock is held. */ void in_pcbfree(struct inpcb *inp) { -#ifdef INVARIANTS - struct inpcbinfo *ipi = inp->inp_pcbinfo; -#endif + struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; - KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", - __func__)); + KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__)); - INP_INFO_WLOCK_ASSERT(ipi); + INP_INFO_WLOCK_ASSERT(pcbinfo); INP_WLOCK_ASSERT(inp); - if (!in_pcbrele(inp)) + /* XXXRW: Do as much as possible here. */ +#ifdef IPSEC + if (inp->inp_sp != NULL) + ipsec_delete_pcbpolicy(inp); +#endif /* IPSEC */ + inp->inp_gencnt = ++pcbinfo->ipi_gencnt; + in_pcbremlists(inp); +#ifdef INET6 + if (inp->inp_vflag & INP_IPV6PROTO) { + ip6_freepcbopts(inp->in6p_outputopts); + if (inp->in6p_moptions != NULL) + ip6_freemoptions(inp->in6p_moptions); + } +#endif + if (inp->inp_options) + (void)m_free(inp->inp_options); +#ifdef INET + if (inp->inp_moptions != NULL) + inp_freemoptions(inp->inp_moptions); +#endif + inp->inp_vflag = 0; + crfree(inp->inp_cred); +#ifdef MAC + mac_inpcb_destroy(inp); +#endif + if (!in_pcbrele_wlocked(inp)) INP_WUNLOCK(inp); } @@ -1307,7 +1335,7 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo #define INP_LOOKUP_MAPPED_PCB_COST 3 struct inpcb * in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, - u_short lport, int wild_okay, struct ucred *cred) + u_short lport, int lookupflags, struct ucred *cred) { struct inpcb *inp; #ifdef INET6 @@ -1317,9 +1345,12 @@ in_pcblookup_local(struct inpcbinfo *pcb #endif int wildcard; + KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0, + ("%s: invalid lookup flags %d", __func__, lookupflags)); + INP_INFO_LOCK_ASSERT(pcbinfo); - if (!wild_okay) { + if ((lookupflags & INPLOOKUP_WILDCARD) == 0) { struct inpcbhead *head; /* * Look for an unconnected (wildcard foreign addr) PCB that @@ -1425,13 +1456,16 @@ in_pcblookup_local(struct inpcbinfo *pcb */ struct inpcb * in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in_addr faddr, - u_int fport_arg, struct in_addr laddr, u_int lport_arg, int wildcard, + u_int fport_arg, struct in_addr laddr, u_int lport_arg, int lookupflags, struct ifnet *ifp) { struct inpcbhead *head; struct inpcb *inp, *tmpinp; u_short fport = fport_arg, lport = lport_arg; + KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0, + ("%s: invalid lookup flags %d", __func__, lookupflags)); + INP_INFO_LOCK_ASSERT(pcbinfo); /* @@ -1467,7 +1501,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbi *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue May 24 01:08:53 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83AAD106566B; Tue, 24 May 2011 01:08:53 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E1B8FC13; Tue, 24 May 2011 01:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4O18rsO045420; Tue, 24 May 2011 01:08:53 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4O18rro045418; Tue, 24 May 2011 01:08:53 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201105240108.p4O18rro045418@svn.freebsd.org> From: Peter Grehan Date: Tue, 24 May 2011 01:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222238 - projects/bhyve/usr.sbin/bhyve X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 01:08:53 -0000 Author: grehan Date: Tue May 24 01:08:53 2011 New Revision: 222238 URL: http://svn.freebsd.org/changeset/base/222238 Log: Catch up with CURRENTs different timer usage compared to 8.1. A counter value of 0 in rategen mode is equivalent to a max initial value. The TSC is now correctly calibrated on a 9.0 guest. Obtained from: NetApp Modified: projects/bhyve/usr.sbin/bhyve/pit_8254.c Modified: projects/bhyve/usr.sbin/bhyve/pit_8254.c ============================================================================== --- projects/bhyve/usr.sbin/bhyve/pit_8254.c Mon May 23 23:58:02 2011 (r222237) +++ projects/bhyve/usr.sbin/bhyve/pit_8254.c Tue May 24 01:08:53 2011 (r222238) @@ -183,6 +183,8 @@ pit_8254_handler(struct vmctx *ctx, int if (c->crbyte == 2) { c->crbyte = 0; c->initial = c->cr[0] | (uint16_t)c->cr[1] << 8; + if (c->initial == 0) + c->initial = 0xffff; gettimeofday(&c->tv, NULL); } } From owner-svn-src-projects@FreeBSD.ORG Tue May 24 14:12:32 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 357421065676; Tue, 24 May 2011 14:12:32 +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 1C5978FC15; Tue, 24 May 2011 14:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4OECWeN071665; Tue, 24 May 2011 14:12:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4OECVHf071663; Tue, 24 May 2011 14:12:31 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105241412.p4OECVHf071663@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 24 May 2011 14:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222256 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 14:12:32 -0000 Author: nwhitehorn Date: Tue May 24 14:12:31 2011 New Revision: 222256 URL: http://svn.freebsd.org/changeset/base/222256 Log: Add SMP support on CHRP/PAPR system, including support for multi-threaded CPUs. Modified: projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Tue May 24 14:10:33 2011 (r222255) +++ projects/pseries/powerpc/pseries/platform_chrp.c Tue May 24 14:12:31 2011 (r222256) @@ -43,8 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -150,33 +152,12 @@ chrp_timebase_freq(platform_t plat, stru return (ticks); } - -static int -chrp_smp_fill_cpuref(struct cpuref *cpuref, phandle_t cpu) -{ - cell_t cpuid, res; - - cpuref->cr_hwref = cpu; - res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); - - /* - * psim doesn't have a reg property, so assume 0 as for the - * uniprocessor case in the CHRP spec. - */ - if (res < 0) { - cpuid = 0; - } - - cpuref->cr_cpuid = cpuid & 0xff; - return (0); -} - static int chrp_smp_first_cpu(platform_t plat, struct cpuref *cpuref) { char buf[8]; phandle_t cpu, dev, root; - int res; + int res, cpuid; root = OF_peer(0); @@ -208,7 +189,16 @@ chrp_smp_first_cpu(platform_t plat, stru if (cpu == 0) return (ENOENT); - return (chrp_smp_fill_cpuref(cpuref, cpu)); + cpuref->cr_hwref = cpu; + res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + sizeof(cpuid)); + if (res <= 0) + res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + cpuref->cr_cpuid = cpuid; + + return (0); } static int @@ -216,8 +206,23 @@ chrp_smp_next_cpu(platform_t plat, struc { char buf[8]; phandle_t cpu; - int res; + int i, res, cpuid; + + /* Check for whether it should be the next thread */ + res = OF_getproplen(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s"); + if (res > 0) { + cell_t interrupt_servers[res/sizeof(cell_t)]; + OF_getprop(cpuref->cr_hwref, "ibm,ppc-interrupt-server#s", + interrupt_servers, res); + for (i = 0; i < res/sizeof(cell_t) - 1; i++) { + if (interrupt_servers[i] == cpuref->cr_cpuid) { + cpuref->cr_cpuid = interrupt_servers[i+1]; + return (0); + } + } + } + /* Next CPU core/package */ cpu = OF_peer(cpuref->cr_hwref); while (cpu != 0) { res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); @@ -228,7 +233,16 @@ chrp_smp_next_cpu(platform_t plat, struc if (cpu == 0) return (ENOENT); - return (chrp_smp_fill_cpuref(cpuref, cpu)); + cpuref->cr_hwref = cpu; + res = OF_getprop(cpu, "ibm,ppc-interrupt-server#s", &cpuid, + sizeof(cpuid)); + if (res <= 0) + res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + cpuref->cr_cpuid = cpuid; + + return (0); } static int @@ -236,7 +250,7 @@ chrp_smp_get_bsp(platform_t plat, struct { ihandle_t inst; phandle_t bsp, chosen; - int res; + int res, cpuid; chosen = OF_finddevice("/chosen"); if (chosen == 0) @@ -247,14 +261,55 @@ chrp_smp_get_bsp(platform_t plat, struct return (ENXIO); bsp = OF_instance_to_package(inst); - return (chrp_smp_fill_cpuref(cpuref, bsp)); + + /* Pick the primary thread. Can it be any other? */ + cpuref->cr_hwref = bsp; + res = OF_getprop(bsp, "ibm,ppc-interrupt-server#s", &cpuid, + sizeof(cpuid)); + if (res <= 0) + res = OF_getprop(bsp, "reg", &cpuid, sizeof(cpuid)); + if (res <= 0) + cpuid = 0; + cpuref->cr_cpuid = cpuid; + + return (0); } static int chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) { - /* XXX: Uses RTAS call, will add later */ - return (ENXIO); + cell_t start_cpu; + int result, err, timeout; + + if (!rtas_exists()) { + printf("RTAS unitialized: unable to start AP %d\n", + pc->pc_cpuid); + return (ENXIO); + } + + start_cpu = rtas_token_lookup("start-cpu"); + if (start_cpu == -1) { + printf("RTAS unknown method: unable to start AP %d\n", + pc->pc_cpuid); + return (ENXIO); + } + + ap_pcpu = pc; + powerpc_sync(); + + result = rtas_call_method(start_cpu, 3, 1, pc->pc_cpuid, EXC_RST, pc, + &err); + if (result < 0 || err != 0) { + printf("RTAS error (%d/%d): unable to start AP %d\n", + result, err, pc->pc_cpuid); + return (ENXIO); + } + + timeout = 10000; + while (!pc->pc_awake && timeout--) + DELAY(100); + + return ((pc->pc_awake) ? 0 : EBUSY); } static void From owner-svn-src-projects@FreeBSD.ORG Tue May 24 15:02:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C86421065672; Tue, 24 May 2011 15:02:42 +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 9FB158FC16; Tue, 24 May 2011 15:02:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4OF2gNJ073254; Tue, 24 May 2011 15:02:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4OF2gU7073251; Tue, 24 May 2011 15:02:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105241502.p4OF2gU7073251@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 24 May 2011 15:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222258 - in projects/pseries/powerpc: include pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 15:02:42 -0000 Author: nwhitehorn Date: Tue May 24 15:02:42 2011 New Revision: 222258 URL: http://svn.freebsd.org/changeset/base/222258 Log: Provide SMP topology detection and bump MAXCPU to match other platforms. Modified: projects/pseries/powerpc/include/param.h projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/include/param.h ============================================================================== --- projects/pseries/powerpc/include/param.h Tue May 24 14:36:32 2011 (r222257) +++ projects/pseries/powerpc/include/param.h Tue May 24 15:02:42 2011 (r222258) @@ -68,7 +68,7 @@ #endif #if defined(SMP) || defined(KLD_MODULE) -#define MAXCPU 4 +#define MAXCPU 32 #else #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Tue May 24 14:36:32 2011 (r222257) +++ projects/pseries/powerpc/pseries/platform_chrp.c Tue May 24 15:02:42 2011 (r222258) @@ -69,6 +69,9 @@ static int chrp_smp_first_cpu(platform_t static int chrp_smp_next_cpu(platform_t, struct cpuref *cpuref); static int chrp_smp_get_bsp(platform_t, struct cpuref *cpuref); static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); +#ifdef SMP +static struct cpu_group *chrp_smp_topo(platform_t plat); +#endif static void chrp_reset(platform_t); static platform_method_t chrp_methods[] = { @@ -82,6 +85,9 @@ static platform_method_t chrp_methods[] PLATFORMMETHOD(platform_smp_next_cpu, chrp_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, chrp_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), +#ifdef SMP + PLATFORMMETHOD(platform_smp_topo, chrp_smp_topo), +#endif PLATFORMMETHOD(platform_reset, chrp_reset), @@ -312,6 +318,39 @@ chrp_smp_start_cpu(platform_t plat, stru return ((pc->pc_awake) ? 0 : EBUSY); } +#ifdef SMP +static struct cpu_group * +chrp_smp_topo(platform_t plat) +{ + struct pcpu *pc, *last_pc; + int i, ncores, ncpus; + + ncores = ncpus = 0; + last_pc = NULL; + for (i = 0; i <= mp_maxid; i++) { + pc = pcpu_find(i); + if (pc == NULL) + continue; + if (last_pc == NULL || pc->pc_hwref != last_pc->pc_hwref) + ncores++; + last_pc = pc; + ncpus++; + } + + if (ncpus % ncores != 0) { + printf("WARNING: Irregular SMP topology. Performance may be " + "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); + return (smp_topo_none()); + } + + /* Don't do anything fancier for non-threaded SMP */ + if (ncpus == ncores) + return (smp_topo_none()); + + return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); +} +#endif + static void chrp_reset(platform_t platform) { From owner-svn-src-projects@FreeBSD.ORG Tue May 24 15:39:36 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D4AF1065672; Tue, 24 May 2011 15:39:36 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19BFC8FC12; Tue, 24 May 2011 15:39:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4OFda9W075412; Tue, 24 May 2011 15:39:36 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4OFdZti075376; Tue, 24 May 2011 15:39:35 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201105241539.p4OFdZti075376@svn.freebsd.org> From: Peter Grehan Date: Tue, 24 May 2011 15:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222259 - in projects/bhyve: . bin/ed bin/pax bin/ps bin/sh contrib/binutils/binutils contrib/binutils/gas contrib/binutils/ld contrib/gcc contrib/gcclibs/libiberty contrib/gperf/src co... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 15:39:36 -0000 Author: grehan Date: Tue May 24 15:39:34 2011 New Revision: 222259 URL: http://svn.freebsd.org/changeset/base/222259 Log: IFC @ r222256 Added: projects/bhyve/lib/libprocstat/Symbol.map - copied unchanged from r222256, head/lib/libprocstat/Symbol.map projects/bhyve/lib/libprocstat/Versions.def - copied unchanged from r222256, head/lib/libprocstat/Versions.def projects/bhyve/lib/libsbuf/Symbol.map - copied unchanged from r222256, head/lib/libsbuf/Symbol.map projects/bhyve/lib/libsbuf/Version.def - copied unchanged from r222256, head/lib/libsbuf/Version.def projects/bhyve/sbin/hastd/proto_tcp.c - copied unchanged from r222256, head/sbin/hastd/proto_tcp.c projects/bhyve/share/man/man4/man4.i386/glxiic.4 - copied unchanged from r222256, head/share/man/man4/man4.i386/glxiic.4 projects/bhyve/sys/dev/glxiic/ - copied from r222256, head/sys/dev/glxiic/ projects/bhyve/sys/modules/glxiic/ - copied from r222256, head/sys/modules/glxiic/ projects/bhyve/tools/build/options/WITHOUT_BINUTILS - copied unchanged from r222256, head/tools/build/options/WITHOUT_BINUTILS projects/bhyve/tools/build/options/WITHOUT_GCC - copied unchanged from r222256, head/tools/build/options/WITHOUT_GCC projects/bhyve/tools/build/options/WITHOUT_KERNEL_SYMBOLS - copied unchanged from r222256, head/tools/build/options/WITHOUT_KERNEL_SYMBOLS projects/bhyve/tools/build/options/WITH_OFED - copied unchanged from r222256, head/tools/build/options/WITH_OFED projects/bhyve/tools/regression/bin/sh/builtins/cd3.0 - copied unchanged from r222256, head/tools/regression/bin/sh/builtins/cd3.0 projects/bhyve/tools/regression/bin/sh/builtins/cd4.0 - copied unchanged from r222256, head/tools/regression/bin/sh/builtins/cd4.0 projects/bhyve/tools/regression/bin/sh/builtins/dot4.0 - copied unchanged from r222256, head/tools/regression/bin/sh/builtins/dot4.0 projects/bhyve/tools/regression/bin/sh/parameters/positional1.0 - copied unchanged from r222256, head/tools/regression/bin/sh/parameters/positional1.0 projects/bhyve/tools/regression/bin/sh/parser/alias4.0 - copied unchanged from r222256, head/tools/regression/bin/sh/parser/alias4.0 projects/bhyve/tools/regression/bin/sh/parser/alias5.0 - copied unchanged from r222256, head/tools/regression/bin/sh/parser/alias5.0 projects/bhyve/tools/regression/bin/sh/parser/heredoc11.0 - copied unchanged from r222256, head/tools/regression/bin/sh/parser/heredoc11.0 projects/bhyve/usr.sbin/pkg_install/lib/ - copied from r222256, head/usr.sbin/pkg_install/lib/ Deleted: projects/bhyve/lib/libpkg/ projects/bhyve/sbin/hastd/proto_tcp4.c Modified: projects/bhyve/Makefile.inc1 projects/bhyve/bin/ed/POSIX projects/bhyve/bin/pax/ar_io.c projects/bhyve/bin/pax/ar_subs.c projects/bhyve/bin/pax/buf_subs.c projects/bhyve/bin/pax/cpio.c projects/bhyve/bin/pax/file_subs.c projects/bhyve/bin/pax/ftree.c projects/bhyve/bin/pax/options.c projects/bhyve/bin/pax/pat_rep.c projects/bhyve/bin/pax/pax.c projects/bhyve/bin/pax/sel_subs.c projects/bhyve/bin/pax/tables.c projects/bhyve/bin/pax/tar.c projects/bhyve/bin/ps/ps.1 projects/bhyve/bin/ps/ps.c projects/bhyve/bin/sh/cd.c projects/bhyve/bin/sh/eval.c projects/bhyve/bin/sh/main.c projects/bhyve/bin/sh/miscbltin.c projects/bhyve/bin/sh/mkinit.c projects/bhyve/bin/sh/mktokens projects/bhyve/bin/sh/parser.c projects/bhyve/bin/sh/parser.h projects/bhyve/bin/sh/sh.1 projects/bhyve/bin/sh/var.c projects/bhyve/contrib/binutils/binutils/objcopy.c projects/bhyve/contrib/binutils/binutils/readelf.c projects/bhyve/contrib/binutils/binutils/strings.c projects/bhyve/contrib/binutils/gas/read.h projects/bhyve/contrib/binutils/gas/write.c projects/bhyve/contrib/binutils/ld/ldlang.c projects/bhyve/contrib/gcc/combine.c projects/bhyve/contrib/gcc/emit-rtl.c projects/bhyve/contrib/gcc/function.c projects/bhyve/contrib/gcc/genattrtab.c projects/bhyve/contrib/gcc/genautomata.c projects/bhyve/contrib/gcc/gengtype-lex.l projects/bhyve/contrib/gcc/genmodes.c projects/bhyve/contrib/gcc/omp-low.c projects/bhyve/contrib/gcc/tree-cfg.c projects/bhyve/contrib/gcc/tree-vect-patterns.c projects/bhyve/contrib/gcclibs/libiberty/regex.c projects/bhyve/contrib/gperf/src/gen-perf.cc projects/bhyve/contrib/gperf/src/key-list.cc projects/bhyve/contrib/gperf/src/options.cc projects/bhyve/contrib/groff/src/devices/grohtml/post-html.cpp projects/bhyve/contrib/groff/src/libs/libdriver/input.cpp projects/bhyve/contrib/groff/src/roff/troff/mtsm.cpp projects/bhyve/contrib/groff/src/roff/troff/node.cpp projects/bhyve/contrib/groff/src/utils/hpftodit/hpftodit.cpp projects/bhyve/crypto/heimdal/lib/sl/slc-gram.y projects/bhyve/etc/rc.d/ipfilter projects/bhyve/etc/rc.d/pf projects/bhyve/games/fortune/datfiles/fortunes projects/bhyve/games/fortune/datfiles/fortunes-o.real projects/bhyve/games/fortune/datfiles/fortunes-o.sp.ok projects/bhyve/games/fortune/datfiles/fortunes.sp.ok projects/bhyve/games/fortune/datfiles/freebsd-tips.sp.ok projects/bhyve/games/fortune/datfiles/gerrold.limerick projects/bhyve/games/fortune/datfiles/limerick projects/bhyve/games/fortune/datfiles/limerick.sp.ok projects/bhyve/games/fortune/datfiles/startrek.sp.ok projects/bhyve/games/fortune/datfiles/zippy.sp.ok projects/bhyve/games/morse/morse.c projects/bhyve/gnu/usr.bin/Makefile projects/bhyve/lib/Makefile projects/bhyve/lib/clang/clang.build.mk projects/bhyve/lib/libc/sys/mq_setattr.2 projects/bhyve/lib/libprocstat/Makefile projects/bhyve/lib/libprocstat/libprocstat.c projects/bhyve/lib/libsbuf/Makefile projects/bhyve/release/Makefile projects/bhyve/release/generate-release.sh projects/bhyve/sbin/atacontrol/atacontrol.8 projects/bhyve/sbin/atacontrol/atacontrol.c projects/bhyve/sbin/geom/class/part/geom_part.c projects/bhyve/sbin/hastctl/hastctl.c projects/bhyve/sbin/hastd/Makefile projects/bhyve/sbin/hastd/control.c projects/bhyve/sbin/hastd/hast.conf.5 projects/bhyve/sbin/hastd/hast.h projects/bhyve/sbin/hastd/hastd.c projects/bhyve/sbin/hastd/parse.y projects/bhyve/sbin/hastd/pjdlog.c projects/bhyve/sbin/hastd/primary.c projects/bhyve/sbin/hastd/secondary.c projects/bhyve/sbin/hastd/subr.c projects/bhyve/sbin/hastd/token.l projects/bhyve/sbin/ifconfig/ifmedia.c projects/bhyve/sbin/ipfw/ipfw.8 projects/bhyve/sbin/mount_reiserfs/mount_reiserfs.8 projects/bhyve/sbin/mount_reiserfs/mount_reiserfs.c projects/bhyve/share/examples/diskless/README.TEMPLATING projects/bhyve/share/examples/drivers/make_device_driver.sh projects/bhyve/share/examples/libvgl/demo.c projects/bhyve/share/examples/netgraph/ether.bridge projects/bhyve/share/examples/netgraph/frame_relay projects/bhyve/share/examples/netgraph/ngctl projects/bhyve/share/examples/netgraph/raw projects/bhyve/share/examples/netgraph/virtual.chain projects/bhyve/share/examples/netgraph/virtual.lan projects/bhyve/share/man/man4/ahci.4 projects/bhyve/share/man/man4/aio.4 projects/bhyve/share/man/man4/ata.4 projects/bhyve/share/man/man4/atkbd.4 projects/bhyve/share/man/man4/cc_hd.4 projects/bhyve/share/man/man4/coretemp.4 projects/bhyve/share/man/man4/geom_map.4 projects/bhyve/share/man/man4/hpet.4 projects/bhyve/share/man/man4/ichwd.4 projects/bhyve/share/man/man4/man4.i386/Makefile projects/bhyve/share/man/man4/msk.4 projects/bhyve/share/man/man4/pst.4 projects/bhyve/share/man/man4/ucycom.4 projects/bhyve/share/man/man4/xhci.4 projects/bhyve/share/man/man5/rc.conf.5 projects/bhyve/share/man/man5/reiserfs.5 projects/bhyve/share/man/man5/src.conf.5 projects/bhyve/share/man/man9/LOCK_PROFILING.9 projects/bhyve/share/man/man9/pseudofs.9 projects/bhyve/share/man/man9/sbuf.9 projects/bhyve/share/man/man9/zone.9 projects/bhyve/share/misc/bsd-family-tree projects/bhyve/share/misc/committers-src.dot projects/bhyve/share/misc/iso3166 projects/bhyve/share/mk/bsd.libnames.mk projects/bhyve/share/mk/bsd.own.mk projects/bhyve/sys/amd64/amd64/identcpu.c projects/bhyve/sys/amd64/include/specialreg.h projects/bhyve/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/bhyve/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/bhyve/sys/cddl/dev/cyclic/cyclic.c projects/bhyve/sys/cddl/dev/cyclic/i386/cyclic_machdep.c projects/bhyve/sys/conf/files.i386 projects/bhyve/sys/conf/kern.mk projects/bhyve/sys/conf/kern.post.mk projects/bhyve/sys/conf/kmod.mk projects/bhyve/sys/conf/newvers.sh projects/bhyve/sys/dev/acpica/acpi_hpet.c projects/bhyve/sys/dev/acpica/acpi_timer.c projects/bhyve/sys/dev/ahci/ahci.c projects/bhyve/sys/dev/ahci/ahci.h projects/bhyve/sys/dev/alc/if_alcreg.h projects/bhyve/sys/dev/ale/if_alereg.h projects/bhyve/sys/dev/ath/ah_osdep.c projects/bhyve/sys/dev/ath/ath_hal/ah.c projects/bhyve/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c projects/bhyve/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/bhyve/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c projects/bhyve/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/bhyve/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/bhyve/sys/dev/ath/ath_hal/ar5416/ar5416desc.h projects/bhyve/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/bhyve/sys/dev/ath/ath_rate/sample/sample.c projects/bhyve/sys/dev/ath/if_ath.c projects/bhyve/sys/dev/ath/if_ath_sysctl.c projects/bhyve/sys/dev/ath/if_athioctl.h projects/bhyve/sys/dev/atkbdc/atkbd.c projects/bhyve/sys/dev/atkbdc/atkbdreg.h projects/bhyve/sys/dev/bge/if_bge.c projects/bhyve/sys/dev/cfi/cfi_dev.c projects/bhyve/sys/dev/cxgbe/t4_main.c projects/bhyve/sys/dev/cxgbe/t4_sge.c projects/bhyve/sys/dev/gem/if_gem.c projects/bhyve/sys/dev/hwpmc/hwpmc_mod.c projects/bhyve/sys/dev/iwn/if_iwn.c projects/bhyve/sys/dev/mii/mii.c projects/bhyve/sys/dev/mk48txx/mk48txx.c projects/bhyve/sys/dev/mk48txx/mk48txxreg.h projects/bhyve/sys/dev/msk/if_msk.c projects/bhyve/sys/dev/msk/if_mskreg.h projects/bhyve/sys/dev/pci/pcireg.h projects/bhyve/sys/dev/puc/pucdata.c projects/bhyve/sys/dev/scc/scc_bfe_ebus.c projects/bhyve/sys/dev/sound/usb/uaudio.c projects/bhyve/sys/dev/uart/uart_cpu_sparc64.c projects/bhyve/sys/dev/usb/controller/xhci_pci.c projects/bhyve/sys/dev/usb/controller/xhcireg.h projects/bhyve/sys/dev/usb/input/uhid.c projects/bhyve/sys/dev/usb/input/ukbd.c projects/bhyve/sys/dev/usb/input/ums.c projects/bhyve/sys/dev/usb/storage/umass.c projects/bhyve/sys/dev/usb/storage/ustorage_fs.c projects/bhyve/sys/dev/usb/usb_device.c projects/bhyve/sys/dev/usb/usbdi.h projects/bhyve/sys/dev/vge/if_vge.c projects/bhyve/sys/fs/cd9660/cd9660_vfsops.c projects/bhyve/sys/fs/ext2fs/ext2_vfsops.c projects/bhyve/sys/fs/hpfs/hpfs_vfsops.c projects/bhyve/sys/fs/msdosfs/msdosfs_vfsops.c projects/bhyve/sys/fs/nfs/nfs_commonkrpc.c projects/bhyve/sys/fs/nfs/nfs_commonport.c projects/bhyve/sys/fs/nfsclient/nfs_clkrpc.c projects/bhyve/sys/fs/nfsclient/nfs_clnfsiod.c projects/bhyve/sys/fs/nfsclient/nfs_clsubs.c projects/bhyve/sys/fs/nfsclient/nfs_clvfsops.c projects/bhyve/sys/fs/nfsclient/nfs_clvnops.c projects/bhyve/sys/fs/nfsserver/nfs_nfsdport.c projects/bhyve/sys/fs/ntfs/ntfs_vfsops.c projects/bhyve/sys/fs/nullfs/null_vfsops.c projects/bhyve/sys/fs/tmpfs/tmpfs_vfsops.c projects/bhyve/sys/fs/udf/udf_vfsops.c projects/bhyve/sys/fs/unionfs/union_vfsops.c projects/bhyve/sys/geom/eli/g_eli_key_cache.c projects/bhyve/sys/geom/gate/g_gate.c projects/bhyve/sys/geom/part/g_part.c projects/bhyve/sys/geom/part/g_part_mbr.c projects/bhyve/sys/geom/part/g_part_pc98.c projects/bhyve/sys/gnu/fs/reiserfs/reiserfs_vfsops.c projects/bhyve/sys/gnu/fs/xfs/FreeBSD/support/kdb.c projects/bhyve/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c projects/bhyve/sys/i386/conf/NOTES projects/bhyve/sys/i386/i386/identcpu.c projects/bhyve/sys/i386/include/specialreg.h projects/bhyve/sys/i386/include/xen/xenvar.h projects/bhyve/sys/i386/xen/mp_machdep.c projects/bhyve/sys/kern/device_if.m projects/bhyve/sys/kern/kern_clocksource.c projects/bhyve/sys/kern/kern_conf.c projects/bhyve/sys/kern/kern_cpuset.c projects/bhyve/sys/kern/kern_environment.c projects/bhyve/sys/kern/kern_synch.c projects/bhyve/sys/kern/sched_4bsd.c projects/bhyve/sys/kern/subr_sbuf.c projects/bhyve/sys/kern/subr_smp.c projects/bhyve/sys/kern/vfs_bio.c projects/bhyve/sys/kern/vfs_default.c projects/bhyve/sys/kern/vfs_syscalls.c projects/bhyve/sys/mips/include/atomic.h projects/bhyve/sys/modules/Makefile projects/bhyve/sys/modules/wlan/Makefile projects/bhyve/sys/net/if_epair.c projects/bhyve/sys/net/if_llatbl.c projects/bhyve/sys/net/if_llatbl.h projects/bhyve/sys/net/if_media.h projects/bhyve/sys/net/netisr.c projects/bhyve/sys/net/netisr.h projects/bhyve/sys/net/netisr_internal.h projects/bhyve/sys/net80211/ieee80211_var.h projects/bhyve/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/bhyve/sys/netgraph/ng_eiface.c projects/bhyve/sys/netinet/in.c projects/bhyve/sys/netinet/in_pcb.c projects/bhyve/sys/netinet/in_pcb.h projects/bhyve/sys/netinet/in_var.h projects/bhyve/sys/netinet/raw_ip.c projects/bhyve/sys/netinet/sctp_output.c projects/bhyve/sys/netinet/sctp_usrreq.c projects/bhyve/sys/netinet6/in6.c projects/bhyve/sys/netinet6/in6_pcb.c projects/bhyve/sys/netinet6/in6_src.c projects/bhyve/sys/nfs/nfs_common.c projects/bhyve/sys/nfsclient/nfs.h projects/bhyve/sys/nfsclient/nfs_krpc.c projects/bhyve/sys/nfsclient/nfs_nfsiod.c projects/bhyve/sys/nfsclient/nfs_subs.c projects/bhyve/sys/nfsclient/nfs_vfsops.c projects/bhyve/sys/nfsclient/nfs_vnops.c projects/bhyve/sys/nfsserver/nfs_srvsubs.c projects/bhyve/sys/nlm/nlm_prot_impl.c projects/bhyve/sys/powerpc/aim/mmu_oea64.c projects/bhyve/sys/powerpc/include/atomic.h projects/bhyve/sys/powerpc/powerpc/platform.c projects/bhyve/sys/powerpc/ps3/ps3bus.c projects/bhyve/sys/sparc64/sparc64/eeprom.c projects/bhyve/sys/sys/dtrace_bsd.h projects/bhyve/sys/sys/mount.h projects/bhyve/sys/sys/param.h projects/bhyve/sys/sys/proc.h projects/bhyve/sys/sys/sbuf.h projects/bhyve/sys/sys/smp.h projects/bhyve/sys/ufs/ffs/ffs_vfsops.c projects/bhyve/sys/ufs/ufs/ufs_extern.h projects/bhyve/sys/ufs/ufs/ufs_vfsops.c projects/bhyve/sys/vm/uma_core.c projects/bhyve/sys/vm/uma_int.h projects/bhyve/tools/tools/iso/check-iso3166.pl projects/bhyve/usr.bin/ar/acpyacc.y projects/bhyve/usr.bin/ar/ar.c projects/bhyve/usr.bin/ar/write.c projects/bhyve/usr.bin/gzip/Makefile projects/bhyve/usr.bin/gzip/gzip.1 projects/bhyve/usr.bin/gzip/gzip.c projects/bhyve/usr.bin/gzip/zdiff projects/bhyve/usr.bin/gzip/zdiff.1 projects/bhyve/usr.bin/gzip/zuncompress.c projects/bhyve/usr.bin/netstat/netisr.c projects/bhyve/usr.bin/nfsstat/nfsstat.c projects/bhyve/usr.bin/rpcgen/rpc_hout.c projects/bhyve/usr.bin/rpcgen/rpc_svcout.c projects/bhyve/usr.bin/rpcgen/rpc_tblout.c projects/bhyve/usr.bin/showmount/showmount.c projects/bhyve/usr.bin/top/machine.c projects/bhyve/usr.bin/truss/amd64-fbsd.c projects/bhyve/usr.bin/truss/amd64-fbsd32.c projects/bhyve/usr.bin/truss/i386-fbsd.c projects/bhyve/usr.bin/truss/ia64-fbsd.c projects/bhyve/usr.bin/truss/main.c projects/bhyve/usr.bin/truss/powerpc-fbsd.c projects/bhyve/usr.bin/truss/powerpc64-fbsd.c projects/bhyve/usr.bin/truss/sparc64-fbsd.c projects/bhyve/usr.sbin/ifmcstat/ifmcstat.8 projects/bhyve/usr.sbin/makefs/cd9660.c projects/bhyve/usr.sbin/makefs/cd9660.h projects/bhyve/usr.sbin/makefs/cd9660/cd9660_eltorito.c projects/bhyve/usr.sbin/makefs/makefs.8 projects/bhyve/usr.sbin/nfsd/nfsv4.4 projects/bhyve/usr.sbin/pc-sysinstall/backend/functions-disk.sh projects/bhyve/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh projects/bhyve/usr.sbin/pkg_install/Makefile projects/bhyve/usr.sbin/pkg_install/Makefile.inc projects/bhyve/usr.sbin/pkg_install/add/Makefile projects/bhyve/usr.sbin/pkg_install/add/extract.c projects/bhyve/usr.sbin/pkg_install/add/futil.c projects/bhyve/usr.sbin/pkg_install/add/main.c projects/bhyve/usr.sbin/pkg_install/add/perform.c projects/bhyve/usr.sbin/pkg_install/create/Makefile projects/bhyve/usr.sbin/pkg_install/create/main.c projects/bhyve/usr.sbin/pkg_install/create/perform.c projects/bhyve/usr.sbin/pkg_install/create/pl.c projects/bhyve/usr.sbin/pkg_install/delete/Makefile projects/bhyve/usr.sbin/pkg_install/delete/main.c projects/bhyve/usr.sbin/pkg_install/delete/perform.c projects/bhyve/usr.sbin/pkg_install/info/Makefile projects/bhyve/usr.sbin/pkg_install/info/info.h projects/bhyve/usr.sbin/pkg_install/info/main.c projects/bhyve/usr.sbin/pkg_install/info/perform.c projects/bhyve/usr.sbin/pkg_install/info/show.c projects/bhyve/usr.sbin/pkg_install/updating/Makefile projects/bhyve/usr.sbin/pkg_install/updating/main.c projects/bhyve/usr.sbin/pkg_install/version/Makefile projects/bhyve/usr.sbin/pkg_install/version/main.c projects/bhyve/usr.sbin/pkg_install/version/perform.c projects/bhyve/usr.sbin/tzsetup/tzsetup.8 projects/bhyve/usr.sbin/tzsetup/tzsetup.c Directory Properties: projects/bhyve/ (props changed) projects/bhyve/cddl/contrib/opensolaris/ (props changed) projects/bhyve/contrib/bind9/ (props changed) projects/bhyve/contrib/binutils/ (props changed) projects/bhyve/contrib/bzip2/ (props changed) projects/bhyve/contrib/dialog/ (props changed) projects/bhyve/contrib/ee/ (props changed) projects/bhyve/contrib/expat/ (props changed) projects/bhyve/contrib/file/ (props changed) projects/bhyve/contrib/gcc/ (props changed) projects/bhyve/contrib/gdb/ (props changed) projects/bhyve/contrib/gdtoa/ (props changed) projects/bhyve/contrib/gnu-sort/ (props changed) projects/bhyve/contrib/groff/ (props changed) projects/bhyve/contrib/less/ (props changed) projects/bhyve/contrib/libpcap/ (props changed) projects/bhyve/contrib/libstdc++/ (props changed) projects/bhyve/contrib/llvm/ (props changed) projects/bhyve/contrib/llvm/tools/clang/ (props changed) projects/bhyve/contrib/ncurses/ (props changed) projects/bhyve/contrib/netcat/ (props changed) projects/bhyve/contrib/ntp/ (props changed) projects/bhyve/contrib/one-true-awk/ (props changed) projects/bhyve/contrib/openbsm/ (props changed) projects/bhyve/contrib/openpam/ (props changed) projects/bhyve/contrib/pf/ (props changed) projects/bhyve/contrib/sendmail/ (props changed) projects/bhyve/contrib/tcpdump/ (props changed) projects/bhyve/contrib/tcsh/ (props changed) projects/bhyve/contrib/top/ (props changed) projects/bhyve/contrib/top/install-sh (props changed) projects/bhyve/contrib/tzcode/stdtime/ (props changed) projects/bhyve/contrib/tzcode/zic/ (props changed) projects/bhyve/contrib/tzdata/ (props changed) projects/bhyve/contrib/wpa/ (props changed) projects/bhyve/contrib/xz/ (props changed) projects/bhyve/crypto/openssh/ (props changed) projects/bhyve/crypto/openssl/ (props changed) projects/bhyve/gnu/lib/ (props changed) projects/bhyve/gnu/usr.bin/binutils/ (props changed) projects/bhyve/gnu/usr.bin/cc/cc_tools/ (props changed) projects/bhyve/gnu/usr.bin/gdb/ (props changed) projects/bhyve/lib/libc/ (props changed) projects/bhyve/lib/libc/stdtime/ (props changed) projects/bhyve/lib/libutil/ (props changed) projects/bhyve/lib/libz/ (props changed) projects/bhyve/sbin/ (props changed) projects/bhyve/sbin/ipfw/ (props changed) projects/bhyve/share/mk/bsd.arch.inc.mk (props changed) projects/bhyve/share/zoneinfo/ (props changed) projects/bhyve/sys/ (props changed) projects/bhyve/sys/amd64/include/xen/ (props changed) projects/bhyve/sys/boot/ (props changed) projects/bhyve/sys/boot/i386/efi/ (props changed) projects/bhyve/sys/boot/ia64/efi/ (props changed) projects/bhyve/sys/boot/ia64/ski/ (props changed) projects/bhyve/sys/boot/powerpc/boot1.chrp/ (props changed) projects/bhyve/sys/boot/powerpc/ofw/ (props changed) projects/bhyve/sys/cddl/contrib/opensolaris/ (props changed) projects/bhyve/sys/conf/ (props changed) projects/bhyve/sys/contrib/dev/acpica/ (props changed) projects/bhyve/sys/contrib/octeon-sdk/ (props changed) projects/bhyve/sys/contrib/pf/ (props changed) projects/bhyve/sys/contrib/x86emu/ (props changed) projects/bhyve/usr.bin/calendar/ (props changed) projects/bhyve/usr.bin/csup/ (props changed) projects/bhyve/usr.bin/procstat/ (props changed) projects/bhyve/usr.sbin/ndiscvt/ (props changed) projects/bhyve/usr.sbin/zic/ (props changed) Modified: projects/bhyve/Makefile.inc1 ============================================================================== --- projects/bhyve/Makefile.inc1 Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/Makefile.inc1 Tue May 24 15:39:34 2011 (r222259) @@ -1132,6 +1132,10 @@ _kgzip= usr.sbin/kgzip .endif .endif +.if ${MK_BINUTILS} != "no" +_binutils= gnu/usr.bin/binutils +.endif + .if ${MK_CLANG} != "no" .if ${CC:T:Mclang} == "clang" _clang= usr.bin/clang @@ -1139,12 +1143,16 @@ _clang_libs= lib/clang .endif .endif +.if ${MK_GCC} != "no" +_cc= gnu/usr.bin/cc +.endif + cross-tools: .for _tool in \ ${_clang_libs} \ ${_clang} \ - gnu/usr.bin/binutils \ - gnu/usr.bin/cc \ + ${_binutils} \ + ${_cc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ ${_crunchide} \ @@ -1205,7 +1213,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libroken} \ lib/libbz2 lib/libcom_err lib/libcrypt \ - lib/libexpat lib/libfetch \ + lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ @@ -1238,7 +1246,6 @@ _cddl_lib= cddl/lib _secure_lib_libcrypto= secure/lib/libcrypto _secure_lib_libssl= secure/lib/libssl lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L -lib/libfetch__L: secure/lib/libcrypto__L secure/lib/libssl__L lib/libmd__L .if ${MK_OPENSSH} != "no" _secure_lib_libssh= secure/lib/libssh secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L @@ -1274,7 +1281,7 @@ _lib_libypclnt= lib/libypclnt .endif .if ${MK_OPENSSL} == "no" -lib/libfetch__L lib/libradius__L: lib/libmd__L +lib/libradius__L: lib/libmd__L .endif .for _lib in ${_prereq_libs} @@ -1553,7 +1560,8 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ - gnu/usr.bin/cc + gnu/usr.bin/cc \ + usr.bin/ar ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -1578,7 +1586,8 @@ _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ gnu/usr.bin/binutils \ - gnu/usr.bin/cc + gnu/usr.bin/cc \ + usr.bin/ar ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR} Modified: projects/bhyve/bin/ed/POSIX ============================================================================== --- projects/bhyve/bin/ed/POSIX Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/ed/POSIX Tue May 24 15:39:34 2011 (r222259) @@ -75,7 +75,7 @@ DEVIATIONS 2) Since the behavior of `u' (undo) within a `g' (global) command list is not specified by POSIX, it follows the behavior of the SunOS ed: undo forces a global command list to be executed only once, rather than - for each line matching a global pattern. In addtion, each instance of + for each line matching a global pattern. In addition, each instance of `u' within a global command undoes all previous commands (including undo's) in the command list. This seems the best way, since the alternatives are either too complicated to implement or too confusing @@ -83,7 +83,7 @@ DEVIATIONS The global/undo combination is useful for masking errors that would otherwise cause a script to fail. For instance, an ed script - to remove any occurences of either `censor1' or `censor2' might be + to remove any occurrences of either `censor1' or `censor2' might be written as: ed - file <= 0) { @@ -794,7 +794,7 @@ ar_rdsync(void) /* * ar_fow() - * Move the I/O position within the archive foward the specified number of + * Move the I/O position within the archive forward the specified number of * bytes as supported by the device. If we cannot move the requested * number of bytes, return the actual number of bytes moved in skipped. * Return: @@ -813,7 +813,7 @@ ar_fow(off_t sksz, off_t *skipped) return(0); /* - * we cannot move foward at EOF or error + * we cannot move forward at EOF or error */ if (lstrval <= 0) return(lstrval); @@ -822,7 +822,7 @@ ar_fow(off_t sksz, off_t *skipped) * Safer to read forward on devices where it is hard to find the end of * the media without reading to it. With tapes we cannot be sure of the * number of physical blocks to skip (we do not know physical block - * size at this point), so we must only read foward on tapes! + * size at this point), so we must only read forward on tapes! */ if (artyp != ISREG) return(0); @@ -907,7 +907,7 @@ ar_rev(off_t sksz) /* * we may try to go backwards past the start when the archive - * is only a single record. If this hapens and we are on a + * is only a single record. If this happens and we are on a * multi volume archive, we need to go to the end of the * previous volume and continue our movement backwards from * there. @@ -1046,7 +1046,7 @@ get_phys(void) } /* - * read foward to the file mark, then back up in front of the filemark + * read forward to the file mark, then back up in front of the filemark * (this is a bit paranoid, but should be safe to do). */ while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0) Modified: projects/bhyve/bin/pax/ar_subs.c ============================================================================== --- projects/bhyve/bin/pax/ar_subs.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/ar_subs.c Tue May 24 15:39:34 2011 (r222259) @@ -854,7 +854,7 @@ copy(void) } /* - * Non standard -Y and -Z flag. When the exisiting file is + * Non standard -Y and -Z flag. When the existing file is * same age or newer skip */ if ((Yflag || Zflag) && ((lstat(arcn->name, &sb) == 0))) { @@ -1096,7 +1096,7 @@ next_head(ARCHD *arcn) } /* - * ok got a valid header, check for trailer if format encodes it in the + * ok got a valid header, check for trailer if format encodes it in * the header. */ if (frmt->inhead && ((*frmt->trail_cpio)(arcn) == 0)) { Modified: projects/bhyve/bin/pax/buf_subs.c ============================================================================== --- projects/bhyve/bin/pax/buf_subs.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/buf_subs.c Tue May 24 15:39:34 2011 (r222259) @@ -145,7 +145,7 @@ rd_start(void) } if (wrblksz % BLKMULT) { paxwarn(1, "Write block size %d is not a %d byte multiple", - wrblksz, BLKMULT); + wrblksz, BLKMULT); return(-1); } } @@ -182,13 +182,13 @@ cp_start(void) * the start of the header of the first file added to the archive. The * format specific end read function tells us how many bytes to move * backwards in the archive to be positioned BEFORE the trailer. Two - * different postions have to be adjusted, the O.S. file offset (e.g. the + * different positions have to be adjusted, the O.S. file offset (e.g. the * position of the tape head) and the write point within the data we have * stored in the read (soon to become write) buffer. We may have to move * back several records (the number depends on the size of the archive * record and the size of the format trailer) to read up the record where * the first byte of the trailer is recorded. Trailers may span (and - * overlap) record boundries. + * overlap) record boundaries. * We first calculate which record has the first byte of the trailer. We * move the OS file offset back to the start of this record and read it * up. We set the buffer write pointer to be at this byte (the byte where @@ -196,10 +196,10 @@ cp_start(void) * start of this record so a flush of this buffer will replace the record * in the archive. * A major problem is rewriting this last record. For archives stored - * on disk files, this is trival. However, many devices are really picky + * on disk files, this is trivial. However, many devices are really picky * about the conditions under which they will allow a write to occur. * Often devices restrict the conditions where writes can be made writes, - * so it may not be feasable to append archives stored on all types of + * so it may not be feasible to append archives stored on all types of * devices. * Return: * 0 for success, -1 for failure @@ -365,7 +365,7 @@ rd_sync(void) * pback() * push the data used during the archive id phase back into the I/O * buffer. This is required as we cannot be sure that the header does NOT - * overlap a block boundry (as in the case we are trying to recover a + * overlap a block boundary (as in the case we are trying to recover a * flawed archived). This was not designed to be used for any other * purpose. (What software engineering, HA!) * WARNING: do not even THINK of pback greater than BLKMULT, unless the @@ -382,7 +382,7 @@ pback(char *pt, int cnt) /* * rd_skip() - * skip foward in the archive during an archive read. Used to get quickly + * skip forward in the archive during an archive read. Used to get quickly * past file data and padding for files the user did NOT select. * Return: * 0 if ok, -1 failure, and 1 when EOF on the archive volume was detected. @@ -396,7 +396,7 @@ rd_skip(off_t skcnt) off_t skipped = 0; /* - * consume what data we have in the buffer. If we have to move foward + * consume what data we have in the buffer. If we have to move forward * whole records, we call the low level skip function to see if we can * move within the archive without doing the expensive reads on data we * do not want. @@ -453,7 +453,7 @@ rd_skip(off_t skcnt) * wr_fin() * flush out any data (and pad if required) the last block. We always pad * with zero (even though we do not have to). Padding with 0 makes it a - * lot easier to recover if the archive is damaged. zero paddding SHOULD + * lot easier to recover if the archive is damaged. zero padding SHOULD * BE a requirement.... */ @@ -530,7 +530,7 @@ rd_wrbuf(char *in, int cpcnt) /* * read error, return what we got (or the error if * no data was copied). The caller must know that an - * error occured and has the best knowledge what to + * error occurred and has the best knowledge what to * do with it */ if ((res = cpcnt - incnt) > 0) @@ -584,7 +584,7 @@ wr_skip(off_t skcnt) /* * wr_rdfile() - * fill write buffer with the contents of a file. We are passed an open + * fill write buffer with the contents of a file. We are passed an open * file descriptor to the file and the archive structure that describes the * file we are storing. The variable "left" is modified to contain the * number of bytes of the file we were NOT able to write to the archive. @@ -671,7 +671,7 @@ rd_wrfile(ARCHD *arcn, int ofd, off_t *l int isem = 1; int rem; int sz = MINFBSZ; - struct stat sb; + struct stat sb; u_long crc = 0L; /* @@ -884,7 +884,7 @@ buf_flush(int bufcnt) /* * if we have reached the user specified byte count for each archive - * volume, prompt for the next volume. (The non-standrad -R flag). + * volume, prompt for the next volume. (The non-standard -R flag). * NOTE: If the wrlimit is smaller than wrcnt, we will always write * at least one record. We always round limit UP to next blocksize. */ @@ -944,7 +944,7 @@ buf_flush(int bufcnt) } else if (cnt > 0) { /* * Oh drat we got a partial write! - * if format doesnt care about alignment let it go, + * if format doesn't care about alignment let it go, * we warned the user in ar_write().... but this means * the last record on this volume violates pax spec.... */ Modified: projects/bhyve/bin/pax/cpio.c ============================================================================== --- projects/bhyve/bin/pax/cpio.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/cpio.c Tue May 24 15:39:34 2011 (r222259) @@ -627,7 +627,7 @@ vcpio_rd(ARCHD *arcn, char *buf) return(-1); /* - * skip padding. header + filename is aligned to 4 byte boundries + * skip padding. header + filename is aligned to 4 byte boundaries */ if (rd_skip((off_t)(VCPIO_PAD(sizeof(HD_VCPIO) + nsz))) < 0) return(-1); @@ -942,7 +942,7 @@ bcpio_rd(ARCHD *arcn, char *buf) return(-1); /* - * header + file name are aligned to 2 byte boundries, skip if needed + * header + file name are aligned to 2 byte boundaries, skip if needed */ if (rd_skip((off_t)(BCPIO_PAD(sizeof(HD_BCPIO) + nsz))) < 0) return(-1); @@ -989,8 +989,8 @@ bcpio_endrd(void) * bcpio_wr() * copy the data in the ARCHD to buffer in old binary cpio format * There is a real chance of field overflow with this critter. So we - * always check the conversion is ok. nobody in his their right mind - * should write an achive in this format... + * always check that the conversion is ok. nobody in their right mind + * should write an archive in this format... * Return * 0 if file has data to be written after the header, 1 if file has NO * data to write after the header, -1 if archive write failed Modified: projects/bhyve/bin/pax/file_subs.c ============================================================================== --- projects/bhyve/bin/pax/file_subs.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/file_subs.c Tue May 24 15:39:34 2011 (r222259) @@ -84,9 +84,9 @@ file_creat(ARCHD *arcn) * works. We have to take special handling when the file does exist. To * detect this, we use O_EXCL. For example when trying to create a * file and a character device or fifo exists with the same name, we - * can accidently open the device by mistake (or block waiting to open) - * If we find that the open has failed, then figure spend the effort to - * figure out why. This strategy was found to have better average + * can accidentally open the device by mistake (or block waiting to + * open). If we find that the open has failed, then spend the effort + * to figure out why. This strategy was found to have better average * performance in common use than checking the file (and the path) * first with lstat. */ @@ -559,7 +559,7 @@ chk_path( char *name, uid_t st_uid, gid_ for(;;) { /* - * work foward from the first / and check each part of the path + * work forward from the first / and check each part of the path */ spt = strchr(spt, '/'); if (spt == NULL) @@ -600,7 +600,7 @@ chk_path( char *name, uid_t st_uid, gid_ (void)set_ids(name, st_uid, st_gid); /* - * make sure the user doen't have some strange umask that + * make sure the user doesn't have some strange umask that * causes this newly created directory to be unusable. We fix * the modes and restore them back to the creation default at * the end of pax @@ -716,11 +716,11 @@ set_pmode(char *fnm, mode_t mode) * uses lseek whenever it detects the input data is all 0 within that * file block. In more detail, the strategy is as follows: * While the input is all zero keep doing an lseek. Keep track of when we - * pass over file block boundries. Only write when we hit a non zero + * pass over file block boundaries. Only write when we hit a non zero * input. once we have written a file block, we continue to write it to * the end (we stop looking at the input). When we reach the start of the * next file block, start checking for zero blocks again. Working on file - * block boundries significantly reduces the overhead when copying files + * block boundaries significantly reduces the overhead when copying files * that are NOT very sparse. This overhead (when compared to a write) is * almost below the measurement resolution on many systems. Without it, * files with holes cannot be safely copied. It does has a side effect as @@ -923,7 +923,7 @@ set_crc(ARCHD *arcn, int fd) /* * safety check. we want to avoid archiving files that are active as - * they can create inconsistant archive copies. + * they can create inconsistent archive copies. */ if (cpcnt != arcn->sb.st_size) paxwarn(1, "File changed size %s", arcn->org_name); Modified: projects/bhyve/bin/pax/ftree.c ============================================================================== --- projects/bhyve/bin/pax/ftree.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/ftree.c Tue May 24 15:39:34 2011 (r222259) @@ -101,8 +101,8 @@ ftree_start(void) /* * optional user flags that effect file traversal * -H command line symlink follow only (half follow) - * -L follow sylinks (logical) - * -P do not follow sylinks (physical). This is the default. + * -L follow symlinks (logical) + * -P do not follow symlinks (physical). This is the default. * -X do not cross over mount points * -t preserve access times on files read. * -n select only the first member of a file tree when a match is found Modified: projects/bhyve/bin/pax/options.c ============================================================================== --- projects/bhyve/bin/pax/options.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/options.c Tue May 24 15:39:34 2011 (r222259) @@ -887,7 +887,7 @@ tar_options(int argc, char **argv) sawpat = 1; } /* - * if patterns were added, we are doing chdir() + * if patterns were added, we are doing chdir() * on a file-by-file basis, else, just one * global chdir (if any) after opening input. */ Modified: projects/bhyve/bin/pax/pat_rep.c ============================================================================== --- projects/bhyve/bin/pax/pat_rep.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/pat_rep.c Tue May 24 15:39:34 2011 (r222259) @@ -397,7 +397,7 @@ pat_sel(ARCHD *arcn) /* * should never happen.... */ - paxwarn(1, "Pattern list inconsistant"); + paxwarn(1, "Pattern list inconsistent"); return(-1); } *ppt = pt->fow; Modified: projects/bhyve/bin/pax/pax.c ============================================================================== --- projects/bhyve/bin/pax/pax.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/pax.c Tue May 24 15:39:34 2011 (r222259) @@ -372,7 +372,7 @@ gen_init(void) /* * signal handling to reset stored directory times and modes. Since * we deal with broken pipes via failed writes we ignore it. We also - * deal with any file size limit thorugh failed writes. Cpu time + * deal with any file size limit thorough failed writes. Cpu time * limits are caught and a cleanup is forced. */ if ((sigemptyset(&s_mask) < 0) || (sigaddset(&s_mask, SIGTERM) < 0) || Modified: projects/bhyve/bin/pax/sel_subs.c ============================================================================== --- projects/bhyve/bin/pax/sel_subs.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/sel_subs.c Tue May 24 15:39:34 2011 (r222259) @@ -376,7 +376,7 @@ trng_add(char *str) } /* - * by default we only will check file mtime, but usee can specify + * by default we only will check file mtime, but the user can specify * mtime, ctime (inode change time) or both. */ if ((flgpt == NULL) || (*flgpt == '\0')) Modified: projects/bhyve/bin/pax/tables.c ============================================================================== --- projects/bhyve/bin/pax/tables.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/tables.c Tue May 24 15:39:34 2011 (r222259) @@ -209,7 +209,7 @@ chk_lnk(ARCHD *arcn) * purg_lnk * remove reference for a file that we may have added to the data base as * a potential source for hard links. We ended up not using the file, so - * we do not want to accidently point another file at it later on. + * we do not want to accidentally point another file at it later on. */ void @@ -306,14 +306,14 @@ lnk_end(void) * An append with an -u must read the archive and store the modification time * for every file on that archive before starting the write phase. It is clear * that this is one HUGE database. To save memory space, the actual file names - * are stored in a scatch file and indexed by an in memory hash table. The + * are stored in a scratch file and indexed by an in memory hash table. The * hash table is indexed by hashing the file path. The nodes in the table store * the length of the filename and the lseek offset within the scratch file * where the actual name is stored. Since there are never any deletions to this * table, fragmentation of the scratch file is never an issue. Lookups seem to * not exhibit any locality at all (files in the database are rarely * looked up more than once...). So caching is just a waste of memory. The - * only limitation is the amount of scatch file space available to store the + * only limitation is the amount of scratch file space available to store the * path names. */ Modified: projects/bhyve/bin/pax/tar.c ============================================================================== --- projects/bhyve/bin/pax/tar.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/pax/tar.c Tue May 24 15:39:34 2011 (r222259) @@ -291,7 +291,7 @@ tar_chksm(char *blk, int len) /* * tar_id() * determine if a block given to us is a valid tar header (and not a USTAR - * header). We have to be on the lookout for those pesky blocks of all + * header). We have to be on the lookout for those pesky blocks of all * zero's. * Return: * 0 if a tar header, -1 otherwise Modified: projects/bhyve/bin/ps/ps.1 ============================================================================== --- projects/bhyve/bin/ps/ps.1 Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/ps/ps.1 Tue May 24 15:39:34 2011 (r222259) @@ -301,7 +301,7 @@ the include file .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" -.It Dv "P_HASTHREADS" Ta No "0x00080 Has had threads (no cleanup shortcuts)" +.It Dv "P_HADTHREADS" Ta No "0x00080 Has had threads (no cleanup shortcuts)" .It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec" .It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping" .It Dv "P_SINGLE_EXIT" Ta No "0x00400 Threads suspending should exit, not wait" @@ -549,7 +549,7 @@ wait channel (as an address) total blocks written (alias .Cm oublock ) .It Cm paddr -swap address +process pointer .It Cm pagein pageins (same as majflt) .It Cm pgid Modified: projects/bhyve/bin/ps/ps.c ============================================================================== --- projects/bhyve/bin/ps/ps.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/ps/ps.c Tue May 24 15:39:34 2011 (r222259) @@ -219,7 +219,7 @@ main(int argc, char *argv[]) case 'A': /* * Exactly the same as `-ax'. This has been - * added for compatability with SUSv3, but for + * added for compatibility with SUSv3, but for * now it will not be described in the man page. */ nselectors++; Modified: projects/bhyve/bin/sh/cd.c ============================================================================== --- projects/bhyve/bin/sh/cd.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/cd.c Tue May 24 15:39:34 2011 (r222259) @@ -84,12 +84,16 @@ cdcmd(int argc, char **argv) const char *path; char *p; struct stat statb; - int ch, phys, print = 0; + int ch, phys, print = 0, getcwderr = 0; + int rc; optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = Pflag; - while ((ch = getopt(argc, argv, "LP")) != -1) { + while ((ch = getopt(argc, argv, "eLP")) != -1) { switch (ch) { + case 'e': + getcwderr = 1; + break; case 'L': phys = 0; break; @@ -131,8 +135,9 @@ cdcmd(int argc, char **argv) else print = strcmp(p, dest); } - if (docd(p, print, phys) >= 0) - return 0; + rc = docd(p, print, phys); + if (rc >= 0) + return getcwderr ? rc : 0; } } error("can't cd to %s", dest); @@ -148,17 +153,18 @@ cdcmd(int argc, char **argv) static int docd(char *dest, int print, int phys) { + int rc; TRACE(("docd(\"%s\", %d, %d) called\n", dest, print, phys)); /* If logical cd fails, fall back to physical. */ - if ((phys || cdlogical(dest) < 0) && cdphysical(dest) < 0) + if ((phys || (rc = cdlogical(dest)) < 0) && (rc = cdphysical(dest)) < 0) return (-1); if (print && iflag && curdir) out1fmt("%s\n", curdir); - return 0; + return (rc); } static int @@ -216,6 +222,7 @@ static int cdphysical(char *dest) { char *p; + int rc = 0; INTOFF; if (chdir(dest) < 0) { @@ -223,11 +230,13 @@ cdphysical(char *dest) return (-1); } p = findcwd(NULL); - if (p == NULL) + if (p == NULL) { warning("warning: failed to get name of current directory"); + rc = 1; + } updatepwd(p); INTON; - return (0); + return (rc); } /* Modified: projects/bhyve/bin/sh/eval.c ============================================================================== --- projects/bhyve/bin/sh/eval.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/eval.c Tue May 24 15:39:34 2011 (r222259) @@ -552,7 +552,8 @@ evalpipe(union node *n) if (prevfd >= 0) close(prevfd); prevfd = pip[0]; - close(pip[1]); + if (pip[1] != -1) + close(pip[1]); } INTON; if (n->npipe.backgnd == 0) { @@ -713,15 +714,9 @@ evalcommand(union node *cmd, int flags, oexitstatus = exitstatus; exitstatus = 0; for (argp = cmd->ncmd.args ; argp ; argp = argp->narg.next) { - char *p = argp->narg.text; - if (varflag && is_name(*p)) { - do { - p++; - } while (is_in_name(*p)); - if (*p == '=') { - expandarg(argp, &varlist, EXP_VARTILDE); - continue; - } + if (varflag && isassignment(argp->narg.text)) { + expandarg(argp, &varlist, EXP_VARTILDE); + continue; } expandarg(argp, &arglist, EXP_FULL | EXP_TILDE); varflag = 0; Modified: projects/bhyve/bin/sh/main.c ============================================================================== --- projects/bhyve/bin/sh/main.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/main.c Tue May 24 15:39:34 2011 (r222259) @@ -281,7 +281,6 @@ readcmdfile(const char *name) static char * find_dot_file(char *basename) { - static char localname[FILENAME_MAX+1]; char *fullname; const char *path = pathval(); struct stat statb; @@ -291,10 +290,14 @@ find_dot_file(char *basename) return basename; while ((fullname = padvance(&path, basename)) != NULL) { - strcpy(localname, fullname); + if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) { + /* + * Don't bother freeing here, since it will + * be freed by the caller. + */ + return fullname; + } stunalloc(fullname); - if ((stat(fullname, &statb) == 0) && S_ISREG(statb.st_mode)) - return localname; } return basename; } Modified: projects/bhyve/bin/sh/miscbltin.c ============================================================================== --- projects/bhyve/bin/sh/miscbltin.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/miscbltin.c Tue May 24 15:39:34 2011 (r222259) @@ -465,7 +465,7 @@ ulimitcmd(int argc __unused, char **argv "(-%c) ", l->option); out1fmt("%-18s %18s ", l->name, optbuf); if (val == RLIM_INFINITY) - out1fmt("unlimited\n"); + out1str("unlimited\n"); else { val /= l->factor; @@ -491,7 +491,7 @@ ulimitcmd(int argc __unused, char **argv val = limit.rlim_max; if (val == RLIM_INFINITY) - out1fmt("unlimited\n"); + out1str("unlimited\n"); else { val /= l->factor; Modified: projects/bhyve/bin/sh/mkinit.c ============================================================================== --- projects/bhyve/bin/sh/mkinit.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/mkinit.c Tue May 24 15:39:34 2011 (r222259) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); /* - * A text structure is basicly just a string that grows as more characters + * A text structure is basically just a string that grows as more characters * are added onto the end of it. It is implemented as a linked list of * blocks of characters. The routines addstr and addchar append a string * or a single character, respectively, to a text structure. Writetext Modified: projects/bhyve/bin/sh/mktokens ============================================================================== --- projects/bhyve/bin/sh/mktokens Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/mktokens Tue May 24 15:39:34 2011 (r222259) @@ -50,7 +50,6 @@ TPIPE 0 "|" TLP 0 "(" TRP 1 ")" TENDCASE 1 ";;" -TENDBQUOTE 1 "`" TREDIR 0 redirection TWORD 0 word TIF 0 "if" Modified: projects/bhyve/bin/sh/parser.c ============================================================================== --- projects/bhyve/bin/sh/parser.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/parser.c Tue May 24 15:39:34 2011 (r222259) @@ -619,6 +619,7 @@ simplecmd(union node **rpp, union node * union node **orig_rpp = rpp; union node *n = NULL; int special; + int savecheckkwd; /* If we don't have any redirections already, then we must reset */ /* rpp to be the address of the local redir variable. */ @@ -634,7 +635,10 @@ simplecmd(union node **rpp, union node * */ orig_rpp = rpp; + savecheckkwd = CHKALIAS; + for (;;) { + checkkwd = savecheckkwd; if (readtoken() == TWORD) { n = (union node *)stalloc(sizeof (struct narg)); n->type = NARG; @@ -642,6 +646,8 @@ simplecmd(union node **rpp, union node * n->narg.backquote = backquotelist; *app = n; app = &n->narg.next; + if (savecheckkwd != 0 && !isassignment(wordtext)) + savecheckkwd = 0; } else if (lasttoken == TREDIR) { *rpp = n = redirnode; rpp = &n->nfile.next; @@ -1513,10 +1519,12 @@ checkend: { p = line; for (q = eofmark + 1 ; *q && *p == *q ; p++, q++); - if (*p == '\n' && *q == '\0') { + if ((*p == '\0' || *p == '\n') && *q == '\0') { c = PEOF; - plinno++; - needprompt = doprompt; + if (*p == '\n') { + plinno++; + needprompt = doprompt; + } } else { pushstring(line, strlen(line), NULL); } @@ -1857,6 +1865,22 @@ goodname(const char *name) } +int +isassignment(const char *p) +{ + if (!is_name(*p)) + return 0; + p++; + for (;;) { + if (*p == '=') + return 1; + else if (!is_in_name(*p)) + return 0; + p++; + } +} + + /* * Called when an unexpected token is read during the parse. The argument * is the token that is expected, or -1 if more than one type of token can Modified: projects/bhyve/bin/sh/parser.h ============================================================================== --- projects/bhyve/bin/sh/parser.h Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/parser.h Tue May 24 15:39:34 2011 (r222259) @@ -80,4 +80,5 @@ extern const char *const parsekwd[]; union node *parsecmd(int); void fixredir(union node *, const char *, int); int goodname(const char *); +int isassignment(const char *); char *getprompt(void *); Modified: projects/bhyve/bin/sh/sh.1 ============================================================================== --- projects/bhyve/bin/sh/sh.1 Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/sh.1 Tue May 24 15:39:34 2011 (r222259) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd May 21, 2011 .Dt SH 1 .Os .Sh NAME @@ -506,8 +506,8 @@ The following are keywords: An alias is a name and corresponding value set using the .Ic alias built-in command. -Whenever a keyword may occur (see above), -and after checking for keywords, the shell +Wherever the command word of a simple command may occur, +and after checking for keywords if a keyword may occur, the shell checks the word to see if it matches an alias. If it does, it replaces it in the input stream with its value. For example, if there is an alias called @@ -1729,7 +1729,7 @@ Execute the specified built-in command, .Ar cmd . This is useful when the user wishes to override a shell function with the same name as a built-in command. -.It Ic cd Oo Fl L | P Oc Op Ar directory +.It Ic cd Oo Fl L | P Oc Oo Fl e Oc Op Ar directory Switch to the specified .Ar directory , or to the directory specified in the @@ -1778,6 +1778,15 @@ option is specified, .Pa .. is handled logically. This is the default. +.Pp +The +.Fl e +option causes +.Ic cd +to return exit status 1 if the full pathname of the new directory +cannot be determined reliably or at all. +Normally this is not considered an error, +although a warning is printed. .It Ic chdir A synonym for the .Ic cd Modified: projects/bhyve/bin/sh/var.c ============================================================================== --- projects/bhyve/bin/sh/var.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/bin/sh/var.c Tue May 24 15:39:34 2011 (r222259) @@ -681,14 +681,13 @@ exportcmd(int argc, char **argv) out1str(cmdname); out1c(' '); } - p = strchr(vp->text, '='); if (values && !(vp->flags & VUNSET)) { - p++; - outbin(vp->text, p - vp->text, - out1); - out1qstr(p); + outbin(vp->text, + vp->name_len + 1, out1); + out1qstr(vp->text + + vp->name_len + 1); } else - outbin(vp->text, p - vp->text, + outbin(vp->text, vp->name_len, out1); out1c('\n'); } Modified: projects/bhyve/contrib/binutils/binutils/objcopy.c ============================================================================== --- projects/bhyve/contrib/binutils/binutils/objcopy.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/binutils/objcopy.c Tue May 24 15:39:34 2011 (r222259) @@ -1542,7 +1542,8 @@ copy_object (bfd *ibfd, bfd *obfd) /* Umm, not sure what to do in this case. */ debuglink_vma = 0x1000; - bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma); + (void) bfd_set_section_vma (obfd, gnu_debuglink_section, + debuglink_vma); } } Modified: projects/bhyve/contrib/binutils/binutils/readelf.c ============================================================================== --- projects/bhyve/contrib/binutils/binutils/readelf.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/binutils/readelf.c Tue May 24 15:39:34 2011 (r222259) @@ -9701,7 +9701,7 @@ process_archive (char *file_name, FILE * } if ((longnames_size & 1) != 0) - getc (file); + (void) getc (file); got = fread (&arhdr, 1, sizeof arhdr, file); if (got != sizeof arhdr) Modified: projects/bhyve/contrib/binutils/binutils/strings.c ============================================================================== --- projects/bhyve/contrib/binutils/binutils/strings.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/binutils/strings.c Tue May 24 15:39:34 2011 (r222259) @@ -593,7 +593,7 @@ print_strings (const char *filename, FIL case 8: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lo ", (unsigned long long) start); + printf ("%7llo ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -608,7 +608,7 @@ print_strings (const char *filename, FIL case 10: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Ld ", (unsigned long long) start); + printf ("%7lld ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG @@ -623,7 +623,7 @@ print_strings (const char *filename, FIL case 16: #if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2) if (sizeof (start) > sizeof (long)) - printf ("%7Lx ", (unsigned long long) start); + printf ("%7llx ", (unsigned long long) start); else #else # if !BFD_HOST_64BIT_LONG Modified: projects/bhyve/contrib/binutils/gas/read.h ============================================================================== --- projects/bhyve/contrib/binutils/gas/read.h Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/gas/read.h Tue May 24 15:39:34 2011 (r222259) @@ -30,7 +30,7 @@ extern char *input_line_pointer; /* -> c #ifdef PERMIT_WHITESPACE #define SKIP_WHITESPACE() \ - ((*input_line_pointer == ' ') ? ++input_line_pointer : 0) + do { if (*input_line_pointer == ' ') ++input_line_pointer; } while (0) #else #define SKIP_WHITESPACE() know(*input_line_pointer != ' ' ) #endif Modified: projects/bhyve/contrib/binutils/gas/write.c ============================================================================== --- projects/bhyve/contrib/binutils/gas/write.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/gas/write.c Tue May 24 15:39:34 2011 (r222259) @@ -345,7 +345,7 @@ record_alignment (/* Segment to which al return; if ((unsigned int) align > bfd_get_section_alignment (stdoutput, seg)) - bfd_set_section_alignment (stdoutput, seg, align); + (void) bfd_set_section_alignment (stdoutput, seg, align); } int @@ -2247,7 +2247,7 @@ relax_segment (struct frag *segment_frag newf = frag_alloc (ob); obstack_blank_fast (ob, fragP->fr_var); - obstack_finish (ob); + (void) obstack_finish (ob); memcpy (newf, fragP, SIZEOF_STRUCT_FRAG); memcpy (newf->fr_literal, fragP->fr_literal + fragP->fr_fix, Modified: projects/bhyve/contrib/binutils/ld/ldlang.c ============================================================================== --- projects/bhyve/contrib/binutils/ld/ldlang.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/binutils/ld/ldlang.c Tue May 24 15:39:34 2011 (r222259) @@ -4274,9 +4274,10 @@ lang_size_sections_1 " section %s\n"), os->name); input = os->children.head->input_section.section; - bfd_set_section_vma (os->bfd_section->owner, - os->bfd_section, - bfd_section_vma (input->owner, input)); + (void) bfd_set_section_vma (os->bfd_section->owner, + os->bfd_section, + bfd_section_vma (input->owner, + input)); os->bfd_section->size = input->size; break; } @@ -4361,7 +4362,7 @@ lang_size_sections_1 os->name, (unsigned long) (newdot - savedot)); } - bfd_set_section_vma (0, os->bfd_section, newdot); + (void) bfd_set_section_vma (0, os->bfd_section, newdot); os->bfd_section->output_offset = 0; } Modified: projects/bhyve/contrib/gcc/combine.c ============================================================================== --- projects/bhyve/contrib/gcc/combine.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/gcc/combine.c Tue May 24 15:39:34 2011 (r222259) @@ -12442,7 +12442,7 @@ distribute_notes (rtx notes, rtx from_in REG_N_DEATHS (REGNO (XEXP (note, 0)))++; REG_NOTES (place2) = gen_rtx_fmt_ee (GET_CODE (note), - REG_NOTE_KIND (note), + GET_MODE (note), XEXP (note, 0), REG_NOTES (place2)); } Modified: projects/bhyve/contrib/gcc/emit-rtl.c ============================================================================== --- projects/bhyve/contrib/gcc/emit-rtl.c Tue May 24 15:02:42 2011 (r222258) +++ projects/bhyve/contrib/gcc/emit-rtl.c Tue May 24 15:39:34 2011 (r222259) @@ -3210,7 +3210,7 @@ try_split (rtx pat, rtx trial, int last) { if (CALL_P (insn)) REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note), + = gen_rtx_EXPR_LIST (GET_MODE (note), XEXP (note, 0), REG_NOTES (insn)); insn = PREV_INSN (insn); @@ -3223,7 +3223,7 @@ try_split (rtx pat, rtx trial, int last) { if (JUMP_P (insn)) REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_NOTE_KIND (note), + = gen_rtx_EXPR_LIST (GET_MODE (note), XEXP (note, 0), REG_NOTES (insn)); insn = PREV_INSN (insn); @@ -4589,7 +4589,8 @@ set_unique_reg_note (rtx insn, enum reg_ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue May 24 15:47:41 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DEA106566C; Tue, 24 May 2011 15:47:41 +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 29DC48FC0C; Tue, 24 May 2011 15:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4OFlftu075878; Tue, 24 May 2011 15:47:41 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4OFlf7H075875; Tue, 24 May 2011 15:47:41 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105241547.p4OFlf7H075875@svn.freebsd.org> From: Attilio Rao Date: Tue, 24 May 2011 15:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222260 - in projects/largeSMP/sys/i386: i386 xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 15:47:41 -0000 Author: attilio Date: Tue May 24 15:47:40 2011 New Revision: 222260 URL: http://svn.freebsd.org/changeset/base/222260 Log: - Fix a misusage of cpuset_t objects - Fix a typo Reported by: pluknet Modified: projects/largeSMP/sys/i386/i386/pmap.c projects/largeSMP/sys/i386/xen/pmap.c Modified: projects/largeSMP/sys/i386/i386/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/i386/pmap.c Tue May 24 15:39:34 2011 (r222259) +++ projects/largeSMP/sys/i386/i386/pmap.c Tue May 24 15:47:40 2011 (r222260) @@ -1939,7 +1939,7 @@ pmap_lazyfix(pmap_t pmap) { cpuset_t mymask, mask; u_int spins; - int lbs; + int lsb; mask = pmap->pm_active; while (!CPU_EMPTY(&mask)) { @@ -1957,7 +1957,7 @@ pmap_lazyfix(pmap_t pmap) lazyptd = vtophys(pmap->pm_pdir); #endif mymask = PCPU_GET(cpumask); - if (mask == mymask) { + if (!CPU_CMP(&mask, &mymask)) { lazymask = &pmap->pm_active; pmap_lazyfix_self(mymask); } else { Modified: projects/largeSMP/sys/i386/xen/pmap.c ============================================================================== --- projects/largeSMP/sys/i386/xen/pmap.c Tue May 24 15:39:34 2011 (r222259) +++ projects/largeSMP/sys/i386/xen/pmap.c Tue May 24 15:47:40 2011 (r222260) @@ -1740,7 +1740,7 @@ pmap_lazyfix(pmap_t pmap) lazyptd = vtophys(pmap->pm_pdir); #endif mymask = PCPU_GET(cpumask); - if (mask == mymask) { + if (!CPU_CMP(&mask, &mymask)) { lazymask = &pmap->pm_active; pmap_lazyfix_self(mymask); } else { From owner-svn-src-projects@FreeBSD.ORG Wed May 25 13:30:44 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C22C106566B; Wed, 25 May 2011 13:30:44 +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 7C9678FC12; Wed, 25 May 2011 13:30:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4PDUiRL016712; Wed, 25 May 2011 13:30:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4PDUisl016710; Wed, 25 May 2011 13:30:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105251330.p4PDUisl016710@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 May 2011 13:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222284 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 13:30:44 -0000 Author: nwhitehorn Date: Wed May 25 13:30:44 2011 New Revision: 222284 URL: http://svn.freebsd.org/changeset/base/222284 Log: Fix typo. Submitted by: trasz Modified: projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Wed May 25 11:14:26 2011 (r222283) +++ projects/pseries/powerpc/pseries/platform_chrp.c Wed May 25 13:30:44 2011 (r222284) @@ -288,7 +288,7 @@ chrp_smp_start_cpu(platform_t plat, stru int result, err, timeout; if (!rtas_exists()) { - printf("RTAS unitialized: unable to start AP %d\n", + printf("RTAS uninitialized: unable to start AP %d\n", pc->pc_cpuid); return (ENXIO); } From owner-svn-src-projects@FreeBSD.ORG Wed May 25 21:49:57 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C279106564A; Wed, 25 May 2011 21:49:57 +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 1D27B8FC13; Wed, 25 May 2011 21:49:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4PLnv17031670; Wed, 25 May 2011 21:49:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4PLnuVe031668; Wed, 25 May 2011 21:49:56 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105252149.p4PLnuVe031668@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 May 2011 21:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222293 - projects/pseries/powerpc/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 21:49:57 -0000 Author: nwhitehorn Date: Wed May 25 21:49:56 2011 New Revision: 222293 URL: http://svn.freebsd.org/changeset/base/222293 Log: Remove some pointless code. Modified: projects/pseries/powerpc/ofw/ofw_machdep.c Modified: projects/pseries/powerpc/ofw/ofw_machdep.c ============================================================================== --- projects/pseries/powerpc/ofw/ofw_machdep.c Wed May 25 21:38:16 2011 (r222292) +++ projects/pseries/powerpc/ofw/ofw_machdep.c Wed May 25 21:49:56 2011 (r222293) @@ -483,12 +483,7 @@ openfirmware(void *args) int result; #ifdef SMP struct ofw_rv_args rv_args; - #endif - - if (pmap_bootstrapped && ofw_real_mode) - args = (void *)pmap_kextract((vm_offset_t)args); - #ifdef SMP rv_args.args = args; rv_args.in_progress = 1; smp_rendezvous(smp_no_rendevous_barrier, ofw_rendezvous_dispatch, From owner-svn-src-projects@FreeBSD.ORG Wed May 25 21:53:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2BE2106564A; Wed, 25 May 2011 21:53:25 +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 9399A8FC08; Wed, 25 May 2011 21:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4PLrPRM031808; Wed, 25 May 2011 21:53:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4PLrPCW031806; Wed, 25 May 2011 21:53:25 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105252153.p4PLrPCW031806@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 May 2011 21:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222294 - projects/pseries/powerpc/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 21:53:25 -0000 Author: nwhitehorn Date: Wed May 25 21:53:25 2011 New Revision: 222294 URL: http://svn.freebsd.org/changeset/base/222294 Log: Add some better error handling/reporting. Modified: projects/pseries/powerpc/ofw/rtas.c Modified: projects/pseries/powerpc/ofw/rtas.c ============================================================================== --- projects/pseries/powerpc/ofw/rtas.c Wed May 25 21:49:56 2011 (r222293) +++ projects/pseries/powerpc/ofw/rtas.c Wed May 25 21:53:25 2011 (r222294) @@ -77,12 +77,17 @@ rtas_setup(void *junk) int result; rtas = OF_finddevice("/rtas"); - if (rtas == -1) + if (rtas == -1) { + rtas = 0; return; + } OF_package_to_path(rtas, path, sizeof(path)); rtasi = OF_open(path); - if (rtasi == -1 || rtasi == 0) + if (rtasi == -1 || rtasi == 0) { + rtas = 0; + printf("Error initializing RTAS: could not open node\n"); return; + } mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0); @@ -123,7 +128,7 @@ rtas_setup(void *junk) if (result != 0) { rtas = 0; rtas_ptr = 0; - printf("Error initializing RTAS\n"); + printf("Error initializing RTAS (%d)\n", result); return; } From owner-svn-src-projects@FreeBSD.ORG Thu May 26 17:38:01 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24FC41065675; Thu, 26 May 2011 17:38:01 +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 1340A8FC13; Thu, 26 May 2011 17:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4QHc0Vb074365; Thu, 26 May 2011 17:38:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4QHc0N7074323; Thu, 26 May 2011 17:38:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105261738.p4QHc0N7074323@svn.freebsd.org> From: Attilio Rao Date: Thu, 26 May 2011 17:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222318 - in projects/largeSMP: bin/sh cddl/compat/opensolaris/misc contrib/openbsm/libbsm contrib/top gnu/usr.bin gnu/usr.bin/grep lib/libc/gen sbin/geom/class/part share/man/man4 shar... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 17:38:01 -0000 Author: attilio Date: Thu May 26 17:38:00 2011 New Revision: 222318 URL: http://svn.freebsd.org/changeset/base/222318 Log: MFC Added: projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.h projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.ini - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287.ini projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287an.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287an.h projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287phy.h - copied unchanged from r222317, head/sys/dev/ath/ath_hal/ar9002/ar9287phy.h Modified: projects/largeSMP/bin/sh/cd.c projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3 projects/largeSMP/gnu/usr.bin/Makefile projects/largeSMP/gnu/usr.bin/grep/Makefile projects/largeSMP/lib/libc/gen/feature_present.3 projects/largeSMP/sbin/geom/class/part/geom_part.c projects/largeSMP/share/man/man4/atrtc.4 projects/largeSMP/share/man/man4/attimer.4 projects/largeSMP/share/man/man4/cc.4 projects/largeSMP/share/man/man4/h_ertt.4 projects/largeSMP/share/man/man4/nvram2env.4 projects/largeSMP/share/man/man7/eventtimers.7 projects/largeSMP/share/man/man7/ports.7 projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9 projects/largeSMP/share/man/man9/hhook.9 projects/largeSMP/share/man/man9/khelp.9 projects/largeSMP/share/misc/committers-src.dot projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/largeSMP/sys/conf/kern.mk projects/largeSMP/sys/dev/ahci/ahci.c projects/largeSMP/sys/dev/ath/ath_hal/ah.c projects/largeSMP/sys/dev/ath/ath_hal/ah.h projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416desc.h projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416phy.h projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/largeSMP/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c projects/largeSMP/sys/dev/ath/if_athvar.h projects/largeSMP/sys/dev/msk/if_msk.c projects/largeSMP/sys/dev/mvs/mvs.c projects/largeSMP/sys/dev/siis/siis.c projects/largeSMP/sys/dev/sound/pci/hda/hdac.c projects/largeSMP/sys/dev/uart/uart_dev_ns8250.c projects/largeSMP/sys/fs/nfs/nfs_var.h projects/largeSMP/sys/fs/nfsclient/nfs_clrpcops.c projects/largeSMP/sys/fs/nfsclient/nfs_clvnops.c projects/largeSMP/sys/geom/part/g_part_ebr.c projects/largeSMP/sys/geom/part/g_part_mbr.c projects/largeSMP/sys/geom/part/g_part_pc98.c projects/largeSMP/sys/geom/vinum/geom_vinum_drive.c projects/largeSMP/sys/geom/vinum/geom_vinum_events.c projects/largeSMP/sys/kern/device_if.m projects/largeSMP/sys/kern/kern_synch.c projects/largeSMP/sys/kern/subr_smp.c projects/largeSMP/sys/net/if_epair.c projects/largeSMP/sys/net/netisr.c projects/largeSMP/sys/net/netisr.h projects/largeSMP/sys/net/netisr_internal.h projects/largeSMP/sys/netgraph/ng_eiface.c projects/largeSMP/sys/netgraph/ng_pipe.c projects/largeSMP/sys/netinet/in_pcb.c projects/largeSMP/sys/netinet/in_proto.c projects/largeSMP/sys/netinet6/in6_proto.c projects/largeSMP/sys/powerpc/aim/trap_subr64.S projects/largeSMP/sys/powerpc/ps3/ps3bus.c projects/largeSMP/tools/build/make_check/Makefile projects/largeSMP/tools/build/options/WITH_BSD_GREP projects/largeSMP/tools/tools/ether_reflect/ether_reflect.1 projects/largeSMP/usr.bin/Makefile projects/largeSMP/usr.bin/calendar/calendars/calendar.freebsd projects/largeSMP/usr.bin/grep/Makefile projects/largeSMP/usr.bin/gzip/gzip.c projects/largeSMP/usr.bin/mkcsmapper/mkcsmapper.1 projects/largeSMP/usr.bin/mkesdb/mkesdb.1 projects/largeSMP/usr.bin/netstat/netisr.c projects/largeSMP/usr.bin/showmount/showmount.c projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 projects/largeSMP/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 projects/largeSMP/usr.sbin/gpioctl/gpioctl.8 projects/largeSMP/usr.sbin/usbdump/usbdump.8 Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/bin/sh/cd.c ============================================================================== --- projects/largeSMP/bin/sh/cd.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/bin/sh/cd.c Thu May 26 17:38:00 2011 (r222318) @@ -86,6 +86,7 @@ cdcmd(int argc, char **argv) struct stat statb; int ch, phys, print = 0, getcwderr = 0; int rc; + int errno1 = ENOENT; optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = Pflag; @@ -138,9 +139,11 @@ cdcmd(int argc, char **argv) rc = docd(p, print, phys); if (rc >= 0) return getcwderr ? rc : 0; + if (errno != ENOENT) + errno1 = errno; } } - error("can't cd to %s", dest); + error("%s: %s", dest, strerror(errno1)); /*NOTREACHED*/ return 0; } Modified: projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/cddl/compat/opensolaris/misc/fsshare.c Thu May 26 17:38:00 2011 (r222318) @@ -223,6 +223,7 @@ out: error = errno; unlink(tmpfile); } else { + fflush(newfd); /* * Send SIGHUP to mountd, but unlock exports file later. */ Modified: projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3 ============================================================================== --- projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/contrib/openbsm/libbsm/audit_submit.3 Thu May 26 17:38:00 2011 (r222318) @@ -30,7 +30,7 @@ .\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#17 $ .\" .Dd January 18, 2008 -.Dt audit_submit 3 +.Dt AUDIT_SUBMIT 3 .Os .Sh NAME .Nm audit_submit Modified: projects/largeSMP/gnu/usr.bin/Makefile ============================================================================== --- projects/largeSMP/gnu/usr.bin/Makefile Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/gnu/usr.bin/Makefile Thu May 26 17:38:00 2011 (r222318) @@ -27,9 +27,7 @@ _groff= groff .endif .endif -.if ${MK_BSD_GREP} != "yes" _grep= grep -.endif .if ${MK_CVS} != "no" _cvs= cvs Modified: projects/largeSMP/gnu/usr.bin/grep/Makefile ============================================================================== --- projects/largeSMP/gnu/usr.bin/grep/Makefile Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/gnu/usr.bin/grep/Makefile Thu May 26 17:38:00 2011 (r222318) @@ -1,35 +1,50 @@ # $FreeBSD$ +.include + GREP_LIBZ=YES +.if ${MK_BSD_GREP} != "yes" PROG= grep +.else +PROG= gnugrep +.endif SRCS= closeout.c dfa.c error.c exclude.c grep.c grepmat.c hard-locale.c \ isdir.c kwset.c obstack.c quotearg.c savedir.c search.c xmalloc.c \ xstrtoumax.c CFLAGS+=-I${.CURDIR} -I${DESTDIR}/usr/include/gnu -DHAVE_CONFIG_H +.if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/fgrep MLINKS= grep.1 egrep.1 grep.1 fgrep.1 +.endif DPADD= ${LIBGNUREGEX} ${LIBBZ2} LDADD= -lgnuregex -lbz2 +.if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ ${BINDIR}/grep ${BINDIR}/bzegrep \ ${BINDIR}/grep ${BINDIR}/bzfgrep MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1 +.endif .if defined(GREP_LIBZ) && !empty(GREP_LIBZ) LDADD+= -lz DPADD+= ${LIBZ} CFLAGS+=-DHAVE_LIBZ=1 +.if ${MK_BSD_GREP} != "yes" LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \ ${BINDIR}/grep ${BINDIR}/zegrep \ ${BINDIR}/grep ${BINDIR}/zfgrep MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1 .endif +.endif + +gnugrep.1: grep.1 + cp ${.ALLSRC} ${.TARGET} SUBDIR+=doc Modified: projects/largeSMP/lib/libc/gen/feature_present.3 ============================================================================== --- projects/largeSMP/lib/libc/gen/feature_present.3 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/lib/libc/gen/feature_present.3 Thu May 26 17:38:00 2011 (r222318) @@ -29,7 +29,7 @@ .\" $FreeBSD$ .\" .Dd January 8, 2008 -.Dt feature_present 3 +.Dt FEATURE_PRESENT 3 .Os .Sh NAME .Nm feature_present Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c ============================================================================== --- projects/largeSMP/sbin/geom/class/part/geom_part.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sbin/geom/class/part/geom_part.c Thu May 26 17:38:00 2011 (r222318) @@ -295,8 +295,8 @@ fmtattrib(struct gprovider *pp) return (buf); } -#define ALIGNDOWN(d, a) (-(a) & (d)) -#define ALIGNUP(d, a) (-(-(a) & -(d))) +#define ALIGNDOWN(d, a) ((d) - (d) % (a)) +#define ALIGNUP(d, a) ((d) % (a) ? (d) - (d) % (a) + (a): (d)) static int gpart_autofill_resize(struct gctl_req *req) Modified: projects/largeSMP/share/man/man4/atrtc.4 ============================================================================== --- projects/largeSMP/share/man/man4/atrtc.4 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man4/atrtc.4 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd September 17, 2010 -.Dt atrtc 4 +.Dt ATRTC 4 .Os .Sh NAME .Nm atrtc Modified: projects/largeSMP/share/man/man4/attimer.4 ============================================================================== --- projects/largeSMP/share/man/man4/attimer.4 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man4/attimer.4 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd September 14, 2010 -.Dt attimer 4 +.Dt ATTIMER 4 .Os .Sh NAME .Nm attimer Modified: projects/largeSMP/share/man/man4/cc.4 ============================================================================== --- projects/largeSMP/share/man/man4/cc.4 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man4/cc.4 Thu May 26 17:38:00 2011 (r222318) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt cc 4 +.Dt CC 4 .Os .Sh NAME .Nm cc Modified: projects/largeSMP/share/man/man4/h_ertt.4 ============================================================================== --- projects/largeSMP/share/man/man4/h_ertt.4 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man4/h_ertt.4 Thu May 26 17:38:00 2011 (r222318) @@ -30,7 +30,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt h_ertt 9 +.Dt H_ERTT 9 .Os .Sh NAME .Nm h_ertt Modified: projects/largeSMP/share/man/man4/nvram2env.4 ============================================================================== --- projects/largeSMP/share/man/man4/nvram2env.4 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man4/nvram2env.4 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 3, 2011 -.Dt nvram2env 4 +.Dt NVRAM2ENV 4 .Os .Sh NAME .Nm nvram2env Modified: projects/largeSMP/share/man/man7/eventtimers.7 ============================================================================== --- projects/largeSMP/share/man/man7/eventtimers.7 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man7/eventtimers.7 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd September 15, 2010 -.Dt eventtimers 4 +.Dt EVENTTIMERS 4 .Os .Sh NAME .Nm eventtimers Modified: projects/largeSMP/share/man/man7/ports.7 ============================================================================== --- projects/largeSMP/share/man/man7/ports.7 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man7/ports.7 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2009 +.Dd May 25, 2011 .Dt PORTS 7 .Os .Sh NAME @@ -124,6 +124,8 @@ and .It Cm checksum Verify that the fetched distfile's checksum matches the one the port was tested against. +If the distfile's checksum does not match, it also fetches the distfiles +which are missing or failed the checksum calculation. Defining .Va NO_CHECKSUM will skip this step. Modified: projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man9/devfs_set_cdevpriv.9 Thu May 26 17:38:00 2011 (r222318) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd September 8, 2008 -.Dt DEVFS_CDEVPRIV +.Dt DEVFS_CDEVPRIV 9 .Os .Sh NAME .Nm devfs_set_cdevpriv , Modified: projects/largeSMP/share/man/man9/hhook.9 ============================================================================== --- projects/largeSMP/share/man/man9/hhook.9 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man9/hhook.9 Thu May 26 17:38:00 2011 (r222318) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt hhook 9 +.Dt HHOOK 9 .Os .Sh NAME .Nm hhook , Modified: projects/largeSMP/share/man/man9/khelp.9 ============================================================================== --- projects/largeSMP/share/man/man9/khelp.9 Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/man/man9/khelp.9 Thu May 26 17:38:00 2011 (r222318) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt khelp 9 +.Dt KHELP 9 .Os .Sh NAME .Nm khelp , Modified: projects/largeSMP/share/misc/committers-src.dot ============================================================================== --- projects/largeSMP/share/misc/committers-src.dot Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/share/misc/committers-src.dot Thu May 26 17:38:00 2011 (r222318) @@ -206,6 +206,7 @@ ps [label="Paul Saab\nps@FreeBSD.org\n20 qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2007/01/31"] randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"] +ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] @@ -268,6 +269,8 @@ day1 -> rgrimes day1 -> alm day1 -> dg +adrian -> ray + andre -> qingli anholt -> jkim Modified: projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Thu May 26 17:38:00 2011 (r222318) @@ -147,9 +147,7 @@ taskq_run_safe(void *arg, int pending __ { struct ostask *task = arg; - ASSERT(task->ost_magic == TASKQ_MAGIC); task->ost_func(task->ost_arg); - task->ost_magic = 0; } taskqid_t @@ -158,15 +156,12 @@ taskq_dispatch_safe(taskq_t *tq, task_fu { int prio; - ASSERT(task->ost_magic != TASKQ_MAGIC); - /* * If TQ_FRONT is given, we want higher priority for this task, so it * can go at the front of the queue. */ prio = !!(flags & TQ_FRONT); - task->ost_magic = TASKQ_MAGIC; task->ost_func = func; task->ost_arg = arg; Modified: projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h ============================================================================== --- projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/cddl/compat/opensolaris/sys/taskq.h Thu May 26 17:38:00 2011 (r222318) @@ -35,7 +35,6 @@ struct ostask { struct task ost_task; task_func_t *ost_func; void *ost_arg; - int ost_magic; }; taskqid_t taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg, Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu May 26 17:38:00 2011 (r222318) @@ -421,8 +421,7 @@ struct zio { #ifdef _KERNEL /* FreeBSD only. */ - struct ostask io_task_issue; - struct ostask io_task_interrupt; + struct ostask io_task; #endif }; Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Thu May 26 17:38:00 2011 (r222318) @@ -239,15 +239,20 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn return (ENOENT); } if (dl == NULL) { + size_t namesize; + /* * Allocate a new dirlock and add it to the list. */ - dl = kmem_alloc(sizeof (zfs_dirlock_t), KM_SLEEP); + namesize = strlen(name) + 1; + dl = kmem_alloc(sizeof (zfs_dirlock_t) + namesize, + KM_SLEEP); cv_init(&dl->dl_cv, NULL, CV_DEFAULT, NULL); - dl->dl_name = name; + dl->dl_name = (char *)(dl + 1); + bcopy(name, dl->dl_name, namesize); dl->dl_sharecnt = 0; dl->dl_namelock = 0; - dl->dl_namesize = 0; + dl->dl_namesize = namesize; dl->dl_dzp = dzp; dl->dl_next = dzp->z_dirlocks; dzp->z_dirlocks = dl; @@ -264,20 +269,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn if (flag & ZHAVELOCK) dl->dl_namelock = 1; - if ((flag & ZSHARED) && ++dl->dl_sharecnt > 1 && dl->dl_namesize == 0) { - /* - * We're the second shared reference to dl. Make a copy of - * dl_name in case the first thread goes away before we do. - * Note that we initialize the new name before storing its - * pointer into dl_name, because the first thread may load - * dl->dl_name at any time. He'll either see the old value, - * which is his, or the new shared copy; either is OK. - */ - dl->dl_namesize = strlen(dl->dl_name) + 1; - name = kmem_alloc(dl->dl_namesize, KM_SLEEP); - bcopy(dl->dl_name, name, dl->dl_namesize); - dl->dl_name = name; - } + if (flag & ZSHARED) + dl->dl_sharecnt++; mutex_exit(&dzp->z_lock); @@ -361,10 +354,8 @@ zfs_dirent_unlock(zfs_dirlock_t *dl) cv_broadcast(&dl->dl_cv); mutex_exit(&dzp->z_lock); - if (dl->dl_namesize != 0) - kmem_free(dl->dl_name, dl->dl_namesize); cv_destroy(&dl->dl_cv); - kmem_free(dl, sizeof (*dl)); + kmem_free(dl, sizeof (*dl) + dl->dl_namesize); } /* Modified: projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu May 26 17:38:00 2011 (r222318) @@ -1068,19 +1068,9 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ spa_t *spa = zio->io_spa; zio_type_t t = zio->io_type; int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0); -#ifdef _KERNEL - struct ostask *task; -#endif ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); -#ifdef _KERNEL - if (q == ZIO_TASKQ_ISSUE) - task = &zio->io_task_issue; - else /* if (q == ZIO_TASKQ_INTERRUPT) */ - task = &zio->io_task_interrupt; -#endif - /* * If we're a config writer or a probe, the normal issue and * interrupt threads may all be blocked waiting for the config lock. @@ -1105,7 +1095,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ ASSERT3U(q, <, ZIO_TASKQ_TYPES); #ifdef _KERNEL (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], - (task_func_t *)zio_execute, zio, flags, task); + (task_func_t *)zio_execute, zio, flags, &zio->io_task); #else (void) taskq_dispatch(spa->spa_zio_taskq[t][q], (task_func_t *)zio_execute, zio, flags); @@ -2904,7 +2894,7 @@ zio_done(zio_t *zio) (void) taskq_dispatch_safe( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], (task_func_t *)zio_reexecute, zio, TQ_SLEEP, - &zio->io_task_issue); + &zio->io_task); #else (void) taskq_dispatch( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], Modified: projects/largeSMP/sys/conf/kern.mk ============================================================================== --- projects/largeSMP/sys/conf/kern.mk Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/conf/kern.mk Thu May 26 17:38:00 2011 (r222318) @@ -1,15 +1,12 @@ # $FreeBSD$ # -# Warning flags for compiling the kernel and components of the kernel. +# Warning flags for compiling the kernel and components of the kernel: # -# Note that the newly added -Wcast-qual is responsible for generating -# most of the remaining warnings. Warnings introduced with -Wall will -# also pop up, but are easier to fix. CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ -Wundef -Wno-pointer-sign -fformat-extensions \ - -Wmissing-include-dirs + -Wmissing-include-dirs -fdiagnostics-show-option # # The following flags are next up for working on: # -Wextra Modified: projects/largeSMP/sys/dev/ahci/ahci.c ============================================================================== --- projects/largeSMP/sys/dev/ahci/ahci.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ahci/ahci.c Thu May 26 17:38:00 2011 (r222318) @@ -119,6 +119,7 @@ static struct { #define AHCI_Q_NOBSYRES 256 #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 +#define AHCI_Q_ALTSIG 2048 } ahci_ids[] = { {0x43801002, 0x00, "ATI IXP600", 0}, {0x43901002, 0x00, "ATI IXP700", 0}, @@ -192,8 +193,9 @@ static struct { {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES}, - {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES}, + {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, + {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, @@ -398,6 +400,13 @@ ahci_attach(device_t dev) if (ctlr->caps & AHCI_CAP_EMS) ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL); ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI); + + /* Identify and set separate quirks for HBA and RAID f/w Marvells. */ + if ((ctlr->quirks & AHCI_Q_NOBSYRES) && + (ctlr->quirks & AHCI_Q_ALTSIG) && + (ctlr->caps & AHCI_CAP_SPM) == 0) + ctlr->quirks &= ~AHCI_Q_NOBSYRES; + if (ctlr->quirks & AHCI_Q_1CH) { ctlr->caps &= ~AHCI_CAP_NPMASK; ctlr->ichannels &= 0x01; @@ -1764,7 +1773,7 @@ ahci_execute_transaction(struct ahci_slo struct ahci_cmd_list *clp; union ccb *ccb = slot->ccb; int port = ccb->ccb_h.target_id & 0x0f; - int fis_size, i; + int fis_size, i, softreset; uint8_t *fis = ch->dma.rfis + 0x40; uint8_t val; @@ -1791,17 +1800,20 @@ ahci_execute_transaction(struct ahci_slo if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { if (ccb->ataio.cmd.control & ATA_A_RESET) { + softreset = 1; /* Kick controller into sane state */ ahci_stop(dev); ahci_clo(dev); ahci_start(dev, 0); clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; } else { + softreset = 2; /* Prepare FIS receive area for check. */ for (i = 0; i < 20; i++) fis[i] = 0xff; } - } + } else + softreset = 0; clp->bytecount = 0; clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); @@ -1825,8 +1837,7 @@ ahci_execute_transaction(struct ahci_slo ATA_OUTL(ch->r_mem, AHCI_P_CI, (1 << slot->slot)); /* Device reset commands doesn't interrupt. Poll them. */ if (ccb->ccb_h.func_code == XPT_ATA_IO && - (ccb->ataio.cmd.command == ATA_DEVICE_RESET || - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL))) { + (ccb->ataio.cmd.command == ATA_DEVICE_RESET || softreset)) { int count, timeout = ccb->ccb_h.timeout * 100; enum ahci_err_type et = AHCI_ERR_NONE; @@ -1834,10 +1845,13 @@ ahci_execute_transaction(struct ahci_slo DELAY(10); if (!(ATA_INL(ch->r_mem, AHCI_P_CI) & (1 << slot->slot))) break; - if (ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) { + if ((ATA_INL(ch->r_mem, AHCI_P_TFD) & ATA_S_ERROR) && + softreset != 1) { +#if 0 device_printf(ch->dev, "Poll error on slot %d, TFD: %04x\n", slot->slot, ATA_INL(ch->r_mem, AHCI_P_TFD)); +#endif et = AHCI_ERR_TFE; break; } @@ -1849,9 +1863,20 @@ ahci_execute_transaction(struct ahci_slo break; } } + + /* Marvell controllers do not wait for readyness. */ + if ((ch->quirks & AHCI_Q_NOBSYRES) && softreset == 2 && + et == AHCI_ERR_NONE) { + while ((val = fis[2]) & ATA_S_BUSY) { + DELAY(10); + if (count++ >= timeout) + break; + } + } + if (timeout && (count >= timeout)) { - device_printf(ch->dev, - "Poll timeout on slot %d\n", slot->slot); + device_printf(dev, "Poll timeout on slot %d port %d\n", + slot->slot, port); device_printf(dev, "is %08x cs %08x ss %08x " "rs %08x tfd %02x serr %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), @@ -1861,30 +1886,11 @@ ahci_execute_transaction(struct ahci_slo ATA_INL(ch->r_mem, AHCI_P_SERR)); et = AHCI_ERR_TIMEOUT; } - /* Marvell controllers do not wait for readyness. */ - if ((ch->quirks & AHCI_Q_NOBSYRES) && - (ccb->ccb_h.func_code == XPT_ATA_IO) && - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && - (ccb->ataio.cmd.control & ATA_A_RESET) == 0) { - while ((val = fis[2]) & (ATA_S_BUSY | ATA_S_DRQ)) { - DELAY(10); - if (count++ >= timeout) { - device_printf(dev, "device is not " - "ready after soft-reset: " - "tfd = %08x\n", val); - et = AHCI_ERR_TIMEOUT; - break; - } - } - } - ahci_end_transaction(slot, et); + /* Kick controller into sane state and enable FBS. */ - if ((ccb->ccb_h.func_code == XPT_ATA_IO) && - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && - (ccb->ataio.cmd.control & ATA_A_RESET) == 0) { - ahci_stop(ch->dev); - ahci_start(ch->dev, 1); - } + if (softreset == 2) + ch->eslots |= (1 << slot->slot); + ahci_end_transaction(slot, et); return; } /* Start command execution timeout */ @@ -1962,7 +1968,8 @@ ahci_timeout(struct ahci_slot *slot) return; } - device_printf(dev, "Timeout on slot %d\n", slot->slot); + device_printf(dev, "Timeout on slot %d port %d\n", + slot->slot, slot->ccb->ccb_h.target_id & 0x0f); device_printf(dev, "is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n", ATA_INL(ch->r_mem, AHCI_P_IS), ATA_INL(ch->r_mem, AHCI_P_CI), ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, @@ -2013,6 +2020,7 @@ ahci_end_transaction(struct ahci_slot *s union ccb *ccb = slot->ccb; struct ahci_cmd_list *clp; int lastto; + uint32_t sig; bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -2050,6 +2058,20 @@ ahci_end_transaction(struct ahci_slot *s res->lba_high_exp = fis[10]; res->sector_count = fis[12]; res->sector_count_exp = fis[13]; + + /* + * Some weird controllers do not return signature in + * FIS receive area. Read it from PxSIG register. + */ + if ((ch->quirks & AHCI_Q_ALTSIG) && + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET) == 0) { + sig = ATA_INL(ch->r_mem, AHCI_P_SIG); + res->lba_high = sig >> 24; + res->lba_mid = sig >> 16; + res->lba_low = sig >> 8; + res->sector_count = sig; + } } else bzero(res, sizeof(*res)); if ((ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) == 0 && @@ -2169,13 +2191,6 @@ ahci_end_transaction(struct ahci_slot *s ch->numhslots++; } else xpt_done(ccb); - /* Unfreeze frozen command. */ - if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) { - union ccb *fccb = ch->frozen; - ch->frozen = NULL; - ahci_begin_transaction(dev, fccb); - xpt_release_simq(ch->sim, TRUE); - } /* If we have no other active commands, ... */ if (ch->rslots == 0) { /* if there was fatal error - reset port. */ @@ -2185,6 +2200,7 @@ ahci_end_transaction(struct ahci_slot *s /* if we have slots in error, we can reinit port. */ if (ch->eslots != 0) { ahci_stop(dev); + ahci_clo(dev); ahci_start(dev, 1); } /* if there commands on hold, we can do READ LOG. */ @@ -2195,6 +2211,13 @@ ahci_end_transaction(struct ahci_slot *s } else if ((ch->rslots & ~ch->toslots) == 0 && et != AHCI_ERR_TIMEOUT) ahci_rearm_timeout(dev); + /* Unfreeze frozen command. */ + if (ch->frozen && !ahci_check_collision(dev, ch->frozen)) { + union ccb *fccb = ch->frozen; + ch->frozen = NULL; + ahci_begin_transaction(dev, fccb); + xpt_release_simq(ch->sim, TRUE); + } /* Start PM timer. */ if (ch->numrslots == 0 && ch->pm_level > 3 && (ch->curr[ch->pm_present ? 15 : 0].caps & CTS_SATA_CAPS_D_PMREQ)) { Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah.c Thu May 26 17:38:00 2011 (r222318) @@ -117,6 +117,8 @@ ath_hal_mac_name(struct ath_hal *ah) return "9280"; case AR_XSREV_VERSION_KITE: return "9285"; + case AR_XSREV_VERSION_KIWI: + return "9287"; } return "????"; } Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah.h ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah.h Thu May 26 17:38:00 2011 (r222318) @@ -669,6 +669,41 @@ typedef struct { } HAL_CHANNEL_SURVEY; /* + * ANI commands. + * + * These are used both internally and externally via the diagnostic + * API. + * + * Note that this is NOT the ANI commands being used via the INTMIT + * capability - that has a different mapping for some reason. + */ +typedef enum { + HAL_ANI_PRESENT = 0, /* is ANI support present */ + HAL_ANI_NOISE_IMMUNITY_LEVEL = 1, /* set level */ + HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 2, /* enable/disable */ + HAL_ANI_CCK_WEAK_SIGNAL_THR = 3, /* enable/disable */ + HAL_ANI_FIRSTEP_LEVEL = 4, /* set level */ + HAL_ANI_SPUR_IMMUNITY_LEVEL = 5, /* set level */ + HAL_ANI_MODE = 6, /* 0 => manual, 1 => auto (XXX do not change) */ + HAL_ANI_PHYERR_RESET = 7, /* reset phy error stats */ +} HAL_ANI_CMD; + +/* + * This is the layout of the ANI INTMIT capability. + * + * Notice that the command values differ to HAL_ANI_CMD. + */ +typedef enum { + HAL_CAP_INTMIT_PRESENT = 0, + HAL_CAP_INTMIT_ENABLE = 1, + HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL = 2, + HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL = 3, + HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR = 4, + HAL_CAP_INTMIT_FIRSTEP_LEVEL = 5, + HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL = 6 +} HAL_CAP_INTMIT_CMD; + +/* * Hardware Access Layer (HAL) API. * * Clients of the HAL call ath_hal_attach to obtain a reference to an Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah_devid.h Thu May 26 17:38:00 2011 (r222318) @@ -80,6 +80,8 @@ #define AR9280_DEVID_PCIE 0x002a /* AR9280 PCI-E Merlin */ #define AR9285_DEVID_PCIE 0x002b /* AR9285 PCI-E Kite */ #define AR2427_DEVID_PCIE 0x002c /* AR2427 PCI-E w/ 802.11n bonded out */ +#define AR9287_DEVID_PCI 0x002d /* AR9227 PCI Kiwi */ +#define AR9287_DEVID_PCIE 0x002e /* AR9287 PCI-E Kiwi */ #define AR_SUBVENDOR_ID_NOG 0x0e11 /* No 11G subvendor ID */ #define AR_SUBVENDOR_ID_NEW_A 0x7065 /* Update device to new RD */ Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom.h Thu May 26 17:38:00 2011 (r222318) @@ -101,7 +101,9 @@ enum { AR_EEP_ANTGAINMAX_2, /* int8_t* */ AR_EEP_WRITEPROTECT, /* use ath_hal_eepromGetFlag */ AR_EEP_PWR_TABLE_OFFSET,/* int8_t* */ - AR_EEP_PWDCLKIND /* uint8_t* */ + AR_EEP_PWDCLKIND, /* uint8_t* */ + AR_EEP_TEMPSENSE_SLOPE, /* int8_t* */ + AR_EEP_TEMPSENSE_SLOPE_PAL_ON, /* int8_t* */ }; typedef struct { Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah_eeprom_9287.c Thu May 26 17:38:00 2011 (r222318) @@ -63,28 +63,10 @@ v9287EepromGet(struct ath_hal *ah, int p return pBase->opCapFlags; case AR_EEP_RFSILENT: return pBase->rfSilent; -#if 0 - case AR_EEP_OB_5: - return pModal[CHAN_A_IDX].ob; - case AR_EEP_DB_5: - return pModal[CHAN_A_IDX].db; - case AR_EEP_OB_2: - return pModal[CHAN_B_IDX].ob; - case AR_EEP_DB_2: - return pModal[CHAN_B_IDX].db; -#endif case AR_EEP_TXMASK: return pBase->txMask; case AR_EEP_RXMASK: return pBase->rxMask; -#if 0 - case AR_EEP_RXGAIN_TYPE: - return IS_VERS(>=, AR5416_EEP_MINOR_VER_17) ? - pBase->rxGainType : AR5416_EEP_RXGAIN_ORIG; - case AR_EEP_TXGAIN_TYPE: - return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? - pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; -#endif case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; @@ -117,6 +99,18 @@ v9287EepromGet(struct ath_hal *ah, int p case AR_EEP_PWR_TABLE_OFFSET: *(int8_t *) val = pBase->pwrTableOffset; return HAL_OK; + case AR_EEP_TEMPSENSE_SLOPE: + if (IS_VERS(>=, AR9287_EEP_MINOR_VER_2)) + *(int8_t *)val = pBase->tempSensSlope; + else + *(int8_t *)val = 0; + return HAL_OK; + case AR_EEP_TEMPSENSE_SLOPE_PAL_ON: + if (IS_VERS(>=, AR9287_EEP_MINOR_VER_3)) + *(int8_t *)val = pBase->tempSensSlopePalOn; + else + *(int8_t *)val = 0; + return HAL_OK; default: HALASSERT(0); return HAL_EINVAL; @@ -132,14 +126,12 @@ v9287EepromSet(struct ath_hal *ah, int p HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; switch (param) { - case AR_EEP_ANTGAINMAX_2: - ee->ee_antennaGainMax[1] = (int8_t) v; - return HAL_OK; - case AR_EEP_ANTGAINMAX_5: - ee->ee_antennaGainMax[0] = (int8_t) v; - return HAL_OK; + case AR_EEP_ANTGAINMAX_2: + ee->ee_antennaGainMax[1] = (int8_t) v; + return HAL_OK; + default: + return HAL_EINVAL; } - return HAL_EINVAL; } static HAL_BOOL Modified: projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ah_internal.h Thu May 26 17:38:00 2011 (r222318) @@ -418,18 +418,6 @@ extern HAL_BOOL ath_hal_setTxQProps(stru extern HAL_BOOL ath_hal_getTxQProps(struct ath_hal *ah, HAL_TXQ_INFO *qInfo, const HAL_TX_QUEUE_INFO *qi); -typedef enum { - HAL_ANI_PRESENT = 0x1, /* is ANI support present */ - HAL_ANI_NOISE_IMMUNITY_LEVEL = 0x2, /* set level */ - HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION = 0x4, /* enable/disable */ - HAL_ANI_CCK_WEAK_SIGNAL_THR = 0x8, /* enable/disable */ - HAL_ANI_FIRSTEP_LEVEL = 0x10, /* set level */ - HAL_ANI_SPUR_IMMUNITY_LEVEL = 0x20, /* set level */ - HAL_ANI_MODE = 0x40, /* 0 => manual, 1 => auto (XXX do not change) */ - HAL_ANI_PHYERR_RESET =0x80, /* reset phy error stats */ - HAL_ANI_ALL = 0xff -} HAL_ANI_CMD; - #define HAL_SPUR_VAL_MASK 0x3FFF #define HAL_SPUR_CHAN_WIDTH 87 #define HAL_BIN_WIDTH_BASE_100HZ 3125 Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu May 26 17:38:00 2011 (r222318) @@ -320,6 +320,9 @@ struct ath_hal_5212 { struct ar5212AniState *ah_curani; /* cached last reference */ struct ar5212AniState ah_ani[AH_MAXCHAN]; /* per-channel state */ + /* AR5416 uses some of the AR5212 ANI code; these are the ANI methods */ + HAL_BOOL (*ah_aniControl) (struct ath_hal *, HAL_ANI_CMD cmd, int param); + /* * Transmit power state. Note these are maintained * here so they can be retrieved by diagnostic tools. Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu May 26 17:38:00 2011 (r222318) @@ -203,6 +203,9 @@ ar5212AniSetup(struct ath_hal *ah) ar5212AniAttach(ah, &tmp, &tmp, AH_TRUE); } else ar5212AniAttach(ah, &aniparams, &aniparams, AH_TRUE); + + /* Set overridable ANI methods */ + AH5212(ah)->ah_aniControl = ar5212AniControl; } /* Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Thu May 26 17:38:00 2011 (r222318) @@ -880,16 +880,16 @@ ar5212GetCapability(struct ath_hal *ah, return HAL_OK; case HAL_CAP_INTMIT: /* interference mitigation */ switch (capability) { - case 0: /* hardware capability */ + case HAL_CAP_INTMIT_PRESENT: /* hardware capability */ return HAL_OK; - case 1: + case HAL_CAP_INTMIT_ENABLE: return (ahp->ah_procPhyErr & HAL_ANI_ENA) ? HAL_OK : HAL_ENXIO; - case 2: /* HAL_ANI_NOISE_IMMUNITY_LEVEL */ - case 3: /* HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION */ - case 4: /* HAL_ANI_CCK_WEAK_SIGNAL_THR */ - case 5: /* HAL_ANI_FIRSTEP_LEVEL */ - case 6: /* HAL_ANI_SPUR_IMMUNITY_LEVEL */ + case HAL_CAP_INTMIT_NOISE_IMMUNITY_LEVEL: + case HAL_CAP_INTMIT_OFDM_WEAK_SIGNAL_LEVEL: + case HAL_CAP_INTMIT_CCK_WEAK_SIGNAL_THR: + case HAL_CAP_INTMIT_FIRSTEP_LEVEL: + case HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL: ani = ar5212AniGetCurrentState(ah); if (ani == AH_NULL) return HAL_ENXIO; @@ -980,6 +980,8 @@ ar5212SetCapability(struct ath_hal *ah, OS_REG_WRITE(ah, AR_TPC, ahp->ah_macTPC); return AH_TRUE; case HAL_CAP_INTMIT: { /* interference mitigation */ + /* This maps the public ANI commands to the internal ANI commands */ + /* Private: HAL_ANI_CMD; Public: HAL_CAP_INTMIT_CMD */ static const HAL_ANI_CMD cmds[] = { HAL_ANI_PRESENT, HAL_ANI_MODE, @@ -990,7 +992,7 @@ ar5212SetCapability(struct ath_hal *ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, }; return capability < N(cmds) ? - ar5212AniControl(ah, cmds[capability], setting) : + AH5212(ah)->ah_aniControl(ah, cmds[capability], setting) : AH_FALSE; } case HAL_CAP_TSF_ADJUST: /* hardware has beacon tsf adjust */ @@ -1053,7 +1055,7 @@ ar5212GetDiagState(struct ath_hal *ah, i case HAL_DIAG_ANI_CMD: if (argsize != 2*sizeof(uint32_t)) return AH_FALSE; - ar5212AniControl(ah, ((const uint32_t *)args)[0], + AH5212(ah)->ah_aniControl(ah, ((const uint32_t *)args)[0], ((const uint32_t *)args)[1]); return AH_TRUE; case HAL_DIAG_ANI_PARAMS: Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu May 26 17:38:00 2011 (r222318) @@ -175,9 +175,17 @@ ar5416AniControl(struct ath_hal *ah, HAL struct ar5212AniState *aniState = ahp->ah_curani; const struct ar5212AniParams *params = aniState->params; + /* Check whether the particular function is enabled */ + if (((1 << cmd) & AH5416(ah)->ah_ani_function) == 0) { + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: command %d disabled\n", + __func__, cmd); + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd %d; mask %x\n", __func__, cmd, AH5416(ah)->ah_ani_function); + return AH_FALSE; + } + OS_MARK(ah, AH_MARK_ANI_CONTROL, cmd); - switch (cmd & AH5416(ah)->ah_ani_function) { + switch (cmd) { case HAL_ANI_NOISE_IMMUNITY_LEVEL: { u_int level = param; @@ -356,14 +364,14 @@ ar5416AniOfdmErrTrigger(struct ath_hal * aniState = ahp->ah_curani; params = aniState->params; /* First, raise noise immunity level, up to max */ - if ((AH5416(ah)->ah_ani_function & HAL_ANI_NOISE_IMMUNITY_LEVEL) && + if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL)) && (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) { ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, aniState->noiseImmunityLevel + 1); return; } /* then, raise spur immunity level, up to max */ - if ((AH5416(ah)->ah_ani_function & HAL_ANI_SPUR_IMMUNITY_LEVEL) && + if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL)) && (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel)) { ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, aniState->spurImmunityLevel + 1); @@ -443,7 +451,8 @@ ar5416AniCckErrTrigger(struct ath_hal *a /* first, raise noise immunity level, up to max */ aniState = ahp->ah_curani; params = aniState->params; - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if ((AH5416(ah)->ah_ani_function & (1 << HAL_ANI_NOISE_IMMUNITY_LEVEL) && + aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel)) { ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, aniState->noiseImmunityLevel + 1); return; Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Thu May 26 17:38:00 2011 (r222318) @@ -58,7 +58,7 @@ ar5416AniSetup(struct ath_hal *ah) .period = 100, }; /* NB: disable ANI noise immmunity for reliable RIFS rx */ - AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL; + AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL); ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } @@ -199,7 +199,10 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5416(ah)->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK; /* Enable all ANI functions to begin with */ - AH5416(ah)->ah_ani_function = HAL_ANI_ALL; + AH5416(ah)->ah_ani_function = 0xffffffff; + + /* Set overridable ANI methods */ + AH5212(ah)->ah_aniControl = ar5416AniControl; } uint32_t Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu May 26 17:38:00 2011 (r222318) @@ -594,8 +594,8 @@ ar5416LoadNF(struct ath_hal *ah, const s if (AR_SREV_KITE(ah)) { /* Kite has only one chain */ chainmask = 0x9; - } else if (AR_SREV_MERLIN(ah)) { - /* Merlin has only two chains */ + } else if (AR_SREV_MERLIN(ah) || AR_SREV_KIWI(ah)) { + /* Merlin/Kiwi has only two chains */ chainmask = 0x1B; } else { chainmask = 0x3F; Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu May 26 17:02:56 2011 (r222317) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu May 26 17:38:00 2011 (r222318) @@ -167,6 +167,17 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu May 26 19:18:56 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE9D6106564A; Thu, 26 May 2011 19:18:56 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF9F08FC08; Thu, 26 May 2011 19:18:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4QJIuIb077473; Thu, 26 May 2011 19:18:56 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4QJIuYI077469; Thu, 26 May 2011 19:18:56 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201105261918.p4QJIuYI077469@svn.freebsd.org> From: Andreas Tobler Date: Thu, 26 May 2011 19:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222321 - in projects/pseries/powerpc: aim ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 19:18:56 -0000 Author: andreast Date: Thu May 26 19:18:56 2011 New Revision: 222321 URL: http://svn.freebsd.org/changeset/base/222321 Log: Increase the OFMEM_REGIONS to 128 and replace it with PHYS_AVAIL_SZ. Add dynamic memory reconfiguration readout for PAPR compatible machines. This allows us to use the full equipped physical memory instead of only the first 128MB. Move the qsort memory compare functionality from mmu_oea64.c and mmu_oea.c to ofw_machdep.c. Reviewed by: nwhitehorn (mentor) Modified: projects/pseries/powerpc/aim/mmu_oea.c projects/pseries/powerpc/aim/mmu_oea64.c projects/pseries/powerpc/ofw/ofw_machdep.c Modified: projects/pseries/powerpc/aim/mmu_oea.c ============================================================================== --- projects/pseries/powerpc/aim/mmu_oea.c Thu May 26 18:54:07 2011 (r222320) +++ projects/pseries/powerpc/aim/mmu_oea.c Thu May 26 19:18:56 2011 (r222321) @@ -584,26 +584,9 @@ moea_pte_change(struct pte *pt, struct p /* * Quick sort callout for comparing memory regions. */ -static int mr_cmp(const void *a, const void *b); static int om_cmp(const void *a, const void *b); static int -mr_cmp(const void *a, const void *b) -{ - const struct mem_region *regiona; - const struct mem_region *regionb; - - regiona = a; - regionb = b; - if (regiona->mr_start < regionb->mr_start) - return (-1); - else if (regiona->mr_start > regionb->mr_start) - return (1); - else - return (0); -} - -static int om_cmp(const void *a, const void *b) { const struct ofw_map *mapa; @@ -720,7 +703,6 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz); CTR0(KTR_PMAP, "moea_bootstrap: physical memory"); - qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp); for (i = 0; i < pregions_sz; i++) { vm_offset_t pa; vm_offset_t end; @@ -749,7 +731,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz) panic("moea_bootstrap: phys_avail too small"); - qsort(regions, regions_sz, sizeof(*regions), mr_cmp); + phys_avail_count = 0; physsz = 0; hwphyssz = 0; Modified: projects/pseries/powerpc/aim/mmu_oea64.c ============================================================================== --- projects/pseries/powerpc/aim/mmu_oea64.c Thu May 26 18:54:07 2011 (r222320) +++ projects/pseries/powerpc/aim/mmu_oea64.c Thu May 26 19:18:56 2011 (r222321) @@ -473,26 +473,9 @@ moea64_calc_wimg(vm_offset_t pa, vm_mema /* * Quick sort callout for comparing memory regions. */ -static int mr_cmp(const void *a, const void *b); static int om_cmp(const void *a, const void *b); static int -mr_cmp(const void *a, const void *b) -{ - const struct mem_region *regiona; - const struct mem_region *regionb; - - regiona = a; - regionb = b; - if (regiona->mr_start < regionb->mr_start) - return (-1); - else if (regiona->mr_start > regionb->mr_start) - return (1); - else - return (0); -} - -static int om_cmp(const void *a, const void *b) { const struct ofw_map *mapa; @@ -707,10 +690,9 @@ moea64_early_bootstrap(mmu_t mmup, vm_of mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz); CTR0(KTR_PMAP, "moea64_bootstrap: physical memory"); - qsort(pregions, pregions_sz, sizeof(*pregions), mr_cmp); if (sizeof(phys_avail)/sizeof(phys_avail[0]) < regions_sz) panic("moea64_bootstrap: phys_avail too small"); - qsort(regions, regions_sz, sizeof(*regions), mr_cmp); + phys_avail_count = 0; physsz = 0; hwphyssz = 0; Modified: projects/pseries/powerpc/ofw/ofw_machdep.c ============================================================================== --- projects/pseries/powerpc/ofw/ofw_machdep.c Thu May 26 18:54:07 2011 (r222320) +++ projects/pseries/powerpc/ofw/ofw_machdep.c Thu May 26 19:18:56 2011 (r222321) @@ -60,9 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define OFMEM_REGIONS 32 -static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3]; -static struct mem_region OFfree[OFMEM_REGIONS + 3]; +static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ]; +static struct mem_region OFfree[PHYS_AVAIL_SZ]; extern register_t ofmsr[5]; extern void *openfirmware_entry; @@ -133,11 +132,32 @@ memr_merge(struct mem_region *from, stru to->mr_size = end - to->mr_start; } +/* + * Quick sort callout for comparing memory regions. + */ +static int mr_cmp(const void *a, const void *b); + +static int +mr_cmp(const void *a, const void *b) +{ + const struct mem_region *regiona; + const struct mem_region *regionb; + + regiona = a; + regionb = b; + if (regiona->mr_start < regionb->mr_start) + return (-1); + else if (regiona->mr_start > regionb->mr_start) + return (1); + else + return (0); +} + static int parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) { cell_t address_cells, size_cells; - cell_t OFmem[4*(OFMEM_REGIONS + 1)]; + cell_t OFmem[4 * PHYS_AVAIL_SZ]; int sz, i, j; int apple_hack_mode; phandle_t phandle; @@ -174,7 +194,7 @@ parse_ofw_memory(phandle_t node, const c * Get memory. */ if ((node == -1) || (sz = OF_getprop(node, prop, - OFmem, sizeof(OFmem[0]) * 4 * OFMEM_REGIONS)) <= 0) + OFmem, sizeof(OFmem[0]) * 4 * PHYS_AVAIL_SZ)) <= 0) panic("Physical memory map not found"); i = 0; @@ -224,7 +244,7 @@ parse_ofw_memory(phandle_t node, const c #ifdef __powerpc64__ if (apple_hack_mode) { /* Add in regions above 4 GB to the available list */ - struct mem_region himem[OFMEM_REGIONS]; + struct mem_region himem[PHYS_AVAIL_SZ]; int hisz; hisz = parse_ofw_memory(node, "reg", himem); @@ -242,6 +262,81 @@ parse_ofw_memory(phandle_t node, const c return (sz); } +static int +parse_drconf_memory(int *msz, int *asz, struct mem_region *ofmem, + struct mem_region *ofavail) +{ + phandle_t phandle; + vm_offset_t base; + int i, idx, len, lasz, lmsz, res; + uint32_t lmb_size[2]; + unsigned long *dmem, flags; + + lmsz = *msz; + lasz = *asz; + + phandle = OF_finddevice("/ibm,dynamic-reconfiguration-memory"); + if (phandle == -1) + /* No drconf node, return. */ + return (0); + + res = OF_getprop(phandle, "ibm,lmb-size", lmb_size, sizeof(lmb_size)); + if (res == -1) + return (0); + + /* Parse the /ibm,dynamic-memory. + The first position gives the # of entries. The next two words + reflect the address of the memory block. The next four words are + the DRC index, reserved, list index and flags. + (see PAPR C.6.6.2 ibm,dynamic-reconfiguration-memory) + + #el Addr DRC-idx res list-idx flags + ------------------------------------------------- + | 4 | 8 | 4 | 4 | 4 | 4 |.... + ------------------------------------------------- + */ + + len = OF_getproplen(phandle, "ibm,dynamic-memory"); + if (len > 0) { + + /* We have to use a variable length array on the stack + since we have very limited stack space. + */ + cell_t arr[len/sizeof(cell_t)]; + + res = OF_getprop(phandle, "ibm,dynamic-memory", &arr, + sizeof(arr)); + if (res == -1) + return (0); + + /* Number of elements */ + idx = arr[0]; + + /* First address. */ + dmem = (void*)&arr[1]; + + for (i = 0; i < idx; i++) { + base = *dmem; + dmem += 2; + flags = *dmem; + /* Use region only if available and not reserved. */ + if ((flags & 0x8) && !(flags & 0x80)) { + ofmem[lmsz].mr_start = base; + ofmem[lmsz].mr_size = (vm_size_t)lmb_size[1]; + ofavail[lasz].mr_start = base; + ofavail[lasz].mr_size = (vm_size_t)lmb_size[1]; + lmsz++; + lasz++; + } + dmem++; + } + } + + *msz = lmsz; + *asz = lasz; + + return (1); +} /* * This is called during powerpc_init, before the system is really initialized. * It shall provide the total and the available regions of RAM. @@ -256,7 +351,7 @@ ofw_mem_regions(struct mem_region **memp phandle_t phandle; vm_offset_t maxphysaddr; int asz, msz, fsz; - int i, j; + int i, j, res; int still_merging; asz = msz = 0; @@ -273,6 +368,14 @@ ofw_mem_regions(struct mem_region **memp asz = parse_ofw_memory(phandle, "available", OFavail); asz /= sizeof(struct mem_region); + res = parse_drconf_memory(&msz, &asz, OFmem, OFavail); + if (res == 0) + /* tbd. */ + printf("no ibm machine\n"); + + qsort(OFmem, msz, sizeof(*OFmem), mr_cmp); + qsort(OFavail, asz, sizeof(*OFavail), mr_cmp); + *memp = OFmem; *memsz = msz; From owner-svn-src-projects@FreeBSD.ORG Thu May 26 23:23:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766AF1065672; Thu, 26 May 2011 23:23:25 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBB08FC1A; Thu, 26 May 2011 23:23:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4QNNPrP085178; Thu, 26 May 2011 23:23:25 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4QNNP9s085175; Thu, 26 May 2011 23:23:25 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201105262323.p4QNNP9s085175@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 26 May 2011 23:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222331 - projects/jbuild/usr.bin/jbuild/filemon X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 23:23:25 -0000 Author: obrien Date: Thu May 26 23:23:25 2011 New Revision: 222331 URL: http://svn.freebsd.org/changeset/base/222331 Log: Add Start / Stop timestamps. Obtained from: Juniper Networks Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon.h projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon.h ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon.h Thu May 26 22:29:43 2011 (r222330) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon.h Thu May 26 23:23:25 2011 (r222331) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, 2010, Juniper Networks, Inc. + * Copyright (c) 2009-2011, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,3 +28,5 @@ #define FILEMON_SET_FD _IOWR('S', 1, int) #define FILEMON_SET_PID _IOWR('S', 2, pid_t) + +#define FILEMON_VERSION 2 /* output format */ Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Thu May 26 22:29:43 2011 (r222330) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Thu May 26 23:23:25 2011 (r222331) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, 2010, Juniper Networks, Inc. + * Copyright (c) 2009-2011, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,8 +70,12 @@ filemon_pid_check(struct proc *p) static void filemon_comment(struct filemon *filemon) { + struct timeval now; int len; + /* Load timestamp before locking. Less accurate but less contention. */ + getmicrotime(&now); + /* Grab a read lock on the filemon inuse list. */ filemon_lock_read(); @@ -79,7 +83,9 @@ filemon_comment(struct filemon *filemon) filemon_filemon_lock(filemon); len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), - "# buildmon version 2\n# Target pid %d\nV 2\n", curproc->p_pid); + "# buildmon version %d\n# Target pid %d\n# Start %ju.%06ju\nV %d\n", + FILEMON_VERSION, curproc->p_pid, (uintmax_t)now.tv_sec, + (uintmax_t)now.tv_usec, FILEMON_VERSION); filemon_output(filemon, filemon->msgbufr, len); @@ -479,9 +485,13 @@ filemon_wrapper_freebsd32_stat(struct th static void filemon_wrapper_sys_exit(struct thread *td, struct sys_exit_args *uap) { + struct timeval now; size_t len; struct filemon *filemon; + /* Get timestamp before locking. */ + getmicrotime(&now); + /* Grab a read lock on the filemon inuse list. */ filemon_lock_read(); @@ -496,7 +506,10 @@ filemon_wrapper_sys_exit(struct thread * /* Check if the monitored process is about to exit. */ if (filemon->pid == curproc->p_pid) { - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "# Bye bye\n"); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), + "# Stop %ju.%06ju\n# Bye bye\n", + (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); filemon_output(filemon, filemon->msgbufr, len); } From owner-svn-src-projects@FreeBSD.ORG Thu May 26 23:27:39 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D16F6106564A; Thu, 26 May 2011 23:27:39 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF39B8FC08; Thu, 26 May 2011 23:27:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4QNRdBi085338; Thu, 26 May 2011 23:27:39 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4QNRdDL085335; Thu, 26 May 2011 23:27:39 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201105262327.p4QNRdDL085335@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 26 May 2011 23:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222332 - projects/jbuild/usr.bin/jbuild/filemon/test X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 23:27:39 -0000 Author: obrien Date: Thu May 26 23:27:39 2011 New Revision: 222332 URL: http://svn.freebsd.org/changeset/base/222332 Log: Add a small testsuite. Obtained from: Juniper Networks Added: projects/jbuild/usr.bin/jbuild/filemon/test/ projects/jbuild/usr.bin/jbuild/filemon/test/Makefile (contents, props changed) projects/jbuild/usr.bin/jbuild/filemon/test/filemontest.c (contents, props changed) projects/jbuild/usr.bin/jbuild/filemon/test/test_script.sh (contents, props changed) Added: projects/jbuild/usr.bin/jbuild/filemon/test/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/jbuild/usr.bin/jbuild/filemon/test/Makefile Thu May 26 23:27:39 2011 (r222332) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +PROG= filemontest + +NO_MAN= + +WARNS?= 6 +CFLAGS= -Werror +CFLAGS+= -I${.CURDIR}/.. + +test: ${PROG} + @cd ${.CURDIR} ; ${MAKE} clean-test + cd ${.CURDIR} ; \ + for A in 1 2 3 4 5 6 7 8 9 0; do \ + for B in 1 2 3 4 5 6 7 8 9 0; do \ + for C in 1 2 3 4 5 6 7 8 9 0; do \ + ${.OBJDIR}/${PROG} ;\ + done ;\ + done ;\ + done + @cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \ + grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp format OK" + +clean-test: + cd ${.CURDIR} ; rm -f filemon_log.* + +.include Added: projects/jbuild/usr.bin/jbuild/filemon/test/filemontest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/jbuild/usr.bin/jbuild/filemon/test/filemontest.c Thu May 26 23:27:39 2011 (r222332) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2009-2011, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "filemon.h" + +/* + * This simple test of filemon expects a test script called + * "test_script" in the cwd. + */ + +int main(void) { + char log_name[] = "filemon_log.XXXXXX"; + pid_t child; + int fm_fd, fm_log; + + if ((fm_fd = open("/dev/filemon", O_RDWR)) == -1) + err(1, "open(\"/dev/filemon\", O_RDWR)"); + if ((fm_log = mkstemp(log_name)) == -1) + err(1, "mkstemp(log_name)"); + + if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0) + err(1, "Cannot set filemon log file descriptor"); + + /* Set up these two fd's to close on exec */ + (void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC); + (void)fcntl(fm_log, F_SETFD, FD_CLOEXEC); + + if ((child = fork()) == 0) { + system("./test_script.sh"); + return 0; + } else { + if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0) + err(1, "Cannot set filemon PID"); + wait(&child); + close(fm_fd); +// printf("Results in %s\n", log_name); + } + return 0; +} Added: projects/jbuild/usr.bin/jbuild/filemon/test/test_script.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/jbuild/usr.bin/jbuild/filemon/test/test_script.sh Thu May 26 23:27:39 2011 (r222332) @@ -0,0 +1,36 @@ +#! /bin/sh +# +# Copyright (c) 2011, Juniper Networks, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +echo shazbot > /dev/null +f1=`mktemp /tmp/filemon_test.XXXXXX` +trap 'rm -f $f1; exit 1' 1 2 3 13 15 +> $f1 +echo "One line to rule them all" >> $f1 +wc -l $f1 > /dev/null +rm $f1 +uptime > /dev/null From owner-svn-src-projects@FreeBSD.ORG Thu May 26 23:30:29 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12602106566C; Thu, 26 May 2011 23:30:29 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3F018FC14; Thu, 26 May 2011 23:30:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4QNUSQc085499; Thu, 26 May 2011 23:30:28 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4QNUSYx085494; Thu, 26 May 2011 23:30:28 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201105262330.p4QNUSYx085494@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 26 May 2011 23:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222333 - projects/jbuild/usr.bin/jbuild/filemon X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 23:30:29 -0000 Author: obrien Date: Thu May 26 23:30:28 2011 New Revision: 222333 URL: http://svn.freebsd.org/changeset/base/222333 Log: style(9) Modified: projects/jbuild/usr.bin/jbuild/filemon/Makefile projects/jbuild/usr.bin/jbuild/filemon/filemon.c projects/jbuild/usr.bin/jbuild/filemon/filemon_lock.c projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Modified: projects/jbuild/usr.bin/jbuild/filemon/Makefile ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/Makefile Thu May 26 23:27:39 2011 (r222332) +++ projects/jbuild/usr.bin/jbuild/filemon/Makefile Thu May 26 23:30:28 2011 (r222333) @@ -1,7 +1,9 @@ # $FreeBSD$ -KMOD = filemon -SRCS = filemon.c -SRCS += vnode_if.h +KMOD= filemon +SRCS= filemon.c +SRCS+= vnode_if.h + +SUBDIR= test .include Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon.c Thu May 26 23:27:39 2011 (r222332) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon.c Thu May 26 23:30:28 2011 (r222333) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, 2010, Juniper Networks, Inc. + * Copyright (c) 2009-2011, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include extern struct sysentvec ia32_freebsd_sysvec; - #endif extern struct sysentvec elf32_freebsd_sysvec; @@ -129,7 +128,7 @@ filemon_clone(void *arg, struct ucred *c if (len != 7) return; - if (bcmp(name,"filemon",7) != 0) + if (bcmp(name,"filemon", 7) != 0) return; /* Clone the device to the new minor number. */ @@ -180,7 +179,8 @@ filemon_dtr(void *data) } static int -filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, struct thread *td) +filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, + struct thread *td) { int error = 0; struct filemon *filemon; @@ -210,7 +210,7 @@ filemon_ioctl(struct cdev *dev, u_long c break; } - return(error); + return (error); } static int @@ -229,7 +229,8 @@ filemon_open(struct cdev *dev, int oflag filemon_unlock_write(); if (filemon == NULL) { - filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); + filemon = malloc(sizeof(struct filemon), M_FILEMON, + M_WAITOK | M_ZERO); filemon->fp = NULL; @@ -294,7 +295,6 @@ filemon_load(void *dummy __unused) #endif } - static int filemon_unload(void) { Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon_lock.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon_lock.c Thu May 26 23:27:39 2011 (r222332) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon_lock.c Thu May 26 23:30:28 2011 (r222333) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009, 2010, Juniper Networks, Inc. + * Copyright (c) 2009-2011, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,7 +91,8 @@ filemon_lock_write(void) while (access_owner != curthread) { if (access_owner == NULL && - (access_requester == NULL || access_requester == curthread)) { + (access_requester == NULL || + access_requester == curthread)) { access_owner = curthread; access_requester = NULL; } else { Modified: projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c ============================================================================== --- projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Thu May 26 23:27:39 2011 (r222332) +++ projects/jbuild/usr.bin/jbuild/filemon/filemon_wrapper.c Thu May 26 23:30:28 2011 (r222333) @@ -58,11 +58,11 @@ filemon_pid_check(struct proc *p) TAILQ_FOREACH(filemon, &filemons_inuse, link) { if (p->p_pid == filemon->pid) - return(filemon); + return (filemon); } if (p->p_pptr == NULL) - return(NULL); + return (NULL); return (filemon_pid_check(p->p_pptr)); } @@ -70,8 +70,8 @@ filemon_pid_check(struct proc *p) static void filemon_comment(struct filemon *filemon) { - struct timeval now; int len; + struct timeval now; /* Load timestamp before locking. Less accurate but less contention. */ getmicrotime(&now); @@ -112,9 +112,11 @@ filemon_wrapper_chdir(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "C %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "C %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); @@ -127,7 +129,7 @@ filemon_wrapper_chdir(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -149,7 +151,8 @@ filemon_wrapper_execve(struct thread *td /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", curproc->p_pid, fname); filemon_output(filemon, filemon->msgbufr, len); @@ -162,12 +165,13 @@ filemon_wrapper_execve(struct thread *td filemon_unlock_read(); } - return(ret); + return (ret); } #ifdef COMPAT_IA32 static int -filemon_wrapper_freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap) +filemon_wrapper_freebsd32_execve(struct thread *td, + struct freebsd32_execve_args *uap) { char fname[MAXPATHLEN]; int ret; @@ -185,7 +189,8 @@ filemon_wrapper_freebsd32_execve(struct /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "E %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", curproc->p_pid, fname); filemon_output(filemon, filemon->msgbufr, len); @@ -198,7 +203,7 @@ filemon_wrapper_freebsd32_execve(struct filemon_unlock_read(); } - return(ret); + return (ret); } #endif @@ -217,8 +222,9 @@ filemon_wrapper_fork(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", - curproc->p_pid, (long)curthread->td_retval[0]); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "F %d %ld\n", + curproc->p_pid, (long)curthread->td_retval[0]); filemon_output(filemon, filemon->msgbufr, len); @@ -230,7 +236,7 @@ filemon_wrapper_fork(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -249,10 +255,13 @@ filemon_wrapper_open(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "%c %d %s\n", - (uap->flags & O_ACCMODE) ? 'W':'R', curproc->p_pid, filemon->fname1); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "%c %d %s\n", + (uap->flags & O_ACCMODE) ? 'W':'R', + curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); @@ -264,7 +273,7 @@ filemon_wrapper_open(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -283,10 +292,13 @@ filemon_wrapper_rename(struct thread *td /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->from, filemon->fname1, sizeof(filemon->fname1), &done); - copyinstr(uap->to, filemon->fname2, sizeof(filemon->fname2), &done); + copyinstr(uap->from, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->to, filemon->fname2, + sizeof(filemon->fname2), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "M %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); @@ -299,7 +311,7 @@ filemon_wrapper_rename(struct thread *td filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -318,10 +330,13 @@ filemon_wrapper_link(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, sizeof(filemon->fname2), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->link, filemon->fname2, + sizeof(filemon->fname2), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); @@ -334,7 +349,7 @@ filemon_wrapper_link(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -353,10 +368,13 @@ filemon_wrapper_symlink(struct thread *t /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); - copyinstr(uap->link, filemon->fname2, sizeof(filemon->fname2), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->link, filemon->fname2, + sizeof(filemon->fname2), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); @@ -369,7 +387,7 @@ filemon_wrapper_symlink(struct thread *t filemon_unlock_read(); } - return(ret); + return (ret); } #if __FreeBSD_version > 800032 @@ -393,10 +411,13 @@ filemon_wrapper_linkat(struct thread *td /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path1, filemon->fname1, sizeof(filemon->fname1), &done); - copyinstr(uap->path2, filemon->fname2, sizeof(filemon->fname2), &done); + copyinstr(uap->path1, filemon->fname1, + sizeof(filemon->fname1), &done); + copyinstr(uap->path2, filemon->fname2, + sizeof(filemon->fname2), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "L %d '%s' '%s'\n", curproc->p_pid, filemon->fname1, filemon->fname2); filemon_output(filemon, filemon->msgbufr, len); @@ -409,9 +430,10 @@ filemon_wrapper_linkat(struct thread *td filemon_unlock_read(); } - return(ret); + return (ret); } #endif + static int filemon_wrapper_stat(struct thread *td, struct stat_args *uap) { @@ -428,9 +450,11 @@ filemon_wrapper_stat(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "S %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "S %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); @@ -443,12 +467,13 @@ filemon_wrapper_stat(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } #ifdef COMPAT_IA32 static int -filemon_wrapper_freebsd32_stat(struct thread *td, struct freebsd32_stat_args *uap) +filemon_wrapper_freebsd32_stat(struct thread *td, + struct freebsd32_stat_args *uap) { int ret; size_t done; @@ -463,9 +488,11 @@ filemon_wrapper_freebsd32_stat(struct th /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "S %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "S %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); @@ -478,16 +505,16 @@ filemon_wrapper_freebsd32_stat(struct th filemon_unlock_read(); } - return(ret); + return (ret); } #endif static void filemon_wrapper_sys_exit(struct thread *td, struct sys_exit_args *uap) { - struct timeval now; size_t len; struct filemon *filemon; + struct timeval now; /* Get timestamp before locking. */ getmicrotime(&now); @@ -540,9 +567,11 @@ filemon_wrapper_unlink(struct thread *td /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - copyinstr(uap->path, filemon->fname1, sizeof(filemon->fname1), &done); + copyinstr(uap->path, filemon->fname1, + sizeof(filemon->fname1), &done); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "D %d %s\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "D %d %s\n", curproc->p_pid, filemon->fname1); filemon_output(filemon, filemon->msgbufr, len); @@ -555,7 +584,7 @@ filemon_wrapper_unlink(struct thread *td filemon_unlock_read(); } - return(ret); + return (ret); } static int @@ -573,7 +602,8 @@ filemon_wrapper_vfork(struct thread *td, /* Lock the found filemon structure. */ filemon_filemon_lock(filemon); - len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "F %d %ld\n", + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "F %d %ld\n", curproc->p_pid, (long)curthread->td_retval[0]); filemon_output(filemon, filemon->msgbufr, len); @@ -586,7 +616,7 @@ filemon_wrapper_vfork(struct thread *td, filemon_unlock_read(); } - return(ret); + return (ret); } static void @@ -632,9 +662,7 @@ filemon_wrapper_install(void) #ifdef FILEMON_HAS_LINKAT sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) filemon_wrapper_linkat; #endif -#endif - - +#endif /* COMPAT_IA32 */ } static void @@ -680,6 +708,5 @@ filemon_wrapper_deinstall(void) #ifdef FILEMON_HAS_LINKAT sv_table[FREEBSD32_SYS_linkat].sy_call = (sy_call_t *) linkat; #endif -#endif - +#endif /* COMPAT_IA32 */ } From owner-svn-src-projects@FreeBSD.ORG Fri May 27 10:08:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F53106564A; Fri, 27 May 2011 10:08:25 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6906D8FC14; Fri, 27 May 2011 10:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RA8P2x017044; Fri, 27 May 2011 10:08:25 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RA8P2W017040; Fri, 27 May 2011 10:08:25 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201105271008.p4RA8P2W017040@svn.freebsd.org> From: Florent Thoumie Date: Fri, 27 May 2011 10:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222352 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 10:08:25 -0000 Author: flz Date: Fri May 27 10:08:25 2011 New Revision: 222352 URL: http://svn.freebsd.org/changeset/base/222352 Log: portbuild: use ${ssh_cmd} rather than calling ssh directly. ssh_cmd is set to use publickey authentication only so this avoids issues when a host might be up and running but keys aren't in place. Modified: projects/portbuild/scripts/allgohans projects/portbuild/scripts/dosetupnode projects/portbuild/scripts/pdispatch Modified: projects/portbuild/scripts/allgohans ============================================================================== --- projects/portbuild/scripts/allgohans Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/allgohans Fri May 27 10:08:25 2011 (r222352) @@ -31,16 +31,16 @@ doarch() { # If we need to scp first, the command given in the parameters is the local # path, which we need to upload first. The command will return the remote # temporary file, which we can subsequently execute. So this isn't really scp. - cmdpath=$(su ports-${arch} -c "cat ${cmd} | ssh ${client_user}@$i 't=\$(mktemp -t ${cmd##*/}); cat >\$t; echo \$t; chmod 755 \$t'") + cmdpath=$(su ports-${arch} -c "cat ${cmd} | ${ssh_cmd} ${client_user}@$i 't=\$(mktemp -t ${cmd##*/}); cat >\$t; echo \$t; chmod 755 \$t'") case ${cmdpath} in /tmp/*) ;; *) echo "Failed to scp ${cmd} to $i."; return 1;; esac fi - lockf -t 60 ${pbd}/${arch}/lockfiles/lock.$i su ports-${arch} -c "ssh ${client_user}@$i ${sudo_cmd} ${cmdpath} $@" + lockf -t 60 ${pbd}/${arch}/lockfiles/lock.$i su ports-${arch} -c "${ssh_cmd} ${client_user}@$i ${sudo_cmd} ${cmdpath} $@" result=$? if [ $result -ne 0 ]; then echo "could not execute command ${cmdpath} $@ on $i: $result" fi if [ ${scpfirst} -ne 0 ]; then - su ports-${arch} -c "ssh ${client_user}@$i 'rm -f ${cmdpath}'" + su ports-${arch} -c "${ssh_cmd} ${client_user}@$i 'rm -f ${cmdpath}'" fi done } Modified: projects/portbuild/scripts/dosetupnode ============================================================================== --- projects/portbuild/scripts/dosetupnode Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/dosetupnode Fri May 27 10:08:25 2011 (r222352) @@ -72,7 +72,7 @@ setup() { checkerror $? || (echo "Copying scripts to ${node} failed"; return 1) fi - cmdpath=$(cat ${pbc}/scripts/setupnode | ssh -a ${client_user}@${node} 't=$(mktemp -t setupnode); cat >$t; echo $t; chmod 755 $t') + cmdpath=$(cat ${pbc}/scripts/setupnode | ${ssh_cmd} -a ${client_user}@${node} 't=$(mktemp -t setupnode); cat >$t; echo $t; chmod 755 $t') case ${cmdpath} in /tmp/*) ;; *) echo "Failed to upload or run setupnode on ${node}."; return 1;; esac client_setup="${ssh_cmd} -n ${client_user}@${node} ${cmdpath} ${pbd} ${arch} ${branch} ${buildid} ${scratchdir} \"${portsmd5}\" \"${srcmd5}\" \"${bindistmd5}\"" Modified: projects/portbuild/scripts/pdispatch ============================================================================== --- projects/portbuild/scripts/pdispatch Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/pdispatch Fri May 27 10:08:25 2011 (r222352) @@ -85,7 +85,7 @@ chroot= test -f ${pbd}/${arch}/portbuild.${host} && . ${pbd}/${arch}/portbuild.${host} # Upload scripts/claim-chroot as per-build scripts aren't in place yet. -cmdpath=$(cat ${pbc}/scripts/claim-chroot | ssh -a ${client_user}@${host} 't=$(mktemp -t claim-chroot); cat >$t; echo $t; chmod 755 $t') +cmdpath=$(cat ${pbc}/scripts/claim-chroot | ${ssh_cmd} -a ${client_user}@${host} 't=$(mktemp -t claim-chroot); cat >$t; echo $t; chmod 755 $t') case ${cmdpath} in /tmp/*) ;; *) echo "Failed to scp claim-chroot to ${host}."; exit 254;; esac chrootdata=$(${ssh_cmd} -a -n ${client_user}@${host} ${sudo_cmd} ${cmdpath} ${arch} ${branch} ${buildid} ${pkgname} 2>&1) ${ssh_cmd} -a ${client_user}@${host} "rm -f ${cmdpath}" From owner-svn-src-projects@FreeBSD.ORG Fri May 27 10:08:27 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0327A106566C; Fri, 27 May 2011 10:08:27 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD3478FC15; Fri, 27 May 2011 10:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RA8QAg017077; Fri, 27 May 2011 10:08:26 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RA8QoK017075; Fri, 27 May 2011 10:08:26 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201105271008.p4RA8QoK017075@svn.freebsd.org> From: Florent Thoumie Date: Fri, 27 May 2011 10:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222353 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 10:08:27 -0000 Author: flz Date: Fri May 27 10:08:26 2011 New Revision: 222353 URL: http://svn.freebsd.org/changeset/base/222353 Log: portbuild: prepare for pkgng. Modified: projects/portbuild/scripts/buildscript Modified: projects/portbuild/scripts/buildscript ============================================================================== --- projects/portbuild/scripts/buildscript Fri May 27 10:08:25 2011 (r222352) +++ projects/portbuild/scripts/buildscript Fri May 27 10:08:26 2011 (r222353) @@ -50,12 +50,21 @@ add_pkg() { arch=$(uname -m) echo "adding dependencies" for i in $pkgs; do - echo "pkg_add $i" + echo "adding package $i" base=$(basename $i ${pkg_sufx}) - if pkg_info -q -e $base; then + if [ $use_pkgng = "no" ]; then + pkg_cmd_info="pkg_info -qe" + pkg_cmd_add="pkg_add" + else + pkg_cmd_info="pkg info -qeO" + pkg_cmd_add="pkg add" + fi + eval $pkg_cmd_info $base >/dev/null 2>&1 + if [ $? -eq 0 ]; then echo "skipping $base, already added" else - if ! pkg_add $i; then + eval $pkg_cmd_add $i >/dev/null 2>&1 + if [ $? -ne 0 ]; then echo "error in dependency $i, exiting" cleanup 0 fi @@ -78,24 +87,45 @@ del_pkg() { recursion=0 for i in $pkgs; do base=$(basename $i ${pkg_sufx}) - if [ -s /var/db/pkg/${base}/+REQUIRED_BY ]; then + if [ $use_pkgng = "no" ]; then + dependents=$(cat /var/db/pkg/${base}/+REQUIRED_BY 2>/dev/null) + pkg_cmd_check="cd /var/db/pkg && test -d" + else + dependents=$(pkg info -qOr $base) + pkg_cmd_check="pkg info -qO" + fi + if [ -n "$dependents" ]; then recursion=1 nextpkg="${base} ${nextpkg}" - elif [ -d /var/db/pkg/${base}/ ]; then - delpkg="${base} ${delpkg}" + else + eval $pkg_cmd_check $base >/dev/null 2>&1 + if [ $? -eq 0 ]; then + delpkg="${base} ${delpkg}" + fi fi done pkgs="${nextpkg}" if [ "$dellist" != "" -a "$dellist" = "$delpkg" ]; then + if [ $use_pkgng = "no" ]; then + leftover=$(cd /var/db/pkg && find * -type d -maxdepth 1) + else + leftover=$(pkg info -qa) + fi echo "deleted list =\""$dellist"\", packages to delete ="\"$delpkg\" echo "The following packages were left behind (perhaps your dependency list is incomplete):" - ls /var/db/pkg - echo "error in pkg_delete, exiting" + echo $leftover + echo "error while removing package, exiting" cleanup 0 else for j in ${delpkg}; do echo "Deleting ${j}" - if ! (pkg_delete -f $j); then + if [ $use_pkgng = "no" ]; then + pkg_delete -f ${j} + else + jorig=$(pkg info -qOo ${j}) + pkg delete -f ${jorig} + fi + if [ $? -ne 0 ]; then echo "--> error in pkg_delete, exiting" cleanup 0 fi @@ -128,6 +158,13 @@ restr=$(make -V RESTRICTED) # Inherit from environment set by portbuild. pkg_sufx=${PKG_SUFX} +# Use pkgng if available. +if [ -x /usr/sbin/pkg ]; then + use_pkgng="yes" +else + use_pkgng="no" +fi + # Keep restricted distfiles in a subdirectory for extra protection # against leakage if [ ! -z "$restr" ]; then @@ -358,10 +395,17 @@ EOF # Concatenate and remove duplicates BRD=$(echo $BD $RD | tr ' ' '\n' | sort -u | tr '\n' ' ') del_pkg ${BRD} - cd /var/db/pkg - if [ $(echo $(echo * | wc -c)) != 2 ]; then - echo "leftover packages:" * - del_pkg * + + if [ $use_pkgng = "no" ]; then + cd /var/db/pkg + leftover=$(find * -type d -maxdepth 1) + else + leftover=$(pkg info -qa) + fi + + if [ -n "$leftover" ]; then + echo "leftover packages:" $leftover + del_pkg $leftover echo "1" > /tmp/status cleanup 0 fi From owner-svn-src-projects@FreeBSD.ORG Fri May 27 14:08:24 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF27A1065673; Fri, 27 May 2011 14:08:24 +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 9F3458FC14; Fri, 27 May 2011 14:08:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RE8OMs038641; Fri, 27 May 2011 14:08:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RE8OtA038639; Fri, 27 May 2011 14:08:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105271408.p4RE8OtA038639@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 27 May 2011 14:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222355 - projects/pseries/powerpc/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 14:08:24 -0000 Author: nwhitehorn Date: Fri May 27 14:08:24 2011 New Revision: 222355 URL: http://svn.freebsd.org/changeset/base/222355 Log: Check for memory in multiple /memory nodes, as present in some IBM systems (e.g. the QS22 Cell blade server). Modified: projects/pseries/powerpc/ofw/ofw_machdep.c Modified: projects/pseries/powerpc/ofw/ofw_machdep.c ============================================================================== --- projects/pseries/powerpc/ofw/ofw_machdep.c Fri May 27 10:40:34 2011 (r222354) +++ projects/pseries/powerpc/ofw/ofw_machdep.c Fri May 27 14:08:24 2011 (r222355) @@ -353,25 +353,32 @@ ofw_mem_regions(struct mem_region **memp int asz, msz, fsz; int i, j, res; int still_merging; + char name[31]; asz = msz = 0; /* - * Get memory. + * Get memory from all the /memory nodes. */ - phandle = OF_finddevice("/memory"); - if (phandle == -1) - phandle = OF_finddevice("/memory@0"); - - msz = parse_ofw_memory(phandle, "reg", OFmem); - msz /= sizeof(struct mem_region); - asz = parse_ofw_memory(phandle, "available", OFavail); - asz /= sizeof(struct mem_region); - - res = parse_drconf_memory(&msz, &asz, OFmem, OFavail); - if (res == 0) - /* tbd. */ - printf("no ibm machine\n"); + for (phandle = OF_child(OF_peer(0)); phandle != 0; + phandle = OF_peer(phandle)) { + if (OF_getprop(phandle, "name", name, sizeof(name)) <= 0) + continue; + if (strncmp(name, "memory", sizeof(name)) != 0) + continue; + + res = parse_ofw_memory(phandle, "reg", &OFmem[msz]); + msz += res/sizeof(struct mem_region); + if (OF_getproplen(phandle, "available") >= 0) + res = parse_ofw_memory(phandle, "available", + &OFavail[asz]); + else + res = parse_ofw_memory(phandle, "reg", &OFavail[asz]); + asz += res/sizeof(struct mem_region); + } + + /* Check for memory in ibm,dynamic-reconfiguration-memory */ + parse_drconf_memory(&msz, &asz, OFmem, OFavail); qsort(OFmem, msz, sizeof(*OFmem), mr_cmp); qsort(OFavail, asz, sizeof(*OFavail), mr_cmp); From owner-svn-src-projects@FreeBSD.ORG Fri May 27 14:27:29 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22570106564A; Fri, 27 May 2011 14:27:29 +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 1223F8FC0A; Fri, 27 May 2011 14:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RERSvl039283; Fri, 27 May 2011 14:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RERSUb039281; Fri, 27 May 2011 14:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105271427.p4RERSUb039281@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 27 May 2011 14:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222356 - projects/pseries/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 14:27:29 -0000 Author: nwhitehorn Date: Fri May 27 14:27:28 2011 New Revision: 222356 URL: http://svn.freebsd.org/changeset/base/222356 Log: On multi-core, multi-threaded PPC systems, it is important that the threads be brought up in the order they are enumerated in the device tree (in particular, that thread 0 on each core be brought up first). The SLIST through which we loop to start the CPUs has all of its entries added with SLIST_INSERT_HEAD(), which means it is in reverse order of enumeration and so AP startup would always fail in such situation (causing a machine check or RTAS failure). The best fix is probably to change this from a LIST to a TAILQ, but fix this by looping through to add new cpus to the end of the list. Modified: projects/pseries/kern/subr_pcpu.c Modified: projects/pseries/kern/subr_pcpu.c ============================================================================== --- projects/pseries/kern/subr_pcpu.c Fri May 27 14:08:24 2011 (r222355) +++ projects/pseries/kern/subr_pcpu.c Fri May 27 14:27:28 2011 (r222356) @@ -82,6 +82,7 @@ struct cpuhead cpuhead = SLIST_HEAD_INIT void pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) { + struct pcpu *tail; bzero(pcpu, size); KASSERT(cpuid >= 0 && cpuid < MAXCPU, @@ -89,7 +90,17 @@ pcpu_init(struct pcpu *pcpu, int cpuid, pcpu->pc_cpuid = cpuid; pcpu->pc_cpumask = 1 << cpuid; cpuid_to_pcpu[cpuid] = pcpu; - SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu); + /* + * It may be important that the CPU list stay ordered, so try to + * install this PCPU at the end of the list instead of the beginnig. + */ + for (tail = SLIST_FIRST(&cpuhead); tail != NULL && + SLIST_NEXT(tail, pc_allcpu) != NULL; + tail = SLIST_NEXT(tail, pc_allcpu)) {} + if (tail != NULL) + SLIST_INSERT_AFTER(tail, pcpu, pc_allcpu); + else + SLIST_INSERT_HEAD(&cpuhead, pcpu, pc_allcpu); cpu_pcpu_init(pcpu, cpuid, size); pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue; pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue; From owner-svn-src-projects@FreeBSD.ORG Fri May 27 14:30:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CBFA1065675; Fri, 27 May 2011 14:30:19 +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 C25A78FC1B; Fri, 27 May 2011 14:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4REUJvs039437; Fri, 27 May 2011 14:30:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4REUJxR039435; Fri, 27 May 2011 14:30:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105271430.p4REUJxR039435@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 27 May 2011 14:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222358 - projects/pseries/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 14:30:21 -0000 Author: nwhitehorn Date: Fri May 27 14:30:19 2011 New Revision: 222358 URL: http://svn.freebsd.org/changeset/base/222358 Log: Spell "beginning" correctly. Modified: projects/pseries/kern/subr_pcpu.c Modified: projects/pseries/kern/subr_pcpu.c ============================================================================== --- projects/pseries/kern/subr_pcpu.c Fri May 27 14:30:13 2011 (r222357) +++ projects/pseries/kern/subr_pcpu.c Fri May 27 14:30:19 2011 (r222358) @@ -92,7 +92,7 @@ pcpu_init(struct pcpu *pcpu, int cpuid, cpuid_to_pcpu[cpuid] = pcpu; /* * It may be important that the CPU list stay ordered, so try to - * install this PCPU at the end of the list instead of the beginnig. + * install this PCPU at the end of the list instead of the beginning. */ for (tail = SLIST_FIRST(&cpuhead); tail != NULL && SLIST_NEXT(tail, pc_allcpu) != NULL; From owner-svn-src-projects@FreeBSD.ORG Fri May 27 15:50:15 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F0A41065676; Fri, 27 May 2011 15:50:15 +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 13F608FC15; Fri, 27 May 2011 15:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RFoEI1041960; Fri, 27 May 2011 15:50:14 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RFoEtc041957; Fri, 27 May 2011 15:50:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105271550.p4RFoEtc041957@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 May 2011 15:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222360 - in projects/largeSMP: lib/libkvm sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 15:50:15 -0000 Author: attilio Date: Fri May 27 15:50:14 2011 New Revision: 222360 URL: http://svn.freebsd.org/changeset/base/222360 Log: In the near future cpuset_t objects in struct pcpu will be axed out, but as long as this does not happen, we need to fix interfaces to userland in order to not break run-time accesses to the structure. Reviwed by: kib Tested by: pluknet Modified: projects/largeSMP/lib/libkvm/kvm_pcpu.c projects/largeSMP/sys/sys/pcpu.h Modified: projects/largeSMP/lib/libkvm/kvm_pcpu.c ============================================================================== --- projects/largeSMP/lib/libkvm/kvm_pcpu.c Fri May 27 15:29:39 2011 (r222359) +++ projects/largeSMP/lib/libkvm/kvm_pcpu.c Fri May 27 15:50:14 2011 (r222360) @@ -39,11 +39,13 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include #include +#include #include "kvm_private.h" @@ -118,6 +120,9 @@ _kvm_pcpu_clear(void) void * kvm_getpcpu(kvm_t *kd, int cpu) { + long kcpusetsize; + ssize_t nbytes; + uintptr_t readptr; char *buf; if (kd == NULL) { @@ -125,6 +130,10 @@ kvm_getpcpu(kvm_t *kd, int cpu) return (NULL); } + kcpusetsize = sysconf(_SC_CPUSET_SIZE); + if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t)) + return ((void *)-1); + if (maxcpu == 0) if (_kvm_pcpu_init(kd) < 0) return ((void *)-1); @@ -137,8 +146,26 @@ kvm_getpcpu(kvm_t *kd, int cpu) _kvm_err(kd, kd->program, "out of memory"); return ((void *)-1); } - if (kvm_read(kd, (uintptr_t)pcpu_data[cpu], buf, sizeof(struct pcpu)) != - sizeof(struct pcpu)) { + nbytes = sizeof(struct pcpu) - 2 * kcpusetsize; + readptr = (uintptr_t)pcpu_data[cpu]; + if (kvm_read(kd, readptr, buf, nbytes) != nbytes) { + _kvm_err(kd, kd->program, "unable to read per-CPU data"); + free(buf); + return ((void *)-1); + } + + /* Fetch the valid cpuset_t objects. */ + CPU_ZERO((cpuset_t *)(buf + nbytes)); + CPU_ZERO((cpuset_t *)(buf + nbytes + sizeof(cpuset_t))); + readptr += nbytes; + if (kvm_read(kd, readptr, buf + nbytes, kcpusetsize) != kcpusetsize) { + _kvm_err(kd, kd->program, "unable to read per-CPU data"); + free(buf); + return ((void *)-1); + } + readptr += kcpusetsize; + if (kvm_read(kd, readptr, buf + nbytes + sizeof(cpuset_t), + kcpusetsize) != kcpusetsize) { _kvm_err(kd, kd->program, "unable to read per-CPU data"); free(buf); return ((void *)-1); Modified: projects/largeSMP/sys/sys/pcpu.h ============================================================================== --- projects/largeSMP/sys/sys/pcpu.h Fri May 27 15:29:39 2011 (r222359) +++ projects/largeSMP/sys/sys/pcpu.h Fri May 27 15:50:14 2011 (r222360) @@ -163,8 +163,6 @@ struct pcpu { uint64_t pc_switchtime; /* cpu_ticks() at last csw */ int pc_switchticks; /* `ticks' at last csw */ u_int pc_cpuid; /* This cpu number */ - cpuset_t pc_cpumask; /* This cpu mask */ - cpuset_t pc_other_cpus; /* Mask of all other cpus */ SLIST_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; #ifdef KTR @@ -198,6 +196,18 @@ struct pcpu { * if only to make kernel debugging easier. */ PCPU_MD_FIELDS; + + /* + * XXX + * For the time being, keep the cpuset_t objects as the very last + * members of the structure. + * They are actually tagged to be removed soon, but as long as this + * does not happen, it is necessary to find a way to implement + * easilly interfaces to userland and leaving them last makes that + * possible. + */ + cpuset_t pc_cpumask; /* This cpu mask */ + cpuset_t pc_other_cpus; /* Mask of all other cpus */ } __aligned(CACHE_LINE_SIZE); #ifdef _KERNEL From owner-svn-src-projects@FreeBSD.ORG Fri May 27 16:01:52 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E78106566C; Fri, 27 May 2011 16:01:52 +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 D04668FC1E; Fri, 27 May 2011 16:01:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RG1pfg042429; Fri, 27 May 2011 16:01:51 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RG1pfn042424; Fri, 27 May 2011 16:01:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105271601.p4RG1pfn042424@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 May 2011 16:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222363 - in projects/largeSMP: gnu/usr.bin/gdb/kgdb lib/libkvm lib/libmemstat usr.sbin/pmccontrol X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 16:01:52 -0000 Author: attilio Date: Fri May 27 16:01:51 2011 New Revision: 222363 URL: http://svn.freebsd.org/changeset/base/222363 Log: Style fix: cast to size_t rather than u_long when comparing to sizeof() rets. Requested by: kib Modified: projects/largeSMP/gnu/usr.bin/gdb/kgdb/kthr.c projects/largeSMP/lib/libkvm/kvm_pcpu.c projects/largeSMP/lib/libmemstat/memstat_uma.c projects/largeSMP/usr.sbin/pmccontrol/pmccontrol.c Modified: projects/largeSMP/gnu/usr.bin/gdb/kgdb/kthr.c ============================================================================== --- projects/largeSMP/gnu/usr.bin/gdb/kgdb/kthr.c Fri May 27 16:00:37 2011 (r222362) +++ projects/largeSMP/gnu/usr.bin/gdb/kgdb/kthr.c Fri May 27 16:01:51 2011 (r222363) @@ -107,7 +107,7 @@ kgdb_thr_init(void) addr = kgdb_lookup("stopped_cpus"); CPU_ZERO(&stopped_cpus); cpusetsize = sysconf(_SC_CPUSET_SIZE); - if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) && + if (cpusetsize != -1 && (size_t)cpusetsize <= sizeof(cpuset_t) && addr != 0) kvm_read(kvm, addr, &stopped_cpus, cpusetsize); Modified: projects/largeSMP/lib/libkvm/kvm_pcpu.c ============================================================================== --- projects/largeSMP/lib/libkvm/kvm_pcpu.c Fri May 27 16:00:37 2011 (r222362) +++ projects/largeSMP/lib/libkvm/kvm_pcpu.c Fri May 27 16:01:51 2011 (r222363) @@ -131,7 +131,7 @@ kvm_getpcpu(kvm_t *kd, int cpu) } kcpusetsize = sysconf(_SC_CPUSET_SIZE); - if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t)) + if (kcpusetsize == -1 || (size_t)kcpusetsize > sizeof(cpuset_t)) return ((void *)-1); if (maxcpu == 0) Modified: projects/largeSMP/lib/libmemstat/memstat_uma.c ============================================================================== --- projects/largeSMP/lib/libmemstat/memstat_uma.c Fri May 27 16:00:37 2011 (r222362) +++ projects/largeSMP/lib/libmemstat/memstat_uma.c Fri May 27 16:01:51 2011 (r222363) @@ -341,7 +341,7 @@ memstat_kvm_uma(struct memory_type_list return (-1); } cpusetsize = sysconf(_SC_CPUSET_SIZE); - if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) { + if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) { list->mtl_error = MEMSTAT_ERROR_KVM_NOSYMBOL; return (-1); } Modified: projects/largeSMP/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- projects/largeSMP/usr.sbin/pmccontrol/pmccontrol.c Fri May 27 16:00:37 2011 (r222362) +++ projects/largeSMP/usr.sbin/pmccontrol/pmccontrol.c Fri May 27 16:01:51 2011 (r222363) @@ -148,7 +148,7 @@ pmcc_do_enable_disable(struct pmcc_op_li /* Determine the set of active CPUs. */ cpusetsize = sysconf(_SC_CPUSET_SIZE); - if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) { + if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) { err(EX_OSERR, "ERROR: Cannot determine which CPUs are " "halted"); } From owner-svn-src-projects@FreeBSD.ORG Fri May 27 16:02:06 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED942106566B; Fri, 27 May 2011 16:02:06 +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 C4B308FC08; Fri, 27 May 2011 16:02:06 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7978D46B49; Fri, 27 May 2011 12:02:06 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0C8988A051; Fri, 27 May 2011 12:02:06 -0400 (EDT) From: John Baldwin To: Nathan Whitehorn Date: Fri, 27 May 2011 12:02:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201105271427.p4RERSUb039281@svn.freebsd.org> In-Reply-To: <201105271427.p4RERSUb039281@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105271202.04421.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 27 May 2011 12:02:06 -0400 (EDT) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222356 - projects/pseries/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 16:02:07 -0000 On Friday, May 27, 2011 10:27:28 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Fri May 27 14:27:28 2011 > New Revision: 222356 > URL: http://svn.freebsd.org/changeset/base/222356 > > Log: > On multi-core, multi-threaded PPC systems, it is important that the threads > be brought up in the order they are enumerated in the device tree (in > particular, that thread 0 on each core be brought up first). The SLIST > through which we loop to start the CPUs has all of its entries added with > SLIST_INSERT_HEAD(), which means it is in reverse order of enumeration > and so AP startup would always fail in such situation (causing a machine > check or RTAS failure). > > The best fix is probably to change this from a LIST to a TAILQ, but fix > this by looping through to add new cpus to the end of the list. Just make it a STAILQ. That has a STAILQ_INSERT_TAIL() method and doesn't change the ABI of 'struct pcpu'. It just adds an extra pointer to the head. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Fri May 27 16:09:11 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27566106566B; Fri, 27 May 2011 16:09:11 +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 133A98FC0A; Fri, 27 May 2011 16:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RG9B2e042761; Fri, 27 May 2011 16:09:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RG9A4M042735; Fri, 27 May 2011 16:09:10 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105271609.p4RG9A4M042735@svn.freebsd.org> From: Attilio Rao Date: Fri, 27 May 2011 16:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222364 - in projects/largeSMP: bin/sh contrib/top lib/libc/iconv libexec/tftpd sbin/geom/class/part sbin/newfs share/examples share/examples/ses/srcs share/mk sys/cam/scsi sys/cddl/com... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 16:09:11 -0000 Author: attilio Date: Fri May 27 16:09:10 2011 New Revision: 222364 URL: http://svn.freebsd.org/changeset/base/222364 Log: MFC Added: projects/largeSMP/tools/regression/bin/sh/expansion/ifs4.0 - copied unchanged from r222363, head/tools/regression/bin/sh/expansion/ifs4.0 projects/largeSMP/tools/tools/ath/ath_ee_9287_print/ - copied from r222363, head/tools/tools/ath/ath_ee_9287_print/ Modified: projects/largeSMP/bin/sh/TOUR projects/largeSMP/bin/sh/expand.c projects/largeSMP/lib/libc/iconv/Symbol.map projects/largeSMP/libexec/tftpd/tftp-io.c projects/largeSMP/sbin/geom/class/part/geom_part.c projects/largeSMP/sbin/geom/class/part/gpart.8 projects/largeSMP/sbin/newfs/newfs.h projects/largeSMP/share/examples/Makefile projects/largeSMP/share/examples/ses/srcs/eltsub.c projects/largeSMP/sys/cam/scsi/scsi_ses.h projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c projects/largeSMP/sys/conf/files projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c projects/largeSMP/sys/dev/puc/pucdata.c projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c projects/largeSMP/sys/geom/part/g_part_mbr.c projects/largeSMP/sys/kern/kern_sig.c projects/largeSMP/sys/modules/ath/Makefile projects/largeSMP/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c projects/largeSMP/sys/powerpc/booke/platform_bare.c projects/largeSMP/sys/powerpc/include/spr.h projects/largeSMP/sys/ufs/ffs/ffs_alloc.c Directory Properties: projects/largeSMP/ (props changed) projects/largeSMP/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/contrib/bind9/ (props changed) projects/largeSMP/contrib/binutils/ (props changed) projects/largeSMP/contrib/bzip2/ (props changed) projects/largeSMP/contrib/dialog/ (props changed) projects/largeSMP/contrib/ee/ (props changed) projects/largeSMP/contrib/expat/ (props changed) projects/largeSMP/contrib/file/ (props changed) projects/largeSMP/contrib/gcc/ (props changed) projects/largeSMP/contrib/gdb/ (props changed) projects/largeSMP/contrib/gdtoa/ (props changed) projects/largeSMP/contrib/gnu-sort/ (props changed) projects/largeSMP/contrib/groff/ (props changed) projects/largeSMP/contrib/less/ (props changed) projects/largeSMP/contrib/libpcap/ (props changed) projects/largeSMP/contrib/libstdc++/ (props changed) projects/largeSMP/contrib/llvm/ (props changed) projects/largeSMP/contrib/llvm/tools/clang/ (props changed) projects/largeSMP/contrib/ncurses/ (props changed) projects/largeSMP/contrib/netcat/ (props changed) projects/largeSMP/contrib/ntp/ (props changed) projects/largeSMP/contrib/one-true-awk/ (props changed) projects/largeSMP/contrib/openbsm/ (props changed) projects/largeSMP/contrib/openpam/ (props changed) projects/largeSMP/contrib/pf/ (props changed) projects/largeSMP/contrib/sendmail/ (props changed) projects/largeSMP/contrib/tcpdump/ (props changed) projects/largeSMP/contrib/tcsh/ (props changed) projects/largeSMP/contrib/top/ (props changed) projects/largeSMP/contrib/top/install-sh (props changed) projects/largeSMP/contrib/tzcode/stdtime/ (props changed) projects/largeSMP/contrib/tzcode/zic/ (props changed) projects/largeSMP/contrib/tzdata/ (props changed) projects/largeSMP/contrib/wpa/ (props changed) projects/largeSMP/contrib/xz/ (props changed) projects/largeSMP/crypto/openssh/ (props changed) projects/largeSMP/crypto/openssl/ (props changed) projects/largeSMP/gnu/lib/ (props changed) projects/largeSMP/gnu/usr.bin/binutils/ (props changed) projects/largeSMP/gnu/usr.bin/cc/cc_tools/ (props changed) projects/largeSMP/gnu/usr.bin/gdb/ (props changed) projects/largeSMP/lib/libc/ (props changed) projects/largeSMP/lib/libc/stdtime/ (props changed) projects/largeSMP/lib/libutil/ (props changed) projects/largeSMP/lib/libz/ (props changed) projects/largeSMP/sbin/ (props changed) projects/largeSMP/sbin/ipfw/ (props changed) projects/largeSMP/share/mk/bsd.arch.inc.mk (props changed) projects/largeSMP/share/zoneinfo/ (props changed) projects/largeSMP/sys/ (props changed) projects/largeSMP/sys/amd64/include/xen/ (props changed) projects/largeSMP/sys/boot/ (props changed) projects/largeSMP/sys/boot/i386/efi/ (props changed) projects/largeSMP/sys/boot/ia64/efi/ (props changed) projects/largeSMP/sys/boot/ia64/ski/ (props changed) projects/largeSMP/sys/boot/powerpc/boot1.chrp/ (props changed) projects/largeSMP/sys/boot/powerpc/ofw/ (props changed) projects/largeSMP/sys/cddl/contrib/opensolaris/ (props changed) projects/largeSMP/sys/conf/ (props changed) projects/largeSMP/sys/contrib/dev/acpica/ (props changed) projects/largeSMP/sys/contrib/octeon-sdk/ (props changed) projects/largeSMP/sys/contrib/pf/ (props changed) projects/largeSMP/sys/contrib/x86emu/ (props changed) projects/largeSMP/usr.bin/calendar/ (props changed) projects/largeSMP/usr.bin/csup/ (props changed) projects/largeSMP/usr.bin/procstat/ (props changed) projects/largeSMP/usr.sbin/ndiscvt/ (props changed) projects/largeSMP/usr.sbin/zic/ (props changed) Modified: projects/largeSMP/bin/sh/TOUR ============================================================================== --- projects/largeSMP/bin/sh/TOUR Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/bin/sh/TOUR Fri May 27 16:09:10 2011 (r222364) @@ -27,10 +27,8 @@ programs is: mkbuiltins builtins builtins.h builtins.c mkinit *.c init.c mknodes nodetypes nodes.h nodes.c - mksignames - signames.h signames.c mksyntax - syntax.h syntax.c mktokens - token.h - bltin/mkexpr unary_op binary_op operators.h operators.c There are undoubtedly too many of these. Mkinit searches all the C source files for entries looking like: @@ -64,14 +62,6 @@ tion: Preprocessor #define statements are copied to init.c without any special action to request this. -INDENTATION: The ash source is indented in multiples of six -spaces. The only study that I have heard of on the subject con- -cluded that the optimal amount to indent is in the range of four -to six spaces. I use six spaces since it is not too big a jump -from the widely used eight spaces. If you really hate six space -indentation, use the adjind (source included) program to change -it to something else. - EXCEPTIONS: Code for dealing with exceptions appears in exceptions.c. The C language doesn't include exception handling, so I implement it using setjmp and longjmp. The global variable @@ -115,7 +105,7 @@ repeatedly parses and executes commands. OPTIONS.C: This file contains the option processing code. It is called from main to parse the shell arguments when the shell is -invoked, and it also contains the set builtin. The -i and -j op- +invoked, and it also contains the set builtin. The -i and -m op- tions (the latter turns on job control) require changes in signal handling. The routines setjobctl (in jobs.c) and setinteractive (in trap.c) are called to handle changes to these options. @@ -123,10 +113,11 @@ handling. The routines setjobctl (in jo PARSING: The parser code is all in parser.c. A recursive des- cent parser is used. Syntax tables (generated by mksyntax) are used to classify characters during lexical analysis. There are -three tables: one for normal use, one for use when inside single -quotes, and one for use when inside double quotes. The tables -are machine dependent because they are indexed by character vari- -ables and the range of a char varies from machine to machine. +four tables: one for normal use, one for use when inside single +quotes and dollar single quotes, one for use when inside double +quotes and one for use in arithmetic. The tables are machine +dependent because they are indexed by character variables and +the range of a char varies from machine to machine. PARSE OUTPUT: The output of the parser consists of a tree of nodes. The various types of nodes are defined in the file node- @@ -242,12 +233,7 @@ The routine shellexec is the interface t EXPAND.C: Arguments are processed in three passes. The first (performed by the routine argstr) performs variable and command substitution. The second (ifsbreakup) performs word splitting -and the third (expandmeta) performs file name generation. If the -"/u" directory is simulated, then when "/u/username" is replaced -by the user's home directory, the flag "didudir" is set. This -tells the cd command that it should print out the directory name, -just as it would if the "/u" directory were implemented using -symbolic links. +and the third (expandmeta) performs file name generation. VAR.C: Variables are stored in a hash table. Probably we should switch to extensible hashing. The variable name is stored in the @@ -292,14 +278,7 @@ when the program is linked into ash. Th before bltin.h is included; bltin.h will #undef main if the pro- gram is to be compiled stand-alone. -CD.C: This file defines the cd and pwd builtins. The pwd com- -mand runs /bin/pwd the first time it is invoked (unless the user -has already done a cd to an absolute pathname), but then -remembers the current directory and updates it when the cd com- -mand is run, so subsequent pwd commands run very fast. The main -complication in the cd command is in the docd command, which -resolves symbolic links into actual names and informs the user -where the user ended up if he crossed a symbolic link. +CD.C: This file defines the cd and pwd builtins. SIGNALS: Trap.c implements the trap command. The routine set- signal figures out what action should be taken when a signal is Modified: projects/largeSMP/bin/sh/expand.c ============================================================================== --- projects/largeSMP/bin/sh/expand.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/bin/sh/expand.c Fri May 27 16:09:10 2011 (r222364) @@ -761,7 +761,8 @@ again: /* jump here after setting a vari break; record: recordregion(startloc, expdest - stackblock(), - varflags & VSQUOTE); + varflags & VSQUOTE || (ifsset() && ifsval()[0] == '\0' && + (*var == '@' || *var == '*'))); break; case VSPLUS: @@ -947,7 +948,9 @@ numvar: sep = ' '; for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { strtodest(p, flag, subtype, quoted); - if (*ap && sep) + if (!*ap) + break; + if (sep || (flag & EXP_FULL && !quoted && **ap != '\0')) STPUTC(sep, expdest); } break; Modified: projects/largeSMP/lib/libc/iconv/Symbol.map ============================================================================== --- projects/largeSMP/lib/libc/iconv/Symbol.map Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/lib/libc/iconv/Symbol.map Fri May 27 16:09:10 2011 (r222364) @@ -6,6 +6,18 @@ FBSD_1.2 { __iconv; __iconv_free_list; __iconv_get_list; + _libiconv_version; + iconv_canonicalize; + libiconv; + libiconv_close; + libiconv_open; + libiconv_open_into; + libiconv_set_relocation_prefix; + libiconvctl; + libiconvlist; +}; + +FBSDprivate_1.0 { _citrus_bcs_convert_to_lower; _citrus_bcs_convert_to_upper; _citrus_bcs_isalnum; @@ -89,13 +101,4 @@ FBSD_1.2 { _citrus_stdenc_close; _citrus_stdenc_open; _citrus_unmap_file; - _libiconv_version; - iconv_canonicalize; - libiconv; - libiconv_close; - libiconv_open; - libiconv_open_into; - libiconv_set_relocation_prefix; - libiconvctl; - libiconvlist; }; Modified: projects/largeSMP/libexec/tftpd/tftp-io.c ============================================================================== --- projects/largeSMP/libexec/tftpd/tftp-io.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/libexec/tftpd/tftp-io.c Fri May 27 16:09:10 2011 (r222364) @@ -262,7 +262,7 @@ send_rrq(int peer, char *filename, char n = sendto(peer, buf, size, 0, (struct sockaddr *)&peer_sock, peer_sock.ss_len); if (n != size) { - tftp_log(LOG_ERR, "send_rrq: %s", n, strerror(errno)); + tftp_log(LOG_ERR, "send_rrq: %d %s", n, strerror(errno)); return (1); } return (0); Modified: projects/largeSMP/sbin/geom/class/part/geom_part.c ============================================================================== --- projects/largeSMP/sbin/geom/class/part/geom_part.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sbin/geom/class/part/geom_part.c Fri May 27 16:09:10 2011 (r222364) @@ -101,7 +101,7 @@ struct g_command PUBSYM(class_commands)[ { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "[-a alignment] [-b start] [-s size] -t type [-i index] " + "-t type [-a alignment] [-b start] [-s size] [-i index] " "[-l label] [-f flags] geom" }, { "backup", 0, gpart_backup, G_NULL_OPTS, @@ -113,7 +113,7 @@ struct g_command PUBSYM(class_commands)[ { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "[-b bootcode] [-p partcode] [-i index] [-f flags] geom" + "[-b bootcode] [-p partcode -i index] [-f flags] geom" }, { "commit", 0, gpart_issue, G_NULL_OPTS, "geom" @@ -157,7 +157,7 @@ struct g_command PUBSYM(class_commands)[ { 'r', "show_rawtype", NULL, G_TYPE_BOOL }, { 'p', "show_providers", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - "[-lrp] [geom ...]" + "[-l | -r] [-p] [geom ...]" }, { "undo", 0, gpart_issue, G_NULL_OPTS, "geom" @@ -175,7 +175,7 @@ struct g_command PUBSYM(class_commands)[ { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, - "[-a alignment] [-s size] -i index [-f flags] geom" + "-i index [-a alignment] [-s size] [-f flags] geom" }, { "restore", 0, gpart_restore, { { 'F', "force", NULL, G_TYPE_BOOL }, Modified: projects/largeSMP/sbin/geom/class/part/gpart.8 ============================================================================== --- projects/largeSMP/sbin/geom/class/part/gpart.8 Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sbin/geom/class/part/gpart.8 Fri May 27 16:09:10 2011 (r222364) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 03, 2011 +.Dd May 27, 2011 .Dt GPART 8 .Os .Sh NAME @@ -170,7 +170,8 @@ utility: .\" ==== SHOW ==== .Nm .Cm show -.Op Fl lrp +.Op Fl l | Fl r +.Op Fl p .Op Ar geom ... .\" ==== UNDO ==== .Nm @@ -841,6 +842,33 @@ partition that would contain UFS where t /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed .Pp +Create MBR scheme on +.Pa ada0 , +then create 30GB-sized FreeBSD slice, mark it active and +install boot0 boot manager: +.Bd -literal -offset indent +/sbin/gpart create -s MBR ada0 +/sbin/gpart add -t freebsd -s 30G ada0 +/sbin/gpart set -a active -i 1 ada0 +/sbin/gpart bootcode -b /boot/boot0 ada0 +.Ed +.Pp +Now create BSD scheme (BSD label) with ability to have up to 20 partitions: +.Bd -literal -offset indent +/sbin/gpart create -s BSD -n 20 ada0s1 +.Ed +.Pp +Create 1GB-sized UFS partition and 4GB-sized swap partition: +.Bd -literal -offset indent +/sbin/gpart add -t freebsd-ufs -s 1G ada0s1 +/sbin/gpart add -t freebsd-swap -s 4G ada0s1 +.Ed +.Pp +Install bootstrap code for the BSD label: +.Bd -literal -offset indent +/sbin/gpart bootcode -b /boot/boot ada0s1 +.Ed +.Pp Create VTOC8 scheme on .Pa da0 . .Bd -literal -offset indent Modified: projects/largeSMP/sbin/newfs/newfs.h ============================================================================== --- projects/largeSMP/sbin/newfs/newfs.h Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sbin/newfs/newfs.h Fri May 27 16:09:10 2011 (r222364) @@ -47,8 +47,8 @@ * sectorsize <= DESFRAGSIZE <= DESBLKSIZE * DESBLKSIZE / DESFRAGSIZE <= 8 */ -#define DFL_FRAGSIZE 2048 -#define DFL_BLKSIZE 16384 +#define DFL_FRAGSIZE 4096 +#define DFL_BLKSIZE 32768 /* * Cylinder groups may have up to MAXBLKSPERCG blocks. The actual Modified: projects/largeSMP/share/examples/Makefile ============================================================================== --- projects/largeSMP/share/examples/Makefile Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/share/examples/Makefile Fri May 27 16:09:10 2011 (r222364) @@ -175,6 +175,7 @@ XFILES= BSD_daemon/FreeBSD.pfa \ ses/setobjstat/setobjstat.0 \ ses/srcs/chpmon.c \ ses/srcs/eltsub.c \ + ses/srcs/eltsub.h \ ses/srcs/getencstat.c \ ses/srcs/getnobj.c \ ses/srcs/getobjmap.c \ Modified: projects/largeSMP/share/examples/ses/srcs/eltsub.c ============================================================================== --- projects/largeSMP/share/examples/ses/srcs/eltsub.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/share/examples/ses/srcs/eltsub.c Fri May 27 16:09:10 2011 (r222364) @@ -85,6 +85,9 @@ geteltnm(int type) case SESTYP_KEYPAD: sprintf(rbuf, "Key pad entry device"); break; + case SESTYP_ENCLOSURE: + sprintf(rbuf, "Enclosure"); + break; case SESTYP_SCSIXVR: sprintf(rbuf, "SCSI port/transceiver"); break; @@ -109,6 +112,15 @@ geteltnm(int type) case SESTYP_SUBENC: sprintf(rbuf, "Simple sub-enclosure"); break; + case SESTYP_ARRAY: + sprintf(rbuf, "Array device"); + break; + case SESTYP_SASEXPANDER: + sprintf(rbuf, "SAS Expander"); + break; + case SESTYP_SASCONNECTOR: + sprintf(rbuf, "SAS Connector"); + break; default: (void) sprintf(rbuf, "", type); break; Modified: projects/largeSMP/sys/cam/scsi/scsi_ses.h ============================================================================== --- projects/largeSMP/sys/cam/scsi/scsi_ses.h Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/cam/scsi/scsi_ses.h Fri May 27 16:09:10 2011 (r222364) @@ -101,6 +101,7 @@ typedef struct { #define SESTYP_UPS 0x0b #define SESTYP_DISPLAY 0x0c #define SESTYP_KEYPAD 0x0d +#define SESTYP_ENCLOSURE 0x0e #define SESTYP_SCSIXVR 0x0f #define SESTYP_LANGUAGE 0x10 #define SESTYP_COMPORT 0x11 @@ -109,6 +110,9 @@ typedef struct { #define SESTYP_SCSI_TGT 0x14 #define SESTYP_SCSI_INI 0x15 #define SESTYP_SUBENC 0x16 +#define SESTYP_ARRAY 0x17 +#define SESTYP_SASEXPANDER 0x18 +#define SESTYP_SASCONNECTOR 0x19 /* * Overall Enclosure Status Modified: projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c ============================================================================== --- projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c Fri May 27 16:09:10 2011 (r222364) @@ -113,8 +113,10 @@ sysevent_add_attr(sysevent_attr_list_t * } break; default: +#if 0 printf("%s: type %d is not implemented\n", __func__, se_value->value_type); +#endif break; } @@ -286,8 +288,10 @@ log_sysevent(sysevent_t *evp, int flag, break; } default: +#if 0 printf("%s: type %d is not implemented\n", __func__, nvpair_type(elem)); +#endif break; } } Modified: projects/largeSMP/sys/conf/files ============================================================================== --- projects/largeSMP/sys/conf/files Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/conf/files Fri May 27 16:09:10 2011 (r222364) @@ -604,6 +604,9 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ dev/ath/ath_hal/ah_eeprom_v4k.c \ optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/ath_hal/ah_eeprom_9287.c \ + optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # ar5210 @@ -651,111 +654,128 @@ dev/ath/ath_hal/ar5211/ar5211_xmit.c op # ar5212 dev/ath/ath_hal/ar5212/ar5212_ani.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_attach.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_beacon.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_eeprom.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_gpio.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_interrupts.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_keycache.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_misc.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_phy.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_power.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_recv.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_reset.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_rfgain.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_xmit.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar5416 (depends on ar5212) dev/ath/ath_hal/ar5416/ar5416_ani.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_attach.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_beacon.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_eeprom.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_gpio.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_interrupts.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_keycache.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_misc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_phy.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_power.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_recv.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_reset.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_xmit.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130 dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_hal | ath_ar9130 \ @@ -786,6 +806,16 @@ dev/ath/ath_hal/ar9002/ar9285_phy.c opti compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285_diversity.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +# ar9287 (depends on ar5416) +dev/ath/ath_hal/ar9002/ar9287_attach.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_reset.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_cal.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" + # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" @@ -807,6 +837,8 @@ dev/ath/ath_hal/ar9002/ar9280.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c Fri May 27 16:09:10 2011 (r222364) @@ -87,10 +87,8 @@ ar9285_check_div_comb(struct ath_hal *ah HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader; -#if 0 /* For now, simply disable this until it's better debugged. -adrian */ return AH_FALSE; -#endif if (! AR_SREV_KITE(ah)) return AH_FALSE; Modified: projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c ============================================================================== --- projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/dev/ath/ath_hal/ar9002/ar9287.c Fri May 27 16:09:10 2011 (r222364) @@ -36,7 +36,7 @@ struct ar9287State { RF_HAL_FUNCS base; /* public state, must be first */ uint16_t pcdacTable[1]; /* XXX */ }; -#define AR9280(ah) ((struct ar9287State *) AH5212(ah)->ah_rfHal) +#define AR9287(ah) ((struct ar9287State *) AH5212(ah)->ah_rfHal) static HAL_BOOL ar9287GetChannelMaxMinPower(struct ath_hal *, const struct ieee80211_channel *, int16_t *maxPow,int16_t *minPow); Modified: projects/largeSMP/sys/dev/puc/pucdata.c ============================================================================== --- projects/largeSMP/sys/dev/puc/pucdata.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/dev/puc/pucdata.c Fri May 27 16:09:10 2011 (r222364) @@ -1292,6 +1292,12 @@ puc_config_timedia(struct puc_softc *sc, uint16_t subdev; switch (cmd) { + case PUC_CFG_GET_CLOCK: + if (port < 2) + *res = DEFAULT_RCLK * 8; + else + *res = DEFAULT_RCLK; + return (0); case PUC_CFG_GET_DESC: snprintf(desc, sizeof(desc), "Timedia technology %d Port Serial", (int)sc->sc_cfg_data); Modified: projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/fs/nfsclient/nfs_clvfsops.c Fri May 27 16:09:10 2011 (r222364) @@ -1458,10 +1458,20 @@ nfs_sync(struct mount *mp, int waitfor) td = curthread; + MNT_ILOCK(mp); + /* + * If a forced dismount is in progress, return from here so that + * the umount(2) syscall doesn't get stuck in VFS_SYNC() before + * calling VFS_UNMOUNT(). + */ + if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) { + MNT_IUNLOCK(mp); + return (EBADF); + } + /* * Force stale buffer cache information to be flushed. */ - MNT_ILOCK(mp); loop: MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); Modified: projects/largeSMP/sys/geom/part/g_part_mbr.c ============================================================================== --- projects/largeSMP/sys/geom/part/g_part_mbr.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/geom/part/g_part_mbr.c Fri May 27 16:09:10 2011 (r222364) @@ -423,12 +423,13 @@ g_part_mbr_read(struct g_part_table *bas struct g_part_mbr_table *table; struct g_part_mbr_entry *entry; u_char *buf, *p; - off_t chs, msize; + off_t chs, msize, first; u_int sectors, heads; int error, index; pp = cp->provider; table = (struct g_part_mbr_table *)basetable; + first = basetable->gpt_sectors; msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); buf = g_read_data(cp, 0L, pp->sectorsize, &error); @@ -461,7 +462,8 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_heads = heads; } } - + if (ent.dp_start < first) + first = ent.dp_start; entry = (struct g_part_mbr_entry *)g_part_new_entry(basetable, index + 1, ent.dp_start, ent.dp_start + ent.dp_size - 1); entry->ent = ent; @@ -471,6 +473,9 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - 1; + if (first < basetable->gpt_first) + basetable->gpt_first = 1; + g_free(buf); return (0); } Modified: projects/largeSMP/sys/kern/kern_sig.c ============================================================================== --- projects/largeSMP/sys/kern/kern_sig.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/kern/kern_sig.c Fri May 27 16:09:10 2011 (r222364) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3173,14 +3174,15 @@ coredump(struct thread *td) * if it is larger than the limit. */ limit = (off_t)lim_cur(p, RLIMIT_CORE); - PROC_UNLOCK(p); - if (limit == 0) { + if (limit == 0 || racct_get_available(p, RACCT_CORE) == 0) { + PROC_UNLOCK(p); #ifdef AUDIT audit_proc_coredump(td, name, EFBIG); #endif free(name, M_TEMP); return (EFBIG); } + PROC_UNLOCK(p); restart: NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td); Modified: projects/largeSMP/sys/modules/ath/Makefile ============================================================================== --- projects/largeSMP/sys/modules/ath/Makefile Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/modules/ath/Makefile Fri May 27 16:09:10 2011 (r222364) @@ -116,6 +116,12 @@ SRCS+= ar9280.c ar9280_attach.c ar9280_o SRCS+= ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c SRCS+= ar9285_diversity.c +# + AR9287 - Kiwi +.PATH: ${.CURDIR}/../../dev/ath/ath_hal +SRCS+= ah_eeprom_9287.c +.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002 +SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c + # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" .PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample Modified: projects/largeSMP/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- projects/largeSMP/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri May 27 16:09:10 2011 (r222364) @@ -554,8 +554,8 @@ void ipoib_cm_handle_rx_wc(struct ipoib_ ipoib_dma_mb(priv, mb, wc->byte_len); - ++dev->if_opackets; - dev->if_obytes += mb->m_pkthdr.len; + ++dev->if_ipackets; + dev->if_ibytes += mb->m_pkthdr.len; mb->m_pkthdr.rcvif = dev; proto = *mtod(mb, uint16_t *); Modified: projects/largeSMP/sys/powerpc/booke/platform_bare.c ============================================================================== --- projects/largeSMP/sys/powerpc/booke/platform_bare.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/powerpc/booke/platform_bare.c Fri May 27 16:09:10 2011 (r222364) @@ -166,8 +166,11 @@ bare_timebase_freq(platform_t plat, stru phandle_t cpus, child; pcell_t freq; - /* Backward compatibility. See 8-STABLE. */ - ticks = bootinfo[3] >> 3; + if (bootinfo != NULL) { + /* Backward compatibility. See 8-STABLE. */ + ticks = bootinfo[3] >> 3; + } else + ticks = 0; if ((cpus = OF_finddevice("/cpus")) == 0) goto out; Modified: projects/largeSMP/sys/powerpc/include/spr.h ============================================================================== --- projects/largeSMP/sys/powerpc/include/spr.h Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/powerpc/include/spr.h Fri May 27 16:09:10 2011 (r222364) @@ -644,8 +644,8 @@ #define SPR_MCSRR1 0x23b /* ..8 571 Machine check SRR1 */ #define SPR_SVR 0x3ff /* ..8 1023 System Version Register */ -#define SVR_MPC8533 0x803c -#define SVR_MPC8533E 0x8034 +#define SVR_MPC8533 0x8034 +#define SVR_MPC8533E 0x803c #define SVR_MPC8541 0x8072 #define SVR_MPC8541E 0x807a #define SVR_MPC8548 0x8031 @@ -654,6 +654,14 @@ #define SVR_MPC8555E 0x8079 #define SVR_MPC8572 0x80e0 #define SVR_MPC8572E 0x80e8 +#define SVR_P1011 0x80e5 +#define SVR_P1011E 0x80ed +#define SVR_P1020 0x80e4 +#define SVR_P1020E 0x80ec +#define SVR_P2010 0x80e3 +#define SVR_P2010E 0x80eb +#define SVR_P2020 0x80e2 +#define SVR_P2020E 0x80ea #define SVR_VER(svr) (((svr) >> 16) & 0xffff) #define SPR_PID0 0x030 /* ..8 Process ID Register 0 */ Modified: projects/largeSMP/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- projects/largeSMP/sys/ufs/ffs/ffs_alloc.c Fri May 27 16:01:51 2011 (r222363) +++ projects/largeSMP/sys/ufs/ffs/ffs_alloc.c Fri May 27 16:09:10 2011 (r222364) @@ -1873,10 +1873,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size /* devvp is a normal disk device */ dev = devvp->v_rdev; cgblkno = fsbtodb(fs, cgtod(fs, cg)); - ASSERT_VOP_LOCKED(devvp, "ffs_blkfree"); - if ((devvp->v_vflag & VV_COPYONWRITE) && - ffs_snapblkfree(fs, devvp, bno, size, inum)) - return; + ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg"); } #ifdef INVARIANTS if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0 || @@ -2030,6 +2027,17 @@ ffs_blkfree(ump, fs, devvp, bno, size, i struct bio *bip; struct ffs_blkfree_trim_params *tp; + /* + * Check to see if a snapshot wants to claim the block. + * Check that devvp is a normal disk device, not a snapshot, + * it has a snapshot(s) associated with it, and one of the + * snapshots wants to claim the block. + */ + if (devvp->v_type != VREG && + (devvp->v_vflag & VV_COPYONWRITE) && + ffs_snapblkfree(fs, devvp, bno, size, inum)) { + return; + } if (!ump->um_candelete) { ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); return; Copied: projects/largeSMP/tools/regression/bin/sh/expansion/ifs4.0 (from r222363, head/tools/regression/bin/sh/expansion/ifs4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/largeSMP/tools/regression/bin/sh/expansion/ifs4.0 Fri May 27 16:09:10 2011 (r222364, copy of r222363, head/tools/regression/bin/sh/expansion/ifs4.0) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +c=: e= s=' ' +failures='' +ok='' + +check_result() { + if [ "x$2" = "x$3" ]; then + ok=x$ok + else + failures=x$failures + echo "For $1, expected $3 actual $2" + fi +} + +IFS=' +' +set -- a b '' c +set -- $@ +check_result 'set -- $@' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()" + +IFS='' +set -- a b '' c +set -- $@ +check_result 'set -- $@' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()" + +set -- a b '' c +set -- $* +check_result 'set -- $*' "($#)($1)($2)($3)($4)" "(3)(a)(b)(c)()" + +set -- a b '' c +set -- "$@" +check_result 'set -- "$@"' "($#)($1)($2)($3)($4)" "(4)(a)(b)()(c)" + +set -- a b '' c +set -- "$*" +check_result 'set -- "$*"' "($#)($1)($2)($3)($4)" "(1)(abc)()()()" + +test "x$failures" = x From owner-svn-src-projects@FreeBSD.ORG Fri May 27 17:47:20 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333C41065672; Fri, 27 May 2011 17:47:20 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2321A8FC29; Fri, 27 May 2011 17:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RHlKKY045753; Fri, 27 May 2011 17:47:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RHlKIG045751; Fri, 27 May 2011 17:47:20 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201105271747.p4RHlKIG045751@svn.freebsd.org> From: Andreas Tobler Date: Fri, 27 May 2011 17:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222366 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 17:47:20 -0000 Author: andreast Date: Fri May 27 17:47:19 2011 New Revision: 222366 URL: http://svn.freebsd.org/changeset/base/222366 Log: Fix non SMP build. Modified: projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Fri May 27 16:17:35 2011 (r222365) +++ projects/pseries/powerpc/pseries/platform_chrp.c Fri May 27 17:47:19 2011 (r222366) @@ -300,7 +300,9 @@ chrp_smp_start_cpu(platform_t plat, stru return (ENXIO); } +#ifdef SMP ap_pcpu = pc; +#endif powerpc_sync(); result = rtas_call_method(start_cpu, 3, 1, pc->pc_cpuid, EXC_RST, pc, From owner-svn-src-projects@FreeBSD.ORG Fri May 27 19:02:38 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B44B1106564A; Fri, 27 May 2011 19:02:38 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF878FC14; Fri, 27 May 2011 19:02:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RJ2chF048366; Fri, 27 May 2011 19:02:38 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RJ2cOI048342; Fri, 27 May 2011 19:02:38 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201105271902.p4RJ2cOI048342@svn.freebsd.org> From: Andreas Tobler Date: Fri, 27 May 2011 19:02:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222373 - in projects/pseries: amd64/amd64 amd64/include cam/scsi cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/openso... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 19:02:38 -0000 Author: andreast Date: Fri May 27 19:02:37 2011 New Revision: 222373 URL: http://svn.freebsd.org/changeset/base/222373 Log: MFC Added: projects/pseries/dev/ath/ath_hal/ar9002/ar9287.c - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287.h projects/pseries/dev/ath/ath_hal/ar9002/ar9287.ini - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287.ini projects/pseries/dev/ath/ath_hal/ar9002/ar9287_attach.c - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287_cal.c - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287_cal.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_cal.h projects/pseries/dev/ath/ath_hal/ar9002/ar9287_olc.c - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287_olc.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_olc.h projects/pseries/dev/ath/ath_hal/ar9002/ar9287_reset.c - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c projects/pseries/dev/ath/ath_hal/ar9002/ar9287_reset.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.h projects/pseries/dev/ath/ath_hal/ar9002/ar9287an.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287an.h projects/pseries/dev/ath/ath_hal/ar9002/ar9287phy.h - copied unchanged from r222369, head/sys/dev/ath/ath_hal/ar9002/ar9287phy.h Modified: projects/pseries/amd64/amd64/identcpu.c projects/pseries/amd64/include/specialreg.h projects/pseries/cam/scsi/scsi_ses.h projects/pseries/cddl/compat/opensolaris/kern/opensolaris_sysevent.c projects/pseries/cddl/compat/opensolaris/kern/opensolaris_taskq.c projects/pseries/cddl/compat/opensolaris/sys/taskq.h projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c projects/pseries/cddl/dev/cyclic/cyclic.c projects/pseries/cddl/dev/cyclic/i386/cyclic_machdep.c projects/pseries/conf/files projects/pseries/conf/kern.mk projects/pseries/conf/kern.post.mk projects/pseries/conf/kmod.mk projects/pseries/conf/newvers.sh projects/pseries/dev/acpica/acpi_hpet.c projects/pseries/dev/acpica/acpi_timer.c projects/pseries/dev/ahci/ahci.c projects/pseries/dev/ahci/ahci.h projects/pseries/dev/alc/if_alcreg.h projects/pseries/dev/ale/if_alereg.h projects/pseries/dev/ath/ah_osdep.c projects/pseries/dev/ath/ath_hal/ah.c projects/pseries/dev/ath/ath_hal/ah.h projects/pseries/dev/ath/ath_hal/ah_devid.h projects/pseries/dev/ath/ath_hal/ah_eeprom.h projects/pseries/dev/ath/ath_hal/ah_eeprom_9287.c projects/pseries/dev/ath/ath_hal/ah_internal.h projects/pseries/dev/ath/ath_hal/ar5212/ar5212.h projects/pseries/dev/ath/ath_hal/ar5212/ar5212_attach.c projects/pseries/dev/ath/ath_hal/ar5212/ar5212_misc.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_ani.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_attach.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_cal.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416_xmit.c projects/pseries/dev/ath/ath_hal/ar5416/ar5416desc.h projects/pseries/dev/ath/ath_hal/ar5416/ar5416phy.h projects/pseries/dev/ath/ath_hal/ar5416/ar5416reg.h projects/pseries/dev/ath/ath_hal/ar9001/ar9160_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9280_attach.c projects/pseries/dev/ath/ath_hal/ar9002/ar9285_attach.c projects/pseries/dev/ath/ath_rate/sample/sample.c projects/pseries/dev/ath/if_athvar.h projects/pseries/dev/atkbdc/atkbd.c projects/pseries/dev/atkbdc/atkbdreg.h projects/pseries/dev/cfi/cfi_dev.c projects/pseries/dev/cxgbe/t4_main.c projects/pseries/dev/cxgbe/t4_sge.c projects/pseries/dev/gem/if_gem.c projects/pseries/dev/hwpmc/hwpmc_mod.c projects/pseries/dev/msk/if_msk.c projects/pseries/dev/msk/if_mskreg.h projects/pseries/dev/mvs/mvs.c projects/pseries/dev/pci/pcireg.h projects/pseries/dev/puc/pucdata.c projects/pseries/dev/siis/siis.c projects/pseries/dev/sound/pci/hda/hdac.c projects/pseries/dev/sound/usb/uaudio.c projects/pseries/dev/uart/uart_dev_ns8250.c projects/pseries/dev/usb/controller/xhci_pci.c projects/pseries/dev/usb/controller/xhcireg.h projects/pseries/dev/usb/input/uhid.c projects/pseries/dev/usb/input/ukbd.c projects/pseries/dev/usb/input/ums.c projects/pseries/dev/usb/storage/umass.c projects/pseries/dev/usb/storage/ustorage_fs.c projects/pseries/dev/usb/usb_device.c projects/pseries/dev/usb/usbdi.h projects/pseries/dev/vge/if_vge.c projects/pseries/fs/cd9660/cd9660_vfsops.c projects/pseries/fs/ext2fs/ext2_vfsops.c projects/pseries/fs/hpfs/hpfs_vfsops.c projects/pseries/fs/msdosfs/msdosfs_vfsops.c projects/pseries/fs/nfs/nfs_var.h projects/pseries/fs/nfsclient/nfs_clrpcops.c projects/pseries/fs/nfsclient/nfs_clvfsops.c projects/pseries/fs/nfsclient/nfs_clvnops.c projects/pseries/fs/nfsserver/nfs_nfsdport.c projects/pseries/fs/ntfs/ntfs_vfsops.c projects/pseries/fs/nullfs/null_vfsops.c projects/pseries/fs/tmpfs/tmpfs_vfsops.c projects/pseries/fs/udf/udf_vfsops.c projects/pseries/fs/unionfs/union_vfsops.c projects/pseries/geom/gate/g_gate.c projects/pseries/geom/part/g_part.c projects/pseries/geom/part/g_part_ebr.c projects/pseries/geom/part/g_part_mbr.c projects/pseries/geom/part/g_part_pc98.c projects/pseries/geom/vinum/geom_vinum_drive.c projects/pseries/geom/vinum/geom_vinum_events.c projects/pseries/gnu/fs/reiserfs/reiserfs_vfsops.c projects/pseries/gnu/fs/xfs/FreeBSD/support/kdb.c projects/pseries/gnu/fs/xfs/FreeBSD/xfs_mountops.c projects/pseries/i386/i386/identcpu.c projects/pseries/i386/include/specialreg.h projects/pseries/i386/include/xen/xenvar.h projects/pseries/i386/xen/mp_machdep.c projects/pseries/kern/device_if.m projects/pseries/kern/kern_clocksource.c projects/pseries/kern/kern_conf.c projects/pseries/kern/kern_cpuset.c projects/pseries/kern/kern_environment.c projects/pseries/kern/kern_sig.c projects/pseries/kern/kern_synch.c projects/pseries/kern/sched_4bsd.c projects/pseries/kern/subr_sbuf.c projects/pseries/kern/subr_smp.c projects/pseries/kern/vfs_bio.c projects/pseries/kern/vfs_default.c projects/pseries/kern/vfs_syscalls.c projects/pseries/mips/include/atomic.h projects/pseries/modules/ath/Makefile projects/pseries/modules/wlan/Makefile projects/pseries/net/if_epair.c projects/pseries/net/if_llatbl.c projects/pseries/net/if_llatbl.h projects/pseries/net/netisr.c projects/pseries/net/netisr.h projects/pseries/net/netisr_internal.h projects/pseries/net80211/ieee80211_var.h projects/pseries/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/pseries/netgraph/ng_eiface.c projects/pseries/netgraph/ng_pipe.c projects/pseries/netinet/in.c projects/pseries/netinet/in_pcb.c projects/pseries/netinet/in_pcb.h projects/pseries/netinet/in_proto.c projects/pseries/netinet/in_var.h projects/pseries/netinet/raw_ip.c projects/pseries/netinet/sctp_output.c projects/pseries/netinet/sctp_usrreq.c projects/pseries/netinet6/in6.c projects/pseries/netinet6/in6_pcb.c projects/pseries/netinet6/in6_proto.c projects/pseries/netinet6/in6_src.c projects/pseries/nfsclient/nfs_vfsops.c projects/pseries/nfsclient/nfs_vnops.c projects/pseries/nfsserver/nfs_srvsubs.c projects/pseries/nlm/nlm_prot_impl.c projects/pseries/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c projects/pseries/powerpc/aim/trap_subr64.S projects/pseries/powerpc/booke/platform_bare.c projects/pseries/powerpc/include/atomic.h projects/pseries/powerpc/include/spr.h projects/pseries/powerpc/ps3/ps3bus.c projects/pseries/sys/dtrace_bsd.h projects/pseries/sys/mount.h projects/pseries/sys/param.h projects/pseries/sys/proc.h projects/pseries/sys/sbuf.h projects/pseries/sys/smp.h projects/pseries/ufs/ffs/ffs_alloc.c projects/pseries/ufs/ffs/ffs_vfsops.c projects/pseries/ufs/ufs/ufs_extern.h projects/pseries/ufs/ufs/ufs_vfsops.c projects/pseries/vm/uma_core.c projects/pseries/vm/uma_int.h Directory Properties: projects/pseries/ (props changed) projects/pseries/amd64/include/xen/ (props changed) projects/pseries/boot/ (props changed) projects/pseries/boot/i386/efi/ (props changed) projects/pseries/boot/ia64/efi/ (props changed) projects/pseries/boot/ia64/ski/ (props changed) projects/pseries/boot/powerpc/boot1.chrp/ (props changed) projects/pseries/boot/powerpc/ofw/ (props changed) projects/pseries/cddl/contrib/opensolaris/ (props changed) projects/pseries/conf/ (props changed) projects/pseries/contrib/dev/acpica/ (props changed) projects/pseries/contrib/octeon-sdk/ (props changed) projects/pseries/contrib/pf/ (props changed) projects/pseries/contrib/x86emu/ (props changed) Modified: projects/pseries/amd64/amd64/identcpu.c ============================================================================== --- projects/pseries/amd64/amd64/identcpu.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/amd64/amd64/identcpu.c Fri May 27 19:02:37 2011 (r222373) @@ -216,6 +216,14 @@ printcpuinfo(void) printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); printf(" Stepping = %u", cpu_id & CPUID_STEPPING); + + /* + * AMD CPUID Specification + * http://support.amd.com/us/Embedded_TechDocs/25481.pdf + * + * Intel Processor Identification and CPUID Instruction + * http://www.intel.com/assets/pdf/appnote/241618.pdf + */ if (cpu_high > 0) { /* @@ -277,38 +285,29 @@ printcpuinfo(void) "\012SSSE3" /* SSSE3 */ "\013CNXT-ID" /* L1 context ID available */ "\014" - "\015" + "\015FMA" /* Fused Multiply Add */ "\016CX16" /* CMPXCHG16B Instruction */ "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022PCID" /* Process-context Identifiers */ + "\022PCID" /* Process-context Identifiers*/ "\023DCA" /* Direct Cache Access */ - "\024SSE4.1" - "\025SSE4.2" + "\024SSE4.1" /* SSE 4.1 */ + "\025SSE4.2" /* SSE 4.2 */ "\026x2APIC" /* xAPIC Extensions */ - "\027MOVBE" - "\030POPCNT" - "\031" - "\032AESNI" /* AES Crypto*/ - "\033XSAVE" - "\034OSXSAVE" - "\035" - "\036" + "\027MOVBE" /* MOVBE Instruction */ + "\030POPCNT" /* POPCNT Instruction */ + "\031TSCDLT" /* TSC-Deadline Timer */ + "\032AESNI" /* AES Crypto */ + "\033XSAVE" /* XSAVE/XRSTOR States */ + "\034OSXSAVE" /* OS-Enabled State Management*/ + "\035AVX" /* Advanced Vector Extensions */ + "\036F16C" /* Half-precision conversions */ "\037" "\040HV" /* Hypervisor */ ); } - /* - * AMD64 Architecture Programmer's Manual Volume 3: - * General-Purpose and System Instructions - * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf - * - * IA-32 Intel Architecture Software Developer's Manual, - * Volume 2A: Instruction Set Reference, A-M - * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf - */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -361,18 +360,18 @@ printcpuinfo(void) "\011Prefetch" /* 3DNow! Prefetch/PrefetchW */ "\012OSVW" /* OS visible workaround */ "\013IBS" /* Instruction based sampling */ - "\014SSE5" /* SSE5 */ + "\014XOP" /* XOP extended instructions */ "\015SKINIT" /* SKINIT/STGI */ "\016WDT" /* Watchdog timer */ "\017" - "\020" - "\021" + "\020LWP" /* Lightweight Profiling */ + "\021FMA4" /* 4-operand FMA instructions */ "\022" "\023" - "\024" + "\024NodeId" /* NodeId MSR support */ "\025" - "\026" - "\027" + "\026TBM" /* Trailing Bit Manipulation */ + "\027Topology" /* Topology Extensions */ "\030" "\031" "\032" Modified: projects/pseries/amd64/include/specialreg.h ============================================================================== --- projects/pseries/amd64/include/specialreg.h Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/amd64/include/specialreg.h Fri May 27 19:02:37 2011 (r222373) @@ -123,6 +123,7 @@ #define CPUID2_TM2 0x00000100 #define CPUID2_SSSE3 0x00000200 #define CPUID2_CNXTID 0x00000400 +#define CPUID2_FMA 0x00001000 #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 @@ -133,7 +134,12 @@ #define CPUID2_X2APIC 0x00200000 #define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 +#define CPUID2_TSCDLT 0x01000000 #define CPUID2_AESNI 0x02000000 +#define CPUID2_XSAVE 0x04000000 +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define CPUID2_F16C 0x20000000 #define CPUID2_HV 0x80000000 /* @@ -170,9 +176,14 @@ #define AMDID2_PREFETCH 0x00000100 #define AMDID2_OSVW 0x00000200 #define AMDID2_IBS 0x00000400 -#define AMDID2_SSE5 0x00000800 +#define AMDID2_XOP 0x00000800 #define AMDID2_SKINIT 0x00001000 #define AMDID2_WDT 0x00002000 +#define AMDID2_LWP 0x00008000 +#define AMDID2_FMA4 0x00010000 +#define AMDID2_NODE_ID 0x00080000 +#define AMDID2_TBM 0x00200000 +#define AMDID2_TOPOLOGY 0x00400000 /* * CPUID instruction 1 eax info Modified: projects/pseries/cam/scsi/scsi_ses.h ============================================================================== --- projects/pseries/cam/scsi/scsi_ses.h Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cam/scsi/scsi_ses.h Fri May 27 19:02:37 2011 (r222373) @@ -101,6 +101,7 @@ typedef struct { #define SESTYP_UPS 0x0b #define SESTYP_DISPLAY 0x0c #define SESTYP_KEYPAD 0x0d +#define SESTYP_ENCLOSURE 0x0e #define SESTYP_SCSIXVR 0x0f #define SESTYP_LANGUAGE 0x10 #define SESTYP_COMPORT 0x11 @@ -109,6 +110,9 @@ typedef struct { #define SESTYP_SCSI_TGT 0x14 #define SESTYP_SCSI_INI 0x15 #define SESTYP_SUBENC 0x16 +#define SESTYP_ARRAY 0x17 +#define SESTYP_SASEXPANDER 0x18 +#define SESTYP_SASCONNECTOR 0x19 /* * Overall Enclosure Status Modified: projects/pseries/cddl/compat/opensolaris/kern/opensolaris_sysevent.c ============================================================================== --- projects/pseries/cddl/compat/opensolaris/kern/opensolaris_sysevent.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/compat/opensolaris/kern/opensolaris_sysevent.c Fri May 27 19:02:37 2011 (r222373) @@ -113,8 +113,10 @@ sysevent_add_attr(sysevent_attr_list_t * } break; default: +#if 0 printf("%s: type %d is not implemented\n", __func__, se_value->value_type); +#endif break; } @@ -286,8 +288,10 @@ log_sysevent(sysevent_t *evp, int flag, break; } default: +#if 0 printf("%s: type %d is not implemented\n", __func__, nvpair_type(elem)); +#endif break; } } Modified: projects/pseries/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- projects/pseries/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri May 27 19:02:37 2011 (r222373) @@ -147,9 +147,7 @@ taskq_run_safe(void *arg, int pending __ { struct ostask *task = arg; - ASSERT(task->ost_magic == TASKQ_MAGIC); task->ost_func(task->ost_arg); - task->ost_magic = 0; } taskqid_t @@ -158,15 +156,12 @@ taskq_dispatch_safe(taskq_t *tq, task_fu { int prio; - ASSERT(task->ost_magic != TASKQ_MAGIC); - /* * If TQ_FRONT is given, we want higher priority for this task, so it * can go at the front of the queue. */ prio = !!(flags & TQ_FRONT); - task->ost_magic = TASKQ_MAGIC; task->ost_func = func; task->ost_arg = arg; Modified: projects/pseries/cddl/compat/opensolaris/sys/taskq.h ============================================================================== --- projects/pseries/cddl/compat/opensolaris/sys/taskq.h Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/compat/opensolaris/sys/taskq.h Fri May 27 19:02:37 2011 (r222373) @@ -35,7 +35,6 @@ struct ostask { struct task ost_task; task_func_t *ost_func; void *ost_arg; - int ost_magic; }; taskqid_t taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg, Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri May 27 19:02:37 2011 (r222373) @@ -421,8 +421,7 @@ struct zio { #ifdef _KERNEL /* FreeBSD only. */ - struct ostask io_task_issue; - struct ostask io_task_interrupt; + struct ostask io_task; #endif }; Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri May 27 19:02:37 2011 (r222373) @@ -239,15 +239,20 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn return (ENOENT); } if (dl == NULL) { + size_t namesize; + /* * Allocate a new dirlock and add it to the list. */ - dl = kmem_alloc(sizeof (zfs_dirlock_t), KM_SLEEP); + namesize = strlen(name) + 1; + dl = kmem_alloc(sizeof (zfs_dirlock_t) + namesize, + KM_SLEEP); cv_init(&dl->dl_cv, NULL, CV_DEFAULT, NULL); - dl->dl_name = name; + dl->dl_name = (char *)(dl + 1); + bcopy(name, dl->dl_name, namesize); dl->dl_sharecnt = 0; dl->dl_namelock = 0; - dl->dl_namesize = 0; + dl->dl_namesize = namesize; dl->dl_dzp = dzp; dl->dl_next = dzp->z_dirlocks; dzp->z_dirlocks = dl; @@ -264,20 +269,8 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn if (flag & ZHAVELOCK) dl->dl_namelock = 1; - if ((flag & ZSHARED) && ++dl->dl_sharecnt > 1 && dl->dl_namesize == 0) { - /* - * We're the second shared reference to dl. Make a copy of - * dl_name in case the first thread goes away before we do. - * Note that we initialize the new name before storing its - * pointer into dl_name, because the first thread may load - * dl->dl_name at any time. He'll either see the old value, - * which is his, or the new shared copy; either is OK. - */ - dl->dl_namesize = strlen(dl->dl_name) + 1; - name = kmem_alloc(dl->dl_namesize, KM_SLEEP); - bcopy(dl->dl_name, name, dl->dl_namesize); - dl->dl_name = name; - } + if (flag & ZSHARED) + dl->dl_sharecnt++; mutex_exit(&dzp->z_lock); @@ -361,10 +354,8 @@ zfs_dirent_unlock(zfs_dirlock_t *dl) cv_broadcast(&dl->dl_cv); mutex_exit(&dzp->z_lock); - if (dl->dl_namesize != 0) - kmem_free(dl->dl_name, dl->dl_namesize); cv_destroy(&dl->dl_cv); - kmem_free(dl, sizeof (*dl)); + kmem_free(dl, sizeof (*dl) + dl->dl_namesize); } /* Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri May 27 19:02:37 2011 (r222373) @@ -689,6 +689,9 @@ zfs_secpolicy_destroy(zfs_cmd_t *zc, cre * and destroying snapshots requires descendent permissions, a successfull * check of the top level snapshot applies to snapshots of all descendent * datasets as well. + * + * The top level snapshot may not exist when doing a recursive destroy. + * In this case fallback to permissions of the parent dataset. */ static int zfs_secpolicy_destroy_snaps(zfs_cmd_t *zc, cred_t *cr) @@ -700,6 +703,9 @@ zfs_secpolicy_destroy_snaps(zfs_cmd_t *z error = zfs_secpolicy_destroy_perms(dsname, cr); + if (error == ENOENT) + error = zfs_secpolicy_destroy_perms(zc->zc_name, cr); + strfree(dsname); return (error); } Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri May 27 19:02:37 2011 (r222373) @@ -93,7 +93,7 @@ static int zfs_vget(vfs_t *vfsp, ino_t i static int zfs_sync(vfs_t *vfsp, int waitfor); static int zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp, int *numsecflavors, int **secflavors); -static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp); +static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp); static void zfs_objset_close(zfsvfs_t *zfsvfs); static void zfs_freevfs(vfs_t *vfsp); @@ -2007,7 +2007,7 @@ CTASSERT(SHORT_FID_LEN <= sizeof(struct CTASSERT(LONG_FID_LEN <= sizeof(struct fid)); static int -zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp) +zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, int flags, vnode_t **vpp) { zfsvfs_t *zfsvfs = vfsp->vfs_data; znode_t *zp; @@ -2069,7 +2069,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno VN_HOLD(*vpp); } ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + err = zfs_vnode_lock(*vpp, flags | LK_RETRY); if (err != 0) *vpp = NULL; return (err); @@ -2096,7 +2096,7 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno *vpp = ZTOV(zp); ZFS_EXIT(zfsvfs); - err = zfs_vnode_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); + err = zfs_vnode_lock(*vpp, flags | LK_RETRY); if (err == 0) vnode_create_vobject(*vpp, zp->z_size, curthread); else Modified: projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri May 27 19:02:37 2011 (r222373) @@ -1068,19 +1068,9 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ spa_t *spa = zio->io_spa; zio_type_t t = zio->io_type; int flags = TQ_SLEEP | (cutinline ? TQ_FRONT : 0); -#ifdef _KERNEL - struct ostask *task; -#endif ASSERT(q == ZIO_TASKQ_ISSUE || q == ZIO_TASKQ_INTERRUPT); -#ifdef _KERNEL - if (q == ZIO_TASKQ_ISSUE) - task = &zio->io_task_issue; - else /* if (q == ZIO_TASKQ_INTERRUPT) */ - task = &zio->io_task_interrupt; -#endif - /* * If we're a config writer or a probe, the normal issue and * interrupt threads may all be blocked waiting for the config lock. @@ -1105,7 +1095,7 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ ASSERT3U(q, <, ZIO_TASKQ_TYPES); #ifdef _KERNEL (void) taskq_dispatch_safe(spa->spa_zio_taskq[t][q], - (task_func_t *)zio_execute, zio, flags, task); + (task_func_t *)zio_execute, zio, flags, &zio->io_task); #else (void) taskq_dispatch(spa->spa_zio_taskq[t][q], (task_func_t *)zio_execute, zio, flags); @@ -2904,7 +2894,7 @@ zio_done(zio_t *zio) (void) taskq_dispatch_safe( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], (task_func_t *)zio_reexecute, zio, TQ_SLEEP, - &zio->io_task_issue); + &zio->io_task); #else (void) taskq_dispatch( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], Modified: projects/pseries/cddl/dev/cyclic/cyclic.c ============================================================================== --- projects/pseries/cddl/dev/cyclic/cyclic.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/dev/cyclic/cyclic.c Fri May 27 19:02:37 2011 (r222373) @@ -341,6 +341,16 @@ static cyc_backend_t cyclic_backend; MALLOC_DEFINE(M_CYCLIC, "cyclic", "Cyclic timer subsystem"); +static __inline hrtime_t +cyc_gethrtime(void) +{ + struct bintime bt; + + binuptime(&bt); + return ((hrtime_t)bt.sec * NANOSEC + + (((uint64_t)NANOSEC * (uint32_t)(bt.frac >> 32)) >> 32)); +} + /* * Returns 1 if the upheap propagated to the root, 0 if it did not. This * allows the caller to reprogram the backend only when the root has been @@ -507,7 +517,7 @@ cyclic_fire(cpu_t *c) cyc_index_t *heap = cpu->cyp_heap; cyclic_t *cyclic, *cyclics = cpu->cyp_cyclics; void *arg = be->cyb_arg; - hrtime_t now = gethrtime(); + hrtime_t now = cyc_gethrtime(); hrtime_t exp; if (cpu->cyp_nelems == 0) { @@ -687,7 +697,7 @@ cyclic_add_xcall(cyc_xcallarg_t *arg) * If a start time hasn't been explicitly specified, we'll * start on the next interval boundary. */ - cyclic->cy_expire = (gethrtime() / cyclic->cy_interval + 1) * + cyclic->cy_expire = (cyc_gethrtime() / cyclic->cy_interval + 1) * cyclic->cy_interval; } else { cyclic->cy_expire = when->cyt_when; Modified: projects/pseries/cddl/dev/cyclic/i386/cyclic_machdep.c ============================================================================== --- projects/pseries/cddl/dev/cyclic/i386/cyclic_machdep.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/cddl/dev/cyclic/i386/cyclic_machdep.c Fri May 27 19:02:37 2011 (r222373) @@ -30,6 +30,7 @@ static void enable(cyb_arg_t); static void disable(cyb_arg_t); static void reprogram(cyb_arg_t, hrtime_t); static void xcall(cyb_arg_t, cpu_t *, cyc_func_t, void *); +static void cyclic_clock(struct trapframe *frame); static cyc_backend_t be = { NULL, /* cyb_configure */ @@ -45,6 +46,7 @@ static void cyclic_ap_start(void *dummy) { /* Initialise the rest of the CPUs. */ + cyclic_clock_func = cyclic_clock; cyclic_mp_init(); } @@ -63,18 +65,10 @@ cyclic_machdep_init(void) static void cyclic_machdep_uninit(void) { - int i; - - for (i = 0; i <= mp_maxid; i++) - /* Reset the cyclic clock callback hook. */ - cyclic_clock_func[i] = NULL; - /* De-register the cyclic backend. */ cyclic_uninit(); } -static hrtime_t exp_due[MAXCPU]; - /* * This function is the one registered by the machine dependent * initialiser as the callback for high speed timer events. @@ -84,7 +78,7 @@ cyclic_clock(struct trapframe *frame) { cpu_t *c = &solaris_cpu[curcpu]; - if (c->cpu_cyclic != NULL && gethrtime() >= exp_due[curcpu]) { + if (c->cpu_cyclic != NULL) { if (TRAPF_USERMODE(frame)) { c->cpu_profile_pc = 0; c->cpu_profile_upc = TRAPF_PC(frame); @@ -102,26 +96,34 @@ cyclic_clock(struct trapframe *frame) } } -static void enable(cyb_arg_t arg) +static void +enable(cyb_arg_t arg __unused) { - /* Register the cyclic clock callback function. */ - cyclic_clock_func[curcpu] = cyclic_clock; + } -static void disable(cyb_arg_t arg) +static void +disable(cyb_arg_t arg __unused) { - /* Reset the cyclic clock callback function. */ - cyclic_clock_func[curcpu] = NULL; + } -static void reprogram(cyb_arg_t arg, hrtime_t exp) +static void +reprogram(cyb_arg_t arg __unused, hrtime_t exp) { - exp_due[curcpu] = exp; + struct bintime bt; + struct timespec ts; + + ts.tv_sec = exp / 1000000000; + ts.tv_nsec = exp % 1000000000; + timespec2bintime(&ts, &bt); + clocksource_cyc_set(&bt); } -static void xcall(cyb_arg_t arg, cpu_t *c, cyc_func_t func, void *param) +static void xcall(cyb_arg_t arg __unused, cpu_t *c, cyc_func_t func, + void *param) { - smp_rendezvous_cpus((cpumask_t) (1 << c->cpuid), + smp_rendezvous_cpus((cpumask_t)1 << c->cpuid, smp_no_rendevous_barrier, func, smp_no_rendevous_barrier, param); } Modified: projects/pseries/conf/files ============================================================================== --- projects/pseries/conf/files Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/conf/files Fri May 27 19:02:37 2011 (r222373) @@ -604,6 +604,9 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ dev/ath/ath_hal/ah_eeprom_v4k.c \ optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/ath_hal/ah_eeprom_9287.c \ + optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" # ar5210 @@ -651,111 +654,128 @@ dev/ath/ath_hal/ar5211/ar5211_xmit.c op # ar5212 dev/ath/ath_hal/ar5212/ar5212_ani.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_attach.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_beacon.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_eeprom.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_gpio.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_interrupts.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_keycache.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_misc.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_phy.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_power.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_recv.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_reset.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_rfgain.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5212/ar5212_xmit.c \ optional ath_hal | ath_ar5212 | ath_ar5416 | ath_ar9160 | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar5416 (depends on ar5212) dev/ath/ath_hal/ar5416/ar5416_ani.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_attach.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_beacon.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_iq.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcgain.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal_adcdc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_eeprom.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_gpio.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_interrupts.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_keycache.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_misc.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_phy.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_power.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_recv.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_reset.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_xmit.c \ - optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130 dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_hal | ath_ar9130 \ @@ -786,6 +806,16 @@ dev/ath/ath_hal/ar9002/ar9285_phy.c opti compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285_diversity.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +# ar9287 (depends on ar5416) +dev/ath/ath_hal/ar9002/ar9287_attach.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_reset.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_cal.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287_olc.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" + # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" @@ -807,6 +837,8 @@ dev/ath/ath_hal/ar9002/ar9280.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9287.c optional ath_hal | ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" Modified: projects/pseries/conf/kern.mk ============================================================================== --- projects/pseries/conf/kern.mk Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/conf/kern.mk Fri May 27 19:02:37 2011 (r222373) @@ -1,15 +1,12 @@ # $FreeBSD$ # -# Warning flags for compiling the kernel and components of the kernel. +# Warning flags for compiling the kernel and components of the kernel: # -# Note that the newly added -Wcast-qual is responsible for generating -# most of the remaining warnings. Warnings introduced with -Wall will -# also pop up, but are easier to fix. CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ -Wundef -Wno-pointer-sign -fformat-extensions \ - -Wmissing-include-dirs + -Wmissing-include-dirs -fdiagnostics-show-option # # The following flags are next up for working on: # -Wextra Modified: projects/pseries/conf/kern.post.mk ============================================================================== --- projects/pseries/conf/kern.post.mk Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/conf/kern.post.mk Fri May 27 19:02:37 2011 (r222373) @@ -227,7 +227,8 @@ kernel-install: .endif mkdir -p ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} -.if defined(DEBUG) && !defined(INSTALL_NODEBUG) +.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif .if defined(KERNEL_EXTRA_INSTALL) @@ -239,7 +240,8 @@ kernel-install: kernel-reinstall: @-chflags -R noschg ${DESTDIR}${KODIR} ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO} ${DESTDIR}${KODIR} -.if defined(DEBUG) && !defined(INSTALL_NODEBUG) +.if defined(DEBUG) && !defined(INSTALL_NODEBUG) && \ + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -p -m 555 -o ${KMODOWN} -g ${KMODGRP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR} .endif Modified: projects/pseries/conf/kmod.mk ============================================================================== --- projects/pseries/conf/kmod.mk Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/conf/kmod.mk Fri May 27 19:02:37 2011 (r222373) @@ -286,7 +286,8 @@ realinstall: _kmodinstall _kmodinstall: ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR} -.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) +.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && \ + (defined(MK_KERNEL_SYMBOLS) && ${MK_KERNEL_SYMBOLS} != "no") ${INSTALL} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ ${_INSTALLFLAGS} ${PROG}.symbols ${DESTDIR}${KMODDIR} .endif Modified: projects/pseries/conf/newvers.sh ============================================================================== --- projects/pseries/conf/newvers.sh Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/conf/newvers.sh Fri May 27 19:02:37 2011 (r222373) @@ -139,4 +139,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -echo `expr ${v} + 1` > version +echo $((v + 1)) > version Modified: projects/pseries/dev/acpica/acpi_hpet.c ============================================================================== --- projects/pseries/dev/acpica/acpi_hpet.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/dev/acpica/acpi_hpet.c Fri May 27 19:02:37 2011 (r222373) @@ -476,7 +476,7 @@ hpet_attach(device_t dev) sc->tc.tc_get_timecount = hpet_get_timecount, sc->tc.tc_counter_mask = ~0u, sc->tc.tc_name = "HPET", - sc->tc.tc_quality = 900, + sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; tc_init(&sc->tc); Modified: projects/pseries/dev/acpica/acpi_timer.c ============================================================================== --- projects/pseries/dev/acpica/acpi_timer.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/dev/acpica/acpi_timer.c Fri May 27 19:02:37 2011 (r222373) @@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev) if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; - acpi_timer_timecounter.tc_quality = 1000; + acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; Modified: projects/pseries/dev/ahci/ahci.c ============================================================================== --- projects/pseries/dev/ahci/ahci.c Fri May 27 18:59:24 2011 (r222372) +++ projects/pseries/dev/ahci/ahci.c Fri May 27 19:02:37 2011 (r222373) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "ahci.h" @@ -68,6 +69,7 @@ static int ahci_ch_resume(device_t dev); static void ahci_ch_pm(void *arg); static void ahci_ch_intr_locked(void *data); static void ahci_ch_intr(void *data); +static void ahci_ch_led(void *priv, int onoff); static int ahci_ctlr_reset(device_t dev); static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); @@ -117,6 +119,7 @@ static struct { #define AHCI_Q_NOBSYRES 256 #define AHCI_Q_NOAA 512 #define AHCI_Q_NOCOUNT 1024 +#define AHCI_Q_ALTSIG 2048 } ahci_ids[] = { {0x43801002, 0x00, "ATI IXP600", 0}, {0x43901002, 0x00, "ATI IXP700", 0}, @@ -190,8 +193,9 @@ static struct { {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES}, - {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES}, + {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, + {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, {0x06201b4b, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, @@ -396,6 +400,13 @@ ahci_attach(device_t dev) if (ctlr->caps & AHCI_CAP_EMS) ctlr->capsem = ATA_INL(ctlr->r_mem, AHCI_EM_CTL); ctlr->ichannels = ATA_INL(ctlr->r_mem, AHCI_PI); + + /* Identify and set separate quirks for HBA and RAID f/w Marvells. */ + if ((ctlr->quirks & AHCI_Q_NOBSYRES) && + (ctlr->quirks & AHCI_Q_ALTSIG) && + (ctlr->caps & AHCI_CAP_SPM) == 0) + ctlr->quirks &= ~AHCI_Q_NOBSYRES; + if (ctlr->quirks & AHCI_Q_1CH) { ctlr->caps &= ~AHCI_CAP_NPMASK; ctlr->ichannels &= 0x01; @@ -418,6 +429,8 @@ ahci_attach(device_t dev) ctlr->caps &= ~AHCI_CAP_SNCQ; if ((ctlr->caps & AHCI_CAP_CCCS) == 0) ctlr->ccc = 0; + mtx_init(&ctlr->em_mtx, "AHCI EM lock", NULL, MTX_DEF); + ctlr->emloc = ATA_INL(ctlr->r_mem, AHCI_EM_LOC); ahci_ctlr_setup(dev); /* Setup interrupts. */ if (ahci_setup_interrupt(dev)) { @@ -521,6 +534,7 @@ ahci_detach(device_t dev) rman_fini(&ctlr->sc_iomem); if (ctlr->r_mem) bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + mtx_destroy(&ctlr->em_mtx); return (0); } @@ -887,6 +901,7 @@ ahci_ch_attach(device_t dev) struct cam_devq *devq; int rid, error, i, sata_rev = 0; u_int32_t version; + char buf[32]; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -995,6 +1010,25 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, dev); } mtx_unlock(&ch->mtx); + if ((ch->caps & AHCI_CAP_EMS) && + (ctlr->capsem & AHCI_EM_LED)) { + for (i = 0; i < AHCI_NUM_LEDS; i++) { + ch->leds[i].dev = dev; + ch->leds[i].num = i; + } + if ((ctlr->capsem & AHCI_EM_ALHD) == 0) { + snprintf(buf, sizeof(buf), "%s.act", + device_get_nameunit(dev)); + ch->leds[0].led = led_create(ahci_ch_led, + &ch->leds[0], buf); + } + snprintf(buf, sizeof(buf), "%s.locate", + device_get_nameunit(dev)); + ch->leds[1].led = led_create(ahci_ch_led, &ch->leds[1], buf); + snprintf(buf, sizeof(buf), "%s.fault", + device_get_nameunit(dev)); + ch->leds[2].led = led_create(ahci_ch_led, &ch->leds[2], buf); + } return (0); err3: @@ -1014,7 +1048,12 @@ static int ahci_ch_detach(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); + int i; + for (i = 0; i < AHCI_NUM_LEDS; i++) { + if (ch->leds[i].led) + led_destroy(ch->leds[i].led); + } mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); /* Forget about reset. */ @@ -1137,6 +1176,47 @@ static driver_t ahcich_driver = { }; DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, 0, 0); +static void +ahci_ch_setleds(device_t dev) +{ + struct ahci_channel *ch; + struct ahci_controller *ctlr; + size_t buf; + int i, timeout; + int16_t val; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + + val = 0; + for (i = 0; i < AHCI_NUM_LEDS; i++) + val |= ch->leds[i].state << (i * 3); + + buf = (ctlr->emloc & 0xffff0000) >> 14; + mtx_lock(&ctlr->em_mtx); + timeout = 1000; + while (ATA_INL(ctlr->r_mem, AHCI_EM_CTL) & (AHCI_EM_TM | AHCI_EM_RST) && + --timeout > 0) + DELAY(1000); + if (timeout == 0) + device_printf(dev, "EM timeout\n"); + ATA_OUTL(ctlr->r_mem, buf, (1 << 8) | (0 << 16) | (0 << 24)); + ATA_OUTL(ctlr->r_mem, buf + 4, ch->unit | (val << 16)); + ATA_OUTL(ctlr->r_mem, AHCI_EM_CTL, AHCI_EM_TM); + mtx_unlock(&ctlr->em_mtx); +} + +static void +ahci_ch_led(void *priv, int onoff) +{ + struct ahci_led *led; + + led = (struct ahci_led *)priv; + + led->state = onoff; + ahci_ch_setleds(led->dev); +} + struct ahci_dc_cb_args { bus_addr_t maddr; int error; @@ -1693,7 +1773,7 @@ ahci_execute_transaction(struct ahci_slo struct ahci_cmd_list *clp; union ccb *ccb = slot->ccb; int port = ccb->ccb_h.target_id & 0x0f; - int fis_size, i; + int fis_size, i, softreset; uint8_t *fis = ch->dma.rfis + 0x40; uint8_t val; @@ -1720,17 +1800,20 @@ ahci_execute_transaction(struct ahci_slo if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { if (ccb->ataio.cmd.control & ATA_A_RESET) { + softreset = 1; /* Kick controller into sane state */ ahci_stop(dev); ahci_clo(dev); ahci_start(dev, 0); clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; } else { + softreset = 2; /* Prepare FIS receive area for check. */ for (i = 0; i < 20; i++) fis[i] = 0xff; } - } + } else + softreset = 0; clp->bytecount = 0; clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); @@ -1754,8 +1837,7 @@ ahci_execute_transaction(struct ahci_slo ATA_OUTL(ch->r_mem, AHCI_P_CI, (1 << slot->slot)); /* Device reset commands doesn't interrupt. Poll them. */ if (ccb->ccb_h.func_code == XPT_ATA_IO && - (ccb->ataio.cmd.command == ATA_DEVICE_RESET || - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL))) { + (ccb->ataio.cmd.command == ATA_DEVICE_RESET || softreset)) { int count, timeout = ccb->ccb_h.timeout * 100; enum ahci_err_type et = AHCI_ERR_NONE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri May 27 19:06:04 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF9A106566C; Fri, 27 May 2011 19:06:04 +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 049C48FC1D; Fri, 27 May 2011 19:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RJ63Jw048603; Fri, 27 May 2011 19:06:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RJ63FL048601; Fri, 27 May 2011 19:06:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105271906.p4RJ63FL048601@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 27 May 2011 19:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222376 - projects/pseries/powerpc/pseries X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 19:06:04 -0000 Author: nwhitehorn Date: Fri May 27 19:06:03 2011 New Revision: 222376 URL: http://svn.freebsd.org/changeset/base/222376 Log: Expand the #ifdefs in the non-SMP case. Modified: projects/pseries/powerpc/pseries/platform_chrp.c Modified: projects/pseries/powerpc/pseries/platform_chrp.c ============================================================================== --- projects/pseries/powerpc/pseries/platform_chrp.c Fri May 27 19:05:01 2011 (r222375) +++ projects/pseries/powerpc/pseries/platform_chrp.c Fri May 27 19:06:03 2011 (r222376) @@ -68,8 +68,8 @@ static u_long chrp_timebase_freq(platfor static int chrp_smp_first_cpu(platform_t, struct cpuref *cpuref); static int chrp_smp_next_cpu(platform_t, struct cpuref *cpuref); static int chrp_smp_get_bsp(platform_t, struct cpuref *cpuref); -static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); #ifdef SMP +static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); static struct cpu_group *chrp_smp_topo(platform_t plat); #endif static void chrp_reset(platform_t); @@ -84,8 +84,8 @@ static platform_method_t chrp_methods[] PLATFORMMETHOD(platform_smp_first_cpu, chrp_smp_first_cpu), PLATFORMMETHOD(platform_smp_next_cpu, chrp_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, chrp_smp_get_bsp), - PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), #ifdef SMP + PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), PLATFORMMETHOD(platform_smp_topo, chrp_smp_topo), #endif @@ -281,6 +281,7 @@ chrp_smp_get_bsp(platform_t plat, struct return (0); } +#ifdef SMP static int chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) { @@ -300,9 +301,7 @@ chrp_smp_start_cpu(platform_t plat, stru return (ENXIO); } -#ifdef SMP ap_pcpu = pc; -#endif powerpc_sync(); result = rtas_call_method(start_cpu, 3, 1, pc->pc_cpuid, EXC_RST, pc, @@ -320,7 +319,6 @@ chrp_smp_start_cpu(platform_t plat, stru return ((pc->pc_awake) ? 0 : EBUSY); } -#ifdef SMP static struct cpu_group * chrp_smp_topo(platform_t plat) { From owner-svn-src-projects@FreeBSD.ORG Sat May 28 05:40:20 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50719106566C; Sat, 28 May 2011 05:40:20 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 402348FC08; Sat, 28 May 2011 05:40:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4S5eKvg070079; Sat, 28 May 2011 05:40:20 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4S5eKIv070077; Sat, 28 May 2011 05:40:20 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201105280540.p4S5eKIv070077@svn.freebsd.org> From: Mark Linimon Date: Sat, 28 May 2011 05:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222405 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 05:40:20 -0000 Author: linimon (doc,ports committer) Date: Sat May 28 05:40:19 2011 New Revision: 222405 URL: http://svn.freebsd.org/changeset/base/222405 Log: Big rework to attmempt to clean up hanging mounts of vanished chroots. While here, attempt to remove builds that are now stale, as well. Modified: projects/portbuild/scripts/cleanup-chroots Modified: projects/portbuild/scripts/cleanup-chroots ============================================================================== --- projects/portbuild/scripts/cleanup-chroots Sat May 28 05:28:00 2011 (r222404) +++ projects/portbuild/scripts/cleanup-chroots Sat May 28 05:40:19 2011 (r222405) @@ -9,6 +9,8 @@ pbd=${PORTBUILD_DATA:-/var/portbuild} +VERBOSE=1 + kill_procs() { dir=$1 @@ -25,6 +27,7 @@ kill_procs() done } +# clean up a single mount cleanup_mount() { chroot=$1 mount=$2 @@ -41,60 +44,114 @@ cleanup_mount() { fi } +# cleanup all mounts (old NFS, devfs, linux), as well as mds +cleanup_all() { + chroot=$1 + + mounts=$(mount | grep ${chroot} | awk '{print $3}') + if [ ! -z "${mounts}" ]; then + for j in ${mounts}; do + umount ${j} || cleanup_mount ${j} + done + # XXX MCL is this redundant with the above? + umount ${chroot}/compat/linux/proc || cleanup_mount ${chroot}/compat/linux/proc + fi + if [ "${use_zfs}" != "1" -a "${use_md_swap}" = "1" ]; then + chrootnum=$(basename ${chroot}) + umount -f /dev/md${chroot} + mdconfig -d -u ${chrootnum} + fi +} + # note: uname is not being overridden (should not need client.conf here) arch=$(uname -m) +# note: if any are missing, the script exits here. . ${pbd}/${arch}/client.conf . ${pbd}/${arch}/portbuild.conf . ${pbd}/${arch}/portbuild.$(hostname) if [ "${use_zfs}" = "1" ]; then - old=$(find ${scratchdir}/*/*/* -prune -mmin +60 2> /dev/null) + old_chroots=$(find ${scratchdir}/*/*/* -prune -mmin +60 2> /dev/null) else - old=$(find ${scratchdir}/*/*/chroot/* -prune -mmin +60 2> /dev/null) + old_chroots=$(find ${scratchdir}/*/*/chroot/* -prune -mmin +60 2> /dev/null) fi -if [ -z "${old}" ]; then - exit 0 +if [ $VERBOSE ]; then + echo "non-empty chroots > 1 hr old found on $(hostname):" + echo ${old_chroots} fi -# Prune out chroots with active builds -for i in ${old}; do - if [ ! -d ${i}/used ]; then - old2="${i} ${old2}" - # Also remove "in use" chroots that were set up more than 5 days ago - elif [ ! -z "`find $i/used -prune -mmin +7200`" ]; then - echo "cleanup-chroots: Found old files on `hostname`:" - ls -l ${i}/tmp ${i}/used - echo "${i} allegedly in use but >5 days old" - old2="${i} ${old2}" - fi -done +if [ ! -z "${old_chroots}" ]; then + # Flag non-empty chroots with no active builds + for chroot in ${old_chroots}; do + if [ ! -d ${chroot}/used ]; then + stale_chroots="${chroot} ${stale_chroots}" + # Also flag "in use" chroots that were set up more than 5 days ago + elif [ ! -z "`find ${chroot}/used -prune -mmin +7200`" ]; then + echo "cleanup-chroots: Found old files on $(hostname):" + ls -l ${chroot}/tmp ${chroot}/used + echo "${chroot} allegedly in use but >5 days old" + stale_chroots="${chroot} ${stale_chroots}" + fi + done +fi -if [ -z "${old2}" ]; then - exit 0 +if [ $VERBOSE ]; then + echo "non-empty, >1 hr old stale chroots found on $(hostname):" + echo ${stale_chroots} fi -# cleanup old NFS and devfs mounts -for i in ${old2}; do - mounts=$(mount | grep $i | awk '{print $3}') - if [ ! -z "${mounts}" ]; then - for j in ${mounts}; do - umount ${j} || cleanup_mount ${j} - done - umount ${i}/compat/linux/proc || cleanup_mount ${i}/compat/linux/proc +# save off non-empty, stale chroots for possible examination +if [ -z "${stale_chroots}" ]; then + mkdir -p ${scratchdir}/old + for chroot in ${stale_chroots}; do + mv ${chroot} ${scratchdir}/old + done + rm -rf ${scratchdir}/old 2> /dev/null + if [ -d ${scratchdir}/old ]; then + chflags -R noschg ${scratchdir}/old + rm -rf ${scratchdir}/old fi - if [ "${use_zfs}" != "1" -a "${use_md_swap}" = "1" ]; then - chrootnum=$(basename $i) - umount -f /dev/md${i} - mdconfig -d -u ${chrootnum} +fi + +# cleanup old NFS and devfs mounts for stale chroots +if [ ! -z "${stale_chroots}" ]; then + for chroot in ${stale_chroots}; do + cleanup_all ${chroot} + done +fi + +# now look for empty stale builds +if [ "${use_zfs}" = "1" ]; then + builds=$(find ${scratchdir}/[0-9]*/* -prune -mmin +7200 2> /dev/null) +else + builds=$(find ${scratchdir}/[0-9]*/* -prune -mmin +7200 2> /dev/null) +fi + +for build in ${builds}; do + if [ -e ${build} ]; then + stale_builds="${build} ${stale_builds}" fi done -mkdir -p ${scratchdir}/old -mv ${old2} ${scratchdir}/old -rm -rf ${scratchdir}/old 2> /dev/null -if [ -d ${scratchdir}/old ]; then - chflags -R noschg ${scratchdir}/old - rm -rf ${scratchdir}/old +if [ $VERBOSE ]; then + echo "empty stale builds found on $(hostname):" + echo ${stale_builds} fi + +# cleanup old NFS and devfs mounts for vanished chroots in stale builds +if [ ! -z "${stale_builds}" ]; then + for build in ${stale_builds}; do + # XXX MCL HACK! what I really want is "give me the next 2 subdirs after $build" + mounts=$(mount | grep "${build}" | awk '{print $3}' | grep -E "/dev$") + if [ ! -z "${mounts}" ]; then + for mount in ${mounts}; do + target=`echo ${mount} | sed -e "s@/dev@@"` + cleanup_all ${target} + done + fi + rm -rf ${build} + done +fi + From owner-svn-src-projects@FreeBSD.ORG Sat May 28 17:13:15 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC1AC106566B; Sat, 28 May 2011 17:13:15 +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 9D0648FC14; Sat, 28 May 2011 17:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4SHDFfM093534; Sat, 28 May 2011 17:13:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4SHDFnF093532; Sat, 28 May 2011 17:13:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105281713.p4SHDFnF093532@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 28 May 2011 17:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222427 - projects/pseries/powerpc/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2011 17:13:15 -0000 Author: nwhitehorn Date: Sat May 28 17:13:15 2011 New Revision: 222427 URL: http://svn.freebsd.org/changeset/base/222427 Log: Check whether the return value of OF_open is 0 only, as -1 is potentially a valid ihandle. Modified: projects/pseries/powerpc/ofw/rtas.c Modified: projects/pseries/powerpc/ofw/rtas.c ============================================================================== --- projects/pseries/powerpc/ofw/rtas.c Sat May 28 16:30:24 2011 (r222426) +++ projects/pseries/powerpc/ofw/rtas.c Sat May 28 17:13:15 2011 (r222427) @@ -83,7 +83,7 @@ rtas_setup(void *junk) } OF_package_to_path(rtas, path, sizeof(path)); rtasi = OF_open(path); - if (rtasi == -1 || rtasi == 0) { + if (rtasi == 0) { rtas = 0; printf("Error initializing RTAS: could not open node\n"); return;