From owner-p4-projects Wed Apr 3 7:52:16 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BF16D37B400; Wed, 3 Apr 2002 07:50:52 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EA00A37B405 for ; Wed, 3 Apr 2002 07:50:50 -0800 (PST) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g33FooH05472 for perforce@freebsd.org; Wed, 3 Apr 2002 07:50:50 -0800 (PST) (envelope-from jhb@freebsd.org) Date: Wed, 3 Apr 2002 07:50:50 -0800 (PST) Message-Id: <200204031550.g33FooH05472@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 8971 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=8971 Change 8971 by jhb@jhb_laptop on 2002/04/03 07:49:54 IFC @8970. Affected files ... ... //depot/projects/smpng/sys/alpha/alpha/machdep.c#34 integrate ... //depot/projects/smpng/sys/alpha/conf/GENERIC#15 integrate ... //depot/projects/smpng/sys/alpha/conf/SIMOS#4 integrate ... //depot/projects/smpng/sys/conf/NOTES#2 integrate ... //depot/projects/smpng/sys/conf/files.ia64#12 integrate ... //depot/projects/smpng/sys/conf/options#17 integrate ... //depot/projects/smpng/sys/dev/aac/aac_pci.c#11 integrate ... //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#9 integrate ... //depot/projects/smpng/sys/dev/isp/isp_pci.c#8 integrate ... //depot/projects/smpng/sys/dev/isp/ispvar.h#12 integrate ... //depot/projects/smpng/sys/i386/conf/GENERIC#17 integrate ... //depot/projects/smpng/sys/i386/conf/NEWCARD#11 integrate ... //depot/projects/smpng/sys/i386/conf/NOTES#32 integrate ... //depot/projects/smpng/sys/i386/i386/i386dump.c#2 integrate ... //depot/projects/smpng/sys/i386/i386/machdep.c#30 integrate ... //depot/projects/smpng/sys/ia64/conf/GENERIC#13 integrate ... //depot/projects/smpng/sys/ia64/conf/SKI#3 integrate ... //depot/projects/smpng/sys/ia64/ia64/ia64dump.c#2 integrate ... //depot/projects/smpng/sys/ia64/ia64/machdep.c#32 integrate ... //depot/projects/smpng/sys/kern/kern_mutex.c#24 integrate ... //depot/projects/smpng/sys/kern/tty.c#17 integrate ... //depot/projects/smpng/sys/kern/vfs_bio.c#18 integrate ... //depot/projects/smpng/sys/kern/vfs_syscalls.c#33 integrate ... //depot/projects/smpng/sys/pc98/conf/GENERIC#17 integrate ... //depot/projects/smpng/sys/pc98/i386/machdep.c#26 integrate ... //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#20 integrate ... //depot/projects/smpng/sys/sparc64/conf/GENERIC#8 integrate ... //depot/projects/smpng/sys/sparc64/sparc64/machdep.c#22 integrate ... //depot/projects/smpng/sys/sys/cdefs.h#10 integrate ... //depot/projects/smpng/sys/sys/kerneldump.h#3 integrate ... //depot/projects/smpng/sys/sys/mutex.h#23 integrate ... //depot/projects/smpng/sys/sys/param.h#18 integrate ... //depot/projects/smpng/sys/vm/uma_core.c#4 integrate ... //depot/projects/smpng/sys/vm/vm_page.c#11 integrate Differences ... ==== //depot/projects/smpng/sys/alpha/alpha/machdep.c#34 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.170 2002/03/27 09:23:37 jeff Exp $ + * $FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.171 2002/04/02 22:19:14 jhb Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. ==== //depot/projects/smpng/sys/alpha/conf/GENERIC#15 (text+ko) ==== @@ -19,7 +19,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.134 2002/03/27 21:10:38 wilko Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.135 2002/04/03 10:56:54 ru Exp $ machine alpha cpu EV4 @@ -63,7 +63,6 @@ options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console options KTRACE #ktrace(1) syscall trace support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues ==== //depot/projects/smpng/sys/alpha/conf/SIMOS#4 (text+ko) ==== @@ -11,7 +11,7 @@ # device lines is present in the ./NOTES file. If you are in doubt as # to the purpose or necessity of a line, check first in NOTES. # -# $FreeBSD: src/sys/alpha/conf/SIMOS,v 1.18 2001/12/04 11:16:41 des Exp $ +# $FreeBSD: src/sys/alpha/conf/SIMOS,v 1.19 2002/04/03 10:56:54 ru Exp $ machine "alpha" cpu "EV5" @@ -31,7 +31,6 @@ options PSEUDOFS #Pseudo-filesystem framework options "COMPAT_43" #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=100 #Be pessimistic about Joe SCSI device -options UCONSOLE #Allow users to grab the console config kernel ==== //depot/projects/smpng/sys/conf/NOTES#2 (text+ko) ==== @@ -11,7 +11,7 @@ # Please use ``make LINT'' to create an old-style LINT file if you want to # do kernel test-builds. # -# $FreeBSD: src/sys/conf/NOTES,v 1.1014 2002/04/01 19:25:22 jhb Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1015 2002/04/03 10:56:53 ru Exp $ # # @@ -427,10 +427,6 @@ options COMPILING_LINT -# XXX - this doesn't belong here. -# Allow ordinary users to take the console - this is useful for X. -options UCONSOLE - # XXX - this doesn't belong here either #options USERCONFIG #boot -c editor #options INTRO_USERCONFIG #imply -c and show intro screen ==== //depot/projects/smpng/sys/conf/files.ia64#12 (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.ia64,v 1.28 2002/03/27 05:39:16 dillon Exp $ +# $FreeBSD: src/sys/conf/files.ia64,v 1.29 2002/04/03 04:42:14 marcel Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -23,6 +23,7 @@ ia64/acpica/OsdEnvironment.c optional acpica ia64/acpica/madt.c optional acpica ia64/ia64/ia64-gdbstub.c optional ddb +ia64/ia64/ia64dump.c standard ia64/ia64/autoconf.c standard ia64/ia64/busdma_machdep.c standard ia64/ia64/clock.c standard ==== //depot/projects/smpng/sys/conf/options#17 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.308 2002/04/02 00:01:47 des Exp $ +# $FreeBSD: src/sys/conf/options,v 1.309 2002/04/03 10:56:53 ru Exp $ # # On the handling of kernel options # @@ -97,7 +97,6 @@ MSGSEG opt_sysvipc.h MSGSSZ opt_sysvipc.h MSGTQL opt_sysvipc.h -UCONSOLE VFS_AIO # POSIX kernel options ==== //depot/projects/smpng/sys/dev/aac/aac_pci.c#11 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.18 2002/02/13 07:44:43 scottl Exp $ + * $FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.19 2002/04/02 21:49:26 scottl Exp $ */ /* @@ -100,6 +100,7 @@ {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, "Dell PERC 3/Di"}, {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, "Dell PERC 3/Di"}, {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, "Dell PERC 3/Di"}, + {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, "Dell PERC 3/Di"}, {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, "Adaptec AAC-364"}, {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, "Adaptec SCSI RAID 5400S"}, ==== //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.59 2002/03/20 02:07:25 alfred Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.60 2002/04/02 23:36:14 mjacob Exp $ */ /* * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * Copyright (c) 1997, 1998, 1999, 2000, 2001 by Matthew Jacob @@ -63,7 +63,7 @@ /* * Efficiency- get rid of SBus code && tests unless we need them. */ -#if defined(__sparcv9__ ) || defined(__sparc__) +#if _MACHINE_ARCH == sparc64 #define ISP_SBUS_SUPPORTED 1 #else #define ISP_SBUS_SUPPORTED 0 @@ -117,6 +117,10 @@ struct mtx lock; struct cv kthread_cv; struct proc *kproc; + bus_dma_tag_t cdmat; + bus_dmamap_t cdmap; +#define isp_cdmat isp_osinfo.cdmat +#define isp_cdmap isp_osinfo.cdmap #ifdef ISP_TARGET_MODE #define TM_WANTED 0x80 #define TM_BUSY 0x40 @@ -173,14 +177,21 @@ #define MAXISPREQUEST(isp) 256 -#if defined(__alpha__) -#define MEMORYBARRIER(isp, type, offset, size) alpha_mb() -#elif defined(__ia64__) -#define MEMORYBARRIER(isp, type, offset, size) \ - do { ia64_mf(); ia64_mf_a(); } while (0) -#else -#define MEMORYBARRIER(isp, type, offset, size) -#endif +#define MEMORYBARRIER(isp, type, offset, size) \ +switch (type) { \ +case SYNC_SFORDEV: \ +case SYNC_REQUEST: \ + bus_dmamap_sync(isp->isp_cdmat, isp->isp_cdmap, \ + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); \ + break; \ +case SYNC_SFORCPU: \ +case SYNC_RESULT: \ + bus_dmamap_sync(isp->isp_cdmat, isp->isp_cdmap, \ + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); \ + break; \ +default: \ + break; \ +} #define MBOX_ACQUIRE(isp) #define MBOX_WAIT_COMPLETE isp_mbox_wait_complete ==== //depot/projects/smpng/sys/dev/isp/isp_pci.c#8 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.78 2002/02/18 00:00:34 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.79 2002/04/02 23:36:14 mjacob Exp $ */ /* * PCI specific probe and attach routines for Qlogic ISP SCSI adapters. * FreeBSD Version. @@ -241,6 +241,16 @@ ((PCI_PRODUCT_QLOGIC_ISP2312 << 16) | PCI_VENDOR_QLOGIC) /* + * I/O Mapping Stuff + */ +#if _MACHINE_ARCH == SPARC64 +/* An IOMMU means that we only will ever need one descriptor. */ +#define ISP_NSEG 2 +#else +#define ISP_NSEG ((MAXPHYS/PAGE_SIZE) + 1) +#endif + +/* * Odd case for some AMI raid cards... We need to *not* attach to this. */ #define AMI_RAID_SUBVENDOR_ID 0x101e @@ -254,6 +264,7 @@ static int isp_pci_probe (device_t); static int isp_pci_attach (device_t); + struct isp_pcisoftc { struct ispsoftc pci_isp; device_t pci_dev; @@ -262,9 +273,7 @@ bus_space_handle_t pci_sh; void * ih; int16_t pci_poff[_NREG_BLKS]; - bus_dma_tag_t parent_dmat; - bus_dma_tag_t cntrol_dmat; - bus_dmamap_t cntrol_dmap; + bus_dma_tag_t dmat; bus_dmamap_t *dmaps; }; ispfwfunc *isp_get_firmware_p = NULL; @@ -343,7 +352,6 @@ struct isp_pcisoftc *pcs; struct ispsoftc *isp = NULL; struct ispmdvec *mdvp; - bus_size_t lim; const char *sptr; int locksetup = 0; @@ -438,12 +446,10 @@ mdvp = &mdvec; basetype = ISP_HA_SCSI_UNKNOWN; psize = sizeof (sdparam); - lim = BUS_SPACE_MAXSIZE_32BIT; if (pci_get_devid(dev) == PCI_QLOGIC_ISP1020) { mdvp = &mdvec; basetype = ISP_HA_SCSI_UNKNOWN; psize = sizeof (sdparam); - lim = BUS_SPACE_MAXSIZE_24BIT; } if (pci_get_devid(dev) == PCI_QLOGIC_ISP1080) { mdvp = &mdvec_1080; @@ -573,16 +579,6 @@ data &= ~1; pci_write_config(dev, PCIR_ROMADDR, data, 4); - - if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, lim + 1, - 255, lim, 0, &pcs->parent_dmat) != 0) { - device_printf(dev, "could not create master dma tag\n"); - free(isp->isp_param, M_DEVBUF); - free(pcs, M_DEVBUF); - return (ENXIO); - } - iqd = 0; irq = bus_alloc_resource(dev, SYS_RES_IRQ, &iqd, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); @@ -1007,60 +1003,46 @@ } } -static void isp_map_rquest(void *, bus_dma_segment_t *, int, int); -static void isp_map_result(void *, bus_dma_segment_t *, int, int); -static void isp_map_fcscrt(void *, bus_dma_segment_t *, int, int); struct imush { struct ispsoftc *isp; int error; }; +static void imc(void *, bus_dma_segment_t *, int, int); + static void -isp_map_rquest(void *arg, bus_dma_segment_t *segs, int nseg, int error) +imc(void *arg, bus_dma_segment_t *segs, int nseg, int error) { struct imush *imushp = (struct imush *) arg; if (error) { imushp->error = error; } else { - imushp->isp->isp_rquest_dma = segs->ds_addr; - } -} + struct ispsoftc *isp =imushp->isp; + bus_addr_t addr = segs->ds_addr; -static void -isp_map_result(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct imush *imushp = (struct imush *) arg; - if (error) { - imushp->error = error; - } else { - imushp->isp->isp_result_dma = segs->ds_addr; + isp->isp_rquest_dma = addr; + addr += ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); + isp->isp_result_dma = addr; + if (IS_FC(isp)) { + addr += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); + FCPARAM(isp)->isp_scdma = addr; + } } } -static void -isp_map_fcscrt(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct imush *imushp = (struct imush *) arg; - if (error) { - imushp->error = error; - } else { - fcparam *fcp = imushp->isp->isp_param; - fcp->isp_scdma = segs->ds_addr; - } -} +#define ISP_NSEGS ((BUS_SPACE_MAXSIZE / PAGE_SIZE) + 1) static int isp_pci_mbxdma(struct ispsoftc *isp) { - struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp; + struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; caddr_t base; u_int32_t len; - int i, error; - bus_size_t lim; + int i, error, ns; + bus_size_t bl; struct imush im; - /* * Already been here? If so, leave... */ @@ -1068,6 +1050,20 @@ return (0); } + if (IS_ULTRA2(isp) || IS_FC(isp) || IS_1240(isp)) { + bl = BUS_SPACE_UNRESTRICTED; + } else { + bl = BUS_SPACE_MAXADDR_24BIT; + } + + if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE, + ISP_NSEGS, bl, 0, &pcs->dmat)) { + isp_prt(isp, ISP_LOGERR, "could not create master dma tag"); + return(1); + } + + len = sizeof (XS_T **) * isp->isp_maxcmds; isp->isp_xflist = (XS_T **) malloc(len, M_DEVBUF, M_WAITOK | M_ZERO); if (isp->isp_xflist == NULL) { @@ -1075,18 +1071,13 @@ return (1); } len = sizeof (bus_dmamap_t) * isp->isp_maxcmds; - pci->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK); - if (pci->dmaps == NULL) { - isp_prt(isp, ISP_LOGERR, "can't alloc dma maps"); + pcs->dmaps = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK); + if (pcs->dmaps == NULL) { + isp_prt(isp, ISP_LOGERR, "can't alloc dma map storage"); free(isp->isp_xflist, M_DEVBUF); return (1); } - if (IS_FC(isp) || IS_ULTRA2(isp)) - lim = BUS_SPACE_MAXADDR + 1; - else - lim = BUS_SPACE_MAXADDR_24BIT + 1; - /* * Allocate and map the request, result queues, plus FC scratch area. */ @@ -1095,80 +1086,64 @@ if (IS_FC(isp)) { len += ISP2100_SCRLEN; } - if (bus_dma_tag_create(pci->parent_dmat, PAGE_SIZE, lim, - BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, - BUS_SPACE_MAXSIZE_32BIT, 0, &pci->cntrol_dmat) != 0) { + + ns = (len / PAGE_SIZE) + 1; + if (bus_dma_tag_create(pcs->dmat, QENTRY_LEN, 0, BUS_SPACE_MAXADDR, + BUS_SPACE_MAXADDR, NULL, NULL, len, ns, bl, 0, &isp->isp_cdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); + free(pcs->dmaps, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); return (1); } - if (bus_dmamem_alloc(pci->cntrol_dmat, (void **)&base, - BUS_DMA_NOWAIT, &pci->cntrol_dmap) != 0) { + + if (bus_dmamem_alloc(isp->isp_cdmat, (void **)&base, BUS_DMA_NOWAIT, + &isp->isp_cdmap) != 0) { isp_prt(isp, ISP_LOGERR, "cannot allocate %d bytes of CCB memory", len); + bus_dma_tag_destroy(isp->isp_cdmat); free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); + free(pcs->dmaps, M_DEVBUF); return (1); } - isp->isp_rquest = base; - im.isp = isp; - im.error = 0; - bus_dmamap_load(pci->cntrol_dmat, pci->cntrol_dmap, isp->isp_rquest, - ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), isp_map_rquest, &im, 0); - if (im.error) { - isp_prt(isp, ISP_LOGERR, - "error %d loading dma map for DMA request queue", im.error); - free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); - isp->isp_rquest = NULL; - return (1); - } - isp->isp_result = base + ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); - im.error = 0; - bus_dmamap_load(pci->cntrol_dmat, pci->cntrol_dmap, isp->isp_result, - ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)), isp_map_result, &im, 0); - if (im.error) { - isp_prt(isp, ISP_LOGERR, - "error %d loading dma map for DMA result queue", im.error); - free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); - isp->isp_rquest = NULL; - return (1); - } - for (i = 0; i < isp->isp_maxcmds; i++) { - error = bus_dmamap_create(pci->parent_dmat, 0, &pci->dmaps[i]); + error = bus_dmamap_create(pcs->dmat, 0, &pcs->dmaps[i]); if (error) { isp_prt(isp, ISP_LOGERR, "error %d creating per-cmd DMA maps", error); - free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); - isp->isp_rquest = NULL; - return (1); + while (--i >= 0) { + bus_dmamap_destroy(pcs->dmat, pcs->dmaps[i]); + } + goto bad; } } + im.isp = isp; + im.error = 0; + bus_dmamap_load(isp->isp_cdmat, isp->isp_cdmap, base, len, imc, &im, 0); + if (im.error) { + isp_prt(isp, ISP_LOGERR, + "error %d loading dma map for control areas", im.error); + goto bad; + } + + isp->isp_rquest = base; + base += ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); + isp->isp_result = base; if (IS_FC(isp)) { - fcparam *fcp = (fcparam *) isp->isp_param; - fcp->isp_scratch = base + - ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)) + - ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); - im.error = 0; - bus_dmamap_load(pci->cntrol_dmat, pci->cntrol_dmap, - fcp->isp_scratch, ISP2100_SCRLEN, isp_map_fcscrt, &im, 0); - if (im.error) { - isp_prt(isp, ISP_LOGERR, - "error %d loading FC scratch area", im.error); - free(isp->isp_xflist, M_DEVBUF); - free(pci->dmaps, M_DEVBUF); - isp->isp_rquest = NULL; - return (1); - } + base += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); + FCPARAM(isp)->isp_scratch = base; } return (0); + +bad: + bus_dmamem_free(isp->isp_cdmat, base, isp->isp_cdmap); + bus_dma_tag_destroy(isp->isp_cdmat); + free(isp->isp_xflist, M_DEVBUF); + free(pcs->dmaps, M_DEVBUF); + isp->isp_rquest = NULL; + return (1); } typedef struct { @@ -1210,7 +1185,7 @@ mush_t *mp; struct ccb_scsiio *csio; struct ispsoftc *isp; - struct isp_pcisoftc *pci; + struct isp_pcisoftc *pcs; bus_dmamap_t *dp; ct_entry_t *cto, *qe; u_int8_t scsi_status; @@ -1291,12 +1266,12 @@ cto->ct_resid = 0; cto->ct_scsi_status = 0; - pci = (struct isp_pcisoftc *)isp; - dp = &pci->dmaps[isp_handle_index(handle)]; + pcs = (struct isp_pcisoftc *)isp; + dp = &pcs->dmaps[isp_handle_index(handle)]; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREREAD); } else { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREWRITE); } nxti = *mp->nxtip; @@ -1448,7 +1423,7 @@ u_int8_t sense[QLTM_SENSELEN]; struct ccb_scsiio *csio; struct ispsoftc *isp; - struct isp_pcisoftc *pci; + struct isp_pcisoftc *pcs; bus_dmamap_t *dp; ct2_entry_t *cto, *qe; u_int16_t scsi_status, send_status, send_sense, handle; @@ -1565,12 +1540,12 @@ cto->rsp.m0.ct_scsi_status = 0; MEMZERO(&cto->rsp, sizeof (cto->rsp)); - pci = (struct isp_pcisoftc *)isp; - dp = &pci->dmaps[isp_handle_index(handle)]; + pcs = (struct isp_pcisoftc *)isp; + dp = &pcs->dmaps[isp_handle_index(handle)]; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREREAD); } else { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREWRITE); } nxti = *mp->nxtip; @@ -1755,7 +1730,7 @@ mush_t *mp; struct ispsoftc *isp; struct ccb_scsiio *csio; - struct isp_pcisoftc *pci; + struct isp_pcisoftc *pcs; bus_dmamap_t *dp; bus_dma_segment_t *eseg; ispreq_t *rq; @@ -1776,14 +1751,14 @@ csio = mp->cmd_token; isp = mp->isp; rq = mp->rq; - pci = (struct isp_pcisoftc *)mp->isp; - dp = &pci->dmaps[isp_handle_index(rq->req_handle)]; + pcs = (struct isp_pcisoftc *)mp->isp; + dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; nxti = *mp->nxtip; if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREREAD); } else { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_PREWRITE); } datalen = XS_XFRLEN(csio); @@ -1877,7 +1852,7 @@ isp_pci_dmasetup(struct ispsoftc *isp, struct ccb_scsiio *csio, ispreq_t *rq, u_int16_t *nxtip, u_int16_t optr) { - struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp; + struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; ispreq_t *qep; bus_dmamap_t *dp = NULL; mush_t mush, *mp; @@ -1929,12 +1904,12 @@ if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) { if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) { int error, s; - dp = &pci->dmaps[isp_handle_index(rq->req_handle)]; + dp = &pcs->dmaps[isp_handle_index(rq->req_handle)]; s = splsoftvm(); - error = bus_dmamap_load(pci->parent_dmat, *dp, + error = bus_dmamap_load(pcs->dmat, *dp, csio->data_ptr, csio->dxfer_len, eptr, mp, 0); if (error == EINPROGRESS) { - bus_dmamap_unload(pci->parent_dmat, *dp); + bus_dmamap_unload(pcs->dmat, *dp); mp->error = EINVAL; isp_prt(isp, ISP_LOGERR, "deferred dma allocation not supported"); @@ -2002,14 +1977,14 @@ static void isp_pci_dmateardown(struct ispsoftc *isp, XS_T *xs, u_int16_t handle) { - struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp; - bus_dmamap_t *dp = &pci->dmaps[isp_handle_index(handle)]; + struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; + bus_dmamap_t *dp = &pcs->dmaps[isp_handle_index(handle)]; if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_POSTREAD); } else { - bus_dmamap_sync(pci->parent_dmat, *dp, BUS_DMASYNC_POSTWRITE); + bus_dmamap_sync(pcs->dmat, *dp, BUS_DMASYNC_POSTWRITE); } - bus_dmamap_unload(pci->parent_dmat, *dp); + bus_dmamap_unload(pcs->dmat, *dp); } @@ -2025,7 +2000,7 @@ static void isp_pci_dumpregs(struct ispsoftc *isp, const char *msg) { - struct isp_pcisoftc *pci = (struct isp_pcisoftc *)isp; + struct isp_pcisoftc *pcs = (struct isp_pcisoftc *)isp; if (msg) printf("%s: %s\n", device_get_nameunit(isp->isp_dev), msg); else @@ -2058,5 +2033,5 @@ ISP_READ(isp, OUTMAILBOX2), ISP_READ(isp, OUTMAILBOX3), ISP_READ(isp, OUTMAILBOX4)); printf(" PCI Status Command/Status=%x\n", - pci_read_config(pci->pci_dev, PCIR_COMMAND, 1)); + pci_read_config(pcs->pci_dev, PCIR_COMMAND, 1)); } ==== //depot/projects/smpng/sys/dev/isp/ispvar.h#12 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/ispvar.h,v 1.55 2002/03/21 21:10:16 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/ispvar.h,v 1.56 2002/04/02 23:36:14 mjacob Exp $ */ /* * Soft Definitions for for Qlogic ISP SCSI adapters. * @@ -149,8 +149,12 @@ #define QENTRY_LEN 64 /* Both request and result queue length must be a power of two */ #define RQUEST_QUEUE_LEN(x) MAXISPREQUEST(x) +#ifdef ISP_TARGET_MODE +#define RESULT_QUEUE_LEN(x) MAXISPREQUEST(x) +#else #define RESULT_QUEUE_LEN(x) \ (((MAXISPREQUEST(x) >> 2) < 64)? 64 : MAXISPREQUEST(x) >> 2) +#endif #define ISP_QUEUE_ENTRY(q, idx) ((q) + ((idx) * QENTRY_LEN)) #define ISP_QUEUE_SIZE(n) ((n) * QENTRY_LEN) #define ISP_NXT_QENTRY(idx, qlen) (((idx) + 1) & ((qlen)-1)) ==== //depot/projects/smpng/sys/i386/conf/GENERIC#17 (text+ko) ==== @@ -15,7 +15,7 @@ # device lines is also present in the NOTES configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in NOTES. # -# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.336 2002/03/17 23:48:24 des Exp $ +# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.337 2002/04/03 10:56:54 ru Exp $ machine i386 cpu I486_CPU @@ -44,7 +44,6 @@ options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console #options USERCONFIG #boot -c editor #options VISUAL_USERCONFIG #visual boot -c editor options KTRACE #ktrace(1) support ==== //depot/projects/smpng/sys/i386/conf/NEWCARD#11 (text+ko) ==== @@ -19,7 +19,7 @@ # device lines is also present in the NOTES configuration file. If you are # in doubt as to the purpose or necessity of a line, check first in NOTES. # -# $FreeBSD: src/sys/i386/conf/NEWCARD,v 1.60 2002/03/06 19:44:08 cjc Exp $ +# $FreeBSD: src/sys/i386/conf/NEWCARD,v 1.61 2002/04/03 10:56:55 ru Exp $ machine i386 cpu I486_CPU @@ -48,7 +48,6 @@ options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console #options USERCONFIG #boot -c editor #options VISUAL_USERCONFIG #visual boot -c editor options KTRACE #ktrace(1) support ==== //depot/projects/smpng/sys/i386/conf/NOTES#32 (text+ko) ==== @@ -11,7 +11,7 @@ # Please use ``make LINT'' to create an old-style LINT file if you want to # do kernel test-builds. # -# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1014 2002/04/01 19:25:22 jhb Exp $ +# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1015 2002/04/03 10:56:56 ru Exp $ # # @@ -427,10 +427,6 @@ options COMPILING_LINT -# XXX - this doesn't belong here. -# Allow ordinary users to take the console - this is useful for X. -options UCONSOLE - # XXX - this doesn't belong here either #options USERCONFIG #boot -c editor #options INTRO_USERCONFIG #imply -c and show intro screen ==== //depot/projects/smpng/sys/i386/i386/i386dump.c#2 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/i386/i386dump.c,v 1.1 2002/03/31 22:36:44 phk Exp $ + * $FreeBSD: src/sys/i386/i386/i386dump.c,v 1.2 2002/04/03 07:24:07 marcel Exp $ */ #include @@ -44,6 +44,8 @@ #include #include +CTASSERT(sizeof(struct kerneldumpheader) == 512); + static struct kerneldumpheader kdh; void @@ -57,21 +59,14 @@ printf("Dumping %u MB\n", Maxmem / (1024*1024 / PAGE_SIZE)); - if (sizeof kdh != 512) { - printf( - "Compiled struct kerneldumpheader is %d, not %d bytes\n", - sizeof kdh, 512); - return; - } - /* Fill in the kernel dump header */ strcpy(kdh.magic, KERNELDUMPMAGIC); strcpy(kdh.architecture, "i386"); - kdh.version = KERNELDUMPVERSION; - kdh.architectureversion = KERNELDUMP_I386_VERSION; - kdh.dumplength = Maxmem * (off_t)PAGE_SIZE; - kdh.blocksize = di->blocksize; - kdh.dumptime = time_second; + kdh.version = htod32(KERNELDUMPVERSION); + kdh.architectureversion = htod32(KERNELDUMP_I386_VERSION); + kdh.dumplength = htod64(Maxmem * (off_t)PAGE_SIZE); + kdh.dumptime = htod64(time_second); + kdh.blocksize = htod32(di->blocksize); strncpy(kdh.hostname, hostname, sizeof kdh.hostname); strncpy(kdh.versionstring, version, sizeof kdh.versionstring); if (panicstr != NULL) ==== //depot/projects/smpng/sys/i386/i386/machdep.c#30 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $FreeBSD: src/sys/i386/i386/machdep.c,v 1.509 2002/04/01 21:30:41 jhb Exp $ + * $FreeBSD: src/sys/i386/i386/machdep.c,v 1.510 2002/04/02 22:19:14 jhb Exp $ */ #include "opt_atalk.h" ==== //depot/projects/smpng/sys/ia64/conf/GENERIC#13 (text+ko) ==== @@ -19,7 +19,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.26 2002/03/19 11:21:12 peter Exp $ +# $FreeBSD: src/sys/ia64/conf/GENERIC,v 1.27 2002/04/03 10:56:57 ru Exp $ machine ia64 cpu ITANIUM @@ -48,7 +48,6 @@ options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console options KTRACE #ktrace(1) syscall trace support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues ==== //depot/projects/smpng/sys/ia64/conf/SKI#3 (text+ko) ==== @@ -20,7 +20,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/ia64/conf/SKI,v 1.2 2002/03/04 18:01:56 dfr Exp $ +# $FreeBSD: src/sys/ia64/conf/SKI,v 1.3 2002/04/03 10:56:57 ru Exp $ machine ia64 cpu ITANIUM @@ -47,7 +47,6 @@ options PSEUDOFS #Pseudo-filesystem framework options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options SCSI_DELAY=2000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console options KTRACE #ktrace(1) syscall trace support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues ==== //depot/projects/smpng/sys/ia64/ia64/ia64dump.c#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/ia64/ia64/ia64dump.c,v 1.1 2002/04/02 10:51:32 marcel Exp $ + * $FreeBSD: src/sys/ia64/ia64/ia64dump.c,v 1.3 2002/04/03 07:24:10 marcel Exp $ */ #include @@ -38,6 +38,8 @@ #include #include +CTASSERT(sizeof(struct kerneldumpheader) == 512); + #define MD_ALIGN(x) (((off_t)(x) + EFI_PAGE_MASK) & ~EFI_PAGE_MASK) typedef int callback_t(EFI_MEMORY_DESCRIPTOR*, int, void*); @@ -55,21 +57,14 @@ uint32_t blksz) { - if (sizeof(*kdh) != DEV_BSIZE) { - printf( - "Compiled struct kerneldumpheader is %d, not %d bytes\n", - sizeof(*kdh), DEV_BSIZE); - return; - } - bzero(kdh, sizeof(*kdh)); strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic)); strncpy(kdh->architecture, MACHINE_ARCH, sizeof(kdh->architecture)); - kdh->version = KERNELDUMPVERSION; - kdh->architectureversion = archver; - kdh->dumplength = dumplen; - kdh->blocksize = blksz; - kdh->dumptime = time_second; + kdh->version = htod32(KERNELDUMPVERSION); + kdh->architectureversion = htod32(archver); + kdh->dumplength = htod64(dumplen); + kdh->dumptime = htod64(time_second); + kdh->blocksize = htod32(blksz); strncpy(kdh->hostname, hostname, sizeof(kdh->hostname)); strncpy(kdh->versionstring, version, sizeof(kdh->versionstring)); if (panicstr != NULL) @@ -124,17 +119,19 @@ vm_offset_t pa; uint64_t pgs; size_t sz; - int error; + int error, twiddle; - printf(" region %d:", seqnr); - error = 0; /* catch case in which mdp->NumberOfPages is 0 */ + twiddle = 0; pgs = mdp->NumberOfPages; pa = IA64_PHYS_TO_RR7(mdp->PhysicalStart); + + printf(" region %d: %ld pages ", seqnr, (long)pgs); + while (pgs) { sz = (pgs > (DFLTPHYS >> EFI_PAGE_SHIFT)) ? DFLTPHYS : pgs << EFI_PAGE_SHIFT; - printf(" %lld", pgs); + printf("%c\b", "|/-\\"[twiddle++ & 3]); error = di->dumper(di->priv, (void*)pa, NULL, dumplo, sz); if (error) break; @@ -142,7 +139,7 @@ pgs -= sz >> EFI_PAGE_SHIFT; pa += sz; } - printf("\n"); + printf("... %s\n", (error) ? "fail" : "ok"); return (error); } @@ -215,7 +212,11 @@ ehdr.e_ident[EI_MAG2] = ELFMAG2; ehdr.e_ident[EI_MAG3] = ELFMAG3; ehdr.e_ident[EI_CLASS] = ELFCLASS64; +#if BYTE_ORDER == LITTLE_ENDIAN ehdr.e_ident[EI_DATA] = ELFDATA2LSB; +#else + ehdr.e_ident[EI_DATA] = ELFDATA2MSB; +#endif ehdr.e_ident[EI_VERSION] = EV_CURRENT; ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ ehdr.e_type = ET_CORE; ==== //depot/projects/smpng/sys/ia64/ia64/machdep.c#32 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/ia64/ia64/machdep.c,v 1.86 2002/04/02 07:20:42 marcel Exp $ + * $FreeBSD: src/sys/ia64/ia64/machdep.c,v 1.88 2002/04/03 05:16:09 marcel Exp $ */ #include "opt_compat.h" @@ -109,7 +109,7 @@ u_int64_t ia64_pal_base; u_int64_t ia64_port_base; -char machine[] = "ia64"; +char machine[] = MACHINE; SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, ""); static char cpu_model[128]; @@ -139,9 +139,7 @@ struct msgbuf *msgbufp=0; int Maxmem = 0; -long dumplo; - >>> TRUNCATED FOR MAIL (1000 lines) <<< To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message