From owner-p4-projects@FreeBSD.ORG Sun Jan 21 15:13:01 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2932316A488; Sun, 21 Jan 2007 15:13:01 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0179F16A484 for ; Sun, 21 Jan 2007 15:13:01 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E561813C43E for ; Sun, 21 Jan 2007 15:13:00 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0LFD0Mu053496 for ; Sun, 21 Jan 2007 15:13:00 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0LFCxJF053492 for perforce@freebsd.org; Sun, 21 Jan 2007 15:12:59 GMT (envelope-from piso@freebsd.org) Date: Sun, 21 Jan 2007 15:12:59 GMT Message-Id: <200701211512.l0LFCxJF053492@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 113255 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jan 2007 15:13:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=113255 Change 113255 by piso@piso_newluxor on 2007/01/21 15:12:50 IFC@113250 Affected files ... .. //depot/projects/soc2006/intr_filter/amd64/linux32/linux32_machdep.c#8 integrate .. //depot/projects/soc2006/intr_filter/arm/at91/uart_dev_at91usart.c#5 integrate .. //depot/projects/soc2006/intr_filter/arm/sa11x0/uart_dev_sa1110.c#2 integrate .. //depot/projects/soc2006/intr_filter/compat/linprocfs/linprocfs.c#8 integrate .. //depot/projects/soc2006/intr_filter/compat/linux/linux_emul.c#7 integrate .. //depot/projects/soc2006/intr_filter/compat/linux/linux_file.c#6 integrate .. //depot/projects/soc2006/intr_filter/conf/files.sparc64#5 integrate .. //depot/projects/soc2006/intr_filter/conf/options#12 integrate .. //depot/projects/soc2006/intr_filter/conf/options.sun4v#2 integrate .. //depot/projects/soc2006/intr_filter/dev/aic7xxx/aic79xx.h#2 integrate .. //depot/projects/soc2006/intr_filter/dev/aic7xxx/aic79xx_pci.c#2 integrate .. //depot/projects/soc2006/intr_filter/dev/bce/if_bce.c#11 integrate .. //depot/projects/soc2006/intr_filter/dev/cardbus/cardbus.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/dpt/dpt.h#2 integrate .. //depot/projects/soc2006/intr_filter/dev/dpt/dpt_eisa.c#4 integrate .. //depot/projects/soc2006/intr_filter/dev/dpt/dpt_scsi.c#4 integrate .. //depot/projects/soc2006/intr_filter/dev/fb/fbreg.h#2 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp.c#12 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp_freebsd.c#9 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp_freebsd.h#7 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp_target.c#5 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp_target.h#4 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/isp_tpublic.h#4 integrate .. //depot/projects/soc2006/intr_filter/dev/isp/ispvar.h#7 integrate .. //depot/projects/soc2006/intr_filter/dev/le/if_le_cbus.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/le/if_le_isa.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/le/if_le_lebuffer.c#1 branch .. //depot/projects/soc2006/intr_filter/dev/le/if_le_ledma.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/le/if_le_pci.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/le/lance.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/le/lebuffer_sbus.c#1 branch .. //depot/projects/soc2006/intr_filter/dev/mc146818/mc146818reg.h#2 integrate .. //depot/projects/soc2006/intr_filter/dev/mii/mii.c#2 integrate .. //depot/projects/soc2006/intr_filter/dev/mii/ukphy.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/pci/pcireg.h#5 integrate .. //depot/projects/soc2006/intr_filter/dev/si/si.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/sound/sbus/cs4231.c#2 integrate .. //depot/projects/soc2006/intr_filter/dev/uart/uart_cpu.h#2 integrate .. //depot/projects/soc2006/intr_filter/dev/uart/uart_dev_ns8250.c#2 integrate .. //depot/projects/soc2006/intr_filter/dev/uart/uart_dev_sab82532.c#2 integrate .. //depot/projects/soc2006/intr_filter/dev/uart/uart_dev_z8530.c#3 integrate .. //depot/projects/soc2006/intr_filter/dev/uart/uart_kbd_sun.c#4 integrate .. //depot/projects/soc2006/intr_filter/i386/linux/linux_machdep.c#7 integrate .. //depot/projects/soc2006/intr_filter/kern/sched_ule.c#9 integrate .. //depot/projects/soc2006/intr_filter/modules/le/Makefile#2 integrate .. //depot/projects/soc2006/intr_filter/netgraph/ng_ppp.c#3 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/bus.h#3 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/cache.h#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/frame.h#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/fsr.h#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/intr_machdep.h#4 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/pcb.h#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/include/tsb.h#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/isa/isa.c#3 integrate .. //depot/projects/soc2006/intr_filter/sparc64/pci/ofw_pci_if.m#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/pci/psycho.c#10 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sbus/dma_sbus.c#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/bus_machdep.c#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/exception.S#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/genassym.c#6 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/interrupt.S#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/mp_exception.S#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/mp_locore.S#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/ofw_machdep.c#3 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/support.S#4 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/swtch.S#2 integrate .. //depot/projects/soc2006/intr_filter/sparc64/sparc64/upa.c#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/bus.h#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/frame.h#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/fsr.h#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/intr_machdep.h#3 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/pcb.h#3 integrate .. //depot/projects/soc2006/intr_filter/sun4v/include/utrap.h#3 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/bus_machdep.c#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/exception.S#5 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/hv_pci.c#3 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/interrupt.S#4 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/mp_locore.S#3 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/support.S#4 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/swtch.S#2 integrate .. //depot/projects/soc2006/intr_filter/sun4v/sun4v/wbuf.S#4 integrate .. //depot/projects/soc2006/intr_filter/ufs/ffs/ffs_alloc.c#5 integrate .. //depot/projects/soc2006/intr_filter/ufs/ffs/ffs_snapshot.c#4 integrate .. //depot/projects/soc2006/intr_filter/ufs/ufs/quota.h#2 integrate .. //depot/projects/soc2006/intr_filter/ufs/ufs/ufs_quota.c#4 integrate Differences ... ==== //depot/projects/soc2006/intr_filter/amd64/linux32/linux32_machdep.c#8 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.26 2007/01/14 16:20:37 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.27 2007/01/20 14:58:59 netchild Exp $"); #include #include @@ -453,14 +453,21 @@ linux_fork(struct thread *td, struct linux_fork_args *args) { int error; + struct proc *p2; + struct thread *td2; #ifdef DEBUG if (ldebug(fork)) printf(ARGS(fork, "")); #endif - if ((error = fork(td, (struct fork_args *)args)) != 0) + if ((error = fork1(td, RFFDG | RFPROC | RFSTOPPED, 0, &p2)) != 0) return (error); + + if (error == 0) { + td->td_retval[0] = p2->p_pid; + td->td_retval[1] = 0; + } if (td->td_retval[1] == 1) td->td_retval[0] = 0; @@ -468,6 +475,14 @@ if (error) return (error); + td2 = FIRST_THREAD_IN_PROC(p2); + + /* make it run */ + mtx_lock_spin(&sched_lock); + TD_SET_CAN_RUN(td2); + setrunqueue(td2, SRQ_BORING); + mtx_unlock_spin(&sched_lock); + return (0); } @@ -476,6 +491,7 @@ { int error; struct proc *p2; + struct thread *td2; #ifdef DEBUG if (ldebug(vfork)) @@ -483,7 +499,7 @@ #endif /* exclude RFPPWAIT */ - if ((error = fork1(td, RFFDG | RFPROC | RFMEM, 0, &p2)) != 0) + if ((error = fork1(td, RFFDG | RFPROC | RFMEM | RFSTOPPED, 0, &p2)) != 0) return (error); if (error == 0) { td->td_retval[0] = p2->p_pid; @@ -495,12 +511,25 @@ error = linux_proc_init(td, td->td_retval[0], 0); if (error) return (error); + + PROC_LOCK(p2); + p2->p_flag |= P_PPWAIT; + PROC_UNLOCK(p2); + + td2 = FIRST_THREAD_IN_PROC(p2); + + /* make it run */ + mtx_lock_spin(&sched_lock); + TD_SET_CAN_RUN(td2); + setrunqueue(td2, SRQ_BORING); + mtx_unlock_spin(&sched_lock); + /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; while (p2->p_flag & P_PPWAIT) msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); PROC_UNLOCK(p2); + return (0); } @@ -632,6 +661,11 @@ printf(LMSG("clone: successful rfork to %ld, stack %p sig = %d"), (long)p2->p_pid, args->stack, exit_signal); #endif + if (args->flags & CLONE_VFORK) { + PROC_LOCK(p2); + p2->p_flag |= P_PPWAIT; + PROC_UNLOCK(p2); + } /* * Make this runnable after we are finished with it. @@ -647,7 +681,6 @@ if (args->flags & CLONE_VFORK) { /* wait for the children to exit, ie. emulate vfork */ PROC_LOCK(p2); - p2->p_flag |= P_PPWAIT; while (p2->p_flag & P_PPWAIT) msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0); PROC_UNLOCK(p2); ==== //depot/projects/soc2006/intr_filter/arm/at91/uart_dev_at91usart.c#5 (text) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.10 2006/12/07 00:24:15 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.11 2007/01/18 22:01:19 marius Exp $"); #include "opt_comconsole.h" @@ -94,7 +94,7 @@ static void at91_usart_init(struct uart_bas *bas, int, int, int, int); static void at91_usart_term(struct uart_bas *bas); static void at91_usart_putc(struct uart_bas *bas, int); -static int at91_usart_poll(struct uart_bas *bas); +static int at91_usart_rxready(struct uart_bas *bas); static int at91_usart_getc(struct uart_bas *bas, struct mtx *mtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -201,7 +201,7 @@ .init = at91_usart_init, .term = at91_usart_term, .putc = at91_usart_putc, - .poll = at91_usart_poll, + .rxready = at91_usart_rxready, .getc = at91_usart_getc, }; @@ -252,15 +252,13 @@ } /* - * Poll for a character available + * Check for a character available. */ static int -at91_usart_poll(struct uart_bas *bas) +at91_usart_rxready(struct uart_bas *bas) { - if (!(RD4(bas, USART_CSR) & USART_CSR_RXRDY)) - return (-1); - return (RD4(bas, USART_RHR) & 0xff); + return ((RD4(bas, USART_CSR) & USART_CSR_RXRDY) != 0 ? 1 : 0); } /* ==== //depot/projects/soc2006/intr_filter/arm/sa11x0/uart_dev_sa1110.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.6 2006/06/07 11:28:17 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.7 2007/01/18 22:01:19 marius Exp $"); #include #include @@ -52,7 +52,7 @@ static void sa1110_init(struct uart_bas *bas, int, int, int, int); static void sa1110_term(struct uart_bas *bas); static void sa1110_putc(struct uart_bas *bas, int); -static int sa1110_poll(struct uart_bas *bas); +static int sa1110_rxready(struct uart_bas *bas); static int sa1110_getc(struct uart_bas *bas, struct mtx *mtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -62,7 +62,7 @@ .init = sa1110_init, .term = sa1110_term, .putc = sa1110_putc, - .poll = sa1110_poll, + .rxready = sa1110_rxready, .getc = sa1110_getc, }; @@ -102,11 +102,10 @@ } static int -sa1110_poll(struct uart_bas *bas) +sa1110_rxready(struct uart_bas *bas) { - if (!(uart_getreg(bas, SACOM_SR1) & SR1_RNE)) - return (-1); - return (uart_getreg(bas, SACOM_DR) & 0xff); + + return ((uart_getreg(bas, SACOM_SR1) & SR1_RNE) != 0 ? 1 : 0); } static int ==== //depot/projects/soc2006/intr_filter/compat/linprocfs/linprocfs.c#8 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.101 2006/11/27 21:10:55 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.105 2007/01/21 13:18:52 netchild Exp $"); #include #include @@ -121,7 +121,7 @@ * This character array is used with ki_stati-1 as an index and tries to * map our states to suitable linux states. */ -static char *linux_state = "RRSTZDD"; +static char linux_state[] = "RRSTZDD"; /* * Filler function for proc/meminfo @@ -462,15 +462,25 @@ linprocfs_doprocstat(PFS_FILL_ARGS) { struct kinfo_proc kp; + char state; + static int ratelimit = 0; PROC_LOCK(p); fill_kinfo_proc(p, &kp); sbuf_printf(sb, "%d", p->p_pid); #define PS_ADD(name, fmt, arg) sbuf_printf(sb, " " fmt, arg) PS_ADD("comm", "(%s)", p->p_comm); - KASSERT(kp.ki_stat <= sizeof(linux_state), - ("linprocfs: don't know how to handle unknown FreeBSD state")); - PS_ADD("state", "%c", linux_state[kp.ki_stat - 1]); + if (kp.ki_stat > sizeof(linux_state)) { + state = 'R'; + + if (ratelimit == 0) { + printf("linprocfs: don't know how to handle unknown FreeBSD state %d/%zd, mapping to R\n", + kp.ki_stat, sizeof(linux_state)); + ++ratelimit; + } + } else + state = linux_state[kp.ki_stat - 1]; + PS_ADD("state", "%c", state); PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0); PS_ADD("pgrp", "%d", p->p_pgid); PS_ADD("session", "%d", p->p_session->s_sid); ==== //depot/projects/soc2006/intr_filter/compat/linux/linux_emul.c#7 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.12 2007/01/07 19:09:20 netchild Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_emul.c,v 1.13 2007/01/20 14:58:59 netchild Exp $"); #include "opt_compat.h" @@ -91,17 +91,12 @@ struct linux_emuldata_shared *s; s = malloc(sizeof *s, M_LINUX, M_WAITOK | M_ZERO); - em->shared = s; s->refs = 1; s->group_pid = child; LIST_INIT(&s->threads); + em->shared = s; } - p = pfind(child); - KASSERT(p != NULL, ("process not found in proc_init\n")); - p->p_emuldata = em; - PROC_UNLOCK(p); - EMUL_LOCK(&emul_lock); } else { /* lookup the old one */ em = em_find(td->td_proc, EMUL_DOLOCK); @@ -120,11 +115,12 @@ if (flags & CLONE_THREAD) { /* lookup the parent */ EMUL_SHARED_WLOCK(&emul_shared_lock); - p_em = em_find(td->td_proc, EMUL_DONTLOCK); + p_em = em_find(td->td_proc, EMUL_DOLOCK); KASSERT(p_em != NULL, ("proc_init: parent emuldata not found for CLONE_THREAD\n")); em->shared = p_em->shared; em->shared->refs++; EMUL_SHARED_WUNLOCK(&emul_shared_lock); + EMUL_UNLOCK(&emul_lock); } else { /* * handled earlier to avoid malloc(M_WAITOK) with @@ -133,12 +129,13 @@ } } if (child != 0) { - EMUL_UNLOCK(&emul_lock); EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_INSERT_HEAD(&em->shared->threads, em, threads); EMUL_SHARED_WUNLOCK(&emul_shared_lock); p = pfind(child); + KASSERT(p != NULL, ("process not found in proc_init\n")); + p->p_emuldata = em; /* we might have a sleeping linux_schedtail */ wakeup(&p->p_emuldata); PROC_UNLOCK(p); ==== //depot/projects/soc2006/intr_filter/compat/linux/linux_file.c#6 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.100 2007/01/18 09:32:08 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.101 2007/01/18 10:42:10 kib Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/soc2006/intr_filter/conf/files.sparc64#5 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.sparc64,v 1.86 2007/01/16 22:08:27 marius Exp $ +# $FreeBSD: src/sys/conf/files.sparc64,v 1.87 2007/01/20 12:53:30 marius Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -49,7 +49,9 @@ dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc dev/kbd/kbd.c optional atkbd | sc | ukbd +dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus +dev/le/lebuffer_sbus.c optional le sbus dev/ofw/ofw_bus_if.m standard dev/ofw/ofw_bus_subr.c standard dev/ofw/ofw_console.c optional ofw_console ==== //depot/projects/soc2006/intr_filter/conf/options#12 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.572 2007/01/10 18:45:17 marius Exp $ +# $FreeBSD: src/sys/conf/options,v 1.573 2007/01/18 13:33:36 marius Exp $ # # On the handling of kernel options # @@ -662,6 +662,8 @@ DEV_CARP opt_carp.h DEV_SPLASH opt_splash.h +# EISA support +DEV_EISA opt_eisa.h EISA_SLOTS opt_eisa.h # ed driver ==== //depot/projects/soc2006/intr_filter/conf/options.sun4v#2 (text+ko) ==== @@ -1,12 +1,7 @@ -# $FreeBSD: src/sys/conf/options.sun4v,v 1.1 2006/10/05 06:14:24 kmacy Exp $ +# $FreeBSD: src/sys/conf/options.sun4v,v 1.2 2007/01/19 12:22:50 marius Exp $ SUN4V opt_global.h -GFB_DEBUG opt_gfb.h -GFB_NO_FONT_LOADING opt_gfb.h -GFB_NO_MODE_CHANGE opt_gfb.h - -DEBUGGER_ON_POWERFAIL opt_psycho.h OFW_PCI_DEBUG opt_ofw_pci.h OFWCONS_POLL_HZ opt_ofw.h # Debug IOMMU inserts/removes using diagnostic accesses. Very loud. ==== //depot/projects/soc2006/intr_filter/dev/aic7xxx/aic79xx.h#2 (text+ko) ==== @@ -39,7 +39,7 @@ * * $Id: //depot/aic7xxx/aic7xxx/aic79xx.h#107 $ * - * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.h,v 1.24 2005/01/06 01:42:25 imp Exp $ + * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.h,v 1.25 2007/01/19 22:37:52 jhb Exp $ */ #ifndef _AIC79XX_H_ @@ -1244,6 +1244,9 @@ /* PCI cacheline size. */ u_int pci_cachesize; + /* PCI-X capability offset. */ + int pcix_ptr; + /* IO Cell Parameters */ uint8_t iocell_opts[AHD_NUM_PER_DEV_ANNEXCOLS]; ==== //depot/projects/soc2006/intr_filter/dev/aic7xxx/aic79xx_pci.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #include "aic79xx_inline.h" #else #include -__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.24 2005/12/04 02:12:40 ru Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.25 2007/01/19 22:37:52 jhb Exp $"); #include #include #endif @@ -342,7 +342,12 @@ error = entry->setup(ahd); if (error != 0) return (error); - + + /* + * Find the PCI-X cap pointer. If we don't find it, + * pcix_ptr will be 0. + */ + pci_find_extcap(ahd->dev_softc, PCIY_PCIX, &ahd->pcix_ptr); devconfig = aic_pci_read_config(ahd->dev_softc, DEVCONFIG, /*bytes*/4); if ((devconfig & PCIXINITPAT) == PCIXINIT_PCI33_66) { ahd->chip |= AHD_PCI; @@ -350,6 +355,8 @@ ahd->bugs &= ~AHD_PCIX_BUG_MASK; } else { ahd->chip |= AHD_PCIX; + if (ahd->pcix_ptr == 0) + return (ENXIO); } ahd->bus_description = pci_bus_modes[PCI_BUS_MODES_INDEX(devconfig)]; @@ -867,16 +874,16 @@ uint8_t sg_split_status1[2]; ahd_mode_state saved_modes; u_int i; - uint16_t pcix_status; + uint32_t pcix_status; /* * Check for splits in all modes. Modes 0 and 1 * additionally have SG engine splits to look at. */ - pcix_status = aic_pci_read_config(ahd->dev_softc, PCIXR_STATUS, - /*bytes*/2); + pcix_status = aic_pci_read_config(ahd->dev_softc, + ahd->pcix_ptr + PCIXR_STATUS, /*bytes*/ 4); printf("%s: PCI Split Interrupt - PCI-X status = 0x%x\n", - ahd_name(ahd), pcix_status); + ahd_name(ahd), pcix_status >> 16); saved_modes = ahd_save_modes(ahd); for (i = 0; i < 4; i++) { ahd_set_modes(ahd, i, i); @@ -922,8 +929,8 @@ /* * Clear PCI-X status bits. */ - aic_pci_write_config(ahd->dev_softc, PCIXR_STATUS, - pcix_status, /*bytes*/2); + aic_pci_write_config(ahd->dev_softc, ahd->pcix_ptr + PCIXR_STATUS, + pcix_status, /*bytes*/4); ahd_outb(ahd, CLRINT, CLRSPLTINT); ahd_restore_modes(ahd, saved_modes); } ==== //depot/projects/soc2006/intr_filter/dev/bce/if_bce.c#11 (text) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.25 2007/01/13 04:35:15 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.26 2007/01/20 17:05:12 scottl Exp $"); /* * The following controllers are supported by this driver: @@ -5231,7 +5231,7 @@ { struct ifnet *ifp; struct ifmultiaddr *ifma; - u32 hashes[4] = { 0, 0, 0, 0 }; + u32 hashes[NUM_MC_HASH_REGISTERS] = { 0, 0, 0, 0, 0, 0, 0, 0 }; u32 rx_mode, sort_mode; int h, i; @@ -5279,12 +5279,12 @@ if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_le(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F; - hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); + ifma->ifma_addr), ETHER_ADDR_LEN) & 0xFF; + hashes[(h & 0xE0) >> 5] |= 1 << (h & 0x1F); } IF_ADDR_UNLOCK(ifp); - for (i = 0; i < 4; i++) + for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) REG_WR(sc, BCE_EMAC_MULTICAST_HASH0 + (i * 4), hashes[i]); sort_mode |= BCE_RPM_SORT_USER0_MC_HSH_EN; ==== //depot/projects/soc2006/intr_filter/dev/cardbus/cardbus.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.62 2006/06/12 03:17:24 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.63 2007/01/19 08:49:28 imp Exp $"); #include #include @@ -217,7 +217,8 @@ int tmp; int err = 0; - device_get_children(cbdev, &devlist, &numdevs); + if (device_get_children(cbdev, &devlist, &numdevs) != 0) + return (ENOENT); if (numdevs == 0) { free(devlist, M_TEMP); @@ -251,7 +252,9 @@ struct cardbus_devinfo *dinfo; DEVICE_IDENTIFY(driver, cbdev); - device_get_children(cbdev, &devlist, &numdevs); + if (device_get_children(cbdev, &devlist, &numdevs) != 0) + return; + /* * If there are no drivers attached, but there are children, * then power the card up. ==== //depot/projects/soc2006/intr_filter/dev/dpt/dpt.h#2 (text+ko) ==== @@ -40,7 +40,7 @@ */ -#ident "$FreeBSD: src/sys/dev/dpt/dpt.h,v 1.16 2005/01/06 01:42:35 imp Exp $" +#ident "$FreeBSD: src/sys/dev/dpt/dpt.h,v 1.17 2007/01/18 13:33:36 marius Exp $" #ifndef _DPT_H #define _DPT_H @@ -1292,7 +1292,9 @@ int dpt_attach(dpt_softc_t * dpt); void dpt_intr(void *arg); +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf(u_int32_t); +#endif #if 0 extern void hex_dump(u_char * data, int length, ==== //depot/projects/soc2006/intr_filter/dev/dpt/dpt_eisa.c#4 (text+ko) ==== @@ -26,7 +26,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_eisa.c,v 1.21 2006/12/11 18:28:30 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_eisa.c,v 1.22 2007/01/18 13:33:36 marius Exp $"); + +#include "opt_eisa.h" #include #include ==== //depot/projects/soc2006/intr_filter/dev/dpt/dpt_scsi.c#4 (text+ko) ==== @@ -27,9 +27,9 @@ * SUCH DAMAGE. */ -#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $" +#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.55 2007/01/18 13:33:36 marius Exp $" #include -__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.55 2007/01/18 13:33:36 marius Exp $"); /* * dpt_scsi.c: SCSI dependant code for the DPT driver @@ -50,6 +50,8 @@ #define _DPT_C_ #include "opt_dpt.h" +#include "opt_eisa.h" + #include #include #include @@ -106,7 +108,9 @@ /* ================= Private Inline Function declarations ===================*/ static __inline int dpt_just_reset(dpt_softc_t * dpt); static __inline int dpt_raid_busy(dpt_softc_t * dpt); +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t, u_int, u_int, u_int); +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state); static __inline struct dpt_ccb* dptgetccb(struct dpt_softc *dpt); @@ -181,6 +185,7 @@ return (0); } +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t base, u_int reg, u_int bits, u_int state) { @@ -196,6 +201,7 @@ } return (-1); } +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state) @@ -386,6 +392,7 @@ return (i); } +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf (u_int32_t base) { @@ -478,6 +485,7 @@ } return (NULL); } +#endif /* * Read a configuration page into the supplied dpt_cont_t buffer. ==== //depot/projects/soc2006/intr_filter/dev/fb/fbreg.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (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: src/sys/dev/fb/fbreg.h,v 1.20 2005/12/06 11:19:36 ru Exp $ + * $FreeBSD: src/sys/dev/fb/fbreg.h,v 1.21 2007/01/18 13:08:08 marius Exp $ */ #ifndef _DEV_FB_FBREG_H_ @@ -50,7 +50,8 @@ #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) -#elif defined(__ia64__) +#elif defined(__ia64__) || defined(__sparc64__) +#if defined(__ia64__) #include #define bcopy_fromio(s, d, c) \ bus_space_read_region_1(IA64_BUS_SPACE_MEM, s, 0, (void*)(d), c) @@ -69,6 +70,7 @@ #define writeb(a, v) bus_space_write_1(IA64_BUS_SPACE_MEM, a, 0, v) #define writew(a, v) bus_space_write_2(IA64_BUS_SPACE_MEM, a, 0, v) #define writel(a, v) bus_space_write_4(IA64_BUS_SPACE_MEM, a, 0, v) +#endif /* __ia64__ */ static __inline void fillw(int val, uint16_t *buf, size_t size) { @@ -91,7 +93,7 @@ u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); -#else /* !__i386__ && !__ia64__ && !__amd64__ && !__powerpc__ */ +#else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) ==== //depot/projects/soc2006/intr_filter/dev/isp/isp.c#12 (text+ko) ==== @@ -43,7 +43,7 @@ #endif #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.136 2007/01/05 22:59:26 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp.c,v 1.137 2007/01/20 04:00:20 mjacob Exp $"); #include #endif #ifdef __OpenBSD__ @@ -1170,6 +1170,14 @@ isp->isp_maxluns = 16; } } + /* + * Must do this first to get defaults established. + */ + isp_setdfltparm(isp, 0); + if (IS_DUALBUS(isp)) { + isp_setdfltparm(isp, 1); + } + } /* @@ -1181,14 +1189,6 @@ void isp_init(ispsoftc_t *isp) { - /* - * Must do this first to get defaults established. - */ - isp_setdfltparm(isp, 0); - if (IS_DUALBUS(isp)) { - isp_setdfltparm(isp, 1); - } - if (IS_FC(isp)) { /* * Do this *before* initializing the firmware. @@ -3956,6 +3956,7 @@ static uint16_t isp_nxt_handle(ispsoftc_t *isp, uint16_t handle) { + int i; if (handle == NIL_HANDLE) { if (FCPARAM(isp)->isp_topo == TOPO_F_PORT) { handle = 0; @@ -3982,9 +3983,16 @@ } if (handle == FCPARAM(isp)->isp_loopid) { return (isp_nxt_handle(isp, handle)); - } else { - return (handle); + } + for (i = 0; i < MAX_FC_TARG; i++) { + if (FCPARAM(isp)->portdb[i].state == FC_PORTDB_STATE_NIL) { + continue; + } + if (FCPARAM(isp)->portdb[i].handle == handle) { + return (isp_nxt_handle(isp, handle)); + } } + return (handle); } /* @@ -7034,15 +7042,16 @@ fcp->isp_retry_count = ICB_DFLT_RCOUNT; /* Platform specific.... */ fcp->isp_loopid = DEFAULT_LOOPID(isp); - fcp->isp_nodewwn = DEFAULT_NODEWWN(isp); - fcp->isp_portwwn = DEFAULT_PORTWWN(isp); + fcp->isp_wwnn_nvram = DEFAULT_NODEWWN(isp); + fcp->isp_wwpn_nvram = DEFAULT_PORTWWN(isp); fcp->isp_fwoptions = 0; fcp->isp_fwoptions |= ICBOPT_FAIRNESS; fcp->isp_fwoptions |= ICBOPT_PDBCHANGE_AE; fcp->isp_fwoptions |= ICBOPT_HARD_ADDRESS; fcp->isp_fwoptions |= ICBOPT_FAST_POST; - if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) + if (isp->isp_confopts & ISP_CFG_FULL_DUPLEX) { fcp->isp_fwoptions |= ICBOPT_FULL_DUPLEX; + } /* * Make sure this is turned off now until we get @@ -7052,7 +7061,7 @@ /* * Now try and read NVRAM unless told to not do so. - * This will set fcparam's isp_nodewwn && isp_portwwn. + * This will set fcparam's isp_wwnn_nvram && isp_wwpn_nvram. */ if ((isp->isp_confopts & ISP_CFG_NONVRAM) == 0) { nvfail = isp_read_nvram(isp); @@ -7081,8 +7090,8 @@ * We always start out with values derived * from NVRAM or our platform default. */ - ISP_NODEWWN(isp) = fcp->isp_nodewwn; - if (fcp->isp_nodewwn == 0) { + ISP_NODEWWN(isp) = fcp->isp_wwnn_nvram; + if (fcp->isp_wwnn_nvram == 0) { isp_prt(isp, ISP_LOGCONFIG, "bad WWNN- using default"); ISP_NODEWWN(isp) = DEFAULT_NODEWWN(isp); @@ -7098,8 +7107,8 @@ * We always start out with values derived * from NVRAM or our platform default. */ - ISP_PORTWWN(isp) = fcp->isp_portwwn; - if (fcp->isp_portwwn == 0) { + ISP_PORTWWN(isp) = fcp->isp_wwpn_nvram; + if (fcp->isp_wwpn_nvram == 0) { isp_prt(isp, ISP_LOGCONFIG, "bad WWPN- using default"); ISP_PORTWWN(isp) = DEFAULT_PORTWWN(isp); @@ -7841,10 +7850,10 @@ /* * Make sure we have both Node and Port as non-zero values. */ - if (fcp->isp_nodewwn != 0 && fcp->isp_portwwn == 0) { - fcp->isp_portwwn = fcp->isp_nodewwn; - } else if (fcp->isp_nodewwn == 0 && fcp->isp_portwwn != 0) { - fcp->isp_nodewwn = fcp->isp_portwwn; + if (fcp->isp_wwnn_nvram != 0 && fcp->isp_wwpn_nvram == 0) { + fcp->isp_wwpn_nvram = fcp->isp_wwnn_nvram; + } else if (fcp->isp_wwnn_nvram == 0 && fcp->isp_wwpn_nvram != 0) { + fcp->isp_wwnn_nvram = fcp->isp_wwpn_nvram; } /* @@ -7853,14 +7862,14 @@ * make sure that there's some non-zero value in 48..56 * for the Port WWN. */ - if (fcp->isp_nodewwn && fcp->isp_portwwn) { - if ((fcp->isp_nodewwn & (((uint64_t) 0xfff) << 48)) != 0 && - (fcp->isp_nodewwn >> 60) == 2) { - fcp->isp_nodewwn &= ~((uint64_t) 0xfff << 48); + if (fcp->isp_wwnn_nvram && fcp->isp_wwpn_nvram) { + if ((fcp->isp_wwnn_nvram & (((uint64_t) 0xfff) << 48)) != 0 && + (fcp->isp_wwnn_nvram >> 60) == 2) { + fcp->isp_wwnn_nvram &= ~((uint64_t) 0xfff << 48); } - if ((fcp->isp_portwwn & (((uint64_t) 0xfff) << 48)) == 0 && - (fcp->isp_portwwn >> 60) == 2) { - fcp->isp_portwwn |= ((uint64_t) 1 << 56); + if ((fcp->isp_wwpn_nvram & (((uint64_t) 0xfff) << 48)) == 0 && + (fcp->isp_wwpn_nvram >> 60) == 2) { + fcp->isp_wwpn_nvram |= ((uint64_t) 1 << 56); } } } @@ -7890,7 +7899,7 @@ wwn |= (((uint64_t) 2)<< 60); } } - fcp->isp_portwwn = wwn; + fcp->isp_wwpn_nvram = wwn; if (IS_2200(isp) || IS_23XX(isp)) { wwn = ISP2100_NVRAM_NODE_NAME(nvram_data); if (wwn) { @@ -7904,7 +7913,7 @@ } else { wwn &= ~((uint64_t) 0xfff << 48); } - fcp->isp_nodewwn = wwn; + fcp->isp_wwnn_nvram = wwn; isp_fix_nvram_wwns(isp); @@ -7924,8 +7933,8 @@ fcp->isp_fwoptions = ISP2100_NVRAM_OPTIONS(nvram_data); isp_prt(isp, ISP_LOGDEBUG0, "NVRAM 0x%08x%08x 0x%08x%08x maxalloc %d maxframelen %d", - (uint32_t) (fcp->isp_nodewwn >> 32), (uint32_t) fcp->isp_nodewwn, - (uint32_t) (fcp->isp_portwwn >> 32), (uint32_t) fcp->isp_portwwn, + (uint32_t) (fcp->isp_wwnn_nvram >> 32), (uint32_t) fcp->isp_wwnn_nvram, + (uint32_t) (fcp->isp_wwpn_nvram >> 32), (uint32_t) fcp->isp_wwpn_nvram, ISP2100_NVRAM_MAXIOCBALLOCATION(nvram_data), ISP2100_NVRAM_MAXFRAMELENGTH(nvram_data)); isp_prt(isp, ISP_LOGDEBUG0, @@ -7969,7 +7978,7 @@ wwn = 0; } } - fcp->isp_portwwn = wwn; + fcp->isp_wwpn_nvram = wwn; wwn = ISP2400_NVRAM_NODE_NAME(nvram_data); if (wwn) { @@ -7977,7 +7986,7 @@ wwn = 0; } } - fcp->isp_nodewwn = wwn; + fcp->isp_wwnn_nvram = wwn; isp_fix_nvram_wwns(isp); ==== //depot/projects/soc2006/intr_filter/dev/isp/isp_freebsd.c#9 (text+ko) ==== @@ -29,7 +29,7 @@ * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. */ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.132 2006/12/18 23:50:30 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.133 2007/01/20 04:00:20 mjacob Exp $"); #include #include #include @@ -42,6 +42,7 @@ #include #endif #include >>> TRUNCATED FOR MAIL (1000 lines) <<<