Date: Mon, 2 Apr 2007 12:32:20 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 117177 for review Message-ID: <200704021232.l32CWKoX030043@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=117177 Change 117177 by jhb@jhb_mutex on 2007/04/02 12:31:20 IFC @117176. Affected files ... .. //depot/projects/smpng/sys/amd64/amd64/support.S#19 integrate .. //depot/projects/smpng/sys/conf/NOTES#140 integrate .. //depot/projects/smpng/sys/conf/options#139 integrate .. //depot/projects/smpng/sys/dev/acpica/acpi_ec.c#44 integrate .. //depot/projects/smpng/sys/dev/ahb/ahb.c#18 integrate .. //depot/projects/smpng/sys/dev/arcmsr/arcmsr.c#15 integrate .. //depot/projects/smpng/sys/dev/ed/if_ed_pccard.c#39 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#40 integrate .. //depot/projects/smpng/sys/dev/ipmi/ipmi_pci.c#3 integrate .. //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#54 integrate .. //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#40 integrate .. //depot/projects/smpng/sys/dev/isp/isp_library.c#11 integrate .. //depot/projects/smpng/sys/dev/isp/isp_library.h#7 integrate .. //depot/projects/smpng/sys/dev/isp/isp_pci.c#54 integrate .. //depot/projects/smpng/sys/dev/isp/isp_sbus.c#25 integrate .. //depot/projects/smpng/sys/dev/mxge/if_mxge.c#14 integrate .. //depot/projects/smpng/sys/dev/pci/pci.c#89 integrate .. //depot/projects/smpng/sys/dev/pci/pci_pci.c#33 integrate .. //depot/projects/smpng/sys/dev/pci/pcireg.h#22 integrate .. //depot/projects/smpng/sys/dev/sk/if_sk.c#12 integrate .. //depot/projects/smpng/sys/dev/sk/if_skreg.h#7 integrate .. //depot/projects/smpng/sys/dev/sound/midi/midi.c#15 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/channel.c#40 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/mixer.c#27 integrate .. //depot/projects/smpng/sys/dev/sound/usb/uaudio.c#18 integrate .. //depot/projects/smpng/sys/dev/usb/if_aue.c#49 integrate .. //depot/projects/smpng/sys/dev/usb/if_axe.c#29 integrate .. //depot/projects/smpng/sys/dev/usb/ubser.c#13 integrate .. //depot/projects/smpng/sys/gnu/fs/xfs/FreeBSD/support/mrlock.c#2 integrate .. //depot/projects/smpng/sys/gnu/fs/xfs/FreeBSD/support/mrlock.h#2 integrate .. //depot/projects/smpng/sys/i386/acpica/acpi_machdep.c#26 integrate .. //depot/projects/smpng/sys/i386/i386/support.s#24 integrate .. //depot/projects/smpng/sys/i4b/layer1/ifpnp/i4b_ifpnp_avm.c#11 integrate .. //depot/projects/smpng/sys/i4b/layer1/ihfc/i4b_ihfc_pnp.c#8 integrate .. //depot/projects/smpng/sys/i4b/layer1/isic/i4b_avm_a1.c#7 integrate .. //depot/projects/smpng/sys/i4b/layer1/isic/i4b_isic_pnp.c#10 integrate .. //depot/projects/smpng/sys/i4b/layer1/isic/i4b_itk_ix1.c#8 integrate .. //depot/projects/smpng/sys/i4b/layer1/isic/i4b_tel_s016.c#8 integrate .. //depot/projects/smpng/sys/i4b/layer1/isic/i4b_tel_s0163.c#7 integrate .. //depot/projects/smpng/sys/kern/kern_sx.c#45 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#161 integrate .. //depot/projects/smpng/sys/kern/vfs_lookup.c#42 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#71 integrate .. //depot/projects/smpng/sys/kern/vfs_subr.c#139 integrate .. //depot/projects/smpng/sys/modules/cryptodev/Makefile#2 integrate .. //depot/projects/smpng/sys/netgraph/ng_base.c#49 integrate .. //depot/projects/smpng/sys/netinet/sctp_auth.c#6 integrate .. //depot/projects/smpng/sys/netinet/sctp_constants.h#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_indata.c#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_input.c#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_os_bsd.h#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_output.c#8 integrate .. //depot/projects/smpng/sys/netinet/sctp_pcb.c#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_pcb.h#6 integrate .. //depot/projects/smpng/sys/netinet/sctp_structs.h#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_sysctl.c#2 integrate .. //depot/projects/smpng/sys/netinet/sctp_sysctl.h#2 integrate .. //depot/projects/smpng/sys/netinet/sctp_uio.h#7 integrate .. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#8 integrate .. //depot/projects/smpng/sys/netinet/sctputil.c#9 integrate .. //depot/projects/smpng/sys/netinet6/in6_src.c#29 integrate .. //depot/projects/smpng/sys/netinet6/sctp6_usrreq.c#7 integrate .. //depot/projects/smpng/sys/powerpc/conf/GENERIC#42 integrate .. //depot/projects/smpng/sys/powerpc/conf/NOTES#7 integrate .. //depot/projects/smpng/sys/powerpc/powermac/uninorth.c#12 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/extintr.c#7 delete .. //depot/projects/smpng/sys/sys/_sx.h#1 branch .. //depot/projects/smpng/sys/sys/mount.h#59 integrate .. //depot/projects/smpng/sys/sys/sleepqueue.h#12 integrate .. //depot/projects/smpng/sys/sys/sx.h#25 integrate .. //depot/projects/smpng/sys/sys/vnode.h#79 integrate Differences ... ==== //depot/projects/smpng/sys/amd64/amd64/support.S#19 (text+ko) ==== @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.124 2007/03/30 19:33:52 jkim Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.126 2007/03/31 01:47:37 jkim Exp $ */ #include "opt_ddb.h" @@ -671,37 +671,18 @@ incl %eax ret -/* - * Support for BB-profiling (gcc -a). The kernbb program will extract - * the data from the kernel. - */ - - .data - ALIGN_DATA - .globl bbhead -bbhead: - .quad 0 +/*****************************************************************************/ +/* linux_futex support */ +/*****************************************************************************/ - .text -NON_GPROF_ENTRY(__bb_init_func) - movq $1,(%rdi) - movq bbhead,%rax - movq %rax,32(%rdi) - movq %rdi,bbhead - NON_GPROF_RET - - .text - futex_fault: - movq PCPU(CURPCB),%rdx - movq $0,PCB_ONFAULT(%rdx) + movq $0,PCB_ONFAULT(%rcx) movq $-EFAULT,%rax ret -/* int futex_xchgl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_xchgl) - movq PCPU(CURPCB),%r11 - movq $futex_fault,PCB_ONFAULT(%r11) + movq PCPU(CURPCB),%rcx + movq $futex_fault,PCB_ONFAULT(%rcx) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi @@ -713,13 +694,12 @@ xchgl %edi,(%rsi) movl %edi,(%rdx) xorl %eax,%eax - movq %rax,PCB_ONFAULT(%r11) + movq %rax,PCB_ONFAULT(%rcx) ret -/* int futex_addl(int oparg, caddr_t uaddr, int *oldval); */ ENTRY(futex_addl) - movq PCPU(CURPCB),%r11 - movq $futex_fault,PCB_ONFAULT(%r11) + movq PCPU(CURPCB),%rcx + movq $futex_fault,PCB_ONFAULT(%rcx) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rsi @@ -731,5 +711,24 @@ xaddl %edi,(%rsi) movl %edi,(%rdx) xorl %eax,%eax - movq %rax,PCB_ONFAULT(%r11) + movq %rax,PCB_ONFAULT(%rcx) ret + +/* + * Support for BB-profiling (gcc -a). The kernbb program will extract + * the data from the kernel. + */ + + .data + ALIGN_DATA + .globl bbhead +bbhead: + .quad 0 + + .text +NON_GPROF_ENTRY(__bb_init_func) + movq $1,(%rdi) + movq bbhead,%rax + movq %rax,32(%rdi) + movq %rdi,bbhead + NON_GPROF_RET ==== //depot/projects/smpng/sys/conf/NOTES#140 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1416 2007/03/26 09:10:28 yar Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1418 2007/04/02 01:04:20 mjacob Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -214,6 +214,12 @@ # to sleep rather than spinning. options ADAPTIVE_GIANT +# ADAPTIVE_SX changes the behavior of sx locks to spin if the thread +# that currently owns the lock is executing on another CPU. Note that +# in addition to enabling this option, individual sx locks must be +# initialized with the SX_ADAPTIVESPIN flag. +options ADAPTIVE_SX + # MUTEX_NOINLINE forces mutex operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is @@ -233,6 +239,13 @@ # and WITNESS options. options RWLOCK_NOINLINE +# SX_NOINLINE forces sx lock operations to call functions to perform each +# operation rather than inlining the simple cases. This can be used to +# shrink the size of the kernel text segment. Note that this behavior is +# already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, +# and WITNESS options. +options SX_NOINLINE + # SMP Debugging Options: # # PREEMPTION allows the threads that are in the kernel to be preempted @@ -1521,9 +1534,13 @@ # options ISP_TARGET_MODE=1 # -# ISP_DEFAULT_ROLES - default role (none, target, init, both) +# ISP_DEFAULT_ROLES - default role +# none=0 +# target=1 +# initiator=2 +# both=3 (not supported currently) # -options ISP_DEFAULT_ROLES=3 +options ISP_DEFAULT_ROLES=2 # Options used in dev/sym/ (Symbios SCSI driver). #options SYM_SETUP_LP_PROBE_MAP #-Low Priority Probe Map (bits) ==== //depot/projects/smpng/sys/conf/options#139 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.583 2007/03/27 19:32:40 jhb Exp $ +# $FreeBSD: src/sys/conf/options,v 1.584 2007/03/31 23:23:41 jhb Exp $ # # On the handling of kernel options # @@ -59,6 +59,7 @@ # Miscellaneous options. ADAPTIVE_GIANT opt_adaptive_mutexes.h +ADAPTIVE_SX ALQ AUDIT opt_global.h CODA_COMPAT_5 opt_coda.h @@ -555,6 +556,7 @@ REGRESSION opt_global.h RESTARTABLE_PANICS opt_global.h RWLOCK_NOINLINE opt_global.h +SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h # These are VM related options ==== //depot/projects/smpng/sys/dev/acpica/acpi_ec.c#44 (text+ko) ==== @@ -136,12 +136,13 @@ *****************************************************************************/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.72 2007/03/22 18:16:40 jkim Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.73 2007/03/31 23:23:41 jhb Exp $"); #include "opt_acpi.h" #include <sys/param.h> #include <sys/kernel.h> #include <sys/bus.h> +#include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/sx.h> ==== //depot/projects/smpng/sys/dev/ahb/ahb.c#18 (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.39 2007/02/23 12:18:30 piso Exp $ + * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.40 2007/04/01 16:55:31 netchild Exp $ */ #include <sys/param.h> @@ -378,8 +378,10 @@ goto error_exit; /* Enable our interrupt */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr, - ahb, &ih); + if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, ahbintr, + ahb, &ih) != 0) + goto error_exit; + return (0); error_exit: ==== //depot/projects/smpng/sys/dev/arcmsr/arcmsr.c#15 (text+ko) ==== @@ -56,7 +56,7 @@ ** and cause g_vfs_done() read write error ****************************************************************************************** -* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.20 2007/03/12 05:10:29 mjacob Exp $ +* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.21 2007/04/02 03:31:37 scottl Exp $ */ #include <sys/param.h> #include <sys/systm.h> @@ -1270,8 +1270,7 @@ , acb->pci_unit, error); } if((pccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INPROG) { - xpt_freeze_devq(pccb->ccb_h.path, /*count*/1); - pccb->ccb_h.status |= (CAM_REQ_TOO_BIG|CAM_DEV_QFRZN); + pccb->ccb_h.status |= CAM_REQ_TOO_BIG; } arcmsr_srb_complete(srb, 0); return; @@ -1307,14 +1306,14 @@ arcmsr_srb_complete(srb, 0); return; } - pccb->ccb_h.status |= CAM_SIM_QUEUED; if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) { - pccb->ccb_h.status &= ~CAM_STATUS_MASK; - pccb->ccb_h.status |= (CAM_REQUEUE_REQ|CAM_DEV_QFRZN); + xpt_freeze_simq(acb->psim, 1); + pccb->ccb_h.status = CAM_REQUEUE_REQ; acb->acb_flags |= ACB_F_CAM_DEV_QFRZN; arcmsr_srb_complete(srb, 0); return; } + pccb->ccb_h.status |= CAM_SIM_QUEUED; arcmsr_build_srb(srb, dm_segs, nseg); arcmsr_post_srb(acb, srb); return; ==== //depot/projects/smpng/sys/dev/ed/if_ed_pccard.c#39 (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/ed/if_ed_pccard.c,v 1.111 2007/02/23 12:18:38 piso Exp $ + * $FreeBSD: src/sys/dev/ed/if_ed_pccard.c,v 1.112 2007/04/01 14:15:26 netchild Exp $ */ /* @@ -541,7 +541,7 @@ sc->chip_type == ED_CHIP_TYPE_DL10022) { /* Probe for an MII bus, but ignore errors. */ ed_pccard_dl100xx_mii_reset(sc); - mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, + (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts); } else if (sc->chip_type == ED_CHIP_TYPE_AX88190) { ed_pccard_ax88x90_mii_reset(sc); ==== //depot/projects/smpng/sys/dev/firewire/fwohci_pci.c#40 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.58 2007/03/19 03:41:27 simokawa Exp $ + * $FreeBSD: src/sys/dev/firewire/fwohci_pci.c,v 1.59 2007/03/30 22:25:26 simokawa Exp $ */ #define BOUNCE_BUFFER_TEST 0 @@ -424,19 +424,18 @@ FWOHCI_INTMASKCLR, OHCI_INT_EN); if (sc->irq_res) { - int err = bus_teardown_intr(self, sc->irq_res, sc->ih); - if (err) - /* XXX or should we panic? */ - device_printf(self, "Could not tear down irq, %d\n", - err); + int err; + if (sc->ih) { + err = bus_teardown_intr(self, sc->irq_res, sc->ih); + if (err) + device_printf(self, + "Could not tear down irq, %d\n", err); #if defined(__DragonFly__) || __FreeBSD_version < 500000 - bus_teardown_intr(self, sc->irq_res, sc->ih_cam); - bus_teardown_intr(self, sc->irq_res, sc->ih_bio); + bus_teardown_intr(self, sc->irq_res, sc->ih_cam); + bus_teardown_intr(self, sc->irq_res, sc->ih_bio); #endif - sc->ih = NULL; - } - - if (sc->irq_res) { + sc->ih = NULL; + } bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res); sc->irq_res = NULL; } ==== //depot/projects/smpng/sys/dev/ipmi/ipmi_pci.c#3 (text) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_pci.c,v 1.2 2006/09/22 22:11:29 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_pci.c,v 1.4 2007/03/31 21:39:02 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -185,7 +185,7 @@ { if (pci_get_class(dev) == PCIC_SERIALBUS && - pci_get_subclass(dev) == 0x07) { + pci_get_subclass(dev) == PCIS_SERIALBUS_IPMI) { device_set_desc(dev, "IPMI System Interface"); return (BUS_PROBE_GENERIC); } @@ -204,13 +204,13 @@ /* Interface is determined by progif. */ switch (pci_get_progif(dev)) { - case 0: + case PCIP_SERIALBUS_IPMI_SMIC: iface = SMIC_MODE; break; - case 1: + case PCIP_SERIALBUS_IPMI_KCS: iface = KCS_MODE; break; - case 2: + case PCIP_SERIALBUS_IPMI_BT: iface = BT_MODE; device_printf(dev, "BT interface unsupported\n"); return (ENXIO); @@ -220,12 +220,9 @@ return (ENXIO); } - /* - * Bottom bit of bar indicates resouce type. There should be - * constants in pcireg.h for fields in a BAR. - */ + /* Check the BAR to determine our resource type. */ sc->ipmi_io_rid = PCIR_BAR(0); - if (pci_read_config(dev, PCIR_BAR(0), 4) & 0x1) + if (PCI_BAR_IO(pci_read_config(dev, PCIR_BAR(0), 4))) type = SYS_RES_IOPORT; else type = SYS_RES_MEMORY; ==== //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#54 (text+ko) ==== @@ -28,7 +28,7 @@ * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.136 2007/03/12 04:54:30 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.137 2007/04/02 01:04:20 mjacob Exp $"); #include <dev/isp/isp_freebsd.h> #include <sys/unistd.h> #include <sys/kthread.h> @@ -382,6 +382,14 @@ retval = EINVAL; break; } + /* + * XXX: Current + */ + if (nr == ISP_ROLE_BOTH) { + isp_prt(isp, ISP_LOGERR, "dual roles not supported"); + retval = EINVAL; + break; + } *(int *)addr = isp->isp_role; isp->isp_role = nr; /* FALLTHROUGH */ @@ -1133,7 +1141,7 @@ static void isp_ledone(ispsoftc_t *isp, lun_entry_t *lep) { - const char lfmt[] = "now %sabled for target mode"; + const char lfmt[] = "now %sabled for target mode\n"; union ccb *ccb; uint32_t seq; tstate_t *tptr; ==== //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#40 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.102 2007/03/13 06:46:08 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.104 2007/04/02 01:04:20 mjacob Exp $ */ /*- * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * @@ -532,4 +532,10 @@ #include <dev/isp/isp_library.h> +/* + * XXX: Temp + */ +#if ISP_DEFAULT_ROLES == ISP_ROLE_BOTH +#error "Dual Role Temporarily Unsupported" +#endif #endif /* _ISP_FREEBSD_H */ ==== //depot/projects/smpng/sys/dev/isp/isp_library.c#11 (text) ==== @@ -34,7 +34,7 @@ #endif #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.12 2007/03/22 23:38:31 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_library.c,v 1.13 2007/04/02 01:04:20 mjacob Exp $"); #include <dev/isp/isp_freebsd.h> #endif #ifdef __OpenBSD__ @@ -1499,12 +1499,12 @@ void * isp_find_xs_tgt(ispsoftc_t *isp, uint32_t handle) { - if (handle == 0 || (handle & 0x8000) == 0 || - (handle & 0x7fff) > isp->isp_maxcmds) { + if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 || + (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) { isp_prt(isp, ISP_LOGERR, "bad handle in isp_find_xs_tgt"); return (NULL); } else { - return (isp->isp_tgtlist[(handle & 0x7fff) - 1]); + return (isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1]); } } @@ -1515,7 +1515,7 @@ if (xs != NULL) { for (i = 0; i < isp->isp_maxcmds; i++) { if (isp->isp_tgtlist[i] == xs) { - return ((i+1) & 0x7fff); + return ((i+1) & ISP_HANDLE_MASK); } } } @@ -1525,12 +1525,12 @@ void isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle) { - if (handle == 0 || (handle & 0x8000) == 0 || - (handle & 0x7fff) > isp->isp_maxcmds) { + if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 || + (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) { isp_prt(isp, ISP_LOGERR, "bad handle in isp_destroy_tgt_handle"); } else { - isp->isp_tgtlist[(handle & 0x7fff) - 1] = NULL; + isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1] = NULL; } } ==== //depot/projects/smpng/sys/dev/isp/isp_library.h#7 (text) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_library.h,v 1.7 2007/03/22 23:38:31 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_library.h,v 1.8 2007/04/02 01:04:20 mjacob Exp $ */ /*- * Copyright (c) 1997-2007 by Matthew Jacob * All rights reserved. @@ -128,6 +128,8 @@ extern void isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); extern void isp_put_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); +#define ISP_HANDLE_MASK 0x7fff + #ifdef ISP_TARGET_MODE #if defined(__NetBSD__) || defined(__OpenBSD__) #include <dev/ic/isp_target.h> ==== //depot/projects/smpng/sys/dev/isp/isp_pci.c#54 (text+ko) ==== @@ -28,7 +28,7 @@ * FreeBSD Version. */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.141 2007/03/22 23:38:32 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.142 2007/04/02 01:04:20 mjacob Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1994,7 +1994,7 @@ cto->ct_scsi_status = 0; pcs = (struct isp_pcisoftc *)isp; - dp = &pcs->dmaps[isp_handle_index(handle)]; + dp = &pcs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)]; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREREAD); } else { @@ -2388,7 +2388,7 @@ isp = mp->isp; rq = mp->rq; pcs = (struct isp_pcisoftc *)mp->isp; - dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)]; nxti = *mp->nxtip; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { @@ -2494,7 +2494,7 @@ isp = mp->isp; rq = mp->rq; pcs = (struct isp_pcisoftc *)mp->isp; - dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)]; nxti = *mp->nxtip; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { @@ -2628,7 +2628,7 @@ isp = mp->isp; rq = mp->rq; pcs = (struct isp_pcisoftc *)mp->isp; - dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &pcs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)]; nxti = *mp->nxtip; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { @@ -2795,7 +2795,8 @@ if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error, s; - dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &pcs->dmaps[isp_handle_index( + rq->req_handle & ISP_HANDLE_MASK)]; s = splsoftvm(); error = bus_dmamap_load(pcs->dmat, *dp, csio->data_ptr, csio->dxfer_len, eptr, mp, 0); @@ -2880,7 +2881,8 @@ isp_pci_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle) { struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; - bus_dmamap_t *dp = &pcs->dmaps[isp_handle_index(handle)]; + bus_dmamap_t *dp; + dp = &pcs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)]; if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_POSTREAD); } else { ==== //depot/projects/smpng/sys/dev/isp/isp_sbus.c#25 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.31 2007/03/28 16:34:11 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.32 2007/04/02 01:04:20 mjacob Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -624,7 +624,7 @@ isp = mp->isp; rq = mp->rq; sbs = (struct isp_sbussoftc *)mp->isp; - dp = &sbs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &sbs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)]; nxti = *mp->nxtip; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { @@ -735,7 +735,8 @@ if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error, s; - dp = &sbs->dmaps[isp_handle_index(rq->req_handle)]; + dp = &sbs->dmaps[isp_handle_index( + rq->req_handle & ISP_HANDLE_MASK)]; s = splsoftvm(); error = bus_dmamap_load(sbs->dmat, *dp, csio->data_ptr, csio->dxfer_len, eptr, mp, 0); @@ -809,7 +810,8 @@ isp_sbus_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle) { struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp; - bus_dmamap_t *dp = &sbs->dmaps[isp_handle_index(handle)]; + bus_dmamap_t *dp; + dp = &sbs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)]; if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTREAD); } else { ==== //depot/projects/smpng/sys/dev/mxge/if_mxge.c#14 (text+ko) ==== @@ -32,7 +32,7 @@ ***************************************************************************/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.24 2007/03/27 15:55:32 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/mxge/if_mxge.c,v 1.25 2007/03/31 23:23:41 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -44,6 +44,7 @@ #include <sys/malloc.h> #include <sys/kdb.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <sys/module.h> #include <sys/memrange.h> #include <sys/socket.h> ==== //depot/projects/smpng/sys/dev/pci/pci.c#89 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.345 2007/03/26 20:18:52 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.348 2007/03/31 21:39:02 jhb Exp $"); #include "opt_bus.h" @@ -72,7 +72,7 @@ #endif static uint32_t pci_mapbase(unsigned mapreg); -static int pci_maptype(unsigned mapreg); +static const char *pci_maptype(unsigned mapreg); static int pci_mapsize(unsigned testval); static int pci_maprange(unsigned mapreg); static void pci_fixancient(pcicfgregs *cfg); @@ -305,29 +305,24 @@ static uint32_t pci_mapbase(uint32_t mapreg) { - int mask = 0x03; - if ((mapreg & 0x01) == 0) - mask = 0x0f; - return (mapreg & ~mask); + + if (PCI_BAR_MEM(mapreg)) + return (mapreg & PCIM_BAR_MEM_BASE); + else + return (mapreg & PCIM_BAR_IO_BASE); } /* return map type of memory or port map */ -static int +static const char * pci_maptype(unsigned mapreg) { - static uint8_t maptype[0x10] = { - PCI_MAPMEM, PCI_MAPPORT, - PCI_MAPMEM, 0, - PCI_MAPMEM, PCI_MAPPORT, - 0, 0, - PCI_MAPMEM|PCI_MAPMEMP, PCI_MAPPORT, - PCI_MAPMEM|PCI_MAPMEMP, 0, - PCI_MAPMEM|PCI_MAPMEMP, PCI_MAPPORT, - 0, 0, - }; - return (maptype[mapreg & 0x0f]); + if (PCI_BAR_IO(mapreg)) + return ("I/O Port"); + if (mapreg & PCIM_BAR_MEM_PREFETCH) + return ("Prefetchable Memory"); + return ("Memory"); } /* return log2 of map size decoded for memory or port map */ @@ -355,19 +350,21 @@ pci_maprange(unsigned mapreg) { int ln2range = 0; - switch (mapreg & 0x07) { - case 0x00: - case 0x01: - case 0x05: + + if (PCI_BAR_IO(mapreg)) ln2range = 32; - break; - case 0x02: - ln2range = 20; - break; - case 0x04: - ln2range = 64; - break; - } + else + switch (mapreg & PCIM_BAR_MEM_TYPE) { + case PCIM_BAR_MEM_32: + ln2range = 32; + break; + case PCIM_BAR_MEM_1MB: + ln2range = 20; + break; + case PCIM_BAR_MEM_64: + ln2range = 64; + break; + } return (ln2range); } @@ -1062,7 +1059,7 @@ uint32_t offset, bit; KASSERT(cfg->msix.msix_alloc > index, ("bogus index")); - offset = cfg->msix.msix_pba_offset + (index / 4) * 4; + offset = cfg->msix.msix_pba_offset + (index / 32) * 4; bit = 1 << index % 32; return (bus_read_4(cfg->msix.msix_pba_res, offset) & bit); } @@ -1972,7 +1969,7 @@ testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4); PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4); - if (pci_maptype(map) & PCI_MAPMEM) + if (PCI_BAR_MEM(map)) type = SYS_RES_MEMORY; else type = SYS_RES_IOPORT; @@ -1988,8 +1985,7 @@ * areas to the type of memory involved. Memory must be at least * 16 bytes in size, while I/O ranges must be at least 4. */ - if ((testval & 0x1) == 0x1 && - (testval & 0x2) != 0) + if (PCI_BAR_IO(testval) && (testval & PCIM_BAR_IO_RESERVED) != 0) return (barlen); if ((type == SYS_RES_MEMORY && ln2size < 4) || (type == SYS_RES_IOPORT && ln2size < 2)) @@ -1999,7 +1995,7 @@ /* Read the other half of a 64bit map register */ base |= (uint64_t) PCIB_READ_CONFIG(pcib, b, s, f, reg + 4, 4) << 32; if (bootverbose) { - printf("\tmap[%02x]: type %x, range %2d, base %#jx, size %2d", + printf("\tmap[%02x]: type %s, range %2d, base %#jx, size %2d", reg, pci_maptype(map), ln2range, (uintmax_t)base, ln2size); if (type == SYS_RES_IOPORT && !pci_porten(pcib, b, s, f)) printf(", port disabled\n"); @@ -2920,7 +2916,7 @@ map |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) << 32; if (pci_mapbase(testval) == 0) goto out; - if (pci_maptype(testval) & PCI_MAPMEM) { + if (PCI_BAR_MEM(testval)) { if (type != SYS_RES_MEMORY) { if (bootverbose) device_printf(dev, ==== //depot/projects/smpng/sys/dev/pci/pci_pci.c#33 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.46 2007/01/22 21:48:43 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.47 2007/03/31 20:41:00 jhb Exp $"); /* * PCI:PCI bridge support. @@ -253,7 +253,7 @@ * parts as subtractive. */ if ((pci_get_devid(dev) & 0xff00ffff) == 0x24008086 || - pci_read_config(dev, PCIR_PROGIF, 1) == 1) + pci_read_config(dev, PCIR_PROGIF, 1) == PCIP_BRIDGE_PCI_SUBTRACTIVE) sc->flags |= PCIB_SUBTRACTIVE; if (bootverbose) { ==== //depot/projects/smpng/sys/dev/pci/pcireg.h#22 (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/pci/pcireg.h,v 1.59 2007/03/05 16:18:31 jhb Exp $ + * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.61 2007/03/31 21:39:02 jhb Exp $ * */ @@ -118,6 +118,19 @@ #define PCIR_BARS 0x10 #define PCIR_BAR(x) (PCIR_BARS + (x) * 4) #define PCI_RID2BAR(rid) (((rid)-PCIR_BARS)/4) +#define PCI_BAR_IO(x) (((x) & PCIM_BAR_SPACE) == PCIM_BAR_IO_SPACE) +#define PCI_BAR_MEM(x) (((x) & PCIM_BAR_SPACE) == PCIM_BAR_MEM_SPACE) +#define PCIM_BAR_SPACE 0x00000001 +#define PCIM_BAR_MEM_SPACE 0 +#define PCIM_BAR_IO_SPACE 1 +#define PCIM_BAR_MEM_TYPE 0x00000006 +#define PCIM_BAR_MEM_32 0 +#define PCIM_BAR_MEM_1MB 2 /* Locate below 1MB in PCI <= 2.1 */ +#define PCIM_BAR_MEM_64 4 +#define PCIM_BAR_MEM_PREFETCH 0x00000008 +#define PCIM_BAR_MEM_BASE 0xfffffff0 +#define PCIM_BAR_IO_RESERVED 0x00000002 +#define PCIM_BAR_IO_BASE 0xfffffffc #define PCIR_CIS 0x28 #define PCIM_CIS_ASI_MASK 0x7 #define PCIM_CIS_ASI_TUPLE 0 @@ -211,6 +224,10 @@ #define PCIS_STORAGE_FLOPPY 0x02 #define PCIS_STORAGE_IPI 0x03 #define PCIS_STORAGE_RAID 0x04 +#define PCIS_STORAGE_ATA_ADMA 0x05 +#define PCIS_STORAGE_SATA 0x06 +#define PCIP_STORAGE_SATA_AHCI_1_0 0x01 +#define PCIS_STORAGE_SAS 0x07 #define PCIS_STORAGE_OTHER 0x80 #define PCIC_NETWORK 0x02 @@ -219,6 +236,8 @@ #define PCIS_NETWORK_FDDI 0x02 #define PCIS_NETWORK_ATM 0x03 #define PCIS_NETWORK_ISDN 0x04 +#define PCIS_NETWORK_WORLDFIP 0x05 +#define PCIS_NETWORK_PICMG 0x06 #define PCIS_NETWORK_OTHER 0x80 #define PCIC_DISPLAY 0x03 @@ -244,10 +263,13 @@ #define PCIS_BRIDGE_EISA 0x02 #define PCIS_BRIDGE_MCA 0x03 #define PCIS_BRIDGE_PCI 0x04 +#define PCIP_BRIDGE_PCI_SUBTRACTIVE 0x01 #define PCIS_BRIDGE_PCMCIA 0x05 #define PCIS_BRIDGE_NUBUS 0x06 #define PCIS_BRIDGE_CARDBUS 0x07 #define PCIS_BRIDGE_RACEWAY 0x08 +#define PCIS_BRIDGE_PCI_TRANSPARENT 0x09 +#define PCIS_BRIDGE_INFINIBAND 0x0a #define PCIS_BRIDGE_OTHER 0x80 #define PCIC_SIMPLECOMM 0x07 @@ -262,6 +284,8 @@ #define PCIS_SIMPLECOMM_PAR 0x01 #define PCIS_SIMPLECOMM_MULSER 0x02 #define PCIS_SIMPLECOMM_MODEM 0x03 +#define PCIS_SIMPLECOMM_GPIB 0x04 +#define PCIS_SIMPLECOMM_SMART_CARD 0x05 #define PCIS_SIMPLECOMM_OTHER 0x80 #define PCIC_BASEPERIPH 0x08 @@ -304,16 +328,28 @@ #define PCIS_SERIALBUS_ACCESS 0x01 #define PCIS_SERIALBUS_SSA 0x02 #define PCIS_SERIALBUS_USB 0x03 -#define PCIP_SERIALBUS_USB_UHCI 0x00 -#define PCIP_SERIALBUS_USB_OHCI 0x10 -#define PCIP_SERIALBUS_USB_EHCI 0x20 +#define PCIP_SERIALBUS_USB_UHCI 0x00 +#define PCIP_SERIALBUS_USB_OHCI 0x10 +#define PCIP_SERIALBUS_USB_EHCI 0x20 +#define PCIP_SERIALBUS_USB_DEVICE 0xfe #define PCIS_SERIALBUS_FC 0x04 #define PCIS_SERIALBUS_SMBUS 0x05 +#define PCIS_SERIALBUS_INFINIBAND 0x06 +#define PCIS_SERIALBUS_IPMI 0x07 +#define PCIP_SERIALBUS_IPMI_SMIC 0x00 +#define PCIP_SERIALBUS_IPMI_KCS 0x01 +#define PCIP_SERIALBUS_IPMI_BT 0x02 +#define PCIS_SERIALBUS_SERCOS 0x08 +#define PCIS_SERIALBUS_CANBUS 0x09 #define PCIC_WIRELESS 0x0d #define PCIS_WIRELESS_IRDA 0x00 #define PCIS_WIRELESS_IR 0x01 #define PCIS_WIRELESS_RF 0x10 +#define PCIS_WIRELESS_BLUETOOTH 0x11 +#define PCIS_WIRELESS_BROADBAND 0x12 +#define PCIS_WIRELESS_80211A 0x20 +#define PCIS_WIRELESS_80211B 0x21 #define PCIS_WIRELESS_OTHER 0x80 #define PCIC_INTELLIIO 0x0e @@ -331,8 +367,11 @@ #define PCIS_CRYPTO_OTHER 0x80 #define PCIC_DASP 0x11 -#define PCIS_DASP_DPIO 0x00 -#define PCIS_DASP_OTHER 0x80 +#define PCIS_DASP_DPIO 0x00 +#define PCIS_DASP_PERFCNTRS 0x01 +#define PCIS_DASP_COMM_SYNC 0x10 +#define PCIS_DASP_MGMT_CARD 0x20 +#define PCIS_DASP_OTHER 0x80 #define PCIC_OTHER 0xff ==== //depot/projects/smpng/sys/dev/sk/if_sk.c#12 (text) ==== @@ -48,7 +48,7 @@ */ >>> TRUNCATED FOR MAIL (1000 lines) <<<help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704021232.l32CWKoX030043>
