Date: Sat, 3 Jun 2006 17:16:29 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 98405 for review Message-ID: <200606031716.k53HGTtw064613@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=98405 Change 98405 by imp@imp_harmony on 2006/06/03 17:15:43 IFC @98404 Affected files ... .. //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#9 integrate .. //depot/projects/arm/src/sys/arm/arm/busdma_machdep.c#8 integrate .. //depot/projects/arm/src/sys/arm/arm/pmap.c#17 integrate .. //depot/projects/arm/src/sys/arm/include/cpuconf.h#3 integrate .. //depot/projects/arm/src/sys/arm/include/cpufunc.h#4 integrate .. //depot/projects/arm/src/sys/arm/include/pmap.h#9 integrate .. //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#3 integrate .. //depot/projects/arm/src/sys/compat/linprocfs/linprocfs.c#6 integrate .. //depot/projects/arm/src/sys/dev/ahb/ahb.c#3 integrate .. //depot/projects/arm/src/sys/dev/ath/if_ath.c#12 integrate .. //depot/projects/arm/src/sys/dev/awi/awi.c#4 integrate .. //depot/projects/arm/src/sys/dev/gem/if_gem.c#4 integrate .. //depot/projects/arm/src/sys/dev/ipw/if_ipw.c#5 integrate .. //depot/projects/arm/src/sys/dev/isp/isp_freebsd.h#9 integrate .. //depot/projects/arm/src/sys/dev/iwi/if_iwi.c#7 integrate .. //depot/projects/arm/src/sys/dev/lmc/if_lmc.h#3 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt.c#14 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt.h#13 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#16 integrate .. //depot/projects/arm/src/sys/dev/mpt/mpt_pci.c#11 integrate .. //depot/projects/arm/src/sys/dev/pccbb/pccbb.c#11 integrate .. //depot/projects/arm/src/sys/dev/ral/rt2560.c#4 integrate .. //depot/projects/arm/src/sys/dev/ral/rt2661.c#4 integrate .. //depot/projects/arm/src/sys/dev/usb/if_ural.c#10 integrate .. //depot/projects/arm/src/sys/dev/usb/ugen.c#3 integrate .. //depot/projects/arm/src/sys/dev/wi/if_wi.c#5 integrate .. //depot/projects/arm/src/sys/fs/msdosfs/msdosfs_vfsops.c#8 integrate .. //depot/projects/arm/src/sys/fs/smbfs/smbfs_vnops.c#5 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_frw.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_fs_subr.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_iget.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_ioctl.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_super.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_attr.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_bit.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_dfrag.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_dir2_trace.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_inode.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_iomap.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_trans.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_vfsops.c#2 integrate .. //depot/projects/arm/src/sys/gnu/fs/xfs/xfs_vnodeops.c#2 integrate .. //depot/projects/arm/src/sys/i386/i386/busdma_machdep.c#8 integrate .. //depot/projects/arm/src/sys/i386/i386/initcpu.c#3 integrate .. //depot/projects/arm/src/sys/i386/i386/machdep.c#13 integrate .. //depot/projects/arm/src/sys/i386/i386/ptrace_machdep.c#3 integrate .. //depot/projects/arm/src/sys/i386/include/md_var.h#4 integrate .. //depot/projects/arm/src/sys/i386/include/npx.h#4 integrate .. //depot/projects/arm/src/sys/i386/isa/npx.c#9 integrate .. //depot/projects/arm/src/sys/ia64/conf/NOTES#4 integrate .. //depot/projects/arm/src/sys/ia64/ia64/busdma_machdep.c#3 integrate .. //depot/projects/arm/src/sys/kern/kern_event.c#7 integrate .. //depot/projects/arm/src/sys/kern/kern_switch.c#5 integrate .. //depot/projects/arm/src/sys/kern/vfs_aio.c#9 integrate .. //depot/projects/arm/src/sys/kern/vfs_mount.c#16 integrate .. //depot/projects/arm/src/sys/kern/vnode_if.src#6 integrate .. //depot/projects/arm/src/sys/net/bpf.c#8 integrate .. //depot/projects/arm/src/sys/net/bpf.h#3 integrate .. //depot/projects/arm/src/sys/net/bpfdesc.h#4 integrate .. //depot/projects/arm/src/sys/net/if.c#9 integrate .. //depot/projects/arm/src/sys/net/if_disc.c#4 integrate .. //depot/projects/arm/src/sys/net/if_faith.c#4 integrate .. //depot/projects/arm/src/sys/net/if_fwsubr.c#4 integrate .. //depot/projects/arm/src/sys/net/if_gif.c#5 integrate .. //depot/projects/arm/src/sys/net/if_gre.c#6 integrate .. //depot/projects/arm/src/sys/net/if_loop.c#5 integrate .. //depot/projects/arm/src/sys/net/if_media.h#6 integrate .. //depot/projects/arm/src/sys/net/if_sl.c#3 integrate .. //depot/projects/arm/src/sys/net/if_stf.c#4 integrate .. //depot/projects/arm/src/sys/net/if_tun.c#3 integrate .. //depot/projects/arm/src/sys/net/raw_cb.c#3 integrate .. //depot/projects/arm/src/sys/net/raw_usrreq.c#4 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_input.c#8 integrate .. //depot/projects/arm/src/sys/net80211/ieee80211_node.c#10 integrate .. //depot/projects/arm/src/sys/netgraph/atm/uni/ng_uni_cust.h#2 integrate .. //depot/projects/arm/src/sys/netgraph/ng_base.c#5 integrate .. //depot/projects/arm/src/sys/netgraph/ng_iface.c#4 integrate .. //depot/projects/arm/src/sys/netinet/in_pcb.c#9 integrate .. //depot/projects/arm/src/sys/netinet/ip_carp.c#6 integrate .. //depot/projects/arm/src/sys/netinet/ip_gre.c#5 integrate .. //depot/projects/arm/src/sys/security/audit/audit_bsm_klib.c#3 integrate .. //depot/projects/arm/src/sys/sys/elf_common.h#3 integrate .. //depot/projects/arm/src/sys/ufs/ufs/ufs_vnops.c#6 integrate .. //depot/projects/arm/src/sys/vm/vm_page.c#11 integrate Differences ... ==== //depot/projects/arm/src/sys/amd64/amd64/busdma_machdep.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.75 2006/05/28 18:31:32 silby Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.77 2006/06/01 04:49:29 silby Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -498,7 +498,7 @@ * alignment guarantees of malloc need to be nailed down, and the * code below should be rewritten to take that into account. * - * In the meantime, we'll panic if malloc gets it wrong. + * In the meantime, we'll warn the user if malloc gets it wrong. */ if ((dmat->maxsize <= PAGE_SIZE) && (dmat->alignment < dmat->maxsize) && @@ -520,7 +520,7 @@ __func__, dmat, dmat->flags, ENOMEM); return (ENOMEM); } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { - panic("bus_dmamem_alloc failed to align memory properly."); + printf("bus_dmamem_alloc failed to align memory properly."); } CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->flags, ENOMEM); ==== //depot/projects/arm/src/sys/arm/arm/busdma_machdep.c#8 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.25 2006/03/01 23:04:25 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.26 2006/05/31 15:50:33 cognet Exp $"); /* * MacPPC bus dma support routines @@ -806,13 +806,16 @@ if (op & BUS_DMASYNC_PREWRITE) cpu_dcache_wb_range((vm_offset_t)buf, len); - if (op & BUS_DMASYNC_POSTREAD) { - if ((((vm_offset_t)buf | len) & arm_dcache_align_mask) == 0) - cpu_dcache_inv_range((vm_offset_t)buf, len); - else - cpu_dcache_wbinv_range((vm_offset_t)buf, len); - + if (op & BUS_DMASYNC_PREREAD) { + if ((vm_offset_t)buf & arm_dcache_align_mask) + cpu_dcache_wbinv_range((vm_offset_t)buf & + ~arm_dcache_align_mask, arm_dcache_align); + if (((vm_offset_t)buf + len) & arm_dcache_align_mask) + cpu_dcache_wbinv_range(((vm_offset_t)buf + len) & + ~arm_dcache_align_mask, arm_dcache_align); } + if (op & BUS_DMASYNC_POSTREAD) + cpu_dcache_inv_range((vm_offset_t)buf, len); } void @@ -823,7 +826,7 @@ int resid; struct iovec *iov; - if (!(op & (BUS_DMASYNC_PREWRITE | BUS_DMASYNC_POSTREAD))) + if (op == BUS_DMASYNC_POSTWRITE) return; if (map->flags & DMAMAP_COHERENT) return; ==== //depot/projects/arm/src/sys/arm/arm/pmap.c#17 (text+ko) ==== @@ -147,7 +147,7 @@ #include "opt_vm.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.49 2006/05/30 16:55:38 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/pmap.c,v 1.52 2006/06/01 01:31:07 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -198,6 +198,8 @@ static void pmap_free_pv_entry (pv_entry_t); static pv_entry_t pmap_get_pv_entry(void); +static void pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, boolean_t); static void pmap_vac_me_harder(struct vm_page *, pmap_t, vm_offset_t); static void pmap_vac_me_kpmap(struct vm_page *, pmap_t, @@ -230,6 +232,8 @@ static pt_entry_t *csrc_pte, *cdst_pte; static vm_offset_t csrcp, cdstp; +static struct mtx cmtx; + static void pmap_init_l1(struct l1_ttable *, pd_entry_t *); /* * These routines are called when the CPU type is identified to set up @@ -913,20 +917,38 @@ l1idx = L1_IDX(va); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); if ((l2 = pm->pm_l2[L2_IDX(l1idx)]) == NULL) { /* * No mapping at this address, as there is * no entry in the L1 table. * Need to allocate a new l2_dtable. */ +again_l2table: + vm_page_unlock_queues(); if ((l2 = pmap_alloc_l2_dtable()) == NULL) { + vm_page_lock_queues(); return (NULL); } - bzero(l2, sizeof(*l2)); - /* - * Link it into the parent pmap - */ - pm->pm_l2[L2_IDX(l1idx)] = l2; + vm_page_lock_queues(); + if (pm->pm_l2[L2_IDX(l1idx)] != NULL) { + vm_page_unlock_queues(); + uma_zfree(l2table_zone, l2); + vm_page_lock_queues(); + l2 = pm->pm_l2[L2_IDX(l1idx)]; + if (l2 == NULL) + goto again_l2table; + /* + * Someone already allocated the l2_dtable while + * we were doing the same. + */ + } else { + bzero(l2, sizeof(*l2)); + /* + * Link it into the parent pmap + */ + pm->pm_l2[L2_IDX(l1idx)] = l2; + } } l2b = &l2->l2_bucket[L2_BUCKET(l1idx)]; @@ -941,7 +963,19 @@ * No L2 page table has been allocated. Chances are, this * is because we just allocated the l2_dtable, above. */ +again_ptep: + vm_page_unlock_queues(); ptep = (void*)uma_zalloc(l2zone, M_NOWAIT); + vm_page_lock_queues(); + if (l2b->l2b_kva != 0) { + /* We lost the race. */ + vm_page_unlock_queues(); + uma_zfree(l2zone, ptep); + vm_page_lock_queues(); + if (l2b->l2b_kva == 0) + goto again_ptep; + return (l2b); + } l2b->l2b_phys = vtophys(ptep); if (ptep == NULL) { /* @@ -2541,6 +2575,7 @@ virtual_end = lastaddr; kernel_vm_end = pmap_curmaxkvaddr; arm_nocache_startaddr = lastaddr; + mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); #ifdef ARM_USE_SMALL_ALLOC mtx_init(&smallalloc_mtx, "Small alloc page list", NULL, MTX_DEF); @@ -3310,6 +3345,19 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired) { + + vm_page_lock_queues(); + pmap_enter_locked(pmap, va, m, prot, wired); + vm_page_unlock_queues(); +} + +/* + * The page queues and pmap must be locked. + */ +static void +pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, + boolean_t wired) +{ struct l2_bucket *l2b = NULL; struct vm_page *opg; struct pv_entry *pve = NULL; @@ -3318,7 +3366,7 @@ u_int oflags; vm_paddr_t pa; - vm_page_lock_queues(); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); if (va == vector_page) { pa = systempage.pv_pa; m = NULL; @@ -3435,9 +3483,11 @@ simple_lock(&opg->mdpage.pvh_slock); #endif pve = pmap_remove_pv(opg, pmap, va); - if (m && (m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) && pve) + if (m && (m->flags & (PG_UNMANAGED | PG_FICTITIOUS)) && + pve) pmap_free_pv_entry(pve); - else if (!pve) + else if (!pve && + !(m->flags & (PG_UNMANAGED | PG_FICTITIOUS))) pve = pmap_get_pv_entry(); KASSERT(pve != NULL, ("No pv")); #if 0 @@ -3532,7 +3582,6 @@ if (m) pmap_vac_me_harder(m, pmap, va); } - vm_page_unlock_queues(); } /* @@ -3549,15 +3598,9 @@ vm_page_t mpte) { - vm_page_busy(m); - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(m->object); - mtx_lock(&Giant); - pmap_enter(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - mtx_unlock(&Giant); - VM_OBJECT_LOCK(m->object); - vm_page_lock_queues(); - vm_page_wakeup(m); + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), + FALSE); return (NULL); } @@ -4009,6 +4052,7 @@ return; + mtx_lock(&cmtx); /* * Hook in the page, zero it, and purge the cache for that * zeroed page. Invalidate the TLB as needed. @@ -4022,6 +4066,7 @@ bzero((void *)(cdstp + off), size); else bzero_page(cdstp); + mtx_unlock(&cmtx); cpu_dcache_wbinv_range(cdstp, PAGE_SIZE); } #endif /* (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0 */ @@ -4034,6 +4079,7 @@ if (_arm_bzero && _arm_bzero((void *)(phys + off), size, IS_PHYSICAL) == 0) return; + mtx_lock(&cmtx); /* * Hook in the page, zero it, and purge the cache for that * zeroed page. Invalidate the TLB as needed. @@ -4048,6 +4094,7 @@ bzero((void *)(cdstp + off), size); else bzero_page(cdstp); + mtx_unlock(&cmtx); xscale_cache_clean_minidata(); } @@ -4270,6 +4317,7 @@ * the cache for the appropriate page. Invalidate the TLB * as required. */ + mtx_lock(&cmtx); *csrc_pte = L2_S_PROTO | src | L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | pte_l2_s_cache_mode; PTE_SYNC(csrc_pte); @@ -4280,6 +4328,7 @@ cpu_tlb_flushD_SE(cdstp); cpu_cpwait(); bcopy_page(csrcp, cdstp); + mtx_unlock(&cmtx); cpu_dcache_inv_range(csrcp, PAGE_SIZE); #if 0 mtx_lock(&src_pg->md.pvh_mtx); @@ -4321,6 +4370,7 @@ * the cache for the appropriate page. Invalidate the TLB * as required. */ + mtx_lock(&cmtx); *csrc_pte = L2_S_PROTO | src | L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X); /* mini-data */ @@ -4333,6 +4383,7 @@ cpu_tlb_flushD_SE(cdstp); cpu_cpwait(); bcopy_page(csrcp, cdstp); + mtx_unlock(&cmtx); xscale_cache_clean_minidata(); } #endif /* ARM_MMU_XSCALE == 1 */ ==== //depot/projects/arm/src/sys/arm/include/cpuconf.h#3 (text+ko) ==== @@ -34,7 +34,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/arm/include/cpuconf.h,v 1.5 2005/05/26 16:05:22 cognet Exp $ + * $FreeBSD: src/sys/arm/include/cpuconf.h,v 1.7 2006/06/02 09:39:06 cognet Exp $ * */ @@ -57,22 +57,22 @@ */ #if (defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ - defined(CPU_ARM10) || defined(CPU_SA110) || defined(CPU_SA1100) || \ - defined(CPU_SA1110) || defined(CPU_IXP12X0) || defined(CPU_XSCALE_IXP425)) + defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \ + defined(CPU_IXP12X0) || defined(CPU_XSCALE_IXP425)) #define ARM_ARCH_4 1 #else #define ARM_ARCH_4 0 #endif #if (defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_PXA2X0)) + defined(CPU_XSCALE_PXA2X0)) || defined(CPU_ARM10) #define ARM_ARCH_5 1 #else #define ARM_ARCH_5 0 #endif #define ARM_NARCH (ARM_ARCH_4 + ARM_ARCH_5) -#if ARM_NARCH == 0 && !defined(KLD_MODULE) +#if ARM_NARCH == 0 && !defined(KLD_MODULE) && defined(_KERNEL) #error ARM_NARCH is 0 #endif @@ -120,7 +120,7 @@ #define ARM_NMMUS (ARM_MMU_MEMC + ARM_MMU_GENERIC + \ ARM_MMU_SA1 + ARM_MMU_XSCALE) -#if ARM_NMMUS == 0 && !defined(KLD_MODULE) +#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL) #error ARM_NMMUS is 0 #endif ==== //depot/projects/arm/src/sys/arm/include/cpufunc.h#4 (text+ko) ==== @@ -38,7 +38,7 @@ * * Prototypes for cpu, mmu and tlb related functions. * - * $FreeBSD: src/sys/arm/include/cpufunc.h,v 1.7 2005/06/03 19:49:53 cognet Exp $ + * $FreeBSD: src/sys/arm/include/cpufunc.h,v 1.8 2006/06/01 16:17:44 cognet Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -460,7 +460,7 @@ (mask) & (I32_bit | F32_bit))) #define enable_interrupts(mask) \ - (__set_cpsr_c((mask | F32_bit) & (I32_bit | F32_bit), 0)) + (__set_cpsr_c((mask) & (I32_bit | F32_bit), 0)) #define restore_interrupts(old_cpsr) \ (__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit))) ==== //depot/projects/arm/src/sys/arm/include/pmap.h#9 (text+ko) ==== @@ -44,14 +44,14 @@ * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * from: FreeBSD: src/sys/i386/include/pmap.h,v 1.70 2000/11/30 * - * $FreeBSD: src/sys/arm/include/pmap.h,v 1.17 2006/05/13 23:41:15 cognet Exp $ + * $FreeBSD: src/sys/arm/include/pmap.h,v 1.18 2006/05/31 11:57:37 cognet Exp $ */ #ifndef _MACHINE_PMAP_H_ #define _MACHINE_PMAP_H_ #include <machine/pte.h> - +#include <machine/cpuconf.h> /* * Pte related macros */ ==== //depot/projects/arm/src/sys/boot/i386/libi386/biosdisk.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.46 2005/12/19 09:00:11 sobomax Exp $"); +__FBSDID("$FreeBSD: src/sys/boot/i386/libi386/biosdisk.c,v 1.47 2006/05/31 09:05:49 iedowse Exp $"); /* * BIOS disk device handling. @@ -1037,9 +1037,6 @@ */ if (bbuf != NULL) bcopy(p, breg, x * BIOSDISK_SECSIZE); - p += (x * BIOSDISK_SECSIZE); - dblk += x; - resid -= x; /* Loop retrying the operation a couple of times. The BIOS may also retry. */ for (retry = 0; retry < 3; retry++) { @@ -1103,6 +1100,9 @@ if (result) { return(-1); } + p += (x * BIOSDISK_SECSIZE); + dblk += x; + resid -= x; } /* hexdump(dest, (blks * BIOSDISK_SECSIZE)); */ ==== //depot/projects/arm/src/sys/compat/linprocfs/linprocfs.c#6 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.93 2006/05/12 05:04:40 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.94 2006/06/02 13:01:25 des Exp $"); #include <sys/param.h> #include <sys/queue.h> @@ -222,9 +222,9 @@ default: class = 0; break; -#else +#else /* __amd64__ */ default: - class = 6; + class = 15; break; #endif } ==== //depot/projects/arm/src/sys/dev/ahb/ahb.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.34 2005/05/29 04:42:17 nyan Exp $ + * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.35 2006/05/31 14:33:23 mjacob Exp $ */ #include <sys/param.h> @@ -526,7 +526,7 @@ } ahb->num_ecbs = MIN(ahb->num_ecbs, - ahb->ha_inq_data->scsi_data.reserved[1]); + ahb->ha_inq_data->scsi_data.spc2_flags); printf("ahb%ld: %.8s %s SCSI Adapter, FW Rev. %.4s, ID=%d, %d ECBs\n", ahb->unit, ahb->ha_inq_data->scsi_data.product, (ahb->ha_inq_data->scsi_data.flags & 0x4) ? "Differential" ==== //depot/projects/arm/src/sys/dev/ath/if_ath.c#12 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.144 2006/05/08 20:11:09 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.146 2006/06/02 23:14:38 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -2905,7 +2905,7 @@ * pass decrypt+mic errors but others may be * interesting (e.g. crc). */ - if (sc->sc_drvbpf != NULL && + if (bpf_peers_present(sc->sc_drvbpf) && (ds->ds_rxstat.rs_status & sc->sc_monpass)) { bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); @@ -2936,7 +2936,8 @@ sc->sc_stats.ast_ant_rx[ds->ds_rxstat.rs_antenna]++; - if (sc->sc_drvbpf != NULL && !ath_rx_tap(sc, m, ds, tsf, nf)) { + if (bpf_peers_present(sc->sc_drvbpf) && + !ath_rx_tap(sc, m, ds, tsf, nf)) { m_freem(m); /* XXX reclaim */ goto rx_next; } @@ -3634,9 +3635,9 @@ ieee80211_dump_pkt(mtod(m0, caddr_t), m0->m_len, sc->sc_hwmap[txrate].ieeerate, -1); - if (ic->ic_rawbpf) + if (bpf_peers_present(ic->ic_rawbpf)) bpf_mtap(ic->ic_rawbpf, m0); - if (sc->sc_drvbpf) { + if (bpf_peers_present(sc->sc_drvbpf)) { u_int64_t tsf = ath_hal_gettsf64(ah); sc->sc_tx_th.wt_tsf = htole64(tsf); ==== //depot/projects/arm/src/sys/dev/awi/awi.c#4 (text+ko) ==== @@ -89,7 +89,7 @@ __KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.62 2004/01/16 14:13:15 onoe Exp $"); #endif #ifdef __FreeBSD__ -__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.42 2005/08/13 00:30:26 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/awi/awi.c,v 1.43 2006/06/02 23:14:39 sam Exp $"); #endif #include "opt_inet.h" @@ -796,8 +796,7 @@ } IFQ_DEQUEUE(&ifp->if_snd, m0); #if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap(ifp->if_bpf, m0); + BPF_MTAP(ifp, m0); #endif if ((ifp->if_flags & IFF_LINK0) || sc->sc_adhoc_ap) m0 = awi_ether_encap(sc, m0); @@ -839,7 +838,7 @@ ifp->if_opackets++; } #if NBPFILTER > 0 - if (ic->ic_rawbpf) + if (bpf_peers_present(ic->ic_rawbpf)) bpf_mtap(ic->ic_rawbpf, m0); #endif if (dowep) { ==== //depot/projects/arm/src/sys/dev/gem/if_gem.c#4 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.37 2005/12/05 11:58:32 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.38 2006/06/02 23:14:39 sam Exp $"); /* * Driver for Sun GEM ethernet controllers. @@ -1205,8 +1205,7 @@ bus_space_write_4(sc->sc_bustag, sc->sc_h, GEM_TX_KICK, sc->sc_txnext); - if (ifp->if_bpf != NULL) - bpf_mtap(ifp->if_bpf, m0); + BPF_MTAP(ifp, m0); } while (1); if (txmfail == -1 || sc->sc_txfree == 0) { ==== //depot/projects/arm/src/sys/dev/ipw/if_ipw.c#5 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.19 2006/05/16 14:36:27 phk Exp $ */ +/* $FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.21 2006/06/02 23:14:39 sam Exp $ */ /*- * Copyright (c) 2004-2006 @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.19 2006/05/16 14:36:27 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.21 2006/06/02 23:14:39 sam Exp $"); /*- * Intel(R) PRO/Wireless 2100 MiniPCI driver @@ -1054,7 +1054,7 @@ m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = le32toh(status->len); - if (sc->sc_drvbpf != NULL) { + if (bpf_peers_present(sc->sc_drvbpf)) { struct ipw_rx_radiotap_header *tap = &sc->sc_rxtap; tap->wr_flags = 0; @@ -1328,7 +1328,7 @@ wh = mtod(m0, struct ieee80211_frame *); } - if (sc->sc_drvbpf != NULL) { + if (bpf_peers_present(sc->sc_drvbpf)) { struct ipw_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; @@ -1495,7 +1495,7 @@ continue; } - if (ic->ic_rawbpf != NULL) + if (bpf_peers_present(ic->ic_rawbpf)) bpf_mtap(ic->ic_rawbpf, m0); if (ipw_tx_start(ifp, m0, ni) != 0) { ==== //depot/projects/arm/src/sys/dev/isp/isp_freebsd.h#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.89 2006/05/22 06:48:40 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.90 2006/06/03 07:19:44 mjacob Exp $ */ /*- * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * @@ -49,6 +49,9 @@ #include <sys/bus.h> #include <machine/bus.h> +#if __FreeBSD_version < 500000 +#include <machine/clock.h> +#endif #include <machine/cpu.h> #include <cam/cam.h> ==== //depot/projects/arm/src/sys/dev/iwi/if_iwi.c#7 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.36 2006/05/16 14:36:27 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.38 2006/06/02 23:14:39 sam Exp $"); /*- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver @@ -1300,7 +1300,7 @@ m_adj(m, sizeof (struct iwi_hdr) + sizeof (struct iwi_frame)); - if (sc->sc_drvbpf != NULL) { + if (bpf_peers_present(sc->sc_drvbpf)) { struct iwi_rx_radiotap_header *tap = &sc->sc_rxtap; tap->wr_flags = 0; @@ -1829,7 +1829,7 @@ wh = mtod(m0, struct ieee80211_frame *); } - if (sc->sc_drvbpf != NULL) { + if (bpf_peers_present(sc->sc_drvbpf)) { struct iwi_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; @@ -1984,7 +1984,7 @@ continue; } - if (ic->ic_rawbpf != NULL) + if (bpf_peers_present(ic->ic_rawbpf)) bpf_mtap(ic->ic_rawbpf, m0); if (iwi_tx_start(ifp, m0, ni, ac) != 0) { ==== //depot/projects/arm/src/sys/dev/lmc/if_lmc.h#3 (text+ko) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/sys/dev/lmc/if_lmc.h,v 1.2 2005/12/05 11:58:33 ru Exp $ + * $FreeBSD: src/sys/dev/lmc/if_lmc.h,v 1.3 2006/06/02 23:14:39 sam Exp $ * * Copyright (c) 2002-2004 David Boggs. (boggs@boggs.palo-alto.ca.us) * All rights reserved. @@ -1242,7 +1242,7 @@ # define DMA_LOAD(map, addr, size) bus_dmamap_load(ring->tag, map, addr, size, fbsd_dmamap_load, ring, 0) # if (NBPFILTER != 0) # if (__FreeBSD_version >= 500000) -# define LMC_BPF_MTAP(mbuf) if (sc->ifp->if_bpf) bpf_mtap(sc->ifp->if_bpf, mbuf) +# define LMC_BPF_MTAP(mbuf) BPF_MTAP(sc->ifp, mbuf) # else /* FreeBSD-4 */ # define LMC_BPF_MTAP(mbuf) if (sc->ifp->if_bpf) bpf_mtap(sc->ifp, mbuf) # endif ==== //depot/projects/arm/src/sys/dev/mpt/mpt.c#14 (text+ko) ==== @@ -96,7 +96,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.30 2006/05/29 20:34:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.31 2006/06/02 18:50:38 mjacob Exp $"); #include <dev/mpt/mpt.h> #include <dev/mpt/mpt_cam.h> /* XXX For static handler registration */ @@ -2438,12 +2438,15 @@ if (pfp.PortType == MPI_PORTFACTS_PORTTYPE_FC) { mpt->is_fc = 1; mpt->is_sas = 0; + mpt->is_spi = 0; } else if (pfp.PortType == MPI_PORTFACTS_PORTTYPE_SAS) { mpt->is_fc = 0; mpt->is_sas = 1; + mpt->is_spi = 0; } else { mpt->is_fc = 0; mpt->is_sas = 0; + mpt->is_spi = 1; } mpt->mpt_ini_id = pfp.PortSCSIID; mpt->mpt_max_devices = pfp.MaxDevices; ==== //depot/projects/arm/src/sys/dev/mpt/mpt.h#13 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.22 2006/05/29 20:34:28 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/mpt/mpt.h,v 1.24 2006/06/02 19:23:12 mjacob Exp $ */ /*- * Generic defines for LSI '909 FC adapters. * FreeBSD Version. @@ -126,6 +126,7 @@ #if __FreeBSD_version < 500000 #include <machine/bus.h> +#include <machine/clock.h> #endif #include <sys/rman.h> @@ -502,8 +503,8 @@ shutdwn_raid : 1, shutdwn_recovery: 1, outofbeer : 1, - : 1, disabled : 1, + is_spi : 1, is_sas : 1, is_fc : 1; @@ -540,6 +541,10 @@ CONFIG_PAGE_SCSI_DEVICE_1 _dev_page1[16]; uint16_t _tag_enable; uint16_t _disc_enable; + struct { + uint8_t inqdata[39]; + uint8_t state; + } _dv[16]; } spi; #define mpt_port_page0 cfg.spi._port_page0 #define mpt_port_page1 cfg.spi._port_page1 @@ -548,6 +553,10 @@ #define mpt_dev_page1 cfg.spi._dev_page1 #define mpt_tag_enable cfg.spi._tag_enable #define mpt_disc_enable cfg.spi._disc_enable +#define mpt_dv cfg.spi._dv +# define DV_STATE_0 0 +# define DV_STATE_1 1 +# define DV_STATE_DONE 0xff struct mpi_fc_cfg { CONFIG_PAGE_FC_PORT_0 _port_page0; #define mpt_fcport_page0 cfg.fc._port_page0 @@ -665,7 +674,7 @@ uint8_t *fw_image; bus_dma_tag_t fw_dmat; /* DMA tag for firmware image */ bus_dmamap_t fw_dmap; /* DMA map for firmware image */ - bus_addr_t fw_phys; /* BusAddr of request memory */ + bus_addr_t fw_phys; /* BusAddr of firmware image */ /* Shutdown Event Handler. */ eventhandler_tag eh; ==== //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#16 (text+ko) ==== @@ -94,7 +94,7 @@ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.21 2006/05/29 20:34:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt_cam.c,v 1.22 2006/06/02 18:50:38 mjacob Exp $"); #include <dev/mpt/mpt.h> #include <dev/mpt/mpt_cam.h> @@ -599,13 +599,13 @@ if (rv) { mpt_prt(mpt, "failed to read SPI Port Page 2\n"); } else { - mpt_lprt(mpt, MPT_PRT_DEBUG, - "SPI Port Page 2: Flags %x Settings %x\n", + mpt_lprt(mpt, MPT_PRT_NEGOTIATION, + "Port Page 2: Flags %x Settings %x\n", mpt->mpt_port_page2.PortFlags, mpt->mpt_port_page2.PortSettings); for (i = 0; i < 16; i++) { - mpt_lprt(mpt, MPT_PRT_DEBUG, - "SPI Port Page 2 Tgt %d: timo %x SF %x Flags %x\n", + mpt_lprt(mpt, MPT_PRT_NEGOTIATION, + " Port Page 2 Tgt %d: timo %x SF %x Flags %x\n", i, mpt->mpt_port_page2.DeviceSettings[i].Timeout, mpt->mpt_port_page2.DeviceSettings[i].SyncFactor, mpt->mpt_port_page2.DeviceSettings[i].DeviceFlags); @@ -621,9 +621,9 @@ "cannot read SPI Target %d Device Page 0\n", i); continue; } - mpt_lprt(mpt, MPT_PRT_DEBUG, - "SPI Tgt %d Page 0: NParms %x Information %x", i, - mpt->mpt_dev_page0[i].NegotiatedParameters, + mpt_lprt(mpt, MPT_PRT_NEGOTIATION, + "target %d page 0: Negotiated Params %x Information %x\n", + i, mpt->mpt_dev_page0[i].NegotiatedParameters, mpt->mpt_dev_page0[i].Information); rv = mpt_read_cur_cfg_page(mpt, i, @@ -634,9 +634,9 @@ "cannot read SPI Target %d Device Page 1\n", i); continue; } - mpt_lprt(mpt, MPT_PRT_DEBUG, - "SPI Tgt %d Page 1: RParms %x Configuration %x\n", i, - mpt->mpt_dev_page1[i].RequestedParameters, + mpt_lprt(mpt, MPT_PRT_NEGOTIATION, + "target %d page 1: Requested Params %x Configuration %x\n", + i, mpt->mpt_dev_page1[i].RequestedParameters, mpt->mpt_dev_page1[i].Configuration); } return (0); @@ -693,16 +693,20 @@ MPI_SCSIPORTPAGE2_PORT_MASK_NEGO_MASTER_SETTINGS; j = mpt->mpt_port_page2.PortFlags & MPI_SCSIPORTPAGE2_PORT_FLAGS_DV_MASK; - if (i == MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS && - j == MPI_SCSIPORTPAGE2_PORT_FLAGS_OFF_DV) { + if (i == MPI_SCSIPORTPAGE2_PORT_ALL_MASTER_SETTINGS /* && + j == MPI_SCSIPORTPAGE2_PORT_FLAGS_OFF_DV */) { mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "honoring BIOS transfer negotiations\n"); - return (0); - } - for (i = 0; i < 16; i++) { - mpt->mpt_dev_page1[i].RequestedParameters = 0; - mpt->mpt_dev_page1[i].Configuration = 0; - (void) mpt_update_spi_config(mpt, i); + for (i = 0; i < 16; i++) { + mpt->mpt_dv[i].state = DV_STATE_DONE; + } + } else { + for (i = 0; i < 16; i++) { + mpt->mpt_dev_page1[i].RequestedParameters = 0; + mpt->mpt_dev_page1[i].Configuration = 0; + (void) mpt_update_spi_config(mpt, i); + mpt->mpt_dv[i].state = DV_STATE_0; + } } return (0); } @@ -724,7 +728,7 @@ if (mpt_set_initial_config_sas(mpt)) { return (EIO); } - } else { + } else if (mpt->is_spi) { if (mpt_read_config_info_spi(mpt)) { return (EIO); } @@ -873,10 +877,17 @@ break; } } + + if (error == 0 && ((uint32_t)nseg) >= mpt->max_seg_cnt) { + error = EFBIG; + mpt_prt(mpt, "segment count %d too large (max %u)\n", + nseg, mpt->max_seg_cnt); + } + bad: if (error != 0) { if (error != EFBIG && error != ENOMEM) { - mpt_prt(mpt, "mpt_execute_req: err %d\n", error); + mpt_prt(mpt, "mpt_execute_req_a64: err %d\n", error); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { cam_status status; @@ -1275,12 +1286,8 @@ bad: if (error != 0) { - if (hdrp->Function == MPI_FUNCTION_TARGET_ASSIST) { - request_t *cmd_req = - MPT_TAG_2_REQ(mpt, ccb->csio.tag_id); - MPT_TGT_STATE(mpt, cmd_req)->state = TGT_STATE_IN_CAM; - MPT_TGT_STATE(mpt, cmd_req)->ccb = NULL; - MPT_TGT_STATE(mpt, cmd_req)->req = NULL; + if (error != EFBIG && error != ENOMEM) { + mpt_prt(mpt, "mpt_execute_req: err %d\n", error); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { cam_status status; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606031716.k53HGTtw064613>