PERFORCE change 97907 for review

Warner Losh imp at FreeBSD.org
Fri May 26 15:05:56 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=97907

Change 97907 by imp at imp_lighthouse on 2006/05/26 22:03:56

	IFC @97906

Affected files ...

.. //depot/projects/arm/src/sys/arm/sa11x0/assabet_machdep.c#3 integrate
.. //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_io.c#4 integrate
.. //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_reg.h#2 integrate
.. //depot/projects/arm/src/sys/arm/sa11x0/uart_cpu_sa1110.c#2 integrate
.. //depot/projects/arm/src/sys/arm/sa11x0/uart_dev_sa1110.c#5 integrate
.. //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#8 integrate
.. //depot/projects/arm/src/sys/cam/cam_ccb.h#3 integrate
.. //depot/projects/arm/src/sys/cam/cam_periph.c#5 integrate
.. //depot/projects/arm/src/sys/cam/scsi/scsi_target.c#3 integrate
.. //depot/projects/arm/src/sys/dev/bktr/bktr_os.c#5 integrate
.. //depot/projects/arm/src/sys/dev/dcons/dcons_os.c#5 integrate
.. //depot/projects/arm/src/sys/dev/digi/digi.c#4 integrate
.. //depot/projects/arm/src/sys/dev/hifn/hifn7751.c#5 integrate
.. //depot/projects/arm/src/sys/dev/ic/ns16550.h#2 integrate
.. //depot/projects/arm/src/sys/dev/isp/isp_freebsd.c#9 integrate
.. //depot/projects/arm/src/sys/dev/isp/isp_freebsd.h#8 integrate
.. //depot/projects/arm/src/sys/dev/isp/isp_pci.c#9 integrate
.. //depot/projects/arm/src/sys/dev/isp/isp_tpublic.h#5 integrate
.. //depot/projects/arm/src/sys/dev/isp/ispvar.h#8 integrate
.. //depot/projects/arm/src/sys/dev/le/if_le_cbus.c#2 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt.c#11 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt.h#10 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_cam.c#13 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_debug.c#8 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_raid.c#5 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt_raid.h#2 integrate
.. //depot/projects/arm/src/sys/dev/nve/if_nve.c#6 integrate
.. //depot/projects/arm/src/sys/dev/ofw/ofw_console.c#3 integrate
.. //depot/projects/arm/src/sys/dev/pccbb/pccbb.c#10 integrate
.. //depot/projects/arm/src/sys/dev/pccbb/pccbb_pci.c#5 integrate
.. //depot/projects/arm/src/sys/dev/pccbb/pccbbvar.h#3 integrate
.. //depot/projects/arm/src/sys/dev/pci/fixup_pci.c#2 integrate
.. //depot/projects/arm/src/sys/dev/re/if_re.c#11 integrate
.. //depot/projects/arm/src/sys/dev/safe/safe.c#5 integrate
.. //depot/projects/arm/src/sys/dev/sio/sio.c#5 integrate
.. //depot/projects/arm/src/sys/dev/syscons/apm/apm_saver.c#3 integrate
.. //depot/projects/arm/src/sys/dev/syscons/syscons.c#8 integrate
.. //depot/projects/arm/src/sys/dev/uart/uart.h#2 integrate
.. //depot/projects/arm/src/sys/dev/uart/uart_dbg.c#2 integrate
.. //depot/projects/arm/src/sys/dev/uart/uart_dev_ns8250.c#5 integrate
.. //depot/projects/arm/src/sys/dev/uart/uart_tty.c#6 integrate
.. //depot/projects/arm/src/sys/dev/ubsec/ubsec.c#5 integrate
.. //depot/projects/arm/src/sys/dev/usb/ehci.c#9 integrate
.. //depot/projects/arm/src/sys/dev/usb/ehcivar.h#4 integrate
.. //depot/projects/arm/src/sys/dev/usb/usb.c#3 integrate
.. //depot/projects/arm/src/sys/dev/zs/zs.c#3 integrate
.. //depot/projects/arm/src/sys/doc/subsys/Dependencies#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-cam#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-crypto#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-dev_pci#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-dev_sound#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-dev_usb#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-geom#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-i4b#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-kern#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-libkern#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-linux#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-net80211#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-netgraph#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-netinet#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-netinet6#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-netipsec#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-opencrypto#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Doxyfile-vm#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/Makefile#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/README#1 branch
.. //depot/projects/arm/src/sys/doc/subsys/common-Doxyfile#1 branch
.. //depot/projects/arm/src/sys/fs/msdosfs/msdosfs_vfsops.c#7 integrate
.. //depot/projects/arm/src/sys/fs/ntfs/ntfs_vfsops.c#3 integrate
.. //depot/projects/arm/src/sys/fs/nwfs/nwfs_io.c#4 integrate
.. //depot/projects/arm/src/sys/fs/procfs/procfs.c#2 integrate
.. //depot/projects/arm/src/sys/fs/smbfs/smbfs_io.c#4 integrate
.. //depot/projects/arm/src/sys/fs/udf/udf_vfsops.c#6 integrate
.. //depot/projects/arm/src/sys/gdb/gdb.h#2 integrate
.. //depot/projects/arm/src/sys/gdb/gdb_cons.c#2 integrate
.. //depot/projects/arm/src/sys/gdb/gdb_main.c#4 integrate
.. //depot/projects/arm/src/sys/gdb/gdb_packet.c#2 integrate
.. //depot/projects/arm/src/sys/geom/geom_bsd.c#5 integrate
.. //depot/projects/arm/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#3 integrate
.. //depot/projects/arm/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#2 integrate
.. //depot/projects/arm/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#4 integrate
.. //depot/projects/arm/src/sys/i386/bios/apm.c#3 integrate
.. //depot/projects/arm/src/sys/i386/bios/apm.h#2 integrate
.. //depot/projects/arm/src/sys/ia64/ia64/ssc.c#4 integrate
.. //depot/projects/arm/src/sys/isofs/cd9660/cd9660_vfsops.c#5 integrate
.. //depot/projects/arm/src/sys/kern/subr_taskqueue.c#7 integrate
.. //depot/projects/arm/src/sys/kern/tty_cons.c#4 integrate
.. //depot/projects/arm/src/sys/kern/uipc_syscalls.c#9 integrate
.. //depot/projects/arm/src/sys/kern/vfs_mount.c#15 integrate
.. //depot/projects/arm/src/sys/kern/vfs_subr.c#17 integrate
.. //depot/projects/arm/src/sys/modules/Makefile#19 integrate
.. //depot/projects/arm/src/sys/netinet/ip_fw.h#7 integrate
.. //depot/projects/arm/src/sys/netinet/ip_fw2.c#11 integrate
.. //depot/projects/arm/src/sys/netinet/ip_output.c#10 integrate
.. //depot/projects/arm/src/sys/netinet/raw_ip.c#6 integrate
.. //depot/projects/arm/src/sys/netinet/udp_usrreq.c#9 integrate
.. //depot/projects/arm/src/sys/netinet6/in6_src.c#4 integrate
.. //depot/projects/arm/src/sys/netinet6/udp6_usrreq.c#7 integrate
.. //depot/projects/arm/src/sys/netipsec/key.c#3 integrate
.. //depot/projects/arm/src/sys/nfs4client/nfs4_vfsops.c#5 integrate
.. //depot/projects/arm/src/sys/nfs4client/nfs4_vnops.c#5 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs.h#4 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs_bio.c#7 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs_nfsiod.c#4 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs_node.c#6 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs_socket.c#10 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfs_vfsops.c#6 integrate
.. //depot/projects/arm/src/sys/nfsclient/nfsmount.h#4 integrate
.. //depot/projects/arm/src/sys/opencrypto/crypto.c#5 integrate
.. //depot/projects/arm/src/sys/opencrypto/cryptodev.c#6 integrate
.. //depot/projects/arm/src/sys/opencrypto/cryptodev.h#3 integrate
.. //depot/projects/arm/src/sys/pc98/cbus/sio.c#4 integrate
.. //depot/projects/arm/src/sys/pci/if_rlreg.h#4 integrate
.. //depot/projects/arm/src/sys/posix4/p1003_1b.c#5 integrate
.. //depot/projects/arm/src/sys/sys/cons.h#2 integrate
.. //depot/projects/arm/src/sys/sys/kernel.h#3 integrate
.. //depot/projects/arm/src/sys/sys/queue.h#7 integrate
.. //depot/projects/arm/src/sys/tools/vnode_if.awk#4 integrate
.. //depot/projects/arm/src/sys/ufs/ffs/ffs_vfsops.c#13 integrate
.. //depot/projects/arm/src/sys/ufs/ufs/dinode.h#2 integrate
.. //depot/projects/arm/src/sys/vm/uma_core.c#6 integrate

