From owner-svn-src-projects@FreeBSD.ORG Sun Jun 10 13:15:13 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0897106564A; Sun, 10 Jun 2012 13:15:13 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAC4E8FC08; Sun, 10 Jun 2012 13:15:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5ADFDjN098988; Sun, 10 Jun 2012 13:15:13 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5ADFD6b098983; Sun, 10 Jun 2012 13:15:13 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201206101315.q5ADFD6b098983@svn.freebsd.org> From: "Cherry G. Mathew" Date: Sun, 10 Jun 2012 13:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236850 - in projects/amd64_xen_pv/sys/amd64: amd64 include xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2012 13:15:13 -0000 Author: cherry Date: Sun Jun 10 13:15:13 2012 New Revision: 236850 URL: http://svn.freebsd.org/changeset/base/236850 Log: - Fine tune the pages that are added to the crashdump. - Enable the msgbufp initialisation. Note: console is not ready yet. - Further pmap tweaks to make boot progress. Approved by: gibbs (implicit) Modified: projects/amd64_xen_pv/sys/amd64/amd64/uma_machdep.c projects/amd64_xen_pv/sys/amd64/include/pmap.h projects/amd64_xen_pv/sys/amd64/xen/machdep.c projects/amd64_xen_pv/sys/amd64/xen/pmap.c Modified: projects/amd64_xen_pv/sys/amd64/amd64/uma_machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/amd64/uma_machdep.c Sun Jun 10 13:10:21 2012 (r236849) +++ projects/amd64_xen_pv/sys/amd64/amd64/uma_machdep.c Sun Jun 10 13:15:13 2012 (r236850) @@ -68,6 +68,12 @@ uma_small_alloc(uma_zone_t zone, int byt if ((wait & M_NODUMP) == 0) dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); +#ifdef XEN + /* XXX: temp fix, dmap not yet implemented. */ + vm_offset_t vaddr = (vm_offset_t) va; + pmap_map(&vaddr, pa, pa + roundup(bytes, PAGE_SIZE), + VM_PROT_READ | VM_PROT_WRITE); +#endif if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) pagezero(va); return (va); Modified: projects/amd64_xen_pv/sys/amd64/include/pmap.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/pmap.h Sun Jun 10 13:10:21 2012 (r236849) +++ projects/amd64_xen_pv/sys/amd64/include/pmap.h Sun Jun 10 13:15:13 2012 (r236850) @@ -345,7 +345,11 @@ extern vm_paddr_t dump_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +#ifdef XEN +#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT /* XXX: review */ +#else #define pmap_page_get_memattr(m) ((vm_memattr_t)(m)->md.pat_mode) +#endif #define pmap_unmapbios(va, sz) pmap_unmapdev((va), (sz)) void pmap_bootstrap(vm_paddr_t *); Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Sun Jun 10 13:10:21 2012 (r236849) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Sun Jun 10 13:15:13 2012 (r236850) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -65,6 +66,7 @@ #include #include #include +#include /* XXX: remove with RB_XXX */ #include #include #include @@ -104,7 +106,7 @@ xen_pfn_t *xen_phys_machine; #define PHYSMAP_SIZE (2 * VM_PHYSSEG_MAX) vm_offset_t pa_index = 0; vm_paddr_t phys_avail[PHYSMAP_SIZE + 2]; -vm_paddr_t dump_avail[2] = {0, 0}; /* XXX: todo */ +vm_paddr_t dump_avail[PHYSMAP_SIZE + 2]; struct pcpu __pcpu[MAXCPU]; @@ -307,6 +309,7 @@ initxen(struct start_info *si) physmem = si->nr_pages; Maxmem = si->nr_pages + 1; memset(phys_avail, 0, sizeof phys_avail); + memset(dump_avail, 0 , sizeof dump_avail); /* * Setup kernel tls registers. pcpu needs them, and other @@ -329,6 +332,9 @@ initxen(struct start_info *si) /* Address of lowest unused page */ physfree = VTOP(si->pt_base + si->nr_pt_frames * PAGE_SIZE); + /* Init basic tunables, hz, msgbufsize etc */ + init_param1(); + /* page tables */ pmap_bootstrap(&physfree); @@ -346,8 +352,11 @@ initxen(struct start_info *si) ("Attempt to use unmapped va\n")); /* Register the rest of free physical memory with phys_avail[] */ - phys_avail[pa_index++] = physfree; + /* dump_avail[] starts at index 1 */ + phys_avail[pa_index++] = physfree; + dump_avail[pa_index] = physfree; phys_avail[pa_index++] = ptoa(physmem); + dump_avail[pa_index] = ptoa(physmem); /* * This may be done better later if it gets more high level @@ -375,8 +384,6 @@ initxen(struct start_info *si) ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); #endif - /* Init basic tunables, hz etc */ - init_param1(); /* gdt */ vm_paddr_t gdt0_frame = phystomach(VTOP(gdt)); @@ -432,8 +439,13 @@ initxen(struct start_info *si) /* Event handling */ init_event_callbacks(); + + cninit(); /* Console subsystem init */ + identify_cpu(); /* Final stage of CPU initialization */ + init_param2(physmem); + //msgbufinit(msgbufp, msgbufsize); //fpuinit(); @@ -454,8 +466,6 @@ initxen(struct start_info *si) _ufssel = GSEL(GUFS32_SEL, SEL_UPL); _ugssel = GSEL(GUGS32_SEL, SEL_UPL); - gdtset = 1; - /* console */ printk("Hello world!\n"); Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/pmap.c Sun Jun 10 13:10:21 2012 (r236849) +++ projects/amd64_xen_pv/sys/amd64/xen/pmap.c Sun Jun 10 13:15:13 2012 (r236850) @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef SMP @@ -128,6 +129,7 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include #include @@ -198,7 +200,6 @@ vallocpages(vm_paddr_t *firstaddr, int n /* Make sure we are still inside of available mapped va. */ KASSERT(PTOV(*firstaddr) <= (xenstack + 512 * 1024), ("Attempt to use unmapped va\n")); - return (ret); } @@ -495,8 +496,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) KASSERT(pa_index == 0, ("reclaimed page table pages are not the lowest available!")); - phys_avail[pa_index] = VTOP(xen_start_info->pt_base); - phys_avail[pa_index + 1] = phys_avail[pa_index] + + dump_avail[pa_index + 1] = phys_avail[pa_index] = VTOP(xen_start_info->pt_base); + dump_avail[pa_index + 2] = phys_avail[pa_index + 1] = phys_avail[pa_index] + ptoa(xen_start_info->nr_pt_frames - 1); pa_index += 2; @@ -519,8 +520,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* XXX: Check we don't overlap xen pgdir entries. */ virtual_end = VM_MAX_KERNEL_ADDRESS; - virtual_avail = xenstack + 1052 * 1024; - /* * Initialize the kernel pmap (which is statically allocated). */ @@ -532,36 +531,70 @@ pmap_bootstrap(vm_paddr_t *firstaddr) tsz = mmu_map_t_size(); -#if 0 - /* XXX test */ - vm_offset_t va = virtual_avail + 4096 * 1024; - - vm_paddr_t pa = phys_avail[pa_index - 1]; - - pmap_kenter(va, pa); + /* Steal some memory (backing physical pages, and kva) */ + physmem -= atop(round_page(msgbufsize)); - memset((void *)va, 0, PAGE_SIZE); - while(1); - /* test XXX */ -#endif + msgbufp = (void *) pmap_map(&virtual_avail, + ptoa(physmem), ptoa(physmem) + round_page(msgbufsize), + VM_PROT_READ | VM_PROT_WRITE); } void pmap_page_init(vm_page_t m) { - KASSERT(0, ("XXX: TODO\n")); + /* XXX: TODO - pv_lists */ + } +/* + * Map in backing memory from kernel_vm_end to addr, + * and update kernel_vm_end. + */ void pmap_growkernel(vm_offset_t addr) { - KASSERT(0, ("XXX: TODO\n")); + KASSERT(kernel_vm_end < addr, ("trying to shrink kernel VA!")); + + addr = trunc_page(addr); + + char tbuf[tsz]; /* Safe to do this on the stack since tsz is + * effectively const. + */ + + mmu_map_t tptr = tbuf; + + struct mmu_map_mbackend mb = { + ptmb_mappedalloc, + ptmb_mappedfree, + ptmb_ptov, + ptmb_vtop + }; + + mmu_map_t_init(tptr, &mb); + + for (;addr <= kernel_vm_end;addr += PAGE_SIZE) { + + if (mmu_map_inspect_va(kernel_pmap, tptr, addr)) { + continue; + } + int pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; + vm_page_t m = vm_page_alloc(NULL, 0, pflags); + KASSERT(m != NULL, ("Backing page alloc failed!")); + vm_paddr_t pa =m->phys_addr; + + pmap_kenter(addr, pa); + } + + mmu_map_t_fini(tptr); } void pmap_init(void) { - KASSERT(0, ("XXX: TODO\n")); + /* XXX: review the use of gdtset for the purpose below */ + gdtset = 1; /* xpq may assert for locking sanity from this point onwards */ + + /* XXX: switch the mmu_map.c backend to something more sane */ } void @@ -602,10 +635,36 @@ pmap_lazyfix_action(void) } #endif /* SMP */ +/* + * Add a list of wired pages to the kva + * this routine is only used for temporary + * kernel mappings that do not need to have + * page modification or references recorded. + * Note that old mappings are simply written + * over. The page *must* be wired. + * XXX: TODO SMP. + * Note: SMP coherent. Uses a ranged shootdown IPI. + */ + void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - KASSERT(0, ("XXX: TODO\n")); + KASSERT(count > 0, ("count > 0")); + KASSERT(sva == trunc_page(sva), + ("sva not page aligned")); + KASSERT(ma != NULL, ("ma != NULL")); + vm_page_t m; + vm_paddr_t pa; + + while (count--) { + m = *ma++; + pa = VM_PAGE_TO_PHYS(m); + pmap_kenter(sva, pa); + sva += PAGE_SIZE; + } + // XXX: TODO: pmap_invalidate_range(kernel_pmap, sva, sva + count * + // PAGE_SIZE); + } void @@ -710,13 +769,11 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p } /* Backing page tables are in place, let xen do the maths */ - PT_SET_MA(va, xpmap_ptom(pa) | PG_RW | PG_V | PG_U); PT_UPDATES_FLUSH(); mmu_map_release_va(kernel_pmap, tptr, va); mmu_map_t_fini(tptr); - } /* @@ -754,33 +811,29 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s vm_offset_t va, sva; va = sva = *virt; + CTR4(KTR_PMAP, "pmap_map: va=0x%x start=0x%jx end=0x%jx prot=0x%x", va, start, end, prot); while (start < end) { -#if 0 - if (PTOV(start) < xenstack + 512 * 1024) { /* XXX: - remove me */ - continue; - } -#endif - pmap_kenter(va, start); va += PAGE_SIZE; start += PAGE_SIZE; - - while(1); } // XXX: pmap_invalidate_range(kernel_pmap, sva, va); *virt = va; + return (sva); } void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - KASSERT(0, ("XXX: TODO\n")); + /* + * XXX: TODO - ignore for now - we need to revisit this as + * soon as kdb is up. + */ } void @@ -811,7 +864,12 @@ pmap_copy_page(vm_page_t src, vm_page_t void pmap_zero_page(vm_page_t m) { - KASSERT(0, ("XXX: TODO\n")); + vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + + /* XXX: temp fix, dmap not yet implemented. */ + pmap_kenter(va, m->phys_addr); + + pagezero((void *)va); } void From owner-svn-src-projects@FreeBSD.ORG Sun Jun 10 13:46:10 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA20B1065674; Sun, 10 Jun 2012 13:46:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7CBD58FC0C; Sun, 10 Jun 2012 13:46:10 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id CB04346B20; Sun, 10 Jun 2012 09:46:09 -0400 (EDT) Date: Sun, 10 Jun 2012 14:46:09 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bruce Evans In-Reply-To: <20120605000211.R1992@besplex.bde.org> Message-ID: References: <201206041009.q54A9v4A019437@svn.freebsd.org> <20120604210548.Y1459@besplex.bde.org> <20120604133358.GO44607@FreeBSD.org> <20120605000211.R1992@besplex.bde.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r236554 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jun 2012 13:46:10 -0000 On Tue, 5 Jun 2012, Bruce Evans wrote: >> B> Many still have spaces in them. This breaks at least simple parsing >> B> of "vmstat -m" output using columns in awk (and postprocessing of >> B> vmstat -m output is more needed than orginally, since vmstat is now >> B> too stupid to even print the totals). A few bugs in this area have >> B> been fixed relatively recently. For example: >> B> >> B> file desc -> filedesc (matches original naming scheme -- no >> underscore) >> B> BIO buffer -> biobuf >> B> UFS mount -> ufs_mount (now just a style bug -- underscore) >> B> VM pgdata -> vm_pgdata >> B> * ihash -> [went away] >> B> struct cdev * -> [went away] >> B> cluster_save buffer -> [went away] (was also too long) >> B> [too many] -> [vmstat -z, with worse names and formatting] >> >> Should only the shortdesc not contain spaces? Well, there is conflict >> between parseability and understandability :) > > Of course the longdesc should contain spaces. Especially since it is not > used, so it only bloats the source code :-). > > The shortdesc could even use M_FOO (if the longdesc could be looked up more > easily). But in 4.4BSD, there was a separate (hard-coded) string table with > names, with lots of spaces in it too, but apparently only for newer (in > 1993) names, since entries 1-21 had no spaces, no underscores, many > abbreviations and no upper case, while entries 22-61 are quite different. If we succeed in getting this fixed (again) then we should add an assertion to the malloc and UMA registration routines to panic() if a space is found in a short name. Robert From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 05:23:32 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BFD5106564A; Mon, 11 Jun 2012 05:23:32 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 564318FC0A; Mon, 11 Jun 2012 05:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5B5NW3L044508; Mon, 11 Jun 2012 05:23:32 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5B5NWQw044506; Mon, 11 Jun 2012 05:23:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206110523.q5B5NWQw044506@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 11 Jun 2012 05:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236869 - projects/altix2/sys/dev/ioc4 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 05:23:32 -0000 Author: marcel Date: Mon Jun 11 05:23:31 2012 New Revision: 236869 URL: http://svn.freebsd.org/changeset/base/236869 Log: Add the beginnings of ioc4(4), a puc(4)-like controller that combines 4 UARTs, an ATA controller, keyword/mouse controller and a few other goodies. Added: projects/altix2/sys/dev/ioc4/ projects/altix2/sys/dev/ioc4/ioc4.c (contents, props changed) projects/altix2/sys/dev/ioc4/ioc4_bus.h (contents, props changed) Added: projects/altix2/sys/dev/ioc4/ioc4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/altix2/sys/dev/ioc4/ioc4.c Mon Jun 11 05:23:31 2012 (r236869) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +struct ioc4_softc { + device_t sc_dev; + + struct resource *sc_mres; + int sc_mrid; + + int sc_irid; + struct resource *sc_ires; + void *sc_icookie; + + u_int sc_fastintr:1; +}; + +static int ioc4_probe(device_t dev); +static int ioc4_attach(device_t dev); +static int ioc4_detach(device_t dev); + +static char ioc4_name[] = "ioc"; +static devclass_t ioc4_devclass; + +static device_method_t ioc4_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ioc4_probe), + DEVMETHOD(device_attach, ioc4_attach), + DEVMETHOD(device_detach, ioc4_detach), + { 0, 0 } +}; + +static driver_t ioc4_driver = { + ioc4_name, + ioc4_methods, + sizeof(struct ioc4_softc), +}; + +static int +ioc4_intr(void *arg) +{ + struct ioc4_softc *sc = arg; + + device_printf(sc->sc_dev, "%s\n", __func__); + return (FILTER_HANDLED); +} + +static int +ioc4_probe(device_t dev) +{ + + if (pci_get_vendor(dev) != 0x10a9) + return (ENXIO); + if (pci_get_device(dev) != 0x100a) + return (ENXIO); + + device_set_desc(dev, "SGI IOC4 I/O controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +ioc4_attach(device_t dev) +{ + struct ioc4_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_mrid = PCIR_BAR(0); + sc->sc_mres = bus_alloc_resource_any(sc->sc_dev, SYS_RES_MEMORY, + &sc->sc_mrid, RF_ACTIVE); + if (sc->sc_mres == NULL) + return (ENXIO); + + sc->sc_irid = 0; + sc->sc_ires = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, + &sc->sc_irid, RF_ACTIVE|RF_SHAREABLE); + if (sc->sc_ires == NULL) { + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, + sc->sc_mres); + return (ENXIO); + } + + error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY, ioc4_intr, + NULL, sc, &sc->sc_icookie); + if (error) + error = bus_setup_intr(dev, sc->sc_ires, + INTR_TYPE_TTY | INTR_MPSAFE, NULL, + (driver_intr_t *)ioc4_intr, sc, &sc->sc_icookie); + else + sc->sc_fastintr = 1; + + if (error) { + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, sc->sc_irid, + sc->sc_ires); + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, + sc->sc_mres); + return (error); + } + + /* + * Create, probe and attach children + */ + + return (0); +} + +static int +ioc4_detach(device_t dev) +{ + struct ioc4_softc *sc; + + sc = device_get_softc(dev); + + /* + * Detach children and destroy children + */ + + bus_teardown_intr(sc->sc_dev, sc->sc_ires, sc->sc_icookie); + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, sc->sc_irid, + sc->sc_ires); + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, + sc->sc_mres); + return (0); +} + +DRIVER_MODULE(ioc4, pci, ioc4_driver, ioc4_devclass, 0, 0); Added: projects/altix2/sys/dev/ioc4/ioc4_bus.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/altix2/sys/dev/ioc4/ioc4_bus.h Mon Jun 11 05:23:31 2012 (r236869) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IOC4_BUS_H_ +#define _DEV_IOC4_BUS_H_ + +#define IOC4_IVAR_TYPE 1 + +#define IOC4_TYPE_NONE 0 +#define IOC4_TYPE_UART 1 + +#endif /* _DEV_IOC4_BUS_H_ */ From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 05:25:04 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE2C5106566B; Mon, 11 Jun 2012 05:25:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4B48FC14; Mon, 11 Jun 2012 05:25:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5B5P4cl044620; Mon, 11 Jun 2012 05:25:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5B5P4eP044618; Mon, 11 Jun 2012 05:25:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206110525.q5B5P4eP044618@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 11 Jun 2012 05:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236870 - projects/altix2/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 05:25:04 -0000 Author: marcel Date: Mon Jun 11 05:25:04 2012 New Revision: 236870 URL: http://svn.freebsd.org/changeset/base/236870 Log: Hook-up ioc4. Modified: projects/altix2/sys/conf/files.ia64 Modified: projects/altix2/sys/conf/files.ia64 ============================================================================== --- projects/altix2/sys/conf/files.ia64 Mon Jun 11 05:23:31 2012 (r236869) +++ projects/altix2/sys/conf/files.ia64 Mon Jun 11 05:25:04 2012 (r236870) @@ -56,6 +56,7 @@ dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc dev/io/iodev.c optional io +dev/ioc4/ioc4.c optional ioc4 dev/kbd/kbd.c optional atkbd | sc | ukbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 05:25:27 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D2321065670; Mon, 11 Jun 2012 05:25:27 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D47F98FC0C; Mon, 11 Jun 2012 05:25:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5B5PQSU044669; Mon, 11 Jun 2012 05:25:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5B5PQen044667; Mon, 11 Jun 2012 05:25:26 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206110525.q5B5PQen044667@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 11 Jun 2012 05:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236871 - projects/altix2/sys/ia64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 05:25:27 -0000 Author: marcel Date: Mon Jun 11 05:25:26 2012 New Revision: 236871 URL: http://svn.freebsd.org/changeset/base/236871 Log: Add ioc4. Modified: projects/altix2/sys/ia64/conf/ALTIX Modified: projects/altix2/sys/ia64/conf/ALTIX ============================================================================== --- projects/altix2/sys/ia64/conf/ALTIX Mon Jun 11 05:25:04 2012 (r236870) +++ projects/altix2/sys/ia64/conf/ALTIX Mon Jun 11 05:25:26 2012 (r236871) @@ -13,6 +13,7 @@ device bpf device da device ether device firmware +device ioc4 device isp device loop device md From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 16:35:48 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77E361065675; Mon, 11 Jun 2012 16:35:48 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59D3A8FC17; Mon, 11 Jun 2012 16:35:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5BGZmEd096390; Mon, 11 Jun 2012 16:35:48 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5BGZmDS096388; Mon, 11 Jun 2012 16:35:48 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206111635.q5BGZmDS096388@svn.freebsd.org> From: Davide Italiano Date: Mon, 11 Jun 2012 16:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236893 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 16:35:48 -0000 Author: davide Date: Mon Jun 11 16:35:47 2012 New Revision: 236893 URL: http://svn.freebsd.org/changeset/base/236893 Log: The cc_firsttick field in struct callout_cpu keeps track of the time at which the nearest event in future should be fired. In case we're adding an event which time associated is greater than cc_firsttick, there's no need to call callout_new_inserted. While here, fix a style indentation bug pointed out by Bruce Evans (bde@). Modified: projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Mon Jun 11 16:18:39 2012 (r236892) +++ projects/calloutng/sys/kern/kern_timeout.c Mon Jun 11 16:35:47 2012 (r236893) @@ -434,9 +434,9 @@ callout_tick(void) } if (next.sec == -1) next = limit; + cc->cc_firsttick = next; if (callout_new_inserted != NULL) - (*callout_new_inserted)(cpu, - next); + (*callout_new_inserted)(cpu, next); cc->cc_softticks = now; mtx_unlock_spin_flags(&cc->cc_lock, MTX_QUIET); /* @@ -496,9 +496,12 @@ callout_cc_add(struct callout *c, struct * Inform the eventtimers(4) subsystem there's a new callout * that has been inserted. */ - if (callout_new_inserted != NULL) - (*callout_new_inserted)(cpu, - to_bintime); + if (callout_new_inserted != NULL && + (bintime_cmp(&to_bintime, &cc->cc_firsttick, <) || + (cc->cc_firsttick.sec == 0 && cc->cc_firsttick.frac == 0))) { + cc->cc_firsttick = to_bintime; + (*callout_new_inserted)(cpu, to_bintime); + } } static void From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 17:17:29 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B5D106566C; Mon, 11 Jun 2012 17:17:29 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A6D8FC1B; Mon, 11 Jun 2012 17:17:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5BHHSdU098205; Mon, 11 Jun 2012 17:17:28 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5BHHSLr098202; Mon, 11 Jun 2012 17:17:28 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206111717.q5BHHSLr098202@svn.freebsd.org> From: Davide Italiano Date: Mon, 11 Jun 2012 17:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236894 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 17:17:29 -0000 Author: davide Date: Mon Jun 11 17:17:28 2012 New Revision: 236894 URL: http://svn.freebsd.org/changeset/base/236894 Log: CTR4 has four arguments but we need five, change it to CTR5. Modify some printed value to obtain more significant kernel traces. While here, Bruce Evans told me that "unsigned int" is spelled "u_int" in KNF, so replace it where needed. Discussed with: mav Modified: projects/calloutng/sys/kern/kern_clocksource.c projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_clocksource.c ============================================================================== --- projects/calloutng/sys/kern/kern_clocksource.c Mon Jun 11 16:35:47 2012 (r236893) +++ projects/calloutng/sys/kern/kern_clocksource.c Mon Jun 11 17:17:28 2012 (r236894) @@ -168,8 +168,8 @@ hardclockintr(void) state = DPCPU_PTR(timerstate); now = state->now; CTR4(KTR_SPARE2, "ipi at %d: now %d.%08x%08x", - curcpu, now.sec, (unsigned int)(now.frac >> 32), - (unsigned int)(now.frac & 0xffffffff)); + curcpu, now.sec, (u_int)(now.frac >> 32), + (u_int)(now.frac & 0xffffffff)); done = handleevents(&now, 0); return (done ? FILTER_HANDLED : FILTER_STRAY); } @@ -188,8 +188,8 @@ handleevents(struct bintime *now, int fa int done, runs; CTR4(KTR_SPARE2, "handle at %d: now %d.%08x%08x", - curcpu, now->sec, (unsigned int)(now->frac >> 32), - (unsigned int)(now->frac & 0xffffffff)); + curcpu, now->sec, (u_int)(now->frac >> 32), + (u_int)(now->frac & 0xffffffff)); done = 0; if (fake) { frame = NULL; @@ -339,8 +339,8 @@ getnextevent(struct bintime *event) *event = nexthard; } CTR5(KTR_SPARE2, "next at %d: next %d.%08x%08x by %d", - curcpu, event->sec, (unsigned int)(event->frac >> 32), - (unsigned int)(event->frac & 0xffffffff), c); + curcpu, event->sec, (u_int)(event->frac >> 32), + (u_int)(event->frac & 0xffffffff), c); } /* Hardware timer callback function. */ @@ -372,8 +372,8 @@ timercb(struct eventtimer *et, void *arg } state->now = now; CTR4(KTR_SPARE2, "intr at %d: now %d.%08x%08x", - curcpu, now.sec, (unsigned int)(now.frac >> 32), - (unsigned int)(now.frac & 0xffffffff)); + curcpu, (int)(now.sec), (u_int)(now.frac >> 32), + (u_int)(now.frac & 0xffffffff)); #ifdef SMP /* Prepare broadcasting to other CPUs for non-per-CPU timers. */ @@ -444,8 +444,8 @@ loadtimer(struct bintime *now, int start if (new.frac < tmp) /* Left less then passed. */ bintime_add(&new, &timerperiod); CTR5(KTR_SPARE2, "load p at %d: now %d.%08x first in %d.%08x", - curcpu, now->sec, (unsigned int)(now->frac >> 32), - new.sec, (unsigned int)(new.frac >> 32)); + curcpu, now->sec, (u_int)(now->frac >> 32), + new.sec, (u_int)(new.frac >> 32)); *next = new; bintime_add(next, now); et_start(timer, &new, &timerperiod); @@ -454,8 +454,8 @@ loadtimer(struct bintime *now, int start getnextevent(&new); eq = bintime_cmp(&new, next, ==); CTR5(KTR_SPARE2, "load at %d: next %d.%08x%08x eq %d", - curcpu, new.sec, (unsigned int)(new.frac >> 32), - (unsigned int)(new.frac & 0xffffffff), + curcpu, new.sec, (u_int)(new.frac >> 32), + (u_int)(new.frac & 0xffffffff), eq); if (!eq) { *next = new; @@ -788,8 +788,8 @@ cpu_idleclock(void) else binuptime(&now); CTR4(KTR_SPARE2, "idle at %d: now %d.%08x%08x", - curcpu, now.sec, (unsigned int)(now.frac >> 32), - (unsigned int)(now.frac & 0xffffffff)); + curcpu, now.sec, (u_int)(now.frac >> 32), + (u_int)(now.frac & 0xffffffff)); getnextcpuevent(&t, 1); ET_HW_LOCK(state); state->idle = 1; @@ -817,8 +817,8 @@ cpu_activeclock(void) else binuptime(&now); CTR4(KTR_SPARE2, "active at %d: now %d.%08x%08x", - curcpu, now.sec, (unsigned int)(now.frac >> 32), - (unsigned int)(now.frac & 0xffffffff)); + curcpu, now.sec, (u_int)(now.frac >> 32), + (u_int)(now.frac & 0xffffffff)); spinlock_enter(); td = curthread; td->td_intr_nesting_level++; @@ -841,11 +841,11 @@ clocksource_cyc_set(const struct bintime binuptime(&now); CTR4(KTR_SPARE2, "set_cyc at %d: now %d.%08x%08x", - curcpu, now.sec, (unsigned int)(now.frac >> 32), - (unsigned int)(now.frac & 0xffffffff)); + curcpu, now.sec, (u_int)(now.frac >> 32), + (u_int)(now.frac & 0xffffffff)); CTR4(KTR_SPARE2, "set_cyc at %d: t %d.%08x%08x", - curcpu, t->sec, (unsigned int)(t->frac >> 32), - (unsigned int)(t->frac & 0xffffffff)); + curcpu, t->sec, (u_int)(t->frac >> 32), + (u_int)(t->frac & 0xffffffff)); ET_HW_LOCK(state); if (bintime_cmp(t, &state->nextcyc, ==)) { @@ -870,9 +870,9 @@ cpu_new_callout(int cpu, struct bintime struct bintime now; struct pcpu_state *state; - CTR4(KTR_SPARE2, "new co at %d: on %d at %d.%08x%08x", - curcpu, cpu, (unsigned int)(bt.frac >> 32), - (unsigned int)(bt.frac & 0xffffffff)); + CTR5(KTR_SPARE2, "new co at %d: on %d at %d.%08x%08x", + curcpu, cpu, (int)(bt.sec), (u_int)(bt.frac >> 32), + (u_int)(bt.frac & 0xffffffff)); state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Mon Jun 11 16:35:47 2012 (r236893) +++ projects/calloutng/sys/kern/kern_timeout.c Mon Jun 11 17:17:28 2012 (r236894) @@ -896,8 +896,9 @@ callout_reset_bt_on(struct callout *c, s cc->cc_migration_arg = arg; c->c_flags |= CALLOUT_DFRMIGRATION; CTR6(KTR_CALLOUT, - "migration of %p func %p arg %p in %ld %ld to %u deferred", - c, c->c_func, c->c_arg, bt.sec, bt.frac, cpu); + "migration of %p func %p arg %p in %d.%08x to %u deferred", + c, c->c_func, c->c_arg, (int)(bt.sec), + (u_int)(bt.frac >> 32), cpu); CC_UNLOCK(cc); return (cancelled); } @@ -906,8 +907,9 @@ callout_reset_bt_on(struct callout *c, s #endif callout_cc_add(c, cc, bt, ftn, arg, cpu, direct); - CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %ld %ld", - cancelled ? "re" : "", c, c->c_func, c->c_arg, bt.sec, bt.frac); + CTR6(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d.%08x", + cancelled ? "re" : "", c, c->c_func, c->c_arg, (int)(bt.sec), + (u_int)(bt.frac >> 32)); CC_UNLOCK(cc); return (cancelled); From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 18:09:04 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A955C106566C; Mon, 11 Jun 2012 18:09:04 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A96A8FC0C; Mon, 11 Jun 2012 18:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5BI94hc001725; Mon, 11 Jun 2012 18:09:04 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5BI94hN001723; Mon, 11 Jun 2012 18:09:04 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201206111809.q5BI94hN001723@svn.freebsd.org> From: "Cherry G. Mathew" Date: Mon, 11 Jun 2012 18:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236902 - projects/amd64_xen_pv/sys/amd64/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 18:09:04 -0000 Author: cherry Date: Mon Jun 11 18:09:04 2012 New Revision: 236902 URL: http://svn.freebsd.org/changeset/base/236902 Log: Map in the console shared page, which the xen domU console driver uses to communicate with the hypervisor for console i/o. While at it, enable the boot to progress a bit more with temporary shims in pmap.c Approved by: gibbs (implicit) Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/pmap.c Mon Jun 11 18:02:30 2012 (r236901) +++ projects/amd64_xen_pv/sys/amd64/xen/pmap.c Mon Jun 11 18:09:04 2012 (r236902) @@ -129,8 +129,11 @@ __FBSDID("$FreeBSD$"); #endif #include +#include +#include #include #include +#include #include #include @@ -188,6 +191,7 @@ static vm_paddr_t ptmb_vtop(vm_offset_t } extern uint64_t xenstack; /* The stack Xen gives us at boot */ +extern char *console_page; /* The shared ring for console i/o */ /* return kernel virtual address of 'n' claimed physical pages at boot. */ static vm_offset_t @@ -198,6 +202,9 @@ vallocpages(vm_paddr_t *firstaddr, int n *firstaddr += n * PAGE_SIZE; /* Make sure we are still inside of available mapped va. */ + if (PTOV(*firstaddr) > (xenstack + 512 * 1024)) { + printk("Attempt to use unmapped va\n"); + } KASSERT(PTOV(*firstaddr) <= (xenstack + 512 * 1024), ("Attempt to use unmapped va\n")); return (ret); @@ -409,10 +416,9 @@ create_boot_pagetables(vm_paddr_t *first /* * - * Map in the xen provided shared pages. They are: - * - shared info page - * - console page (XXX:) - * - XXX: + * Map in the xen provided share page. Note: The console page is + * mapped in later in the boot process, when kmem_alloc*() is + * available. */ static void @@ -580,7 +586,7 @@ pmap_growkernel(vm_offset_t addr) int pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; vm_page_t m = vm_page_alloc(NULL, 0, pflags); KASSERT(m != NULL, ("Backing page alloc failed!")); - vm_paddr_t pa =m->phys_addr; + vm_paddr_t pa = VM_PAGE_TO_PHYS(m); pmap_kenter(addr, pa); } @@ -595,6 +601,15 @@ pmap_init(void) gdtset = 1; /* xpq may assert for locking sanity from this point onwards */ /* XXX: switch the mmu_map.c backend to something more sane */ + + /* Get a va for console and map the console mfn into it */ + vm_paddr_t console_ma = xen_start_info->console.domU.mfn << PAGE_SHIFT; + + vm_offset_t va = kmem_alloc_nofault(kernel_map, PAGE_SIZE); + KASSERT(va != 0, ("Could not allocate KVA for console page!\n")); + PT_SET_MA(va, console_ma | PG_RW | PG_V | PG_U); + + console_page = (void *)va; } void @@ -673,11 +688,36 @@ pmap_qremove(vm_offset_t sva, int count) KASSERT(0, ("XXX: TODO\n")); } +/* + * Insert the given physical page (p) at + * the specified virtual address (v) in the + * target physical map with the protection requested. + * + * If specified, the page will be wired down, meaning + * that the related pte can not be reclaimed. + * + * NB: This is the only routine which MAY NOT lazy-evaluate + * or lose information. That is, this routine must actually + * insert this page into the given map NOW. + */ + void pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired) { - KASSERT(0, ("XXX: TODO\n")); + va = trunc_page(va); + KASSERT(va <= VM_MAX_KERNEL_ADDRESS, ("pmap_enter: toobig")); + KASSERT(va < UPT_MIN_ADDRESS || va >= UPT_MAX_ADDRESS, + ("pmap_enter: invalid to pmap_enter page table pages (va: 0x%lx)", + va)); + KASSERT((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) != 0 || + VM_OBJECT_LOCKED(m->object), + ("pmap_enter: page %p is not busy", m)); + + pmap_kenter(va, VM_PAGE_TO_PHYS(m)); /* Shim to keep bootup + * happy for now */ + + /* XXX: TODO: */ } void @@ -760,7 +800,6 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p ptmb_ptov, ptmb_vtop }; - mmu_map_t_init(tptr, &mb); if (!mmu_map_inspect_va(kernel_pmap, tptr, va)) { @@ -867,7 +906,7 @@ pmap_zero_page(vm_page_t m) vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); /* XXX: temp fix, dmap not yet implemented. */ - pmap_kenter(va, m->phys_addr); + pmap_kenter(va, VM_PAGE_TO_PHYS(m)); pagezero((void *)va); } @@ -975,11 +1014,28 @@ pmap_sync_icache(pmap_t pm, vm_offset_t KASSERT(0, ("XXX: TODO\n")); } +/* + * Increase the starting virtual address of the given mapping if a + * different alignment might result in more superpage mappings. + */ void pmap_align_superpage(vm_object_t object, vm_ooffset_t offset, vm_offset_t *addr, vm_size_t size) { - KASSERT(0, ("XXX: TODO\n")); + vm_offset_t superpage_offset; + + if (size < NBPDR) + return; + if (object != NULL && (object->flags & OBJ_COLORED) != 0) + offset += ptoa(object->pg_color); + superpage_offset = offset & PDRMASK; + if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR || + (*addr & PDRMASK) == superpage_offset) + return; + if ((*addr & PDRMASK) < superpage_offset) + *addr = (*addr & ~PDRMASK) + superpage_offset; + else + *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } int From owner-svn-src-projects@FreeBSD.ORG Mon Jun 11 18:26:19 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 961AB106566B; Mon, 11 Jun 2012 18:26:19 +0000 (UTC) (envelope-from cherry@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808108FC1D; Mon, 11 Jun 2012 18:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5BIQJrP002590; Mon, 11 Jun 2012 18:26:19 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5BIQJ9B002587; Mon, 11 Jun 2012 18:26:19 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201206111826.q5BIQJ9B002587@svn.freebsd.org> From: "Cherry G. Mathew" Date: Mon, 11 Jun 2012 18:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236905 - projects/amd64_xen_pv/sys/amd64/xen X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 18:26:19 -0000 Author: cherry Date: Mon Jun 11 18:26:18 2012 New Revision: 236905 URL: http://svn.freebsd.org/changeset/base/236905 Log: Map in the console page using pmap_kenter(), since the backing table hierarchy is easiest setup this way. Approved by: gibbs(implicit) Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/pmap.c Mon Jun 11 18:22:04 2012 (r236904) +++ projects/amd64_xen_pv/sys/amd64/xen/pmap.c Mon Jun 11 18:26:18 2012 (r236905) @@ -607,8 +607,8 @@ pmap_init(void) vm_offset_t va = kmem_alloc_nofault(kernel_map, PAGE_SIZE); KASSERT(va != 0, ("Could not allocate KVA for console page!\n")); - PT_SET_MA(va, console_ma | PG_RW | PG_V | PG_U); + pmap_kenter(va, xpmap_mtop(console_ma)); console_page = (void *)va; } From owner-svn-src-projects@FreeBSD.ORG Tue Jun 12 03:22:19 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A6A81065670; Tue, 12 Jun 2012 03:22:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837028FC14; Tue, 12 Jun 2012 03:22:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5C3MJW8026813; Tue, 12 Jun 2012 03:22:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5C3MJF8026808; Tue, 12 Jun 2012 03:22:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206120322.q5C3MJF8026808@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 12 Jun 2012 03:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236940 - in projects/altix2/sys/dev: ata ioc4 uart X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 03:22:19 -0000 Author: marcel Date: Tue Jun 12 03:22:18 2012 New Revision: 236940 URL: http://svn.freebsd.org/changeset/base/236940 Log: Flesh-out ioc4 a bit more. In particular, add: o uart(4) bus attachment o ata(4) bus attachment This has been fleshed out enough to indicate that we still have a platform problem -- interrupts I suspect. Fixing that should allow me to make forward progress on the busdma code again. Added: projects/altix2/sys/dev/ata/ata-ioc4.c (contents, props changed) projects/altix2/sys/dev/ioc4/ioc4_reg.h (contents, props changed) projects/altix2/sys/dev/uart/uart_bus_ioc4.c (contents, props changed) Modified: projects/altix2/sys/dev/ioc4/ioc4.c projects/altix2/sys/dev/ioc4/ioc4_bus.h Added: projects/altix2/sys/dev/ata/ata-ioc4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/altix2/sys/dev/ata/ata-ioc4.c Tue Jun 12 03:22:18 2012 (r236940) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_ata.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "ata_if.h" + +static int ata_ioc4_probe(device_t); +static int ata_ioc4_attach(device_t); +static int ata_ioc4_detach(device_t); + +static device_method_t ata_ioc4_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, ata_ioc4_probe), + DEVMETHOD(device_attach, ata_ioc4_attach), + DEVMETHOD(device_detach, ata_ioc4_detach), + + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD_END +}; + +static driver_t ata_ioc4_driver = { + "ata", + ata_ioc4_methods, + sizeof(struct ata_channel), +}; + +DRIVER_MODULE(ata, ioc4, ata_ioc4_driver, ata_devclass, NULL, NULL); +MODULE_DEPEND(ata, ata, 1, 1, 1); + +static int +ata_ioc4_probe(device_t dev) +{ + device_t parent; + uintptr_t type; + + parent = device_get_parent(dev); + if (BUS_READ_IVAR(parent, dev, IOC4_IVAR_TYPE, &type)) + return (ENXIO); + if (type != IOC4_TYPE_ATA) + return (ENXIO); + + device_set_desc(dev, "SGI IOC4 ATA channel"); + return (ata_probe(dev)); +} + +static int +ata_ioc4_attach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + struct resource *mres; + int i, rid; + + if (ch->attached) + return (0); + ch->attached = 1; + + rid = 0; + mres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (mres == NULL) + return (ENXIO); + + for (i = ATA_DATA; i <= ATA_COMMAND; i++) { + ch->r_io[i].res = mres; + ch->r_io[i].offset = i << 2; + } + ch->r_io[ATA_CONTROL].res = mres; + ch->r_io[ATA_CONTROL].offset = 32; + ata_default_registers(dev); + + ch->unit = 0; + ata_generic_hw(dev); + return (ata_attach(dev)); +} + +int +ata_ioc4_detach(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + if (!ch->attached) + return (0); + ch->attached = 0; + + error = ata_detach(dev); + + bus_release_resource(dev, SYS_RES_MEMORY, 0, ch->r_io[ATA_CONTROL].res); + return (error); +} Modified: projects/altix2/sys/dev/ioc4/ioc4.c ============================================================================== --- projects/altix2/sys/dev/ioc4/ioc4.c Tue Jun 12 01:13:59 2012 (r236939) +++ projects/altix2/sys/dev/ioc4/ioc4.c Tue Jun 12 03:22:18 2012 (r236940) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -40,6 +41,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + +struct ioc4_softc; + +struct ioc4_child { + struct ioc4_softc *ch_softc; + device_t ch_dev; + struct resource *ch_ires; + struct resource *ch_mres; + u_int ch_type; + u_int ch_unit; +}; + struct ioc4_softc { device_t sc_dev; @@ -50,6 +65,8 @@ struct ioc4_softc { struct resource *sc_ires; void *sc_icookie; + struct rman sc_rm; + u_int sc_fastintr:1; }; @@ -57,7 +74,15 @@ static int ioc4_probe(device_t dev); static int ioc4_attach(device_t dev); static int ioc4_detach(device_t dev); -static char ioc4_name[] = "ioc"; +static int ioc4_bus_read_ivar(device_t, device_t, int, uintptr_t *); +static struct resource *ioc4_bus_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int ioc4_bus_release_resource(device_t, device_t, int, int, + struct resource *); +static int ioc4_bus_get_resource(device_t, device_t, int, int, u_long *, + u_long *); + +static char ioc4_name[] = "ioc4"; static devclass_t ioc4_devclass; static device_method_t ioc4_methods[] = { @@ -65,7 +90,15 @@ static device_method_t ioc4_methods[] = DEVMETHOD(device_probe, ioc4_probe), DEVMETHOD(device_attach, ioc4_attach), DEVMETHOD(device_detach, ioc4_detach), - { 0, 0 } + + DEVMETHOD(bus_alloc_resource, ioc4_bus_alloc_resource), + DEVMETHOD(bus_get_resource, ioc4_bus_get_resource), + DEVMETHOD(bus_read_ivar, ioc4_bus_read_ivar), + DEVMETHOD(bus_release_resource, ioc4_bus_release_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + + DEVMETHOD_END }; static driver_t ioc4_driver = { @@ -74,6 +107,7 @@ static driver_t ioc4_driver = { sizeof(struct ioc4_softc), }; +#if 0 static int ioc4_intr(void *arg) { @@ -82,6 +116,80 @@ ioc4_intr(void *arg) device_printf(sc->sc_dev, "%s\n", __func__); return (FILTER_HANDLED); } +#endif + +static int +ioc4_child_add(struct ioc4_softc *sc, u_int type, u_int unit) +{ + struct ioc4_child *ch; + bus_space_handle_t bsh; + bus_space_tag_t bst; + u_long base, ofs, len; + int error; + + ch = malloc(sizeof(*ch), M_DEVBUF, M_WAITOK | M_ZERO); + ch->ch_softc = sc; + ch->ch_type = type; + ch->ch_unit = unit; + + error = ENXIO; + + ch->ch_dev = device_add_child(sc->sc_dev, NULL, -1); + if (ch->ch_dev == NULL) + goto fail_free; + + error = ENOMEM; + + base = rman_get_start(sc->sc_mres); + + switch (type) { + case IOC4_TYPE_UART: + ofs = IOC4_UART_REG(unit); + len = IOC4_UART_REG_SIZE; + break; + case IOC4_TYPE_ATA: + ofs = IOC4_ATA_BASE; + len = IOC4_ATA_SIZE; + break; + default: + ofs = len = 0; + break; + } + if (len == 0 || ofs == 0) + goto fail_free; + + ch->ch_mres = rman_reserve_resource(&sc->sc_rm, base + ofs, + base + ofs + len - 1, len, 0, NULL); + if (ch->ch_mres == NULL) + goto fail_delete; + + ch->ch_ires = sc->sc_ires; + + bsh = rman_get_bushandle(sc->sc_mres); + bst = rman_get_bustag(sc->sc_mres); + bus_space_subregion(bst, bsh, ofs, len, &bsh); + rman_set_bushandle(ch->ch_mres, bsh); + rman_set_bustag(ch->ch_mres, bst); + + device_set_ivars(ch->ch_dev, (void *)ch); + + error = device_probe_and_attach(ch->ch_dev); + if (error) + goto fail_release; + + return (0); + + fail_release: + rman_release_resource(ch->ch_mres); + + fail_delete: + device_delete_child(sc->sc_dev, ch->ch_dev); + + fail_free: + free(ch, M_DEVBUF); + device_printf(sc->sc_dev, "%s: error=%d\n", __func__, error); + return (error); +} static int ioc4_probe(device_t dev) @@ -99,27 +207,28 @@ ioc4_probe(device_t dev) static int ioc4_attach(device_t dev) { + char descr[RM_TEXTLEN]; struct ioc4_softc *sc; int error; sc = device_get_softc(dev); sc->sc_dev = dev; + error = ENXIO; + sc->sc_mrid = PCIR_BAR(0); sc->sc_mres = bus_alloc_resource_any(sc->sc_dev, SYS_RES_MEMORY, &sc->sc_mrid, RF_ACTIVE); if (sc->sc_mres == NULL) - return (ENXIO); + goto fail_return; sc->sc_irid = 0; sc->sc_ires = bus_alloc_resource_any(sc->sc_dev, SYS_RES_IRQ, &sc->sc_irid, RF_ACTIVE|RF_SHAREABLE); - if (sc->sc_ires == NULL) { - bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, - sc->sc_mres); - return (ENXIO); - } + if (sc->sc_ires == NULL) + goto fail_rel_mres; +#if 0 error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY, ioc4_intr, NULL, sc, &sc->sc_icookie); if (error) @@ -129,19 +238,59 @@ ioc4_attach(device_t dev) else sc->sc_fastintr = 1; - if (error) { - bus_release_resource(sc->sc_dev, SYS_RES_IRQ, sc->sc_irid, - sc->sc_ires); - bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, - sc->sc_mres); - return (error); - } + if (error) + goto fail_rel_ires; +#endif + + sc->sc_rm.rm_type = RMAN_ARRAY; + error = rman_init(&sc->sc_rm); + if (error) + goto fail_teardown; + error = rman_manage_region(&sc->sc_rm, rman_get_start(sc->sc_mres), + rman_get_end(sc->sc_mres)); + if (error) + goto fail_teardown; + + snprintf(descr, sizeof(descr), "%s I/O memory", + device_get_nameunit(sc->sc_dev)); + sc->sc_rm.rm_descr = strdup(descr, M_DEVBUF); + + pci_enable_busmaster(sc->sc_dev); + + bus_write_4(sc->sc_mres, IOC4_CTL_CR, 0xf); + bus_write_4(sc->sc_mres, IOC4_CTL_GPIO_SET, 0xf0); + + bus_write_4(sc->sc_mres, IOC4_CTL_UART_INT_CLR, ~0U); + bus_write_4(sc->sc_mres, IOC4_CTL_UART_INT, ~0U); + + bus_write_4(sc->sc_mres, IOC4_CTL_MISC_INT_CLR, ~0U); + bus_write_4(sc->sc_mres, IOC4_CTL_MISC_INT, ~0U); /* * Create, probe and attach children */ +#if 0 + for (n = 0; n < 4; n++) + ioc4_child_add(sc, IOC4_TYPE_UART, n); +#endif + ioc4_child_add(sc, IOC4_TYPE_ATA, 0); return (0); + + fail_teardown: + bus_teardown_intr(sc->sc_dev, sc->sc_ires, sc->sc_icookie); + +#if 0 + fail_rel_ires: +#endif + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, sc->sc_irid, sc->sc_ires); + + fail_rel_mres: + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, sc->sc_mrid, + sc->sc_mres); + + fail_return: + return (error); } static int @@ -155,6 +304,9 @@ ioc4_detach(device_t dev) * Detach children and destroy children */ + free(__DECONST(void *, sc->sc_rm.rm_descr), M_DEVBUF); + rman_fini(&sc->sc_rm); + bus_teardown_intr(sc->sc_dev, sc->sc_ires, sc->sc_icookie); bus_release_resource(sc->sc_dev, SYS_RES_IRQ, sc->sc_irid, sc->sc_ires); @@ -163,4 +315,155 @@ ioc4_detach(device_t dev) return (0); } +static struct ioc4_child * +_ioc4_get_child(device_t dev, device_t child) +{ + struct ioc4_child *ch; + + /* Get our immediate child. */ + while (child != NULL && device_get_parent(child) != dev) + child = device_get_parent(child); + if (child == NULL) + return (NULL); + + ch = device_get_ivars(child); + KASSERT(ch != NULL, ("%s %d", __func__, __LINE__)); + return (ch); +} + +static int +ioc4_bus_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + struct ioc4_child *ch; + struct ioc4_softc *sc; + uint32_t pci; + + if (result == NULL) + return (EINVAL); + + ch = _ioc4_get_child(dev, child); + if (ch == NULL) + return (EINVAL); + + sc = ch->ch_softc; + + switch(index) { + case IOC4_IVAR_CLOCK: + pci = bus_read_4(sc->sc_mres, IOC4_CTL_PCI); + *result = (pci & 1) ? 66666667 : 33333333; + break; + case IOC4_IVAR_TYPE: + *result = ch->ch_type; + break; + default: + return (ENOENT); + } + return (0); +} + +static struct resource * +ioc4_bus_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct ioc4_child *ch; + struct resource *res; + device_t assigned; + int error; + + if (rid == NULL || *rid != 0) + return (NULL); + + /* We only support default allocations. */ + if (start != 0UL || end != ~0UL) + return (NULL); + + ch = _ioc4_get_child(dev, child); + if (ch == NULL) + return (NULL); + + if (type == SYS_RES_IRQ) + return (ch->ch_ires); + if (type != SYS_RES_MEMORY) + return (NULL); + + res = ch->ch_mres; + + assigned = rman_get_device(res); + if (assigned == NULL) /* Not allocated */ + rman_set_device(res, child); + else if (assigned != child) + return (NULL); + + if (flags & RF_ACTIVE) { + error = rman_activate_resource(res); + if (error) { + if (assigned == NULL) + rman_set_device(res, NULL); + res = NULL; + } + } + + return (res); +} + +static int +ioc4_bus_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *res) +{ + struct ioc4_child *ch; + + if (rid != 0 || res == NULL) + return (EINVAL); + + ch = _ioc4_get_child(dev, child); + if (ch == NULL) + return (EINVAL); + + if (type == SYS_RES_MEMORY) { + if (res != ch->ch_mres) + return (EINVAL); + } else if (type == SYS_RES_IRQ) { + if (res != ch->ch_ires) + return (EINVAL); + } else + return (EINVAL); + + if (rman_get_device(res) != child) + return (ENXIO); + if (rman_get_flags(res) & RF_ACTIVE) + rman_deactivate_resource(res); + rman_set_device(res, NULL); + return (0); +} + +static int +ioc4_bus_get_resource(device_t dev, device_t child, int type, int rid, + u_long *startp, u_long *countp) +{ + struct ioc4_child *ch; + struct resource *res; + u_long start; + + ch = _ioc4_get_child(dev, child); + if (ch == NULL) + return (EINVAL); + + if (type == SYS_RES_MEMORY) + res = ch->ch_mres; + else if (type == SYS_RES_IRQ) + res = ch->ch_ires; + else + return (ENXIO); + + if (rid != 0 || res == NULL) + return (ENXIO); + + start = rman_get_start(res); + if (startp != NULL) + *startp = start; + if (countp != NULL) + *countp = rman_get_end(res) - start + 1; + return (0); +} + DRIVER_MODULE(ioc4, pci, ioc4_driver, ioc4_devclass, 0, 0); Modified: projects/altix2/sys/dev/ioc4/ioc4_bus.h ============================================================================== --- projects/altix2/sys/dev/ioc4/ioc4_bus.h Tue Jun 12 01:13:59 2012 (r236939) +++ projects/altix2/sys/dev/ioc4/ioc4_bus.h Tue Jun 12 03:22:18 2012 (r236940) @@ -30,8 +30,10 @@ #define _DEV_IOC4_BUS_H_ #define IOC4_IVAR_TYPE 1 +#define IOC4_IVAR_CLOCK 2 #define IOC4_TYPE_NONE 0 #define IOC4_TYPE_UART 1 +#define IOC4_TYPE_ATA 2 #endif /* _DEV_IOC4_BUS_H_ */ Added: projects/altix2/sys/dev/ioc4/ioc4_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/altix2/sys/dev/ioc4/ioc4_reg.h Tue Jun 12 03:22:18 2012 (r236940) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_IOC4_REG_H_ +#define _DEV_IOC4_REG_H_ + +#define IOC4_CTL_ERR_LO 0x0000 +#define IOC4_CTL_ERR_HI 0x0004 +#define IOC4_CTL_UART_INT 0x0008 +#define IOC4_CTL_MISC_INT 0x000c +#define IOC4_CTL_UART_INT_SET 0x0010 +#define IOC4_CTL_MISC_INT_SET 0x0014 +#define IOC4_CTL_UART_INT_CLR 0x0018 +#define IOC4_CTL_MISC_INT_CLR 0x001c +#define IOC4_CTL_CR 0x0020 +#define IOC4_CTL_PCI 0x0024 +#define IOC4_CTL_EXTINT 0x0028 + +#define IOC4_CTL_GPIO_SET 0x0030 +#define IOC4_CTL_GPIO_CLR 0x0034 +#define IOC4_CTL_GPIO_DATA 0x0038 + +#define IOC4_GPIO_0 0x0040 +#define IOC4_GPIO_1 0x0044 +#define IOC4_GPIO_2 0x0048 +#define IOC4_GPIO_3 0x004C +#define IOC4_GPIO_4 0x0050 +#define IOC4_GPIO_5 0x0054 +#define IOC4_GPIO_6 0x0058 +#define IOC4_GPIO_7 0x005C + +#define IOC4_ATA_BASE 0x0100 +#define IOC4_ATA_SIZE 0x0100 + +#define IOC4_KBD_BASE 0x0200 +#define IOC4_KBD_SIZE 0x0020 + +#define IOC4_UART_BASE 0x0300 +#define IOC4_UART_SIZE 0x0100 + +#define IOC4_UART_DMA_SIZE (7 * 4) +#define IOC4_UART_DMA(x) (0x0310 + (x) * IOC4_UART_DMA_SIZE) +#define IOC4_UART_REG_SIZE 8 +#define IOC4_UART_REG(x) (0x0380 + (x) * IOC4_UART_REG_SIZE) + +#endif /* _DEV_IOC4_REG_H_ */ Added: projects/altix2/sys/dev/uart/uart_bus_ioc4.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/altix2/sys/dev/uart/uart_bus_ioc4.c Tue Jun 12 03:22:18 2012 (r236940) @@ -0,0 +1,90 @@ +/*- + * Copyright (c) 2012 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include + +static int uart_ioc4_probe(device_t dev); + +static device_method_t uart_ioc4_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, uart_ioc4_probe), + DEVMETHOD(device_attach, uart_bus_attach), + DEVMETHOD(device_detach, uart_bus_detach), + /* Serdev interface */ + DEVMETHOD(serdev_ihand, uart_bus_ihand), + DEVMETHOD(serdev_ipend, uart_bus_ipend), + { 0, 0 } +}; + +static driver_t uart_ioc4_driver = { + uart_driver_name, + uart_ioc4_methods, + sizeof(struct uart_softc), +}; + +static int +uart_ioc4_probe(device_t dev) +{ + device_t parent; + struct uart_softc *sc; + uintptr_t rclk, type; + + parent = device_get_parent(dev); + + if (BUS_READ_IVAR(parent, dev, IOC4_IVAR_TYPE, &type)) + return (ENXIO); + if (type != IOC4_TYPE_UART) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_class = &uart_ns8250_class; + + if (BUS_READ_IVAR(parent, dev, IOC4_IVAR_CLOCK, &rclk)) + rclk = 0; + return (uart_bus_probe(dev, 0, rclk, 0, 0)); +} + +DRIVER_MODULE(uart, ioc4, uart_ioc4_driver, uart_devclass, 0, 0); From owner-svn-src-projects@FreeBSD.ORG Tue Jun 12 03:24:38 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE01A1065670; Tue, 12 Jun 2012 03:24:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999EF8FC0A; Tue, 12 Jun 2012 03:24:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5C3OcRP026939; Tue, 12 Jun 2012 03:24:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5C3OcwK026937; Tue, 12 Jun 2012 03:24:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201206120324.q5C3OcwK026937@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 12 Jun 2012 03:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236941 - projects/altix2/sys/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 03:24:38 -0000 Author: marcel Date: Tue Jun 12 03:24:38 2012 New Revision: 236941 URL: http://svn.freebsd.org/changeset/base/236941 Log: Hook-up the uart(4) and ata(4) bus attachments. Modified: projects/altix2/sys/conf/files Modified: projects/altix2/sys/conf/files ============================================================================== --- projects/altix2/sys/conf/files Tue Jun 12 03:22:18 2012 (r236940) +++ projects/altix2/sys/conf/files Tue Jun 12 03:24:38 2012 (r236941) @@ -670,6 +670,7 @@ dev/ata/ata-queue.c optional ata | atac dev/ata/ata-sata.c optional ata | atacore dev/ata/ata-card.c optional ata pccard | atapccard dev/ata/ata-cbus.c optional ata pc98 | atapc98 +dev/ata/ata-ioc4.c optional ata ioc4 dev/ata/ata-isa.c optional ata isa | ataisa dev/ata/ata-pci.c optional ata pci | atapci dev/ata/chipsets/ata-ahci.c optional ata pci | ataahci | ataacerlabs | \ @@ -2028,6 +2029,7 @@ dev/uart/uart_bus_acpi.c optional uart a #dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_fdt.c optional uart fdt +dev/uart/uart_bus_ioc4.c optional uart ioc4 dev/uart/uart_bus_isa.c optional uart isa dev/uart/uart_bus_pccard.c optional uart pccard dev/uart/uart_bus_pci.c optional uart pci From owner-svn-src-projects@FreeBSD.ORG Tue Jun 12 04:26:00 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE75B1065672; Tue, 12 Jun 2012 04:26:00 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C93978FC12; Tue, 12 Jun 2012 04:26:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5C4Q0NC029515; Tue, 12 Jun 2012 04:26:00 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5C4Q05u029512; Tue, 12 Jun 2012 04:26:00 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206120426.q5C4Q05u029512@svn.freebsd.org> From: Mark Linimon Date: Tue, 12 Jun 2012 04:26:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236942 - projects/portbuild/www X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 04:26:01 -0000 Author: linimon (doc,ports committer) Date: Tue Jun 12 04:26:00 2012 New Revision: 236942 URL: http://svn.freebsd.org/changeset/base/236942 Log: 9-current is now 9-stable; 10 is -current. While here, remove some obsolete cruft. Modified: projects/portbuild/www/index.html Modified: projects/portbuild/www/index.html ============================================================================== --- projects/portbuild/www/index.html Tue Jun 12 03:24:38 2012 (r236941) +++ projects/portbuild/www/index.html Tue Jun 12 04:26:00 2012 (r236942) @@ -68,13 +68,20 @@ failures on 8.x-stable: sparc64
* New build -failures on 9.x-current: +failures on 9.x-stable: amd64 i386 ia64 powerpc sparc64
+* New build +failures on 10.x-current: +amd64 +i386 +ia64 +powerpc +sparc64
* New build failures on 7.x-stable with experimental port patches: amd64 @@ -84,10 +91,14 @@ failures on 9.x-current: amd64 i386
-* New build failures on 9.x-current with experimental port patches: +* New build failures on 9.x-stable with experimental port patches: amd64 i386
+* New build failures on 10.x-current with experimental port patches: +amd64 +i386 +
@@ -128,7 +139,7 @@ on 8.x-stable: sparc64
* Previous run -on 9.x-current: +on 9.x-stable: amd64 i386 ia64 @@ -136,13 +147,28 @@ on 9.x-current: sparc64
* Current run -on 9.x-current: +on 9.x-stable: amd64 i386 ia64 powerpc sparc64
+* Previous run +on 10.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+* Current run +on 10.x-current: +amd64 +i386 +ia64 +powerpc +sparc64
* Previous run on 7.x-stable with experimental port patches: @@ -165,14 +191,24 @@ on 8.x-stable with experimental port pat i386
* Previous run -on 9.x-current with experimental port patches: +on 9.x-stable with experimental port patches: amd64 i386
* Current run -on 9.x-current with experimental port patches: +on 9.x-stable with experimental port patches: amd64 i386 +
+* Previous run +on 10.x-current with experimental port patches: +amd64 +i386 +
+* Current run +on 10.x-current with experimental port patches: +amd64 +i386 @@ -213,7 +249,7 @@ on 8.x-stable: sparc64
*Previous run -on 9.x-current: +on 9.x-stable: amd64 i386 ia64 @@ -221,13 +257,28 @@ on 9.x-current: sparc64
*Current run on -9.x-current: +9.x-stable: amd64 i386 ia64 powerpc sparc64
+*Previous run +on 10.x-current: +amd64 +i386 +ia64 +powerpc +sparc64 +
+*Current run on +10.x-current: +amd64 +i386 +ia64 +powerpc +sparc64
*Previous run on 7.x-stable with experimental port patches: @@ -250,15 +301,25 @@ on 8.x-stable with experimental port pat i386
*Previous run -on 9.x-current with experimental port patches: +on 9.x-stable with experimental port patches: amd64 i386
*Current run on -9.x-current with experimental port patches: +9.x-stable with experimental port patches: amd64 i386
+*Previous run +on 10.x-current with experimental port patches: +amd64 +i386 +
+*Current run on +10.x-current with experimental port patches: +amd64 +i386 +
@@ -290,13 +351,21 @@ latest run on 8-stable: sparc64
* Packages from -latest run on 9-current: +latest run on 9-stable: amd64 i386 ia64 powerpc sparc64
+* Packages from +latest run on 10-current: +amd64 +i386 +ia64 +powerpc +sparc64 +

