From owner-svn-src-user@FreeBSD.ORG Sun Dec 22 00:22:58 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6EE1F2E; Sun, 22 Dec 2013 00:22:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 873641E9C; Sun, 22 Dec 2013 00:22:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM0Mwqu081241; Sun, 22 Dec 2013 00:22:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM0Mvil081237; Sun, 22 Dec 2013 00:22:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312220022.rBM0Mvil081237@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Dec 2013 00:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259704 - user/nwhitehorn/mips_pic_if/mips/atheros X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 22 Dec 2013 00:22:58 -0000 Author: nwhitehorn Date: Sun Dec 22 00:22:57 2013 New Revision: 259704 URL: http://svnweb.freebsd.org/changeset/base/259704 Log: Speculative conversion of AR71XX to pic_if. Compile-tested only. Modified: user/nwhitehorn/mips_pic_if/mips/atheros/apb.c user/nwhitehorn/mips_pic_if/mips/atheros/apbvar.h user/nwhitehorn/mips_pic_if/mips/atheros/ar71xx_pci.c Modified: user/nwhitehorn/mips_pic_if/mips/atheros/apb.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/atheros/apb.c Sun Dec 22 00:08:20 2013 (r259703) +++ user/nwhitehorn/mips_pic_if/mips/atheros/apb.c Sun Dec 22 00:22:57 2013 (r259704) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" + #define APB_INTR_PMC 5 #undef APB_DEBUG @@ -73,15 +75,10 @@ static int apb_filter(void *); static int apb_probe(device_t); static int apb_release_resource(device_t, device_t, int, int, struct resource *); -static int apb_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); -static int apb_teardown_intr(device_t, device_t, struct resource *, - void *); static void -apb_mask_irq(void *source) +apb_mask_irq(device_t dev, u_int irq) { - unsigned int irq = (unsigned int)source; uint32_t reg; reg = ATH_READ_REG(AR71XX_MISC_INTR_MASK); @@ -90,10 +87,9 @@ apb_mask_irq(void *source) } static void -apb_unmask_irq(void *source) +apb_unmask_irq(device_t dev, u_int irq) { uint32_t reg; - unsigned int irq = (unsigned int)source; reg = ATH_READ_REG(AR71XX_MISC_INTR_MASK); ATH_WRITE_REG(AR71XX_MISC_INTR_MASK, reg | (1 << irq)); @@ -144,6 +140,9 @@ apb_attach(device_t dev) return (ENXIO); } + /* Register this interrupt domain */ + mips_register_pic(dev, APB_PIC_ID, APB_NIRQS, 0); + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); bus_generic_attach(dev); @@ -151,8 +150,7 @@ apb_attach(device_t dev) /* * Unmask performance counter IRQ */ - apb_unmask_irq((void*)APB_INTR_PMC); - sc->sc_intr_counter[APB_INTR_PMC] = mips_intrcnt_create("apb irq5: pmc"); + apb_unmask_irq(dev, APB_INTR_PMC); return (0); } @@ -278,73 +276,24 @@ apb_release_resource(device_t dev, devic return (0); } -static int -apb_setup_intr(device_t bus, device_t child, struct resource *ires, - int flags, driver_filter_t *filt, driver_intr_t *handler, - void *arg, void **cookiep) +static void +apb_enable_irq(device_t bus, u_int irq, u_int vector) { struct apb_softc *sc = device_get_softc(bus); - struct intr_event *event; - int irq, error; - - irq = rman_get_start(ires); if (irq > APB_IRQ_END) panic("%s: bad irq %d", __func__, irq); - event = sc->sc_eventstab[irq]; - if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - apb_mask_irq, apb_unmask_irq, - NULL, NULL, - "apb intr%d:", irq); - - if (error == 0) { - sc->sc_eventstab[irq] = event; - sc->sc_intr_counter[irq] = - mips_intrcnt_create(event->ie_name); - } - else - return (error); - } + sc->sc_eventstab[irq] = vector; - intr_event_add_handler(event, device_get_nameunit(child), filt, - handler, arg, intr_priority(flags), flags, cookiep); - mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname); - - apb_unmask_irq((void*)irq); - - return (0); -} - -static int -apb_teardown_intr(device_t dev, device_t child, struct resource *ires, - void *cookie) -{ - struct apb_softc *sc = device_get_softc(dev); - int irq, result; - - irq = rman_get_start(ires); - if (irq > APB_IRQ_END) - panic("%s: bad irq %d", __func__, irq); - - if (sc->sc_eventstab[irq] == NULL) - panic("Trying to teardown unoccupied IRQ"); - - apb_mask_irq((void*)irq); - - result = intr_event_remove_handler(cookie); - if (!result) - sc->sc_eventstab[irq] = NULL; - - return (result); + apb_unmask_irq(bus, irq); } static int apb_filter(void *arg) { struct apb_softc *sc = arg; - struct intr_event *event; + u_int vector; uint32_t reg, irq; struct thread *td; struct trapframe *tf; @@ -371,27 +320,18 @@ apb_filter(void *arg) break; } - event = sc->sc_eventstab[irq]; - if (!event || TAILQ_EMPTY(&event->ie_handlers)) { - if (irq == APB_INTR_PMC) { - td = PCPU_GET(curthread); - tf = td->td_intr_frame; - - if (pmc_intr) - (*pmc_intr)(PCPU_GET(cpuid), tf); - - mips_intrcnt_inc(sc->sc_intr_counter[irq]); - - continue; - } - /* Ignore timer interrupts */ - if (irq != 0) - printf("Stray APB IRQ %d\n", irq); + vector = sc->sc_eventstab[irq]; + if (irq == APB_INTR_PMC) { + td = PCPU_GET(curthread); + tf = td->td_intr_frame; + + if (pmc_intr) + (*pmc_intr)(PCPU_GET(cpuid), tf); + continue; } - intr_event_handle(event, PCPU_GET(curthread)->td_intr_frame); - mips_intrcnt_inc(sc->sc_intr_counter[irq]); + mips_dispatch_intr(vector, NULL); } } @@ -433,7 +373,8 @@ apb_hinted_child(device_t bus, const cha } if (resource_int_value(dname, dunit, "irq", &irq) == 0) { - result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); + result = bus_set_resource(child, SYS_RES_IRQ, 0, + mips_get_irq(APB_PIC_ID, irq), 1); if (result != 0) device_printf(bus, "warning: bus_set_resource() failed\n"); @@ -485,13 +426,18 @@ static device_method_t apb_methods[] = { DEVMETHOD(bus_get_resource_list, apb_get_resource_list), DEVMETHOD(bus_hinted_child, apb_hinted_child), DEVMETHOD(bus_release_resource, apb_release_resource), - DEVMETHOD(bus_setup_intr, apb_setup_intr), - DEVMETHOD(bus_teardown_intr, apb_teardown_intr), DEVMETHOD(device_attach, apb_attach), DEVMETHOD(device_probe, apb_probe), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + /* PIC interface */ + DEVMETHOD(pic_enable, apb_enable_irq), + DEVMETHOD(pic_mask, apb_mask_irq), + DEVMETHOD(pic_unmask, apb_unmask_irq), + DEVMETHOD_END }; Modified: user/nwhitehorn/mips_pic_if/mips/atheros/apbvar.h ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/atheros/apbvar.h Sun Dec 22 00:08:20 2013 (r259703) +++ user/nwhitehorn/mips_pic_if/mips/atheros/apbvar.h Sun Dec 22 00:22:57 2013 (r259704) @@ -31,16 +31,15 @@ #define APB_IRQ_BASE 0 #define APB_IRQ_END 7 #define APB_NIRQS 8 +#define APB_PIC_ID 0x100 /* FDT-ize? */ struct apb_softc { struct rman apb_irq_rman; struct rman apb_mem_rman; - /* IRQ events structs for child devices */ - struct intr_event *sc_eventstab[APB_NIRQS]; - mips_intrcnt_t sc_intr_counter[APB_NIRQS]; /* Resources and cookies for MIPS CPU INTs */ struct resource *sc_misc_irq; void *sc_misc_ih; + u_int sc_eventstab[APB_NIRQS]; }; struct apb_ivar { Modified: user/nwhitehorn/mips_pic_if/mips/atheros/ar71xx_pci.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/atheros/ar71xx_pci.c Sun Dec 22 00:08:20 2013 (r259703) +++ user/nwhitehorn/mips_pic_if/mips/atheros/ar71xx_pci.c Sun Dec 22 00:22:57 2013 (r259704) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include "pcib_if.h" +#include "pic_if.h" #include #include @@ -77,6 +78,8 @@ struct mtx ar71xx_pci_mtx; MTX_SYSINIT(ar71xx_pci_mtx, &ar71xx_pci_mtx, "ar71xx PCI space mutex", MTX_SPIN); +#define AR71XX_PCI_PIC_ID 0x200 + struct ar71xx_pci_softc { device_t sc_dev; @@ -85,23 +88,17 @@ struct ar71xx_pci_softc { struct rman sc_mem_rman; struct rman sc_irq_rman; - struct intr_event *sc_eventstab[AR71XX_PCI_NIRQS]; - mips_intrcnt_t sc_intr_counter[AR71XX_PCI_NIRQS]; + u_int sc_eventstab[AR71XX_PCI_NIRQS]; struct resource *sc_irq; void *sc_ih; }; -static int ar71xx_pci_setup_intr(device_t, device_t, struct resource *, int, - driver_filter_t *, driver_intr_t *, void *, void **); -static int ar71xx_pci_teardown_intr(device_t, device_t, struct resource *, - void *); static int ar71xx_pci_intr(void *); static void -ar71xx_pci_mask_irq(void *source) +ar71xx_pci_mask_irq(device_t dev, u_int irq) { uint32_t reg; - unsigned int irq = (unsigned int)source; /* XXX is the PCI lock required here? */ reg = ATH_READ_REG(AR71XX_PCI_INTR_MASK); @@ -111,10 +108,9 @@ ar71xx_pci_mask_irq(void *source) } static void -ar71xx_pci_unmask_irq(void *source) +ar71xx_pci_unmask_irq(device_t dev, u_int irq) { uint32_t reg; - unsigned int irq = (unsigned int)source; /* XXX is the PCI lock required here? */ reg = ATH_READ_REG(AR71XX_PCI_INTR_MASK); @@ -463,6 +459,9 @@ ar71xx_pci_attach(device_t dev) #endif /* AR71XX_ATH_EEPROM */ device_add_child(dev, "pci", busno); + + mips_register_pic(dev, AR71XX_PCI_PIC_ID, AR71XX_PCI_NIRQS, 0); + return (bus_generic_attach(dev)); } @@ -553,72 +552,23 @@ ar71xx_pci_activate_resource(device_t bu return (res); } -static int -ar71xx_pci_setup_intr(device_t bus, device_t child, struct resource *ires, - int flags, driver_filter_t *filt, driver_intr_t *handler, - void *arg, void **cookiep) +static void +ar71xx_pci_enable_intr(device_t bus, u_int irq, u_int vector) { struct ar71xx_pci_softc *sc = device_get_softc(bus); - struct intr_event *event; - int irq, error; - - irq = rman_get_start(ires); - - if (irq > AR71XX_PCI_IRQ_END) - panic("%s: bad irq %d", __func__, irq); - - event = sc->sc_eventstab[irq]; - if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - ar71xx_pci_mask_irq, ar71xx_pci_unmask_irq, NULL, NULL, - "pci intr%d:", irq); - - if (error == 0) { - sc->sc_eventstab[irq] = event; - sc->sc_intr_counter[irq] = - mips_intrcnt_create(event->ie_name); - } - else - return (error); - } - intr_event_add_handler(event, device_get_nameunit(child), filt, - handler, arg, intr_priority(flags), flags, cookiep); - mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname); - - ar71xx_pci_unmask_irq((void*)irq); - - return (0); -} - -static int -ar71xx_pci_teardown_intr(device_t dev, device_t child, struct resource *ires, - void *cookie) -{ - struct ar71xx_pci_softc *sc = device_get_softc(dev); - int irq, result; - - irq = rman_get_start(ires); if (irq > AR71XX_PCI_IRQ_END) panic("%s: bad irq %d", __func__, irq); - if (sc->sc_eventstab[irq] == NULL) - panic("Trying to teardown unoccupied IRQ"); - - ar71xx_pci_mask_irq((void*)irq); + sc->sc_eventstab[irq] = vector; - result = intr_event_remove_handler(cookie); - if (!result) - sc->sc_eventstab[irq] = NULL; - - return (result); + ar71xx_pci_unmask_irq(bus, irq); } static int ar71xx_pci_intr(void *arg) { struct ar71xx_pci_softc *sc = arg; - struct intr_event *event; uint32_t reg, irq, mask; reg = ATH_READ_REG(AR71XX_PCI_INTR_STATUS); @@ -629,20 +579,11 @@ ar71xx_pci_intr(void *arg) reg &= mask; for (irq = AR71XX_PCI_IRQ_START; irq <= AR71XX_PCI_IRQ_END; irq++) { if (reg & (1 << irq)) { - event = sc->sc_eventstab[irq]; - if (!event || TAILQ_EMPTY(&event->ie_handlers)) { - /* Ignore timer interrupts */ - if (irq != 0) - printf("Stray IRQ %d\n", irq); - continue; - } - /* Flush DDR FIFO for IP2 */ ar71xx_device_ddr_flush_ip2(); /* TODO: frame instead of NULL? */ - intr_event_handle(event, NULL); - mips_intrcnt_inc(sc->sc_intr_counter[irq]); + mips_dispatch_intr(sc->sc_eventstab[irq], NULL); } } @@ -665,7 +606,8 @@ ar71xx_pci_route_interrupt(device_t pcib panic("%s: PCI slot %d is less then AR71XX_PCI_BASE_SLOT", __func__, pci_get_slot(device)); - return (pci_get_slot(device) - sc->sc_baseslot); + return (mips_get_irq(AR71XX_PCI_PIC_ID, pci_get_slot(device) - + sc->sc_baseslot)); } static device_method_t ar71xx_pci_methods[] = { @@ -683,8 +625,8 @@ static device_method_t ar71xx_pci_method DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource, ar71xx_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, ar71xx_pci_setup_intr), - DEVMETHOD(bus_teardown_intr, ar71xx_pci_teardown_intr), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), /* pcib interface */ DEVMETHOD(pcib_maxslots, ar71xx_pci_maxslots), @@ -692,6 +634,11 @@ static device_method_t ar71xx_pci_method DEVMETHOD(pcib_write_config, ar71xx_pci_write_config), DEVMETHOD(pcib_route_interrupt, ar71xx_pci_route_interrupt), + /* PIC interface */ + DEVMETHOD(pic_enable, ar71xx_pci_enable_intr), + DEVMETHOD(pic_mask, ar71xx_pci_mask_irq), + DEVMETHOD(pic_unmask, ar71xx_pci_unmask_irq), + DEVMETHOD_END }; From owner-svn-src-user@FreeBSD.ORG Sun Dec 22 00:56:06 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31C2C6A5; Sun, 22 Dec 2013 00:56:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF8D1065; Sun, 22 Dec 2013 00:56:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBM0u5u2092255; Sun, 22 Dec 2013 00:56:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBM0u5Sg092254; Sun, 22 Dec 2013 00:56:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312220056.rBM0u5Sg092254@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Dec 2013 00:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259706 - user/nwhitehorn/mips_pic_if/mips/mips X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 22 Dec 2013 00:56:06 -0000 Author: nwhitehorn Date: Sun Dec 22 00:56:05 2013 New Revision: 259706 URL: http://svnweb.freebsd.org/changeset/base/259706 Log: Fix build with SMP. Modified: user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c Modified: user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c Sun Dec 22 00:45:08 2013 (r259705) +++ user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c Sun Dec 22 00:56:05 2013 (r259706) @@ -398,7 +398,7 @@ mips_enable_intr(void) ("%s: SMP root PIC does not supply any IPIs", __func__)); error = mips_setup_intr("IPI", - MAP_IRQ(piclist[n].node, piclist[n].irqs), + mips_get_irq(piclist[n].node, piclist[n].irqs), mips_ipi_handler, NULL, NULL, INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); if (error) { From owner-svn-src-user@FreeBSD.ORG Sun Dec 22 14:13:01 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27E64CD7; Sun, 22 Dec 2013 14:13:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 088C31FE8; Sun, 22 Dec 2013 14:13:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMED0X9079031; Sun, 22 Dec 2013 14:13:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMED0kq079025; Sun, 22 Dec 2013 14:13:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312221413.rBMED0kq079025@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Dec 2013 14:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259723 - user/nwhitehorn/mips_pic_if/mips/mips X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 22 Dec 2013 14:13:01 -0000 Author: nwhitehorn Date: Sun Dec 22 14:13:00 2013 New Revision: 259723 URL: http://svnweb.freebsd.org/changeset/base/259723 Log: SMP fixes. Modified: user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c user/nwhitehorn/mips_pic_if/mips/mips/mp_machdep.c user/nwhitehorn/mips_pic_if/mips/mips/nexus.c Modified: user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c Sun Dec 22 13:03:33 2013 (r259722) +++ user/nwhitehorn/mips_pic_if/mips/mips/intr_machdep.c Sun Dec 22 14:13:00 2013 (r259723) @@ -78,6 +78,7 @@ #include #include +#include #include #include #include @@ -377,9 +378,6 @@ mips_enable_intr(void) { struct mips_intr *i; int error, vector; -#ifdef SMP - int n; -#endif if (npics == 0) panic("no PIC detected\n"); @@ -390,21 +388,13 @@ mips_enable_intr(void) #ifdef SMP /* Install an IPI handler. */ if (mp_ncpus > 1) { - for (n = 0; n < npics; n++) { - if (piclist[n].dev != root_pic) - continue; - - KASSERT(piclist[n].ipis != 0, - ("%s: SMP root PIC does not supply any IPIs", - __func__)); - error = mips_setup_intr("IPI", - mips_get_irq(piclist[n].node, piclist[n].irqs), - mips_ipi_handler, NULL, NULL, - INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); - if (error) { - printf("unable to setup IPI handler\n"); - return (error); - } + error = mips_setup_intr("IPI", + platform_ipi_intrnum(), + mips_ipi_handler, NULL, NULL, + INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); + if (error) { + printf("unable to setup IPI handler\n"); + return (error); } } #endif Modified: user/nwhitehorn/mips_pic_if/mips/mips/mp_machdep.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/mips/mp_machdep.c Sun Dec 22 13:03:33 2013 (r259722) +++ user/nwhitehorn/mips_pic_if/mips/mips/mp_machdep.c Sun Dec 22 14:13:00 2013 (r259723) @@ -110,7 +110,7 @@ ipi_cpu(int cpu, u_int ipi) /* * Handle an IPI sent to this processor. */ -static int +int mips_ipi_handler(void *arg) { u_int cpu, ipi, ipi_bitmap; @@ -338,18 +338,10 @@ smp_init_secondary(u_int32_t cpuid) static void release_aps(void *dummy __unused) { - int ipi_irq; if (mp_ncpus == 1) return; - /* - * IPI handler - */ - ipi_irq = platform_ipi_intrnum(); - cpu_establish_hardintr("ipi", mips_ipi_handler, NULL, NULL, ipi_irq, - INTR_TYPE_MISC | INTR_EXCL, NULL); - atomic_store_rel_int(&aps_ready, 1); while (smp_started == 0) Modified: user/nwhitehorn/mips_pic_if/mips/mips/nexus.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/mips/nexus.c Sun Dec 22 13:03:33 2013 (r259722) +++ user/nwhitehorn/mips_pic_if/mips/mips/nexus.c Sun Dec 22 14:13:00 2013 (r259723) @@ -529,7 +529,7 @@ nexus_bind_intr(device_t bus __unused, d struct resource *r, int cpu) { - return (powerpc_bind_intr(rman_get_start(r), cpu)); + return (mips_bind_intr(rman_get_start(r), cpu)); } #endif From owner-svn-src-user@FreeBSD.ORG Sun Dec 22 14:39:05 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC4353BB; Sun, 22 Dec 2013 14:39:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CC62F111B; Sun, 22 Dec 2013 14:39:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMEd5PL087464; Sun, 22 Dec 2013 14:39:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMEd4sj087457; Sun, 22 Dec 2013 14:39:04 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312221439.rBMEd4sj087457@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Dec 2013 14:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259725 - user/nwhitehorn/mips_pic_if/mips/nlm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 22 Dec 2013 14:39:06 -0000 Author: nwhitehorn Date: Sun Dec 22 14:39:04 2013 New Revision: 259725 URL: http://svnweb.freebsd.org/changeset/base/259725 Log: Convert to pic_if. Added: user/nwhitehorn/mips_pic_if/mips/nlm/nlm_ic.c - copied, changed from r259687, user/nwhitehorn/mips_pic_if/mips/nlm/intr_machdep.c Deleted: user/nwhitehorn/mips_pic_if/mips/nlm/intr_machdep.c Modified: user/nwhitehorn/mips_pic_if/mips/nlm/cms.c user/nwhitehorn/mips_pic_if/mips/nlm/files.xlp user/nwhitehorn/mips_pic_if/mips/nlm/interrupt.h user/nwhitehorn/mips_pic_if/mips/nlm/tick.c user/nwhitehorn/mips_pic_if/mips/nlm/xlp_pci.c Modified: user/nwhitehorn/mips_pic_if/mips/nlm/cms.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/cms.c Sun Dec 22 14:14:53 2013 (r259724) +++ user/nwhitehorn/mips_pic_if/mips/nlm/cms.c Sun Dec 22 14:39:04 2013 (r259725) @@ -443,8 +443,8 @@ xlp_msgring_config(void *arg) #endif xlp_cms_credit_setup(CMS_DEFAULT_CREDIT); create_msgring_thread(0); - cpu_establish_hardintr("msgring", msgring_process_fast_intr, NULL, - NULL, IRQ_MSGRING, INTR_TYPE_NET, &cookie); + mips_setup_intr("msgring", IRQ_MSGRING, msgring_process_fast_intr, NULL, + NULL, INTR_TYPE_NET, &cookie); } /* Modified: user/nwhitehorn/mips_pic_if/mips/nlm/files.xlp ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/files.xlp Sun Dec 22 14:14:53 2013 (r259724) +++ user/nwhitehorn/mips_pic_if/mips/nlm/files.xlp Sun Dec 22 14:39:04 2013 (r259725) @@ -2,7 +2,7 @@ mips/nlm/hal/nlm_hal.c standard mips/nlm/hal/fmn.c standard mips/nlm/xlp_machdep.c standard -mips/nlm/intr_machdep.c standard +mips/nlm/nlm_ic.c standard mips/nlm/tick.c standard mips/nlm/board.c standard mips/nlm/cms.c standard Modified: user/nwhitehorn/mips_pic_if/mips/nlm/interrupt.h ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/interrupt.h Sun Dec 22 14:14:53 2013 (r259724) +++ user/nwhitehorn/mips_pic_if/mips/nlm/interrupt.h Sun Dec 22 14:39:04 2013 (r259725) @@ -42,9 +42,7 @@ * XLR needs custom pre and post handlers for PCI/PCI-e interrupts * XXX: maybe follow i386 intsrc model */ -void xlp_establish_intr(const char *name, driver_filter_t filt, - driver_intr_t handler, void *arg, int irq, int flags, - void **cookiep, void (*busack)(int)); +void xlp_set_bus_ack(u_int irq, void (*busack)(int)); void xlp_enable_irq(int irq); #endif /* _RMI_INTERRUPT_H_ */ Copied and modified: user/nwhitehorn/mips_pic_if/mips/nlm/nlm_ic.c (from r259687, user/nwhitehorn/mips_pic_if/mips/nlm/intr_machdep.c) ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/intr_machdep.c Sat Dec 21 17:24:31 2013 (r259687, copy source) +++ user/nwhitehorn/mips_pic_if/mips/nlm/nlm_ic.c Sun Dec 22 14:39:04 2013 (r259725) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -53,79 +54,69 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" + +#define XLR_MAX_INTR 64 + struct xlp_intrsrc { void (*busack)(int); /* Additional ack */ - struct intr_event *ie; /* event corresponding to intr */ - int irq; + u_int vector; /* event corresponding to intr */ + u_int irq; }; static struct xlp_intrsrc xlp_interrupts[XLR_MAX_INTR]; -static mips_intrcnt_t mips_intr_counters[XLR_MAX_INTR]; -static int intrcnt_index; -void -xlp_enable_irq(int irq) +static void +xlp_ic_identify(driver_t *driver, device_t parent) { - uint64_t eimr; - eimr = nlm_read_c0_eimr(); - nlm_write_c0_eimr(eimr | (1ULL << irq)); + if (device_find_child(parent, "xlpic", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "xlpic", 0); } -void -cpu_establish_softintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, - void **cookiep) +static int +xlp_ic_probe(device_t dev) { - panic("Soft interrupts unsupported!\n"); + /* XXX: use FDT? */ + device_set_desc(dev, "XLP Root Interrupt Controller"); + return (BUS_PROBE_NOWILDCARD); } -void -cpu_establish_hardintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, - void **cookiep) +static int +xlp_ic_attach(device_t dev) { - xlp_establish_intr(name, filt, handler, arg, irq, flags, - cookiep, NULL); -} + mips_register_pic(dev, 0, XLR_MAX_INTR, 1); + root_pic = dev; -static void -xlp_post_filter(void *source) -{ - struct xlp_intrsrc *src = source; - - if (src->busack) - src->busack(src->irq); - nlm_pic_ack(xlp_pic_base, xlp_irq_to_irt(src->irq)); + return (0); } -static void -xlp_pre_ithread(void *source) +void +xlp_enable_irq(int irq) { - struct xlp_intrsrc *src = source; + uint64_t eimr; - if (src->busack) - src->busack(src->irq); + eimr = nlm_read_c0_eimr(); + nlm_write_c0_eimr(eimr | (1ULL << irq)); } static void -xlp_post_ithread(void *source) +xlp_eoi(device_t dev, u_int irq) { - struct xlp_intrsrc *src = source; + struct xlp_intrsrc *src = &xlp_interrupts[irq]; + + if (src->busack) + src->busack(src->irq); nlm_pic_ack(xlp_pic_base, xlp_irq_to_irt(src->irq)); } -void -xlp_establish_intr(const char *name, driver_filter_t filt, - driver_intr_t handler, void *arg, int irq, int flags, - void **cookiep, void (*busack)(int)) +static void +xlp_enable(device_t dev, u_int irq, u_int vector) { - struct intr_event *ie; /* descriptor for the IRQ */ struct xlp_intrsrc *src = NULL; - int errcode; if (irq < 0 || irq > XLR_MAX_INTR) panic("%s called for unknown hard intr %d", __func__, irq); @@ -135,39 +126,27 @@ xlp_establish_intr(const char *name, dri * startup from CPU0 */ src = &xlp_interrupts[irq]; - ie = src->ie; - if (ie == NULL) { - /* - * PIC based interrupts need ack in PIC, and some SoC - * components need additional acks (e.g. PCI) - */ - if (XLP_IRQ_IS_PICINTR(irq)) - errcode = intr_event_create(&ie, src, 0, irq, - xlp_pre_ithread, xlp_post_ithread, xlp_post_filter, - NULL, "hard intr%d:", irq); - else { - if (filt == NULL) - panic("Unsupported non filter percpu intr %d", irq); - errcode = intr_event_create(&ie, src, 0, irq, - NULL, NULL, NULL, NULL, "hard intr%d:", irq); - } - if (errcode) { - printf("Could not create event for intr %d\n", irq); - return; - } - src->irq = irq; - src->busack = busack; - src->ie = ie; - } - intr_event_add_handler(ie, name, filt, handler, arg, - intr_priority(flags), flags, cookiep); + /* + * PIC based interrupts need ack in PIC, and some SoC + * components need additional acks (e.g. PCI) + */ + + src->irq = irq; + src->vector = vector; + xlp_enable_irq(irq); } void -cpu_intr(struct trapframe *tf) +xlp_set_bus_ack(u_int irq, void (*busack)(int)) +{ + + xlp_interrupts[irq].busack = busack; +} + +static void +xlp_dispatch(device_t dev, struct trapframe *tf) { - struct intr_event *ie; uint64_t eirr, eimr; int i; @@ -187,7 +166,7 @@ cpu_intr(struct trapframe *tf) * compare which ACKs the interrupt. */ if (eirr & (1 << IRQ_TIMER)) { - intr_event_handle(xlp_interrupts[IRQ_TIMER].ie, tf); + mips_dispatch_intr(xlp_interrupts[IRQ_TIMER].vector, tf); critical_exit(); return; } @@ -197,57 +176,36 @@ cpu_intr(struct trapframe *tf) if ((eirr & (1ULL << i)) == 0) continue; - ie = xlp_interrupts[i].ie; - /* Don't account special IRQs */ - switch (i) { - case IRQ_IPI: - case IRQ_MSGRING: - break; - default: - mips_intrcnt_inc(mips_intr_counters[i]); - } - /* Ack the IRQ on the CPU */ nlm_write_c0_eirr(1ULL << i); - if (intr_event_handle(ie, tf) != 0) { - printf("stray interrupt %d\n", i); - } + + mips_dispatch_intr(xlp_interrupts[i].vector, tf); } critical_exit(); } -void -mips_intrcnt_setname(mips_intrcnt_t counter, const char *name) -{ - int idx = counter - intrcnt; - - KASSERT(counter != NULL, ("mips_intrcnt_setname: NULL counter")); +static device_method_t xlp_ic_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, xlp_ic_identify), + DEVMETHOD(device_probe, xlp_ic_probe), + DEVMETHOD(device_attach, xlp_ic_attach), + + /* PIC interface */ + DEVMETHOD(pic_dispatch, xlp_dispatch), + DEVMETHOD(pic_enable, xlp_enable), + DEVMETHOD(pic_eoi, xlp_eoi), - snprintf(intrnames + (MAXCOMLEN + 1) * idx, - MAXCOMLEN + 1, "%-*s", MAXCOMLEN, name); -} - -mips_intrcnt_t -mips_intrcnt_create(const char* name) -{ - mips_intrcnt_t counter = &intrcnt[intrcnt_index++]; - - mips_intrcnt_setname(counter, name); - return counter; -} + DEVMETHOD_END, +}; -void -cpu_init_interrupts() -{ - int i; - char name[MAXCOMLEN + 1]; +static driver_t xlp_ic_driver = { + "xlpic", + xlp_ic_methods, + 0 +}; + +static devclass_t xlp_ic_devclass; + +EARLY_DRIVER_MODULE(xlpic, nexus, xlp_ic_driver, xlp_ic_devclass, 0, 0, + BUS_PASS_INTERRUPT); - /* - * Initialize all available vectors so spare IRQ - * would show up in systat output - */ - for (i = 0; i < XLR_MAX_INTR; i++) { - snprintf(name, MAXCOMLEN + 1, "int%d:", i); - mips_intr_counters[i] = mips_intrcnt_create(name); - } -} Modified: user/nwhitehorn/mips_pic_if/mips/nlm/tick.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/tick.c Sun Dec 22 14:14:53 2013 (r259724) +++ user/nwhitehorn/mips_pic_if/mips/nlm/tick.c Sun Dec 22 14:39:04 2013 (r259725) @@ -334,8 +334,8 @@ clock_attach(device_t dev) panic("can't attach more clocks"); softc = sc = device_get_softc(dev); - cpu_establish_hardintr("compare", clock_intr, NULL, - sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler); + mips_setup_intr("compare", IRQ_TIMER, clock_intr, NULL, + sc, INTR_TYPE_CLK, &sc->intr_handler); sc->tc.tc_get_timecount = counter_get_timecount; sc->tc.tc_counter_mask = 0xffffffff; Modified: user/nwhitehorn/mips_pic_if/mips/nlm/xlp_pci.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/nlm/xlp_pci.c Sun Dec 22 14:14:53 2013 (r259724) +++ user/nwhitehorn/mips_pic_if/mips/nlm/xlp_pci.c Sun Dec 22 14:39:04 2013 (r259725) @@ -723,8 +723,7 @@ mips_platform_pcib_setup_intr(device_t d extra_ack = NULL; if (xlpirq >= PIC_PCIE_0_IRQ && xlpirq <= PIC_PCIE_3_IRQ) extra_ack = bridge_pcie_ack; - xlp_establish_intr(device_get_name(child), filt, - intr, arg, xlpirq, flags, cookiep, extra_ack); + xlp_set_bus_ack(xlpirq, extra_ack); return (0); } From owner-svn-src-user@FreeBSD.ORG Sun Dec 22 14:57:38 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A15DD7A4; Sun, 22 Dec 2013 14:57:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C470121D; Sun, 22 Dec 2013 14:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBMEvchw094133; Sun, 22 Dec 2013 14:57:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBMEvbME094126; Sun, 22 Dec 2013 14:57:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312221457.rBMEvbME094126@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 22 Dec 2013 14:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259726 - user/nwhitehorn/mips_pic_if/mips/rmi X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 22 Dec 2013 14:57:38 -0000 Author: nwhitehorn Date: Sun Dec 22 14:57:36 2013 New Revision: 259726 URL: http://svnweb.freebsd.org/changeset/base/259726 Log: Convert to use pic_if. Added: user/nwhitehorn/mips_pic_if/mips/rmi/rmi_ic.c - copied, changed from r259687, user/nwhitehorn/mips_pic_if/mips/rmi/intr_machdep.c Deleted: user/nwhitehorn/mips_pic_if/mips/rmi/intr_machdep.c Modified: user/nwhitehorn/mips_pic_if/mips/rmi/files.xlr user/nwhitehorn/mips_pic_if/mips/rmi/fmn.c user/nwhitehorn/mips_pic_if/mips/rmi/interrupt.h user/nwhitehorn/mips_pic_if/mips/rmi/iodi.c user/nwhitehorn/mips_pic_if/mips/rmi/tick.c user/nwhitehorn/mips_pic_if/mips/rmi/xlr_pci.c Modified: user/nwhitehorn/mips_pic_if/mips/rmi/files.xlr ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/files.xlr Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/files.xlr Sun Dec 22 14:57:36 2013 (r259726) @@ -8,7 +8,7 @@ mips/rmi/msgring.c standard mips/rmi/msgring_xls.c standard mips/rmi/board.c standard mips/rmi/fmn.c standard -mips/rmi/intr_machdep.c standard +mips/rmi/rmi_ic.c standard mips/rmi/mpwait.S optional smp mips/rmi/xlr_i2c.c optional iic mips/rmi/uart_bus_xlr_iodi.c optional uart Modified: user/nwhitehorn/mips_pic_if/mips/rmi/fmn.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/fmn.c Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/fmn.c Sun Dec 22 14:57:36 2013 (r259726) @@ -434,9 +434,9 @@ register_msgring_handler(int startb, int create_msgring_thread(0); if (msgring_maxthreads > xlr_threads_per_core) msgring_maxthreads = xlr_threads_per_core; - cpu_establish_hardintr("msgring", msgring_process_fast_intr, - NULL, NULL, IRQ_MSGRING, - INTR_TYPE_NET, &cookie); + mips_setup_intr("msgring", IRQ_MSGRING, + msgring_process_fast_intr, NULL, NULL, + INTR_TYPE_NET, &cookie); } return (0); } Modified: user/nwhitehorn/mips_pic_if/mips/rmi/interrupt.h ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/interrupt.h Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/interrupt.h Sun Dec 22 14:57:36 2013 (r259726) @@ -42,9 +42,7 @@ * XLR needs custom pre and post handlers for PCI/PCI-e interrupts * XXX: maybe follow i386 intsrc model */ -void xlr_establish_intr(const char *name, driver_filter_t filt, - driver_intr_t handler, void *arg, int irq, int flags, - void **cookiep, void (*busack)(int)); +void xlr_set_bus_ack(u_int irq, void (*busack)(int)); void xlr_enable_irq(int irq); #endif /* _RMI_INTERRUPT_H_ */ Modified: user/nwhitehorn/mips_pic_if/mips/rmi/iodi.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/iodi.c Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/iodi.c Sun Dec 22 14:57:36 2013 (r259726) @@ -101,24 +101,25 @@ iodi_setup_intr(device_t dev, device_t c if (strcmp(name, "uart") == 0) { /* FIXME uart 1? */ - cpu_establish_hardintr("uart", filt, intr, arg, - PIC_UART_0_IRQ, flags, cookiep); + mips_setup_intr("uart", PIC_UART_0_IRQ, filt, intr, arg, + flags, cookiep); pic_setup_intr(PIC_IRT_UART_0_INDEX, PIC_UART_0_IRQ, 0x1, 1); } else if (strcmp(name, "rge") == 0 || strcmp(name, "nlge") == 0) { int irq; /* This is a hack to pass in the irq */ irq = (intptr_t)ires->__r_i; - cpu_establish_hardintr("rge", filt, intr, arg, irq, flags, + mips_setup_intr("rge", irq, filt, intr, arg, flags, cookiep); pic_setup_intr(irq - PIC_IRQ_BASE, irq, 0x1, 1); } else if (strcmp(name, "ehci") == 0) { - cpu_establish_hardintr("ehci", filt, intr, arg, PIC_USB_IRQ, flags, + mips_setup_intr("ehci", PIC_USB_IRQ, filt, intr, arg, flags, cookiep); pic_setup_intr(PIC_USB_IRQ - PIC_IRQ_BASE, PIC_USB_IRQ, 0x1, 1); } else if (strcmp(name, "ata") == 0) { - xlr_establish_intr("ata", filt, intr, arg, PIC_PCMCIA_IRQ, flags, - cookiep, bridge_pcmcia_ack); + mips_setup_intr("ata", PIC_PCMCIA_IRQ, filt, intr, arg, flags, + cookiep); + xlr_set_bus_ack(PIC_PCMCIA_IRQ, bridge_pcmcia_ack); pic_setup_intr(PIC_PCMCIA_IRQ - PIC_IRQ_BASE, PIC_PCMCIA_IRQ, 0x1, 1); } return (0); Copied and modified: user/nwhitehorn/mips_pic_if/mips/rmi/rmi_ic.c (from r259687, user/nwhitehorn/mips_pic_if/mips/rmi/intr_machdep.c) ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/intr_machdep.c Sat Dec 21 17:24:31 2013 (r259687, copy source) +++ user/nwhitehorn/mips_pic_if/mips/rmi/rmi_ic.c Sun Dec 22 14:57:36 2013 (r259726) @@ -1,40 +1,44 @@ /*- - * Copyright (c) 2006-2009 RMI Corporation - * Copyright (c) 2002-2004 Juli Mallett - * All rights reserved. + * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights + * reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * modification, are permitted provided that the following conditions are + * met: * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY Netlogic Microsystems ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. * - */ + * NETLOGIC_BSD */ #include __FBSDID("$FreeBSD$"); #include #include +#include #include -#include +#include #include +#include +#include #include #include #include @@ -43,85 +47,74 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include + +#include "pic_if.h" #include #include #include +#define XLR_MAX_INTR 64 + struct xlr_intrsrc { void (*busack)(int); /* Additional ack */ - struct intr_event *ie; /* event corresponding to intr */ - int irq; + u_int vector; /* event corresponding to intr */ + u_int irq; }; static struct xlr_intrsrc xlr_interrupts[XLR_MAX_INTR]; -static mips_intrcnt_t mips_intr_counters[XLR_MAX_INTR]; -static int intrcnt_index; -void -xlr_enable_irq(int irq) +static void +xlr_ic_identify(driver_t *driver, device_t parent) { - uint64_t eimr; - eimr = read_c0_eimr64(); - write_c0_eimr64(eimr | (1ULL << irq)); + if (device_find_child(parent, "xlric", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "xlric", 0); } -void -cpu_establish_softintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, - void **cookiep) +static int +xlr_ic_probe(device_t dev) { - panic("Soft interrupts unsupported!\n"); + /* XXX: use FDT? */ + device_set_desc(dev, "XLR Root Interrupt Controller"); + return (BUS_PROBE_NOWILDCARD); } -void -cpu_establish_hardintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, - void **cookiep) +static int +xlr_ic_attach(device_t dev) { - xlr_establish_intr(name, filt, handler, arg, irq, flags, - cookiep, NULL); -} + mips_register_pic(dev, 0, XLR_MAX_INTR, 1); + root_pic = dev; -static void -xlr_post_filter(void *source) -{ - struct xlr_intrsrc *src = source; - - if (src->busack) - src->busack(src->irq); - pic_ack(PIC_IRQ_TO_INTR(src->irq)); + return (0); } -static void -xlr_pre_ithread(void *source) +void +xlr_enable_irq(int irq) { - struct xlr_intrsrc *src = source; + uint64_t eimr; - if (src->busack) - src->busack(src->irq); + eimr = read_c0_eimr64(); + write_c0_eimr64(eimr | (1ULL << irq)); } static void -xlr_post_ithread(void *source) +xlr_eoi(device_t dev, u_int irq) { - struct xlr_intrsrc *src = source; + struct xlr_intrsrc *src = &xlr_interrupts[irq]; + + if (src->busack) + src->busack(src->irq); pic_ack(PIC_IRQ_TO_INTR(src->irq)); } -void -xlr_establish_intr(const char *name, driver_filter_t filt, - driver_intr_t handler, void *arg, int irq, int flags, - void **cookiep, void (*busack)(int)) +static void +xlr_enable(device_t dev, u_int irq, u_int vector) { - struct intr_event *ie; /* descriptor for the IRQ */ struct xlr_intrsrc *src = NULL; - int errcode; if (irq < 0 || irq > XLR_MAX_INTR) panic("%s called for unknown hard intr %d", __func__, irq); @@ -131,39 +124,27 @@ xlr_establish_intr(const char *name, dri * startup from CPU0 */ src = &xlr_interrupts[irq]; - ie = src->ie; - if (ie == NULL) { - /* - * PIC based interrupts need ack in PIC, and some SoC - * components need additional acks (e.g. PCI) - */ - if (PIC_IRQ_IS_PICINTR(irq)) - errcode = intr_event_create(&ie, src, 0, irq, - xlr_pre_ithread, xlr_post_ithread, xlr_post_filter, - NULL, "hard intr%d:", irq); - else { - if (filt == NULL) - panic("Not supported - non filter percpu intr"); - errcode = intr_event_create(&ie, src, 0, irq, - NULL, NULL, NULL, NULL, "hard intr%d:", irq); - } - if (errcode) { - printf("Could not create event for intr %d\n", irq); - return; - } - src->irq = irq; - src->busack = busack; - src->ie = ie; - } - intr_event_add_handler(ie, name, filt, handler, arg, - intr_priority(flags), flags, cookiep); + /* + * PIC based interrupts need ack in PIC, and some SoC + * components need additional acks (e.g. PCI) + */ + + src->irq = irq; + src->vector = vector; + xlr_enable_irq(irq); } void -cpu_intr(struct trapframe *tf) +xlr_set_bus_ack(u_int irq, void (*busack)(int)) +{ + + xlr_interrupts[irq].busack = busack; +} + +static void +xlr_dispatch(device_t dev, struct trapframe *tf) { - struct intr_event *ie; uint64_t eirr, eimr; int i; @@ -183,7 +164,7 @@ cpu_intr(struct trapframe *tf) * compare which ACKs the interrupt. */ if (eirr & (1 << IRQ_TIMER)) { - intr_event_handle(xlr_interrupts[IRQ_TIMER].ie, tf); + mips_dispatch_intr(xlr_interrupts[IRQ_TIMER].vector, tf); critical_exit(); return; } @@ -193,57 +174,36 @@ cpu_intr(struct trapframe *tf) if ((eirr & (1ULL << i)) == 0) continue; - ie = xlr_interrupts[i].ie; - /* Don't account special IRQs */ - switch (i) { - case IRQ_IPI: - case IRQ_MSGRING: - break; - default: - mips_intrcnt_inc(mips_intr_counters[i]); - } - /* Ack the IRQ on the CPU */ write_c0_eirr64(1ULL << i); - if (intr_event_handle(ie, tf) != 0) { - printf("stray interrupt %d\n", i); - } + + mips_dispatch_intr(xlr_interrupts[i].vector, tf); } critical_exit(); } -void -mips_intrcnt_setname(mips_intrcnt_t counter, const char *name) -{ - int idx = counter - intrcnt; - - KASSERT(counter != NULL, ("mips_intrcnt_setname: NULL counter")); - - snprintf(intrnames + (MAXCOMLEN + 1) * idx, - MAXCOMLEN + 1, "%-*s", MAXCOMLEN, name); -} - -mips_intrcnt_t -mips_intrcnt_create(const char* name) -{ - mips_intrcnt_t counter = &intrcnt[intrcnt_index++]; +static device_method_t xlr_ic_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, xlr_ic_identify), + DEVMETHOD(device_probe, xlr_ic_probe), + DEVMETHOD(device_attach, xlr_ic_attach), + + /* PIC interface */ + DEVMETHOD(pic_dispatch, xlr_dispatch), + DEVMETHOD(pic_enable, xlr_enable), + DEVMETHOD(pic_eoi, xlr_eoi), - mips_intrcnt_setname(counter, name); - return counter; -} + DEVMETHOD_END, +}; -void -cpu_init_interrupts() -{ - int i; - char name[MAXCOMLEN + 1]; +static driver_t xlr_ic_driver = { + "xlric", + xlr_ic_methods, + 0 +}; + +static devclass_t xlr_ic_devclass; + +EARLY_DRIVER_MODULE(xlric, nexus, xlr_ic_driver, xlr_ic_devclass, 0, 0, + BUS_PASS_INTERRUPT); - /* - * Initialize all available vectors so spare IRQ - * would show up in systat output - */ - for (i = 0; i < XLR_MAX_INTR; i++) { - snprintf(name, MAXCOMLEN + 1, "int%d:", i); - mips_intr_counters[i] = mips_intrcnt_create(name); - } -} Modified: user/nwhitehorn/mips_pic_if/mips/rmi/tick.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/tick.c Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/tick.c Sun Dec 22 14:57:36 2013 (r259726) @@ -331,8 +331,8 @@ clock_attach(device_t dev) panic("can't attach more clocks"); softc = sc = device_get_softc(dev); - cpu_establish_hardintr("compare", clock_intr, NULL, - sc, IRQ_TIMER, INTR_TYPE_CLK, &sc->intr_handler); + mips_setup_intr("compare", IRQ_TIMER, clock_intr, NULL, + sc, INTR_TYPE_CLK, &sc->intr_handler); sc->tc.tc_get_timecount = counter_get_timecount; sc->tc.tc_counter_mask = 0xffffffff; Modified: user/nwhitehorn/mips_pic_if/mips/rmi/xlr_pci.c ============================================================================== --- user/nwhitehorn/mips_pic_if/mips/rmi/xlr_pci.c Sun Dec 22 14:39:04 2013 (r259725) +++ user/nwhitehorn/mips_pic_if/mips/rmi/xlr_pci.c Sun Dec 22 14:57:36 2013 (r259726) @@ -478,8 +478,9 @@ mips_platform_pci_setup_intr(device_t de return (0); if (xlr_board_info.is_xls == 0) { - xlr_establish_intr(device_get_name(child), filt, - intr, arg, PIC_PCIX_IRQ, flags, cookiep, bridge_pcix_ack); + mips_setup_intr(device_get_name(child), PIC_PCIX_IRQ, filt, + intr, arg, flags, cookiep); + xlr_set_bus_ack(PIC_PCIX_IRQ, bridge_pcix_ack); pic_setup_intr(PIC_IRT_PCIX_INDEX, PIC_PCIX_IRQ, 0x1, 1); } else { /* @@ -494,8 +495,9 @@ mips_platform_pci_setup_intr(device_t de if (xlrirq == -1) return (EINVAL); } - xlr_establish_intr(device_get_name(child), filt, - intr, arg, xlrirq, flags, cookiep, bridge_pcie_ack); + mips_setup_intr(device_get_name(child), xlrirq, filt, + intr, arg, flags, cookiep); + xlr_set_bus_ack(xlrirq, bridge_pcie_ack); pic_setup_intr(xlrirq - PIC_IRQ_BASE, xlrirq, 0x1, 1); } From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 21:55:55 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67A93A3B; Mon, 23 Dec 2013 21:55:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5462112BC; Mon, 23 Dec 2013 21:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNLttiE062605; Mon, 23 Dec 2013 21:55:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNLttv8062604; Mon, 23 Dec 2013 21:55:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232155.rBNLttv8062604@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 21:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259791 - user/ae/inet6/sys/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 23 Dec 2013 21:55:55 -0000 Author: ae Date: Mon Dec 23 21:55:54 2013 New Revision: 259791 URL: http://svnweb.freebsd.org/changeset/base/259791 Log: Include INET6 headers not only when DDB is defined. Modified: user/ae/inet6/sys/kern/kern_jail.c Modified: user/ae/inet6/sys/kern/kern_jail.c ============================================================================== --- user/ae/inet6/sys/kern/kern_jail.c Mon Dec 23 21:29:37 2013 (r259790) +++ user/ae/inet6/sys/kern/kern_jail.c Mon Dec 23 21:55:54 2013 (r259791) @@ -66,13 +66,12 @@ __FBSDID("$FreeBSD$"); #include #include - -#ifdef DDB -#include #ifdef INET6 #include #include #endif /* INET6 */ +#ifdef DDB +#include #endif /* DDB */ #include From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 22:00:38 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B93DCD03; Mon, 23 Dec 2013 22:00:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C1E51331; Mon, 23 Dec 2013 22:00:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNM0cZD065686; Mon, 23 Dec 2013 22:00:38 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNM0cYJ065685; Mon, 23 Dec 2013 22:00:38 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232200.rBNM0cYJ065685@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 22:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259793 - user/ae/inet6/sys/netinet6 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 23 Dec 2013 22:00:38 -0000 Author: ae Date: Mon Dec 23 22:00:38 2013 New Revision: 259793 URL: http://svnweb.freebsd.org/changeset/base/259793 Log: Use updated prison_xxx_ip6() functions with sockaddr_in6 argument. Modified: user/ae/inet6/sys/netinet6/in6_pcb.c Modified: user/ae/inet6/sys/netinet6/in6_pcb.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6_pcb.c Mon Dec 23 21:58:03 2013 (r259792) +++ user/ae/inet6/sys/netinet6/in6_pcb.c Mon Dec 23 22:00:38 2013 (r259793) @@ -128,9 +128,16 @@ in6_pcbbind(struct inpcb *inp, struct so if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { - if ((error = prison_local_ip6(cred, &inp->in6p_laddr, - ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) + struct sockaddr_in6 tmp; + + tmp = sa6_any; + error = prison_local_ip6(cred, &tmp, + ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)); + if (error != 0) return (error); + inp->in6p_laddr = tmp.sin6_addr; + if (IN6_IS_ADDR_LINKLOCAL(&inp->in6p_laddr)) + inp->in6p_zoneid = tmp.sin6_scope_id; } else { sin6 = (struct sockaddr_in6 *)nam; if (nam->sa_len != sizeof(*sin6)) @@ -142,7 +149,7 @@ in6_pcbbind(struct inpcb *inp, struct so inp->in6p_moptions, sin6)) != 0) return (error); - if ((error = prison_local_ip6(cred, &sin6->sin6_addr, + if ((error = prison_local_ip6(cred, sin6, ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) return (error); @@ -328,7 +335,7 @@ in6_pcbconnect_mbuf(register struct inpc inp->in6p_moptions, sin6); if (error != 0) return (error); - if ((error = prison_remote_ip6(inp->inp_cred, &sin6->sin6_addr)) != 0) + if ((error = prison_remote_ip6(inp->inp_cred, sin6)) != 0) return (error); /* * Determine source address and outgoing interface. @@ -884,8 +891,8 @@ in6_pcblookup_group(struct inpcbinfo *pc injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { - if (prison_check_ip6(inp->inp_cred, - laddr) != 0) + if (prison_check_in6(inp->inp_cred, + laddr, zoneid) != 0) continue; } else { if (local_exact != NULL) @@ -1024,8 +1031,8 @@ in6_pcblookup_hash_locked(struct inpcbin injail = prison_flag(inp->inp_cred, PR_IP6); if (injail) { - if (prison_check_ip6(inp->inp_cred, - laddr) != 0) + if (prison_check_in6(inp->inp_cred, + laddr, zoneid) != 0) continue; } else { if (local_exact != NULL) From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 22:20:48 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34697367; Mon, 23 Dec 2013 22:20:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 081051471; Mon, 23 Dec 2013 22:20:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNMKl9m073237; Mon, 23 Dec 2013 22:20:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNMKlAo073236; Mon, 23 Dec 2013 22:20:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232220.rBNMKlAo073236@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 22:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259795 - user/ae/inet6/sys/netinet6 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 23 Dec 2013 22:20:48 -0000 Author: ae Date: Mon Dec 23 22:20:47 2013 New Revision: 259795 URL: http://svnweb.freebsd.org/changeset/base/259795 Log: Highly simplify, deduplicate and make more readable the socket options handling code. Use new prison_xxx_ip6() functions where they were in original code. Modified: user/ae/inet6/sys/netinet6/in6_src.c Modified: user/ae/inet6/sys/netinet6/in6_src.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6_src.c Mon Dec 23 22:20:00 2013 (r259794) +++ user/ae/inet6/sys/netinet6/in6_src.c Mon Dec 23 22:20:47 2013 (r259795) @@ -130,15 +130,10 @@ VNET_DEFINE(int, ip6_prefer_tempaddr) = static int cached_rtlookup(const struct sockaddr_in6 *dst, struct route_in6 *ro, u_int fibnum); -static int check_scopezones(const struct sockaddr_in6 *dst, - struct route_in6 *ro, u_int fibnum, const struct ip6_moptions *mopts, - const struct in6_addr *src, const struct ifnet *ifp); static int handle_nexthop(struct ip6po_nhinfo *nh, u_int fibnum, struct ifnet **ifpp); -static int handle_pktinfo(const struct sockaddr_in6 *dst, - const struct in6_pktinfo* pi, const struct ip6_moptions *mopts, - struct route_in6 *ro, u_int fibnum, struct ifnet **ifpp, - struct in6_addr *srcp, int *done); +static int handle_pktinfo(const struct in6_pktinfo* pi, struct ifnet **ifpp, + struct in6_addr *srcp); static int lookup_policy_label(const struct in6_addr *, uint32_t); @@ -327,65 +322,20 @@ cached_rtlookup(const struct sockaddr_in return (0); } -static int -check_scopezones(const struct sockaddr_in6 *dst, struct route_in6 *ro, - u_int fibnum, const struct ip6_moptions *mopts, const struct in6_addr *src, - const struct ifnet *ifp) -{ - struct ifnet *oifp; - - oifp = NULL; - /* Determine zone index of destination address. */ - if (IN6_IS_SCOPE_LINKLOCAL(&dst->sin6_addr) || - IN6_IS_ADDR_MC_INTFACELOCAL(&dst->sin6_addr)) { - if (dst->sin6_scope_id == 0) - return (EHOSTUNREACH); - oifp = in6_getlinkifnet(dst->sin6_scope_id); - } else if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr) && - mopts != NULL && mopts->im6o_multicast_ifp != NULL) { - oifp = mopts->im6o_multicast_ifp; - } else { - if (cached_rtlookup(dst, ro, fibnum) == 0) - oifp = ro->ro_rt->rt_ifp; - } - if (oifp == NULL) - return (EHOSTUNREACH); - - if (oifp != ifp && - in6_getscopezone(ifp, in6_srcaddrscope(src)) != - in6_getscopezone(oifp, in6_srcaddrscope(&dst->sin6_addr))) - return (EHOSTUNREACH); - - return (0); -} - /* - * dst - original destination address; * pi - options configured via IPV6_PKTINFO; - * mopts - options configured via IPV6_MULTICAST_IF; - * ro - route to destination; - * fibnum - FIB number * * These parameters are returned back to caller: * ifpp - determined outgoing interface; * srcp - determined source address; - * done - if set, this means that outgoing interface and - * source address were determined. - * - * NOTE: don't forget to RTFREE(ro->ro_rt) after calling this function, - * if needed of course. */ static int -handle_pktinfo(const struct sockaddr_in6 *dst, - const struct in6_pktinfo* pi, const struct ip6_moptions *mopts, - struct route_in6 *ro, u_int fibnum, struct ifnet **ifpp, - struct in6_addr *srcp, int *done) +handle_pktinfo(const struct in6_pktinfo* pi, struct ifnet **ifpp, + struct in6_addr *srcp) { - struct in6_ifaddr *ia; struct ifnet *ifp; ifp = NULL; - *done = 0; if (pi->ipi6_ifindex != 0) { ifp = ifnet_byindex(pi->ipi6_ifindex); if (ifp == NULL) @@ -393,93 +343,11 @@ handle_pktinfo(const struct sockaddr_in6 if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) return (ENETDOWN); } - if (ifp != NULL && IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) { - /* - * If an interface is explicitly specified, use it. - */ + if (ifp != NULL) *ifpp = ifp; + if (IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) return (0); - } - if (ifp != NULL && !IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) { - /* - * If both, address and ifindex are specified via - * IPV6_PKTINFO, then check that address is available - * on this interface. - */ - ia = in6ifa_ifpwithaddr(ifp, &pi->ipi6_addr); - } else { - /* - * If address is specified via IPV6_PKTINFO, but interface - * isn't, we can determine interface for a global unicast - * from the ifaddr hash. - */ - if (!IN6_IS_ADDR_LINKLOCAL(&pi->ipi6_addr)) { - /* ipi6_addr is global. */ - ia = in6ifa_ifwithaddr(&pi->ipi6_addr, 0); - } else if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr)) { - /* ipi6_addr is link-local, dst is multicast. */ - if (mopts != NULL && - mopts->im6o_multicast_ifp != NULL) { - /* - * Outgoing interface is specified via - * IPV6_MULTICAST_IF socket option. - */ - ia = in6ifa_ifpwithaddr( - mopts->im6o_multicast_ifp, &pi->ipi6_addr); - } else if (dst->sin6_scope_id != 0 && ( /* XXX */ - IN6_IS_ADDR_MC_LINKLOCAL(&dst->sin6_addr) || - IN6_IS_ADDR_MC_INTFACELOCAL(&dst->sin6_addr))) { - /* - * Destination multicast address is in the - * link-local or interface-local scope. - * Use its sin6_scope_id to determine - * outgoing interface. - */ - ia = in6ifa_ifwithaddr(&pi->ipi6_addr, - dst->sin6_scope_id); - } else { - /* - * XXX: Try to lookup route for this multicast - * destination address. - */ - if (cached_rtlookup(dst, ro, fibnum) != 0) - return (EHOSTUNREACH); - ia = in6ifa_ifpwithaddr(ro->ro_rt->rt_ifp, - &pi->ipi6_addr); - } - } else if (IN6_IS_ADDR_LINKLOCAL(&dst->sin6_addr)) { - /* both are link-local. */ - ia = in6ifa_ifwithaddr(&pi->ipi6_addr, - dst->sin6_scope_id); - } else { - /* ipi6_addr is link-local, dst is global. */ - if (cached_rtlookup(dst, ro, fibnum) != 0) - return (EHOSTUNREACH); - /* Check that address is available on interface. */ - ia = in6ifa_ifpwithaddr(ro->ro_rt->rt_ifp, - &pi->ipi6_addr); - } - } - if (ia == NULL || ( - ia->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) { - RO_RTFREE(ro); - if (ia != NULL) - ifa_free(&ia->ia_ifa); - return (EADDRNOTAVAIL); - } - ifp = ia->ia_ifp; - ifa_free(&ia->ia_ifa); - /* - * Source address can not break the destination zone. - */ - if (check_scopezones(dst, ro, fibnum, mopts, &pi->ipi6_addr, - ifp) != 0) { - RO_RTFREE(ro); - return (EHOSTUNREACH); - } - *ifpp = ifp; *srcp = pi->ipi6_addr; - *done = 1; return (0); } @@ -495,7 +363,6 @@ static int handle_nexthop(struct ip6po_nhinfo *nh, u_int fibnum, struct ifnet **ifpp) { struct sockaddr_in6 *sa; - struct in6_ifaddr *ia; struct route_in6 *ro; struct ifnet *ifp, *oifp; @@ -508,21 +375,11 @@ handle_nexthop(struct ip6po_nhinfo *nh, * was determined in the PKTINFO handling code. */ oifp = *ifpp; - - /* - * Check that the next hop address is our own. - */ - ia = in6ifa_ifwithaddr(&sa->sin6_addr, sa->sin6_scope_id); - if (ia != NULL) { - /* Address is our own. */ - ifp = ia->ia_ifp; - ifa_free(&ia->ia_ifa); - } else { + if (IN6_IS_ADDR_LINKLOCAL(&sa->sin6_addr)) /* - * Address is not our own. + * Next hop is LLA, thus it should be neighbor. * Determine outgoing interface by zone index. */ - if (IN6_IS_ADDR_LINKLOCAL(&sa->sin6_addr)) ifp = in6_getlinkifnet(sa->sin6_scope_id); else { if (cached_rtlookup(sa, ro, fibnum) != 0) @@ -535,7 +392,6 @@ handle_nexthop(struct ip6po_nhinfo *nh, return (EHOSTUNREACH); ifp = ro->ro_rt->rt_ifp; } - } /* * When the outgoing interface is specified by IPV6_PKTINFO * as well, the next hop specified by this option must be @@ -548,6 +404,34 @@ handle_nexthop(struct ip6po_nhinfo *nh, return (0); } +static int +check_addrs(const struct sockaddr_in6 *src, const struct sockaddr_in6 *dst, + struct ifnet *ifp) +{ + struct in6_ifaddr *ia; + + /* + * Check that source address is available on the interface. + */ + ia = in6ifa_ifpwithaddr(ifp, &src->sin6_addr); + if (ia == NULL || ( + ia->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) { + if (ia != NULL) + ifa_free(&ia->ia_ifa); + return (EADDRNOTAVAIL); + } + ifa_free(&ia->ia_ifa); + /* + * Check that source address does not break the destination + * zone. + */ + if (dst->sin6_scope_id != 0 && + dst->sin6_scope_id != in6_getscopezone(ifp, + in6_srcaddrscope(&dst->sin6_addr))) + return (EHOSTUNREACH); + return (0); +} + int in6_selectsrc(struct sockaddr_in6 *dst, struct ip6_pktopts *opts, struct inpcb *inp, struct route_in6 *ro, struct ucred *cred, @@ -556,37 +440,33 @@ in6_selectsrc(struct sockaddr_in6 *dst, struct route_in6 ro6; struct dstaddr_props dstprops; struct srcaddr_choice best; + struct sockaddr_in6 srcsock; struct ip6_moptions *mopts; - struct in6_pktinfo *pi; struct in6_ifaddr *ia; struct ifaddr *ifa; struct ifnet *ifp, *oifp; u_int fibnum; - int error, done; + int error; KASSERT(srcp != NULL, ("%s: srcp is NULL", __func__)); KASSERT(ifpp != NULL, ("%s: ifpp is NULL", __func__)); KASSERT(sa6_checkzone(dst) == 0, ("%s: invalid zone information", __func__)); - ifp = oifp = NULL; - if (ifpp) { - /* - * Save a possibly passed in ifp for in6_selectsrc. Only - * neighbor discovery code should use this feature, where - * we may know the interface but not the FIB number holding - * the connected subnet in case someone deleted it from the - * default FIB and we need to check the interface. - */ - if (*ifpp != NULL) - oifp = *ifpp; - *ifpp = NULL; - } - + ifp = NULL; + /* + * XXX: Save a possibly passed in ifp for in6_selectsrc. Only + * neighbor discovery code should use this feature, where + * we may know the interface but not the FIB number holding + * the connected subnet in case someone deleted it from the + * default FIB and we need to check the interface. + */ + oifp = *ifpp; if (inp != NULL) { INP_LOCK_ASSERT(inp); mopts = inp->in6p_moptions; fibnum = inp->inp_inc.inc_fibnum; + /* Use "sticky" options if opts isn't specified. */ if (opts == NULL) opts = inp->in6p_outputopts; } else { @@ -597,34 +477,32 @@ in6_selectsrc(struct sockaddr_in6 *dst, ro = &ro6; bzero(ro, sizeof(*ro)); } - - /* - * XXX: jail support MUST be added later! - */ - if (opts != NULL && (pi = opts->ip6po_pktinfo) != NULL) { - error = handle_pktinfo(dst, pi, mopts, ro, fibnum, - &ifp, srcp, &done); + srcsock = sa6_any; + if (opts != NULL && opts->ip6po_pktinfo != NULL) { + error = handle_pktinfo(opts->ip6po_pktinfo, &ifp, + &srcsock.sin6_addr); if (error != 0) return (error); - if (done != 0) { + if (ifp != NULL) { /* * When the outgoing interface is specified by * IPV6_PKTINFO as well, the next hop specified by * this option must be reachable via the specified - * interface. Also, we ignore next hop for multicast - * destinations. + * interface. + * We ignore next hop for multicast destinations. */ if (!IN6_IS_ADDR_MULTICAST(&dst->sin6_addr) && - opts->ip6po_nexthop != NULL) + opts->ip6po_nexthop != NULL) { error = handle_nexthop(&opts->ip6po_nhinfo, fibnum, &ifp); - if (error != 0 || ro == &ro6) - RO_RTFREE(ro); - if (error == 0) - *ifpp = ifp; - return (error); + if (error != 0) + return (error); + } } - } else if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr)) { + } + if (ifp != NULL) + goto oif_found; + if (IN6_IS_ADDR_MULTICAST(&dst->sin6_addr)) { /* * If the destination address is a multicast address and * the IPV6_MULTICAST_IF socket option is specified for the @@ -639,10 +517,11 @@ in6_selectsrc(struct sockaddr_in6 *dst, * or interface-local scope. Use its sin6_scope_id to * determine outgoing interface. */ - ifp = in6_getlinkifnet(dst->sin6_scope_id); + if (dst->sin6_scope_id != 0) + ifp = in6_getlinkifnet(dst->sin6_scope_id); } else { /* - * XXX: Try to lookup route for this multicast + * Try to lookup route for this multicast * destination address. */ if (cached_rtlookup(dst, ro, fibnum) != 0) @@ -659,9 +538,10 @@ in6_selectsrc(struct sockaddr_in6 *dst, * Use sin6_scope_id for link-local addresses. * Do a route lookup for global addresses. */ - if (dst->sin6_scope_id != 0) - ifp = in6_getlinkifnet(dst->sin6_scope_id); - else { + if (IN6_IS_ADDR_LINKLOCAL(&dst->sin6_addr)) { + if (dst->sin6_scope_id != 0) + ifp = in6_getlinkifnet(dst->sin6_scope_id); + } else { if (cached_rtlookup(dst, ro, fibnum) != 0) return (EHOSTUNREACH); ifp = ro->ro_rt->rt_ifp; @@ -673,6 +553,26 @@ in6_selectsrc(struct sockaddr_in6 *dst, /* Use outgoing interface specified by caller. */ ifp = oifp; } +oif_found: + if (!IN6_IS_ADDR_UNSPECIFIED(&srcsock.sin6_addr)) { + if (ro == &ro6) + RO_RTFREE(ro); + if (cred != NULL) { + srcsock.sin6_scope_id = in6_getscopezone(ifp, + in6_srcaddrscope(&srcsock.sin6_addr)); + error = prison_local_ip6(cred, &srcsock, + (inp != NULL && + (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)); + if (error != 0) + return (error); + } + error = check_addrs(&srcsock, dst, ifp); + if (error != 0) + return (error); + *ifpp = ifp; + *srcp = srcsock.sin6_addr; + return (0); + } /* * Otherwise, if the socket has already bound the source, just use it. */ @@ -684,13 +584,19 @@ in6_selectsrc(struct sockaddr_in6 *dst, return (0); } /* - * XXX: Bypass source address selection and use the primary jail IP + * Bypass source address selection and use the primary jail IP * if requested. */ -#if 0 - if (cred != NULL && !prison_saddrsel_ip6(cred, srcp)) + if (cred != NULL && !prison_saddrsel_ip6(cred, &srcsock)) { + if (ro == &ro6) + RO_RTFREE(ro); + error = check_addrs(&srcsock, dst, ifp); + if (error != 0) + return (error); + *ifpp = ifp; + *srcp = srcsock.sin6_addr; return (0); -#endif + } /* * If the address is not specified, choose the best one based on From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 22:26:18 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9024F46F; Mon, 23 Dec 2013 22:26:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 62DEF14D6; Mon, 23 Dec 2013 22:26:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNMQIwa073902; Mon, 23 Dec 2013 22:26:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNMQIo6073901; Mon, 23 Dec 2013 22:26:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232226.rBNMQIo6073901@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 22:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259796 - user/ae/inet6/sys/netinet6 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 23 Dec 2013 22:26:18 -0000 Author: ae Date: Mon Dec 23 22:26:17 2013 New Revision: 259796 URL: http://svnweb.freebsd.org/changeset/base/259796 Log: * Use new prison_xxx_ip6() functions. * rip6_output() always calls in6_selectsrc() where all prison restrictions will be applied, thus no need to call prison_check_ip6() here. * in rip6_bind() move prison_check_ip6() call to be a bit later, when sockaddr_in6 structure will have sin6_scope_id properly initialized. Modified: user/ae/inet6/sys/netinet6/raw_ip6.c Modified: user/ae/inet6/sys/netinet6/raw_ip6.c ============================================================================== --- user/ae/inet6/sys/netinet6/raw_ip6.c Mon Dec 23 22:20:47 2013 (r259795) +++ user/ae/inet6/sys/netinet6/raw_ip6.c Mon Dec 23 22:26:17 2013 (r259796) @@ -166,6 +166,7 @@ rip6_input(struct mbuf **mp, int *offp, struct inpcb *last = 0; struct mbuf *opts = NULL; struct sockaddr_in6 fromsa; + uint32_t zoneid; RIP6STAT_INC(rip6s_ipackets); @@ -176,8 +177,8 @@ rip6_input(struct mbuf **mp, int *offp, } init_sin6(&fromsa, m); /* general init */ - ifp = m->m_pkthdr.rcvif; + zoneid = in6_getscopezone(ifp, IPV6_ADDR_SCOPE_LINKLOCAL); INP_INFO_RLOCK(&V_ripcbinfo); LIST_FOREACH(in6p, &V_ripcb, inp_list) { @@ -200,8 +201,8 @@ rip6_input(struct mbuf **mp, int *offp, * and fall through into normal filter path if so. */ if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && - prison_check_ip6(in6p->inp_cred, - &ip6->ip6_dst) != 0) + prison_check_in6(in6p->inp_cred, + &ip6->ip6_dst, zoneid) != 0) continue; } INP_RLOCK(in6p); @@ -466,9 +467,6 @@ rip6_output(struct mbuf *m, ...) &oifp, &in6a); if (error) goto bad; - error = prison_check_ip6(in6p->inp_cred, &in6a); - if (error != 0) - goto bad; ip6->ip6_src = in6a; ip6->ip6_dst = dstsock->sin6_addr; @@ -740,8 +738,6 @@ rip6_bind(struct socket *so, struct sock if (nam->sa_len != sizeof(*addr)) return (EINVAL); - if ((error = prison_check_ip6(td->td_ucred, &addr->sin6_addr)) != 0) - return (error); if (TAILQ_EMPTY(&V_ifnet) || addr->sin6_family != AF_INET6) return (EADDRNOTAVAIL); INP_RLOCK(inp); @@ -750,6 +746,8 @@ rip6_bind(struct socket *so, struct sock INP_RUNLOCK(inp); if (error != 0) return (error); + if ((error = prison_check_ip6(td->td_ucred, addr)) != 0) + return (error); if (!IN6_IS_ADDR_UNSPECIFIED(&addr->sin6_addr)) { ifa = in6ifa_ifwithaddr(&addr->sin6_addr, addr->sin6_scope_id); if (ifa == NULL) From owner-svn-src-user@FreeBSD.ORG Mon Dec 23 22:38:00 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2489795A; Mon, 23 Dec 2013 22:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10FB615A8; Mon, 23 Dec 2013 22:38:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBNMbxQo077885; Mon, 23 Dec 2013 22:37:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBNMbxY1077884; Mon, 23 Dec 2013 22:37:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312232237.rBNMbxY1077884@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 23 Dec 2013 22:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259798 - user/ae/inet6/sys/netinet6 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 23 Dec 2013 22:38:00 -0000 Author: ae Date: Mon Dec 23 22:37:59 2013 New Revision: 259798 URL: http://svnweb.freebsd.org/changeset/base/259798 Log: Remove handling for an impossible case. Modified: user/ae/inet6/sys/netinet6/in6_src.c Modified: user/ae/inet6/sys/netinet6/in6_src.c ============================================================================== --- user/ae/inet6/sys/netinet6/in6_src.c Mon Dec 23 22:31:40 2013 (r259797) +++ user/ae/inet6/sys/netinet6/in6_src.c Mon Dec 23 22:37:59 2013 (r259798) @@ -644,24 +644,6 @@ oif_found: RO_RTFREE(ro); return (EADDRNOTAVAIL); } -#if 0 - /* - * At this point at least one of the addresses belonged to the jail - * but it could still be, that we want to further restrict it, e.g. - * theoratically IN6_IS_ADDR_LOOPBACK. - * It must not be IN6_IS_ADDR_UNSPECIFIED anymore. - * prison_local_ip6() will fix an IN6_IS_ADDR_LOOPBACK but should - * let all others previously selected pass. - * Use tmp to not change ::1 on lo0 to the primary jail address. - */ - tmp = ia->ia_addr.sin6_addr; - if (cred != NULL && prison_local_ip6(cred, &tmp, (inp != NULL && - (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) { - IN6_IFADDR_RUNLOCK(); - IP6STAT_INC(ip6s_sources_none); - return (EADDRNOTAVAIL); - } -#endif *ifpp = ifp; *srcp = best.ia->ia_addr.sin6_addr; From owner-svn-src-user@FreeBSD.ORG Tue Dec 24 15:44:18 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C79675B; Tue, 24 Dec 2013 15:44:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 049701A45; Tue, 24 Dec 2013 15:44:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBOFiHVE052379; Tue, 24 Dec 2013 15:44:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBOFiBDo052333; Tue, 24 Dec 2013 15:44:11 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312241544.rBOFiBDo052333@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 24 Dec 2013 15:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259824 - in user/ae/inet6: . bin bin/date bin/date/tests bin/mv bin/mv/tests bin/pax bin/pax/tests bin/sh bin/sh/tests bin/test bin/test/tests bin/tests cddl/contrib/opensolaris/cmd/zd... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 24 Dec 2013 15:44:18 -0000 Author: ae Date: Tue Dec 24 15:44:09 2013 New Revision: 259824 URL: http://svnweb.freebsd.org/changeset/base/259824 Log: Merge from head/. Added: user/ae/inet6/bin/date/tests/ - copied from r259823, head/bin/date/tests/ user/ae/inet6/bin/mv/tests/ - copied from r259823, head/bin/mv/tests/ user/ae/inet6/bin/pax/tests/ - copied from r259823, head/bin/pax/tests/ user/ae/inet6/bin/sh/tests/ - copied from r259823, head/bin/sh/tests/ user/ae/inet6/bin/test/tests/ - copied from r259823, head/bin/test/tests/ user/ae/inet6/bin/tests/ - copied from r259823, head/bin/tests/ user/ae/inet6/contrib/gcclibs/libcpp/ChangeLog.apple - copied unchanged from r259823, head/contrib/gcclibs/libcpp/ChangeLog.apple user/ae/inet6/etc/rc.d/casperd - copied unchanged from r259823, head/etc/rc.d/casperd user/ae/inet6/lib/clang/include/PPCGenAsmMatcher.inc - copied unchanged from r259823, head/lib/clang/include/PPCGenAsmMatcher.inc user/ae/inet6/lib/clang/libllvmpowerpcasmparser/ - copied from r259823, head/lib/clang/libllvmpowerpcasmparser/ user/ae/inet6/release/scripts/FreeBSD_install_cdrom.conf - copied unchanged from r259823, head/release/scripts/FreeBSD_install_cdrom.conf user/ae/inet6/share/mk/tap.test.mk - copied unchanged from r259823, head/share/mk/tap.test.mk user/ae/inet6/sys/arm/broadcom/bcm2835/bcm2835_fbd.c - copied unchanged from r259823, head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c user/ae/inet6/sys/arm/freescale/imx/imx51_ipuv3_fbd.c - copied unchanged from r259823, head/sys/arm/freescale/imx/imx51_ipuv3_fbd.c user/ae/inet6/sys/boot/fdt/dts/beri-netfpga.dts - copied unchanged from r259823, head/sys/boot/fdt/dts/beri-netfpga.dts user/ae/inet6/sys/dev/netmap/netmap_freebsd.c - copied unchanged from r259823, head/sys/dev/netmap/netmap_freebsd.c user/ae/inet6/sys/dev/netmap/netmap_generic.c - copied unchanged from r259823, head/sys/dev/netmap/netmap_generic.c user/ae/inet6/sys/dev/netmap/netmap_mbq.c - copied unchanged from r259823, head/sys/dev/netmap/netmap_mbq.c user/ae/inet6/sys/dev/netmap/netmap_mbq.h - copied unchanged from r259823, head/sys/dev/netmap/netmap_mbq.h user/ae/inet6/sys/dev/netmap/netmap_vale.c - copied unchanged from r259823, head/sys/dev/netmap/netmap_vale.c user/ae/inet6/sys/mips/conf/BERI_NETFPGA_MDROOT - copied unchanged from r259823, head/sys/mips/conf/BERI_NETFPGA_MDROOT user/ae/inet6/sys/powerpc/cpufreq/pmufreq.c - copied unchanged from r259823, head/sys/powerpc/cpufreq/pmufreq.c user/ae/inet6/usr.sbin/bhyve/bhyve.8 - copied unchanged from r259823, head/usr.sbin/bhyve/bhyve.8 Deleted: user/ae/inet6/sys/i386/i386/symbols.raw user/ae/inet6/tools/regression/bin/ Modified: user/ae/inet6/ObsoleteFiles.inc user/ae/inet6/UPDATING user/ae/inet6/bin/Makefile user/ae/inet6/bin/date/Makefile user/ae/inet6/bin/mv/Makefile user/ae/inet6/bin/pax/Makefile user/ae/inet6/bin/pax/pax.1 user/ae/inet6/bin/sh/Makefile user/ae/inet6/bin/test/Makefile user/ae/inet6/cddl/contrib/opensolaris/cmd/zdb/zdb.c user/ae/inet6/cddl/contrib/opensolaris/cmd/zhack/zhack.c user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c user/ae/inet6/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c user/ae/inet6/contrib/file/compress.c user/ae/inet6/contrib/gcc/ChangeLog.gcc43 user/ae/inet6/contrib/gcc/c-common.c user/ae/inet6/contrib/gcc/c-convert.c user/ae/inet6/contrib/gcc/c-incpath.c user/ae/inet6/contrib/gcc/c-opts.c user/ae/inet6/contrib/gcc/c-typeck.c user/ae/inet6/contrib/gcc/c.opt user/ae/inet6/contrib/gcc/calls.c user/ae/inet6/contrib/gcc/cfg.c user/ae/inet6/contrib/gcc/collect2.c user/ae/inet6/contrib/gcc/config/darwin.h user/ae/inet6/contrib/gcc/config/rs6000/rs6000.c user/ae/inet6/contrib/gcc/cp/ChangeLog.gcc43 user/ae/inet6/contrib/gcc/cp/Make-lang.in user/ae/inet6/contrib/gcc/cp/cvt.c user/ae/inet6/contrib/gcc/cp/decl.c user/ae/inet6/contrib/gcc/cp/mangle.c user/ae/inet6/contrib/gcc/cp/method.c user/ae/inet6/contrib/gcc/cp/parser.c user/ae/inet6/contrib/gcc/cp/pt.c user/ae/inet6/contrib/gcc/cp/rtti.c user/ae/inet6/contrib/gcc/cp/typeck.c user/ae/inet6/contrib/gcc/doc/cppopts.texi user/ae/inet6/contrib/gcc/doc/invoke.texi user/ae/inet6/contrib/gcc/doc/tm.texi user/ae/inet6/contrib/gcc/dwarf2out.c user/ae/inet6/contrib/gcc/fold-const.c user/ae/inet6/contrib/gcc/gcc.c user/ae/inet6/contrib/gcc/gcov.c user/ae/inet6/contrib/gcc/sched-vis.c user/ae/inet6/contrib/gcc/target-def.h user/ae/inet6/contrib/gcc/target.h user/ae/inet6/contrib/gcc/tlink.c user/ae/inet6/contrib/gcc/tree-dump.c user/ae/inet6/contrib/gcc/version.c user/ae/inet6/contrib/gcclibs/libcpp/charset.c user/ae/inet6/contrib/gcclibs/libcpp/include/cpplib.h user/ae/inet6/contrib/gcclibs/libcpp/init.c user/ae/inet6/contrib/gcclibs/libcpp/lex.c user/ae/inet6/contrib/gperf/lib/getline.cc user/ae/inet6/contrib/llvm/tools/clang/lib/Headers/cpuid.h user/ae/inet6/contrib/tcpdump/addrtoname.c user/ae/inet6/contrib/tcpdump/tcpdump.c user/ae/inet6/contrib/tzcode/stdtime/tzfile.5 user/ae/inet6/contrib/tzdata/asia user/ae/inet6/contrib/tzdata/northamerica user/ae/inet6/crypto/heimdal/lib/gssapi/krb5/prf.c user/ae/inet6/etc/defaults/rc.conf user/ae/inet6/etc/mtree/BSD.tests.dist user/ae/inet6/etc/rc.d/Makefile user/ae/inet6/etc/syslog.conf user/ae/inet6/games/fortune/datfiles/fortunes user/ae/inet6/gnu/lib/csu/Makefile user/ae/inet6/gnu/lib/libgcc/Makefile user/ae/inet6/gnu/lib/libstdc++/Makefile user/ae/inet6/gnu/lib/libsupc++/Makefile user/ae/inet6/kerberos5/lib/Makefile user/ae/inet6/kerberos5/lib/libkafs5/Makefile user/ae/inet6/lib/atf/libatf-c/tests/Makefile user/ae/inet6/lib/clang/Makefile user/ae/inet6/lib/clang/include/llvm/Config/AsmParsers.def user/ae/inet6/lib/libc/stdlib/getopt_long.3 user/ae/inet6/lib/libc/sys/shm_open.2 user/ae/inet6/lib/libcam/Makefile user/ae/inet6/lib/libnv/msgio.c user/ae/inet6/lib/libnv/msgio.h user/ae/inet6/lib/libnv/nvlist.c user/ae/inet6/lib/libstand/close.c user/ae/inet6/lib/libstand/dosfs.c user/ae/inet6/lib/libstand/dosfs.h user/ae/inet6/lib/libstand/environment.c user/ae/inet6/lib/libvmmapi/vmmapi.c user/ae/inet6/lib/libvmmapi/vmmapi.h user/ae/inet6/release/Makefile user/ae/inet6/release/doc/Makefile user/ae/inet6/release/doc/en_US.ISO8859-1/relnotes/article.xml user/ae/inet6/release/doc/share/xml/release.ent user/ae/inet6/release/picobsd/build/picobsd user/ae/inet6/release/rc.local user/ae/inet6/release/scripts/pkg-stage.sh user/ae/inet6/sbin/casperd/zygote.c user/ae/inet6/sbin/devd/devd.cc user/ae/inet6/sbin/growfs/growfs.8 user/ae/inet6/sbin/hastd/hastd.c user/ae/inet6/sbin/hastd/nv.c user/ae/inet6/sbin/hastd/primary.c user/ae/inet6/sbin/hastd/proto.c user/ae/inet6/sbin/hastd/secondary.c user/ae/inet6/sbin/ipfw/ipfw.8 user/ae/inet6/sbin/iscontrol/iscsi.conf.5 user/ae/inet6/sbin/swapon/swapon.c user/ae/inet6/share/man/man4/arcmsr.4 user/ae/inet6/share/man/man4/cxgbe.4 user/ae/inet6/share/man/man4/netmap.4 user/ae/inet6/share/man/man9/Makefile user/ae/inet6/share/man/man9/mbuf.9 user/ae/inet6/share/misc/committers-ports.dot user/ae/inet6/share/misc/committers-src.dot user/ae/inet6/share/mk/Makefile user/ae/inet6/share/mk/bsd.own.mk user/ae/inet6/share/mk/bsd.progs.mk user/ae/inet6/share/mk/bsd.sys.mk user/ae/inet6/sys/amd64/amd64/machdep.c user/ae/inet6/sys/amd64/amd64/mp_machdep.c user/ae/inet6/sys/amd64/amd64/pmap.c user/ae/inet6/sys/amd64/include/cpu.h user/ae/inet6/sys/amd64/include/pmap.h user/ae/inet6/sys/amd64/include/vmm.h (contents, props changed) user/ae/inet6/sys/amd64/include/vmm_dev.h (contents, props changed) user/ae/inet6/sys/amd64/vmm/amd/amdv.c user/ae/inet6/sys/amd64/vmm/intel/ept.c user/ae/inet6/sys/amd64/vmm/intel/vmcs.c user/ae/inet6/sys/amd64/vmm/intel/vmcs.h user/ae/inet6/sys/amd64/vmm/intel/vmx.c user/ae/inet6/sys/amd64/vmm/intel/vmx_genassym.c user/ae/inet6/sys/amd64/vmm/io/ppt.c user/ae/inet6/sys/amd64/vmm/io/ppt.h user/ae/inet6/sys/amd64/vmm/io/vhpet.c user/ae/inet6/sys/amd64/vmm/io/vioapic.c user/ae/inet6/sys/amd64/vmm/io/vlapic.c user/ae/inet6/sys/amd64/vmm/io/vlapic.h user/ae/inet6/sys/amd64/vmm/vmm.c user/ae/inet6/sys/amd64/vmm/vmm_dev.c user/ae/inet6/sys/amd64/vmm/vmm_lapic.c user/ae/inet6/sys/amd64/vmm/vmm_lapic.h user/ae/inet6/sys/amd64/vmm/vmm_msr.c user/ae/inet6/sys/amd64/vmm/vmm_msr.h user/ae/inet6/sys/arm/arm/bus_space-v6.c user/ae/inet6/sys/arm/arm/cpufunc.c user/ae/inet6/sys/arm/arm/elf_trampoline.c user/ae/inet6/sys/arm/arm/identcpu.c user/ae/inet6/sys/arm/arm/locore.S user/ae/inet6/sys/arm/arm/swtch.S user/ae/inet6/sys/arm/at91/if_ate.c user/ae/inet6/sys/arm/at91/uart_dev_at91usart.c user/ae/inet6/sys/arm/broadcom/bcm2835/files.bcm2835 user/ae/inet6/sys/arm/conf/RPI-B user/ae/inet6/sys/arm/freescale/imx/files.imx51 user/ae/inet6/sys/arm/freescale/imx/files.imx53 user/ae/inet6/sys/arm/freescale/imx/files.imx6 user/ae/inet6/sys/arm/include/armreg.h user/ae/inet6/sys/arm/include/cpuconf.h user/ae/inet6/sys/arm/include/cpufunc.h user/ae/inet6/sys/arm/include/intr.h user/ae/inet6/sys/arm/include/md_var.h user/ae/inet6/sys/arm/mv/mv_pci.c user/ae/inet6/sys/arm/ti/am335x/am335x_dmtimer.c user/ae/inet6/sys/arm/ti/files.ti user/ae/inet6/sys/arm/versatile/bus_space.c user/ae/inet6/sys/arm/xilinx/zy7_bus_space.c user/ae/inet6/sys/boot/ia64/efi/version user/ae/inet6/sys/cam/cam.h user/ae/inet6/sys/cam/cam_ccb.h user/ae/inet6/sys/cam/cam_compat.c user/ae/inet6/sys/cam/cam_compat.h user/ae/inet6/sys/cam/scsi/scsi_xpt.c user/ae/inet6/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c user/ae/inet6/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c user/ae/inet6/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c user/ae/inet6/sys/cddl/dev/fbt/fbt_powerpc.c user/ae/inet6/sys/conf/Makefile.arm user/ae/inet6/sys/conf/files user/ae/inet6/sys/conf/files.arm user/ae/inet6/sys/conf/files.powerpc user/ae/inet6/sys/conf/kern.mk user/ae/inet6/sys/conf/options user/ae/inet6/sys/conf/options.arm user/ae/inet6/sys/dev/ae/if_ae.c user/ae/inet6/sys/dev/ahci/ahciem.c user/ae/inet6/sys/dev/an/if_an.c user/ae/inet6/sys/dev/an/if_an_pccard.c user/ae/inet6/sys/dev/arcmsr/arcmsr.c user/ae/inet6/sys/dev/arcmsr/arcmsr.h user/ae/inet6/sys/dev/cxgbe/common/common.h user/ae/inet6/sys/dev/cxgbe/offload.h user/ae/inet6/sys/dev/cxgbe/t4_main.c user/ae/inet6/sys/dev/cxgbe/t4_sge.c user/ae/inet6/sys/dev/cxgbe/tom/t4_cpl_io.c user/ae/inet6/sys/dev/cxgbe/tom/t4_listen.c user/ae/inet6/sys/dev/cxgbe/tom/t4_tom.h user/ae/inet6/sys/dev/drm2/drmP.h user/ae/inet6/sys/dev/drm2/drm_edid.c user/ae/inet6/sys/dev/drm2/drm_fb_helper.c user/ae/inet6/sys/dev/drm2/radeon/radeon_fence.c user/ae/inet6/sys/dev/drm2/radeon/radeon_sa.c user/ae/inet6/sys/dev/drm2/ttm/ttm_bo.c user/ae/inet6/sys/dev/drm2/ttm/ttm_bo_vm.c user/ae/inet6/sys/dev/drm2/ttm/ttm_lock.c user/ae/inet6/sys/dev/fb/fbd.c user/ae/inet6/sys/dev/fdt/fdt_common.h user/ae/inet6/sys/dev/fdt/fdt_pci.c user/ae/inet6/sys/dev/hwpmc/hwpmc_core.c user/ae/inet6/sys/dev/hwpmc/hwpmc_core.h user/ae/inet6/sys/dev/hwpmc/hwpmc_intel.c user/ae/inet6/sys/dev/hwpmc/hwpmc_powerpc.c user/ae/inet6/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c user/ae/inet6/sys/dev/iscsi/iscsi.c user/ae/inet6/sys/dev/ixgbe/ixgbe.c user/ae/inet6/sys/dev/md/md.c user/ae/inet6/sys/dev/netmap/if_em_netmap.h user/ae/inet6/sys/dev/netmap/if_igb_netmap.h user/ae/inet6/sys/dev/netmap/if_lem_netmap.h user/ae/inet6/sys/dev/netmap/if_re_netmap.h user/ae/inet6/sys/dev/netmap/ixgbe_netmap.h user/ae/inet6/sys/dev/netmap/netmap.c user/ae/inet6/sys/dev/netmap/netmap_kern.h user/ae/inet6/sys/dev/netmap/netmap_mem2.c user/ae/inet6/sys/dev/netmap/netmap_mem2.h user/ae/inet6/sys/dev/nmdm/nmdm.c user/ae/inet6/sys/dev/ofw/ofw_bus_subr.c user/ae/inet6/sys/dev/ofw/ofw_bus_subr.h user/ae/inet6/sys/dev/ofw/ofw_console.c user/ae/inet6/sys/dev/ofw/ofw_fdt.c user/ae/inet6/sys/dev/pci/vga_pci.c user/ae/inet6/sys/dev/syscons/scterm-teken.c user/ae/inet6/sys/dev/uart/uart_cpu.h user/ae/inet6/sys/dev/uart/uart_tty.c user/ae/inet6/sys/dev/usb/controller/at91dci.c user/ae/inet6/sys/dev/usb/controller/atmegadci.c user/ae/inet6/sys/dev/usb/controller/avr32dci.c user/ae/inet6/sys/dev/usb/controller/dwc_otg.c user/ae/inet6/sys/dev/usb/controller/ehci.c user/ae/inet6/sys/dev/usb/controller/musb_otg.c user/ae/inet6/sys/dev/usb/controller/ohci.c user/ae/inet6/sys/dev/usb/controller/uhci.c user/ae/inet6/sys/dev/usb/controller/uss820dci.c user/ae/inet6/sys/dev/usb/controller/xhci.c user/ae/inet6/sys/dev/usb/quirk/usb_quirk.c user/ae/inet6/sys/dev/usb/template/usb_template.c user/ae/inet6/sys/dev/usb/usb_bus.h user/ae/inet6/sys/dev/usb/usb_device.c user/ae/inet6/sys/dev/usb/usb_device.h user/ae/inet6/sys/dev/usb/usb_hub.c user/ae/inet6/sys/dev/usb/usb_transfer.c user/ae/inet6/sys/dev/usb/usbdevs user/ae/inet6/sys/dev/usb/usbdi.h user/ae/inet6/sys/dev/usb/wlan/if_run.c user/ae/inet6/sys/dev/usb/wlan/if_runreg.h user/ae/inet6/sys/dev/usb/wlan/if_runvar.h user/ae/inet6/sys/dev/vt/font/vt_font_default.c user/ae/inet6/sys/dev/vt/hw/fb/vt_fb.c user/ae/inet6/sys/dev/vt/vt.h user/ae/inet6/sys/dev/vt/vt_consolectl.c user/ae/inet6/sys/dev/vt/vt_core.c user/ae/inet6/sys/dev/vt/vt_font.c user/ae/inet6/sys/dev/vt/vt_sysmouse.c user/ae/inet6/sys/fs/devfs/devfs_devs.c user/ae/inet6/sys/fs/ext2fs/ext2_hash.c user/ae/inet6/sys/fs/fifofs/fifo_vnops.c user/ae/inet6/sys/fs/nfs/nfs_commonsubs.c user/ae/inet6/sys/fs/nfsclient/nfs_clstate.c user/ae/inet6/sys/fs/nfsserver/nfs_fha_new.c user/ae/inet6/sys/geom/eli/g_eli.c user/ae/inet6/sys/geom/eli/g_eli_crypto.c user/ae/inet6/sys/geom/geom_dev.c user/ae/inet6/sys/geom/mirror/g_mirror_ctl.c user/ae/inet6/sys/ia64/ia64/pmap.c user/ae/inet6/sys/kern/capabilities.conf user/ae/inet6/sys/kern/init_sysent.c user/ae/inet6/sys/kern/kern_clocksource.c user/ae/inet6/sys/kern/kern_event.c user/ae/inet6/sys/kern/kern_exit.c user/ae/inet6/sys/kern/kern_fork.c user/ae/inet6/sys/kern/kern_linker.c user/ae/inet6/sys/kern/kern_resource.c user/ae/inet6/sys/kern/kern_rwlock.c user/ae/inet6/sys/kern/makesyscalls.sh user/ae/inet6/sys/kern/subr_terminal.c user/ae/inet6/sys/kern/subr_trap.c user/ae/inet6/sys/kern/subr_vmem.c user/ae/inet6/sys/kern/tty.c user/ae/inet6/sys/kern/uipc_syscalls.c user/ae/inet6/sys/kern/vfs_bio.c user/ae/inet6/sys/kern/vfs_vnops.c user/ae/inet6/sys/mips/beri/beri_machdep.c user/ae/inet6/sys/modules/drm2/drm2/Makefile user/ae/inet6/sys/modules/drm2/i915kms/Makefile user/ae/inet6/sys/modules/drm2/radeonkms/Makefile user/ae/inet6/sys/modules/netmap/Makefile user/ae/inet6/sys/net/netmap.h user/ae/inet6/sys/net/netmap_user.h user/ae/inet6/sys/net/radix.c user/ae/inet6/sys/netgraph/ng_ksocket.c user/ae/inet6/sys/netinet/ip_output.c user/ae/inet6/sys/netinet6/send.c user/ae/inet6/sys/netpfil/ipfw/ip_fw_dynamic.c user/ae/inet6/sys/netpfil/pf/pf.c user/ae/inet6/sys/netpfil/pf/pf.h user/ae/inet6/sys/nfs/nfs_fha.c user/ae/inet6/sys/nfs/nfs_fha.h user/ae/inet6/sys/nfsserver/nfs_fha_old.c user/ae/inet6/sys/ofed/drivers/net/mlx4/en_netdev.c user/ae/inet6/sys/ofed/drivers/net/mlx4/mlx4_en.h user/ae/inet6/sys/powerpc/aim/mp_cpudep.c user/ae/inet6/sys/powerpc/aim/trap.c user/ae/inet6/sys/powerpc/aim/trap_subr32.S user/ae/inet6/sys/powerpc/aim/trap_subr64.S user/ae/inet6/sys/powerpc/include/cpu.h user/ae/inet6/sys/powerpc/include/dbdma.h user/ae/inet6/sys/powerpc/include/openpicreg.h user/ae/inet6/sys/powerpc/include/openpicvar.h user/ae/inet6/sys/powerpc/include/pcpu.h user/ae/inet6/sys/powerpc/include/pmc_mdep.h user/ae/inet6/sys/powerpc/include/spr.h user/ae/inet6/sys/powerpc/ofw/ofw_pci.c user/ae/inet6/sys/powerpc/ofw/ofw_pcib_pci.c user/ae/inet6/sys/powerpc/ofw/openpic_ofw.c user/ae/inet6/sys/powerpc/powermac/ata_macio.c user/ae/inet6/sys/powerpc/powermac/atibl.c user/ae/inet6/sys/powerpc/powermac/cpcht.c user/ae/inet6/sys/powerpc/powermac/dbdma.c user/ae/inet6/sys/powerpc/powermac/dbdmavar.h user/ae/inet6/sys/powerpc/powermac/platform_powermac.c user/ae/inet6/sys/powerpc/powermac/pmu.c user/ae/inet6/sys/powerpc/powermac/pmuvar.h user/ae/inet6/sys/powerpc/powermac/uninorth.c user/ae/inet6/sys/powerpc/powermac/uninorthvar.h user/ae/inet6/sys/powerpc/powermac/viareg.h user/ae/inet6/sys/powerpc/powerpc/mp_machdep.c user/ae/inet6/sys/powerpc/powerpc/openpic.c user/ae/inet6/sys/powerpc/pseries/phyp_vscsi.c user/ae/inet6/sys/powerpc/psim/openpic_iobus.c user/ae/inet6/sys/rpc/svc.c user/ae/inet6/sys/rpc/svc.h user/ae/inet6/sys/rpc/svc_vc.c user/ae/inet6/sys/sparc64/ebus/ebus.c user/ae/inet6/sys/sparc64/isa/ofw_isa.c user/ae/inet6/sys/sparc64/pci/fire.c user/ae/inet6/sys/sparc64/pci/ofw_pcib_subr.c user/ae/inet6/sys/sparc64/pci/psycho.c user/ae/inet6/sys/sparc64/pci/schizo.c user/ae/inet6/sys/sys/consio.h user/ae/inet6/sys/sys/fbio.h user/ae/inet6/sys/sys/param.h user/ae/inet6/sys/sys/terminal.h user/ae/inet6/sys/sys/tty.h user/ae/inet6/sys/teken/demo/teken_demo.c user/ae/inet6/sys/teken/teken.h user/ae/inet6/sys/teken/teken_subr.h user/ae/inet6/sys/x86/acpica/acpi_wakeup.c user/ae/inet6/sys/x86/cpufreq/est.c user/ae/inet6/sys/x86/include/mptable.h user/ae/inet6/sys/x86/x86/mptable.c user/ae/inet6/tools/build/mk/OptionalObsoleteFiles.inc user/ae/inet6/tools/tools/ath/athstats/Makefile user/ae/inet6/tools/tools/net80211/wlanstats/Makefile user/ae/inet6/tools/tools/vt/fontcvt/fontcvt.c user/ae/inet6/tools/tools/vt/mkkfont/mkkfont.c user/ae/inet6/tools/tools/vt/setfont/setfont.c user/ae/inet6/usr.bin/calendar/calcpp.c user/ae/inet6/usr.bin/clang/clang/Makefile user/ae/inet6/usr.bin/clang/llc/Makefile user/ae/inet6/usr.bin/clang/lldb/Makefile user/ae/inet6/usr.bin/clang/llvm-mc/Makefile user/ae/inet6/usr.bin/clang/llvm-objdump/Makefile user/ae/inet6/usr.bin/clang/llvm-rtdyld/Makefile user/ae/inet6/usr.bin/clang/opt/Makefile user/ae/inet6/usr.bin/dtc/fdt.cc user/ae/inet6/usr.bin/kdump/Makefile user/ae/inet6/usr.bin/kdump/kdump.c user/ae/inet6/usr.bin/mkcsmapper/Makefile.inc user/ae/inet6/usr.bin/netstat/if.c user/ae/inet6/usr.bin/netstat/main.c user/ae/inet6/usr.bin/netstat/mroute.c user/ae/inet6/usr.bin/netstat/mroute6.c user/ae/inet6/usr.bin/netstat/netgraph.c user/ae/inet6/usr.bin/netstat/netstat.h user/ae/inet6/usr.bin/netstat/route.c user/ae/inet6/usr.bin/sort/radixsort.c user/ae/inet6/usr.sbin/bhyve/Makefile user/ae/inet6/usr.sbin/bhyve/acpi.c user/ae/inet6/usr.sbin/bhyve/bhyverun.c user/ae/inet6/usr.sbin/bhyve/mptbl.c user/ae/inet6/usr.sbin/bhyve/pci_emul.c user/ae/inet6/usr.sbin/bhyve/pci_emul.h user/ae/inet6/usr.sbin/bhyve/pci_passthru.c user/ae/inet6/usr.sbin/bhyve/xmsr.c user/ae/inet6/usr.sbin/bhyve/xmsr.h user/ae/inet6/usr.sbin/bhyvectl/bhyvectl.c user/ae/inet6/usr.sbin/bsdconfig/share/packages/index.subr user/ae/inet6/usr.sbin/bsdinstall/scripts/auto user/ae/inet6/usr.sbin/bsdinstall/scripts/config user/ae/inet6/usr.sbin/bsdinstall/scripts/services user/ae/inet6/usr.sbin/bsdinstall/scripts/zfsboot user/ae/inet6/usr.sbin/ctld/login.c user/ae/inet6/usr.sbin/mptable/mptable.c user/ae/inet6/usr.sbin/pkg/config.c user/ae/inet6/usr.sbin/pkg/config.h user/ae/inet6/usr.sbin/pkg/pkg.7 user/ae/inet6/usr.sbin/pkg/pkg.c user/ae/inet6/usr.sbin/tcpdump/tcpdump/Makefile user/ae/inet6/usr.sbin/ypbind/yp_ping.c Directory Properties: user/ae/inet6/ (props changed) user/ae/inet6/cddl/ (props changed) user/ae/inet6/cddl/contrib/opensolaris/ (props changed) user/ae/inet6/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/ae/inet6/contrib/file/ (props changed) user/ae/inet6/contrib/gcc/ (props changed) user/ae/inet6/contrib/llvm/ (props changed) user/ae/inet6/contrib/llvm/tools/clang/ (props changed) user/ae/inet6/contrib/tcpdump/ (props changed) user/ae/inet6/contrib/tzcode/stdtime/ (props changed) user/ae/inet6/contrib/tzdata/ (props changed) user/ae/inet6/crypto/heimdal/ (props changed) user/ae/inet6/etc/ (props changed) user/ae/inet6/gnu/lib/ (props changed) user/ae/inet6/lib/libc/ (props changed) user/ae/inet6/lib/libvmmapi/ (props changed) user/ae/inet6/sbin/ (props changed) user/ae/inet6/sbin/ipfw/ (props changed) user/ae/inet6/share/man/man4/ (props changed) user/ae/inet6/sys/ (props changed) user/ae/inet6/sys/amd64/vmm/ (props changed) user/ae/inet6/sys/boot/ (props changed) user/ae/inet6/sys/boot/ia64/efi/ (props changed) user/ae/inet6/sys/cddl/contrib/opensolaris/ (props changed) user/ae/inet6/sys/conf/ (props changed) user/ae/inet6/sys/dev/hyperv/ (props changed) user/ae/inet6/usr.bin/calendar/ (props changed) user/ae/inet6/usr.sbin/bhyve/ (props changed) user/ae/inet6/usr.sbin/bhyvectl/ (props changed) Modified: user/ae/inet6/ObsoleteFiles.inc ============================================================================== --- user/ae/inet6/ObsoleteFiles.inc Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/ObsoleteFiles.inc Tue Dec 24 15:44:09 2013 (r259824) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20131215: libcam version bumped +OLD_LIBS+=lib/libcam.so.6 usr/lib32/libcam.so.6 # 20131202: libcapsicum and libcasper moved to /lib/ OLD_LIBS+=usr/lib/libcapsicum.so.0 OLD_LIBS+=usr/lib/libcasper.so.0 Modified: user/ae/inet6/UPDATING ============================================================================== --- user/ae/inet6/UPDATING Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/UPDATING Tue Dec 24 15:44:09 2013 (r259824) @@ -31,6 +31,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20131213: + The behavior of gss_pseudo_random() for the krb5 mechanism + has changed, for applications requesting a longer random string + than produced by the underlying enctype's pseudo-random() function. + In particular, the random string produced from a session key of + enctype aes256-cts-hmac-sha1-96 or aes256-cts-hmac-sha1-96 will + be different at the 17th octet and later, after this change. + The counter used in the PRF+ construction is now encoded as a + big-endian integer in accordance with RFC 4402. + __FreeBSD_version is bumped to 1100004. + 20131108: The WITHOUT_ATF build knob has been removed and its functionality has been subsumed into the more generic WITHOUT_TESTS. If you were @@ -1932,7 +1943,7 @@ COMMON ITEMS: make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installworld DESTDIR=${CURRENT_ROOT} + make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC make distribution DESTDIR=${CURRENT_ROOT} # if newfs'd make installkernel KERNCONF=YOUR_KERNEL_HERE DESTDIR=${CURRENT_ROOT} cp /etc/fstab ${CURRENT_ROOT}/etc/fstab # if newfs'd Modified: user/ae/inet6/bin/Makefile ============================================================================== --- user/ae/inet6/bin/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -52,6 +52,10 @@ SUBDIR+= rmail SUBDIR+= csh .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include SUBDIR:= ${SUBDIR:O} Modified: user/ae/inet6/bin/date/Makefile ============================================================================== --- user/ae/inet6/bin/date/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/date/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= date SRCS= date.c netdate.c vary.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: user/ae/inet6/bin/mv/Makefile ============================================================================== --- user/ae/inet6/bin/mv/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/mv/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -1,6 +1,12 @@ # @(#)Makefile 8.2 (Berkeley) 4/2/94 # $FreeBSD$ +.include + PROG= mv +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: user/ae/inet6/bin/pax/Makefile ============================================================================== --- user/ae/inet6/bin/pax/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/pax/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + # To install on versions prior to BSD 4.4 the following may have to be # defined with CFLAGS += # @@ -30,4 +32,8 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: user/ae/inet6/bin/pax/pax.1 ============================================================================== --- user/ae/inet6/bin/pax/pax.1 Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/pax/pax.1 Tue Dec 24 15:44:09 2013 (r259824) @@ -33,7 +33,7 @@ .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 29, 2010 +.Dd December 21, 2013 .Dt PAX 1 .Os .Sh NAME @@ -587,6 +587,16 @@ precedence. For example, if .Dl Fl p Ar eme is specified, file modification times are still preserved. +.Pp +File flags set by +.Xr chflags 1 +are not understood by +.Nm , +however +.Xr tar 1 +and +.Xr dump 1 +will preserve these. .It Fl s Ar replstr Modify the file or archive member names specified by the .Ar pattern @@ -1195,3 +1205,11 @@ at the University of California, San Die The .Nm utility does not recognize multibyte characters. +.Pp +File flags set by +.Xr chflags 1 +are not preserved by +.Nm . +The BUGS section of +.Xr chflags 1 +has a list of utilities that are unaware of flags. Modified: user/ae/inet6/bin/sh/Makefile ============================================================================== --- user/ae/inet6/bin/sh/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/sh/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -1,6 +1,8 @@ # @(#)Makefile 8.4 (Berkeley) 5/5/95 # $FreeBSD$ +.include + PROG= sh INSTALLFLAGS= -S SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \ @@ -59,7 +61,8 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens -regress: - cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: user/ae/inet6/bin/test/Makefile ============================================================================== --- user/ae/inet6/bin/test/Makefile Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/bin/test/Makefile Tue Dec 24 15:44:09 2013 (r259824) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= test LINKS= ${BINDIR}/test ${BINDIR}/[ MLINKS= test.1 [.1 +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Modified: user/ae/inet6/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- user/ae/inet6/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/cddl/contrib/opensolaris/cmd/zdb/zdb.c Tue Dec 24 15:44:09 2013 (r259824) @@ -559,16 +559,20 @@ get_metaslab_refcount(vdev_t *vd) static int verify_spacemap_refcounts(spa_t *spa) { - int expected_refcount, actual_refcount; + uint64_t expected_refcount = 0; + uint64_t actual_refcount; - expected_refcount = spa_feature_get_refcount(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + (void) feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM], + &expected_refcount); actual_refcount = get_dtl_refcount(spa->spa_root_vdev); actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); if (expected_refcount != actual_refcount) { - (void) printf("space map refcount mismatch: expected %d != " - "actual %d\n", expected_refcount, actual_refcount); + (void) printf("space map refcount mismatch: expected %lld != " + "actual %lld\n", + (longlong_t)expected_refcount, + (longlong_t)actual_refcount); return (2); } return (0); @@ -670,8 +674,7 @@ dump_metaslab(metaslab_t *msp) } if (dump_opt['m'] > 1 && sm != NULL && - spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) { /* * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). @@ -2417,8 +2420,7 @@ dump_block_stats(spa_t *spa) (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, count_block_cb, &zcb, NULL); } - if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) { VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb, &zcb, NULL)); @@ -2719,7 +2721,7 @@ dump_zpool(spa_t *spa) } if (spa_feature_is_active(spa, - &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) { + SPA_FEATURE_ASYNC_DESTROY)) { dump_bptree(spa->spa_meta_objset, spa->spa_dsl_pool->dp_bptree_obj, "Pool dataset frees"); Modified: user/ae/inet6/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- user/ae/inet6/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/cddl/contrib/opensolaris/cmd/zhack/zhack.c Tue Dec 24 15:44:09 2013 (r259824) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -85,10 +85,15 @@ usage(void) static void -fatal(const char *fmt, ...) +fatal(spa_t *spa, void *tag, const char *fmt, ...) { va_list ap; + if (spa != NULL) { + spa_close(spa, tag); + (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE); + } + va_start(ap, fmt); (void) fprintf(stderr, "%s: ", cmdname); (void) vfprintf(stderr, fmt, ap); @@ -159,13 +164,14 @@ import_pool(const char *target, boolean_ g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || spa_open(target, &spa, FTAG) == 0) { - fatal("cannot import '%s': pool is active; run " - "\"zpool export %s\" first\n", - g_pool, g_pool); + fatal(spa, FTAG, "cannot import '%s': pool is " + "active; run " "\"zpool export %s\" " + "first\n", g_pool, g_pool); } } - fatal("cannot import '%s': no such pool available\n", g_pool); + fatal(NULL, FTAG, "cannot import '%s': no such pool " + "available\n", g_pool); } elem = nvlist_next_nvpair(pools, NULL); @@ -186,7 +192,8 @@ import_pool(const char *target, boolean_ error = 0; if (error) - fatal("can't import '%s': %s", name, strerror(error)); + fatal(NULL, FTAG, "can't import '%s': %s", name, + strerror(error)); } static void @@ -201,10 +208,11 @@ zhack_spa_open(const char *target, boole zfeature_checks_disable = B_FALSE; if (err != 0) - fatal("cannot open '%s': %s", target, strerror(err)); + fatal(*spa, FTAG, "cannot open '%s': %s", target, + strerror(err)); if (spa_version(*spa) < SPA_VERSION_FEATURES) { - fatal("'%s' has version %d, features not enabled", target, - (int)spa_version(*spa)); + fatal(*spa, FTAG, "'%s' has version %d, features not enabled", + target, (int)spa_version(*spa)); } } @@ -275,12 +283,13 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg, dmu_tx_t *tx) +zhack_feature_enable_sync(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; - spa_feature_enable(spa, feature, tx); + feature_enable_sync(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, "name=%s can_readonly=%u", feature->fi_guid, feature->fi_can_readonly); @@ -294,7 +303,7 @@ zhack_do_feature_enable(int argc, char * spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * Features are not added to the pool's label until their refcounts @@ -336,18 +345,19 @@ zhack_do_feature_enable(int argc, char * feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not enable"); + if (zfeature_is_supported(feature.fi_guid)) + fatal(spa, FTAG, "'%s' is a real feature, will not enable"); if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) - fatal("feature already enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature already enabled: %s", + feature.fi_guid); VERIFY0(dsl_sync_task(spa_name(spa), NULL, - feature_enable_sync, &feature, 5)); + zhack_feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -359,8 +369,10 @@ feature_incr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_incr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "name=%s", feature->fi_guid); } @@ -370,8 +382,10 @@ feature_decr_sync(void *arg, dmu_tx_t *t { spa_t *spa = dmu_tx_pool(tx)->dp_spa; zfeature_info_t *feature = arg; + uint64_t refcount; - spa_feature_decr(spa, feature, tx); + VERIFY0(feature_get_refcount(spa, feature, &refcount)); + feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "name=%s", feature->fi_guid); } @@ -385,7 +399,7 @@ zhack_do_feature_ref(int argc, char **ar spa_t *spa; objset_t *mos; zfeature_info_t feature; - zfeature_info_t *nodeps[] = { NULL }; + spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; /* * fi_desc does not matter here because it was written to disk @@ -423,13 +437,15 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid = argv[1]; if (!zfeature_is_valid_guid(feature.fi_guid)) - fatal("invalid feature guid: %s", feature.fi_guid); + fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid); zhack_spa_open(target, B_FALSE, FTAG, &spa); mos = spa->spa_meta_objset; - if (0 == zfeature_lookup_guid(feature.fi_guid, NULL)) - fatal("'%s' is a real feature, will not change refcount"); + if (zfeature_is_supported(feature.fi_guid)) { + fatal(spa, FTAG, + "'%s' is a real feature, will not change refcount"); + } if (0 == zap_contains(mos, spa->spa_feat_for_read_obj, feature.fi_guid)) { @@ -438,11 +454,17 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_guid)) { feature.fi_can_readonly = B_TRUE; } else { - fatal("feature is not enabled: %s", feature.fi_guid); + fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid); } - if (decr && !spa_feature_is_active(spa, &feature)) - fatal("feature refcount already 0: %s", feature.fi_guid); + if (decr) { + uint64_t count; + if (feature_get_refcount(spa, &feature, &count) == 0 && + count != 0) { + fatal(spa, FTAG, "feature refcount already 0: %s", + feature.fi_guid); + } + } VERIFY0(dsl_sync_task(spa_name(spa), NULL, decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); @@ -530,8 +552,8 @@ main(int argc, char **argv) usage(); } - if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_TRUE) != 0) { - fatal("pool export failed; " + if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) { + fatal(NULL, FTAG, "pool export failed; " "changes may not be committed to disk\n"); } Modified: user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Tue Dec 24 15:44:09 2013 (r259824) @@ -269,6 +269,23 @@ an existing space map is upgraded to the Once the feature is .Sy active , it will remain in that state until the pool is destroyed. +.It Sy extensible_dataset +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:extensible_dataset" +.It GUID Ta com.delphix:extensible_dataset +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature allows more flexible use of internal ZFS data structures, +and exists for other features to depend on. +.Pp +This feature will be +.Sy active +when the first dependent feature uses it, +and will be returned to the +.Sy enabled +state when all datasets that use +this feature are destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue Dec 24 15:44:09 2013 (r259824) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -1004,7 +1004,7 @@ zpool_do_create(int argc, char **argv) * Hand off to libzfs. */ if (enable_all_pool_feat) { - int i; + spa_feature_t i; for (i = 0; i < SPA_FEATURES; i++) { char propname[MAXPATHLEN]; zfeature_info_t *feat = &spa_feature_table[i]; Modified: user/ae/inet6/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- user/ae/inet6/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Tue Dec 24 15:44:09 2013 (r259824) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -443,10 +443,9 @@ zpool_valid_proplist(libzfs_handle_t *hd prop = zpool_name_to_prop(propname); if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) { int err; - zfeature_info_t *feature; char *fname = strchr(propname, '@') + 1; - err = zfeature_lookup_name(fname, &feature); + err = zfeature_lookup_name(fname, NULL); if (err != 0) { ASSERT3U(err, ==, ENOENT); zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -839,14 +838,14 @@ zpool_prop_get_feature(zpool_handle_t *z */ if (supported) { int ret; - zfeature_info_t *fi; + spa_feature_t fid; - ret = zfeature_lookup_name(feature, &fi); + ret = zfeature_lookup_name(feature, &fid); if (ret != 0) { (void) strlcpy(buf, "-", len); return (ENOTSUP); } - feature = fi->fi_guid; + feature = spa_feature_table[fid].fi_guid; } if (nvlist_lookup_uint64(features, feature, &refcount) == 0) Modified: user/ae/inet6/contrib/file/compress.c ============================================================================== --- user/ae/inet6/contrib/file/compress.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/file/compress.c Tue Dec 24 15:44:09 2013 (r259824) @@ -480,7 +480,7 @@ uncompressbuf(struct magic_set *ms, int #endif free(*newch); n = 0; - newch[0] = '\0'; + *newch = NULL; goto err; } else { n = r; Modified: user/ae/inet6/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- user/ae/inet6/contrib/gcc/ChangeLog.gcc43 Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/ChangeLog.gcc43 Tue Dec 24 15:44:09 2013 (r259824) @@ -45,6 +45,20 @@ * flags.h (force_align_functions_log): Delete. * toplev.c (force_align_functions_log): Delete. +2007-07-06 Josh Conner (r126422) + + PR middle-end/32602 + PR middle-end/32603 + * calls.c (store_one_arg): Handle arguments which are partially + on the stack when detecting argument overlap. + +2007-07-03 Eric Christopher (r126278) + + * doc/cppopts.texi: Add conflicting option note to -dM. + * doc/invoke.texi: Add note about possible conflicts with + -E for -dCHARS and note that -dM will not produce + any results if there is no machine dependent reorg. + 2007-06-28 Geoffrey Keating (r126088) * doc/invoke.texi (C++ Dialect Options): Document @@ -94,6 +108,14 @@ regs_invalidated_by_call, rather than just checking the membership of REGNO (REG). +2007-05-18 Geoffrey Keating (r124839) + + * dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'. + (output_die): Use 'unsigned long' with %x. + * sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and + HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT. + * tree-dump.c (dump_pointer): Use 'unsigned long' for %lx. + 2007-05-16 Eric Christopher (r124763) * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register @@ -399,6 +421,12 @@ (override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b for CPUs that have PTA_CX16 set. +2007-01-18 Josh Conner (r120902) + + PR target/30485 + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add + support for UNLE, UNLT, UNGE, and UNGT. + 2007-01-17 Eric Christopher (r120846) * config.gcc: Support core2 processor. @@ -408,6 +436,14 @@ * c-common.c (vector_types_convertible_p): Treat opaque types as always convertible if they have the same size, but not otherwise. +2007-01-08 Geoffrey Keating (r120611) + + * target.h (struct gcc_target): New field library_rtti_comdat. + * target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New. + (TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT. + * doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT. + * config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define. + 2007-01-08 Mark Shinwell (r120572) * c.opt: Add -flax-vector-conversions. Modified: user/ae/inet6/contrib/gcc/c-common.c ============================================================================== --- user/ae/inet6/contrib/gcc/c-common.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c-common.c Tue Dec 24 15:44:09 2013 (r259824) @@ -6014,11 +6014,11 @@ c_parse_error (const char *gmsgid, enum message = NULL; } else - error (gmsgid); + error (gmsgid, ""); if (message) { - error (message); + error (message, ""); free (message); } #undef catenate_messages Modified: user/ae/inet6/contrib/gcc/c-convert.c ============================================================================== --- user/ae/inet6/contrib/gcc/c-convert.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c-convert.c Tue Dec 24 15:44:09 2013 (r259824) @@ -80,7 +80,7 @@ convert (tree type, tree expr) if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: user/ae/inet6/contrib/gcc/c-incpath.c ============================================================================== --- user/ae/inet6/contrib/gcc/c-incpath.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c-incpath.c Tue Dec 24 15:44:09 2013 (r259824) @@ -72,7 +72,7 @@ free_path (struct cpp_dir *path, int rea case REASON_DUP_SYS: fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name); if (reason == REASON_DUP_SYS) - fprintf (stderr, + fprintf (stderr, "%s", _(" as it is a non-system directory that duplicates a system directory\n")); break; @@ -292,16 +292,16 @@ merge_include_chains (cpp_reader *pfile, { struct cpp_dir *p; - fprintf (stderr, _("#include \"...\" search starts here:\n")); + fprintf (stderr, "%s", _("#include \"...\" search starts here:\n")); for (p = heads[QUOTE];; p = p->next) { if (p == heads[BRACKET]) - fprintf (stderr, _("#include <...> search starts here:\n")); + fprintf (stderr, "%s", _("#include <...> search starts here:\n")); if (!p) break; fprintf (stderr, " %s\n", p->name); } - fprintf (stderr, _("End of search list.\n")); + fprintf (stderr, "%s", _("End of search list.\n")); } } Modified: user/ae/inet6/contrib/gcc/c-opts.c ============================================================================== --- user/ae/inet6/contrib/gcc/c-opts.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c-opts.c Tue Dec 24 15:44:09 2013 (r259824) @@ -487,6 +487,12 @@ c_common_handle_option (size_t scode, co cpp_opts->warn_multichar = value; break; + /* APPLE LOCAL begin -Wnewline-eof */ + case OPT_Wnewline_eof: + cpp_opts->warn_newline_at_eof = value; + break; + /* APPLE LOCAL end -Wnewline-eof */ + case OPT_Wnormalized_: if (!value || (arg && strcasecmp (arg, "none") == 0)) cpp_opts->warn_normalize = normalized_none; Modified: user/ae/inet6/contrib/gcc/c-typeck.c ============================================================================== --- user/ae/inet6/contrib/gcc/c-typeck.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c-typeck.c Tue Dec 24 15:44:09 2013 (r259824) @@ -2584,7 +2584,7 @@ convert_arguments (tree typelist, tree v else if ((invalid_func_diag = targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val))) { - error (invalid_func_diag); + error (invalid_func_diag, ""); return error_mark_node; } else @@ -2781,7 +2781,7 @@ build_unary_op (enum tree_code code, tre if ((invalid_op_diag = targetm.invalid_unary_op (code, TREE_TYPE (xarg)))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } @@ -7819,7 +7819,7 @@ build_binary_op (enum tree_code code, tr if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + error (invalid_op_diag, ""); return error_mark_node; } Modified: user/ae/inet6/contrib/gcc/c.opt ============================================================================== --- user/ae/inet6/contrib/gcc/c.opt Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/c.opt Tue Dec 24 15:44:09 2013 (r259824) @@ -292,6 +292,12 @@ Wnested-externs C ObjC Var(warn_nested_externs) Warn about \"extern\" declarations not at file scope +; APPLE LOCAL begin -Wnewline-eof +Wnewline-eof +C ObjC C++ ObjC++ +Warn about files missing a newline at the end of the file +; APPLE LOCAL end -Wnewline-eof + Wnon-template-friend C++ ObjC++ Var(warn_nontemplate_friend) Init(1) Warn when non-templatized friend functions are declared within a template Modified: user/ae/inet6/contrib/gcc/calls.c ============================================================================== --- user/ae/inet6/contrib/gcc/calls.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/calls.c Tue Dec 24 15:44:09 2013 (r259824) @@ -4297,6 +4297,7 @@ store_one_arg (struct arg_data *arg, rtx /* expand_call should ensure this. */ gcc_assert (!arg->locate.offset.var + && arg->locate.size.var == 0 && GET_CODE (size_rtx) == CONST_INT); if (arg->locate.offset.constant > i) @@ -4306,7 +4307,21 @@ store_one_arg (struct arg_data *arg, rtx } else if (arg->locate.offset.constant < i) { - if (i < arg->locate.offset.constant + INTVAL (size_rtx)) + /* Use arg->locate.size.constant instead of size_rtx + because we only care about the part of the argument + on the stack. */ + if (i < (arg->locate.offset.constant + + arg->locate.size.constant)) + sibcall_failure = 1; + } + else + { + /* Even though they appear to be at the same location, + if part of the outgoing argument is in registers, + they aren't really at the same location. Check for + this by making sure that the incoming size is the + same as the outgoing size. */ + if (arg->locate.size.constant != INTVAL (size_rtx)) sibcall_failure = 1; } } Modified: user/ae/inet6/contrib/gcc/cfg.c ============================================================================== --- user/ae/inet6/contrib/gcc/cfg.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/cfg.c Tue Dec 24 15:44:09 2013 (r259824) @@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc else fprintf (file, ", "); first = false; - fputs (bb_bitnames[i], file); + fprintf (file, "%s", bb_bitnames[i]); } if (!first) fprintf (file, ")"); Modified: user/ae/inet6/contrib/gcc/collect2.c ============================================================================== --- user/ae/inet6/contrib/gcc/collect2.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/collect2.c Tue Dec 24 15:44:09 2013 (r259824) @@ -1562,10 +1562,10 @@ collect_execute (const char *prog, char if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } return pex; @@ -2050,10 +2050,10 @@ scan_prog_file (const char *prog_name, e if (err != 0) { errno = err; - fatal_perror (errmsg); + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + fatal ("%s", errmsg); } int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); Modified: user/ae/inet6/contrib/gcc/config/darwin.h ============================================================================== --- user/ae/inet6/contrib/gcc/config/darwin.h Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/config/darwin.h Tue Dec 24 15:44:09 2013 (r259824) @@ -467,6 +467,10 @@ extern GTY(()) int darwin_ms_struct; with names, so it's safe to make the class data not comdat. */ #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false +/* For efficiency, on Darwin the RTTI information that is always + emitted in the standard C++ library should not be COMDAT. */ +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false + /* We make exception information linkonce. */ #undef TARGET_USES_WEAK_UNWIND_INFO #define TARGET_USES_WEAK_UNWIND_INFO 1 Modified: user/ae/inet6/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- user/ae/inet6/contrib/gcc/config/rs6000/rs6000.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/config/rs6000/rs6000.c Tue Dec 24 15:44:09 2013 (r259824) @@ -11738,11 +11738,20 @@ rs6000_emit_vector_compare (enum rtx_cod try_again = true; break; case NE: - /* Treat A != B as ~(A==B). */ + case UNLE: + case UNLT: + case UNGE: + case UNGT: + /* Invert condition and try again. + e.g., A != B becomes ~(A==B). */ { + enum rtx_code rev_code; enum insn_code nor_code; - rtx eq_rtx = rs6000_emit_vector_compare (EQ, op0, op1, - dest_mode); + rtx eq_rtx; + + rev_code = reverse_condition_maybe_unordered (rcode); + eq_rtx = rs6000_emit_vector_compare (rev_code, op0, op1, + dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; gcc_assert (nor_code != CODE_FOR_nothing); Modified: user/ae/inet6/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- user/ae/inet6/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/cp/ChangeLog.gcc43 Tue Dec 24 15:44:09 2013 (r259824) @@ -29,6 +29,16 @@ * typeck.c (build_binary_op): Include types in error. +2007-05-18 Geoffrey Keating (r124839) + + * mangle.c (write_real_cst): Use 'unsigned long' for %lx. + +2007-05-14 Paolo Carlini (r124724) + + PR c++/29928 + * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the + type only if is a class type (5.2.8/4). + 2007-05-05 Geoffrey Keating (r124467) PR 31775 @@ -62,6 +72,18 @@ * semantics.c (finish_unary_op_expr): Warn only if result overflowed and operands did not. +2006-12-01 Geoffrey Keating (r119427) + + * decl.c (poplevel): Check DECL_INITIAL invariant. + (duplicate_decls): Preserve DECL_INITIAL when eliminating + a new definition in favour of an old declaration. + (start_preparsed_function): Define and document value of + DECL_INITIAL before and after routine. + (finish_function): Check DECL_INITIAL invariant. + * parser.c + (cp_parser_function_definition_from_specifiers_and_declarator): + Skip duplicate function definitions. + 2006-10-31 Geoffrey Keating (r118360) * name-lookup.c (get_anonymous_namespace_name): New. Modified: user/ae/inet6/contrib/gcc/cp/Make-lang.in ============================================================================== --- user/ae/inet6/contrib/gcc/cp/Make-lang.in Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/cp/Make-lang.in Tue Dec 24 15:44:09 2013 (r259824) @@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_ $(TARGET_H) debug.h cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ - gt-cp-rtti.h + $(TARGET_H) gt-cp-rtti.h cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ Modified: user/ae/inet6/contrib/gcc/cp/cvt.c ============================================================================== --- user/ae/inet6/contrib/gcc/cp/cvt.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/cp/cvt.c Tue Dec 24 15:44:09 2013 (r259824) @@ -615,7 +615,7 @@ ocp_convert (tree type, tree expr, int c if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + error (invalid_conv_diag, ""); return error_mark_node; } Modified: user/ae/inet6/contrib/gcc/cp/decl.c ============================================================================== --- user/ae/inet6/contrib/gcc/cp/decl.c Tue Dec 24 14:48:52 2013 (r259823) +++ user/ae/inet6/contrib/gcc/cp/decl.c Tue Dec 24 15:44:09 2013 (r259824) @@ -758,7 +758,12 @@ poplevel (int keep, int reverse, int fun leave_scope (); if (functionbody) - DECL_INITIAL (current_function_decl) = block; + { + /* The current function is being defined, so its DECL_INITIAL + should be error_mark_node. */ + gcc_assert (DECL_INITIAL (current_function_decl) == error_mark_node); + DECL_INITIAL (current_function_decl) = block; + } else if (block) current_binding_level->blocks = chainon (current_binding_level->blocks, block); @@ -1635,13 +1640,15 @@ duplicate_decls (tree newdecl, tree oldd } /* If the new declaration is a definition, update the file and - line information on the declaration. */ + line information on the declaration, and also make + the old declaration the same definition. */ if (DECL_INITIAL (old_result) == NULL_TREE && DECL_INITIAL (new_result) != NULL_TREE) { DECL_SOURCE_LOCATION (olddecl) = DECL_SOURCE_LOCATION (old_result) = DECL_SOURCE_LOCATION (newdecl); + DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) DECL_ARGUMENTS (old_result) = DECL_ARGUMENTS (new_result); @@ -10509,7 +10516,13 @@ check_function_type (tree decl, tree cur For C++, we must first check whether that datum makes any sense. For example, "class A local_a(1,2);" means that variable local_a is an aggregate of type A, which should have a constructor - applied to it with the argument list [1, 2]. */ + applied to it with the argument list [1, 2]. + + On entry, DECL_INITIAL (decl1) should be NULL_TREE or error_mark_node, + or may be a BLOCK if the function has been defined previously + in this translation unit. On exit, DECL_INITIAL (decl1) will be + error_mark_node if the function has never been defined, or + a BLOCK if the function has been defined somewhere. */ void start_preparsed_function (tree decl1, tree attrs, int flags) @@ -10638,24 +10651,6 @@ start_preparsed_function (tree decl1, tr cp_apply_type_quals_to_decl (cp_type_quals (restype), resdecl); } - /* Initialize RTL machinery. We cannot do this until - CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this - even when processing a template; this is how we get - CFUN set up, and our per-function variables initialized. - FIXME factor out the non-RTL stuff. */ - bl = current_binding_level; - allocate_struct_function (decl1); - current_binding_level = bl; - - /* Even though we're inside a function body, we still don't want to - call expand_expr to calculate the size of a variable-sized array. - We haven't necessarily assigned RTL to all variables yet, so it's - not safe to try to expand expressions involving them. */ - cfun->x_dont_save_pending_sizes_p = 1; - - /* Start the statement-tree, start the tree now. */ - DECL_SAVED_TREE (decl1) = push_stmt_list (); - /* Let the user know we're compiling this function. */ announce_function (decl1); @@ -10701,9 +10696,33 @@ start_preparsed_function (tree decl1, tr maybe_apply_pragma_weak (decl1); } - /* Reset these in case the call to pushdecl changed them. */ + /* Reset this in case the call to pushdecl changed it. */ current_function_decl = decl1; - cfun->decl = decl1; + + gcc_assert (DECL_INITIAL (decl1)); + + /* This function may already have been parsed, in which case just + return; our caller will skip over the body without parsing. */ + if (DECL_INITIAL (decl1) != error_mark_node) + return; + + /* Initialize RTL machinery. We cannot do this until + CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this + even when processing a template; this is how we get + CFUN set up, and our per-function variables initialized. + FIXME factor out the non-RTL stuff. */ + bl = current_binding_level; + allocate_struct_function (decl1); + current_binding_level = bl; + + /* Even though we're inside a function body, we still don't want to + call expand_expr to calculate the size of a variable-sized array. + We haven't necessarily assigned RTL to all variables yet, so it's + not safe to try to expand expressions involving them. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Dec 25 08:34:36 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6357A3A8; Wed, 25 Dec 2013 08:34:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F890102F; Wed, 25 Dec 2013 08:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBP8YaAn028363; Wed, 25 Dec 2013 08:34:36 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBP8YasC028362; Wed, 25 Dec 2013 08:34:36 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201312250834.rBP8YasC028362@svn.freebsd.org> From: Peter Holm Date: Wed, 25 Dec 2013 08:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259864 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 25 Dec 2013 08:34:36 -0000 Author: pho Date: Wed Dec 25 08:34:35 2013 New Revision: 259864 URL: http://svnweb.freebsd.org/changeset/base/259864 Log: Do not assume that "/var" is a mount point. Use a MD based file system. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/recursiveflushes.sh Modified: user/pho/stress2/misc/recursiveflushes.sh ============================================================================== --- user/pho/stress2/misc/recursiveflushes.sh Wed Dec 25 06:46:31 2013 (r259863) +++ user/pho/stress2/misc/recursiveflushes.sh Wed Dec 25 08:34:35 2013 (r259864) @@ -32,6 +32,8 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + snap() { for i in `jot 5`; do mksnap_ffs $1 $2 @@ -39,15 +41,21 @@ snap() { done } +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 4g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs $newfs_flags md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint + old=`sysctl vfs.recursiveflushes | awk '{print $NF}'` -cd /var/tmp -rm -f /var/.snap/pho.* -trap "rm -f /var/.snap/pho.*" 0 -snap /var /var/.snap/pho.1 -snap /var /var/.snap/pho.2 -snap /var /var/.snap/pho.3 -snap /var /var/.snap/pho.4 -snap /var /var/.snap/pho.5 +cd $mntpoint +rm -f $mntpoint/.snap/pho.* +snap $mntpoint $mntpoint/.snap/pho.1 +snap $mntpoint $mntpoint/.snap/pho.2 +snap $mntpoint $mntpoint/.snap/pho.3 +snap $mntpoint $mntpoint/.snap/pho.4 +snap $mntpoint $mntpoint/.snap/pho.5 for i in `jot 32`; do # Create 32 Mb files @@ -60,6 +68,12 @@ for i in `jot 32`; do rm -f big.$i done -rm -f /var/.snap/pho.* +rm -f $mntpoint/.snap/pho.* new=`sysctl vfs.recursiveflushes | awk '{print $NF}'` [ $old != $new ] && echo "vfs.recursiveflushes changed from $old to $new" + +cd / +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart From owner-svn-src-user@FreeBSD.ORG Wed Dec 25 13:51:14 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7C8B917; Wed, 25 Dec 2013 13:51:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A46B017BD; Wed, 25 Dec 2013 13:51:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPDpEfB045978; Wed, 25 Dec 2013 13:51:14 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPDpEI2045977; Wed, 25 Dec 2013 13:51:14 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201312251351.rBPDpEI2045977@svn.freebsd.org> From: Peter Holm Date: Wed, 25 Dec 2013 13:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259867 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 25 Dec 2013 13:51:14 -0000 Author: pho Date: Wed Dec 25 13:51:14 2013 New Revision: 259867 URL: http://svnweb.freebsd.org/changeset/base/259867 Log: Handle leading space in pid and add more cleanup. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/signal.sh Modified: user/pho/stress2/misc/signal.sh ============================================================================== --- user/pho/stress2/misc/signal.sh Wed Dec 25 12:41:53 2013 (r259866) +++ user/pho/stress2/misc/signal.sh Wed Dec 25 13:51:14 2013 (r259867) @@ -192,7 +192,7 @@ cc -o waitthread -Wall -Wextra waitthrea cc -o tkill -Wall -Wextra tkill.c || exit rm -f waitthread.c tkill.c -rm -f gdbfifo gdbout pstat +rm -f gdbfifo gdbout pstat /tmp/waitthread mkfifo gdbfifo sleep 300 > gdbfifo & # Keep the fifo open fifopid=$! @@ -202,7 +202,7 @@ echo "set args 8" > gdbfifo echo "run" > gdbfifo sleep .2 -pid=`ps | grep -v grep | grep "waitthread 8" | sed 's/ .*//'` +pid=`ps | grep -v grep | grep "waitthread 8" | sed 's/^ *//;s/ .*//'` procstat -t $pid > pstat t1=`grep fifo pstat | awk '{print $2}'` @@ -217,7 +217,7 @@ echo "quit" > gdbfifo kill $fifopid if grep -q "signal SIGINT" gdbout; then - rm -f gdbfifo gdbout pstat waitthread tkill + rm -f gdbfifo gdbout pstat waitthread tkill /tmp/waitthread else echo FAIL fi From owner-svn-src-user@FreeBSD.ORG Wed Dec 25 21:21:30 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BDE399E; Wed, 25 Dec 2013 21:21:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 382DA13E3; Wed, 25 Dec 2013 21:21:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBPLLUPt015896; Wed, 25 Dec 2013 21:21:30 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBPLLUTJ015895; Wed, 25 Dec 2013 21:21:30 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201312252121.rBPLLUTJ015895@svn.freebsd.org> From: Peter Holm Date: Wed, 25 Dec 2013 21:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259889 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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, 25 Dec 2013 21:21:30 -0000 Author: pho Date: Wed Dec 25 21:21:29 2013 New Revision: 259889 URL: http://svnweb.freebsd.org/changeset/base/259889 Log: Added a timeout for this test. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/fts.sh Modified: user/pho/stress2/misc/fts.sh ============================================================================== --- user/pho/stress2/misc/fts.sh Wed Dec 25 20:58:02 2013 (r259888) +++ user/pho/stress2/misc/fts.sh Wed Dec 25 21:21:29 2013 (r259889) @@ -135,6 +135,7 @@ main(int argc, char **argv) if (argc != 2) errx(1, "Usage: %s ", argv[0]); + alarm(600); for (i = 0; i < 100; i++) test(argv[1]); From owner-svn-src-user@FreeBSD.ORG Thu Dec 26 09:09:52 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4EB4904; Thu, 26 Dec 2013 09:09:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D219E1F94; Thu, 26 Dec 2013 09:09:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBQ99qGg084000; Thu, 26 Dec 2013 09:09:52 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBQ99qDC083999; Thu, 26 Dec 2013 09:09:52 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201312260909.rBQ99qDC083999@svn.freebsd.org> From: Peter Holm Date: Thu, 26 Dec 2013 09:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259911 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Thu, 26 Dec 2013 09:09:53 -0000 Author: pho Date: Thu Dec 26 09:09:52 2013 New Revision: 259911 URL: http://svnweb.freebsd.org/changeset/base/259911 Log: Added a timeout to this test. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/sendfile2.sh Modified: user/pho/stress2/misc/sendfile2.sh ============================================================================== --- user/pho/stress2/misc/sendfile2.sh Thu Dec 26 07:10:54 2013 (r259910) +++ user/pho/stress2/misc/sendfile2.sh Thu Dec 26 09:09:52 2013 (r259911) @@ -89,6 +89,7 @@ main () { off_t sent = 0; int chunk; + alarm(120); s = socket(AF_INET, SOCK_STREAM, 0); bzero(&addr, sizeof(addr)); addr.sin_family = AF_INET; From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 02:49:05 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41C578CF; Fri, 27 Dec 2013 02:49:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2224E1652; Fri, 27 Dec 2013 02:49:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR2n56d003531; Fri, 27 Dec 2013 02:49:05 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR2n4gF003530; Fri, 27 Dec 2013 02:49:04 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312270249.rBR2n4gF003530@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 27 Dec 2013 02:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259930 - user/ae/inet6/lib/libjail X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 02:49:05 -0000 Author: ae Date: Fri Dec 27 02:49:04 2013 New Revision: 259930 URL: http://svnweb.freebsd.org/changeset/base/259930 Log: Use struct sockaddr_in6 instead of in6_addr in libjail. Modified: user/ae/inet6/lib/libjail/jail.c Modified: user/ae/inet6/lib/libjail/jail.c ============================================================================== --- user/ae/inet6/lib/libjail/jail.c Fri Dec 27 02:43:53 2013 (r259929) +++ user/ae/inet6/lib/libjail/jail.c Fri Dec 27 02:49:04 2013 (r259930) @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include @@ -293,6 +295,7 @@ jailparam_init(struct jailparam *jp, con int jailparam_import(struct jailparam *jp, const char *value) { + struct addrinfo hints, *res; char *p, *ep, *tvalue; const char *avalue; int i, nval, fw; @@ -410,9 +413,11 @@ jailparam_import(struct jailparam *jp, c } break; case JPS_IN6_ADDR: - if (inet_pton(AF_INET6, tvalue, - &((struct in6_addr *)jp->jp_value)[i]) != 1) - { + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_INET6; + hints.ai_flags = AI_NUMERICHOST; + if (getaddrinfo(tvalue, NULL, &hints, + &res) != 0) { snprintf(jail_errmsg, JAIL_ERRMSGLEN, "%s: not an IPv6 address: %s", @@ -420,6 +425,10 @@ jailparam_import(struct jailparam *jp, c errno = EINVAL; goto error; } + memcpy(&((struct sockaddr_in6 *) + jp->jp_value)[i], res->ai_addr, + res->ai_addrlen); + freeaddrinfo(res); break; default: goto unknown_type; @@ -723,11 +732,12 @@ jailparam_get(struct jailparam *jp, unsi char * jailparam_export(struct jailparam *jp) { + struct sockaddr_in6 *sa6; size_t *valuelens; char *value, *tvalue, **values; size_t valuelen; int i, nval, ival; - char valbuf[INET6_ADDRSTRLEN]; + char valbuf[INET6_ADDRSTRLEN + IF_NAMESIZE + 1]; if ((jp->jp_ctltype & CTLTYPE) == CTLTYPE_STRING) { value = strdup(jp->jp_value); @@ -796,11 +806,13 @@ jailparam_export(struct jailparam *jp) } break; case JPS_IN6_ADDR: - if (inet_ntop(AF_INET6, - &((struct in6_addr *)jp->jp_value)[i], - valbuf, sizeof(valbuf)) == NULL) { - strerror_r(errno, jail_errmsg, - JAIL_ERRMSGLEN); + sa6 = &((struct sockaddr_in6 *)jp->jp_value)[i]; + if ((errno = getnameinfo((struct sockaddr *)sa6, + sa6->sin6_len, valbuf, sizeof(valbuf), + NULL, 0, NI_NUMERICHOST)) != 0) { + snprintf(jail_errmsg, JAIL_ERRMSGLEN, + "getnameinfo: %s", + gai_strerror(errno)); return (NULL); } break; @@ -969,9 +981,9 @@ jailparam_type(struct jailparam *jp) if (!strcmp(desc.s, "S,in_addr")) { jp->jp_structtype = JPS_IN_ADDR; jp->jp_valuelen = sizeof(struct in_addr); - } else if (!strcmp(desc.s, "S,in6_addr")) { + } else if (!strcmp(desc.s, "S,sockaddr_in6")) { jp->jp_structtype = JPS_IN6_ADDR; - jp->jp_valuelen = sizeof(struct in6_addr); + jp->jp_valuelen = sizeof(struct sockaddr_in6); } else { desclen = 0; if (sysctl(mib + 2, miblen / sizeof(int), From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 02:49:57 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 646719B0; Fri, 27 Dec 2013 02:49:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BECC1654; Fri, 27 Dec 2013 02:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR2nvZ4003635; Fri, 27 Dec 2013 02:49:57 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR2nvri003634; Fri, 27 Dec 2013 02:49:57 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312270249.rBR2nvri003634@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 27 Dec 2013 02:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259931 - user/ae/inet6/usr.sbin/jail X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 02:49:57 -0000 Author: ae Date: Fri Dec 27 02:49:56 2013 New Revision: 259931 URL: http://svnweb.freebsd.org/changeset/base/259931 Log: Use struct sockaddr_in6 instead of in6_addr in jail(8). Modified: user/ae/inet6/usr.sbin/jail/config.c Modified: user/ae/inet6/usr.sbin/jail/config.c ============================================================================== --- user/ae/inet6/usr.sbin/jail/config.c Fri Dec 27 02:49:04 2013 (r259930) +++ user/ae/inet6/usr.sbin/jail/config.c Fri Dec 27 02:49:56 2013 (r259931) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -456,9 +457,8 @@ check_intparams(struct cfjail *j) char avalue4[INET_ADDRSTRLEN]; #endif #ifdef INET6 - struct in6_addr addr6; int ip6ok; - char avalue6[INET6_ADDRSTRLEN]; + char avalue6[INET6_ADDRSTRLEN + IF_NAMESIZE + 1]; #endif error = 0; @@ -556,14 +556,11 @@ check_intparams(struct cfjail *j) #endif #ifdef INET6 case AF_INET6: - memcpy(&addr6, - &((struct sockaddr_in6 *) - (void *)ai->ai_addr)-> - sin6_addr, sizeof(addr6)); - if (inet_ntop(AF_INET6, - &addr6, avalue6, - INET6_ADDRSTRLEN) == NULL) - err(1, "inet_ntop"); + if (getnameinfo(ai->ai_addr, + ai->ai_addrlen, avalue6, + sizeof(avalue6), NULL, 0, + NI_NUMERICHOST) != 0) + err(1, "getnameinfo"); add_param(j, NULL, KP_IP6_ADDR, avalue6); break; From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 03:36:20 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4BE443E9; Fri, 27 Dec 2013 03:36:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1F76E1AAA; Fri, 27 Dec 2013 03:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR3aJLM022938; Fri, 27 Dec 2013 03:36:19 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR3aJH2022937; Fri, 27 Dec 2013 03:36:19 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312270336.rBR3aJH2022937@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 03:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259932 - user/gjb X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 03:36:20 -0000 Author: gjb Date: Fri Dec 27 03:36:19 2013 New Revision: 259932 URL: http://svnweb.freebsd.org/changeset/base/259932 Log: Create my ^/user directory. Sponsored by: The FreeBSD Foundation Added: user/gjb/ From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 03:38:02 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1520E4DC; Fri, 27 Dec 2013 03:38:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE14A1AB3; Fri, 27 Dec 2013 03:38:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR3c1f2023137; Fri, 27 Dec 2013 03:38:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR3c1jw023135; Fri, 27 Dec 2013 03:38:01 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312270338.rBR3c1jw023135@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 03:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259933 - user/gjb/hacking X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 03:38:02 -0000 Author: gjb Date: Fri Dec 27 03:38:01 2013 New Revision: 259933 URL: http://svnweb.freebsd.org/changeset/base/259933 Log: Create a directory to contain branches for stuff I'm working on. Sponsored by: The FreeBSD Foundation Added: user/gjb/hacking/ From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 04:23:08 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2DC1DD14; Fri, 27 Dec 2013 04:23:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 00A161E35; Fri, 27 Dec 2013 04:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR4N7pM040910; Fri, 27 Dec 2013 04:23:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR4N7Va040909; Fri, 27 Dec 2013 04:23:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312270423.rBR4N7Va040909@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 04:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259934 - user/gjb/hacking/release-embedded X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 04:23:08 -0000 Author: gjb Date: Fri Dec 27 04:23:07 2013 New Revision: 259934 URL: http://svnweb.freebsd.org/changeset/base/259934 Log: Copy head@r259933 -> user/gjb/hacking/release-embedded for initial inclusion of (at least) arm builds with the release. Sponsored by: The FreeBSD Foundation Added: user/gjb/hacking/release-embedded/ - copied from r259933, head/ From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 04:30:33 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50D67E25; Fri, 27 Dec 2013 04:30:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 319691E97; Fri, 27 Dec 2013 04:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBR4UXPv043556; Fri, 27 Dec 2013 04:30:33 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBR4UXgK043555; Fri, 27 Dec 2013 04:30:33 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312270430.rBR4UXgK043555@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 04:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259935 - in user/gjb/hacking/release-embedded: . contrib/ipfilter contrib/top share/examples/kld/random_adaptor share/man/man4 share/mk sys/amd64/include sys/contrib/dev/acpica sys/con... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 04:30:33 -0000 Author: gjb Date: Fri Dec 27 04:30:32 2013 New Revision: 259935 URL: http://svnweb.freebsd.org/changeset/base/259935 Log: Burn mergeinfo on the new branch. Sponsored by: The FreeBSD Foundation Modified: Directory Properties: user/gjb/hacking/release-embedded/ (props changed) user/gjb/hacking/release-embedded/MAINTAINERS (props changed) user/gjb/hacking/release-embedded/cddl/ (props changed) user/gjb/hacking/release-embedded/cddl/contrib/opensolaris/ (props changed) user/gjb/hacking/release-embedded/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) user/gjb/hacking/release-embedded/cddl/contrib/opensolaris/cmd/zfs/ (props changed) user/gjb/hacking/release-embedded/cddl/contrib/opensolaris/lib/libzfs/ (props changed) user/gjb/hacking/release-embedded/contrib/apr/ (props changed) user/gjb/hacking/release-embedded/contrib/apr-util/ (props changed) user/gjb/hacking/release-embedded/contrib/atf/ (props changed) user/gjb/hacking/release-embedded/contrib/binutils/ (props changed) user/gjb/hacking/release-embedded/contrib/bmake/ (props changed) user/gjb/hacking/release-embedded/contrib/byacc/ (props changed) user/gjb/hacking/release-embedded/contrib/bzip2/ (props changed) user/gjb/hacking/release-embedded/contrib/com_err/ (props changed) user/gjb/hacking/release-embedded/contrib/compiler-rt/ (props changed) user/gjb/hacking/release-embedded/contrib/dialog/ (props changed) user/gjb/hacking/release-embedded/contrib/dtc/ (props changed) user/gjb/hacking/release-embedded/contrib/ee/ (props changed) user/gjb/hacking/release-embedded/contrib/expat/ (props changed) user/gjb/hacking/release-embedded/contrib/file/ (props changed) user/gjb/hacking/release-embedded/contrib/gcc/ (props changed) user/gjb/hacking/release-embedded/contrib/gdb/ (props changed) user/gjb/hacking/release-embedded/contrib/gdtoa/ (props changed) user/gjb/hacking/release-embedded/contrib/groff/ (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/ (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/ml_ipl.c (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/mlfk_ipl.c (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/mlh_rule.c (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/mli_ipl.c (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/mln_ipl.c (props changed) user/gjb/hacking/release-embedded/contrib/ipfilter/mls_ipl.c (props changed) user/gjb/hacking/release-embedded/contrib/ldns/ (props changed) user/gjb/hacking/release-embedded/contrib/less/ (props changed) user/gjb/hacking/release-embedded/contrib/libarchive/ (props changed) user/gjb/hacking/release-embedded/contrib/libarchive/cpio/ (props changed) user/gjb/hacking/release-embedded/contrib/libarchive/libarchive/ (props changed) user/gjb/hacking/release-embedded/contrib/libarchive/libarchive_fe/ (props changed) user/gjb/hacking/release-embedded/contrib/libarchive/tar/ (props changed) user/gjb/hacking/release-embedded/contrib/libc++/ (props changed) user/gjb/hacking/release-embedded/contrib/libc-vis/ (props changed) user/gjb/hacking/release-embedded/contrib/libcxxrt/ (props changed) user/gjb/hacking/release-embedded/contrib/libexecinfo/ (props changed) user/gjb/hacking/release-embedded/contrib/libpcap/ (props changed) user/gjb/hacking/release-embedded/contrib/libstdc++/ (props changed) user/gjb/hacking/release-embedded/contrib/llvm/ (props changed) user/gjb/hacking/release-embedded/contrib/llvm/tools/clang/ (props changed) user/gjb/hacking/release-embedded/contrib/llvm/tools/lldb/ (props changed) user/gjb/hacking/release-embedded/contrib/mtree/ (props changed) user/gjb/hacking/release-embedded/contrib/ncurses/ (props changed) user/gjb/hacking/release-embedded/contrib/netcat/ (props changed) user/gjb/hacking/release-embedded/contrib/ntp/ (props changed) user/gjb/hacking/release-embedded/contrib/nvi/ (props changed) user/gjb/hacking/release-embedded/contrib/one-true-awk/ (props changed) user/gjb/hacking/release-embedded/contrib/openbsm/ (props changed) user/gjb/hacking/release-embedded/contrib/openpam/ (props changed) user/gjb/hacking/release-embedded/contrib/openresolv/ (props changed) user/gjb/hacking/release-embedded/contrib/pf/ (props changed) user/gjb/hacking/release-embedded/contrib/sendmail/ (props changed) user/gjb/hacking/release-embedded/contrib/serf/ (props changed) user/gjb/hacking/release-embedded/contrib/subversion/ (props changed) user/gjb/hacking/release-embedded/contrib/tcpdump/ (props changed) user/gjb/hacking/release-embedded/contrib/tcsh/ (props changed) user/gjb/hacking/release-embedded/contrib/tnftp/ (props changed) user/gjb/hacking/release-embedded/contrib/top/ (props changed) user/gjb/hacking/release-embedded/contrib/top/install-sh (props changed) user/gjb/hacking/release-embedded/contrib/tzcode/stdtime/ (props changed) user/gjb/hacking/release-embedded/contrib/tzcode/zic/ (props changed) user/gjb/hacking/release-embedded/contrib/tzdata/ (props changed) user/gjb/hacking/release-embedded/contrib/unbound/ (props changed) user/gjb/hacking/release-embedded/contrib/wpa/ (props changed) user/gjb/hacking/release-embedded/contrib/xz/ (props changed) user/gjb/hacking/release-embedded/crypto/heimdal/ (props changed) user/gjb/hacking/release-embedded/crypto/openssh/ (props changed) user/gjb/hacking/release-embedded/crypto/openssl/ (props changed) user/gjb/hacking/release-embedded/etc/ (props changed) user/gjb/hacking/release-embedded/gnu/lib/ (props changed) user/gjb/hacking/release-embedded/gnu/usr.bin/binutils/ (props changed) user/gjb/hacking/release-embedded/gnu/usr.bin/cc/cc_tools/ (props changed) user/gjb/hacking/release-embedded/gnu/usr.bin/gdb/ (props changed) user/gjb/hacking/release-embedded/include/ (props changed) user/gjb/hacking/release-embedded/lib/libc/ (props changed) user/gjb/hacking/release-embedded/lib/libc/stdtime/ (props changed) user/gjb/hacking/release-embedded/lib/libutil/ (props changed) user/gjb/hacking/release-embedded/lib/libvmmapi/ (props changed) user/gjb/hacking/release-embedded/lib/libz/ (props changed) user/gjb/hacking/release-embedded/sbin/ (props changed) user/gjb/hacking/release-embedded/sbin/dumpon/ (props changed) user/gjb/hacking/release-embedded/sbin/ipfw/ (props changed) user/gjb/hacking/release-embedded/share/examples/kld/random_adaptor/random_adaptor_example.c (props changed) user/gjb/hacking/release-embedded/share/man/man4/ (props changed) user/gjb/hacking/release-embedded/share/man/man4/bhyve.4 (props changed) user/gjb/hacking/release-embedded/share/mk/bsd.arch.inc.mk (props changed) user/gjb/hacking/release-embedded/share/zoneinfo/ (props changed) user/gjb/hacking/release-embedded/sys/ (props changed) user/gjb/hacking/release-embedded/sys/amd64/include/vmm.h (props changed) user/gjb/hacking/release-embedded/sys/amd64/include/vmm_dev.h (props changed) user/gjb/hacking/release-embedded/sys/amd64/include/vmm_instruction_emul.h (props changed) user/gjb/hacking/release-embedded/sys/amd64/include/xen/ (props changed) user/gjb/hacking/release-embedded/sys/amd64/vmm/ (props changed) user/gjb/hacking/release-embedded/sys/boot/ (props changed) user/gjb/hacking/release-embedded/sys/boot/i386/efi/ (props changed) user/gjb/hacking/release-embedded/sys/boot/ia64/efi/ (props changed) user/gjb/hacking/release-embedded/sys/boot/ia64/ski/ (props changed) user/gjb/hacking/release-embedded/sys/boot/powerpc/boot1.chrp/ (props changed) user/gjb/hacking/release-embedded/sys/boot/powerpc/ofw/ (props changed) user/gjb/hacking/release-embedded/sys/cddl/contrib/opensolaris/ (props changed) user/gjb/hacking/release-embedded/sys/conf/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/changes.txt (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/common/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/compiler/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/debugger/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/disassembler/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/dispatcher/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/events/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/executer/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/hardware/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/namespace/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/parser/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/resources/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/tables/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/components/utilities/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/include/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/dev/acpica/os_specific/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/ipfilter/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c (props changed) user/gjb/hacking/release-embedded/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c (props changed) user/gjb/hacking/release-embedded/sys/contrib/libfdt/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/octeon-sdk/ (props changed) user/gjb/hacking/release-embedded/sys/contrib/x86emu/ (props changed) user/gjb/hacking/release-embedded/sys/dev/bvm/ (props changed) user/gjb/hacking/release-embedded/sys/dev/fdt/fdt_ic_if.m (props changed) user/gjb/hacking/release-embedded/sys/dev/hyperv/ (props changed) user/gjb/hacking/release-embedded/sys/modules/hyperv/ (props changed) user/gjb/hacking/release-embedded/sys/modules/vmm/ (props changed) user/gjb/hacking/release-embedded/sys/x86/include/acpica_machdep.h (props changed) user/gjb/hacking/release-embedded/usr.bin/calendar/ (props changed) user/gjb/hacking/release-embedded/usr.bin/csup/ (props changed) user/gjb/hacking/release-embedded/usr.bin/procstat/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/bhyve/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/bhyvectl/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/bhyveload/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/jail/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/ndiscvt/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/rtadvctl/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/rtadvd/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/rtsold/ (props changed) user/gjb/hacking/release-embedded/usr.sbin/zic/ (props changed) From owner-svn-src-user@FreeBSD.ORG Fri Dec 27 17:47:50 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A628F861; Fri, 27 Dec 2013 17:47:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F6F31222; Fri, 27 Dec 2013 17:47:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBRHloxB044107; Fri, 27 Dec 2013 17:47:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBRHlkK6044080; Fri, 27 Dec 2013 17:47:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312271747.rBRHlkK6044080@svn.freebsd.org> From: Glen Barber Date: Fri, 27 Dec 2013 17:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259956 - in user/gjb/hacking/release-embedded: bin/sh contrib/gcc etc/devd lib/libc/sys release sbin/geom/class/mirror share/man/man4 sys/amd64/vmm/intel sys/amd64/vmm/io sys/arm/arm s... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Fri, 27 Dec 2013 17:47:50 -0000 Author: gjb Date: Fri Dec 27 17:47:45 2013 New Revision: 259956 URL: http://svnweb.freebsd.org/changeset/base/259956 Log: MFH: Tracking commit. Sponsored by: The FreeBSD Foundation Modified: user/gjb/hacking/release-embedded/bin/sh/input.c user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.gcc43 user/gjb/hacking/release-embedded/contrib/gcc/reload1.c user/gjb/hacking/release-embedded/etc/devd/usb.conf user/gjb/hacking/release-embedded/lib/libc/sys/aio_fsync.2 user/gjb/hacking/release-embedded/release/release.sh user/gjb/hacking/release-embedded/sbin/geom/class/mirror/gmirror.8 user/gjb/hacking/release-embedded/share/man/man4/run.4 user/gjb/hacking/release-embedded/sys/amd64/vmm/intel/vmx.c user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h user/gjb/hacking/release-embedded/sys/arm/arm/pmap-v6.c user/gjb/hacking/release-embedded/sys/dev/usb/usbdevs user/gjb/hacking/release-embedded/sys/dev/usb/wlan/if_run.c user/gjb/hacking/release-embedded/sys/kern/vfs_bio.c user/gjb/hacking/release-embedded/sys/kern/vfs_cache.c user/gjb/hacking/release-embedded/sys/netinet/sctp_usrreq.c user/gjb/hacking/release-embedded/sys/netinet/sctputil.c user/gjb/hacking/release-embedded/sys/sys/gpt.h user/gjb/hacking/release-embedded/sys/vm/vm_map.c Directory Properties: user/gjb/hacking/release-embedded/ (props changed) Modified: user/gjb/hacking/release-embedded/bin/sh/input.c ============================================================================== --- user/gjb/hacking/release-embedded/bin/sh/input.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/bin/sh/input.c Fri Dec 27 17:47:45 2013 (r259956) @@ -228,7 +228,6 @@ preadbuffer(void) { char *p, *q; int more; - int something; char savec; if (parsefile->strpush) { @@ -252,24 +251,18 @@ again: q = p = parsefile->buf + (parsenextc - parsefile->buf); /* delete nul characters */ - something = 0; for (more = 1; more;) { switch (*p) { case '\0': p++; /* Skip nul */ goto check; - case '\t': - case ' ': - break; - case '\n': parsenleft = q - parsenextc; more = 0; /* Stop processing here */ break; default: - something = 1; break; } @@ -288,7 +281,8 @@ check: *q = '\0'; #ifndef NO_HISTORY - if (parsefile->fd == 0 && hist && something) { + if (parsefile->fd == 0 && hist && + parsenextc[strspn(parsenextc, " \t\n")] != '\0') { HistEvent he; INTOFF; history(hist, &he, whichprompt == 1 ? H_ENTER : H_ADD, Modified: user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 17:47:45 2013 (r259956) @@ -151,6 +151,11 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. +2007-04-24 Hui-May Chang (r124115) + + * reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER + instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction. + 2007-04-16 Lawrence Crowl (r123909) * doc/invoke.texi (Debugging Options): Add documentation for the Modified: user/gjb/hacking/release-embedded/contrib/gcc/reload1.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/reload1.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/contrib/gcc/reload1.c Fri Dec 27 17:47:45 2013 (r259956) @@ -6238,15 +6238,23 @@ merge_assigned_reloads (rtx insn) transfer_replacements (i, j); } - /* If this is now RELOAD_OTHER, look for any reloads that load - parts of this operand and set them to RELOAD_FOR_OTHER_ADDRESS - if they were for inputs, RELOAD_OTHER for outputs. Note that - this test is equivalent to looking for reloads for this operand - number. */ - /* We must take special care with RELOAD_FOR_OUTPUT_ADDRESS; it may - share registers with a RELOAD_FOR_INPUT, so we can not change it - to RELOAD_FOR_OTHER_ADDRESS. We should never need to, since we - do not modify RELOAD_FOR_OUTPUT. */ + /* If this is now RELOAD_OTHER, look for any reloads that + load parts of this operand and set them to + RELOAD_FOR_OTHER_ADDRESS if they were for inputs, + RELOAD_OTHER for outputs. Note that this test is + equivalent to looking for reloads for this operand + number. + + We must take special care with RELOAD_FOR_OUTPUT_ADDRESS; + it may share registers with a RELOAD_FOR_INPUT, so we can + not change it to RELOAD_FOR_OTHER_ADDRESS. We should + never need to, since we do not modify RELOAD_FOR_OUTPUT. + + It is possible that the RELOAD_FOR_OPERAND_ADDRESS + instruction is assigned the same register as the earlier + RELOAD_FOR_OTHER_ADDRESS instruction. Merging these two + instructions will cause the RELOAD_FOR_OTHER_ADDRESS + instruction to be deleted later on. */ if (rld[i].when_needed == RELOAD_OTHER) for (j = 0; j < n_reloads; j++) @@ -6254,6 +6262,7 @@ merge_assigned_reloads (rtx insn) && rld[j].when_needed != RELOAD_OTHER && rld[j].when_needed != RELOAD_FOR_OTHER_ADDRESS && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS + && rld[j].when_needed != RELOAD_FOR_OPERAND_ADDRESS && (! conflicting_input || rld[j].when_needed == RELOAD_FOR_INPUT_ADDRESS || rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS) Modified: user/gjb/hacking/release-embedded/etc/devd/usb.conf ============================================================================== --- user/gjb/hacking/release-embedded/etc/devd/usb.conf Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/etc/devd/usb.conf Fri Dec 27 17:47:45 2013 (r259956) @@ -4625,7 +4625,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b)"; + match "product" "(0x3c09|0x3c0a|0x3c15|0x3c1a|0x3c1b|0x3c20)"; action "kldload -n if_run"; }; @@ -5341,5 +5341,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2576 USB entries processed +# 2577 USB entries processed Modified: user/gjb/hacking/release-embedded/lib/libc/sys/aio_fsync.2 ============================================================================== --- user/gjb/hacking/release-embedded/lib/libc/sys/aio_fsync.2 Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/lib/libc/sys/aio_fsync.2 Fri Dec 27 17:47:45 2013 (r259956) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 4, 2013 +.Dd December 27, 2013 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -49,7 +49,7 @@ completed at the time the call returns. .Pp The .Fa op -argument could be set only to +argument can only be set to .Dv O_SYNC to cause all currently queued I/O operations to be completed as if by a call to @@ -109,7 +109,8 @@ returned in .It Bq Er EBADF The .Fa iocb->aio_fildes -is invalid for writing. +argument +is not a valid descriptor. .It Bq Er EINVAL This implementation does not support synchronized I/O for this file. .El Modified: user/gjb/hacking/release-embedded/release/release.sh ============================================================================== --- user/gjb/hacking/release-embedded/release/release.sh Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/release/release.sh Fri Dec 27 17:47:45 2013 (r259956) @@ -173,21 +173,6 @@ mount -t devfs devfs ${CHROOTDIR}/dev cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf trap "umount ${CHROOTDIR}/dev" EXIT # Clean up devfs mount on exit -build_doc_ports() { - # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints - # is created. This is needed by ports-mgmt/pkg. - chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart - - ## Trick the ports 'run-autotools-fixup' target to do the right thing. - _OSVERSION=$(sysctl -n kern.osreldate) - if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS}" - chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ - ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean - fi -} - # If MAKE_CONF and/or SRC_CONF are set and not character devices (/dev/null), # copy them to the chroot. if [ -e ${MAKE_CONF} ] && [ ! -c ${MAKE_CONF} ]; then @@ -200,7 +185,18 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO fi if [ -d ${CHROOTDIR}/usr/ports ]; then - build_doc_ports ${CHROOTDIR} + # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints + # is created. This is needed by ports-mgmt/pkg. + chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + + ## Trick the ports 'run-autotools-fixup' target to do the right thing. + _OSVERSION=$(sysctl -n kern.osreldate) + if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then + PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" + PBUILD_FLAGS="${PBUILD_FLAGS}" + chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \ + ${PBUILD_FLAGS} OPTIONS_UNSET="FOP IGOR" install clean distclean + fi fi if [ "x${RELSTRING}" = "x" ]; then Modified: user/gjb/hacking/release-embedded/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- user/gjb/hacking/release-embedded/sbin/geom/class/mirror/gmirror.8 Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sbin/geom/class/mirror/gmirror.8 Fri Dec 27 17:47:45 2013 (r259956) @@ -327,9 +327,7 @@ gmirror activate data da1 .Sh NOTES Doing kernel dumps to .Nm -providers. -.Pp -This is possible, but some conditions have to be met. +providers is possible, but some conditions have to be met. First of all, a kernel dump will go only to one component and .Nm always chooses the component with the highest priority. Modified: user/gjb/hacking/release-embedded/share/man/man4/run.4 ============================================================================== --- user/gjb/hacking/release-embedded/share/man/man4/run.4 Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/share/man/man4/run.4 Fri Dec 27 17:47:45 2013 (r259956) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2013 +.Dd December 27, 2013 .Dt RUN 4 .Os .Sh NAME @@ -132,7 +132,7 @@ driver supports the following wireless a .It Corega CG-WLUSB300AGN .It Corega CG-WLUSB300GNM .It D-Link DWA-130 rev B1 -.It D-Link DWA-140 rev B1, B2, B3 +.It D-Link DWA-140 rev B1, B2, B3, D1 .It D-Link DWA-160 rev B2 .It DrayTek Vigor N61 .It Edimax EW-7711UAn Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/intel/vmx.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/intel/vmx.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/intel/vmx.c Fri Dec 27 17:47:45 2013 (r259956) @@ -1114,6 +1114,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i if (cr != 0 && cr != 4) return (UNHANDLED); + regval = 0; /* silence gcc */ vmxctx = &vmx->ctx[vcpu]; /* Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c Fri Dec 27 17:47:45 2013 (r259956) @@ -218,13 +218,17 @@ vlapic_timer_divisor(uint32_t dcr) } static void -vlapic_mask_lvts(uint32_t *lvts, int num_lvt) +vlapic_mask_lvts(struct vlapic *vlapic) { - int i; - for (i = 0; i < num_lvt; i++) { - *lvts |= APIC_LVT_M; - lvts += 4; - } + struct LAPIC *lapic = vlapic->apic_page; + + lapic->lvt_cmci |= APIC_LVT_M; + lapic->lvt_timer |= APIC_LVT_M; + lapic->lvt_thermal |= APIC_LVT_M; + lapic->lvt_pcint |= APIC_LVT_M; + lapic->lvt_lint0 |= APIC_LVT_M; + lapic->lvt_lint1 |= APIC_LVT_M; + lapic->lvt_error |= APIC_LVT_M; } #if 0 @@ -318,14 +322,15 @@ vlapic_reset(struct vlapic *vlapic) lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(&lapic->lvt_timer, 6); - vlapic_mask_lvts(&lapic->lvt_cmci, 1); + vlapic_mask_lvts(vlapic); vlapic_set_dcr(vlapic, 0); if (vlapic->vcpuid == 0) vlapic->boot_state = BS_RUNNING; /* BSP */ else vlapic->boot_state = BS_INIT; /* AP */ + + vlapic->svr_last = lapic->svr; } void @@ -1052,24 +1057,30 @@ vlapic_intr_accepted(struct vlapic *vlap vlapic_update_ppr(vlapic); } -static void -lapic_set_svr(struct vlapic *vlapic, uint32_t new) +void +vlapic_svr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; - uint32_t old, changed; + uint32_t old, new, changed; lapic = vlapic->apic_page; - old = lapic->svr; + + new = lapic->svr; + old = vlapic->svr_last; + vlapic->svr_last = new; + changed = old ^ new; if ((changed & APIC_SVR_ENABLE) != 0) { if ((new & APIC_SVR_ENABLE) == 0) { /* - * The apic is now disabled so stop the apic timer. + * The apic is now disabled so stop the apic timer + * and mask all the LVT entries. */ VLAPIC_CTR0(vlapic, "vlapic is software-disabled"); VLAPIC_TIMER_LOCK(vlapic); callout_stop(&vlapic->callout); VLAPIC_TIMER_UNLOCK(vlapic); + vlapic_mask_lvts(vlapic); } else { /* * The apic is now enabled so restart the apic timer @@ -1080,7 +1091,6 @@ lapic_set_svr(struct vlapic *vlapic, uin vlapic_set_icr_timer(vlapic, lapic->icr_timer); } } - lapic->svr = new; } int @@ -1210,7 +1220,8 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_dfr_write_handler(vlapic); break; case APIC_OFFSET_SVR: - lapic_set_svr(vlapic, data); + lapic->svr = data; + vlapic_svr_write_handler(vlapic); break; case APIC_OFFSET_ICR_LOW: if (!x2apic(vlapic)) { Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h Fri Dec 27 17:47:45 2013 (r259956) @@ -75,4 +75,5 @@ void vlapic_post_intr(struct vlapic *vla void vlapic_id_write_handler(struct vlapic *vlapic); void vlapic_ldr_write_handler(struct vlapic *vlapic); void vlapic_dfr_write_handler(struct vlapic *vlapic); +void vlapic_svr_write_handler(struct vlapic *vlapic); #endif /* _VLAPIC_H_ */ Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h Fri Dec 27 17:47:45 2013 (r259956) @@ -116,6 +116,7 @@ struct vlapic { uint64_t msr_apicbase; enum boot_state boot_state; + uint32_t svr_last; }; void vlapic_init(struct vlapic *vlapic); Modified: user/gjb/hacking/release-embedded/sys/arm/arm/pmap-v6.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/arm/arm/pmap-v6.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/arm/arm/pmap-v6.c Fri Dec 27 17:47:45 2013 (r259956) @@ -3094,21 +3094,16 @@ validate: if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_aflag_set(m, PGA_WRITEABLE); /* - * Enable write permission if the access type - * indicates write intention. Emulate modified - * bit otherwise. + * XXX: Skip modified bit emulation for now. + * The emulation reveals problems + * that result in random failures + * during memory allocation on some + * platforms. + * Therefore, the page is marked RW + * immediately. */ - if ((access & VM_PROT_WRITE) != 0) { - npte &= ~(L2_APX); - /* - * The access type and permissions - * indicate that the page will be - * written as soon as returned from - * fault service. - * Mark it dirty from the outset. - */ - vm_page_dirty(m); - } + npte &= ~(L2_APX); + vm_page_dirty(m); } else npte &= ~(L2_APX); } Modified: user/gjb/hacking/release-embedded/sys/dev/usb/usbdevs ============================================================================== --- user/gjb/hacking/release-embedded/sys/dev/usb/usbdevs Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/dev/usb/usbdevs Fri Dec 27 17:47:45 2013 (r259956) @@ -1558,6 +1558,7 @@ product DLINK RT3072 0x3c0a RT3072 product DLINK DWA140B3 0x3c15 DWA-140 rev B3 product DLINK DWA160B2 0x3c1a DWA-160 rev B2 product DLINK DWA127 0x3c1b DWA-127 Wireless Adapter +product DLINK DWA140D1 0x3c20 DWA-140 rev D1 product DLINK DSB650C 0x4000 10Mbps Ethernet product DLINK DSB650TX1 0x4001 10/100 Ethernet product DLINK DSB650TX 0x4002 10/100 Ethernet Modified: user/gjb/hacking/release-embedded/sys/dev/usb/wlan/if_run.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/dev/usb/wlan/if_run.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/dev/usb/wlan/if_run.c Fri Dec 27 17:47:45 2013 (r259956) @@ -178,6 +178,7 @@ static const STRUCT_USB_HOST_ID run_devs RUN_DEV(DLINK, DWA127), RUN_DEV(DLINK, DWA140B3), RUN_DEV(DLINK, DWA160B2), + RUN_DEV(DLINK, DWA140D1), RUN_DEV(DLINK2, DWA130), RUN_DEV(DLINK2, RT2870_1), RUN_DEV(DLINK2, RT2870_2), Modified: user/gjb/hacking/release-embedded/sys/kern/vfs_bio.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/kern/vfs_bio.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/kern/vfs_bio.c Fri Dec 27 17:47:45 2013 (r259956) @@ -3678,7 +3678,7 @@ bufdonebio(struct bio *bip) struct buf *bp; bp = bip->bio_caller2; - bp->b_resid = bp->b_bcount - bip->bio_completed; + bp->b_resid = bip->bio_resid; bp->b_ioflags = bip->bio_flags; bp->b_error = bip->bio_error; if (bp->b_error) Modified: user/gjb/hacking/release-embedded/sys/kern/vfs_cache.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/kern/vfs_cache.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/kern/vfs_cache.c Fri Dec 27 17:47:45 2013 (r259956) @@ -748,16 +748,20 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp ncp->nc_flag & NCF_ISDOTDOT) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); - if (ncp->nc_vp != NULL) + if (ncp->nc_vp != NULL) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_REMOVE(&ncneg, ncp, nc_dst); - if (vp != NULL) + numneg--; + } + if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); + numneg++; + } ncp->nc_vp = vp; CACHE_WUNLOCK(); return; @@ -893,6 +897,8 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); + KASSERT(ncp->nc_vp == NULL, ("ncp %p vp %p on ncneg", + ncp, ncp->nc_vp)); zap = 1; } if (hold) Modified: user/gjb/hacking/release-embedded/sys/netinet/sctp_usrreq.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/netinet/sctp_usrreq.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/netinet/sctp_usrreq.c Fri Dec 27 17:47:45 2013 (r259956) @@ -2788,7 +2788,7 @@ flags_out: if (stcb) { /* simply copy out the sockaddr_storage... */ - int len; + size_t len; len = *optsize; if (len > stcb->asoc.primary_destination->ro._l_addr.sa.sa_len) Modified: user/gjb/hacking/release-embedded/sys/netinet/sctputil.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/netinet/sctputil.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/netinet/sctputil.c Fri Dec 27 17:47:45 2013 (r259956) @@ -5868,8 +5868,8 @@ get_more_data: goto release; } if ((uio->uio_resid == 0) || - ((in_eeor_mode) && (copied_so_far >= max(so->so_rcv.sb_lowat, 1))) - ) { + ((in_eeor_mode) && + (copied_so_far >= (uint32_t) max(so->so_rcv.sb_lowat, 1)))) { goto release; } /* Modified: user/gjb/hacking/release-embedded/sys/sys/gpt.h ============================================================================== --- user/gjb/hacking/release-embedded/sys/sys/gpt.h Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/sys/gpt.h Fri Dec 27 17:47:45 2013 (r259956) @@ -128,7 +128,7 @@ struct gpt_ent { {0x9d275380,0x40ad,0x11db,0xbf,0x97,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} #define GPT_ENT_TYPE_VMRESERVED \ {0x9198effc,0x31c0,0x11db,0x8f,0x78,{0x00,0x0c,0x29,0x11,0xd1,0xb8}} -#define GPT_ENT_TYPE_VSANHDR \ +#define GPT_ENT_TYPE_VMVSANHDR \ {0x381cfccc,0x7288,0x11e0,0x92,0xee,{0x00,0x0c,0x29,0x11,0xd0,0xb2}} #define GPT_ENT_TYPE_APPLE_BOOT \ Modified: user/gjb/hacking/release-embedded/sys/vm/vm_map.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/vm/vm_map.c Fri Dec 27 17:36:43 2013 (r259955) +++ user/gjb/hacking/release-embedded/sys/vm/vm_map.c Fri Dec 27 17:47:45 2013 (r259956) @@ -1207,6 +1207,7 @@ charged: } else if ((prev_entry != &map->header) && (prev_entry->eflags == protoeflags) && + (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 && (prev_entry->end == start) && (prev_entry->wired_count == 0) && (prev_entry->cred == cred || @@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t a * NOTE: We explicitly allow bi-directional stacks. */ orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); - cow &= ~orient; KASSERT(orient != 0, ("No stack grow direction")); if (addrbos < vm_map_min(map) || From owner-svn-src-user@FreeBSD.ORG Sat Dec 28 02:27:07 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9C2A2B6; Sat, 28 Dec 2013 02:27:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A35514F4; Sat, 28 Dec 2013 02:27:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS2R7ni044930; Sat, 28 Dec 2013 02:27:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS2R6XJ044924; Sat, 28 Dec 2013 02:27:06 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312280227.rBS2R6XJ044924@svn.freebsd.org> From: Glen Barber Date: Sat, 28 Dec 2013 02:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259994 - in user/gjb/hacking/release-embedded: release release/arm tools/release tools/release/arm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 28 Dec 2013 02:27:07 -0000 Author: gjb Date: Sat Dec 28 02:27:06 2013 New Revision: 259994 URL: http://svnweb.freebsd.org/changeset/base/259994 Log: Implement cross build support for embedded devices into release.sh: - Modify release/release.sh to recognize an 'EMBEDDEDBUILD' variable. When set, release/release.sh will build the chroot userland as is done for big-iron builds. - Instead of running the 'buildworld', 'buildkernel', and 'release' targets in the chroot, a separate script is run. The script tools/release/${XDEV}/release.sh sets up the rest of the chroot workspace, such as installing ports that will be needed, and building the 'xdev' target. - crochet (by kientzle@) is checked out from the upstream repository (and if needed, u-boot, in the case of Raspberry Pi). - tools/release/${XDEV}/release.sh then runs crochet with a configuration file specific to the ${KERNCONF} being built. Note that this is effectively a first-pass attempt to integrate this into the release process. Tested against: head@r259961 Sponsored by: The FreeBSD Foundation Added: user/gjb/hacking/release-embedded/release/arm/ user/gjb/hacking/release-embedded/release/arm/RPI-B.conf (contents, props changed) user/gjb/hacking/release-embedded/release/arm/release.sh (contents, props changed) user/gjb/hacking/release-embedded/tools/release/ user/gjb/hacking/release-embedded/tools/release/arm/ user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf (contents, props changed) Modified: user/gjb/hacking/release-embedded/release/release.sh Added: user/gjb/hacking/release-embedded/release/arm/RPI-B.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/release/arm/RPI-B.conf Sat Dec 28 02:27:06 2013 (r259994) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# + +# This is only supported on amd64 right now. It may work on +# i386, but I do not have the hardware to test, so until I get +# a VM set up to make sure, be cautious and assume it will not. +if [ "$(uname -p)" != "amd64" ] || [ "$(uname -m)" != "amd64" ]; then + echo "This is only supported on amd64 right now." + exit 0 +fi + +# Build chroot configuration +TARGET="amd64" +TARGET_ARCH="amd64" +SVNROOT="svn://svn.FreeBSD.org" +SRCBRANCH="base/head@rHEAD" +DOCBRANCH="doc/head@rHEAD" +PORTBRANCH="ports/head@rHEAD" +NODOC=yes + +# Build target configuration +# Since this file is sourced by a script that runs another +# script, these must be exported. +set -a +CHROOTDIR="/scratch" +EMBEDDEDBUILD=1 +EMBEDDEDPORTS="lang/python textproc/gsed" +XDEV="arm" +XDEV_ARCH="arm" +KERNEL="RPI-B" +CROCHETSRC="https://github.com/kientzle/crochet-freebsd" +CROCHETBRANCH="trunk" +UBOOTSRC="https://github.com/gonzoua/u-boot-pi" +UBOOTBRANCH="trunk" +UBOOTDIR="/tmp/crochet/u-boot-rpi" +set +a Added: user/gjb/hacking/release-embedded/release/arm/release.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/release/arm/release.sh Sat Dec 28 02:27:06 2013 (r259994) @@ -0,0 +1,57 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# This script is intended to be called by release/release.sh to build ARM +# images for release. It is not intended to be run directly. This sets up +# the software needed within a build chroot, then runs crochet to provide +# downloadable images for embedded devices. + +set -e + +install_crochet() { + chroot ${CHROOTDIR} svn co -q ${CROCHETSRC}/${CROCHETBRANCH} \ + /tmp/crochet +} + +install_uboot() { + # Only fetch u-boot sources if UBOOTSRC is set; otherwise it is + # not needed. + if [ "X${UBOOTSRC}" != "X" ]; then + continue + else + return 0 + fi + chroot ${CHROOTDIR} svn co -q ${UBOOTSRC}/${UBOOTBRANCH} \ + /${UBOOTDIR} +} + +main() { + # Build the 'xdev' target for crochet. + eval chroot ${CHROOTDIR} make -C /usr/src \ + XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} WITH_GCC=1 xdev + + # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints + # is created. + eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart + # Install security/ca_root_nss since we need to check the https + # certificate of github. + eval chroot ${CHROOTDIR} make -C /usr/ports/security/ca_root_nss \ + OPTIONS_SET="ETCSYMLINK" BATCH=1 FORCE_PKG_REGISTER=1 \ + install clean distclean + EMBEDDEDPORTS="${EMBEDDEDPORTS} devel/subversion" + for _PORT in ${EMBEDDEDPORTS}; do + eval chroot ${CHROOTDIR} make -C /usr/ports/${_PORT} \ + BATCH=1 FORCE_PKG_REGISTER=1 install clean distclean + done + + install_crochet + install_uboot + mkdir -p ${CHROOTDIR}/tmp/crochet/work + eval chroot ${CHROOTDIR} /bin/sh /tmp/crochet/crochet.sh \ + -c /usr/src/tools/release/${XDEV}/crochet-${KERNEL}.conf +} + +main "$@" +exit 0 Modified: user/gjb/hacking/release-embedded/release/release.sh ============================================================================== --- user/gjb/hacking/release-embedded/release/release.sh Sat Dec 28 02:15:30 2013 (r259993) +++ user/gjb/hacking/release-embedded/release/release.sh Sat Dec 28 02:27:06 2013 (r259994) @@ -45,6 +45,9 @@ SRCBRANCH="base/head@rHEAD" DOCBRANCH="doc/head@rHEAD" PORTBRANCH="ports/head@rHEAD" +# Set for embedded device builds. +EMBEDDEDBUILD= + # Sometimes one needs to checkout src with --force svn option. # If custom kernel configs copied to src tree before checkout, e.g. SRC_FORCE_CHECKOUT= @@ -98,6 +101,11 @@ while getopts c: opt; do done shift $(($OPTIND - 1)) +if [ "x${EMBEDDEDBUILD}" != "x" ]; then + WITH_DVD= + NODOC=yes +fi + # If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree # is required to build the documentation set. if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then @@ -184,6 +192,21 @@ if [ -e ${SRC_CONF} ] && [ ! -c ${SRC_CO cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi +# Embedded builds do not use the 'make release' target. +if [ "X${EMBEDDEDBUILD}" != "X" ]; then + if [ -e ${CHROOTDIR}/usr/src/release/${XDEV}/release.sh ]; then + /bin/sh ${CHROOTDIR}/usr/src/release/${XDEV}/release.sh + fi + # If the script does not exist for this architecture, exit. + # This probably should be checked earlier, but allowing the rest + # of the build process to get this far will at least set up the + # chroot environment for testing. + exit 0 +else + # Not embedded. + continue +fi + if [ -d ${CHROOTDIR}/usr/ports ]; then # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. Added: user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf Sat Dec 28 02:27:06 2013 (r259994) @@ -0,0 +1,29 @@ +# +# $FreeBSD$ +# + +# This is the configuration file for use with crochet to produce +# FreeBSD Raspberry Pi images. + +board_setup RaspberryPi +#option UsrPorts +#option UsrSrc +# 4GB +option ImageSize 3900mb + +export MAKEOBJDIRPREFIX=/usr/obj +FREEBSD_SRC=/usr/src +__MAKE_CONF=/dev/null +SRCCONF=/dev/null +WORKDIR=/usr/obj +_BRANCH=$(make -C ${FREEBSD_SRC}/release -V BRANCH) +_REVISION=$(make -C ${FREEBSD_SRC}/release -V REVISION) +KERNCONF=RPI-B +FREEBSD_BUILDWORLD_EXTRA_ARGS="" +FREEBSD_INSTALLWORLD_EXTRA_ARGS="" +FREEBSD_BUILDKERNEL_EXTRA_ARGS="" +FREEBSD_INSTALLKERNEL_EXTRA_ARGS="" +FREEBSD_WORLD_EXTRA_ARGS="" +FREEBSD_KERNEL_EXTRA_ARGS="" +FREEBSD_EXTRA_ARGS="" +IMG=${WORKDIR}/FreeBSD-${_REVISION}-${_BRANCH}-${KERNCONF}.img From owner-svn-src-user@FreeBSD.ORG Sat Dec 28 03:11:10 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0EA4D9E; Sat, 28 Dec 2013 03:11:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8A518FC; Sat, 28 Dec 2013 03:11:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS3BAqj064276; Sat, 28 Dec 2013 03:11:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS3B9WC064266; Sat, 28 Dec 2013 03:11:09 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312280311.rBS3B9WC064266@svn.freebsd.org> From: Glen Barber Date: Sat, 28 Dec 2013 03:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r259996 - in user/gjb/hacking/release-embedded: bin/ps etc sys/amd64/vmm/io sys/ia64/ia64 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 28 Dec 2013 03:11:10 -0000 Author: gjb Date: Sat Dec 28 03:11:09 2013 New Revision: 259996 URL: http://svnweb.freebsd.org/changeset/base/259996 Log: MFH: Tracking commit Sponsored by: The FreeBSD Foundation Modified: user/gjb/hacking/release-embedded/bin/ps/ps.1 user/gjb/hacking/release-embedded/etc/ntp.conf user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h user/gjb/hacking/release-embedded/sys/ia64/ia64/dump_machdep.c Directory Properties: user/gjb/hacking/release-embedded/ (props changed) Modified: user/gjb/hacking/release-embedded/bin/ps/ps.1 ============================================================================== --- user/gjb/hacking/release-embedded/bin/ps/ps.1 Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/bin/ps/ps.1 Sat Dec 28 03:11:09 2013 (r259996) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 15, 2013 +.Dd December 27, 2013 .Dt PS 1 .Os .Sh NAME @@ -416,8 +416,9 @@ The process has reduced CPU scheduling p .It Li s The process is a session leader. .It Li V -The process is suspended during a -.Xr vfork 2 . +The process' parent is suspended during a +.Xr vfork 2 , +waiting for the process to exec or exit. .It Li W The process is swapped out. .It Li X Modified: user/gjb/hacking/release-embedded/etc/ntp.conf ============================================================================== --- user/gjb/hacking/release-embedded/etc/ntp.conf Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/etc/ntp.conf Sat Dec 28 03:11:09 2013 (r259996) @@ -17,7 +17,7 @@ # users with a static IP and good upstream NTP servers to add a server # to the pool. See http://www.pool.ntp.org/join.html if you are interested. # -# The option `iburst' is used for faster initial synchronisation. +# The option `iburst' is used for faster initial synchronization. # server 0.freebsd.pool.ntp.org iburst server 1.freebsd.pool.ntp.org iburst @@ -35,21 +35,37 @@ server 2.freebsd.pool.ntp.org iburst # server 2.CC.pool.ntp.org iburst # -# Security: Only accept NTP traffic from the following hosts. -# The following configuration example only accepts traffic from the -# above defined servers. +# Security: +# +# By default, only allow time queries and block all other requests +# from unauthenticated clients. +# +# See http://support.ntp.org/bin/view/Support/AccessRestrictions +# for more information. +# +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +# +# Alternatively, the following rules would block all unauthorized access. +# +#restrict default ignore +#restrict -6 default ignore +# +# In this case, all remote NTP time servers also need to be explicitly +# allowed or they would not be able to exchange time information with +# this server. # # Please note that this example doesn't work for the servers in # the pool.ntp.org domain since they return multiple A records. -# (This is the reason that by default they are commented out) # -#restrict default ignore #restrict 0.pool.ntp.org nomodify nopeer noquery notrap #restrict 1.pool.ntp.org nomodify nopeer noquery notrap #restrict 2.pool.ntp.org nomodify nopeer noquery notrap -#restrict 127.0.0.1 -#restrict -6 ::1 -#restrict 127.127.1.0 +# +# The following settings allow unrestricted access from the localhost +restrict 127.0.0.1 +restrict -6 ::1 +restrict 127.127.1.0 # # If a server loses sync with all upstream servers, NTP clients Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.c Sat Dec 28 03:11:09 2013 (r259996) @@ -94,20 +94,14 @@ do { \ #define PRIO(x) ((x) >> 4) #define VLAPIC_VERSION (16) -#define VLAPIC_MAXLVT_ENTRIES (APIC_LVT_CMCI) #define x2apic(vlapic) (((vlapic)->msr_apicbase & APICBASE_X2APIC) ? 1 : 0) /* * The 'vlapic->timer_mtx' is used to provide mutual exclusion between the - * vlapic_callout_handler() and vcpu accesses to the following registers: - * - initial count register aka icr_timer - * - current count register aka ccr_timer - * - divide config register aka dcr_timer + * vlapic_callout_handler() and vcpu accesses to: + * - timer_freq_bt, timer_period_bt, timer_fire_bt * - timer LVT register - * - * Note that the vlapic_callout_handler() does not write to any of these - * registers so they can be safely read from the vcpu context without locking. */ #define VLAPIC_TIMER_LOCK(vlapic) mtx_lock_spin(&((vlapic)->timer_mtx)) #define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) @@ -217,20 +211,6 @@ vlapic_timer_divisor(uint32_t dcr) } } -static void -vlapic_mask_lvts(struct vlapic *vlapic) -{ - struct LAPIC *lapic = vlapic->apic_page; - - lapic->lvt_cmci |= APIC_LVT_M; - lapic->lvt_timer |= APIC_LVT_M; - lapic->lvt_thermal |= APIC_LVT_M; - lapic->lvt_pcint |= APIC_LVT_M; - lapic->lvt_lint0 |= APIC_LVT_M; - lapic->lvt_lint1 |= APIC_LVT_M; - lapic->lvt_error |= APIC_LVT_M; -} - #if 0 static inline void vlapic_dump_lvt(uint32_t offset, uint32_t *lvt) @@ -273,8 +253,8 @@ vlapic_get_ccr(struct vlapic *vlapic) return (ccr); } -static void -vlapic_set_dcr(struct vlapic *vlapic, uint32_t dcr) +void +vlapic_dcr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; int divisor; @@ -282,9 +262,9 @@ vlapic_set_dcr(struct vlapic *vlapic, ui lapic = vlapic->apic_page; VLAPIC_TIMER_LOCK(vlapic); - lapic->dcr_timer = dcr; - divisor = vlapic_timer_divisor(dcr); - VLAPIC_CTR2(vlapic, "vlapic dcr_timer=%#x, divisor=%d", dcr, divisor); + divisor = vlapic_timer_divisor(lapic->dcr_timer); + VLAPIC_CTR2(vlapic, "vlapic dcr_timer=%#x, divisor=%d", + lapic->dcr_timer, divisor); /* * Update the timer frequency and the timer period. @@ -299,8 +279,8 @@ vlapic_set_dcr(struct vlapic *vlapic, ui VLAPIC_TIMER_UNLOCK(vlapic); } -static void -vlapic_update_errors(struct vlapic *vlapic) +void +vlapic_esr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; @@ -309,30 +289,6 @@ vlapic_update_errors(struct vlapic *vlap vlapic->esr_pending = 0; } -static void -vlapic_reset(struct vlapic *vlapic) -{ - struct LAPIC *lapic; - - lapic = vlapic->apic_page; - bzero(lapic, sizeof(struct LAPIC)); - - lapic->id = vlapic_get_id(vlapic); - lapic->version = VLAPIC_VERSION; - lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); - lapic->dfr = 0xffffffff; - lapic->svr = APIC_SVR_VECTOR; - vlapic_mask_lvts(vlapic); - vlapic_set_dcr(vlapic, 0); - - if (vlapic->vcpuid == 0) - vlapic->boot_state = BS_RUNNING; /* BSP */ - else - vlapic->boot_state = BS_INIT; /* AP */ - - vlapic->svr_last = lapic->svr; -} - void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level) { @@ -391,24 +347,65 @@ vlapic_get_lvtptr(struct vlapic *vlapic, } } +static __inline int +lvt_off_to_idx(uint32_t offset) +{ + int index; + + switch (offset) { + case APIC_OFFSET_CMCI_LVT: + index = APIC_LVT_CMCI; + break; + case APIC_OFFSET_TIMER_LVT: + index = APIC_LVT_TIMER; + break; + case APIC_OFFSET_THERM_LVT: + index = APIC_LVT_THERMAL; + break; + case APIC_OFFSET_PERF_LVT: + index = APIC_LVT_PMC; + break; + case APIC_OFFSET_LINT0_LVT: + index = APIC_LVT_LINT0; + break; + case APIC_OFFSET_LINT1_LVT: + index = APIC_LVT_LINT1; + break; + case APIC_OFFSET_ERROR_LVT: + index = APIC_LVT_ERROR; + break; + default: + index = -1; + break; + } + KASSERT(index >= 0 && index <= VLAPIC_MAXLVT_INDEX, ("lvt_off_to_idx: " + "invalid lvt index %d for offset %#x", index, offset)); + + return (index); +} + static __inline uint32_t vlapic_get_lvt(struct vlapic *vlapic, uint32_t offset) { + int idx; + uint32_t val; - return (*vlapic_get_lvtptr(vlapic, offset)); + idx = lvt_off_to_idx(offset); + val = atomic_load_acq_32(&vlapic->lvt_last[idx]); + return (val); } -static void -vlapic_set_lvt(struct vlapic *vlapic, uint32_t offset, uint32_t val) +void +vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset) { - uint32_t *lvtptr, mask; + uint32_t *lvtptr, mask, val; struct LAPIC *lapic; + int idx; lapic = vlapic->apic_page; lvtptr = vlapic_get_lvtptr(vlapic, offset); - - if (offset == APIC_OFFSET_TIMER_LVT) - VLAPIC_TIMER_LOCK(vlapic); + val = *lvtptr; + idx = lvt_off_to_idx(offset); if (!(lapic->svr & APIC_SVR_ENABLE)) val |= APIC_LVT_M; @@ -427,10 +424,36 @@ vlapic_set_lvt(struct vlapic *vlapic, ui mask |= APIC_LVT_DM; break; } - *lvtptr = val & mask; + val &= mask; + *lvtptr = val; + atomic_store_rel_32(&vlapic->lvt_last[idx], val); +} + +static void +vlapic_mask_lvts(struct vlapic *vlapic) +{ + struct LAPIC *lapic = vlapic->apic_page; + + lapic->lvt_cmci |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_CMCI_LVT); + + lapic->lvt_timer |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_TIMER_LVT); - if (offset == APIC_OFFSET_TIMER_LVT) - VLAPIC_TIMER_UNLOCK(vlapic); + lapic->lvt_thermal |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_THERM_LVT); + + lapic->lvt_pcint |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_PERF_LVT); + + lapic->lvt_lint0 |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_LINT0_LVT); + + lapic->lvt_lint1 |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_LINT1_LVT); + + lapic->lvt_error |= APIC_LVT_M; + vlapic_lvt_write_handler(vlapic, APIC_OFFSET_ERROR_LVT); } static int @@ -651,7 +674,7 @@ vlapic_fire_cmci(struct vlapic *vlapic) } } -static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_ENTRIES, +static VMM_STAT_ARRAY(LVTS_TRIGGERRED, VLAPIC_MAXLVT_INDEX + 1, "lvts triggered"); int @@ -711,8 +734,6 @@ vlapic_callout_handler(void *arg) callout_deactivate(&vlapic->callout); - KASSERT(vlapic->apic_page->icr_timer != 0, ("timer is disabled")); - vlapic_fire_timer(vlapic); if (vlapic_periodic_timer(vlapic)) { @@ -757,16 +778,17 @@ done: VLAPIC_TIMER_UNLOCK(vlapic); } -static void -vlapic_set_icr_timer(struct vlapic *vlapic, uint32_t icr_timer) +void +vlapic_icrtmr_write_handler(struct vlapic *vlapic) { struct LAPIC *lapic; sbintime_t sbt; + uint32_t icr_timer; VLAPIC_TIMER_LOCK(vlapic); lapic = vlapic->apic_page; - lapic->icr_timer = icr_timer; + icr_timer = lapic->icr_timer; vlapic->timer_period_bt = vlapic->timer_freq_bt; bintime_mul(&vlapic->timer_period_bt, icr_timer); @@ -888,16 +910,22 @@ vlapic_calcdest(struct vm *vm, cpuset_t static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); -static int -lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu) +int +vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) { int i; bool phys; cpuset_t dmask; + uint64_t icrval; uint32_t dest, vec, mode; struct vlapic *vlapic2; struct vm_exit *vmexit; - + struct LAPIC *lapic; + + lapic = vlapic->apic_page; + lapic->icr_lo &= ~APIC_DELSTAT_PEND; + icrval = ((uint64_t)lapic->icr_hi << 32) | lapic->icr_lo; + if (x2apic(vlapic)) dest = icrval >> 32; else @@ -1088,7 +1116,7 @@ vlapic_svr_write_handler(struct vlapic * */ VLAPIC_CTR0(vlapic, "vlapic is software-enabled"); if (vlapic_periodic_timer(vlapic)) - vlapic_set_icr_timer(vlapic, lapic->icr_timer); + vlapic_icrtmr_write_handler(vlapic); } } } @@ -1155,6 +1183,8 @@ vlapic_read(struct vlapic *vlapic, uint6 break; case APIC_OFFSET_ICR_LOW: *data = lapic->icr_lo; + if (x2apic(vlapic)) + *data |= (uint64_t)lapic->icr_hi << 32; break; case APIC_OFFSET_ICR_HI: *data = lapic->icr_hi; @@ -1162,6 +1192,11 @@ vlapic_read(struct vlapic *vlapic, uint6 case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: *data = vlapic_get_lvt(vlapic, offset); +#ifdef INVARIANTS + reg = vlapic_get_lvtptr(vlapic, offset); + KASSERT(*data == *reg, ("inconsistent lvt value at " + "offset %#lx: %#lx/%#x", offset, *data, *reg)); +#endif break; case APIC_OFFSET_TIMER_ICR: *data = lapic->icr_timer; @@ -1186,6 +1221,7 @@ int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) { struct LAPIC *lapic = vlapic->apic_page; + uint32_t *regptr; int retval; KASSERT((offset & 0xf) == 0 && offset < PAGE_SIZE, @@ -1224,32 +1260,32 @@ vlapic_write(struct vlapic *vlapic, uint vlapic_svr_write_handler(vlapic); break; case APIC_OFFSET_ICR_LOW: - if (!x2apic(vlapic)) { - data &= 0xffffffff; - data |= (uint64_t)lapic->icr_hi << 32; - } - retval = lapic_process_icr(vlapic, data, retu); + lapic->icr_lo = data; + if (x2apic(vlapic)) + lapic->icr_hi = data >> 32; + retval = vlapic_icrlo_write_handler(vlapic, retu); break; case APIC_OFFSET_ICR_HI: - if (!x2apic(vlapic)) { - retval = 0; - lapic->icr_hi = data; - } + lapic->icr_hi = data; break; case APIC_OFFSET_CMCI_LVT: case APIC_OFFSET_TIMER_LVT ... APIC_OFFSET_ERROR_LVT: - vlapic_set_lvt(vlapic, offset, data); + regptr = vlapic_get_lvtptr(vlapic, offset); + *regptr = data; + vlapic_lvt_write_handler(vlapic, offset); break; case APIC_OFFSET_TIMER_ICR: - vlapic_set_icr_timer(vlapic, data); + lapic->icr_timer = data; + vlapic_icrtmr_write_handler(vlapic); break; case APIC_OFFSET_TIMER_DCR: - vlapic_set_dcr(vlapic, data); + lapic->dcr_timer = data; + vlapic_dcr_write_handler(vlapic); break; case APIC_OFFSET_ESR: - vlapic_update_errors(vlapic); + vlapic_esr_write_handler(vlapic); break; case APIC_OFFSET_VER: case APIC_OFFSET_APR: @@ -1267,6 +1303,32 @@ vlapic_write(struct vlapic *vlapic, uint return (retval); } +static void +vlapic_reset(struct vlapic *vlapic) +{ + struct LAPIC *lapic; + + lapic = vlapic->apic_page; + bzero(lapic, sizeof(struct LAPIC)); + + lapic->id = vlapic_get_id(vlapic); + lapic->version = VLAPIC_VERSION; + lapic->version |= (VLAPIC_MAXLVT_INDEX << MAXLVTSHIFT); + lapic->dfr = 0xffffffff; + lapic->svr = APIC_SVR_VECTOR; + vlapic_mask_lvts(vlapic); + + lapic->dcr_timer = 0; + vlapic_dcr_write_handler(vlapic); + + if (vlapic->vcpuid == 0) + vlapic->boot_state = BS_RUNNING; /* BSP */ + else + vlapic->boot_state = BS_INIT; /* AP */ + + vlapic->svr_last = lapic->svr; +} + void vlapic_init(struct vlapic *vlapic) { Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic.h Sat Dec 28 03:11:09 2013 (r259996) @@ -76,4 +76,9 @@ void vlapic_id_write_handler(struct vlap void vlapic_ldr_write_handler(struct vlapic *vlapic); void vlapic_dfr_write_handler(struct vlapic *vlapic); void vlapic_svr_write_handler(struct vlapic *vlapic); +void vlapic_esr_write_handler(struct vlapic *vlapic); +int vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu); +void vlapic_icrtmr_write_handler(struct vlapic *vlapic); +void vlapic_dcr_write_handler(struct vlapic *vlapic); +void vlapic_lvt_write_handler(struct vlapic *vlapic, uint32_t offset); #endif /* _VLAPIC_H_ */ Modified: user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h ============================================================================== --- user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/sys/amd64/vmm/io/vlapic_priv.h Sat Dec 28 03:11:09 2013 (r259996) @@ -29,6 +29,8 @@ #ifndef _VLAPIC_PRIV_H_ #define _VLAPIC_PRIV_H_ +#include + /* * APIC Register: Offset Description */ @@ -91,6 +93,8 @@ enum boot_state { */ #define ISRVEC_STK_SIZE (16 + 1) +#define VLAPIC_MAXLVT_INDEX APIC_LVT_CMCI + struct vlapic { struct vm *vm; int vcpuid; @@ -111,12 +115,20 @@ struct vlapic { * The vector on the top of the stack is used to compute the * Processor Priority in conjunction with the TPR. */ - uint8_t isrvec_stk[ISRVEC_STK_SIZE]; - int isrvec_stk_top; + uint8_t isrvec_stk[ISRVEC_STK_SIZE]; + int isrvec_stk_top; + + uint64_t msr_apicbase; + enum boot_state boot_state; - uint64_t msr_apicbase; - enum boot_state boot_state; - uint32_t svr_last; + /* + * Copies of some registers in the virtual APIC page. We do this for + * a couple of different reasons: + * - to be able to detect what changed (e.g. svr_last) + * - to maintain a coherent snapshot of the register (e.g. lvt_last) + */ + uint32_t svr_last; + uint32_t lvt_last[VLAPIC_MAXLVT_INDEX + 1]; }; void vlapic_init(struct vlapic *vlapic); Modified: user/gjb/hacking/release-embedded/sys/ia64/ia64/dump_machdep.c ============================================================================== --- user/gjb/hacking/release-embedded/sys/ia64/ia64/dump_machdep.c Sat Dec 28 03:04:05 2013 (r259995) +++ user/gjb/hacking/release-embedded/sys/ia64/ia64/dump_machdep.c Sat Dec 28 03:11:09 2013 (r259996) @@ -56,7 +56,10 @@ CTASSERT(sizeof(struct kerneldumpheader) #define MD_ALIGN(x) (((off_t)(x) + EFI_PAGE_MASK) & ~EFI_PAGE_MASK) #define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) -typedef int callback_t(struct efi_md*, int, void*); +static int minidump = 0; +TUNABLE_INT("debug.minidump", &minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &minidump, 0, + "Enable mini crash dumps"); static struct kerneldumpheader kdh; static off_t dumplo, fileofs; @@ -83,7 +86,7 @@ buf_write(struct dumperinfo *di, char *p error = dump_write(di, buffer, 0, dumplo, DEV_BSIZE); if (error) - return error; + return (error); dumplo += DEV_BSIZE; fragsz = 0; } @@ -106,8 +109,14 @@ buf_flush(struct dumperinfo *di) return (error); } +/* + * Physical dump support + */ + +typedef int phys_callback_t(struct efi_md*, int, void*); + static int -cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumpdata(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; vm_offset_t pa; @@ -153,7 +162,7 @@ cb_dumpdata(struct efi_md *mdp, int seqn } static int -cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_dumphdr(struct efi_md *mdp, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; Elf64_Phdr phdr; @@ -175,7 +184,7 @@ cb_dumphdr(struct efi_md *mdp, int seqnr } static int -cb_size(struct efi_md *mdp, int seqnr, void *arg) +phys_cb_size(struct efi_md *mdp, int seqnr, void *arg) { uint64_t *sz = (uint64_t*)arg; @@ -184,7 +193,7 @@ cb_size(struct efi_md *mdp, int seqnr, v } static int -foreach_chunk(callback_t cb, void *arg) +phys_foreach(phys_callback_t cb, void *arg) { struct efi_md *mdp; int error, seqnr; @@ -206,6 +215,31 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } +/* + * Virtual dump (aka minidump) support + */ + +static int +virt_size(uint64_t *dumpsize) +{ + + return (0); +} + +static int +virt_dumphdrs(struct dumperinfo *di) +{ + + return (-ENOSYS); +} + +static int +virt_dumpdata(struct dumperinfo *di) +{ + + return (-ENOSYS); +} + void dumpsys(struct dumperinfo *di) { @@ -213,7 +247,7 @@ dumpsys(struct dumperinfo *di) uint64_t dumpsize; off_t hdrgap; size_t hdrsz; - int error; + int error, status; bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -230,18 +264,25 @@ dumpsys(struct dumperinfo *di) ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ehdr.e_machine = EM_IA_64; - ehdr.e_entry = ia64_tpa((uintptr_t)bootinfo); + ehdr.e_entry = (minidump) ? (uintptr_t)bootinfo : + ia64_tpa((uintptr_t)bootinfo); ehdr.e_phoff = sizeof(ehdr); - ehdr.e_flags = EF_IA_64_ABSOLUTE; /* XXX misuse? */ + ehdr.e_flags = (minidump) ? 0 : EF_IA_64_ABSOLUTE; /* XXX misuse? */ ehdr.e_ehsize = sizeof(ehdr); ehdr.e_phentsize = sizeof(Elf64_Phdr); ehdr.e_shentsize = sizeof(Elf64_Shdr); /* Calculate dump size. */ dumpsize = 0L; - ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + status = (minidump) ? virt_size(&dumpsize) : + phys_foreach(phys_cb_size, &dumpsize); + if (status < 0) { + error = -status; + goto fail; + } + ehdr.e_phnum = status; hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; - fileofs = MD_ALIGN(hdrsz); + fileofs = (minidump) ? round_page(hdrsz) : MD_ALIGN(hdrsz); dumpsize += fileofs; hdrgap = fileofs - DEV_ALIGN(hdrsz); @@ -270,24 +311,30 @@ dumpsys(struct dumperinfo *di) goto fail; /* Dump program headers */ - error = foreach_chunk(cb_dumphdr, di); - if (error < 0) + status = (minidump) ? virt_dumphdrs(di) : + phys_foreach(phys_cb_dumphdr, di); + if (status < 0) { + error = -status; goto fail; + } buf_flush(di); /* * All headers are written using blocked I/O, so we know the - * current offset is (still) block aligned. Skip the alignement + * current offset is (still) block aligned. Skip the alignment * in the file to have the segment contents aligned at page - * boundary. We cannot use MD_ALIGN on dumplo, because we don't - * care and may very well be unaligned within the dump device. + * boundary. For physical dumps, it's the EFI page size (= 4K). + * For minidumps it's the kernel's page size (= 8K). */ dumplo += hdrgap; /* Dump memory chunks (updates dumplo) */ - error = foreach_chunk(cb_dumpdata, di); - if (error < 0) + status = (minidump) ? virt_dumpdata(di) : + phys_foreach(phys_cb_dumpdata, di); + if (status < 0) { + error = -status; goto fail; + } /* Dump trailer */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); @@ -300,9 +347,6 @@ dumpsys(struct dumperinfo *di) return; fail: - if (error < 0) - error = -error; - if (error == ECANCELED) printf("\nDump aborted\n"); else From owner-svn-src-user@FreeBSD.ORG Sat Dec 28 04:46:03 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F097D277; Sat, 28 Dec 2013 04:46:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD4F71050; Sat, 28 Dec 2013 04:46:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBS4k3RG098726; Sat, 28 Dec 2013 04:46:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBS4k3Dp098725; Sat, 28 Dec 2013 04:46:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312280446.rBS4k3Dp098725@svn.freebsd.org> From: Glen Barber Date: Sat, 28 Dec 2013 04:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r260000 - user/gjb/hacking/release-embedded/tools/release/arm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 28 Dec 2013 04:46:04 -0000 Author: gjb Date: Sat Dec 28 04:46:03 2013 New Revision: 260000 URL: http://svnweb.freebsd.org/changeset/base/260000 Log: Remove commented options to include src/ and ports/. Reduce image size from 4G to 1G, and enable autosize. Sponsored by: The FreeBSD Foundation Modified: user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf Modified: user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf ============================================================================== --- user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf Sat Dec 28 04:28:35 2013 (r259999) +++ user/gjb/hacking/release-embedded/tools/release/arm/crochet-RPI-B.conf Sat Dec 28 04:46:03 2013 (r260000) @@ -6,10 +6,8 @@ # FreeBSD Raspberry Pi images. board_setup RaspberryPi -#option UsrPorts -#option UsrSrc -# 4GB -option ImageSize 3900mb +option ImageSize 1gb +option AutoSize export MAKEOBJDIRPREFIX=/usr/obj FREEBSD_SRC=/usr/src From owner-svn-src-user@FreeBSD.ORG Sat Dec 28 22:27:01 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 468BFE24; Sat, 28 Dec 2013 22:27:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F5271F9A; Sat, 28 Dec 2013 22:27:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBSMR1tv088153; Sat, 28 Dec 2013 22:27:01 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBSMQvqd088124; Sat, 28 Dec 2013 22:26:57 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312282226.rBSMQvqd088124@svn.freebsd.org> From: Glen Barber Date: Sat, 28 Dec 2013 22:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r260018 - in user/gjb/hacking/release-embedded: contrib/gcc contrib/gcc/cp contrib/gcc/doc contrib/libc++/include lib/libiconv_modules/BIG5 lib/libiconv_modules/DECHanyu lib/libiconv_mo... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 28 Dec 2013 22:27:01 -0000 Author: gjb Date: Sat Dec 28 22:26:57 2013 New Revision: 260018 URL: http://svnweb.freebsd.org/changeset/base/260018 Log: MFH: Tracking commit. Sponsored by: The FreeBSD Foundation Added: user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.apple - copied unchanged from r260017, head/contrib/gcc/ChangeLog.apple user/gjb/hacking/release-embedded/contrib/gcc/cp/ChangeLog.apple - copied unchanged from r260017, head/contrib/gcc/cp/ChangeLog.apple Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-common.c user/gjb/hacking/release-embedded/contrib/gcc/c-decl.c user/gjb/hacking/release-embedded/contrib/gcc/c-parser.c user/gjb/hacking/release-embedded/contrib/gcc/c-tree.h user/gjb/hacking/release-embedded/contrib/gcc/c-typeck.c user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-gimplify.c user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.def user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.h user/gjb/hacking/release-embedded/contrib/gcc/cp/decl.c user/gjb/hacking/release-embedded/contrib/gcc/cp/dump.c user/gjb/hacking/release-embedded/contrib/gcc/cp/init.c user/gjb/hacking/release-embedded/contrib/gcc/cp/parser.c user/gjb/hacking/release-embedded/contrib/gcc/cp/pt.c user/gjb/hacking/release-embedded/contrib/gcc/cp/semantics.c user/gjb/hacking/release-embedded/contrib/gcc/doc/extend.texi user/gjb/hacking/release-embedded/contrib/gcc/dwarf2out.c user/gjb/hacking/release-embedded/contrib/gcc/emit-rtl.c user/gjb/hacking/release-embedded/contrib/gcc/final.c user/gjb/hacking/release-embedded/contrib/gcc/print-rtl.c user/gjb/hacking/release-embedded/contrib/gcc/print-tree.c user/gjb/hacking/release-embedded/contrib/gcc/rtl.def user/gjb/hacking/release-embedded/contrib/gcc/rtl.h user/gjb/hacking/release-embedded/contrib/gcc/stmt.c user/gjb/hacking/release-embedded/contrib/gcc/toplev.c user/gjb/hacking/release-embedded/contrib/gcc/toplev.h user/gjb/hacking/release-embedded/contrib/gcc/tree-cfg.c user/gjb/hacking/release-embedded/contrib/gcc/tree.h user/gjb/hacking/release-embedded/contrib/libc++/include/type_traits user/gjb/hacking/release-embedded/lib/libiconv_modules/BIG5/citrus_big5.c user/gjb/hacking/release-embedded/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c user/gjb/hacking/release-embedded/lib/libiconv_modules/EUC/citrus_euc.c user/gjb/hacking/release-embedded/lib/libiconv_modules/EUCTW/citrus_euctw.c user/gjb/hacking/release-embedded/lib/libiconv_modules/GBK2K/citrus_gbk2k.c user/gjb/hacking/release-embedded/lib/libiconv_modules/HZ/citrus_hz.c user/gjb/hacking/release-embedded/lib/libiconv_modules/ISO2022/citrus_iso2022.c user/gjb/hacking/release-embedded/lib/libiconv_modules/JOHAB/citrus_johab.c user/gjb/hacking/release-embedded/lib/libiconv_modules/MSKanji/citrus_mskanji.c user/gjb/hacking/release-embedded/lib/libiconv_modules/UES/citrus_ues.c user/gjb/hacking/release-embedded/lib/libiconv_modules/UTF7/citrus_utf7.c user/gjb/hacking/release-embedded/lib/libiconv_modules/UTF8/citrus_utf8.c user/gjb/hacking/release-embedded/lib/libiconv_modules/VIQR/citrus_viqr.c user/gjb/hacking/release-embedded/lib/libiconv_modules/ZW/citrus_zw.c user/gjb/hacking/release-embedded/sys/dev/iwn/if_iwn_chip_cfg.h user/gjb/hacking/release-embedded/sys/dev/sk/if_sk.c user/gjb/hacking/release-embedded/sys/ia64/ia64/dump_machdep.c user/gjb/hacking/release-embedded/sys/sys/param.h user/gjb/hacking/release-embedded/sys/sys/pctrie.h user/gjb/hacking/release-embedded/sys/vm/vm_reserv.c user/gjb/hacking/release-embedded/usr.sbin/bhyve/acpi.c user/gjb/hacking/release-embedded/usr.sbin/bhyve/acpi.h user/gjb/hacking/release-embedded/usr.sbin/bhyve/mevent.c user/gjb/hacking/release-embedded/usr.sbin/bhyve/mevent.h user/gjb/hacking/release-embedded/usr.sbin/bhyve/mptbl.c user/gjb/hacking/release-embedded/usr.sbin/bhyve/pm.c user/gjb/hacking/release-embedded/usr.sbin/bhyve/pmtmr.c Directory Properties: user/gjb/hacking/release-embedded/ (props changed) Copied: user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.apple (from r260017, head/contrib/gcc/ChangeLog.apple) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/contrib/gcc/ChangeLog.apple Sat Dec 28 22:26:57 2013 (r260018, copy of r260017, head/contrib/gcc/ChangeLog.apple) @@ -0,0 +1,51 @@ +006-02-15 Fariborz Jahanian + + Radar 4445586 + * c-common.def (DO_STMT): Takes an extra argument. + +/* APPLE LOCAL merge marger */ +/* Stuff under is in fsf mainline, but not in the 4.2 branch */ + +2007-08-02 Geoffrey Keating + + Radar 3274130, 5295549 + * c-parser.c (c_parser_while_statement): Handle attributes. + (c_parser_do_statement): Handle attributes. + (c_parser_for_statement): Handle attributes. + * c-common.c (handle_unused_attribute): Warn if a statement + is marked as unused. + * c-tree.h (c_finish_loop): Add extra parameter. + * c-typeck.c (c_finish_loop): Handle attributes. + * doc/extend.texi (Attribute Syntax): Document statement attributes. + (Label Attributes): Explain how they apply to statements. + * tree-cfg.c (cleanup_dead_labels): Preserve labels with + user-specified alignment or attributes. + * stmt.c (expand_label): Update and correct documentation. + + * c-common.c (handle_aligned_attribute): Handle LABEL_DECL. + * rtl.def (CODE_LABEL): Add 8th operand. + * rtl.h (LABEL_ALIGN_LOG): New. + (LABEL_MAX_SKIP): New. + (SET_LABEL_ALIGN): New. + * emit-rtl.c (gen_label_rtx): Adjust. + * print-rtl.c (print_rtx): Print LABEL_ALIGN_LOG. + * stmt.c (label_rtx): Set CODE_LABEL's alignment from DECL_ALIGN. + (expand_label): Update documentation. + * final.c (struct label_alignment): Delete. + (label_align): Delete. + (min_labelno): Delete. + (max_labelno): Delete. + (LABEL_TO_ALIGNMENT): Delete. + (LABEL_TO_MAX_SKIP): Delete. + (label_to_alignment): Adjust for LABEL_ALIGN_LOG. + (align_fuzz): Likewise. + (compute_alignments): Likewise. + (shorten_branches): Remove code to set up label_align. + Adjust for LABEL_ALIGN_LOG. + (final_scan_insn): Adjust for LABEL_ALIGN_LOG. + * doc/extend.texi (C Extensions): Add 'Label Attributes' to menu. + (Attribute Syntax): Move label content to Label Attributes. + (Function Attributes): Mention label attributes. + (Variable Attributes): Mention label attributes. + (Type Attributes): Mention label attributes. + (Label Attributes): New. Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-common.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/c-common.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/c-common.c Sat Dec 28 22:26:57 2013 (r260018) @@ -541,6 +541,9 @@ static tree handle_pure_attribute (tree static tree handle_novops_attribute (tree *, tree, tree, int, bool *); static tree handle_deprecated_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ +static tree handle_unavailable_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL end "unavailable" attribute --ilr */ static tree handle_vector_size_attribute (tree *, tree, tree, int, bool *); static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *); @@ -626,6 +629,10 @@ const struct attribute_spec c_common_att handle_novops_attribute }, { "deprecated", 0, 0, false, false, false, handle_deprecated_attribute }, + /* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ + { "unavailable", 0, 0, false, false, false, + handle_unavailable_attribute }, + /* APPLE LOCAL end "unavailable" attribute --ilr */ { "vector_size", 1, 1, false, true, false, handle_vector_size_attribute }, { "visibility", 1, 1, false, false, false, @@ -4394,7 +4401,10 @@ handle_unused_attribute (tree *node, tre if (TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL - || TREE_CODE (decl) == LABEL_DECL +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + || (TREE_CODE (decl) == LABEL_DECL + && ! DECL_ARTIFICIAL (decl)) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ || TREE_CODE (decl) == TYPE_DECL) TREE_USED (decl) = 1; else @@ -4842,7 +4852,10 @@ handle_aligned_attribute (tree *node, tr TYPE_USER_ALIGN (*type) = 1; } else if (! VAR_OR_FUNCTION_DECL_P (decl) - && TREE_CODE (decl) != FIELD_DECL) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + && TREE_CODE (decl) != FIELD_DECL + && TREE_CODE (decl) != LABEL_DECL) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { error ("alignment may not be specified for %q+D", decl); *no_add_attrs = true; @@ -5345,6 +5358,67 @@ handle_deprecated_attribute (tree *node, return NULL_TREE; } +/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */ +/* Handle a "unavailable" attribute; arguments as in + struct attribute_spec.handler. */ + +static tree +handle_unavailable_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + tree type = NULL_TREE; + int warn = 0; + const char *what = NULL; + + if (DECL_P (*node)) + { + tree decl = *node; + type = TREE_TYPE (decl); + + if (TREE_CODE (decl) == TYPE_DECL + || TREE_CODE (decl) == PARM_DECL + || TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == FUNCTION_DECL) + { + TREE_UNAVAILABLE (decl) = 1; + } + else + warn = 1; + } + else if (TYPE_P (*node)) + { + if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE)) + *node = build_variant_type_copy (*node); + TREE_UNAVAILABLE (*node) = 1; + type = *node; + } + else + warn = 1; + + if (warn) + { + *no_add_attrs = true; + if (type && TYPE_NAME (type)) + { + if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) + what = IDENTIFIER_POINTER (TYPE_NAME (*node)); + else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL + && DECL_NAME (TYPE_NAME (type))) + what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); + } + if (what) + warning (0, "`%s' attribute ignored for `%s'", + IDENTIFIER_POINTER (name), what); + else + warning (0, "`%s' attribute ignored", IDENTIFIER_POINTER (name)); + } + + return NULL_TREE; +} +/* APPLE LOCAL end "unavailable" attribute --ilr */ + /* Handle a "vector_size" attribute; arguments as in struct attribute_spec.handler. */ Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-decl.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/c-decl.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/c-decl.c Sat Dec 28 22:26:57 2013 (r260018) @@ -453,10 +453,17 @@ add_stmt (tree t) with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ +/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ +/* Also add an __attribute__((unavailable)). An object declared as + __attribute__((unavailable)) suppresses any reports of being + declared with unavailable or deprecated items. */ +/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ enum deprecated_states { DEPRECATED_NORMAL, DEPRECATED_SUPPRESS + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + , DEPRECATED_UNAVAILABLE_SUPPRESS }; static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; @@ -1709,6 +1716,12 @@ merge_decls (tree newdecl, tree olddecl, if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* Merge unavailableness. */ + if (TREE_UNAVAILABLE (newdecl)) + TREE_UNAVAILABLE (olddecl) = 1; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + /* Keep source location of definition rather than declaration and of prototype rather than non-prototype unless that prototype is built-in. */ @@ -3222,8 +3235,36 @@ start_decl (struct c_declarator *declara /* An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. An object declared as __attribute__((deprecated)) + suppresses warnings of uses of other deprecated items. */ +#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */ if (lookup_attribute ("deprecated", attributes)) deprecated_state = DEPRECATED_SUPPRESS; + else if (lookup_attribute ("unavailable", attributes)) + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; +#else /* a more efficient way doing what lookup_attribute would do */ + tree a; + + for (a = attributes; a; a = TREE_CHAIN (a)) + { + tree name = TREE_PURPOSE (a); + if (TREE_CODE (name) == IDENTIFIER_NODE) + if (is_attribute_p ("deprecated", name)) + { + deprecated_state = DEPRECATED_SUPPRESS; + break; + } + if (is_attribute_p ("unavailable", name)) + { + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; + break; + } + } +#endif + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, NULL); @@ -4087,6 +4128,11 @@ grokdeclarator (const struct c_declarato /* If this looks like a function definition, make it one, even if it occurs where parms are expected. Then store_parm_decls will reject it and not use it as a parm. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (declspecs->unavailable_p) + error_unavailable_use (declspecs->type); + else + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ if (decl_context == NORMAL && !funcdef_flag && current_scope->parm_flag) decl_context = PARM; @@ -7267,6 +7313,8 @@ build_null_declspecs (void) ret->tag_defined_p = false; ret->explicit_signed_p = false; ret->deprecated_p = false; + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + ret->unavailable_p = false; ret->default_int_p = false; ret->long_p = false; ret->long_long_p = false; @@ -7330,6 +7378,11 @@ declspecs_add_type (struct c_declspecs * if (TREE_DEPRECATED (type)) specs->deprecated_p = true; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (type)) + specs->unavailable_p = true; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + /* Handle type specifier keywords. */ if (TREE_CODE (type) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (type)) { Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-parser.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/c-parser.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/c-parser.c Sat Dec 28 22:26:57 2013 (r260018) @@ -3940,16 +3940,25 @@ c_parser_switch_statement (c_parser *par /* Parse a while statement (C90 6.6.5, C99 6.8.5). while-statement: - while (expression) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + while attributes (expression) statement + + The use of attributes is a GNU extension. + APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ static void c_parser_while_statement (c_parser *parser) { - tree block, cond, body, save_break, save_cont; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, body, save_break, save_cont, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_WHILE)); c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; cond = c_parser_paren_condition (parser); @@ -3958,7 +3967,10 @@ c_parser_while_statement (c_parser *pars save_cont = c_cont_label; c_cont_label = NULL_TREE; body = c_parser_c99_block_statement (parser); - c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, true); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, NULL, body, c_break_label, c_cont_label, attrs, + true); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); c_break_label = save_break; c_cont_label = save_cont; @@ -3967,16 +3979,25 @@ c_parser_while_statement (c_parser *pars /* Parse a do statement (C90 6.6.5, C99 6.8.5). do-statement: - do statement while ( expression ) ; + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + do attributes statement while ( expression ) ; + + The use of attributes is a GNU extension. + APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ static void c_parser_do_statement (c_parser *parser) { - tree block, cond, body, save_break, save_cont, new_break, new_cont; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, body, save_break, save_cont, new_break, new_cont, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_DO)); c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); loc = c_parser_peek_token (parser)->location; save_break = c_break_label; @@ -3992,18 +4013,26 @@ c_parser_do_statement (c_parser *parser) cond = c_parser_paren_condition (parser); if (!c_parser_require (parser, CPP_SEMICOLON, "expected %<;%>")) c_parser_skip_to_end_of_block_or_statement (parser); - c_finish_loop (loc, cond, NULL, body, new_break, new_cont, false); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, NULL, body, new_break, new_cont, attrs, false); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); } /* Parse a for statement (C90 6.6.5, C99 6.8.5). for-statement: - for ( expression[opt] ; expression[opt] ; expression[opt] ) statement - for ( nested-declaration expression[opt] ; expression[opt] ) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + for attributes ( expression[opt] ; expression[opt] ; expression[opt] ) \ + statement + for attributes ( nested-declaration expression[opt] ; expression[opt] ) \ + statement The form with a declaration is new in C99. + The use of attributes is a GNU extension. + + APPLE LOCAL end for-fsf-4_4 3274130 5295549 ??? In accordance with the old parser, the declaration may be a nested function, which is then rejected in check_for_loop_decls, but does it make any sense for this to be included in the grammar? @@ -4015,11 +4044,16 @@ c_parser_do_statement (c_parser *parser) static void c_parser_for_statement (c_parser *parser) { - tree block, cond, incr, save_break, save_cont, body; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree block, cond, incr, save_break, save_cont, body, attrs; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ location_t loc; gcc_assert (c_parser_next_token_is_keyword (parser, RID_FOR)); loc = c_parser_peek_token (parser)->location; c_parser_consume_token (parser); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + attrs = c_parser_attributes (parser); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ block = c_begin_compound_stmt (flag_isoc99); if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) { @@ -4094,7 +4128,10 @@ c_parser_for_statement (c_parser *parser save_cont = c_cont_label; c_cont_label = NULL_TREE; body = c_parser_c99_block_statement (parser); - c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, true); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + c_finish_loop (loc, cond, incr, body, c_break_label, c_cont_label, attrs, + true); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (c_end_compound_stmt (block, flag_isoc99)); c_break_label = save_break; c_cont_label = save_cont; Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-tree.h ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/c-tree.h Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/c-tree.h Sat Dec 28 22:26:57 2013 (r260018) @@ -257,6 +257,10 @@ struct c_declspecs { BOOL_BITFIELD explicit_signed_p : 1; /* Whether the specifiers include a deprecated typedef. */ BOOL_BITFIELD deprecated_p : 1; + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* Whether the specifiers include a unavailable typedef. */ + BOOL_BITFIELD unavailable_p : 1; + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ /* Whether the type defaulted to "int" because there were no type specifiers. */ BOOL_BITFIELD default_int_p; @@ -573,7 +577,10 @@ extern int c_types_compatible_p (tree, t extern tree c_begin_compound_stmt (bool); extern tree c_end_compound_stmt (tree, bool); extern void c_finish_if_stmt (location_t, tree, tree, tree, bool); -extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, tree, + bool); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern tree c_begin_stmt_expr (void); extern tree c_finish_stmt_expr (tree); extern tree c_process_expr_stmt (tree); Modified: user/gjb/hacking/release-embedded/contrib/gcc/c-typeck.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/c-typeck.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/c-typeck.c Sat Dec 28 22:26:57 2013 (r260018) @@ -1849,6 +1849,11 @@ build_component_ref (tree datum, tree co if (TREE_DEPRECATED (subdatum)) warn_deprecated_use (subdatum); + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (subdatum)) + error_unavailable_use (subdatum); + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + datum = ref; field = TREE_CHAIN (field); @@ -2090,6 +2095,11 @@ build_external_ref (tree id, int fun, lo if (TREE_DEPRECATED (ref)) warn_deprecated_use (ref); + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + if (TREE_UNAVAILABLE (ref)) + error_unavailable_use (ref); + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ + if (!skip_evaluation) assemble_external (ref); TREE_USED (ref) = 1; @@ -7247,15 +7257,22 @@ c_finish_if_stmt (location_t if_locus, t add_stmt (stmt); } -/* Emit a general-purpose loop construct. START_LOCUS is the location of - the beginning of the loop. COND is the loop condition. COND_IS_FIRST - is false for DO loops. INCR is the FOR increment expression. BODY is - the statement controlled by the loop. BLAB is the break label. CLAB is - the continue label. Everything is allowed to be NULL. */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +/* Emit a general-purpose loop construct. START_LOCUS is the location + of the beginning of the loop. COND is the loop condition. + COND_IS_FIRST is false for DO loops. INCR is the FOR increment + expression. BODY is the statement controlled by the loop. BLAB is + the break label. CLAB is the continue label. ATTRS is the + attributes associated with the loop, which at present are + associated with the topmost label. Everything is allowed to be + NULL. */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ void c_finish_loop (location_t start_locus, tree cond, tree incr, tree body, - tree blab, tree clab, bool cond_is_first) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree blab, tree clab, tree attrs, bool cond_is_first) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree entry = NULL, exit = NULL, t; Copied: user/gjb/hacking/release-embedded/contrib/gcc/cp/ChangeLog.apple (from r260017, head/contrib/gcc/cp/ChangeLog.apple) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/ChangeLog.apple Sat Dec 28 22:26:57 2013 (r260018, copy of r260017, head/contrib/gcc/cp/ChangeLog.apple) @@ -0,0 +1,31 @@ +2006-02-15 Fariborz Jahanian + + Radar 4445586 + * semantics.c (begin_do_stmt): DO_STMT nodes take an + extra argument to build. + + # APPLE LOCAL begin for-fsf-4_4 3274130 5295549 +2007-08-03 Geoffrey Keating + + Radar 5295549 + * parser.c (cp_parser_iteration_statement): Handle attributes. + * semantics.c (begin_for_stmt): Put attributes in built tree. + (begin_while_stmt): Put attributes in built tree. + (begin_do_stmt): Put attributes in built tree. + * pt.c (tsubst_expr): Handle attributes for FOR_STMT, WHILE_STMT, + DO_STMT. + * cp-gimplify.c (gimplify_cp_loop): Handle attributes. + (gimplify_for_stmt): Pass attributes to gimplify_cp_loop. + (gimplify_while_stmt): Pass attributes to gimplify_cp_loop. + (gimplify_do_stmt): Pass attributes to gimplify_cp_loop. + * dump.c (cp_dump_tree): Dump attributes for FOR_STMT, WHILE_STMT, + DO_STMT. + * cp-tree.h (begin_while_stmt): Update prototype. + (begin_do_stmt): Likewise. + (begin_for_stmt): Likewise. + * cp-tree.def (FOR_STMT): Add extra parameter. + (WHILE_STMT): Likewise. + (DO_STMT): Likewise. + * init.c (build_vec_init): Update for change to begin_for_stmt. + + # APPLE LOCAL end for-fsf-4_4 3274130 5295549 Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-gimplify.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-gimplify.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-gimplify.c Sat Dec 28 22:26:57 2013 (r260018) @@ -188,7 +188,10 @@ gimplify_if_stmt (tree *stmt_p) loop body as in do-while loops. */ static tree -gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +gimplify_cp_loop (tree cond, tree body, tree incr, tree attrs, + bool cond_is_first, tree inner_foreach) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree top, entry, exit, cont_block, break_block, stmt_list, t; location_t stmt_locus; @@ -223,6 +226,12 @@ gimplify_cp_loop (tree cond, tree body, out of the loop, or to the top of it. If there's no exit condition, then we just build a jump back to the top. */ exit = build_and_jump (&LABEL_EXPR_LABEL (top)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + + /* Add the attributes to the 'top' label. */ + decl_attributes (&LABEL_EXPR_LABEL (top), attrs, 0); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ if (cond && !integer_nonzerop (cond)) { t = build_bc_goto (bc_break); @@ -270,8 +279,11 @@ gimplify_for_stmt (tree *stmt_p, tree *p if (FOR_INIT_STMT (stmt)) gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), - FOR_EXPR (stmt), 1); + FOR_EXPR (stmt), FOR_ATTRIBUTES (stmt), 1, + NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Gimplify a WHILE_STMT node. */ @@ -280,8 +292,11 @@ static void gimplify_while_stmt (tree *stmt_p) { tree stmt = *stmt_p; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), - NULL_TREE, 1); + NULL_TREE, WHILE_ATTRIBUTES (stmt), 1, + NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Gimplify a DO_STMT node. */ @@ -290,8 +305,11 @@ static void gimplify_do_stmt (tree *stmt_p) { tree stmt = *stmt_p; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), - NULL_TREE, 0); + NULL_TREE, DO_ATTRIBUTES (stmt), 0, + DO_FOREACH (stmt)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ } /* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.def ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.def Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.def Sat Dec 28 22:26:57 2013 (r260018) @@ -281,18 +281,23 @@ DEFTREECODE (CLEANUP_STMT, "cleanup_stmt and COND_EXPR for the benefit of templates. */ DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ /* Used to represent a `for' statement. The operands are - FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ -DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 4) + FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY and FOR_ATTRIBUTES + respectively. */ +DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 5) /* Used to represent a 'while' statement. The operands are WHILE_COND - and WHILE_BODY, respectively. */ -DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) + WHILE_BODY, and WHILE_ATTRIBUTES respectively. */ +DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 3) -/* Used to represent a 'do' statement. The operands are DO_BODY and - DO_COND, respectively. */ -DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2) +/* APPLE LOCAL begin radar 4445586 */ +/* Used to represent a 'do' statement. The operands are DO_BODY, + DO_COND, DO_ATTRIBUTES, and DO_FOREACH respectively. */ +DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 4) +/* APPLE LOCAL end radar 4445586 */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Used to represent a 'break' statement. */ DEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0) Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.h ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.h Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/cp-tree.h Sat Dec 28 22:26:57 2013 (r260018) @@ -3080,12 +3080,24 @@ extern void decl_shadowed_for_var_insert while statement and the body of the while statement, respectively. */ #define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) #define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define WHILE_ATTRIBUTES(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 2) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* DO_STMT accessors. These give access to the condition of the do statement and the body of the do statement, respectively. */ #define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) #define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define DO_ATTRIBUTES(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 2) +/* APPLE LOCAL begin C* language */ +/* Used as a flag to indicate synthesized inner do-while loop of a + foreach statement. Used for generation of break/continue statement + of the loop. */ +#define DO_FOREACH(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 3) +/* APPLE LOCAL end C* language */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* FOR_STMT accessors. These give access to the init statement, condition, update expression, and body of the for statement, respectively. */ @@ -3093,7 +3105,10 @@ extern void decl_shadowed_for_var_insert #define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) #define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) #define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +#define FOR_ATTRIBUTES(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 4) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ #define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) #define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) #define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) @@ -4258,14 +4273,20 @@ extern tree finish_then_clause (tree); extern void begin_else_clause (tree); extern void finish_else_clause (tree); extern void finish_if_stmt (tree); -extern tree begin_while_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_while_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_while_stmt_cond (tree, tree); extern void finish_while_stmt (tree); -extern tree begin_do_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_do_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_do_body (tree); extern void finish_do_stmt (tree, tree); extern tree finish_return_stmt (tree); -extern tree begin_for_stmt (void); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +extern tree begin_for_stmt (tree); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ extern void finish_for_init_stmt (tree); extern void finish_for_cond (tree, tree); extern void finish_for_expr (tree, tree); Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/decl.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/decl.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/decl.c Sat Dec 28 22:26:57 2013 (r260018) @@ -232,10 +232,17 @@ int function_depth; with __attribute__((deprecated)). An object declared as __attribute__((deprecated)) suppresses warnings of uses of other deprecated items. */ +/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ +/* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. */ +/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ enum deprecated_states { DEPRECATED_NORMAL, DEPRECATED_SUPPRESS + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + , DEPRECATED_UNAVAILABLE_SUPPRESS }; static enum deprecated_states deprecated_state = DEPRECATED_NORMAL; @@ -3836,14 +3843,40 @@ start_decl (const cp_declarator *declara tree decl; tree type, tem; tree context; + /* APPLE LOCAL "unavailable" attribute (radar 2809697) */ + tree a; bool was_public; *pushed_scope_p = NULL_TREE; - /* An object declared as __attribute__((deprecated)) suppresses - warnings of uses of other deprecated items. */ + /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */ + /* An object declared as __attribute__((unavailable)) suppresses + any reports of being declared with unavailable or deprecated + items. An object declared as __attribute__((deprecated)) + suppresses warnings of uses of other deprecated items. */ +#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */ if (lookup_attribute ("deprecated", attributes)) deprecated_state = DEPRECATED_SUPPRESS; + else if (lookup_attribute ("unavailable", attributes)) + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; +#else /* a more efficient way doing what lookup_attribute would do */ + for (a = attributes; a; a = TREE_CHAIN (a)) + { + tree name = TREE_PURPOSE (a); + if (TREE_CODE (name) == IDENTIFIER_NODE) + if (is_attribute_p ("deprecated", name)) + { + deprecated_state = DEPRECATED_SUPPRESS; + break; + } + if (is_attribute_p ("unavailable", name)) + { + deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS; + break; + } + } +#endif + /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */ attributes = chainon (attributes, prefix_attributes); @@ -7274,6 +7307,19 @@ grokdeclarator (const cp_declarator *dec type = NULL_TREE; type_was_error_mark_node = true; } + + /* APPLE LOCAL begin unavailable attribute (radar 2809697) --bowdidge */ + /* If the entire declaration is itself tagged as unavailable then + suppress reports of unavailable/deprecated items. If the + entire declaration is tagged as only deprecated we still + report unavailable uses. */ + if (type && TREE_DEPRECATED (type) && TREE_UNAVAILABLE (type)) + { + if (deprecated_state != DEPRECATED_UNAVAILABLE_SUPPRESS) + warn_deprecated_use (type); + } + else + /* APPLE LOCAL end unavailable attribute (radar 2809697) --bowdidge */ /* If the entire declaration is itself tagged as deprecated then suppress reports of deprecated items. */ if (type && TREE_DEPRECATED (type) Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/dump.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/dump.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/dump.c Sat Dec 28 22:26:57 2013 (r260018) @@ -433,6 +433,9 @@ cp_dump_tree (void* dump_info, tree t) dump_stmt (di, t); dump_child ("body", DO_BODY (t)); dump_child ("cond", DO_COND (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", DO_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case FOR_STMT: @@ -441,6 +444,9 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("cond", FOR_COND (t)); dump_child ("expr", FOR_EXPR (t)); dump_child ("body", FOR_BODY (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", FOR_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case SWITCH_STMT: @@ -453,6 +459,9 @@ cp_dump_tree (void* dump_info, tree t) dump_stmt (di, t); dump_child ("cond", WHILE_COND (t)); dump_child ("body", WHILE_BODY (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + dump_child ("attrs", WHILE_ATTRIBUTES (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ break; case STMT_EXPR: Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/init.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/init.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/init.c Sat Dec 28 22:26:57 2013 (r260018) @@ -2563,7 +2563,9 @@ build_vec_init (tree base, tree maxindex tree elt_init; tree to; - for_stmt = begin_for_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + for_stmt = begin_for_stmt (NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ finish_for_init_stmt (for_stmt); finish_for_cond (build2 (NE_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/parser.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/parser.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/parser.c Sat Dec 28 22:26:57 2013 (r260018) @@ -6787,6 +6787,16 @@ cp_parser_condition (cp_parser* parser) for ( for-init-statement condition [opt] ; expression [opt] ) statement + APPLE LOCAL begin for-fsf-4_4 3274130 5295549 + GNU extension: + + while attributes [opt] ( condition ) statement + do attributes [opt] statement while ( expression ) ; + for attributes [opt] + ( for-init-statement condition [opt] ; expression [opt] ) + statement + + APPLE LOCAL end for-fsf-4_4 3274130 5295549 Returns the new WHILE_STMT, DO_STMT, or FOR_STMT. */ static tree @@ -6794,10 +6804,14 @@ cp_parser_iteration_statement (cp_parser { cp_token *token; enum rid keyword; - tree statement; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree statement, attributes; +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ unsigned char in_statement; - /* Peek at the next token. */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + /* Get the keyword at the start of the loop. */ +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ token = cp_parser_require (parser, CPP_KEYWORD, "iteration-statement"); if (!token) return error_mark_node; @@ -6806,6 +6820,11 @@ cp_parser_iteration_statement (cp_parser statement. */ in_statement = parser->in_statement; +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + /* Parse the attributes, if any. */ + attributes = cp_parser_attributes_opt (parser); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* See what kind of keyword it is. */ keyword = token->keyword; switch (keyword) @@ -6815,7 +6834,9 @@ cp_parser_iteration_statement (cp_parser tree condition; /* Begin the while-statement. */ - statement = begin_while_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_while_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Look for the `('. */ cp_parser_require (parser, CPP_OPEN_PAREN, "`('"); /* Parse the condition. */ @@ -6837,7 +6858,9 @@ cp_parser_iteration_statement (cp_parser tree expression; /* Begin the do-statement. */ - statement = begin_do_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_do_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Parse the body of the do-statement. */ parser->in_statement = IN_ITERATION_STMT; cp_parser_implicitly_scoped_statement (parser, NULL); @@ -6864,7 +6887,9 @@ cp_parser_iteration_statement (cp_parser tree expression = NULL_TREE; /* Begin the for-statement. */ - statement = begin_for_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + statement = begin_for_stmt (attributes); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ /* Look for the `('. */ cp_parser_require (parser, CPP_OPEN_PAREN, "`('"); /* Parse the initialization. */ Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/pt.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/pt.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/pt.c Sat Dec 28 22:26:57 2013 (r260018) @@ -8593,8 +8593,11 @@ tsubst_expr (tree t, tree args, tsubst_f } case FOR_STMT: - stmt = begin_for_stmt (); - RECUR (FOR_INIT_STMT (t)); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (FOR_ATTRIBUTES (t)); + stmt = begin_for_stmt (tmp); + RECUR (FOR_INIT_STMT (t)); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ finish_for_init_stmt (stmt); tmp = RECUR (FOR_COND (t)); finish_for_cond (tmp, stmt); @@ -8605,7 +8608,10 @@ tsubst_expr (tree t, tree args, tsubst_f break; case WHILE_STMT: - stmt = begin_while_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (WHILE_ATTRIBUTES (t)); + stmt = begin_while_stmt (tmp); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ tmp = RECUR (WHILE_COND (t)); finish_while_stmt_cond (tmp, stmt); RECUR (WHILE_BODY (t)); @@ -8613,7 +8619,10 @@ tsubst_expr (tree t, tree args, tsubst_f break; case DO_STMT: - stmt = begin_do_stmt (); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tmp = RECUR (DO_ATTRIBUTES (t)); + stmt = begin_do_stmt (tmp); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ RECUR (DO_BODY (t)); finish_do_body (stmt); tmp = RECUR (DO_COND (t)); Modified: user/gjb/hacking/release-embedded/contrib/gcc/cp/semantics.c ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/cp/semantics.c Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/cp/semantics.c Sat Dec 28 22:26:57 2013 (r260018) @@ -704,10 +704,14 @@ finish_if_stmt (tree if_stmt) appropriate. */ tree -begin_while_stmt (void) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_while_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree r; - r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + r = build_stmt (WHILE_STMT, NULL_TREE, NULL_TREE, attribs); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (r); WHILE_BODY (r) = do_pushlevel (sk_block); begin_cond (&WHILE_COND (r)); @@ -737,9 +741,14 @@ finish_while_stmt (tree while_stmt) appropriate. */ tree -begin_do_stmt (void) -{ - tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_do_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ +{ + /* APPLE LOCAL radar 4445586 */ +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + tree r = build_stmt (DO_STMT, NULL_TREE, NULL_TREE, attribs, NULL_TREE); +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ add_stmt (r); DO_BODY (r) = push_stmt_list (); return r; @@ -803,12 +812,17 @@ finish_return_stmt (tree expr) /* Begin a for-statement. Returns a new FOR_STMT if appropriate. */ tree -begin_for_stmt (void) +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ +begin_for_stmt (tree attribs) +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ { tree r; r = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE, - NULL_TREE, NULL_TREE); +/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ + NULL_TREE, NULL_TREE, attribs); + +/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \ if (flag_new_for_scope > 0) TREE_CHAIN (r) = do_pushlevel (sk_for); Modified: user/gjb/hacking/release-embedded/contrib/gcc/doc/extend.texi ============================================================================== --- user/gjb/hacking/release-embedded/contrib/gcc/doc/extend.texi Sat Dec 28 21:31:58 2013 (r260017) +++ user/gjb/hacking/release-embedded/contrib/gcc/doc/extend.texi Sat Dec 28 22:26:57 2013 (r260018) @@ -58,6 +58,9 @@ extensions, accepted by GCC in C89 mode * Character Escapes:: @samp{\e} stands for the character @key{ESC}. * Variable Attributes:: Specifying attributes of variables. * Type Attributes:: Specifying attributes of types. +@c APPLE LOCAL begin for-fsf-4_4 3274130 5295549 +* Label Attributes:: Specifying attributes of labels and statements. +@c APPLE LOCAL end for-fsf-4_4 3274130 5295549 * Alignment:: Inquiring about the alignment of a type or variable. * Inline:: Defining inline functions (as fast as macros). * Extended Asm:: Assembler instructions with C expressions as operands. @@ -1587,8 +1590,11 @@ attributes are currently defined for fun @code{gnu_inline} and @code{externally_visible}. Several other attributes are defined for functions on particular target systems. Other attributes, including @code{section} are supported for variables declarations -(@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}). *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***