Differences ...

==== //depot/projects/arm/src/sys/arm/sa11x0/assabet_machdep.c#3 (text+ko) ====

@@ -47,7 +47,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.10 2005/10/03 14:15:50 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.13 2006/05/26 01:41:47 cognet Exp $");
 
 #include "opt_md.h"
 
@@ -93,6 +93,8 @@
 #include <machine/bus.h>
 #include <sys/reboot.h>
 
+#include <arm/sa11x0/sa11x0_reg.h>
+
 #define MDROOT_ADDR 0xd0400000
 
 #define KERNEL_PT_VMEM		0	/* Page table for mapping video memory */
@@ -151,9 +153,37 @@
 struct pv_addr undstack;
 struct pv_addr abtstack;
 struct pv_addr kernelstack;
-void enable_mmu(vm_offset_t);
 static struct trapframe proc0_tf;
 
+/* Static device mappings. */
+static const struct pmap_devmap assabet_devmap[] = {
+	/*
+	 * Map the on-board devices VA == PA so that we can access them
+	 * with the MMU on or off.
+	 */
+	{
+		SACOM1_VBASE,
+		SACOM1_BASE,
+		SACOM1_SIZE,
+		VM_PROT_READ|VM_PROT_WRITE,
+		PTE_NOCACHE,
+	},
+	{
+		SAIPIC_BASE,
+		SAIPIC_BASE,
+		SAIPIC_SIZE,
+		VM_PROT_READ|VM_PROT_WRITE,
+		PTE_NOCACHE,
+	},
+	{
+		0,
+		0,
+		0,
+		0,
+		0,
+	}
+};
+
 struct arm32_dma_range *
 bus_dma_get_range(void)
 {
@@ -334,11 +364,8 @@
 	/* Map the vector page. */
 	pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa,
 	    VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-	/* Map SACOM3. */
-	pmap_map_entry(l1pagetable, 0xd000d000, 0x80010000, 
-	    VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE);
-	pmap_map_entry(l1pagetable, 0x90050000, 0x90050000,
-	    VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE);
+	/* Map the statically mapped devices. */
+	pmap_devmap_bootstrap(l1pagetable, assabet_devmap);
 	pmap_map_chunk(l1pagetable, sa1_cache_clean_addr, 0xf0000000, 
 	    CPU_SA110_CACHE_CLEAN_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 

==== //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_io.c#4 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_io.c,v 1.7 2006/05/18 22:03:47 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0_io.c,v 1.8 2006/05/23 12:14:14 cognet Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/queue.h>
@@ -146,6 +146,13 @@
 	u_long startpa, endpa, pa;
 	vm_offset_t va;
 	pt_entry_t *pte;
+	const struct pmap_devmap *pd;
+
+	if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) {
+		/* Device was statically mapped. */
+		*bshp = pd->pd_va + (bpa - pd->pd_pa);
+		return 0;
+	}
 
 	startpa = trunc_page(bpa);
 	endpa = round_page(bpa + size);

==== //depot/projects/arm/src/sys/arm/sa11x0/sa11x0_reg.h#2 (text+ko) ====

@@ -34,7 +34,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/arm/sa11x0/sa11x0_reg.h,v 1.1 2004/05/14 11:46:45 cognet Exp $
+ * $FreeBSD: src/sys/arm/sa11x0/sa11x0_reg.h,v 1.3 2006/05/23 12:14:14 cognet Exp $
  *
  */
 
@@ -48,9 +48,11 @@
 #define SARCR_BASE		0x90030000	/* Reset Controller */
 #define SAGPIO_BASE		0x90040000	/* GPIO */
 #define SAIPIC_BASE		0x90050000	/* Interrupt Controller */
+#define SAIPIC_SIZE		0x24
 #define SAPPC_BASE		0x90060000	/* Peripheral Pin Controller */
 #define SAUDC_BASE		0x80000000	/* USB Device Controller*/
 #define	SACOM1_BASE		0x80010000	/* GPCLK/UART 1 */
+#define SACOM1_SIZE		0x24
 #define SACOM3_HW_BASE		0x80050000	/* UART 3  */
 #define SAMCP_BASE		0x80060000	/* MCP Controller */
 #define SASSP_BASE		0x80070000	/* Synchronous serial port */
@@ -59,7 +61,7 @@
 #define SALCD_BASE		0xB0100000	/* LCD */
 
 /* Register base virtual addresses mapped by initarm() */
-#define SACOM3_BASE             0xd000d000
+#define SACOM1_VBASE		0xd000d000
 
 /* Interrupt controller registers */
 #define SAIPIC_NPORTS		9

==== //depot/projects/arm/src/sys/arm/sa11x0/uart_cpu_sa1110.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_cpu_sa1110.c,v 1.3 2005/01/05 21:58:48 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_cpu_sa1110.c,v 1.4 2006/05/23 12:14:14 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -36,6 +36,7 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 
+#include <arm/sa11x0/sa11x0_reg.h>
 #include <arm/sa11x0/sa11x0_var.h>
 
 bus_space_tag_t uart_bus_space_io;
@@ -57,7 +58,7 @@
 	di->ops = uart_sa1110_ops;
 	di->bas.chan = 0;
 	di->bas.bst = &sa11x0_bs_tag;
-	di->bas.bsh = 0x80010000;
+	di->bas.bsh = SACOM1_BASE;
 	di->bas.regshft = 0;
 	di->bas.rclk = 0;
 	di->baudrate = 9600;

==== //depot/projects/arm/src/sys/arm/sa11x0/uart_dev_sa1110.c#5 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.4 2006/05/18 22:02:33 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.5 2006/05/22 23:25:34 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -38,6 +38,7 @@
 #include <dev/uart/uart.h>
 #include <dev/uart/uart_cpu.h>
 #include <dev/uart/uart_bus.h>
+#include <arm/sa11x0/sa11x0_reg.h>
 #include <arm/sa11x0/uart_dev_sa1110.h>
 
 #include "uart_if.h"
@@ -79,7 +80,7 @@
 sa1110_addr_change(struct uart_bas *bas)
 {
 	
-	bas->bsh = 0xd000d000;
+	bas->bsh = SACOM1_VBASE;
 	did_mmu = 1;
 }
 

==== //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#8 (text+ko) ====

@@ -49,7 +49,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.18 2005/12/21 15:01:49 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.19 2006/05/26 01:41:46 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -147,7 +147,6 @@
 struct pv_addr kernelstack;
 struct pv_addr minidataclean;
 
-void enable_mmu(vm_offset_t);
 static struct trapframe proc0_tf;
 
 #define IQ80321_OBIO_BASE 0xfe800000UL

==== //depot/projects/arm/src/sys/cam/cam_ccb.h#3 (text+ko) ====

@@ -25,7 +25,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.29 2006/01/20 19:21:38 mjacob Exp $
+ * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.31 2006/05/24 15:23:27 mjacob Exp $
  */
 
 #ifndef _CAM_CAM_CCB_H

==== //depot/projects/arm/src/sys/cam/cam_periph.c#5 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.61 2006/01/08 20:04:55 iedowse Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/cam_periph.c,v 1.62 2006/05/24 15:22:21 mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -673,6 +673,16 @@
 		mapinfo->num_bufs_used++;
 	}
 