* Package building statistics (current state of all package builds) @@ -346,13 +415,6 @@ put on a CDROM.

  • Every port is built in its own chroot environment - , starting with an empty /usr/local and /usr/X11R6. The dependencies are installed as packages just before @@ -980,9 +1042,6 @@ longer sufficient in XFree86-4.
    The ports page | Maintained by portmgr@FreeBSD.org -| Last modified -
    -$FreeBSD: ports/Tools/portbuild/errorlogs/index.shtml,v 1.18 2011/03/08 22:03:18 linimon Exp $
    From owner-svn-src-projects@FreeBSD.ORG Tue Jun 12 04:58:53 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85DF1106566B; Tue, 12 Jun 2012 04:58:53 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 716908FC14; Tue, 12 Jun 2012 04:58:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5C4wrmE030853; Tue, 12 Jun 2012 04:58:53 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5C4wrXq030851; Tue, 12 Jun 2012 04:58:53 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206120458.q5C4wrXq030851@svn.freebsd.org> From: Mark Linimon Date: Tue, 12 Jun 2012 04:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236943 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 04:58:53 -0000 Author: linimon (doc,ports committer) Date: Tue Jun 12 04:58:52 2012 New Revision: 236943 URL: http://svn.freebsd.org/changeset/base/236943 Log: Attempt to add arm. Fix powerpc name. Modified: projects/portbuild/scripts/zbackup Modified: projects/portbuild/scripts/zbackup ============================================================================== --- projects/portbuild/scripts/zbackup Tue Jun 12 04:26:00 2012 (r236942) +++ projects/portbuild/scripts/zbackup Tue Jun 12 04:58:52 2012 (r236943) @@ -13,8 +13,8 @@ import zfs # List of filesystems to backup # XXX MCL backuplist=["a", "a/nfs", "a/local", "a/portbuild", - "a/portbuild/amd64", "a/portbuild/i386", - "a/portbuild/ia64", "a/portbuild/powerprc", + "a/portbuild/amd64", "a/portbuild/arm", "a/portbuild/i386", + "a/portbuild/ia64", "a/portbuild/powerpc", "a/portbuild/sparc64"] # Directory to store backups From owner-svn-src-projects@FreeBSD.ORG Wed Jun 13 20:14:41 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C40FE106564A; Wed, 13 Jun 2012 20:14:41 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id AE78F8FC0A; Wed, 13 Jun 2012 20:14:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5DKEfWs046158; Wed, 13 Jun 2012 20:14:41 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5DKEftk046155; Wed, 13 Jun 2012 20:14:41 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201206132014.q5DKEftk046155@svn.freebsd.org> From: Damjan Marion Date: Wed, 13 Jun 2012 20:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237020 - in projects/armv6/sys: arm/ti/am335x boot/fdt/dts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 20:14:41 -0000 Author: dmarion Date: Wed Jun 13 20:14:41 2012 New Revision: 237020 URL: http://svn.freebsd.org/changeset/base/237020 Log: Few changes in AM335x/beaglebone padconf: - added padconf to gpio mapping functions - renamed pad states - added more padmux definitions With this changes gpioctl(8) can be used for controlling gpios. Following example toggles LED1 (bank 1 pin 21) on beaglebone: gpioctl -f /dev/gpioc0 -c 53 OUT gpioctl -f /dev/gpioc0 -t 53 Modified: projects/armv6/sys/arm/ti/am335x/am335x_scm_padconf.c projects/armv6/sys/boot/fdt/dts/beaglebone.dts Modified: projects/armv6/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- projects/armv6/sys/arm/ti/am335x/am335x_scm_padconf.c Wed Jun 13 19:53:29 2012 (r237019) +++ projects/armv6/sys/arm/ti/am335x/am335x_scm_padconf.c Wed Jun 13 20:14:41 2012 (r237020) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -65,16 +66,22 @@ __FBSDID("$FreeBSD$"); #define SLEWCTRL (0x01 << 6) /* faster(0) or slower(1) slew rate. */ #define RXACTIVE (0x01 << 5) /* Input enable value for the Pad */ #define PULLTYPESEL (0x01 << 4) /* Pad pullup/pulldown type selection */ -#define PULLUDEN (0x01 << 3) /* Pullup/pulldown enabled */ +#define PULLUDEN (0x01 << 3) /* Pullup/pulldown disabled */ + +#define PADCONF_OUTPUT (0) +#define PADCONF_OUTPUT_PULLUP (PULLTYPESEL) +#define PADCONF_INPUT (RXACTIVE | PULLUDEN) +#define PADCONF_INPUT_PULLUP (RXACTIVE | PULLTYPESEL) +#define PADCONF_INPUT_PULLDOWN (RXACTIVE) +#define PADCONF_INPUT_PULLUP_SLOW (PADCONF_INPUT_PULLUP | SLEWCTRL) const struct ti_scm_padstate ti_padstate_devmap[] = { - {"output", 0 }, - {"output_pullup", PULLTYPESEL }, - {"input", RXACTIVE }, - {"input_pulldown", RXACTIVE | PULLUDEN }, - {"input_pullup", RXACTIVE | PULLUDEN | PULLTYPESEL }, - {"input_pullup_inact", RXACTIVE | PULLTYPESEL }, - {"input_pullup_inact_slow", RXACTIVE | PULLTYPESEL | SLEWCTRL }, + {"output", PADCONF_OUTPUT }, + {"output_pullup", PADCONF_OUTPUT_PULLUP }, + {"input", PADCONF_INPUT }, + {"input_pulldown", PADCONF_INPUT_PULLDOWN }, + {"input_pullup", PADCONF_INPUT_PULLUP }, + {"i2c", PADCONF_INPUT_PULLUP_SLOW }, { .state = NULL } }; @@ -101,10 +108,12 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x848, "gpmc_a2", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x84C, "gpmc_a3", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x850, "gpmc_a4", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x854, "gpmc_a5", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x858, "gpmc_a6", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x85C, "gpmc_a7", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x860, "gpmc_a8", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +#endif + _PIN(0x854, "GPMC_A5", 53, 7, "gpmc_a5", "gmii2_txd0", "rgmii2_td0", "rmii2_txd0", "gpmc_a21", "pr1_mii1_rxd3", "eQEP1B_in", "gpio1_21"), + _PIN(0x858, "GPMC_A6", 54, 7, "gpmc_a6", "gmii2_txclk", "rgmii2_tclk", "mmc2_dat4", "gpmc_a22", "pr1_mii1_rxd2", "eQEP1_index", "gpio1_22"), + _PIN(0x85C, "GPMC_A7", 55, 7, "gpmc_a7", "gmii2_rxclk", "rgmii2_rclk", "mmc2_dat5", "gpmc_a23", "pr1_mii1_rxd1", "eQEP1_strobe", "gpio1_23"), + _PIN(0x860, "GPMC_A8", 56, 7, "gpmc_a8", "gmii2_rxd3", "rgmii2_rd3", "mmc2_dat6", "gpmc_a24", "pr1_mii1_rxd0", "mcasp0_aclkx", "gpio1_24"), +#if 0 _PIN(0x864, "gpmc_a9", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x868, "gpmc_a10", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x86C, "gpmc_a11", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), @@ -178,8 +187,10 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x96c, "uart0_rtsn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x970, "uart0_rxd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x974, "uart0_txd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x978, "uart1_ctsn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - _PIN(0x97c, "uart1_rtsn", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +#endif + _PIN(0x978, "uart1_ctsn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), + _PIN(0x97c, "uart1_rtsn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), +#if 0 _PIN(0x980, "uart1_rxd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), _PIN(0x984, "uart1_txd", 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), #endif @@ -313,13 +324,50 @@ const struct ti_scm_device ti_scm_dev = int ti_scm_padconf_set_gpioflags(uint32_t gpio, uint32_t flags) { - /* TODO */ - return (EINVAL); + unsigned int state = 0; + if (flags & GPIO_PIN_OUTPUT) { + if (flags & GPIO_PIN_PULLUP) + state = PADCONF_OUTPUT_PULLUP; + else + state = PADCONF_OUTPUT; + } else if (flags & GPIO_PIN_INPUT) { + if (flags & GPIO_PIN_PULLUP) + state = PADCONF_INPUT_PULLUP; + else if (flags & GPIO_PIN_PULLDOWN) + state = PADCONF_INPUT_PULLDOWN; + else + state = PADCONF_INPUT; + } + return ti_scm_padconf_set_gpiomode(gpio, state); } void ti_scm_padconf_get_gpioflags(uint32_t gpio, uint32_t *flags) { - /* TODO */ + unsigned int state; + if (ti_scm_padconf_get_gpiomode(gpio, &state) != 0) + *flags = 0; + else { + switch (state) { + case PADCONF_OUTPUT: + *flags = GPIO_PIN_OUTPUT; + break; + case PADCONF_OUTPUT_PULLUP: + *flags = GPIO_PIN_OUTPUT | GPIO_PIN_PULLUP; + break; + case PADCONF_INPUT: + *flags = GPIO_PIN_INPUT; + break; + case PADCONF_INPUT_PULLUP: + *flags = GPIO_PIN_INPUT | GPIO_PIN_PULLUP; + break; + case PADCONF_INPUT_PULLDOWN: + *flags = GPIO_PIN_INPUT | GPIO_PIN_PULLDOWN; + break; + default: + *flags = 0; + break; + } + } } Modified: projects/armv6/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- projects/armv6/sys/boot/fdt/dts/beaglebone.dts Wed Jun 13 19:53:29 2012 (r237019) +++ projects/armv6/sys/boot/fdt/dts/beaglebone.dts Wed Jun 13 20:14:41 2012 (r237020) @@ -65,31 +65,31 @@ /* Set of triplets < padname, muxname, padstate> */ scm-pad-config = /* I2C0 */ - "I2C0_SDA", "I2C0_SDA","input_pullup_inact_slow", - "I2C0_SCL", "I2C0_SCL","input_pullup_inact_slow", + "I2C0_SDA", "I2C0_SDA","i2c", + "I2C0_SCL", "I2C0_SCL","i2c", /* Ethernet */ - "MII1_RX_ER", "gmii1_rxerr", "input", + "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", "MII1_TX_EN", "gmii1_txen", "output", - "MII1_RX_DV", "gmii1_rxdv", "input", + "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", "MII1_TXD3", "gmii1_txd3", "output", "MII1_TXD2", "gmii1_txd2", "output", "MII1_TXD1", "gmii1_txd1", "output", "MII1_TXD0", "gmii1_txd0", "output", - "MII1_TX_CLK", "gmii1_txclk", "input", - "MII1_RX_CLK", "gmii1_rxclk", "input", - "MII1_RXD3", "gmii1_rxd3", "input", - "MII1_RXD2", "gmii1_rxd2", "input", - "MII1_RXD1", "gmii1_rxd1", "input", - "MII1_RXD0", "gmii1_rxd0", "input", - "MDIO", "mdio_data", "input_pullup_inact", + "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", + "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", + "MII1_RXD3", "gmii1_rxd3", "input_pulldown", + "MII1_RXD2", "gmii1_rxd2", "input_pulldown", + "MII1_RXD1", "gmii1_rxd1", "input_pulldown", + "MII1_RXD0", "gmii1_rxd0", "input_pulldown", + "MDIO", "mdio_data", "input_pullup", "MDC", "mdio_clk", "output_pullup", /* MMCSD0 */ - "MMC0_CMD", "mmc0_cmd", "input_pullup_inact", - "MMC0_CLK", "mmc0_clk", "input_pullup_inact", - "MMC0_DAT0", "mmc0_dat0", "input_pullup_inact", - "MMC0_DAT1", "mmc0_dat1", "input_pullup_inact", - "MMC0_DAT2", "mmc0_dat2", "input_pullup_inact", - "MMC0_DAT3", "mmc0_dat3", "input_pullup_inact"; + "MMC0_CMD", "mmc0_cmd", "input_pullup", + "MMC0_CLK", "mmc0_clk", "input_pullup", + "MMC0_DAT0", "mmc0_dat0", "input_pullup", + "MMC0_DAT1", "mmc0_dat1", "input_pullup", + "MMC0_DAT2", "mmc0_dat2", "input_pullup", + "MMC0_DAT3", "mmc0_dat3", "input_pullup"; }; prcm@44E00000 { From owner-svn-src-projects@FreeBSD.ORG Wed Jun 13 20:30:26 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECEA91065766; Wed, 13 Jun 2012 20:30:25 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D853B8FC16; Wed, 13 Jun 2012 20:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5DKUPLK046928; Wed, 13 Jun 2012 20:30:25 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5DKUPrM046926; Wed, 13 Jun 2012 20:30:25 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201206132030.q5DKUPrM046926@svn.freebsd.org> From: Damjan Marion Date: Wed, 13 Jun 2012 20:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237022 - projects/armv6/sys/arm/ti/am335x X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 20:30:26 -0000 Author: dmarion Date: Wed Jun 13 20:30:25 2012 New Revision: 237022 URL: http://svn.freebsd.org/changeset/base/237022 Log: AM335x GPIO mode requires a bit different clock activation Modified: projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Modified: projects/armv6/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Wed Jun 13 20:21:08 2012 (r237021) +++ projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Wed Jun 13 20:30:25 2012 (r237022) @@ -118,6 +118,7 @@ static struct resource_spec am335x_prcm_ static struct am335x_prcm_softc *am335x_prcm_sc = NULL; static int am335x_clk_generic_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_gpio_activate(struct ti_clock_dev *clkdev); static int am335x_clk_generic_deactivate(struct ti_clock_dev *clkdev); static int am335x_clk_generic_set_source(struct ti_clock_dev *clkdev, clk_src_t clksrc); static int am335x_clk_hsmmc_get_source_freq(struct ti_clock_dev *clkdev, unsigned int *freq); @@ -136,6 +137,15 @@ static int am335x_clk_musb0_activate(str .clk_get_source_freq = NULL \ } +#define AM335X_GPIO_CLOCK_DEV(i) \ + { .id = (i), \ + .clk_activate = am335x_clk_gpio_activate, \ + .clk_deactivate = am335x_clk_generic_deactivate, \ + .clk_set_source = am335x_clk_generic_set_source, \ + .clk_accessible = NULL, \ + .clk_get_source_freq = NULL \ + } + #define AM335X_MMCHS_CLOCK_DEV(i) \ { .id = (i), \ .clk_activate = am335x_clk_generic_activate, \ @@ -189,10 +199,10 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_GENERIC_CLOCK_DEV(DMTIMER7_CLK), /* GPIO */ - AM335X_GENERIC_CLOCK_DEV(GPIO0_CLK), - AM335X_GENERIC_CLOCK_DEV(GPIO1_CLK), - AM335X_GENERIC_CLOCK_DEV(GPIO2_CLK), - AM335X_GENERIC_CLOCK_DEV(GPIO3_CLK), + AM335X_GPIO_CLOCK_DEV(GPIO0_CLK), + AM335X_GPIO_CLOCK_DEV(GPIO1_CLK), + AM335X_GPIO_CLOCK_DEV(GPIO2_CLK), + AM335X_GPIO_CLOCK_DEV(GPIO3_CLK), /* I2C */ AM335X_GENERIC_CLOCK_DEV(I2C0_CLK), @@ -361,6 +371,30 @@ am335x_clk_generic_activate(struct ti_cl } static int +am335x_clk_gpio_activate(struct ti_clock_dev *clkdev) +{ + struct am335x_prcm_softc *sc = am335x_prcm_sc; + struct am335x_clk_details* clk_details; + + if (sc == NULL) + return ENXIO; + + clk_details = am335x_clk_details(clkdev->id); + + if (clk_details == NULL) + return (ENXIO); + + /* set *_CLKCTRL register MODULEMODE[1:0] to enable(2) */ + /* set *_CLKCTRL register OPTFCLKEN_GPIO_1_G DBCLK[18] to FCLK_EN(1) */ + prcm_write_4(clk_details->clkctrl_reg, 2 | (1 << 18)); + while ((prcm_read_4(clk_details->clkctrl_reg) & (3 | (1 << 18) )) != (2 | (1 << 18))) + DELAY(10); + + printf("%s: reg=0x%08x val=0x%08x\n",__func__, clk_details->clkctrl_reg, prcm_read_4(clk_details->clkctrl_reg) ); + return (0); +} + +static int am335x_clk_generic_deactivate(struct ti_clock_dev *clkdev) { struct am335x_prcm_softc *sc = am335x_prcm_sc; From owner-svn-src-projects@FreeBSD.ORG Wed Jun 13 20:44:00 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58EE71065673; Wed, 13 Jun 2012 20:44:00 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 44DAF8FC27; Wed, 13 Jun 2012 20:44:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5DKi0r9047704; Wed, 13 Jun 2012 20:44:00 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5DKi0P4047702; Wed, 13 Jun 2012 20:44:00 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201206132044.q5DKi0P4047702@svn.freebsd.org> From: Damjan Marion Date: Wed, 13 Jun 2012 20:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237026 - projects/armv6/sys/arm/ti/am335x X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 20:44:00 -0000 Author: dmarion Date: Wed Jun 13 20:43:59 2012 New Revision: 237026 URL: http://svn.freebsd.org/changeset/base/237026 Log: remove debug printf Modified: projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Modified: projects/armv6/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Wed Jun 13 20:41:45 2012 (r237025) +++ projects/armv6/sys/arm/ti/am335x/am335x_prcm.c Wed Jun 13 20:43:59 2012 (r237026) @@ -387,10 +387,10 @@ am335x_clk_gpio_activate(struct ti_clock /* set *_CLKCTRL register MODULEMODE[1:0] to enable(2) */ /* set *_CLKCTRL register OPTFCLKEN_GPIO_1_G DBCLK[18] to FCLK_EN(1) */ prcm_write_4(clk_details->clkctrl_reg, 2 | (1 << 18)); - while ((prcm_read_4(clk_details->clkctrl_reg) & (3 | (1 << 18) )) != (2 | (1 << 18))) + while ((prcm_read_4(clk_details->clkctrl_reg) & + (3 | (1 << 18) )) != (2 | (1 << 18))) DELAY(10); - printf("%s: reg=0x%08x val=0x%08x\n",__func__, clk_details->clkctrl_reg, prcm_read_4(clk_details->clkctrl_reg) ); return (0); } From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 13:55:53 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EDDF1065674; Thu, 14 Jun 2012 13:55:53 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE268FC15; Thu, 14 Jun 2012 13:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EDtq80098159; Thu, 14 Jun 2012 13:55:52 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5EDtqCE098157; Thu, 14 Jun 2012 13:55:52 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206141355.q5EDtqCE098157@svn.freebsd.org> From: Davide Italiano Date: Thu, 14 Jun 2012 13:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237067 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 13:55:53 -0000 Author: davide Date: Thu Jun 14 13:55:52 2012 New Revision: 237067 URL: http://svn.freebsd.org/changeset/base/237067 Log: The second argument of sleepq_timedwait_sig() is priority and it does not concern signal caught in previous calls as I thought and the manpage says. Fix kern_nanosleep() accordingly. Reported by: bde Reviewed by: bde Modified: projects/calloutng/sys/kern/kern_time.c Modified: projects/calloutng/sys/kern/kern_time.c ============================================================================== --- projects/calloutng/sys/kern/kern_time.c Thu Jun 14 12:43:37 2012 (r237066) +++ projects/calloutng/sys/kern/kern_time.c Thu Jun 14 13:55:52 2012 (r237067) @@ -355,7 +355,7 @@ kern_nanosleep(struct thread *td, struct { struct timespec ts; struct bintime bt, bt2, tmp; - int catch = 0, error; + int error; if (rqt->tv_nsec < 0 || rqt->tv_nsec >= 1000000000) return (EINVAL); @@ -368,22 +368,20 @@ kern_nanosleep(struct thread *td, struct sleepq_lock(&nanowait); sleepq_add(&nanowait, NULL, "nanslp", PWAIT | PCATCH, 0); sleepq_set_timeout_bt(&nanowait,bt); - error = sleepq_timedwait_sig(&nanowait,catch); + error = sleepq_timedwait_sig(&nanowait, PWAIT | PCATCH); binuptime(&bt2); - if (catch) { - if (error != EWOULDBLOCK) { - if (error == ERESTART) - error = EINTR; - if (rmt != NULL) { - tmp = bt; - bintime_sub(&tmp, &bt2); - bintime2timespec(&tmp,&ts); - if (ts.tv_sec < 0) - timespecclear(&ts); - *rmt = ts; - } - return (error); + if (error != EWOULDBLOCK) { + if (error == ERESTART) + error = EINTR; + if (rmt != NULL) { + tmp = bt; + bintime_sub(&tmp, &bt2); + bintime2timespec(&tmp, &ts); + if (ts.tv_sec < 0) + timespecclear(&ts); + *rmt = ts; } + return (error); } if (bintime_cmp(&bt2, &bt, >=)) return (0); From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 14:01:54 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D9B11065670; Thu, 14 Jun 2012 14:01:54 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 899B38FC12; Thu, 14 Jun 2012 14:01:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EE1soq098480; Thu, 14 Jun 2012 14:01:54 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5EE1sfn098478; Thu, 14 Jun 2012 14:01:54 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206141401.q5EE1sfn098478@svn.freebsd.org> From: Davide Italiano Date: Thu, 14 Jun 2012 14:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237068 - projects/calloutng/lib/libprocstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 14:01:54 -0000 Author: davide Date: Thu Jun 14 14:01:54 2012 New Revision: 237068 URL: http://svn.freebsd.org/changeset/base/237068 Log: Fix (or at least, workaround) an include conflict in libprocstat which causes buildworld to fail, after my recent changes to sys/sys/_callout.h header. Reviewed by: stas Modified: projects/calloutng/lib/libprocstat/zfs.c Modified: projects/calloutng/lib/libprocstat/zfs.c ============================================================================== --- projects/calloutng/lib/libprocstat/zfs.c Thu Jun 14 13:55:52 2012 (r237067) +++ projects/calloutng/lib/libprocstat/zfs.c Thu Jun 14 14:01:54 2012 (r237068) @@ -35,6 +35,7 @@ #undef lbolt #undef lbolt64 +#undef gethrestime #undef gethrestime_sec #include #include From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 14:05:35 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CD2106566C for ; Thu, 14 Jun 2012 14:05:35 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id B90AA8FC0C for ; Thu, 14 Jun 2012 14:05:34 +0000 (UTC) Received: (qmail 77452 invoked from network); 14 Jun 2012 16:02:30 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Jun 2012 16:02:30 -0000 Message-ID: <4FD9EFA3.3060904@freebsd.org> Date: Thu, 14 Jun 2012 16:05:23 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Davide Italiano References: <201206141355.q5EDtqCE098157@svn.freebsd.org> In-Reply-To: <201206141355.q5EDtqCE098157@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237067 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 14:05:35 -0000 On 14.06.2012 15:55, Davide Italiano wrote: > Author: davide > Date: Thu Jun 14 13:55:52 2012 > New Revision: 237067 > URL: http://svn.freebsd.org/changeset/base/237067 > > Log: > The second argument of sleepq_timedwait_sig() is priority and it does not > concern signal caught in previous calls as I thought and the manpage says. Are you going to fix the man page as well? -- Andre From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 14:15:06 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EFDB106564A; Thu, 14 Jun 2012 14:15:06 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1F88B8FC0A; Thu, 14 Jun 2012 14:15:06 +0000 (UTC) Received: by vcbfy7 with SMTP id fy7so1274327vcb.13 for ; Thu, 14 Jun 2012 07:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=xyGyRtoWAlPP89pSt5A+OZUsyxHsqdMRIi3hET6cKSU=; b=sWk2HW4wfezuGlJwC69R1qkKdv097UwyujObJ0RIDx7qjp4BhBWDpgqa9vl4QMQsBc NWJ1FUvl+Ly43XDPVu/583GcZhY1zI+oY/AtVmfTFpYypr8Pqq5GDNVNctaLMCxJLPZv e46qvRbEgwLytENXMd4M2e2y/e60UxKIIPGqu3jEyM8rorJdHorEDJbOARDY83mjbArH X+QgxUcYoC7ZcTi184OfjK2UKFQv3kj9yMbltytJ1janY6KFF1b1TXVC4yZoMO0zjHm+ cDecJ9ZkdYq9vn5hnwiajR8aszgjvsHvJjXLA6ivtFZZYTRJNOXXxtQOsjZn4NbCbrBk GSgA== MIME-Version: 1.0 Received: by 10.52.33.100 with SMTP id q4mr949872vdi.59.1339683305063; Thu, 14 Jun 2012 07:15:05 -0700 (PDT) Received: by 10.52.28.132 with HTTP; Thu, 14 Jun 2012 07:15:05 -0700 (PDT) In-Reply-To: <4FD9EFA3.3060904@freebsd.org> References: <201206141355.q5EDtqCE098157@svn.freebsd.org> <4FD9EFA3.3060904@freebsd.org> Date: Thu, 14 Jun 2012 16:15:05 +0200 Message-ID: From: Davide Italiano To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237067 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 14:15:06 -0000 On Thu, Jun 14, 2012 at 4:05 PM, Andre Oppermann wrote: > On 14.06.2012 15:55, Davide Italiano wrote: >> >> Author: davide >> Date: Thu Jun 14 13:55:52 2012 >> New Revision: 237067 >> URL: http://svn.freebsd.org/changeset/base/237067 >> >> Log: >> =A0 The second argument of sleepq_timedwait_sig() is priority and it doe= s >> not >> =A0 concern signal caught in previous calls as I thought and the manpage >> says. > > > Are you going to fix the man page as well? > > -- > Andre > For sure, mainly because I'm trying to extend the sleepq*(9) KPI, but it's not a short-term priority. It seems that someone did an attempt but noone made technical review and the contribute got lost: http://lists.freebsd.org/pipermail/freebsd-doc/2009-May/015916.html I'll try to fill a PR ASAP, trying to explain what I think it's wrong. Davide From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 15:27:33 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB4CC1065670; Thu, 14 Jun 2012 15:27:33 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D77CE8FC1D; Thu, 14 Jun 2012 15:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EFRXMI002591; Thu, 14 Jun 2012 15:27:33 GMT (envelope-from linimon@svn.freebsd.org) Received: (from linimon@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5EFRXrB002589; Thu, 14 Jun 2012 15:27:33 GMT (envelope-from linimon@svn.freebsd.org) Message-Id: <201206141527.q5EFRXrB002589@svn.freebsd.org> From: Mark Linimon Date: Thu, 14 Jun 2012 15:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237074 - projects/portbuild/crontabs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 15:27:34 -0000 Author: linimon (doc,ports committer) Date: Thu Jun 14 15:27:33 2012 New Revision: 237074 URL: http://svn.freebsd.org/changeset/base/237074 Log: Add arm. This is naive and needs to be auto-sensed. Modified: projects/portbuild/crontabs/root Modified: projects/portbuild/crontabs/root ============================================================================== --- projects/portbuild/crontabs/root Thu Jun 14 15:26:23 2012 (r237073) +++ projects/portbuild/crontabs/root Thu Jun 14 15:27:33 2012 (r237074) @@ -9,6 +9,7 @@ TERM=xterm 6,16,26,36,46,56 * * * * su ports-ia64 -c "lockf -k -t 0 /var/portbuild/errorlogs/lock /var/portbuild/scripts/dologs ia64" > /dev/null 2>&1 8,18,28,38,48,58 * * * * su ports-amd64 -c "lockf -k -t 0 /var/portbuild/errorlogs/lock /var/portbuild/scripts/dologs amd64" > /dev/null 2>&1 0,10,20,30,40,50 * * * * su ports-powerpc -c "lockf -k -t 0 /var/portbuild/errorlogs/lock /var/portbuild/scripts/dologs powerpc" > /dev/null 2>&1 +1,11,21,31,41,51 * * * * su ports-arm -c "lockf -k -t 1 /var/portbuild/errorlogs/lock /var/portbuild/scripts/dologs arm" > /dev/null 2>&1 # # Compress old logs to save space # From owner-svn-src-projects@FreeBSD.ORG Thu Jun 14 20:21:01 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2A77B10656FA; Thu, 14 Jun 2012 20:21:00 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2F5A48FC16; Thu, 14 Jun 2012 20:21:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EKL06p017062; Thu, 14 Jun 2012 20:21:00 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5EKKxk0017060; Thu, 14 Jun 2012 20:20:59 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201206142020.q5EKKxk0017060@svn.freebsd.org> From: Davide Italiano Date: Thu, 14 Jun 2012 20:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237097 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 20:21:01 -0000 Author: davide Date: Thu Jun 14 20:20:59 2012 New Revision: 237097 URL: http://svn.freebsd.org/changeset/base/237097 Log: callwheelbits variable was introduced long time ago but it's not really used. Get rid of it. Discussed with: Matt Dillon Modified: projects/calloutng/sys/kern/kern_timeout.c Modified: projects/calloutng/sys/kern/kern_timeout.c ============================================================================== --- projects/calloutng/sys/kern/kern_timeout.c Thu Jun 14 20:05:12 2012 (r237096) +++ projects/calloutng/sys/kern/kern_timeout.c Thu Jun 14 20:20:59 2012 (r237097) @@ -81,7 +81,7 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca * TODO: * allocate more timeout table slots when table overflows. */ -int callwheelsize, callwheelbits, callwheelmask; +int callwheelsize, callwheelmask; /* * The callout cpu migration entity represents informations necessary for @@ -225,10 +225,9 @@ kern_timeout_callwheel_alloc(caddr_t v) /* * Calculate callout wheel size */ - for (callwheelsize = 1, callwheelbits = 0; - callwheelsize < ncallout; - callwheelsize <<= 1, ++callwheelbits) - ; + callwheelsize = 1; + while (callwheelsize < ncallout) + callwheelsize <<= 1; callwheelmask = callwheelsize - 1; cc->cc_callout = (struct callout *)v; From owner-svn-src-projects@FreeBSD.ORG Fri Jun 15 21:45:25 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528E5106564A; Fri, 15 Jun 2012 21:45:25 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BDFF8FC1C; Fri, 15 Jun 2012 21:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5FLjP3K005304; Fri, 15 Jun 2012 21:45:25 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5FLjP0s005301; Fri, 15 Jun 2012 21:45:25 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201206152145.q5FLjP0s005301@svn.freebsd.org> From: Rick Macklem Date: Fri, 15 Jun 2012 21:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237146 - projects/nfsv4.1-client/sys/rpc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2012 21:45:25 -0000 Author: rmacklem Date: Fri Jun 15 21:45:24 2012 New Revision: 237146 URL: http://svn.freebsd.org/changeset/base/237146 Log: Fix a refence count problem for the backchannel SVCXPRT structure. Modified: projects/nfsv4.1-client/sys/rpc/clnt_rc.c projects/nfsv4.1-client/sys/rpc/svc_vc.c Modified: projects/nfsv4.1-client/sys/rpc/clnt_rc.c ============================================================================== --- projects/nfsv4.1-client/sys/rpc/clnt_rc.c Fri Jun 15 20:27:15 2012 (r237145) +++ projects/nfsv4.1-client/sys/rpc/clnt_rc.c Fri Jun 15 21:45:24 2012 (r237146) @@ -367,6 +367,7 @@ static bool_t clnt_reconnect_control(CLIENT *cl, u_int request, void *info) { struct rc_data *rc = (struct rc_data *)cl->cl_private; + SVCXPRT *xprt; if (info == NULL) { return (FALSE); @@ -449,6 +450,10 @@ clnt_reconnect_control(CLIENT *cl, u_int break; case CLSET_BACKCHANNEL: +printf("clntrc reg backch\n"); + xprt = (SVCXPRT *)info; + SVC_ACQUIRE(xprt); + xprt_register(xprt); rc->rc_backchannel = info; break; @@ -488,9 +493,16 @@ static void clnt_reconnect_destroy(CLIENT *cl) { struct rc_data *rc = (struct rc_data *)cl->cl_private; + SVCXPRT *xprt; if (rc->rc_client) CLNT_DESTROY(rc->rc_client); + if (rc->rc_backchannel) { +printf("clntrc dereg backch\n"); + xprt = (SVCXPRT *)rc->rc_backchannel; + xprt_unregister(xprt); + SVC_RELEASE(xprt); + } crfree(rc->rc_ucred); mtx_destroy(&rc->rc_lock); mem_free(rc, sizeof(*rc)); Modified: projects/nfsv4.1-client/sys/rpc/svc_vc.c ============================================================================== --- projects/nfsv4.1-client/sys/rpc/svc_vc.c Fri Jun 15 20:27:15 2012 (r237145) +++ projects/nfsv4.1-client/sys/rpc/svc_vc.c Fri Jun 15 21:45:24 2012 (r237146) @@ -294,9 +294,6 @@ svc_vc_create_backchannel(SVCPOOL *pool) xprt->xp_p1 = cd; xprt->xp_p2 = NULL; xprt->xp_ops = &svc_vc_backchannel_ops; - - xprt_register(xprt); - return (xprt); } From owner-svn-src-projects@FreeBSD.ORG Sat Jun 16 05:06:44 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EC49106564A; Sat, 16 Jun 2012 05:06:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599B38FC16; Sat, 16 Jun 2012 05:06:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5G56i0N023821; Sat, 16 Jun 2012 05:06:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5G56ieB023819; Sat, 16 Jun 2012 05:06:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206160506.q5G56ieB023819@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 16 Jun 2012 05:06:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237154 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 05:06:44 -0000 Author: glebius Date: Sat Jun 16 05:06:43 2012 New Revision: 237154 URL: http://svn.freebsd.org/changeset/base/237154 Log: Fix off-by-one overflow in the copyout() for the DIOCIGETIFACES ioctl. Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Sat Jun 16 04:41:35 2012 (r237153) +++ projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Sat Jun 16 05:06:43 2012 (r237154) @@ -3248,19 +3248,19 @@ DIOCCHANGEADDR_error: case DIOCIGETIFACES: { struct pfioc_iface *io = (struct pfioc_iface *)addr; struct pfi_kif *ifstore; + size_t bufsiz; if (io->pfiio_esize != sizeof(struct pfi_kif)) { error = ENODEV; break; } - ifstore = malloc(io->pfiio_size * sizeof(struct pfi_kif), - M_TEMP, M_WAITOK); + bufsiz = io->pfiio_size * sizeof(struct pfi_kif); + ifstore = malloc(bufsiz, M_TEMP, M_WAITOK); PF_RULES_RLOCK(); pfi_get_ifaces(io->pfiio_name, ifstore, &io->pfiio_size); PF_RULES_RUNLOCK(); - error = copyout(ifstore, io->pfiio_buffer, io->pfiio_size * - sizeof(struct pfi_kif)); + error = copyout(ifstore, io->pfiio_buffer, bufsiz); free(ifstore, M_TEMP); break; } From owner-svn-src-projects@FreeBSD.ORG Sat Jun 16 06:24:06 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 502BA106566C; Sat, 16 Jun 2012 06:24:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2838FC0C; Sat, 16 Jun 2012 06:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5G6O6Ql026949; Sat, 16 Jun 2012 06:24:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5G6O6mH026947; Sat, 16 Jun 2012 06:24:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206160624.q5G6O6mH026947@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 16 Jun 2012 06:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237155 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 06:24:06 -0000 Author: glebius Date: Sat Jun 16 06:24:05 2012 New Revision: 237155 URL: http://svn.freebsd.org/changeset/base/237155 Log: Fix for fallout from r236397: we need to zero entire sockaddr to make rn_match() work. This fixes matching on tables. Modified: projects/pf/head/sys/contrib/pf/net/pf_table.c Modified: projects/pf/head/sys/contrib/pf/net/pf_table.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf_table.c Sat Jun 16 05:06:43 2012 (r237154) +++ projects/pf/head/sys/contrib/pf/net/pf_table.c Sat Jun 16 06:24:05 2012 (r237155) @@ -1901,6 +1901,7 @@ pfr_match_addr(struct pfr_ktable *kt, st { struct sockaddr_in sin; + bzero(&sin, sizeof(sin)); sin.sin_len = sizeof(sin); sin.sin_family = AF_INET; sin.sin_addr.s_addr = a->addr32[0]; @@ -1915,6 +1916,7 @@ pfr_match_addr(struct pfr_ktable *kt, st { struct sockaddr_in6 sin6; + bzero(&sin6, sizeof(sin6)); sin6.sin6_len = sizeof(sin6); sin6.sin6_family = AF_INET6; bcopy(a, &sin6.sin6_addr, sizeof(sin6.sin6_addr)); From owner-svn-src-projects@FreeBSD.ORG Sat Jun 16 19:05:39 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0724B106564A; Sat, 16 Jun 2012 19:05:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E640B8FC08; Sat, 16 Jun 2012 19:05:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5GJ5cN4060855; Sat, 16 Jun 2012 19:05:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5GJ5ccT060853; Sat, 16 Jun 2012 19:05:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201206161905.q5GJ5ccT060853@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 16 Jun 2012 19:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237169 - projects/pf/head/sys/contrib/pf/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 19:05:39 -0000 Author: glebius Date: Sat Jun 16 19:05:38 2012 New Revision: 237169 URL: http://svn.freebsd.org/changeset/base/237169 Log: Re-do second part of r236718. The pfsync thread don't obtain any hash locks, but can dereference state keys. Thus, we need to remove state from pfsync queues prior to detaching keys. Modified: projects/pf/head/sys/contrib/pf/net/pf.c Modified: projects/pf/head/sys/contrib/pf/net/pf.c ============================================================================== --- projects/pf/head/sys/contrib/pf/net/pf.c Sat Jun 16 18:56:19 2012 (r237168) +++ projects/pf/head/sys/contrib/pf/net/pf.c Sat Jun 16 19:05:38 2012 (r237169) @@ -1477,12 +1477,12 @@ pf_unlink_state(struct pf_state *s, u_in pf_src_tree_remove_state(s); PF_HASHROW_UNLOCK(ih); - pf_detach_state(s); - refcount_release(&s->refs); - if (pfsync_delete_state_ptr != NULL) pfsync_delete_state_ptr(s); + pf_detach_state(s); + refcount_release(&s->refs); + return (pf_release_state(s)); }