From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 00:36:08 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39230106566B; Mon, 6 Aug 2012 00:36:08 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242138FC0C; Mon, 6 Aug 2012 00:36:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q760a7rm058068; Mon, 6 Aug 2012 00:36:08 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q760a7OY058066; Mon, 6 Aug 2012 00:36:07 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208060036.q760a7OY058066@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 00:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239083 - user/jceel/soc2012_armv6/sys/arm/arm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 00:36:08 -0000 Author: jceel Date: Mon Aug 6 00:36:07 2012 New Revision: 239083 URL: http://svn.freebsd.org/changeset/base/239083 Log: Fix build warning. Modified: user/jceel/soc2012_armv6/sys/arm/arm/bus_space_generic.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/bus_space_generic.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/bus_space_generic.c Mon Aug 6 00:15:49 2012 (r239082) +++ user/jceel/soc2012_armv6/sys/arm/arm/bus_space_generic.c Mon Aug 6 00:36:07 2012 (r239083) @@ -61,7 +61,6 @@ generic_bs_map(void *t, bus_addr_t bpa, const struct pmap_devmap *pd; vm_paddr_t startpa, endpa, pa, offset; vm_offset_t va; - pt_entry_t *pte; if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { /* Device was statically mapped. */ From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 15:22:12 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2B9E106566C; Mon, 6 Aug 2012 15:22:12 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDDD18FC17; Mon, 6 Aug 2012 15:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76FMClg052370; Mon, 6 Aug 2012 15:22:12 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76FMC7n052368; Mon, 6 Aug 2012 15:22:12 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208061522.q76FMC7n052368@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 15:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239094 - user/jceel/soc2012_armv6/sys/nfsclient X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 15:22:13 -0000 Author: jceel Date: Mon Aug 6 15:22:11 2012 New Revision: 239094 URL: http://svn.freebsd.org/changeset/base/239094 Log: Fix mutex recursion in NFS client by removing MNT_ILOCK and MNT_INUNLOCK in nfs_sync(). Modified: user/jceel/soc2012_armv6/sys/nfsclient/nfs_vfsops.c Modified: user/jceel/soc2012_armv6/sys/nfsclient/nfs_vfsops.c ============================================================================== --- user/jceel/soc2012_armv6/sys/nfsclient/nfs_vfsops.c Mon Aug 6 11:02:23 2012 (r239093) +++ user/jceel/soc2012_armv6/sys/nfsclient/nfs_vfsops.c Mon Aug 6 15:22:11 2012 (r239094) @@ -1442,14 +1442,18 @@ nfs_sync(struct mount *mp, int waitfor) td = curthread; +#if 0 MNT_ILOCK(mp); +#endif /* * 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) { +#if 0 MNT_IUNLOCK(mp); +#endif return (EBADF); } From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 16:55:02 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 400EE106564A; Mon, 6 Aug 2012 16:55:02 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 250668FC15; Mon, 6 Aug 2012 16:55:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76Gt1UP060195; Mon, 6 Aug 2012 16:55:02 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76Gt1hZ060191; Mon, 6 Aug 2012 16:55:01 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208061655.q76Gt1hZ060191@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 16:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239096 - in user/jceel/soc2012_armv6/sys: arm/arm arm/include kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 16:55:02 -0000 Author: jceel Date: Mon Aug 6 16:55:01 2012 New Revision: 239096 URL: http://svn.freebsd.org/changeset/base/239096 Log: Remove need of passing trapframes between consecutive arm_dispatch_irq() calls. Trapframe will be stored in thread td_intr_frame variable in first arm_dispatch_irq() call (at root interrupt controlled) and maintained in whole IRQ handling path. Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c user/jceel/soc2012_armv6/sys/arm/arm/intrng.c user/jceel/soc2012_armv6/sys/arm/include/intr.h user/jceel/soc2012_armv6/sys/kern/kern_intr.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/gic.c Mon Aug 6 16:37:43 2012 (r239095) +++ user/jceel/soc2012_armv6/sys/arm/arm/gic.c Mon Aug 6 16:55:01 2012 (r239096) @@ -228,8 +228,7 @@ arm_gic_attach(device_t dev) static int arm_gic_intr(void *arg) { - struct arm_intr_data *id = (struct arm_intr_data *)arg; - struct arm_gic_softc *sc = (struct arm_gic_softc *)id->arg; + struct arm_gic_softc *sc = (struct arm_gic_softc *)arg; uint32_t active_irq, last_irq = 0; active_irq = gic_c_read_4(sc, GICC_IAR); @@ -251,7 +250,7 @@ arm_gic_intr(void *arg) } gic_c_write_4(sc, GICC_EOIR, active_irq); - arm_dispatch_irq(sc->gic_dev, id->tf, active_irq); + arm_dispatch_irq(sc->gic_dev, NULL, active_irq); return (FILTER_HANDLED); } Modified: user/jceel/soc2012_armv6/sys/arm/arm/intrng.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 16:37:43 2012 (r239095) +++ user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 16:55:01 2012 (r239096) @@ -69,7 +69,6 @@ typedef void (*mask_fn)(void *); struct arm_intr_controller { device_t ic_dev; phandle_t ic_node; - struct arm_intr_data ic_id; }; struct arm_intr_handler { @@ -92,7 +91,6 @@ void arm_dispatch_irq(device_t dev, struct trapframe *tf, int irq) { struct arm_intr_handler *ih = NULL; - void *arg; int i; debugf("pic %s, tf %p, irq %d\n", device_get_nameunit(dev), tf, irq); @@ -110,12 +108,6 @@ arm_dispatch_irq(device_t dev, struct tr debugf("requested by %s\n", device_get_nameunit(ih->ih_dev)); - arg = tf; - - /* XXX */ - for (i = 0; arm_pics[i].ic_dev != NULL; i++) - arm_pics[i].ic_id.tf = tf; - ih->ih_intrcnt++; if (intr_event_handle(ih->ih_event, tf) != 0) { /* Stray IRQ */ @@ -222,7 +214,6 @@ arm_setup_irqhandler(device_t dev, drive { struct arm_intr_controller *pic; struct arm_intr_handler *ih; - struct arm_intr_data *id; int error; if (irq < 0) @@ -263,28 +254,17 @@ arm_setup_irqhandler(device_t dev, drive #endif } - if (flags & INTR_CONTROLLER) { - struct arm_intr_controller *pic = NULL; - int i; - for (i = 0; i < NPIC; i++) { - if (arm_pics[i].ic_dev == dev) - pic = &arm_pics[i]; - } - - id = &pic->ic_id; - id->arg = arg; - arg = id; - } - intr_event_add_handler(ih->ih_event, device_get_nameunit(dev), filt, hand, arg, intr_priority(flags), flags, cookiep); debugf("done\n"); + *cookiep = ih; } int arm_remove_irqhandler(int irq, void *cookie) { + struct arm_intr_handler *ih = (struct arm_intr_handler *)ih; /* struct intr_event *event; int error; Modified: user/jceel/soc2012_armv6/sys/arm/include/intr.h ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/include/intr.h Mon Aug 6 16:37:43 2012 (r239095) +++ user/jceel/soc2012_armv6/sys/arm/include/intr.h Mon Aug 6 16:55:01 2012 (r239096) @@ -40,6 +40,7 @@ #define _MACHINE_INTR_H_ #include +#include #include #include "opt_global.h" @@ -50,11 +51,6 @@ #define NPIC 16 #define INTR_CONTROLLER INTR_MD1 -struct arm_intr_data { - void * arg; - struct trapframe * tf; -}; - int arm_fdt_map_irq(phandle_t ic, int irq); void arm_register_pic(device_t dev); void arm_unregister_pic(device_t dev); Modified: user/jceel/soc2012_armv6/sys/kern/kern_intr.c ============================================================================== --- user/jceel/soc2012_armv6/sys/kern/kern_intr.c Mon Aug 6 16:37:43 2012 (r239095) +++ user/jceel/soc2012_armv6/sys/kern/kern_intr.c Mon Aug 6 16:55:01 2012 (r239096) @@ -1418,7 +1418,12 @@ intr_event_handle(struct intr_event *ie, ret = 0; critical_enter(); oldframe = td->td_intr_frame; - td->td_intr_frame = frame; + + if (frame) + td->td_intr_frame = frame; + else + frame = td->td_intr_frame; + TAILQ_FOREACH(ih, &ie->ie_handlers, ih_next) { if (ih->ih_filter == NULL) { thread = 1; From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 17:00:30 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EFA7106566B; Mon, 6 Aug 2012 17:00:30 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29F4B8FC0A; Mon, 6 Aug 2012 17:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76H0UnL060646; Mon, 6 Aug 2012 17:00:30 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76H0TVs060644; Mon, 6 Aug 2012 17:00:29 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208061700.q76H0TVs060644@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239097 - user/jceel/soc2012_armv6/sys/arm/conf X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 17:00:30 -0000 Author: jceel Date: Mon Aug 6 17:00:29 2012 New Revision: 239097 URL: http://svn.freebsd.org/changeset/base/239097 Log: Enable INVARIANTS, WITNESS and DIAGNOSTIC on Pandaboard by default. Modified: user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD Modified: user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD Mon Aug 6 16:55:01 2012 (r239096) +++ user/jceel/soc2012_armv6/sys/arm/conf/PANDABOARD Mon Aug 6 17:00:29 2012 (r239097) @@ -101,11 +101,11 @@ device pl310 # PL310 L2 cache contro #options VERBOSE_SYSINIT #Enable verbose sysinit messages options KDB options DDB #Enable the kernel debugger -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options DIAGNOSTIC +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS #Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options DIAGNOSTIC device md From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 17:58:59 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4EAF106564A; Mon, 6 Aug 2012 17:58:59 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 766CF8FC14; Mon, 6 Aug 2012 17:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76HwxTW065421; Mon, 6 Aug 2012 17:58:59 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76Hwx2r065419; Mon, 6 Aug 2012 17:58:59 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208061758.q76Hwx2r065419@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 17:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239098 - user/jceel/soc2012_armv6/sys/arm/arm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 17:58:59 -0000 Author: jceel Date: Mon Aug 6 17:58:58 2012 New Revision: 239098 URL: http://svn.freebsd.org/changeset/base/239098 Log: Improvements in intrng code: fill in arm_remove_irqhandler() routine, add support for interrupt counting, some general cleanup. Modified: user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/intrng.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 17:00:29 2012 (r239097) +++ user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 17:58:58 2012 (r239098) @@ -73,11 +73,10 @@ struct arm_intr_controller { struct arm_intr_handler { device_t ih_dev; - int ih_intrcnt; + int ih_intrcnt_idx; int ih_irq; struct intr_event * ih_event; struct arm_intr_controller *ih_pic; - struct arm_intr_controller *ih_self; }; static void arm_mask_irq(void *); @@ -87,6 +86,9 @@ static void arm_eoi(void *); static struct arm_intr_handler arm_intrs[NIRQ]; static struct arm_intr_controller arm_pics[NPIC]; +static int intrcnt_index = 0; +static int last_printed = 0; + void arm_dispatch_irq(device_t dev, struct trapframe *tf, int irq) { @@ -108,7 +110,7 @@ arm_dispatch_irq(device_t dev, struct tr debugf("requested by %s\n", device_get_nameunit(ih->ih_dev)); - ih->ih_intrcnt++; + intrcnt[ih->ih_intrcnt_idx]++; if (intr_event_handle(ih->ih_event, tf) != 0) { /* Stray IRQ */ arm_mask_irq(ih); @@ -241,44 +243,45 @@ arm_setup_irqhandler(device_t dev, drive arm_unmask_irq(ih); - debugf("self interrupt controller %p\n", ih->ih_self); -#if 0 last_printed += snprintf(intrnames + last_printed, - MAXCOMLEN + 1, - "irq%d: %s", irq, device_get_nameunit(dev)); + MAXCOMLEN + 1, "%s:%d: %s", + device_get_nameunit(pic->ic_dev), + ih->ih_irq, device_get_nameunit(dev)); + last_printed++; - intrcnt_tab[irq] = intrcnt_index; + ih->ih_intrcnt_idx = intrcnt_index; intrcnt_index++; -#endif } intr_event_add_handler(ih->ih_event, device_get_nameunit(dev), filt, hand, arg, intr_priority(flags), flags, cookiep); - - debugf("done\n"); - *cookiep = ih; } int arm_remove_irqhandler(int irq, void *cookie) { - struct arm_intr_handler *ih = (struct arm_intr_handler *)ih; - /* - struct intr_event *event; + struct arm_intr_controller *pic; + struct arm_intr_handler *ih; int error; - event = intr_events[irq]; - arm_mask_irq(irq); - + if (irq < 0) + return (ENXIO); + + pic = &arm_pics[IRQ_PIC_IDX(irq)]; + ih = arm_lookup_intr_handler(pic->ic_dev, IRQ_VECTOR_IDX(irq)); + + if (ih->ih_event == NULL) + return (ENXIO); + + arm_mask_irq(ih); error = intr_event_remove_handler(cookie); - if (!TAILQ_EMPTY(&event->ie_handlers)) - arm_unmask_irq(irq); + if (!TAILQ_EMPTY(&ih->ih_event->ie_handlers)) + arm_unmask_irq(ih); + return (error); - */ - return (ENXIO); } void From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 23:15:46 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9EB4106564A; Mon, 6 Aug 2012 23:15:46 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B40C98FC15; Mon, 6 Aug 2012 23:15:46 +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 q76NFk6e094029; Mon, 6 Aug 2012 23:15:46 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76NFkET094023; Mon, 6 Aug 2012 23:15:46 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208062315.q76NFkET094023@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 23:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239114 - in user/jceel/soc2012_armv6/sys/arm: arm include ti/omap4 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 23:15:46 -0000 Author: jceel Date: Mon Aug 6 23:15:46 2012 New Revision: 239114 URL: http://svn.freebsd.org/changeset/base/239114 Log: Initial IPI support in intrng. Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c user/jceel/soc2012_armv6/sys/arm/arm/intrng.c user/jceel/soc2012_armv6/sys/arm/arm/pic_if.m user/jceel/soc2012_armv6/sys/arm/include/intr.h user/jceel/soc2012_armv6/sys/arm/ti/omap4/omap4_mp.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/gic.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/gic.c Mon Aug 6 23:05:32 2012 (r239113) +++ user/jceel/soc2012_armv6/sys/arm/arm/gic.c Mon Aug 6 23:15:46 2012 (r239114) @@ -112,6 +112,7 @@ static void arm_gic_config(device_t, int static void arm_gic_eoi(device_t, int); static void arm_gic_mask(device_t, int); static void arm_gic_unmask(device_t, int); +static void arm_gic_ipi(device_t, cpuset_t, int); #define gic_c_read_4(_sc, _reg) \ bus_space_read_4((_sc)->gic_c_bst, (_sc)->gic_c_bsh, (_reg)) @@ -288,6 +289,19 @@ arm_gic_unmask(device_t dev, int irq) gic_d_write_4(sc, GICD_ISENABLER(irq >> 5), (1UL << (irq & 0x1F))); } +static void +arm_gic_ipi(device_t dev, cpuset_t cpus, int ipi) +{ + struct arm_gic_softc *sc = device_get_softc(dev); + uint32_t val = 0, i; + + for (i = 0; i < MAXCPU; i++) + if (CPU_ISSET(i, &cpus)) + val |= 1 << (16 + i); + + gic_d_write_4(sc, GICD_SGIR(0), val | ipi); +} + static device_method_t arm_gic_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arm_gic_probe), @@ -298,6 +312,7 @@ static device_method_t arm_gic_methods[] DEVMETHOD(pic_mask, arm_gic_mask), DEVMETHOD(pic_unmask, arm_gic_unmask), DEVMETHOD(pic_eoi, arm_gic_eoi), + DEVMETHOD(pic_ipi, arm_gic_ipi), { 0, 0 } }; @@ -312,18 +327,6 @@ static devclass_t arm_gic_devclass; DRIVER_MODULE(gic, simplebus, arm_gic_driver, arm_gic_devclass, 0, 0); #ifdef SMP -void -pic_ipi_send(cpuset_t cpus, u_int ipi) -{ - uint32_t val = 0, i; - - for (i = 0; i < MAXCPU; i++) - if (CPU_ISSET(i, &cpus)) - val |= 1 << (16 + i); - gic_d_write_4(arm_gic_sc, GICD_SGIR(0), val | ipi); - -} - int pic_ipi_get(int i) { Modified: user/jceel/soc2012_armv6/sys/arm/arm/intrng.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 23:05:32 2012 (r239113) +++ user/jceel/soc2012_armv6/sys/arm/arm/intrng.c Mon Aug 6 23:15:46 2012 (r239114) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #define IRQ_PIC_IDX(_irq) ((_irq >> 8) & 0xff) #define IRQ_VECTOR_IDX(_irq) ((_irq) & 0xff) #define IRQ_GEN(_pic, _irq) (((_pic) << 8) | ((_irq) & 0xff)) -#define CORE_PIC_IDX (0) -#define CORE_PIC_NODE (0xffffffff) #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ Modified: user/jceel/soc2012_armv6/sys/arm/arm/pic_if.m ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/pic_if.m Mon Aug 6 23:05:32 2012 (r239113) +++ user/jceel/soc2012_armv6/sys/arm/arm/pic_if.m Mon Aug 6 23:15:46 2012 (r239114) @@ -27,9 +27,17 @@ # #include +#include INTERFACE pic; +CODE { + static void null_pic_ipi(device_t dev, cpuset_t cpus, int ipi) + { + return; + } +}; + METHOD void config { device_t dev; int irq; @@ -52,3 +60,8 @@ METHOD void unmask { int irq; }; +METHOD void ipi { + device_t dev; + cpuset_t cpus; + int ipi; +} DEFAULT null_pic_ipi; Modified: user/jceel/soc2012_armv6/sys/arm/include/intr.h ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/include/intr.h Mon Aug 6 23:05:32 2012 (r239113) +++ user/jceel/soc2012_armv6/sys/arm/include/intr.h Mon Aug 6 23:15:46 2012 (r239114) @@ -50,6 +50,8 @@ #define NIRQ 255 #define NPIC 16 #define INTR_CONTROLLER INTR_MD1 +#define CORE_PIC_IDX (0) +#define CORE_PIC_NODE (0xffffffff) int arm_fdt_map_irq(phandle_t ic, int irq); void arm_register_pic(device_t dev); Modified: user/jceel/soc2012_armv6/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/omap4/omap4_mp.c Mon Aug 6 23:05:32 2012 (r239113) +++ user/jceel/soc2012_armv6/sys/arm/ti/omap4/omap4_mp.c Mon Aug 6 23:15:46 2012 (r239114) @@ -83,5 +83,9 @@ platform_mp_start_ap(void) void platform_ipi_send(cpuset_t cpus, u_int ipi) { - pic_ipi_send(cpus, ipi); + device_t gic = devclass_get_device(devclass_find("gic"), 0); + if (gic == NULL) + panic("no interrupt controler to send IPI"); + + pic_ipi_send(gic, cpus, ipi); } From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 23:21:16 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C1181065672; Mon, 6 Aug 2012 23:21:16 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E04F8FC08; Mon, 6 Aug 2012 23:21:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q76NLGVZ094510; Mon, 6 Aug 2012 23:21:16 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76NLGWm094506; Mon, 6 Aug 2012 23:21:16 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208062321.q76NLGWm094506@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 23:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239115 - in user/jceel/soc2012_armv6/sys: arm/lpc arm/ti dev/fdt X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 23:21:16 -0000 Author: jceel Date: Mon Aug 6 23:21:15 2012 New Revision: 239115 URL: http://svn.freebsd.org/changeset/base/239115 Log: Get FDT interrupt decoding back to work. Modified: user/jceel/soc2012_armv6/sys/arm/lpc/lpc_intc.c user/jceel/soc2012_armv6/sys/arm/ti/common.c user/jceel/soc2012_armv6/sys/dev/fdt/fdt_common.c Modified: user/jceel/soc2012_armv6/sys/arm/lpc/lpc_intc.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/lpc/lpc_intc.c Mon Aug 6 23:15:46 2012 (r239114) +++ user/jceel/soc2012_armv6/sys/arm/lpc/lpc_intc.c Mon Aug 6 23:21:15 2012 (r239115) @@ -214,11 +214,8 @@ static int fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { -#if 0 - // XXX if (!fdt_is_compatible(node, "lpc,pic")) return (ENXIO); -#endif *interrupt = fdt32_to_cpu(intr[0]); *trig = INTR_TRIGGER_CONFORM; Modified: user/jceel/soc2012_armv6/sys/arm/ti/common.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/common.c Mon Aug 6 23:15:46 2012 (r239114) +++ user/jceel/soc2012_armv6/sys/arm/ti/common.c Mon Aug 6 23:21:15 2012 (r239115) @@ -58,10 +58,9 @@ static int fdt_gic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { -#if 0 if (!fdt_is_compatible(node, "arm,gic")) return (ENXIO); -#endif + *interrupt = fdt32_to_cpu(intr[0]); *trig = INTR_TRIGGER_CONFORM; *pol = INTR_POLARITY_CONFORM; @@ -75,7 +74,6 @@ static int fdt_aintc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, int *pol) { - if (!fdt_is_compatible(node, "ti,aintc")) return (ENXIO); Modified: user/jceel/soc2012_armv6/sys/dev/fdt/fdt_common.c ============================================================================== --- user/jceel/soc2012_armv6/sys/dev/fdt/fdt_common.c Mon Aug 6 23:15:46 2012 (r239114) +++ user/jceel/soc2012_armv6/sys/dev/fdt/fdt_common.c Mon Aug 6 23:21:15 2012 (r239115) @@ -585,7 +585,7 @@ fdt_intr_to_rl(phandle_t node, struct re */ if (OF_getprop(node, "interrupt-parent", &iph, sizeof(iph)) <= 0) { debugf("no intr-parent phandle\n"); - intr_par = 0xffffffff; + intr_par = 0xffffffff; /* XXX should be #defined */ } else { iph = fdt32_to_cpu(iph); intr_par = OF_instance_to_package(iph); @@ -609,10 +609,16 @@ fdt_intr_to_rl(phandle_t node, struct re interrupt = -1; trig = pol = 0; - if (fdt_intr_decode(intr_par, &intr[i * intr_cells], - &interrupt, &trig, &pol) != 0) { - rv = ENXIO; - goto out; + if (intr_par != 0xffffffff) { + if (fdt_intr_decode(intr_par, &intr[i * intr_cells], + &interrupt, &trig, &pol) != 0) { + rv = ENXIO; + goto out; + } + } else { + interrupt = fdt32_to_cpu(intr[i * intr_cells]); + trig = INTR_TRIGGER_CONFORM; + pol = INTR_POLARITY_CONFORM; } if (interrupt < 0) { From owner-svn-src-user@FreeBSD.ORG Mon Aug 6 23:46:18 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A097106564A; Mon, 6 Aug 2012 23:46:18 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 766EC8FC12; Mon, 6 Aug 2012 23:46: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 q76NkIeZ096583; Mon, 6 Aug 2012 23:46:18 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q76NkIVv096580; Mon, 6 Aug 2012 23:46:18 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208062346.q76NkIVv096580@svn.freebsd.org> From: Jakub Wojciech Klama Date: Mon, 6 Aug 2012 23:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239116 - user/jceel/soc2012_armv6/sys/arm/ti X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Aug 2012 23:46:18 -0000 Author: jceel Date: Mon Aug 6 23:46:17 2012 New Revision: 239116 URL: http://svn.freebsd.org/changeset/base/239116 Log: Remove now unused pieces of ti_machdep code. Modified: user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c Modified: user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c Mon Aug 6 23:21:15 2012 (r239115) +++ user/jceel/soc2012_armv6/sys/arm/ti/ti_machdep.c Mon Aug 6 23:46:17 2012 (r239116) @@ -97,21 +97,6 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -/* Start of address space used for bootstrap map */ -#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 - -/* - * This is the number of L2 page tables required for covering max - * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, - * stacks etc.), uprounded to be divisible by 4. - */ -#define KERNEL_PT_MAX 78 - -/* Define various stack sizes in pages */ -#define IRQ_STACK_SIZE 1 -#define ABT_STACK_SIZE 1 -#define UND_STACK_SIZE 1 - extern unsigned char kernbase[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -124,8 +109,6 @@ extern vm_offset_t ksym_start, ksym_end; extern int *end; -struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; - const struct pmap_devmap *pmap_devmap_bootstrap_table; static struct mem_region availmem_regions[FDT_MEM_REGIONS]; @@ -250,9 +233,6 @@ initarm(void *mdp, void *unused __unused &memsize) != 0) while(1); -// if (fdt_immr_addr(OMAP44XX_L4_PERIPH_VBASE) != 0) -// while (1); - /* Platform-specific initialisation */ pcpu0_init(); From owner-svn-src-user@FreeBSD.ORG Tue Aug 7 00:15:34 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50EE2106566B; Tue, 7 Aug 2012 00:15:34 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 228318FC15; Tue, 7 Aug 2012 00:15:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q770FXTG099103; Tue, 7 Aug 2012 00:15:33 GMT (envelope-from jceel@svn.freebsd.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q770FXp8099101; Tue, 7 Aug 2012 00:15:33 GMT (envelope-from jceel@svn.freebsd.org) Message-Id: <201208070015.q770FXp8099101@svn.freebsd.org> From: Jakub Wojciech Klama Date: Tue, 7 Aug 2012 00:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239117 - user/jceel/soc2012_armv6/sys/arm/arm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2012 00:15:34 -0000 Author: jceel Date: Tue Aug 7 00:15:33 2012 New Revision: 239117 URL: http://svn.freebsd.org/changeset/base/239117 Log: Add support for high/low vector addresses in arm_mmu_init(). Modified: user/jceel/soc2012_armv6/sys/arm/arm/machdep.c Modified: user/jceel/soc2012_armv6/sys/arm/arm/machdep.c ============================================================================== --- user/jceel/soc2012_armv6/sys/arm/arm/machdep.c Mon Aug 6 23:46:17 2012 (r239116) +++ user/jceel/soc2012_armv6/sys/arm/arm/machdep.c Tue Aug 7 00:15:33 2012 (r239117) @@ -151,7 +151,8 @@ extern vm_offset_t ksym_start, ksym_end; static void arm_valloc_pages(struct pv_addr *, size_t, size_t); static void arm_process_devmap(struct pmap_devmap *); -static void arm_bootstrap_pagetables(uint32_t, struct pv_addr *, struct pv_addr *); +static void arm_bootstrap_pagetables(uint32_t, struct pv_addr *, + struct pv_addr *, int); void sendsig(catcher, ksi, mask) @@ -822,15 +823,18 @@ arm_valloc_pages(struct pv_addr *result, } static void -arm_bootstrap_pagetables(uint32_t memsize, struct pv_addr *vectors, struct pv_addr *l1pt) +arm_bootstrap_pagetables(uint32_t memsize, struct pv_addr *vectors, struct pv_addr *l1pt, int high_vectors) { struct pv_addr *l2pt = arm_bootstrap_l2pt; + vm_offset_t vectors_va; vm_offset_t l2_start; vm_offset_t pagetables_size = 0; int l2_needed; int l2_devmap; int i, j; + vectors_va = high_vectors ? ARM_VECTORS_HIGH : ARM_VECTORS_LOW; + /* Allocate L1 pagetable */ arm_valloc_pages(l1pt, L1_TABLE_SIZE / PAGE_SIZE, L1_TABLE_SIZE / PAGE_SIZE); pagetables_size += L1_TABLE_SIZE; @@ -881,8 +885,8 @@ arm_bootstrap_pagetables(uint32_t memsiz } /* Link and map vectors page */ - pmap_link_l2pt(l1pt->pv_va, ARM_VECTORS_HIGH, &l2pt[l2_needed - 1]); - pmap_map_entry(l1pt->pv_va, ARM_VECTORS_HIGH, vectors->pv_pa, + pmap_link_l2pt(l1pt->pv_va, vectors_va, &l2pt[l2_needed - 1]); + pmap_map_entry(l1pt->pv_va, vectors_va, vectors->pv_pa, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); /* Map kernel and structures */ @@ -1005,7 +1009,7 @@ arm_mmu_init(uint32_t memsize, uint32_t arm_process_devmap(arm_pmap_devmap); /* Construct bootstrap pagetables */ - arm_bootstrap_pagetables(memsize, &systempage, &pagetable); + arm_bootstrap_pagetables(memsize, &systempage, &pagetable, high_vectors); pmap_devmap_bootstrap(pagetable.pv_va, arm_pmap_devmap); edebugf("L1 table pa=0x%x va=0x%x\n", pagetable.pv_pa, pagetable.pv_va); @@ -1053,7 +1057,8 @@ arm_mmu_init(uint32_t memsize, uint32_t undefined_init(); init_proc0(kernelstack.pv_va); - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_vector_init(high_vectors ? ARM_VECTORS_HIGH : ARM_VECTORS_LOW, + ARM_VEC_ALL); dump_avail[0] = 0; dump_avail[1] = memsize; From owner-svn-src-user@FreeBSD.ORG Tue Aug 7 05:03:55 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0807C1065670; Tue, 7 Aug 2012 05:03:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E22AE8FC0A; Tue, 7 Aug 2012 05:03:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7753sIk022955; Tue, 7 Aug 2012 05:03:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7753s7m022940; Tue, 7 Aug 2012 05:03:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201208070503.q7753s7m022940@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 7 Aug 2012 05:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239122 - in user/ae/bootcode: . bin/sh cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libdtrace/common cddl/contrib/opensolaris/lib/libzfs/common cddl/lib/libzfs contr... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2012 05:03:55 -0000 Author: ae Date: Tue Aug 7 05:03:53 2012 New Revision: 239122 URL: http://svn.freebsd.org/changeset/base/239122 Log: Sync with head/. Added: user/ae/bootcode/contrib/libarchive/libarchive/archive_getdate.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_getdate.c user/ae/bootcode/contrib/libarchive/libarchive/archive_match.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_match.c user/ae/bootcode/contrib/libarchive/libarchive/archive_pathmatch.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_pathmatch.c user/ae/bootcode/contrib/libarchive/libarchive/archive_pathmatch.h - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_pathmatch.h user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_write_add_filter.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_disk_acl.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/archive_write_disk_acl.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_acl_freebsd_posix1e.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_getdate.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_archive_getdate.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_match_owner.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_archive_match_owner.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_match_path.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_archive_match_path.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_match_time.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_archive_match_time.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_pathmatch.c - copied unchanged from r239120, head/contrib/libarchive/libarchive/test/test_archive_pathmatch.c user/ae/bootcode/contrib/libarchive/tar/test/test_format_newc.c - copied unchanged from r239120, head/contrib/libarchive/tar/test/test_format_newc.c user/ae/bootcode/contrib/libarchive/tar/test/test_option_nodump.c - copied unchanged from r239120, head/contrib/libarchive/tar/test/test_option_nodump.c user/ae/bootcode/share/man/man4/vale.4 - copied unchanged from r239120, head/share/man/man4/vale.4 user/ae/bootcode/sys/arm/at91/at91sam9x5.c - copied unchanged from r239120, head/sys/arm/at91/at91sam9x5.c user/ae/bootcode/sys/arm/at91/at91sam9x5reg.h - copied unchanged from r239120, head/sys/arm/at91/at91sam9x5reg.h user/ae/bootcode/sys/powerpc/powermac/nvbl.c - copied unchanged from r239120, head/sys/powerpc/powermac/nvbl.c Deleted: user/ae/bootcode/contrib/libarchive/cpio/test/test_pathmatch.c user/ae/bootcode/contrib/libarchive/libarchive_fe/matching.c user/ae/bootcode/contrib/libarchive/libarchive_fe/matching.h user/ae/bootcode/contrib/libarchive/libarchive_fe/pathmatch.c user/ae/bootcode/contrib/libarchive/libarchive_fe/pathmatch.h user/ae/bootcode/contrib/libarchive/tar/getdate.c user/ae/bootcode/contrib/libarchive/tar/test/test_getdate.c user/ae/bootcode/contrib/libarchive/tar/tree.c user/ae/bootcode/contrib/libarchive/tar/tree.h user/ae/bootcode/sys/arm/at91/at91sam9x25.c user/ae/bootcode/sys/arm/at91/at91sam9x25reg.h Modified: user/ae/bootcode/Makefile.inc1 user/ae/bootcode/UPDATING user/ae/bootcode/bin/sh/jobs.c user/ae/bootcode/bin/sh/trap.c user/ae/bootcode/bin/sh/trap.h user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool.8 user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/ae/bootcode/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c user/ae/bootcode/cddl/lib/libzfs/Makefile user/ae/bootcode/contrib/libarchive/NEWS user/ae/bootcode/contrib/libarchive/README user/ae/bootcode/contrib/libarchive/cpio/bsdcpio.1 user/ae/bootcode/contrib/libarchive/cpio/cmdline.c user/ae/bootcode/contrib/libarchive/cpio/cpio.c user/ae/bootcode/contrib/libarchive/cpio/cpio.h user/ae/bootcode/contrib/libarchive/cpio/test/main.c user/ae/bootcode/contrib/libarchive/cpio/test/test.h user/ae/bootcode/contrib/libarchive/libarchive/archive.h user/ae/bootcode/contrib/libarchive/libarchive/archive_acl.c user/ae/bootcode/contrib/libarchive/libarchive/archive_check_magic.c user/ae/bootcode/contrib/libarchive/libarchive/archive_endian.h user/ae/bootcode/contrib/libarchive/libarchive/archive_entry.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry.c user/ae/bootcode/contrib/libarchive/libarchive/archive_entry.h user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_acl.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_link_resolver.c user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_linkify.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_paths.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_perms.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_stat.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_stat.c user/ae/bootcode/contrib/libarchive/libarchive/archive_entry_time.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_ppmd7.c user/ae/bootcode/contrib/libarchive/libarchive/archive_private.h user/ae/bootcode/contrib/libarchive/libarchive/archive_read.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_data.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_disk.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_disk_posix.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_disk_private.h user/ae/bootcode/contrib/libarchive/libarchive/archive_read_extract.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_filter.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_format.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_free.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_header.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_new.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_open.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_open_fd.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_open_filename.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_private.h user/ae/bootcode/contrib/libarchive/libarchive/archive_read_set_options.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_filter_rpm.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_7zip.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_cab.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_cpio.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_lha.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_mtree.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_rar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_tar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_xar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_read_support_format_zip.c user/ae/bootcode/contrib/libarchive/libarchive/archive_string.c user/ae/bootcode/contrib/libarchive/libarchive/archive_string.h user/ae/bootcode/contrib/libarchive/libarchive/archive_string_composition.h user/ae/bootcode/contrib/libarchive/libarchive/archive_string_sprintf.c user/ae/bootcode/contrib/libarchive/libarchive/archive_util.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_util.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter_compress.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter_program.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_add_filter_xz.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_blocksize.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_data.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_disk.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_disk_posix.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_disk_private.h user/ae/bootcode/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_filter.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_finish_entry.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_format.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_free.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_header.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_new.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_open.3 user/ae/bootcode/contrib/libarchive/libarchive/archive_write_open_filename.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_private.h user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_7zip.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_ar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_cpio.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_mtree.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_pax.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_ustar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_xar.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_format_zip.c user/ae/bootcode/contrib/libarchive/libarchive/archive_write_set_options.3 user/ae/bootcode/contrib/libarchive/libarchive/cpio.5 user/ae/bootcode/contrib/libarchive/libarchive/libarchive-formats.5 user/ae/bootcode/contrib/libarchive/libarchive/libarchive.3 user/ae/bootcode/contrib/libarchive/libarchive/libarchive_changes.3 user/ae/bootcode/contrib/libarchive/libarchive/libarchive_internals.3 user/ae/bootcode/contrib/libarchive/libarchive/tar.5 user/ae/bootcode/contrib/libarchive/libarchive/test/main.c user/ae/bootcode/contrib/libarchive/libarchive/test/read_open_memory.c user/ae/bootcode/contrib/libarchive/libarchive/test/test.h user/ae/bootcode/contrib/libarchive/libarchive/test/test_archive_string_conversion.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_compat_zip.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_7zip.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_cab.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_rar.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_rar_unicode.rar.uu user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_format_tar_filename.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_pax_truncated.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_read_position.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_sparse_basic.c user/ae/bootcode/contrib/libarchive/libarchive/test/test_write_format_zip.c user/ae/bootcode/contrib/libarchive/libarchive_fe/err.c user/ae/bootcode/contrib/libarchive/libarchive_fe/err.h user/ae/bootcode/contrib/libarchive/tar/bsdtar.1 user/ae/bootcode/contrib/libarchive/tar/bsdtar.c user/ae/bootcode/contrib/libarchive/tar/bsdtar.h user/ae/bootcode/contrib/libarchive/tar/read.c user/ae/bootcode/contrib/libarchive/tar/test/main.c user/ae/bootcode/contrib/libarchive/tar/test/test.h user/ae/bootcode/contrib/libarchive/tar/test/test_basic.c user/ae/bootcode/contrib/libarchive/tar/write.c user/ae/bootcode/contrib/llvm/tools/clang/lib/Driver/Tools.cpp user/ae/bootcode/etc/devd/usb.conf user/ae/bootcode/games/fortune/datfiles/fortunes user/ae/bootcode/include/gssapi/gssapi.h user/ae/bootcode/lib/libarchive/Makefile user/ae/bootcode/lib/libarchive/config_freebsd.h user/ae/bootcode/lib/libarchive/test/Makefile user/ae/bootcode/lib/libc/gen/fts.c user/ae/bootcode/lib/libc/locale/Makefile.inc user/ae/bootcode/lib/libc/locale/isgraph.3 user/ae/bootcode/lib/libc/locale/islower.3 user/ae/bootcode/lib/libc/locale/ispunct.3 user/ae/bootcode/lib/libc/locale/isspace.3 user/ae/bootcode/lib/libc/locale/nl_langinfo.3 user/ae/bootcode/lib/libc/string/strerror.3 user/ae/bootcode/lib/libc/sys/fcntl.2 user/ae/bootcode/lib/libpam/modules/pam_krb5/pam_krb5.c user/ae/bootcode/lib/libpam/modules/pam_unix/pam_unix.c user/ae/bootcode/lib/msun/ld128/s_expl.c user/ae/bootcode/lib/msun/ld80/s_expl.c user/ae/bootcode/lib/msun/src/s_cbrtl.c user/ae/bootcode/libexec/rtld-elf/arm/rtld_start.S user/ae/bootcode/libexec/rtld-elf/map_object.c user/ae/bootcode/rescue/rescue/Makefile user/ae/bootcode/sbin/camcontrol/camcontrol.c user/ae/bootcode/sbin/fsck_ffs/suj.c user/ae/bootcode/sbin/geom/class/multipath/geom_multipath.c user/ae/bootcode/sbin/geom/class/multipath/gmultipath.8 user/ae/bootcode/sbin/geom/class/sched/gsched.8 user/ae/bootcode/sbin/geom/class/virstor/gvirstor.8 user/ae/bootcode/sbin/ggate/shared/ggate.h user/ae/bootcode/sbin/ipfw/dummynet.c user/ae/bootcode/sbin/ipfw/ipfw2.c user/ae/bootcode/sbin/ipfw/nat.c user/ae/bootcode/sbin/md5/Makefile user/ae/bootcode/sbin/md5/md5.1 user/ae/bootcode/sbin/md5/md5.c user/ae/bootcode/sbin/shutdown/shutdown.c user/ae/bootcode/share/man/man4/Makefile user/ae/bootcode/share/man/man4/hptiop.4 user/ae/bootcode/share/man/man4/netmap.4 user/ae/bootcode/share/man/man4/polling.4 user/ae/bootcode/share/man/man4/umodem.4 user/ae/bootcode/share/man/man4/uslcom.4 user/ae/bootcode/share/man/man5/rc.conf.5 user/ae/bootcode/share/misc/committers-ports.dot user/ae/bootcode/sys/amd64/amd64/fpu.c user/ae/bootcode/sys/amd64/amd64/pmap.c user/ae/bootcode/sys/amd64/include/cpufunc.h user/ae/bootcode/sys/arm/arm/bcopyinout.S user/ae/bootcode/sys/arm/arm/bcopyinout_xscale.S user/ae/bootcode/sys/arm/arm/exception.S user/ae/bootcode/sys/arm/arm/pmap.c user/ae/bootcode/sys/arm/at91/at91_spi.c user/ae/bootcode/sys/arm/at91/board_sn9g45.c user/ae/bootcode/sys/arm/at91/files.at91 user/ae/bootcode/sys/arm/at91/if_ate.c user/ae/bootcode/sys/arm/at91/std.at91sam9g45 user/ae/bootcode/sys/arm/at91/std.atmel user/ae/bootcode/sys/arm/at91/std.sam9x25ek user/ae/bootcode/sys/arm/conf/ATMEL user/ae/bootcode/sys/arm/conf/ETHERNUT5 user/ae/bootcode/sys/arm/conf/HL201 user/ae/bootcode/sys/arm/conf/KB920X user/ae/bootcode/sys/arm/conf/QILA9G20 user/ae/bootcode/sys/arm/conf/SAM9G20EK user/ae/bootcode/sys/arm/conf/SAM9X25EK user/ae/bootcode/sys/arm/conf/SN9G45 user/ae/bootcode/sys/arm/mv/common.c user/ae/bootcode/sys/arm/mv/gpio.c user/ae/bootcode/sys/arm/mv/ic.c user/ae/bootcode/sys/arm/mv/kirkwood/kirkwood.c user/ae/bootcode/sys/arm/mv/mv_sata.c user/ae/bootcode/sys/arm/mv/mvreg.h user/ae/bootcode/sys/boot/i386/libi386/biosdisk.c user/ae/bootcode/sys/boot/i386/pmbr/pmbr.s user/ae/bootcode/sys/boot/pc98/boot2/boot2.c user/ae/bootcode/sys/boot/pc98/btx/btxldr/btxldr.S user/ae/bootcode/sys/boot/pc98/btx/lib/btxcsu.S user/ae/bootcode/sys/boot/pc98/cdboot/cdboot.S user/ae/bootcode/sys/boot/pc98/libpc98/Makefile user/ae/bootcode/sys/boot/sparc64/loader/main.c user/ae/bootcode/sys/boot/userboot/test/test.c user/ae/bootcode/sys/boot/userboot/userboot.h user/ae/bootcode/sys/boot/userboot/userboot/main.c user/ae/bootcode/sys/cam/ata/ata_all.h user/ae/bootcode/sys/cam/ata/ata_xpt.c user/ae/bootcode/sys/cam/cam_ccb.h user/ae/bootcode/sys/cam/cam_periph.c user/ae/bootcode/sys/cam/cam_xpt.c user/ae/bootcode/sys/cam/ctl/scsi_ctl.c user/ae/bootcode/sys/cam/scsi/scsi_cd.c user/ae/bootcode/sys/cam/scsi/scsi_da.c user/ae/bootcode/sys/cam/scsi/scsi_enc.c user/ae/bootcode/sys/cam/scsi/scsi_enc_safte.c user/ae/bootcode/sys/cam/scsi/scsi_enc_ses.c user/ae/bootcode/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/ae/bootcode/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h user/ae/bootcode/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c user/ae/bootcode/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/ae/bootcode/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h user/ae/bootcode/sys/conf/NOTES user/ae/bootcode/sys/conf/files user/ae/bootcode/sys/conf/files.powerpc user/ae/bootcode/sys/conf/kern.post.mk user/ae/bootcode/sys/dev/acpica/acpi_cpu.c user/ae/bootcode/sys/dev/agp/agp.c user/ae/bootcode/sys/dev/agp/agp_i810.c user/ae/bootcode/sys/dev/aic7xxx/aic79xx_osm.c user/ae/bootcode/sys/dev/aic7xxx/aic_osm_lib.c user/ae/bootcode/sys/dev/ath/ah_osdep.h user/ae/bootcode/sys/dev/ath/ath_hal/ah.c user/ae/bootcode/sys/dev/ath/ath_hal/ah.h user/ae/bootcode/sys/dev/ath/ath_hal/ah_desc.h user/ae/bootcode/sys/dev/ath/ath_hal/ah_internal.h user/ae/bootcode/sys/dev/ath/ath_hal/ar5210/ar5210.h user/ae/bootcode/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5211/ar5211.h user/ae/bootcode/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5212/ar5212.h user/ae/bootcode/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5416/ar5416.h user/ae/bootcode/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/ae/bootcode/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/ae/bootcode/sys/dev/ath/ath_rate/sample/sample.c user/ae/bootcode/sys/dev/ath/if_ath.c user/ae/bootcode/sys/dev/ath/if_ath_beacon.c user/ae/bootcode/sys/dev/ath/if_ath_misc.h user/ae/bootcode/sys/dev/ath/if_ath_rx.c user/ae/bootcode/sys/dev/ath/if_ath_rx_edma.c user/ae/bootcode/sys/dev/ath/if_ath_tx.c user/ae/bootcode/sys/dev/ath/if_ath_tx.h user/ae/bootcode/sys/dev/ath/if_ath_tx_edma.c user/ae/bootcode/sys/dev/ath/if_ath_tx_ht.c user/ae/bootcode/sys/dev/ath/if_athioctl.h user/ae/bootcode/sys/dev/ath/if_athvar.h user/ae/bootcode/sys/dev/bce/if_bce.c user/ae/bootcode/sys/dev/cesa/cesa.c user/ae/bootcode/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c user/ae/bootcode/sys/dev/cxgbe/firmware/t4fw_interface.h user/ae/bootcode/sys/dev/e1000/if_igb.c user/ae/bootcode/sys/dev/e1000/if_lem.c user/ae/bootcode/sys/dev/esp/ncr53c9x.c user/ae/bootcode/sys/dev/hptiop/hptiop.c user/ae/bootcode/sys/dev/isp/isp.c user/ae/bootcode/sys/dev/isp/isp_freebsd.c user/ae/bootcode/sys/dev/isp/isp_freebsd.h user/ae/bootcode/sys/dev/isp/isp_library.c user/ae/bootcode/sys/dev/isp/isp_library.h user/ae/bootcode/sys/dev/isp/isp_pci.c user/ae/bootcode/sys/dev/isp/isp_sbus.c user/ae/bootcode/sys/dev/isp/isp_stds.h user/ae/bootcode/sys/dev/isp/isp_target.c user/ae/bootcode/sys/dev/isp/isp_target.h user/ae/bootcode/sys/dev/isp/ispmbox.h user/ae/bootcode/sys/dev/isp/ispvar.h user/ae/bootcode/sys/dev/md/md.c user/ae/bootcode/sys/dev/mge/if_mge.c user/ae/bootcode/sys/dev/mii/e1000phy.c user/ae/bootcode/sys/dev/mlx/mlxvar.h user/ae/bootcode/sys/dev/mps/mps.c user/ae/bootcode/sys/dev/mps/mps_sas.c user/ae/bootcode/sys/dev/mps/mps_table.c user/ae/bootcode/sys/dev/mps/mps_user.c user/ae/bootcode/sys/dev/mps/mpsvar.h user/ae/bootcode/sys/dev/mvs/mvs_soc.c user/ae/bootcode/sys/dev/netmap/if_em_netmap.h user/ae/bootcode/sys/dev/netmap/if_igb_netmap.h user/ae/bootcode/sys/dev/netmap/ixgbe_netmap.h user/ae/bootcode/sys/dev/netmap/netmap.c user/ae/bootcode/sys/dev/netmap/netmap_kern.h user/ae/bootcode/sys/dev/netmap/netmap_mem2.c user/ae/bootcode/sys/dev/pccbb/pccbb_pci.c user/ae/bootcode/sys/dev/pci/pci_pci.c user/ae/bootcode/sys/dev/puc/puc_cfg.h user/ae/bootcode/sys/dev/puc/pucdata.c user/ae/bootcode/sys/dev/sdhci/sdhci.c user/ae/bootcode/sys/dev/spibus/spi.h user/ae/bootcode/sys/dev/spibus/spibus.c user/ae/bootcode/sys/dev/usb/controller/at91dci_atmelarm.c user/ae/bootcode/sys/dev/usb/serial/uftdi.c user/ae/bootcode/sys/dev/usb/serial/uftdi_reg.h user/ae/bootcode/sys/dev/usb/serial/uslcom.c user/ae/bootcode/sys/dev/usb/usbdevs user/ae/bootcode/sys/dev/wtap/if_wtap.c user/ae/bootcode/sys/fs/fifofs/fifo_vnops.c user/ae/bootcode/sys/fs/nfs/nfs_commonport.c user/ae/bootcode/sys/fs/nfsclient/nfs_clbio.c user/ae/bootcode/sys/fs/nwfs/nwfs_io.c user/ae/bootcode/sys/fs/smbfs/smbfs_io.c user/ae/bootcode/sys/fs/tmpfs/tmpfs_subr.c user/ae/bootcode/sys/fs/tmpfs/tmpfs_vnops.c user/ae/bootcode/sys/geom/gate/g_gate.c user/ae/bootcode/sys/geom/geom.h user/ae/bootcode/sys/geom/geom_dev.c user/ae/bootcode/sys/geom/geom_disk.c user/ae/bootcode/sys/geom/geom_disk.h user/ae/bootcode/sys/geom/geom_event.c user/ae/bootcode/sys/geom/geom_io.c user/ae/bootcode/sys/geom/geom_slice.c user/ae/bootcode/sys/geom/geom_subr.c user/ae/bootcode/sys/geom/multipath/g_multipath.c user/ae/bootcode/sys/geom/part/g_part.c user/ae/bootcode/sys/geom/virstor/g_virstor.c user/ae/bootcode/sys/gnu/fs/reiserfs/reiserfs_vfsops.c user/ae/bootcode/sys/i386/include/cpufunc.h user/ae/bootcode/sys/i386/isa/npx.c user/ae/bootcode/sys/i386/linux/linux_proto.h user/ae/bootcode/sys/i386/linux/linux_syscall.h user/ae/bootcode/sys/i386/linux/linux_syscalls.c user/ae/bootcode/sys/i386/linux/linux_sysent.c user/ae/bootcode/sys/i386/linux/linux_systrace_args.c user/ae/bootcode/sys/i386/linux/syscalls.master user/ae/bootcode/sys/ia64/ia64/pmap.c user/ae/bootcode/sys/kern/kern_clocksource.c user/ae/bootcode/sys/kern/kern_descrip.c user/ae/bootcode/sys/kern/kern_intr.c user/ae/bootcode/sys/kern/kern_ktr.c user/ae/bootcode/sys/kern/kern_proc.c user/ae/bootcode/sys/kern/subr_uio.c user/ae/bootcode/sys/kern/sys_pipe.c user/ae/bootcode/sys/kern/uipc_syscalls.c user/ae/bootcode/sys/kern/vfs_syscalls.c user/ae/bootcode/sys/kern/vfs_vnops.c user/ae/bootcode/sys/mips/mips/pmap.c user/ae/bootcode/sys/modules/cam/Makefile user/ae/bootcode/sys/net/bpf_zerocopy.c user/ae/bootcode/sys/net/flowtable.c user/ae/bootcode/sys/net/if_llatbl.c user/ae/bootcode/sys/net/if_llatbl.h user/ae/bootcode/sys/net/if_loop.c user/ae/bootcode/sys/net/if_var.h user/ae/bootcode/sys/net80211/ieee80211_hwmp.c user/ae/bootcode/sys/netgraph/ng_ether.c user/ae/bootcode/sys/netgraph/ng_pptpgre.c user/ae/bootcode/sys/netinet/if_ether.c user/ae/bootcode/sys/netinet/in.c user/ae/bootcode/sys/netinet/in_cksum.c user/ae/bootcode/sys/netinet/ipfw/ip_dn_io.c user/ae/bootcode/sys/netinet/ipfw/ip_dummynet.c user/ae/bootcode/sys/netinet/ipfw/ip_fw2.c user/ae/bootcode/sys/netinet/ipfw/ip_fw_dynamic.c user/ae/bootcode/sys/netinet/ipfw/ip_fw_log.c user/ae/bootcode/sys/netinet/sctp_bsd_addr.c user/ae/bootcode/sys/netinet/sctp_input.c user/ae/bootcode/sys/netinet/sctp_pcb.c user/ae/bootcode/sys/netinet/tcp_timer.c user/ae/bootcode/sys/netinet6/in6.c user/ae/bootcode/sys/netinet6/ip6_ipsec.c user/ae/bootcode/sys/netinet6/ip6_output.c user/ae/bootcode/sys/nfsclient/nfs_bio.c user/ae/bootcode/sys/ofed/include/linux/gfp.h user/ae/bootcode/sys/powerpc/conf/GENERIC user/ae/bootcode/sys/powerpc/conf/GENERIC64 user/ae/bootcode/sys/powerpc/powerpc/busdma_machdep.c user/ae/bootcode/sys/sparc64/include/pmap.h user/ae/bootcode/sys/sparc64/sparc64/pmap.c user/ae/bootcode/sys/sys/bus.h user/ae/bootcode/sys/sys/fcntl.h user/ae/bootcode/sys/sys/pipe.h user/ae/bootcode/sys/ufs/ffs/ffs_vnops.c user/ae/bootcode/sys/vm/device_pager.c user/ae/bootcode/sys/vm/sg_pager.c user/ae/bootcode/sys/vm/vm_page.c user/ae/bootcode/sys/vm/vm_page.h user/ae/bootcode/sys/vm/vnode_pager.c user/ae/bootcode/sys/x86/x86/busdma_machdep.c user/ae/bootcode/sys/x86/x86/local_apic.c user/ae/bootcode/sys/x86/x86/tsc.c user/ae/bootcode/tools/tools/ath/athratestats/main.c user/ae/bootcode/usr.bin/calendar/calendars/calendar.freebsd user/ae/bootcode/usr.bin/cpio/Makefile user/ae/bootcode/usr.bin/cpio/test/Makefile user/ae/bootcode/usr.bin/find/main.c user/ae/bootcode/usr.bin/make/var.c user/ae/bootcode/usr.bin/script/script.1 user/ae/bootcode/usr.bin/script/script.c user/ae/bootcode/usr.bin/tar/Makefile user/ae/bootcode/usr.bin/tar/test/Makefile user/ae/bootcode/usr.sbin/ctladm/ctladm.c user/ae/bootcode/usr.sbin/portsnap/portsnap/portsnap.8 user/ae/bootcode/usr.sbin/portsnap/portsnap/portsnap.sh Directory Properties: user/ae/bootcode/ (props changed) user/ae/bootcode/cddl/contrib/opensolaris/ (props changed) user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/ae/bootcode/contrib/libarchive/ (props changed) user/ae/bootcode/contrib/libarchive/cpio/ (props changed) user/ae/bootcode/contrib/libarchive/libarchive/ (props changed) user/ae/bootcode/contrib/libarchive/libarchive_fe/ (props changed) user/ae/bootcode/contrib/libarchive/tar/ (props changed) user/ae/bootcode/contrib/llvm/ (props changed) user/ae/bootcode/contrib/llvm/tools/clang/ (props changed) user/ae/bootcode/lib/libc/ (props changed) user/ae/bootcode/sbin/ (props changed) user/ae/bootcode/sbin/ipfw/ (props changed) user/ae/bootcode/share/man/man4/ (props changed) user/ae/bootcode/sys/ (props changed) user/ae/bootcode/sys/boot/ (props changed) user/ae/bootcode/sys/cddl/contrib/opensolaris/ (props changed) user/ae/bootcode/sys/conf/ (props changed) user/ae/bootcode/usr.bin/calendar/ (props changed) Modified: user/ae/bootcode/Makefile.inc1 ============================================================================== --- user/ae/bootcode/Makefile.inc1 Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/Makefile.inc1 Tue Aug 7 05:03:53 2012 (r239122) @@ -1260,7 +1260,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ - ${_cddl_lib_libumem} \ + ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1284,6 +1284,7 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem +_cddl_lib_libnvpair= cddl/lib/libnvpair _cddl_lib= cddl/lib .endif Modified: user/ae/bootcode/UPDATING ============================================================================== --- user/ae/bootcode/UPDATING Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/UPDATING Tue Aug 7 05:03:53 2012 (r239122) @@ -24,6 +24,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120727: + The sparc64 ZFS loader has been changed to no longer try to auto- + detect ZFS providers based on diskN aliases but now requires these + to be explicitly listed in the OFW boot-device environment variable. + 20120712: The OpenSSL has been upgraded to 1.0.1c. Any binaries requiring libcrypto.so.6 or libssl.so.6 must be recompiled. Also, there are Modified: user/ae/bootcode/bin/sh/jobs.c ============================================================================== --- user/ae/bootcode/bin/sh/jobs.c Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/bin/sh/jobs.c Tue Aug 7 05:03:53 2012 (r239122) @@ -87,6 +87,10 @@ int in_waitcmd = 0; /* are we in waitcm volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */ static int ttyfd = -1; +/* mode flags for dowait */ +#define DOWAIT_BLOCK 0x1 /* wait until a child exits */ +#define DOWAIT_SIG 0x2 /* if DOWAIT_BLOCK, abort on signals */ + #if JOBS static void restartjob(struct job *); #endif @@ -94,7 +98,6 @@ static void freejob(struct job *); static struct job *getjob(char *); pid_t getjobpgrp(char *); static pid_t dowait(int, struct job *); -static pid_t waitproc(int, int *); static void checkzombies(void); static void cmdtxt(union node *); static void cmdputs(const char *); @@ -519,7 +522,7 @@ waitcmd(int argc, char **argv) break; } } - } while (dowait(1, (struct job *)NULL) != -1); + } while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, (struct job *)NULL) != -1); in_waitcmd--; return 0; @@ -966,7 +969,7 @@ waitforjob(struct job *jp, int *origstat INTOFF; TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1)); while (jp->state == 0) - if (dowait(1, jp) == -1) + if (dowait(DOWAIT_BLOCK | (Tflag ? DOWAIT_SIG : 0), jp) == -1) dotrap(); #if JOBS if (jp->jobctl) { @@ -1004,14 +1007,20 @@ waitforjob(struct job *jp, int *origstat } +static void +dummy_handler(int sig) +{ +} /* * Wait for a process to terminate. */ static pid_t -dowait(int block, struct job *job) +dowait(int mode, struct job *job) { + struct sigaction sa, osa; + sigset_t mask, omask; pid_t pid; int status; struct procstat *sp; @@ -1021,15 +1030,49 @@ dowait(int block, struct job *job) int stopped; int sig; int coredump; + int wflags; + int restore_sigchld; TRACE(("dowait(%d) called\n", block)); + restore_sigchld = 0; + if ((mode & DOWAIT_SIG) != 0) { + sigfillset(&mask); + sigprocmask(SIG_BLOCK, &mask, &omask); + INTOFF; + if (!issigchldtrapped()) { + restore_sigchld = 1; + sa.sa_handler = dummy_handler; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(SIGCHLD, &sa, &osa); + } + } do { - pid = waitproc(block, &status); +#if JOBS + if (iflag) + wflags = WUNTRACED | WCONTINUED; + else +#endif + wflags = 0; + if ((mode & (DOWAIT_BLOCK | DOWAIT_SIG)) != DOWAIT_BLOCK) + wflags |= WNOHANG; + pid = wait3(&status, wflags, (struct rusage *)NULL); TRACE(("wait returns %d, status=%d\n", (int)pid, status)); - } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || - (pid > 0 && WIFSTOPPED(status) && !iflag)); + if (pid == 0 && (mode & DOWAIT_SIG) != 0) { + sigsuspend(&omask); + pid = -1; + if (int_pending()) + break; + } + } while (pid == -1 && errno == EINTR && breakwaitcmd == 0); if (pid == -1 && errno == ECHILD && job != NULL) job->state = JOBDONE; + if ((mode & DOWAIT_SIG) != 0) { + if (restore_sigchld) + sigaction(SIGCHLD, &osa, NULL); + sigprocmask(SIG_SETMASK, &omask, NULL); + INTON; + } if (breakwaitcmd != 0) { breakwaitcmd = 0; if (pid <= 0) @@ -1050,7 +1093,11 @@ dowait(int block, struct job *job) TRACE(("Changing status of proc %d from 0x%x to 0x%x\n", (int)pid, sp->status, status)); - sp->status = status; + if (WIFCONTINUED(status)) { + sp->status = -1; + jp->state = 0; + } else + sp->status = status; thisjob = jp; } if (sp->status == -1) @@ -1108,26 +1155,6 @@ dowait(int block, struct job *job) /* - * Do a wait system call. If job control is compiled in, we accept - * stopped processes. If block is zero, we return a value of zero - * rather than blocking. - */ -static pid_t -waitproc(int block, int *status) -{ - int flags; - -#if JOBS - flags = WUNTRACED; -#else - flags = 0; -#endif - if (block == 0) - flags |= WNOHANG; - return wait3(status, flags, (struct rusage *)NULL); -} - -/* * return 1 if there are stopped jobs, otherwise 0 */ int job_warning = 0; Modified: user/ae/bootcode/bin/sh/trap.c ============================================================================== --- user/ae/bootcode/bin/sh/trap.c Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/bin/sh/trap.c Tue Aug 7 05:03:53 2012 (r239122) @@ -368,6 +368,14 @@ ignoresig(int signo) } +int +issigchldtrapped(void) +{ + + return (trap[SIGCHLD] != NULL && *trap[SIGCHLD] != '\0'); +} + + /* * Signal handler. */ Modified: user/ae/bootcode/bin/sh/trap.h ============================================================================== --- user/ae/bootcode/bin/sh/trap.h Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/bin/sh/trap.h Tue Aug 7 05:03:53 2012 (r239122) @@ -41,6 +41,7 @@ void clear_traps(void); int have_traps(void); void setsignal(int); void ignoresig(int); +int issigchldtrapped(void); void onsig(int); void dotrap(void); void setinteractive(int); Modified: user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Tue Aug 7 05:03:53 2012 (r239122) @@ -1636,21 +1636,22 @@ for unixtime .Op Fl v .Xc .Pp -Displays all pools formatted using a different +Displays pools which do not have all supported features enabled and pools +formatted using a legacy .Tn ZFS -pool on-disk version. Older versions can continue to be used, but some -features may not be available. These pools can be upgraded using -.Qq Nm Cm upgrade Fl a . -Pools that are formatted with a more recent version are also displayed, -although these pools will be inaccessible on the system. +version number. +These pools can continue to be used, but some features may not be available. +Use +.Nm Cm upgrade Fl a +to enable all features on all pools. .Bl -tag -width indent .It Fl v -Displays +Displays legacy .Tn ZFS -pool versions supported by the current software. The current -.Tn ZFS -pool version and all previous supported versions are displayed, along -with an explanation of the features provided with each version. +versions supported by the current software. +See +.Xr zpool-features.5 +for a description of feature flags features supported by the current software. .El .It Xo .Nm @@ -1659,18 +1660,22 @@ with an explanation of the features prov .Fl a | Ar pool ... .Xc .Pp -Upgrades the given pool to the latest on-disk pool version. Once this is done, -the pool will no longer be accessible on systems running older versions of the -software. +Enables all supported features on the given pool. +Once this is done, the pool will no longer be accessible on systems that do +not support feature flags. +See +.Xr zpool-features.5 +for details on compatability with system sthat support feature flags, but do +not support all features enabled on the pool. .Bl -tag -width indent .It Fl a -Upgrades all pools. +Enables all supported features on all pools. .It Fl V Ar version -Upgrade to the specified version. If the +Upgrade to the specified legacy version. If the .Fl V -flag is not specified, the pool is upgraded to the most recent version. This -option can only be used to increase the version number, and only up to the most -recent version supported by this software. +flag is specified, no features will be enabled on the pool. +This option can only be used to increase version number up to the last +supported legacy version number. .El .El .Sh EXAMPLES Modified: user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Aug 7 05:03:53 2012 (r239122) @@ -389,6 +389,18 @@ print_vdev_tree(zpool_handle_t *zhp, con } } +static boolean_t +prop_list_contains_feature(nvlist_t *proplist) +{ + nvpair_t *nvp; + for (nvp = nvlist_next_nvpair(proplist, NULL); NULL != nvp; + nvp = nvlist_next_nvpair(proplist, nvp)) { + if (zpool_prop_feature(nvpair_name(nvp))) + return (B_TRUE); + } + return (B_FALSE); +} + /* * Add a property pair (name, string-value) into a property nvlist. */ @@ -412,12 +424,30 @@ add_prop_list(const char *propname, char proplist = *props; if (poolprop) { + const char *vname = zpool_prop_to_name(ZPOOL_PROP_VERSION); + if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL && !zpool_prop_feature(propname)) { (void) fprintf(stderr, gettext("property '%s' is " "not a valid pool property\n"), propname); return (2); } + + /* + * feature@ properties and version should not be specified + * at the same time. + */ + if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) && + nvlist_exists(proplist, vname)) || + (prop == ZPOOL_PROP_VERSION && + prop_list_contains_feature(proplist))) { + (void) fprintf(stderr, gettext("'feature@' and " + "'version' properties cannot be specified " + "together\n")); + return (2); + } + + if (zpool_prop_feature(propname)) normnm = propname; else @@ -1583,8 +1613,8 @@ show_import(nvlist_t *config) break; case ZPOOL_STATUS_VERSION_OLDER: - (void) printf(gettext(" status: The pool is formatted using an " - "older on-disk version.\n")); + (void) printf(gettext(" status: The pool is formatted using a " + "legacy on-disk version.\n")); break; case ZPOOL_STATUS_VERSION_NEWER: @@ -1592,6 +1622,11 @@ show_import(nvlist_t *config) "incompatible version.\n")); break; + case ZPOOL_STATUS_FEAT_DISABLED: + (void) printf(gettext(" status: Some supported features are " + "not enabled on the pool.\n")); + break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: (void) printf(gettext("status: The pool uses the following " "feature(s) not supported on this sytem:\n")); @@ -1638,19 +1673,21 @@ show_import(nvlist_t *config) * Print out an action according to the overall state of the pool. */ if (vs->vs_state == VDEV_STATE_HEALTHY) { - if (reason == ZPOOL_STATUS_VERSION_OLDER) + if (reason == ZPOOL_STATUS_VERSION_OLDER || + reason == ZPOOL_STATUS_FEAT_DISABLED) { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric identifier, " "though\n\tsome features will not be available " "without an explicit 'zpool upgrade'.\n")); - else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH) + } else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH) { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric " "identifier and\n\tthe '-f' flag.\n")); - else + } else { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric " "identifier.\n")); + } } else if (vs->vs_state == VDEV_STATE_DEGRADED) { (void) printf(gettext(" action: The pool can be imported " "despite missing or damaged devices. The\n\tfault " @@ -4108,12 +4145,13 @@ status_callback(zpool_handle_t *zhp, voi break; case ZPOOL_STATUS_VERSION_OLDER: - (void) printf(gettext("status: The pool is formatted using an " - "older on-disk format. The pool can\n\tstill be used, but " - "some features are unavailable.\n")); + (void) printf(gettext("status: The pool is formatted using a " + "legacy on-disk format. The pool can\n\tstill be used, " + "but some features are unavailable.\n")); (void) printf(gettext("action: Upgrade the pool using 'zpool " "upgrade'. Once this is done, the\n\tpool will no longer " - "be accessible on older software versions.\n")); + "be accessible on software that does not support feature\n" + "\tflags.\n")); break; case ZPOOL_STATUS_VERSION_NEWER: @@ -4125,6 +4163,16 @@ status_callback(zpool_handle_t *zhp, voi "backup.\n")); break; + case ZPOOL_STATUS_FEAT_DISABLED: + (void) printf(gettext("status: Some supported features are not " + "enabled on the pool. The pool can\n\tstill be used, but " + "some features are unavailable.\n")); + (void) printf(gettext("action: Enable all features using " + "'zpool upgrade'. Once this is done,\n\tthe pool may no " + "longer be accessible by software that does not support\n\t" + "the features. See zpool-features(5) for details.\n")); + break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: (void) printf(gettext("status: The pool cannot be accessed on " "this system because it uses the\n\tfollowing feature(s) " @@ -4354,15 +4402,14 @@ zpool_do_status(int argc, char **argv) } typedef struct upgrade_cbdata { - int cb_all; int cb_first; - int cb_newer; char cb_poolname[ZPOOL_MAXNAMELEN]; int cb_argc; uint64_t cb_version; char **cb_argv; } upgrade_cbdata_t; +#ifdef __FreeBSD__ static int is_root_pool(zpool_handle_t *zhp) { @@ -4388,56 +4435,161 @@ is_root_pool(zpool_handle_t *zhp) return (poolname != NULL && strcmp(poolname, zpool_get_name(zhp)) == 0); } +static void +root_pool_upgrade_check(zpool_handle_t *zhp, char *poolname, int size) { + + if (poolname[0] == '\0' && is_root_pool(zhp)) + (void) strlcpy(poolname, zpool_get_name(zhp), size); +} +#endif /* FreeBSD */ + +static int +upgrade_version(zpool_handle_t *zhp, uint64_t version) +{ + int ret; + nvlist_t *config; + uint64_t oldversion; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &oldversion) == 0); + + assert(SPA_VERSION_IS_SUPPORTED(oldversion)); + assert(oldversion < version); + + ret = zpool_upgrade(zhp, version); + if (ret != 0) + return (ret); + + if (version >= SPA_VERSION_FEATURES) { + (void) printf(gettext("Successfully upgraded " + "'%s' from version %llu to feature flags.\n"), + zpool_get_name(zhp), oldversion); + } else { + (void) printf(gettext("Successfully upgraded " + "'%s' from version %llu to version %llu.\n"), + zpool_get_name(zhp), oldversion, version); + } + + return (0); +} + +static int +upgrade_enable_all(zpool_handle_t *zhp, int *countp) +{ + int i, ret, count; + boolean_t firstff = B_TRUE; + nvlist_t *enabled = zpool_get_features(zhp); + + count = 0; + for (i = 0; i < SPA_FEATURES; i++) { + const char *fname = spa_feature_table[i].fi_uname; + const char *fguid = spa_feature_table[i].fi_guid; + if (!nvlist_exists(enabled, fguid)) { + char *propname; + verify(-1 != asprintf(&propname, "feature@%s", fname)); + ret = zpool_set_prop(zhp, propname, + ZFS_FEATURE_ENABLED); + if (ret != 0) { + free(propname); + return (ret); + } + count++; + + if (firstff) { + (void) printf(gettext("Enabled the " + "following features on '%s':\n"), + zpool_get_name(zhp)); + firstff = B_FALSE; + } + (void) printf(gettext(" %s\n"), fname); + free(propname); + } + } + + if (countp != NULL) + *countp = count; + return (0); +} + static int upgrade_cb(zpool_handle_t *zhp, void *arg) { upgrade_cbdata_t *cbp = arg; nvlist_t *config; uint64_t version; - int ret = 0; + boolean_t printnl = B_FALSE; + int ret; config = zpool_get_config(zhp, NULL); verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, &version) == 0); - if (!cbp->cb_newer && SPA_VERSION_IS_SUPPORTED(version) && - version != SPA_VERSION) { - if (!cbp->cb_all) { - if (cbp->cb_first) { - (void) printf(gettext("The following pools are " - "out of date, and can be upgraded. After " - "being\nupgraded, these pools will no " - "longer be accessible by older software " - "versions.\n\n")); - (void) printf(gettext("VER POOL\n")); - (void) printf(gettext("--- ------------\n")); - cbp->cb_first = B_FALSE; - } + assert(SPA_VERSION_IS_SUPPORTED(version)); - (void) printf("%2llu %s\n", (u_longlong_t)version, - zpool_get_name(zhp)); - } else { + if (version < cbp->cb_version) { + cbp->cb_first = B_FALSE; + ret = upgrade_version(zhp, cbp->cb_version); + if (ret != 0) + return (ret); +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, + sizeof(cbp->cb_poolname)); +#endif /* ___FreeBSD__ */ + printnl = B_TRUE; + +#ifdef illumos + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; +#endif + } + + if (cbp->cb_version >= SPA_VERSION_FEATURES) { + int count; + ret = upgrade_enable_all(zhp, &count); + if (ret != 0) + return (ret); + + if (count > 0) { cbp->cb_first = B_FALSE; - ret = zpool_upgrade(zhp, cbp->cb_version); - if (!ret) { - (void) printf(gettext("Successfully upgraded " - "'%s'\n\n"), zpool_get_name(zhp)); - if (cbp->cb_poolname[0] == '\0' && - is_root_pool(zhp)) { - (void) strlcpy(cbp->cb_poolname, - zpool_get_name(zhp), - sizeof(cbp->cb_poolname)); - } - } + printnl = B_TRUE; } - } else if (cbp->cb_newer && !SPA_VERSION_IS_SUPPORTED(version)) { - assert(!cbp->cb_all); + } + + if (printnl) { + (void) printf(gettext("\n")); + } + + return (0); +} + +static int +upgrade_list_older_cb(zpool_handle_t *zhp, void *arg) +{ + upgrade_cbdata_t *cbp = arg; + nvlist_t *config; + uint64_t version; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &version) == 0); + + assert(SPA_VERSION_IS_SUPPORTED(version)); + if (version < SPA_VERSION_FEATURES) { if (cbp->cb_first) { (void) printf(gettext("The following pools are " - "formatted using an unsupported software version " - "and\ncannot be accessed on the current " - "system.\n\n")); + "formatted with legacy version numbers and can\n" + "be upgraded to use feature flags. After " + "being upgraded, these pools\nwill no " + "longer be accessible by software that does not " + "support feature\nflags.\n\n")); (void) printf(gettext("VER POOL\n")); (void) printf(gettext("--- ------------\n")); cbp->cb_first = B_FALSE; @@ -4447,14 +4599,65 @@ upgrade_cb(zpool_handle_t *zhp, void *ar zpool_get_name(zhp)); } - zpool_close(zhp); - return (ret); + return (0); +} + +static int +upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg) +{ + upgrade_cbdata_t *cbp = arg; + nvlist_t *config; + uint64_t version; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &version) == 0); + + if (version >= SPA_VERSION_FEATURES) { + int i; + boolean_t poolfirst = B_TRUE; + nvlist_t *enabled = zpool_get_features(zhp); + + for (i = 0; i < SPA_FEATURES; i++) { + const char *fguid = spa_feature_table[i].fi_guid; + const char *fname = spa_feature_table[i].fi_uname; + if (!nvlist_exists(enabled, fguid)) { + if (cbp->cb_first) { + (void) printf(gettext("\nSome " + "supported features are not " + "enabled on the following pools. " + "Once a\nfeature is enabled the " + "pool may become incompatible with " + "software\nthat does not support " + "the feature. See " + "zpool-features(5) for " + "details.\n\n")); + (void) printf(gettext("POOL " + "FEATURE\n")); + (void) printf(gettext("------" + "---------\n")); + cbp->cb_first = B_FALSE; + } + + if (poolfirst) { + (void) printf(gettext("%s\n"), + zpool_get_name(zhp)); + poolfirst = B_FALSE; + } + + (void) printf(gettext(" %s\n"), fname); + } + } + } + + return (0); } /* ARGSUSED */ static int upgrade_one(zpool_handle_t *zhp, void *data) { + boolean_t printnl = B_FALSE; upgrade_cbdata_t *cbp = data; uint64_t cur_version; int ret; @@ -4469,30 +4672,53 @@ upgrade_one(zpool_handle_t *zhp, void *d cur_version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL); if (cur_version > cbp->cb_version) { (void) printf(gettext("Pool '%s' is already formatted " - "using more current version '%llu'.\n"), + "using more current version '%llu'.\n\n"), zpool_get_name(zhp), cur_version); return (0); } - if (cur_version == cbp->cb_version) { + + if (cbp->cb_version != SPA_VERSION && cur_version == cbp->cb_version) { (void) printf(gettext("Pool '%s' is already formatted " - "using the current version.\n"), zpool_get_name(zhp)); + "using version %llu.\n\n"), zpool_get_name(zhp), + cbp->cb_version); return (0); } - ret = zpool_upgrade(zhp, cbp->cb_version); + if (cur_version != cbp->cb_version) { + printnl = B_TRUE; + ret = upgrade_version(zhp, cbp->cb_version); + if (ret != 0) + return (ret); +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, + sizeof(cbp->cb_poolname)); +#endif /* ___FreeBSD__ */ + } + + if (cbp->cb_version >= SPA_VERSION_FEATURES) { + int count = 0; + ret = upgrade_enable_all(zhp, &count); + if (ret != 0) + return (ret); - if (!ret) { - (void) printf(gettext("Successfully upgraded '%s' " - "from version %llu to version %llu\n\n"), - zpool_get_name(zhp), (u_longlong_t)cur_version, - (u_longlong_t)cbp->cb_version); - if (cbp->cb_poolname[0] == '\0' && is_root_pool(zhp)) { - (void) strlcpy(cbp->cb_poolname, zpool_get_name(zhp), + if (count != 0) { + printnl = B_TRUE; +#ifdef __FreeBSD__ + root_pool_upgrade_check(zhp, cbp->cb_poolname, sizeof(cbp->cb_poolname)); +#endif /* __FreeBSD __*/ + } else if (cur_version == SPA_VERSION) { + (void) printf(gettext("Pool '%s' already has all " + "supported features enabled.\n"), + zpool_get_name(zhp)); } } - return (ret != 0); + if (printnl) { + (void) printf(gettext("\n")); + } + + return (0); } /* @@ -4511,6 +4737,7 @@ zpool_do_upgrade(int argc, char **argv) upgrade_cbdata_t cb = { 0 }; int ret = 0; boolean_t showversions = B_FALSE; + boolean_t upgradeall = B_FALSE; char *end; @@ -4518,7 +4745,7 @@ zpool_do_upgrade(int argc, char **argv) while ((c = getopt(argc, argv, ":avV:")) != -1) { switch (c) { case 'a': - cb.cb_all = B_TRUE; + upgradeall = B_TRUE; break; case 'v': showversions = B_TRUE; @@ -4551,19 +4778,19 @@ zpool_do_upgrade(int argc, char **argv) if (cb.cb_version == 0) { cb.cb_version = SPA_VERSION; - } else if (!cb.cb_all && argc == 0) { + } else if (!upgradeall && argc == 0) { (void) fprintf(stderr, gettext("-V option is " "incompatible with other arguments\n")); usage(B_FALSE); } if (showversions) { - if (cb.cb_all || argc != 0) { + if (upgradeall || argc != 0) { (void) fprintf(stderr, gettext("-v option is " "incompatible with other arguments\n")); usage(B_FALSE); } - } else if (cb.cb_all) { + } else if (upgradeall) { if (argc != 0) { (void) fprintf(stderr, gettext("-a option should not " "be used along with a pool name\n")); @@ -4573,9 +4800,25 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext("This system supports ZFS pool feature " "flags.\n\n")); - cb.cb_first = B_TRUE; if (showversions) { - (void) printf(gettext("The following versions are " + int i; + + (void) printf(gettext("The following features are " + "supported:\n\n")); + (void) printf(gettext("FEAT DESCRIPTION\n")); + (void) printf("----------------------------------------------" + "---------------\n"); + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *fi = &spa_feature_table[i]; + const char *ro = fi->fi_can_readonly ? + " (read-only compatible)" : ""; + + (void) printf("%-37s%s\n", fi->fi_uname, ro); + (void) printf(" %s\n", fi->fi_desc); + } + (void) printf("\n"); + + (void) printf(gettext("The following legacy versions are also " "supported:\n\n")); (void) printf(gettext("VER DESCRIPTION\n")); (void) printf("--- -----------------------------------------" @@ -4618,32 +4861,44 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext("\nFor more information on a particular " "version, including supported releases,\n")); (void) printf(gettext("see the ZFS Administration Guide.\n\n")); - } else if (argc == 0) { - int notfound; - + } else if (argc == 0 && upgradeall) { + cb.cb_first = B_TRUE; ret = zpool_iter(g_zfs, upgrade_cb, &cb); - notfound = cb.cb_first; - - if (!cb.cb_all && ret == 0) { - if (!cb.cb_first) - (void) printf("\n"); - cb.cb_first = B_TRUE; - cb.cb_newer = B_TRUE; - ret = zpool_iter(g_zfs, upgrade_cb, &cb); - if (!cb.cb_first) { - notfound = B_FALSE; - (void) printf("\n"); + if (ret == 0 && cb.cb_first) { + if (cb.cb_version == SPA_VERSION) { + (void) printf(gettext("All pools are already " + "formatted using feature flags.\n\n")); + (void) printf(gettext("Every feature flags " + "pool already has all supported features " + "enabled.\n")); + } else { + (void) printf(gettext("All pools are already " + "formatted with version %llu or higher.\n"), + cb.cb_version); } } + } else if (argc == 0) { + cb.cb_first = B_TRUE; + ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb); + assert(ret == 0); + + if (cb.cb_first) { + (void) printf(gettext("All pools are formatted " + "using feature flags.\n\n")); + } else { + (void) printf(gettext("\nUse 'zpool upgrade -v' " + "for a list of available legacy versions.\n")); + } - if (ret == 0) { - if (notfound) - (void) printf(gettext("All pools are formatted " - "using this version.\n")); - else if (!cb.cb_all) - (void) printf(gettext("Use 'zpool upgrade -v' " - "for a list of available versions and " - "their associated\nfeatures.\n")); + cb.cb_first = B_TRUE; + ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb); + assert(ret == 0); + + if (cb.cb_first) { + (void) printf(gettext("Every feature flags pool has " + "all supported features enabled.\n")); + } else { + (void) printf(gettext("\n")); } } else { ret = for_each_pool(argc, argv, B_FALSE, NULL, Modified: user/ae/bootcode/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c ============================================================================== --- user/ae/bootcode/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c Tue Aug 7 05:03:53 2012 (r239122) @@ -942,7 +942,8 @@ dt_proc_create_thread(dtrace_hdl_t *dtp, (int)dpr->dpr_pid, strerror(err)); } - (void) pthread_mutex_unlock(&dpr->dpr_lock); + if (err == 0) + (void) pthread_mutex_unlock(&dpr->dpr_lock); (void) pthread_attr_destroy(&a); return (err); Modified: user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Tue Aug 7 05:03:53 2012 (r239122) @@ -316,7 +316,8 @@ typedef enum { * requiring administrative attention. There is no corresponding * message ID. */ - ZPOOL_STATUS_VERSION_OLDER, /* older on-disk version */ + ZPOOL_STATUS_VERSION_OLDER, /* older legacy on-disk version */ + ZPOOL_STATUS_FEAT_DISABLED, /* supported features are disabled */ ZPOOL_STATUS_RESILVERING, /* device being resilvered */ ZPOOL_STATUS_OFFLINE_DEV, /* device online */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ Modified: user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Tue Aug 7 05:03:53 2012 (r239122) @@ -44,6 +44,7 @@ #include #include #include "libzfs_impl.h" +#include "zfeature_common.h" /* * Message ID table. This must be kept in sync with the ZPOOL_STATUS_* defines @@ -319,6 +320,30 @@ check_status(nvlist_t *config, boolean_t if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) return (ZPOOL_STATUS_VERSION_OLDER); + /* + * Usable pool with disabled features + */ + if (version >= SPA_VERSION_FEATURES) { + int i; + nvlist_t *feat; + + if (isimport) { + feat = fnvlist_lookup_nvlist(config, + ZPOOL_CONFIG_LOAD_INFO); + feat = fnvlist_lookup_nvlist(feat, + ZPOOL_CONFIG_ENABLED_FEAT); + } else { + feat = fnvlist_lookup_nvlist(config, + ZPOOL_CONFIG_FEATURE_STATS); + } + + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *fi = &spa_feature_table[i]; + if (!nvlist_exists(feat, fi->fi_guid)) + return (ZPOOL_STATUS_FEAT_DISABLED); + } + } + return (ZPOOL_STATUS_OK); } Modified: user/ae/bootcode/cddl/lib/libzfs/Makefile ============================================================================== --- user/ae/bootcode/cddl/lib/libzfs/Makefile Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/cddl/lib/libzfs/Makefile Tue Aug 7 05:03:53 2012 (r239122) @@ -6,8 +6,8 @@ .PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzfs/common LIB= zfs -DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} -LDADD= -lmd -lpthread -lumem -lutil -lm +DPADD= ${LIBMD} ${LIBPTHREAD} ${LIBUMEM} ${LIBUTIL} ${LIBM} ${LIBNVPAIR} +LDADD= -lmd -lpthread -lumem -lutil -lm -lnvpair SRCS= deviceid.c \ fsshare.c \ Modified: user/ae/bootcode/contrib/libarchive/NEWS ============================================================================== --- user/ae/bootcode/contrib/libarchive/NEWS Tue Aug 7 04:48:14 2012 (r239121) +++ user/ae/bootcode/contrib/libarchive/NEWS Tue Aug 7 05:03:53 2012 (r239122) @@ -1,14 +1,10 @@ -Jan 10, 2012: Issue 223: Skip atime tests if atime not supported -Jan 09, 2012: Issue 222: Errors saving sparse files to pax archives -Jan 09, 2012: Issue 221: allow archive_*_free(NULL) -Dec 31, 2011: Issue 212: configure script on Solaris -Dec 30, 2011: Issue 218: empty contents extracting Zip files with bsdcpio -Dec 30, 2011: Issue 217: fix compile warning -Dec 30, 2011: Issue 216: truncated filenames in listings -Dec 28, 2011: Issue 210: memory leak on Windows -Dec 28, 2011: Issue 206: fix hardlink tests on Windows 2000 -Dec 27, 2011: Issue 208: Don't hang when using external compression - program on Windows +Mar 27, 2012: libarchive 3.0.4 released + +Feb 05, 2012: libarchive development now hosted at GitHub. + http://libarchive.github.com/ +Feb 05, 2012: libarchive's issue tracker remains at Google Code. + http://code.google.com/p/libarchive/issues/list +Feb 05, 2012: libarchive's mailing lists remain at Google Groups. Dec 24, 2011: libarchive 3.0.2 released Dec 23, 2011: Various fixes merged from FreeBSD Modified: user/ae/bootcode/contrib/libarchive/README ============================================================================== --- user/ae/bootcode/contrib/libarchive/README Tue Aug 7 04:48:14 2012 (r239121) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Aug 8 04:28:46 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04B21106566B; Wed, 8 Aug 2012 04:28:46 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DECDE8FC08; Wed, 8 Aug 2012 04:28:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q784SjQN042533; Wed, 8 Aug 2012 04:28:45 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q784SjsT042522; Wed, 8 Aug 2012 04:28:45 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201208080428.q784SjsT042522@svn.freebsd.org> From: Matt Jacob Date: Wed, 8 Aug 2012 04:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239136 - in user/mjacob/sys: amd64/amd64 arm/arm boot/common boot/i386/libi386 boot/i386/loader boot/i386/pmbr boot/pc98/boot2 boot/pc98/btx/btxldr boot/pc98/btx/lib boot/pc98/cdboot b... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2012 04:28:46 -0000 Author: mjacob Date: Wed Aug 8 04:28:45 2012 New Revision: 239136 URL: http://svn.freebsd.org/changeset/base/239136 Log: MFC@239135 Added: user/mjacob/sys/boot/common/part.c - copied unchanged from r239135, head/sys/boot/common/part.c user/mjacob/sys/boot/common/part.h - copied unchanged from r239135, head/sys/boot/common/part.h user/mjacob/sys/powerpc/powermac/nvbl.c - copied unchanged from r239135, head/sys/powerpc/powermac/nvbl.c Modified: user/mjacob/sys/amd64/amd64/elf_machdep.c user/mjacob/sys/amd64/amd64/initcpu.c user/mjacob/sys/amd64/amd64/pmap.c user/mjacob/sys/arm/arm/bcopyinout.S user/mjacob/sys/arm/arm/bcopyinout_xscale.S user/mjacob/sys/arm/arm/exception.S user/mjacob/sys/arm/arm/pmap.c user/mjacob/sys/boot/common/Makefile.inc user/mjacob/sys/boot/common/disk.c user/mjacob/sys/boot/common/disk.h user/mjacob/sys/boot/i386/libi386/Makefile user/mjacob/sys/boot/i386/libi386/biosdisk.c user/mjacob/sys/boot/i386/libi386/devicename.c user/mjacob/sys/boot/i386/libi386/libi386.h user/mjacob/sys/boot/i386/loader/Makefile user/mjacob/sys/boot/i386/loader/main.c user/mjacob/sys/boot/i386/pmbr/pmbr.s user/mjacob/sys/boot/pc98/boot2/boot2.c user/mjacob/sys/boot/pc98/btx/btxldr/btxldr.S user/mjacob/sys/boot/pc98/btx/lib/btxcsu.S user/mjacob/sys/boot/pc98/cdboot/cdboot.S user/mjacob/sys/boot/pc98/libpc98/Makefile user/mjacob/sys/boot/userboot/test/test.c user/mjacob/sys/boot/userboot/userboot.h user/mjacob/sys/boot/userboot/userboot/Makefile user/mjacob/sys/boot/userboot/userboot/bootinfo32.c user/mjacob/sys/boot/userboot/userboot/copy.c user/mjacob/sys/boot/userboot/userboot/devicename.c user/mjacob/sys/boot/userboot/userboot/main.c user/mjacob/sys/boot/userboot/userboot/userboot_disk.c user/mjacob/sys/boot/zfs/zfs.c user/mjacob/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/mjacob/sys/conf/files.powerpc user/mjacob/sys/conf/kern.post.mk user/mjacob/sys/dev/agp/agp.c user/mjacob/sys/dev/agp/agp_i810.c user/mjacob/sys/dev/aic7xxx/aic79xx_osm.c user/mjacob/sys/dev/aic7xxx/aic_osm_lib.c user/mjacob/sys/dev/ath/ah_osdep.h user/mjacob/sys/dev/ath/ath_hal/ah.h user/mjacob/sys/dev/ath/ath_hal/ah_devid.h user/mjacob/sys/dev/ath/ath_hal/ar5210/ar5210.h user/mjacob/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c user/mjacob/sys/dev/ath/ath_hal/ar5211/ar5211.h user/mjacob/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c user/mjacob/sys/dev/ath/ath_hal/ar5212/ar5212.h user/mjacob/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c user/mjacob/sys/dev/ath/ath_hal/ar5416/ar5416.h user/mjacob/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/mjacob/sys/dev/ath/if_ath_beacon.c user/mjacob/sys/dev/ath/if_ath_rx.c user/mjacob/sys/dev/ath/if_ath_rx_edma.c user/mjacob/sys/dev/ath/if_ath_tx.c user/mjacob/sys/dev/ath/if_athvar.h user/mjacob/sys/dev/bce/if_bce.c user/mjacob/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c user/mjacob/sys/dev/cxgbe/firmware/t4fw_interface.h user/mjacob/sys/dev/e1000/if_igb.c user/mjacob/sys/dev/esp/ncr53c9x.c user/mjacob/sys/dev/hptiop/hptiop.c user/mjacob/sys/dev/ipmi/ipmi.c user/mjacob/sys/dev/ipmi/ipmivars.h user/mjacob/sys/dev/isp/isp_sbus.c user/mjacob/sys/dev/md/md.c user/mjacob/sys/dev/pci/pci_pci.c user/mjacob/sys/dev/puc/pucdata.c user/mjacob/sys/dev/usb/serial/uftdi.c user/mjacob/sys/dev/usb/serial/uftdi_reg.h user/mjacob/sys/dev/usb/serial/uslcom.c user/mjacob/sys/dev/usb/usbdevs user/mjacob/sys/fs/nfs/nfs_commonport.c user/mjacob/sys/fs/nfsclient/nfs_clbio.c user/mjacob/sys/fs/nwfs/nwfs_io.c user/mjacob/sys/fs/smbfs/smbfs_io.c user/mjacob/sys/fs/tmpfs/tmpfs_subr.c user/mjacob/sys/fs/tmpfs/tmpfs_vnops.c user/mjacob/sys/geom/gate/g_gate.c user/mjacob/sys/geom/geom_io.c user/mjacob/sys/geom/virstor/g_virstor.c user/mjacob/sys/ia64/ia64/pmap.c user/mjacob/sys/kern/kern_clocksource.c user/mjacob/sys/kern/kern_intr.c user/mjacob/sys/kern/kern_proc.c user/mjacob/sys/kern/subr_uio.c user/mjacob/sys/kern/sys_process.c user/mjacob/sys/kern/uipc_syscalls.c user/mjacob/sys/mips/mips/trap.c user/mjacob/sys/net/bpf_zerocopy.c user/mjacob/sys/netinet/ip_dummynet.h user/mjacob/sys/netinet/ipfw/dummynet.txt user/mjacob/sys/netinet/ipfw/ip_dn_io.c user/mjacob/sys/netinet/ipfw/ip_fw_log.c user/mjacob/sys/netinet/sctp_bsd_addr.c user/mjacob/sys/netinet/sctp_input.c user/mjacob/sys/netinet/sctp_pcb.c user/mjacob/sys/netinet/tcp_timer.c user/mjacob/sys/nfsclient/nfs_bio.c user/mjacob/sys/ofed/include/linux/gfp.h user/mjacob/sys/powerpc/conf/GENERIC user/mjacob/sys/powerpc/conf/GENERIC64 user/mjacob/sys/sparc64/include/pmap.h user/mjacob/sys/sparc64/sparc64/pmap.c user/mjacob/sys/sys/bus.h user/mjacob/sys/ufs/ffs/ffs_vnops.c user/mjacob/sys/vm/device_pager.c user/mjacob/sys/vm/sg_pager.c user/mjacob/sys/vm/vm_page.c user/mjacob/sys/vm/vm_page.h user/mjacob/sys/vm/vm_pageout.c user/mjacob/sys/vm/vnode_pager.c user/mjacob/sys/x86/x86/busdma_machdep.c user/mjacob/sys/x86/x86/tsc.c Directory Properties: user/mjacob/sys/ (props changed) user/mjacob/sys/boot/ (props changed) user/mjacob/sys/cddl/contrib/opensolaris/ (props changed) user/mjacob/sys/conf/ (props changed) Modified: user/mjacob/sys/amd64/amd64/elf_machdep.c ============================================================================== --- user/mjacob/sys/amd64/amd64/elf_machdep.c Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/amd64/amd64/elf_machdep.c Wed Aug 8 04:28:45 2012 (r239136) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: user/mjacob/sys/amd64/amd64/initcpu.c ============================================================================== --- user/mjacob/sys/amd64/amd64/initcpu.c Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/amd64/amd64/initcpu.c Wed Aug 8 04:28:45 2012 (r239136) @@ -91,11 +91,17 @@ init_amd(void) * * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf + * + * Hypervisors do not provide access to the errata MSR, + * causing #GP exception on attempt to apply the errata. The + * MSR write shall be done on host and persist globally + * anyway, so do not try to do it when under virtualization. */ switch (CPUID_TO_FAMILY(cpu_id)) { case 0x10: case 0x12: - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + if ((cpu_feature2 & CPUID2_HV) == 0) + wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } } Modified: user/mjacob/sys/amd64/amd64/pmap.c ============================================================================== --- user/mjacob/sys/amd64/amd64/pmap.c Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/amd64/amd64/pmap.c Wed Aug 8 04:28:45 2012 (r239136) @@ -3468,7 +3468,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, newpte |= PG_G; newpte |= pmap_cache_bits(m->md.pat_mode, 0); - mpte = om = NULL; + mpte = NULL; lock = NULL; rw_rlock(&pvh_global_lock); @@ -3540,12 +3540,6 @@ retry: if (((origpte ^ newpte) & ~(PG_M | PG_A)) == 0) goto unchanged; goto validate; - } else { - /* - * Yes, fall through to validate the new mapping. - */ - if ((origpte & PG_MANAGED) != 0) - om = PHYS_TO_VM_PAGE(opa); } } else { /* @@ -3578,6 +3572,7 @@ validate: opa = origpte & PG_FRAME; if (opa != pa) { if ((origpte & PG_MANAGED) != 0) { + om = PHYS_TO_VM_PAGE(opa); if ((origpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(om); Modified: user/mjacob/sys/arm/arm/bcopyinout.S ============================================================================== --- user/mjacob/sys/arm/arm/bcopyinout.S Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/arm/arm/bcopyinout.S Wed Aug 8 04:28:45 2012 (r239136) @@ -39,6 +39,7 @@ #include "assym.s" #include +#include .L_arm_memcpy: .word _C_LABEL(_arm_memcpy) @@ -310,7 +311,7 @@ ENTRY(copyin) RET .Lcopyfault: - mov r0, #14 /* EFAULT */ + ldr r0, =EFAULT str r5, [r4, #PCB_ONFAULT] RESTORE_REGS Modified: user/mjacob/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- user/mjacob/sys/arm/arm/bcopyinout_xscale.S Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/arm/arm/bcopyinout_xscale.S Wed Aug 8 04:28:45 2012 (r239136) @@ -108,6 +108,7 @@ ENTRY(copyin) ldmfd sp!, {r10-r11, pc} .Lcopyin_fault: + ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ @@ -559,6 +560,7 @@ ENTRY(copyout) ldmfd sp!, {r10-r11, pc} .Lcopyout_fault: + ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ Modified: user/mjacob/sys/arm/arm/exception.S ============================================================================== --- user/mjacob/sys/arm/arm/exception.S Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/arm/arm/exception.S Wed Aug 8 04:28:45 2012 (r239136) @@ -80,7 +80,10 @@ ASENTRY_NP(swi_entry) PUSHFRAME mov r0, sp /* Pass the frame to any function */ + mov r6, sp /* Backup the stack pointer */ + bic sp, sp, #7 /* Align the stack pointer */ bl _C_LABEL(swi_handler) /* It's a SWI ! */ + mov sp, r6 /* Restore the stack */ DO_AST PULLFRAME Modified: user/mjacob/sys/arm/arm/pmap.c ============================================================================== --- user/mjacob/sys/arm/arm/pmap.c Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/arm/arm/pmap.c Wed Aug 8 04:28:45 2012 (r239136) @@ -154,6 +154,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -165,7 +166,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: user/mjacob/sys/boot/common/Makefile.inc ============================================================================== --- user/mjacob/sys/boot/common/Makefile.inc Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/boot/common/Makefile.inc Wed Aug 8 04:28:45 2012 (r239136) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= boot.c commands.c console.c devopen.c disk.c interp.c +SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -24,6 +24,18 @@ SRCS+= load_elf64.c reloc_elf64.c SRCS+= dev_net.c .endif +.if !defined(LOADER_NO_DISK_SUPPORT) +SRCS+= disk.c part.c +CFLAGS+= -DLOADER_DISK_SUPPORT +.if !defined(LOADER_NO_GPT_SUPPORT) +SRCS+= crc32.c +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif +.if !defined(LOADER_NO_MBR_SUPPORT) +CFLAGS+= -DLOADER_MBR_SUPPORT +.endif +.endif + .if defined(HAVE_BCACHE) SRCS+= bcache.c .endif Modified: user/mjacob/sys/boot/common/disk.c ============================================================================== --- user/mjacob/sys/boot/common/disk.c Wed Aug 8 00:20:30 2012 (r239135) +++ user/mjacob/sys/boot/common/disk.c Wed Aug 8 04:28:45 2012 (r239136) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Michael Smith + * Copyright (c) 2012 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,26 +28,11 @@ #include __FBSDID("$FreeBSD$"); -/* - * MBR/GPT partitioned disk device handling. - * - * Ideas and algorithms from: - * - * - NetBSD libi386/biosdisk.c - * - FreeBSD biosboot/disk.c - * - */ - +#include #include - -#include -#include -#include - #include -#include - #include +#include #include "disk.h" @@ -56,53 +42,26 @@ __FBSDID("$FreeBSD$"); # define DEBUG(fmt, args...) #endif -/* - * Search for a slice with the following preferences: - * - * 1: Active FreeBSD slice - * 2: Non-active FreeBSD slice - * 3: Active Linux slice - * 4: non-active Linux slice - * 5: Active FAT/FAT32 slice - * 6: non-active FAT/FAT32 slice - */ -#define PREF_RAWDISK 0 -#define PREF_FBSD_ACT 1 -#define PREF_FBSD 2 -#define PREF_LINUX_ACT 3 -#define PREF_LINUX 4 -#define PREF_DOS_ACT 5 -#define PREF_DOS 6 -#define PREF_NONE 7 - -#ifdef LOADER_GPT_SUPPORT - -struct gpt_part { - int gp_index; - uuid_t gp_type; - uint64_t gp_start; - uint64_t gp_end; +struct open_disk { + struct ptable *table; + off_t mediasize; + u_int sectorsize; }; -static uuid_t efi = GPT_ENT_TYPE_EFI; -static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; - -#endif - -#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT) +struct print_args { + struct disk_devdesc *dev; + const char *prefix; + int verbose; +}; -/* Given a size in 512 byte sectors, convert it to a human-readable number. */ +/* Convert size to a human-readable number. */ static char * -display_size(uint64_t size) +display_size(uint64_t size, u_int sectorsize) { static char buf[80]; char unit; - size /= 2; + size = size * sectorsize / 1024; unit = 'K'; if (size >= 10485760000LL) { size /= 1073741824; @@ -114,687 +73,230 @@ display_size(uint64_t size) size /= 1024; unit = 'M'; } - sprintf(buf, "%.6ld%cB", (long)size, unit); + sprintf(buf, "%ld%cB", (long)size, unit); return (buf); } -#endif - -#ifdef LOADER_MBR_SUPPORT - -static void -disk_checkextended(struct disk_devdesc *dev, - struct dos_partition *slicetab, int slicenum, int *nslicesp) -{ - uint8_t buf[DISK_SECSIZE]; - struct dos_partition *dp; - uint32_t base; - int rc, i, start, end; - - dp = &slicetab[slicenum]; - start = *nslicesp; - - if (dp->dp_size == 0) - goto done; - if (dp->dp_typ != DOSPTYP_EXT) - goto done; - rc = dev->d_dev->dv_strategy(dev, F_READ, dp->dp_start, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) - goto done; - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no magic in extended table"); - goto done; - } - base = dp->dp_start; - dp = (struct dos_partition *) &buf[DOSPARTOFF]; - for (i = 0; i < NDOSPART; i++, dp++) { - if (dp->dp_size == 0) - continue; - if (*nslicesp == NEXTDOSPART) - goto done; - dp->dp_start += base; - bcopy(dp, &slicetab[*nslicesp], sizeof(*dp)); - (*nslicesp)++; - } - end = *nslicesp; - - /* - * now, recursively check the slices we just added - */ - for (i = start; i < end; i++) - disk_checkextended(dev, slicetab, i, nslicesp); -done: - return; -} - -static int -disk_readslicetab(struct disk_devdesc *dev, - struct dos_partition **slicetabp, int *nslicesp) -{ - struct dos_partition *slicetab = NULL; - int nslices, i; - int rc; - uint8_t buf[DISK_SECSIZE]; - - /* - * Find the slice in the DOS slice table. - */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (rc); - } - - /* - * Check the slice table magic. - */ - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no slice table/MBR (no magic)"); - return (rc); - } - - /* - * copy the partition table, then pick up any extended partitions. - */ - slicetab = malloc(NEXTDOSPART * sizeof(struct dos_partition)); - bcopy(buf + DOSPARTOFF, slicetab, - sizeof(struct dos_partition) * NDOSPART); - nslices = NDOSPART; /* extended slices start here */ - for (i = 0; i < NDOSPART; i++) - disk_checkextended(dev, slicetab, i, &nslices); - - *slicetabp = slicetab; - *nslicesp = nslices; - return (0); -} - -/* - * Search for the best MBR slice (typically the first FreeBSD slice). - */ -static int -disk_bestslice(struct dos_partition *slicetab, int nslices) -{ - struct dos_partition *dp; - int pref, preflevel; - int i, prefslice; - - prefslice = 0; - preflevel = PREF_NONE; - - dp = &slicetab[0]; - for (i = 0; i < nslices; i++, dp++) { - switch (dp->dp_typ) { - case DOSPTYP_386BSD: /* FreeBSD */ - pref = dp->dp_flag & 0x80 ? PREF_FBSD_ACT : PREF_FBSD; - break; - - case DOSPTYP_LINUX: - pref = dp->dp_flag & 0x80 ? PREF_LINUX_ACT : PREF_LINUX; - break; - - case 0x01: /* DOS/Windows */ - case 0x04: - case 0x06: - case 0x0b: - case 0x0c: - case 0x0e: - pref = dp->dp_flag & 0x80 ? PREF_DOS_ACT : PREF_DOS; - break; - - default: - pref = PREF_NONE; - } - if (pref < preflevel) { - preflevel = pref; - prefslice = i + 1; - } - } - return (prefslice); -} - static int -disk_openmbr(struct disk_devdesc *dev) -{ - struct dos_partition *slicetab = NULL, *dptr; - int nslices, sector, slice; - int rc; - uint8_t buf[DISK_SECSIZE]; - struct disklabel *lp; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); - - /* - * if a slice number was supplied but not found, this is an error. - */ - if (dev->d_slice > 0) { - slice = dev->d_slice - 1; - if (slice >= nslices) { - DEBUG("slice %d not found", slice); - rc = EPART; - goto out; - } - } - - /* - * Check for the historically bogus MBR found on true dedicated disks - */ - if (slicetab[3].dp_typ == DOSPTYP_386BSD && - slicetab[3].dp_start == 0 && slicetab[3].dp_size == 50000) { - sector = 0; - goto unsliced; - } - - /* - * Try to auto-detect the best slice; this should always give - * a slice number - */ - if (dev->d_slice == 0) { - slice = disk_bestslice(slicetab, nslices); - if (slice == -1) { - rc = ENOENT; - goto out; - } - dev->d_slice = slice; - } - - /* - * Accept the supplied slice number unequivocally (we may be looking - * at a DOS partition). - * Note: we number 1-4, offsets are 0-3 - */ - dptr = &slicetab[dev->d_slice - 1]; - sector = dptr->dp_start; - DEBUG("slice entry %d at %d, %d sectors", - dev->d_slice - 1, sector, dptr->dp_size); - -unsliced: - /* - * Now we have the slice offset, look for the partition in the - * disklabel if we have a partition to start with. - * - * XXX we might want to check the label checksum. - */ - if (dev->d_partition < 0) { - /* no partition, must be after the slice */ - DEBUG("opening raw slice"); - dev->d_offset = sector; - rc = 0; - goto out; - } - - rc = dev->d_dev->dv_strategy(dev, F_READ, sector + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) { - DEBUG("error reading disklabel"); - goto out; - } - - lp = (struct disklabel *) buf; - - if (lp->d_magic != DISKMAGIC) { - DEBUG("no disklabel"); - rc = ENOENT; - goto out; - } - if (dev->d_partition >= lp->d_npartitions) { - DEBUG("partition '%c' exceeds partitions in table (a-'%c')", - 'a' + dev->d_partition, - 'a' + lp->d_npartitions); - rc = EPART; - goto out; - } - - dev->d_offset = - lp->d_partitions[dev->d_partition].p_offset - - lp->d_partitions[RAW_PART].p_offset + - sector; - rc = 0; - -out: - if (slicetab) - free(slicetab); - return (rc); -} - -/* - * Print out each valid partition in the disklabel of a FreeBSD slice. - * For size calculations, we assume a 512 byte sector size. - */ -static void -disk_printbsdslice(struct disk_devdesc *dev, daddr_t offset, - char *prefix, int verbose) +ptblread(void *d, void *buf, size_t blocks, off_t offset) { - char line[80]; - char buf[DISK_SECSIZE]; - struct disklabel *lp; - int i, rc, fstype; - - /* read disklabel */ - rc = dev->d_dev->dv_strategy(dev, F_READ, offset + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) - return; - lp =(struct disklabel *)(&buf[0]); - if (lp->d_magic != DISKMAGIC) { - sprintf(line, "%s: FFS bad disklabel\n", prefix); - pager_output(line); - return; - } + struct disk_devdesc *dev; + struct open_disk *od; - /* Print partitions */ - for (i = 0; i < lp->d_npartitions; i++) { - /* - * For each partition, make sure we know what type of fs it - * is. If not, then skip it. - */ - fstype = lp->d_partitions[i].p_fstype; - if (fstype != FS_BSDFFS && - fstype != FS_SWAP && - fstype != FS_VINUM) - continue; - - /* Only print out statistics in verbose mode */ - if (verbose) - sprintf(line, " %s%c: %s %s (%d - %d)\n", - prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap " : - (fstype == FS_VINUM) ? "vinum" : - "FFS ", - display_size(lp->d_partitions[i].p_size), - lp->d_partitions[i].p_offset, - (lp->d_partitions[i].p_offset - + lp->d_partitions[i].p_size)); - else - sprintf(line, " %s%c: %s\n", prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap" : - (fstype == FS_VINUM) ? "vinum" : - "FFS"); - pager_output(line); - } + dev = (struct disk_devdesc *)d; + od = (struct open_disk *)dev->d_opendata; + return (dev->d_dev->dv_strategy(dev, F_READ, offset, + blocks * od->sectorsize, (char *)buf, NULL)); } +#define PWIDTH 35 static void -disk_printslice(struct disk_devdesc *dev, int slice, - struct dos_partition *dp, char *prefix, int verbose) +ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { - char stats[80]; + struct print_args *pa, bsd; + struct open_disk *od; + struct ptable *table; char line[80]; - if (verbose) - sprintf(stats, " %s (%d - %d)", display_size(dp->dp_size), - dp->dp_start, dp->dp_start + dp->dp_size); - else - stats[0] = '\0'; - - switch (dp->dp_typ) { - case DOSPTYP_386BSD: - disk_printbsdslice(dev, (daddr_t)dp->dp_start, - prefix, verbose); - return; - case DOSPTYP_LINSWP: - sprintf(line, "%s: Linux swap%s\n", prefix, stats); - break; - case DOSPTYP_LINUX: - /* - * XXX - * read the superblock to confirm this is an ext2fs partition? - */ - sprintf(line, "%s: ext2fs%s\n", prefix, stats); - break; - case 0x00: /* unused partition */ - case DOSPTYP_EXT: - return; - case 0x01: - sprintf(line, "%s: FAT-12%s\n", prefix, stats); - break; - case 0x04: - case 0x06: - case 0x0e: - sprintf(line, "%s: FAT-16%s\n", prefix, stats); - break; - case 0x07: - sprintf(line, "%s: NTFS/HPFS%s\n", prefix, stats); - break; - case 0x0b: - case 0x0c: - sprintf(line, "%s: FAT-32%s\n", prefix, stats); - break; - default: - sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_typ, - stats); - } + pa = (struct print_args *)arg; + od = (struct open_disk *)pa->dev->d_opendata; + sprintf(line, " %s%s: %s", pa->prefix, pname, + parttype2str(part->type)); + if (pa->verbose) + sprintf(line, "%-*s%s", PWIDTH, line, + display_size(part->end - part->start + 1, + od->sectorsize)); + strcat(line, "\n"); pager_output(line); -} - -static int -disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose) -{ - struct dos_partition *slicetab; - int nslices, i; - int rc; - char line[80]; - - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); - for (i = 0; i < nslices; i++) { - sprintf(line, "%ss%d", prefix, i + 1); - disk_printslice(dev, i, &slicetab[i], line, verbose); - } - free(slicetab); - return (0); -} - -#endif - -#ifdef LOADER_GPT_SUPPORT - -static int -disk_readgpt(struct disk_devdesc *dev, struct gpt_part **gptp, int *ngptp) -{ - struct dos_partition *dp; - struct gpt_hdr *hdr; - struct gpt_ent *ent; - struct gpt_part *gptab = NULL; - int entries_per_sec, rc, i, part; - daddr_t lba, elba; - uint8_t gpt[DISK_SECSIZE], tbl[DISK_SECSIZE]; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = 0; - - /* First, read the MBR and see if we have a PMBR. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (EIO); + if (part->type == PART_FREEBSD) { + /* Open slice with BSD label */ + pa->dev->d_offset = part->start; + table = ptable_open(pa->dev, part->end - part->start + 1, + od->sectorsize, ptblread); + if (table == NULL) + return; + sprintf(line, " %s%s", pa->prefix, pname); + bsd.dev = pa->dev; + bsd.prefix = line; + bsd.verbose = pa->verbose; + ptable_iterate(table, &bsd, ptable_print); + ptable_close(table); } - - /* Check the slice table magic. */ - if (tbl[0x1fe] != 0x55 || tbl[0x1ff] != 0xaa) - return (ENXIO); - - /* Check for GPT slice. */ - part = 0; - dp = (struct dos_partition *)(tbl + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { - if (dp[i].dp_typ == 0xee) - part++; - else if ((part != 1) && (dp[i].dp_typ != 0x00)) - return (EINVAL); - } - if (part != 1) - return (EINVAL); - - /* Read primary GPT table header. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 1, DISK_SECSIZE, - (char *) gpt, NULL); - if (rc) { - DEBUG("error reading GPT header"); - return (EIO); - } - hdr = (struct gpt_hdr *)gpt; - if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || - hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 || - hdr->hdr_entsz < sizeof(*ent) || - DISK_SECSIZE % hdr->hdr_entsz != 0) { - DEBUG("Invalid GPT header\n"); - return (EINVAL); - } - - /* Walk the partition table to count valid partitions. */ - part = 0; - entries_per_sec = DISK_SECSIZE / hdr->hdr_entsz; - elba = hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - return (EIO); - } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - part++; - } - } - - /* Save the important information about all the valid partitions. */ - if (part != 0) { - gptab = malloc(part * sizeof(struct gpt_part)); - part = 0; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - free(gptab); - return (EIO); - } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - gptab[part].gp_index = (lba - hdr->hdr_lba_table) * - entries_per_sec + i + 1; - gptab[part].gp_type = ent->ent_type; - gptab[part].gp_start = ent->ent_lba_start; - gptab[part].gp_end = ent->ent_lba_end; - part++; - } - } - } - - *gptp = gptab; - *ngptp = part; - return (0); } +#undef PWIDTH -static struct gpt_part * -disk_bestgpt(struct gpt_part *gpt, int ngpt) +void +disk_print(struct disk_devdesc *dev, char *prefix, int verbose) { - struct gpt_part *gp, *prefpart; - int i, pref, preflevel; - - prefpart = NULL; - preflevel = PREF_NONE; + struct open_disk *od; + struct print_args pa; - gp = gpt; - for (i = 0; i < ngpt; i++, gp++) { - /* Windows. XXX: Also Linux. */ - if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL)) - pref = PREF_DOS; - /* FreeBSD */ - else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL) || - uuid_equal(&gp->gp_type, &freebsd_zfs, NULL)) - pref = PREF_FBSD; - else - pref = PREF_NONE; - if (pref < preflevel) { - preflevel = pref; - prefpart = gp; - } - } - return (prefpart); + /* Disk should be opened */ + od = (struct open_disk *)dev->d_opendata; + pa.dev = dev; + pa.prefix = prefix; + pa.verbose = verbose; + ptable_iterate(od->table, &pa, ptable_print); } -static int -disk_opengpt(struct disk_devdesc *dev) +int +disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize) { - struct gpt_part *gpt = NULL, *gp; - int rc, ngpt, i; + struct open_disk *od; + struct ptable *table; + struct ptable_entry part; + int rc; - rc = disk_readgpt(dev, &gpt, &ngpt); - if (rc) - return (rc); - - /* Is this a request for the whole disk? */ - if (dev->d_slice < 0) { - dev->d_offset = 0; - rc = 0; - goto out; + od = (struct open_disk *)malloc(sizeof(struct open_disk)); + if (od == NULL) { + DEBUG("no memory"); + return (ENOMEM); } - /* - * If a partition number was supplied, then the user is trying to use - * an MBR address rather than a GPT address, so fail. + * While we are reading disk metadata, make sure we do it relative + * to the start of the disk */ - if (dev->d_partition != 0xff) { - rc = ENOENT; + rc = 0; + table = NULL; + dev->d_offset = 0; + dev->d_opendata = od; + od->mediasize = mediasize; + od->sectorsize = sectorsize; + DEBUG("open '%s', unit %d slice %d partition %d", + disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition); + + /* Determine disk layout. */ + od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, + ptblread); + if (od->table == NULL) { + DEBUG("Can't read partition table"); + rc = ENXIO; goto out; } - - /* If a slice number was supplied but not found, this is an error. */ - gp = NULL; if (dev->d_slice > 0) { - for (i = 0; i < ngpt; i++) { - if (gpt[i].gp_index == dev->d_slice) { - gp = &gpt[i]; - break; - } - } - if (gp == NULL) { - DEBUG("partition %d not found", dev->d_slice); - rc = ENOENT; + /* Try to get information about partition */ + rc = ptable_getpart(od->table, &part, dev->d_slice); + if (rc != 0) /* Partition doesn't exist */ goto out; - } - } - - /* Try to auto-detect the best partition. */ - if (dev->d_slice == 0) { - gp = disk_bestgpt(gpt, ngpt); - if (gp == NULL) { - rc = ENOENT; + dev->d_offset = part.start; + if (dev->d_partition == -1 || + dev->d_partition == 255) + goto out; /* Nothing more to do */ + + /* Try to read BSD label */ + table = ptable_open(dev, part.end - part.start + 1, + od->sectorsize, ptblread); + if (table == NULL) { + DEBUG("Can't read BSD label"); + rc = ENXIO; goto out; } - dev->d_slice = gp->gp_index; + rc = ptable_getpart(table, &part, dev->d_partition); + if (rc != 0) + goto out; + dev->d_offset += part.start; + } else if (dev->d_slice == 0) { + rc = ptable_getbestpart(od->table, &part); + if (rc != 0) + goto out; + /* Save the slice number of best partition to dev */ + dev->d_slice = part.index; + dev->d_offset = part.start; } - - dev->d_offset = gp->gp_start; - rc = 0; - out: - if (gpt) - free(gpt); + if (table != NULL) + ptable_close(table); + if (rc != 0) { + if (od->table != NULL) + ptable_close(od->table); + free(od); + } return (rc); } -static void -disk_printgptpart(struct disk_devdesc *dev, struct gpt_part *gp, - char *prefix, int verbose) +int +disk_close(struct disk_devdesc *dev) { - char stats[80]; - char line[96]; - - if (verbose) - sprintf(stats, " %s", - display_size(gp->gp_end + 1 - gp->gp_start)); - else - stats[0] = '\0'; - - if (uuid_equal(&gp->gp_type, &efi, NULL)) - sprintf(line, "%s: EFI %s\n", prefix, stats); - else if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL)) - sprintf(line, "%s: FAT/NTFS %s\n", prefix, stats); - else if (uuid_equal(&gp->gp_type, &freebsd_boot, NULL)) - sprintf(line, "%s: FreeBSD boot%s\n", prefix, stats); - else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL)) - sprintf(line, "%s: FreeBSD UFS %s\n", prefix, stats); - else if (uuid_equal(&gp->gp_type, &freebsd_zfs, NULL)) - sprintf(line, "%s: FreeBSD ZFS %s\n", prefix, stats); - else if (uuid_equal(&gp->gp_type, &freebsd_swap, NULL)) - sprintf(line, "%s: FreeBSD swap%s\n", prefix, stats); - else - sprintf(line, - "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n", - prefix, - gp->gp_type.time_low, gp->gp_type.time_mid, - gp->gp_type.time_hi_and_version, - gp->gp_type.clock_seq_hi_and_reserved, - gp->gp_type.clock_seq_low, - gp->gp_type.node[0], - gp->gp_type.node[1], - gp->gp_type.node[2], - gp->gp_type.node[3], - gp->gp_type.node[4], - gp->gp_type.node[5], - stats); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***