+	/*
+	 * Now that we've gotten this far, change ownership to the kernel
+	 * of the buffers so that we don't run afoul of returning to user
+	 * space with locks (on the buffer) held.
+	 */
+	for (i = 0; i < numbufs; i++) {
+		BUF_KERNPROC(mapinfo->bp[i]);
+	}
+
+
 	return(0);
 }
 

==== //depot/projects/arm/src/sys/cam/scsi/scsi_target.c#3 (text+ko) ====

@@ -28,7 +28,8 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.68 2005/08/08 19:55:30 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.70 2006/05/24 15:26:07 mjacob Exp $");
+
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,6 +41,7 @@
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/devicestat.h>
+#include <sys/proc.h>
 
 #include <cam/cam.h>
 #include <cam/cam_ccb.h>
@@ -89,7 +91,6 @@
 	targ_state		 state;
 	struct selinfo		 read_select;
 	struct devstat		 device_stats;
-	struct mtx		 mtx;
 };
 
 static d_open_t		targopen;
@@ -157,10 +158,6 @@
 };
 PERIPHDRIVER_DECLARE(targ, targdriver);
 
-static struct mtx		targ_mtx;
-#define TARG_LOCK(softc)	mtx_lock(&(softc)->mtx)
-#define TARG_UNLOCK(softc)	mtx_unlock(&(softc)->mtx)
-
 static MALLOC_DEFINE(M_TARG, "TARG", "TARG data");
 
 /* Create softc and initialize it. Only one proc can open each targ device. */
@@ -169,15 +166,12 @@
 {
 	struct targ_softc *softc;
 
-	mtx_lock(&targ_mtx);
 	if (dev->si_drv1 != 0) {
-		mtx_unlock(&targ_mtx);
 		return (EBUSY);
 	}
 	
 	/* Mark device busy before any potentially blocking operations */
 	dev->si_drv1 = (void *)~0;
-	mtx_unlock(&targ_mtx);
 
 	/* Create the targ device, allocate its softc, initialize it */
 	if ((dev->si_flags & SI_NAMED) == 0) {
@@ -190,13 +184,12 @@
 	softc->state = TARG_STATE_OPENED;
 	softc->periph = NULL;
 	softc->path = NULL;
-	mtx_init(&softc->mtx, devtoname(dev), "targ cdev", MTX_DEF);
 
 	TAILQ_INIT(&softc->pending_ccb_queue);
 	TAILQ_INIT(&softc->work_queue);
 	TAILQ_INIT(&softc->abort_queue);
 	TAILQ_INIT(&softc->user_ccb_queue);
-	knlist_init(&softc->read_select.si_note, &softc->mtx, NULL, NULL, NULL);
+	knlist_init(&softc->read_select.si_note, NULL, NULL, NULL, NULL);
 
 	return (0);
 }
@@ -209,22 +202,15 @@
 	int    error;
 
 	softc = (struct targ_softc *)dev->si_drv1;
-	TARG_LOCK(softc);
 	error = targdisable(softc);
 	if (error == CAM_REQ_CMP) {
 		dev->si_drv1 = 0;
-		mtx_lock(&targ_mtx);
 		if (softc->periph != NULL) {
 			cam_periph_invalidate(softc->periph);
 			softc->periph = NULL;
 		}
-		mtx_unlock(&targ_mtx);
-		TARG_UNLOCK(softc);
-		mtx_destroy(&softc->mtx);
 		destroy_dev(dev);
 		FREE(softc, M_TARG);
-	} else {
-		TARG_UNLOCK(softc);
 	}
 	return (error);
 }
@@ -253,17 +239,13 @@
 			printf("Couldn't create path, status %#x\n", status);
 			break;
 		}
-		TARG_LOCK(softc);
 		status = targenable(softc, path, new_lun->grp6_len,
 				    new_lun->grp7_len);
-		TARG_UNLOCK(softc);
 		xpt_free_path(path);
 		break;
 	}
 	case TARGIOCDISABLE:
-		TARG_LOCK(softc);
 		status = targdisable(softc);
-		TARG_UNLOCK(softc);
 		break;
 	case TARGIOCDEBUG:
 	{
@@ -280,14 +262,11 @@
 		cdbg.ccb_h.cbfcnp = targdone;
 
 		/* If no periph available, disallow debugging changes */
-		TARG_LOCK(softc);
 		if ((softc->state & TARG_STATE_LUN_ENABLED) == 0) {
 			status = CAM_DEV_NOT_THERE;
-			TARG_UNLOCK(softc);
 			break;
 		}
 		xpt_action((union ccb *)&cdbg);
-		TARG_UNLOCK(softc);
 		status = cdbg.ccb_h.status & CAM_STATUS_MASK;
 #else
 		status = CAM_FUNC_NOTAVAIL;
@@ -315,7 +294,6 @@
 	revents = poll_events & (POLLOUT | POLLWRNORM);
 	if ((poll_events & (POLLIN | POLLRDNORM)) != 0) {
 		/* Poll for read() depends on user and abort queues. */
-		TARG_LOCK(softc);
 		if (!TAILQ_EMPTY(&softc->user_ccb_queue) ||
 		    !TAILQ_EMPTY(&softc->abort_queue)) {
 			revents |= poll_events & (POLLIN | POLLRDNORM);
@@ -323,7 +301,6 @@
 		/* Only sleep if the user didn't poll for write. */
 		if (revents == 0)
 			selrecord(td, &softc->read_select);
-		TARG_UNLOCK(softc);
 	}
 
 	return (revents);
@@ -415,7 +392,6 @@
 	}
 
 	/* Destroy any periph on our path if it is disabled */
-	mtx_lock(&targ_mtx);
 	periph = cam_periph_find(path, "targ");
 	if (periph != NULL) {
 		struct targ_softc *del_softc;
@@ -427,7 +403,6 @@
 		} else {
 			printf("Requested path still in use by targ%d\n",
 			       periph->unit_number);
-			mtx_unlock(&targ_mtx);
 			status = CAM_LUN_ALRDY_ENA;
 			goto enable_fail;
 		}
@@ -436,7 +411,6 @@
 	/* Create a periph instance attached to this path */
 	status = cam_periph_alloc(targctor, NULL, targdtor, targstart,
 			"targ", CAM_PERIPH_BIO, path, targasync, 0, softc);
-	mtx_unlock(&targ_mtx);
 	if (status != CAM_REQ_CMP) {
 		printf("cam_periph_alloc failed, status %#x\n", status);
 		goto enable_fail;
@@ -566,11 +540,9 @@
 			CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
 				  ("Sent ATIO/INOT (%p)\n", user_ccb));
 			xpt_action(ccb);
-			TARG_LOCK(softc);
 			TAILQ_INSERT_TAIL(&softc->pending_ccb_queue,
 					  &ccb->ccb_h,
 					  periph_links.tqe);
-			TARG_UNLOCK(softc);
 			break;
 		default:
 			if ((func_code & XPT_FC_QUEUED) != 0) {
@@ -581,10 +553,8 @@
 				descr->user_ccb = user_ccb;
 				descr->priority = priority;
 				descr->func_code = func_code;
-				TARG_LOCK(softc);
 				TAILQ_INSERT_TAIL(&softc->work_queue,
 						  descr, tqe);
-				TARG_UNLOCK(softc);
 				xpt_schedule(softc->periph, priority);
 			} else {
 				CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
@@ -629,15 +599,12 @@
 	softc = (struct targ_softc *)periph->softc;
 	CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targstart %p\n", start_ccb));
 
-	TARG_LOCK(softc);
 	descr = TAILQ_FIRST(&softc->work_queue);
 	if (descr == NULL) {
-		TARG_UNLOCK(softc);
 		xpt_release_ccb(start_ccb);
 	} else {
 		TAILQ_REMOVE(&softc->work_queue, descr, tqe);
 		next_descr = TAILQ_FIRST(&softc->work_queue);
-		TARG_UNLOCK(softc);
 
 		/* Initiate a transaction using the descr and supplied CCB */
 		error = targusermerge(softc, descr, start_ccb);
@@ -649,9 +616,7 @@
 			xpt_release_ccb(start_ccb);
 			suword(&descr->user_ccb->ccb_h.status,
 			       CAM_REQ_CMP_ERR);
-			TARG_LOCK(softc);
 			TAILQ_INSERT_TAIL(&softc->abort_queue, descr, tqe);
-			TARG_UNLOCK(softc);
 			notify_user(softc);
 		}
 
@@ -694,7 +659,6 @@
 		struct ccb_hdr *ccb_h;
 
 		cab = (struct ccb_abort *)ccb;
-		TARG_LOCK(softc);
 		TAILQ_FOREACH(ccb_h, &softc->pending_ccb_queue,
 		    periph_links.tqe) {
 			struct targ_cmd_descr *ab_descr;
@@ -708,7 +672,6 @@
 				break;
 			}
 		}
-		TARG_UNLOCK(softc);
 		/* CCB not found, set appropriate status */
 		if (ccb_h == NULL) {
 			k_ccbh->status = CAM_PATH_INVALID;
@@ -776,10 +739,8 @@
 	 */
 	CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("sendccb %p\n", ccb));
 	if (XPT_FC_IS_QUEUED(ccb)) {
-		TARG_LOCK(softc);
 		TAILQ_INSERT_TAIL(&softc->pending_ccb_queue, ccb_h,
 				  periph_links.tqe);
-		TARG_UNLOCK(softc);
 	}
 	xpt_action(ccb);
 
@@ -795,7 +756,6 @@
 
 	CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("targdone %p\n", done_ccb));
 	softc = (struct targ_softc *)periph->softc;
-	TARG_LOCK(softc);
 	TAILQ_REMOVE(&softc->pending_ccb_queue, &done_ccb->ccb_h,
 		     periph_links.tqe);
 	status = done_ccb->ccb_h.status & CAM_STATUS_MASK;
@@ -803,7 +763,6 @@
 	/* If we're no longer enabled, throw away CCB */
 	if ((softc->state & TARG_STATE_LUN_ENABLED) == 0) {
 		targfreeccb(softc, done_ccb);
-		TARG_UNLOCK(softc);
 		return;
 	}
 	/* abort_all_pending() waits for pending queue to be empty */
@@ -817,7 +776,6 @@
 	case XPT_CONT_TARGET_IO:
 		TAILQ_INSERT_TAIL(&softc->user_ccb_queue, &done_ccb->ccb_h,
 				  periph_links.tqe);
-		TARG_UNLOCK(softc);
 		notify_user(softc);
 		break;
 	default:
@@ -839,6 +797,8 @@
 	union  ccb	  *user_ccb;
 	int		   read_len, error;
 
+	mtx_lock(&Giant);
+
 	error = 0;
 	read_len = 0;
 	softc = (struct targ_softc *)dev->si_drv1;
@@ -847,12 +807,11 @@
 	CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("targread\n"));
 
 	/* If no data is available, wait or return immediately */
-	TARG_LOCK(softc);
 	ccb_h = TAILQ_FIRST(user_queue);
 	user_descr = TAILQ_FIRST(abort_queue);
 	while (ccb_h == NULL && user_descr == NULL) {
 		if ((ioflag & IO_NDELAY) == 0) {
-			error = msleep(user_queue, &softc->mtx,
+			error = msleep(user_queue, NULL,
 				       PRIBIO | PCATCH, "targrd", 0);
 			ccb_h = TAILQ_FIRST(user_queue);
 			user_descr = TAILQ_FIRST(abort_queue);
@@ -860,12 +819,11 @@
 				if (error == ERESTART) {
 					continue;
 				} else {
-					TARG_UNLOCK(softc);
 					goto read_fail;
 				}
 			}
 		} else {
-			TARG_UNLOCK(softc);
+			mtx_unlock(&Giant);
 			return (EAGAIN);
 		}
 	}
@@ -877,7 +835,6 @@
 		if (uio->uio_resid < sizeof(user_ccb))
 			break;
 		TAILQ_REMOVE(user_queue, ccb_h, periph_links.tqe);
-		TARG_UNLOCK(softc);
 		descr = (struct targ_cmd_descr *)ccb_h->targ_descr;
 		user_ccb = descr->user_ccb;
 		CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
@@ -890,7 +847,6 @@
 			goto read_fail;
 		read_len += sizeof(user_ccb);
 
-		TARG_LOCK(softc);
 		ccb_h = TAILQ_FIRST(user_queue);
 	}
 
@@ -899,7 +855,6 @@
 		if (uio->uio_resid < sizeof(user_ccb))
 			break;
 		TAILQ_REMOVE(abort_queue, user_descr, tqe);
-		TARG_UNLOCK(softc);
 		user_ccb = user_descr->user_ccb;
 		CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH,
 			  ("targread aborted descr %p (%p)\n",
@@ -910,10 +865,8 @@
 			goto read_fail;
 		read_len += sizeof(user_ccb);
 
-		TARG_LOCK(softc);
 		user_descr = TAILQ_FIRST(abort_queue);
 	}
-	TARG_UNLOCK(softc);
 
 	/*
 	 * If we've successfully read some amount of data, don't report an
@@ -924,6 +877,7 @@
 		error = ENOSPC;
 
 read_fail:
+	mtx_unlock(&Giant);
 	return (error);
 }
 
@@ -1020,7 +974,6 @@
 static void
 targinit(void)
 {
-	mtx_init(&targ_mtx, "targ global", NULL, MTX_DEF);
 	EVENTHANDLER_REGISTER(dev_clone, targclone, 0, 1000);
 }
 
@@ -1086,7 +1039,7 @@
 
 	/* If we aborted at least one pending CCB ok, wait for it. */
 	if (cab.ccb_h.status == CAM_REQ_CMP) {
-		msleep(&softc->pending_ccb_queue, &softc->mtx,
+		msleep(&softc->pending_ccb_queue, NULL,
 		       PRIBIO | PCATCH, "tgabrt", 0);
 	}
 
@@ -1105,7 +1058,7 @@
 	 * blocking read().
 	 */
 	selwakeuppri(&softc->read_select, PRIBIO);
-	KNOTE_LOCKED(&softc->read_select.si_note, 0);
+	KNOTE_UNLOCKED(&softc->read_select.si_note, 0);
 	wakeup(&softc->user_ccb_queue);
 }
 

==== //depot/projects/arm/src/sys/dev/bktr/bktr_os.c#5 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.52 2006/01/27 08:42:48 jmg Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.53 2006/05/26 07:36:50 jmg Exp $");
 
 /*
  * This is part of the Driver for Video Capture Cards (Frame grabbers)
@@ -149,6 +149,8 @@
 
 #include <vm/vm.h>
 
+#include <dev/bktr/ioctl_bt848.h>	/* extensions to ioctl_meteor.h */
+
 #ifndef __NetBSD__
 #include <vm/vm_kern.h>
 #include <vm/pmap.h>
@@ -767,8 +769,15 @@
 		return (ENXIO);
 	}
 
+#ifdef BKTR_GPIO_ACCESS
+	if (bktr->bigbuf == 0 && cmd != BT848_GPIO_GET_EN &&
+	    cmd != BT848_GPIO_SET_EN && cmd != BT848_GPIO_GET_DATA &&
+	    cmd != BT848_GPIO_SET_DATA)	/* no frame buffer allocated (ioctl failed) */
+		return( ENOMEM );
+#else
 	if (bktr->bigbuf == 0)	/* no frame buffer allocated (ioctl failed) */
 		return( ENOMEM );
+#endif
 
 	switch ( FUNCTION( minor(dev) ) ) {
 	case VIDEO_DEV:

==== //depot/projects/arm/src/sys/dev/dcons/dcons_os.c#5 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $FreeBSD: src/sys/dev/dcons/dcons_os.c,v 1.9 2006/01/04 09:20:41 phk Exp $
+ * $FreeBSD: src/sys/dev/dcons/dcons_os.c,v 1.11 2006/05/26 13:51:38 phk Exp $
  */
 
 #include <sys/param.h>
@@ -171,23 +171,21 @@
 
 static cn_probe_t	dcons_cnprobe;
 static cn_init_t	dcons_cninit;
+static cn_term_t	dcons_cnterm;
 static cn_getc_t	dcons_cngetc;
-static cn_checkc_t 	dcons_cncheckc;
 static cn_putc_t	dcons_cnputc;
 
-CONS_DRIVER(dcons, dcons_cnprobe, dcons_cninit, NULL, dcons_cngetc,
-    dcons_cncheckc, dcons_cnputc, NULL);
+CONSOLE_DRIVER(dcons);
 
 #if __FreeBSD_version >= 502122
 static gdb_probe_f dcons_dbg_probe;
 static gdb_init_f dcons_dbg_init;
 static gdb_term_f dcons_dbg_term;
 static gdb_getc_f dcons_dbg_getc;
-static gdb_checkc_f dcons_dbg_checkc;
 static gdb_putc_f dcons_dbg_putc;
 
 GDB_DBGPORT(dcons, dcons_dbg_probe, dcons_dbg_init, dcons_dbg_term,
-    dcons_dbg_checkc, dcons_dbg_getc, dcons_dbg_putc);
+    dcons_dbg_getc, dcons_dbg_putc);
 
 extern struct gdb_dbgport *gdb_cur;
 #endif
@@ -444,17 +442,16 @@
 		= (void *)&sc[DCONS_CON]; /* share port0 with unit0 */
 }
 
+static void
+dcons_cnterm(struct consdev *cp)
+{
+}
+
 #if CONS_NODEV
 static int
 dcons_cngetc(struct consdev *cp)
 {
 	struct dcons_softc *dc = (struct dcons_softc *)cp->cn_arg;
-	return (dcons_os_getc(dc));
-}
-static int
-dcons_cncheckc(struct consdev *cp)
-{
-	struct dcons_softc *dc = (struct dcons_softc *)cp->cn_arg;
 	return (dcons_os_checkc(dc));
 }
 static void
@@ -733,13 +730,6 @@
 }
 
 static int
-dcons_dbg_checkc(void)
-{
-	struct dcons_softc *dc = &sc[DCONS_GDB];
-	return (dcons_os_checkc(dc));
-}
-
-static int
 dcons_dbg_getc(void)
 {
 	struct dcons_softc *dc = &sc[DCONS_GDB];

==== //depot/projects/arm/src/sys/dev/digi/digi.c#4 (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/digi/digi.c,v 1.60 2005/10/16 20:22:54 phk Exp $
+ * $FreeBSD: src/sys/dev/digi/digi.c,v 1.61 2006/05/25 22:04:46 jhb Exp $
  */
 
 /*-
@@ -783,7 +783,6 @@
 	modlen = strlen(sc->module);
 	modfile = malloc(modlen + 6, M_TEMP, M_WAITOK);
 	snprintf(modfile, modlen + 6, "digi_%s", sc->module);
-	res = linker_reference_module(modfile, NULL, &lf);
 	if ((res = linker_reference_module(modfile, NULL, &lf)) != 0)
 		printf("%s: Failed %d to autoload module\n", modfile, res);
 	free(modfile, M_TEMP);

==== //depot/projects/arm/src/sys/dev/hifn/hifn7751.c#5 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.36 2006/05/17 18:34:26 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.37 2006/05/22 16:18:20 pjd Exp $");
 
 /*
  * Driver for various Hifn encryption processors.
@@ -2832,8 +2832,9 @@
 			if (crp->crp_flags & CRYPTO_F_IMBUF)
 				m_copyback((struct mbuf *)crp->crp_buf,
                                    crd->crd_inject, len, macbuf);
-			else if ((crp->crp_flags & CRYPTO_F_IOV) && crp->crp_mac)
-				bcopy((caddr_t)macbuf, crp->crp_mac, len);
+			else if (crp->crp_flags & CRYPTO_F_IOV)
+				cuio_copyback((struct uio *)crp->crp_buf,
+				    crd->crd_inject, len, macbuf);
 			break;
 		}
 	}

==== //depot/projects/arm/src/sys/dev/ic/ns16550.h#2 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)ns16550.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/dev/ic/ns16550.h,v 1.16 2004/11/20 23:19:42 marcel Exp $
+ * $FreeBSD: src/sys/dev/ic/ns16550.h,v 1.17 2006/05/23 00:41:12 benno Exp $
  */
 
 /*
@@ -127,7 +127,8 @@
 #define	com_dlbl	com_dll
 #define	com_dlm		1	/* divisor latch high (R/W) */
 #define	com_dlbh	com_dlm
-#define	REG_DL		com_dll
+#define	REG_DLL		com_dll
+#define	REG_DLH		com_dlm
 
 /* 16450 register #7.  Not multiplexed. */
 #define	com_scr		7	/* scratch register (R/W) */

==== //depot/projects/arm/src/sys/dev/isp/isp_freebsd.c#9 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.114 2006/04/21 18:46:35 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.116 2006/05/22 07:07:30 mjacob Exp $");
 
 #include <dev/isp/isp_freebsd.h>
 #include <sys/unistd.h>
@@ -1247,7 +1247,7 @@
 		XS_SETERR(ccb, CAM_REQUEUE_REQ);
 		goto out;
 	}
-	bzero(local, QENTRY_LEN);
+	memset(local, 0, QENTRY_LEN);
 
 	/*
 	 * We're either moving data or completing a command here.
@@ -1259,9 +1259,13 @@
 
 		cto->ct_header.rqs_entry_type = RQSTYPE_CTIO2;
 		cto->ct_header.rqs_entry_count = 1;
-		cto->ct_iid = cso->init_id;
-		if ((FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN) == 0) {
-			cto->ct_lun = ccb->ccb_h.target_lun;
+		if (IS_2KLOGIN(isp)) {
+			((ct2e_entry_t *)cto)->ct_iid = cso->init_id;
+		} else {
+			cto->ct_iid = cso->init_id;
+			if (!(FCPARAM(isp)->isp_fwattr & ISP_FW_ATTR_SCCLUN)) {
+				cto->ct_lun = ccb->ccb_h.target_lun;
+			}
 		}
 
 		atp = isp_get_atpd(isp, cso->tag_id);
@@ -1291,7 +1295,8 @@
 			}
 			if ((ccb->ccb_h.flags & CAM_SEND_SENSE) != 0) {
 				int m = min(cso->sense_len, MAXRESPLEN);
-				bcopy(&cso->sense_data, cto->rsp.m1.ct_resp, m);
+				memcpy(cto->rsp.m1.ct_resp,
+				    &cso->sense_data, m);
 				cto->rsp.m1.ct_senselen = m;
 				cto->rsp.m1.ct_scsi_status |= CT2_SNSLEN_VALID;
 			}
@@ -1440,7 +1445,7 @@
 		    "isp_target_putback_atio: Request Queue Overflow"); 
 		return;
 	}
-	bzero(qe, QENTRY_LEN);
+	memset(qe, 0, QENTRY_LEN);
 	cso = &ccb->csio;
 	if (IS_FC(isp)) {
 		at2_entry_t local, *at = &local;
@@ -2845,7 +2850,7 @@
 		struct ccb_trans_settings cts;
 		struct cam_path *tmppath;
 
-		bzero(&cts, sizeof (struct ccb_trans_settings));
+		memset(&cts, 0, sizeof (struct ccb_trans_settings));
 
 		tgt = *((int *)arg);
 		bus = (tgt >> 16) & 0xffff;
@@ -3171,6 +3176,7 @@

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list