Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jul 2006 14:57:39 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 101937 for review
Message-ID:  <200607191457.k6JEvdpA047863@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101937

Change 101937 by jhb@jhb_mutex on 2006/07/19 14:57:13

	IFC @101934.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/db_trace.c#19 integrate
.. //depot/projects/smpng/sys/amd64/amd64/identcpu.c#19 integrate
.. //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#18 integrate
.. //depot/projects/smpng/sys/amd64/amd64/local_apic.c#23 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#63 integrate
.. //depot/projects/smpng/sys/amd64/include/specialreg.h#10 integrate
.. //depot/projects/smpng/sys/arm/arm/db_trace.c#15 integrate
.. //depot/projects/smpng/sys/arm/arm/gdb_machdep.c#1 branch
.. //depot/projects/smpng/sys/arm/arm/in_cksum.c#7 integrate
.. //depot/projects/smpng/sys/arm/arm/vm_machdep.c#21 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_pio.c#3 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_piovar.h#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_pmc.c#3 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_rtc.c#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_rtcreg.h#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_spi.c#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_spiio.h#2 delete
.. //depot/projects/smpng/sys/arm/at91/at91_spireg.h#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_ssc.c#2 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_st.c#4 integrate
.. //depot/projects/smpng/sys/arm/at91/at91_twi.c#3 integrate
.. //depot/projects/smpng/sys/arm/at91/files.at91#4 integrate
.. //depot/projects/smpng/sys/arm/at91/if_ate.c#6 integrate
.. //depot/projects/smpng/sys/arm/at91/kb920x_machdep.c#7 integrate
.. //depot/projects/smpng/sys/arm/at91/std.at91#2 integrate
.. //depot/projects/smpng/sys/arm/at91/std.kb920x#2 integrate
.. //depot/projects/smpng/sys/arm/at91/uart_dev_at91usart.c#7 integrate
.. //depot/projects/smpng/sys/arm/conf/KB920X#4 integrate
.. //depot/projects/smpng/sys/arm/include/gdb_machdep.h#1 branch
.. //depot/projects/smpng/sys/arm/xscale/i80321/i80321_timer.c#10 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_cd.c#29 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#68 integrate
.. //depot/projects/smpng/sys/compat/freebsd32/syscalls.master#34 integrate
.. //depot/projects/smpng/sys/conf/Makefile.arm#23 integrate
.. //depot/projects/smpng/sys/conf/NOTES#124 integrate
.. //depot/projects/smpng/sys/conf/files#180 integrate
.. //depot/projects/smpng/sys/conf/files.arm#9 integrate
.. //depot/projects/smpng/sys/conf/files.ia64#56 integrate
.. //depot/projects/smpng/sys/conf/kern.pre.mk#52 integrate
.. //depot/projects/smpng/sys/conf/options#123 integrate
.. //depot/projects/smpng/sys/conf/options.arm#9 integrate
.. //depot/projects/smpng/sys/crypto/via/padlock.c#5 integrate
.. //depot/projects/smpng/sys/ddb/db_command.c#33 integrate
.. //depot/projects/smpng/sys/ddb/db_output.c#19 integrate
.. //depot/projects/smpng/sys/ddb/db_output.h#5 integrate
.. //depot/projects/smpng/sys/ddb/db_ps.c#34 integrate
.. //depot/projects/smpng/sys/ddb/db_thread.c#8 integrate
.. //depot/projects/smpng/sys/ddb/ddb.h#23 integrate
.. //depot/projects/smpng/sys/dev/aac/aac_cam.c#18 integrate
.. //depot/projects/smpng/sys/dev/acpica/acpi_perf.c#9 integrate
.. //depot/projects/smpng/sys/dev/amr/amr.c#42 integrate
.. //depot/projects/smpng/sys/dev/bce/if_bce.c#3 integrate
.. //depot/projects/smpng/sys/dev/fdc/fdc.c#24 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iic.c#11 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iic.h#2 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iicbus.c#8 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iicbus.h#3 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iicbus_if.m#3 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iiconf.c#4 integrate
.. //depot/projects/smpng/sys/dev/iicbus/iiconf.h#4 integrate
.. //depot/projects/smpng/sys/dev/isp/isp.c#41 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#43 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_library.c#3 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_pci.c#38 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_sbus.c#15 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_target.c#19 integrate
.. //depot/projects/smpng/sys/dev/lmc/if_lmc.c#13 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt.c#18 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt.h#15 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_cam.c#11 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_debug.c#14 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_pci.c#22 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_raid.c#8 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_raid.h#4 integrate
.. //depot/projects/smpng/sys/dev/mxge/if_mxge.c#3 integrate
.. //depot/projects/smpng/sys/dev/ncv/ncr53c500_pccard.c#20 integrate
.. //depot/projects/smpng/sys/dev/pccard/pccarddevs#55 integrate
.. //depot/projects/smpng/sys/dev/pci/pci.c#72 integrate
.. //depot/projects/smpng/sys/dev/random/probe.c#4 integrate
.. //depot/projects/smpng/sys/dev/sio/sio.c#62 integrate
.. //depot/projects/smpng/sys/dev/sk/if_sk.c#4 integrate
.. //depot/projects/smpng/sys/dev/sk/if_skreg.h#3 integrate
.. //depot/projects/smpng/sys/dev/sound/driver.c#8 integrate
.. //depot/projects/smpng/sys/dev/sound/midi/sequencer.c#13 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/cmi.c#30 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/emu10k1.c#28 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/emu10kx-midi.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/pci/emu10kx-pcm.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/pci/emu10kx.c#1 branch
.. //depot/projects/smpng/sys/dev/sound/pci/emu10kx.h#1 branch
.. //depot/projects/smpng/sys/dev/sound/pcm/buffer.c#15 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/buffer.h#8 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/mixer.h#6 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/sound.c#33 integrate
.. //depot/projects/smpng/sys/dev/sound/pcm/sound.h#26 integrate
.. //depot/projects/smpng/sys/dev/spibus/spi.h#1 branch
.. //depot/projects/smpng/sys/dev/spibus/spibus.c#1 branch
.. //depot/projects/smpng/sys/dev/spibus/spibus_if.m#1 branch
.. //depot/projects/smpng/sys/dev/spibus/spibusvar.h#1 branch
.. //depot/projects/smpng/sys/dev/stg/tmc18c30_subr.c#6 integrate
.. //depot/projects/smpng/sys/dev/streams/streams.c#26 integrate
.. //depot/projects/smpng/sys/fs/devfs/devfs_devs.c#22 integrate
.. //depot/projects/smpng/sys/fs/devfs/devfs_rule.c#16 integrate
.. //depot/projects/smpng/sys/fs/devfs/devfs_vfsops.c#28 integrate
.. //depot/projects/smpng/sys/fs/devfs/devfs_vnops.c#57 integrate
.. //depot/projects/smpng/sys/fs/portalfs/portal_vnops.c#26 integrate
.. //depot/projects/smpng/sys/fs/smbfs/smbfs_vfsops.c#35 integrate
.. //depot/projects/smpng/sys/geom/geom.h#47 integrate
.. //depot/projects/smpng/sys/geom/mirror/g_mirror_ctl.c#12 integrate
.. //depot/projects/smpng/sys/geom/raid3/g_raid3_ctl.c#14 integrate
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1-ac97.h#3 delete
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1-alsa.h#4 integrate
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/emu10k1.h#5 delete
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/p16v-alsa.h#1 branch
.. //depot/projects/smpng/sys/gnu/dev/sound/pci/p17v-alsa.h#1 branch
.. //depot/projects/smpng/sys/i386/i386/db_trace.c#31 integrate
.. //depot/projects/smpng/sys/i386/i386/identcpu.c#46 integrate
.. //depot/projects/smpng/sys/i386/i386/initcpu.c#28 integrate
.. //depot/projects/smpng/sys/i386/i386/intr_machdep.c#19 integrate
.. //depot/projects/smpng/sys/i386/i386/local_apic.c#44 integrate
.. //depot/projects/smpng/sys/i386/i386/machdep.c#109 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#103 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_syscall.h#7 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_isc_sysent.c#8 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_proto.h#15 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_syscall.h#14 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_sysent.c#16 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/syscalls.isc#8 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#19 integrate
.. //depot/projects/smpng/sys/i386/include/md_var.h#33 integrate
.. //depot/projects/smpng/sys/i386/include/specialreg.h#12 integrate
.. //depot/projects/smpng/sys/ia64/conf/DEFAULTS#5 integrate
.. //depot/projects/smpng/sys/ia64/ia64/db_machdep.c#3 integrate
.. //depot/projects/smpng/sys/kern/init_sysent.c#71 integrate
.. //depot/projects/smpng/sys/kern/kern_intr.c#78 integrate
.. //depot/projects/smpng/sys/kern/kern_ktr.c#35 integrate
.. //depot/projects/smpng/sys/kern/kern_lock.c#47 integrate
.. //depot/projects/smpng/sys/kern/kern_mac.c#44 integrate
.. //depot/projects/smpng/sys/kern/kern_thr.c#35 integrate
.. //depot/projects/smpng/sys/kern/kern_uuid.c#11 integrate
.. //depot/projects/smpng/sys/kern/link_elf.c#40 integrate
.. //depot/projects/smpng/sys/kern/subr_prf.c#46 integrate
.. //depot/projects/smpng/sys/kern/subr_turnstile.c#30 integrate
.. //depot/projects/smpng/sys/kern/syscalls.c#71 integrate
.. //depot/projects/smpng/sys/kern/syscalls.master#77 integrate
.. //depot/projects/smpng/sys/kern/sysv_sem.c#42 integrate
.. //depot/projects/smpng/sys/kern/uipc_domain.c#17 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket.c#86 integrate
.. //depot/projects/smpng/sys/kern/uipc_socket2.c#55 integrate
.. //depot/projects/smpng/sys/kern/uipc_usrreq.c#61 integrate
.. //depot/projects/smpng/sys/kern/vfs_subr.c#131 integrate
.. //depot/projects/smpng/sys/modules/sound/driver/Makefile#9 integrate
.. //depot/projects/smpng/sys/modules/sound/driver/emu10kx/Makefile#1 branch
.. //depot/projects/smpng/sys/net/if_spppsubr.c#30 integrate
.. //depot/projects/smpng/sys/net/if_tap.c#41 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_input.c#30 integrate
.. //depot/projects/smpng/sys/net80211/ieee80211_ioctl.c#26 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.c#66 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.h#42 integrate
.. //depot/projects/smpng/sys/netinet/ip_divert.c#49 integrate
.. //depot/projects/smpng/sys/netinet/raw_ip.c#58 integrate
.. //depot/projects/smpng/sys/netinet/tcp_subr.c#79 integrate
.. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#51 integrate
.. //depot/projects/smpng/sys/netinet/udp_usrreq.c#68 integrate
.. //depot/projects/smpng/sys/netinet6/in6_pcb.c#45 integrate
.. //depot/projects/smpng/sys/netinet6/raw_ip6.c#40 integrate
.. //depot/projects/smpng/sys/netinet6/udp6_usrreq.c#38 integrate
.. //depot/projects/smpng/sys/netsmb/smb_conn.c#16 integrate
.. //depot/projects/smpng/sys/nfs4client/nfs4_vnops.c#20 integrate
.. //depot/projects/smpng/sys/pc98/pc98/machdep.c#15 integrate
.. //depot/projects/smpng/sys/posix4/ksched.c#19 integrate
.. //depot/projects/smpng/sys/posix4/p1003_1b.c#14 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/db_trace.c#16 integrate
.. //depot/projects/smpng/sys/security/mac/mac_vfs.c#12 integrate
.. //depot/projects/smpng/sys/sparc64/sparc64/db_trace.c#27 integrate
.. //depot/projects/smpng/sys/sys/libkern.h#21 integrate
.. //depot/projects/smpng/sys/sys/mbuf.h#62 integrate
.. //depot/projects/smpng/sys/sys/param.h#101 integrate
.. //depot/projects/smpng/sys/sys/protosw.h#20 integrate
.. //depot/projects/smpng/sys/sys/syscall.h#70 integrate
.. //depot/projects/smpng/sys/sys/syscall.mk#70 integrate
.. //depot/projects/smpng/sys/sys/sysctl.h#40 integrate
.. //depot/projects/smpng/sys/sys/sysproto.h#73 integrate
.. //depot/projects/smpng/sys/sys/thr.h#9 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_alloc.c#41 integrate
.. //depot/projects/smpng/sys/vm/uma_core.c#65 integrate
.. //depot/projects/smpng/sys/vm/vm_object.c#80 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/db_trace.c#19 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.74 2006/03/13 23:56:44 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/db_trace.c,v 1.75 2006/07/12 21:22:42 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

==== //depot/projects/smpng/sys/amd64/amd64/identcpu.c#19 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.146 2006/04/24 22:56:57 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.147 2006/07/12 06:04:11 jkim Exp $");
 
 #include "opt_cpu.h"
 
@@ -306,8 +306,8 @@
 				"\020"
 				"\001LAHF"	/* LAHF/SAHF in long mode */
 				"\002CMP"	/* CMP legacy */
-				"\003<b2>"
-				"\004<b3>"
+				"\003SVM"	/* Secure Virtual Mode */
+				"\004ExtAPIC"	/* Extended APIC register */
 				"\005CR8"	/* CR8 in legacy mode */
 				"\006<b5>"
 				"\007<b6>"

==== //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#18 (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/amd64/amd64/intr_machdep.c,v 1.19 2006/02/28 22:24:54 jhb Exp $
+ * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.20 2006/07/12 21:22:42 jhb Exp $
  */
 
 /*

==== //depot/projects/smpng/sys/amd64/amd64/local_apic.c#23 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.25 2006/03/20 19:39:07 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.26 2006/07/12 21:22:42 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
 

==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#63 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.565 2006/07/06 06:17:08 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.566 2006/07/17 03:10:17 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1627,6 +1627,7 @@
 	int idx, field, bit;
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	PMAP_LOCK_ASSERT(pmap, MA_OWNED);
 	PV_STAT(pv_entry_frees++);
 	PV_STAT(pv_entry_spare++);
 	pv_entry_count--;
@@ -2015,8 +2016,8 @@
 		TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
 		m->md.pv_list_count--;
 		pmap_unuse_pt(pmap, pv->pv_va, ptepde);
+		free_pv_entry(pmap, pv);
 		PMAP_UNLOCK(pmap);
-		free_pv_entry(pmap, pv);
 	}
 	vm_page_flag_clear(m, PG_WRITEABLE);
 }

==== //depot/projects/smpng/sys/amd64/include/specialreg.h#10 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)specialreg.h	7.1 (Berkeley) 5/9/91
- * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.33 2006/05/01 22:07:00 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.35 2006/07/13 16:09:40 jkim Exp $
  */
 
 #ifndef _MACHINE_SPECIALREG_H_
@@ -109,16 +109,18 @@
 #define	CPUID_SS	0x08000000
 #define	CPUID_HTT	0x10000000
 #define	CPUID_TM	0x20000000
-#define	CPUID_B30	0x40000000
+#define	CPUID_IA64	0x40000000
 #define	CPUID_PBE	0x80000000
 
 #define CPUID2_SSE3	0x00000001
 #define CPUID2_MON	0x00000008
 #define CPUID2_DS_CPL	0x00000010
+#define CPUID2_VMX	0x00000020
 #define CPUID2_EST	0x00000080
 #define CPUID2_TM2	0x00000100
 #define CPUID2_CNTXID	0x00000400
 #define CPUID2_CX16	0x00002000
+#define CPUID2_XTPR	0x00004000
 
 /*
  * Important bits in the AMD extended cpuid flags
@@ -135,6 +137,8 @@
 
 #define AMDID2_LAHF	0x00000001
 #define AMDID2_CMP	0x00000002
+#define AMDID2_SVM	0x00000004
+#define AMDID2_EXT_APIC	0x00000008
 #define AMDID2_CR8	0x00000010
 
 /*
@@ -188,6 +192,7 @@
 #define MSR_THERM_CONTROL	0x19a
 #define MSR_THERM_INTERRUPT	0x19b
 #define MSR_THERM_STATUS	0x19c
+#define	MSR_IA32_MISC_ENABLE	0x1a0
 #define MSR_DEBUGCTLMSR		0x1d9
 #define MSR_LASTBRANCHFROMIP	0x1db
 #define MSR_LASTBRANCHTOIP	0x1dc
@@ -356,7 +361,7 @@
 #define	AMD_WT_ALLOC_PRE	0x20000	/* programmable range enable */
 #define	AMD_WT_ALLOC_FRE	0x10000	/* fixed (A0000-FFFFF) range enable */
 
-/* X86-64 MSR's */
+/* AMD64 MSR's */
 #define	MSR_EFER	0xc0000080	/* extended features */
 #define	MSR_STAR	0xc0000081	/* legacy mode SYSCALL target/cs/ss */
 #define	MSR_LSTAR	0xc0000082	/* long mode SYSCALL target rip */

==== //depot/projects/smpng/sys/arm/arm/db_trace.c#15 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/db_trace.c,v 1.12 2005/09/10 03:01:24 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/db_trace.c,v 1.13 2006/07/12 21:22:42 jhb Exp $");
 #include <sys/param.h>
 #include <sys/systm.h>
 

==== //depot/projects/smpng/sys/arm/arm/in_cksum.c#7 (text+ko) ====

@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.6 2006/03/09 23:33:59 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/in_cksum.c,v 1.7 2006/07/18 00:07:05 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -89,6 +89,17 @@
 	return (sum);
 }
 
+static
+uint64_t _do_cksum(void *addr, int len)
+{
+	uint64_t sum;
+	union q_util q_util;
+
+	sum = do_cksum(addr, len);
+	REDUCE32;
+	return (sum);
+}
+
 u_short
 in_cksum_skip(struct mbuf *m, int len, int skip)
 {
@@ -120,9 +131,9 @@
 			mlen = len;
 
 		if ((clen ^ (int) addr) & 1)
-		    sum += do_cksum(addr, mlen) << 8;
+		    sum += _do_cksum(addr, mlen) << 8;
 		else
-		    sum += do_cksum(addr, mlen);
+		    sum += _do_cksum(addr, mlen);
 
 		clen += mlen;
 		len -= mlen;

==== //depot/projects/smpng/sys/arm/arm/vm_machdep.c#21 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.24 2006/06/05 23:42:47 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.26 2006/07/15 23:15:31 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -512,7 +512,7 @@
 	void *ret;
 	struct arm_small_page *sp, *tmp;
 	TAILQ_HEAD(,arm_small_page) *head;
-	static int in_alloc;
+	static struct thread *in_alloc;
 	static int in_sleep;
 	int should_wakeup = 0;
 	
@@ -532,12 +532,13 @@
 
 	if (!sp) {
 		/* No more free pages, need to alloc more. */
-		if (!(wait & M_WAITOK)) {
+		if (!(wait & M_WAITOK) ||
+		    in_alloc == curthread) {
 			mtx_unlock(&smallalloc_mtx);
 			*flags = UMA_SLAB_KMEM;
 			return ((void *)kmem_malloc(kmem_map, bytes, M_NOWAIT));
 		}
-		if (in_alloc) {
+		if (in_alloc != NULL) {
 			/* Somebody else is already doing the allocation. */
 			in_sleep++;
 			msleep(&in_alloc, &smallalloc_mtx, PWAIT, 
@@ -545,14 +546,14 @@
 			in_sleep--;
 			goto retry;
 		}
-		in_alloc = 1;
+		in_alloc = curthread;
 		mtx_unlock(&smallalloc_mtx);
 		/* Try to alloc 1MB of contiguous memory. */
 		ret = arm_uma_do_alloc(&sp, bytes, zone == l2zone ?
 		    SECTION_PT : SECTION_CACHE);
 		mtx_lock(&smallalloc_mtx);
-		in_alloc = 0;
-		if (in_sleep)
+		in_alloc = NULL;
+		if (in_sleep > 0)
 			should_wakeup = 1;
 		if (sp) {
 			for (int i = 0; i < (0x100000 / PAGE_SIZE) - 1;

==== //depot/projects/smpng/sys/arm/at91/at91_pio.c#3 (text) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_pio.c,v 1.2 2006/07/02 03:50:44 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_pio.c,v 1.3 2006/07/14 22:22:57 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -280,21 +280,29 @@
  * them.
  */
 void
-at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask)
+at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup)
 {
 	uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio);
 
 	PIO[PIO_ASR / 4] = periph_a_mask;
 	PIO[PIO_PDR / 4] = periph_a_mask;
+	if (use_pullup)
+		PIO[PIO_PUER / 4] = periph_a_mask;
+	else
+		PIO[PIO_PUDR / 4] = periph_a_mask;
 }
 
 void
-at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask)
+at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup)
 {
 	uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio);
 
 	PIO[PIO_BSR / 4] = periph_b_mask;
 	PIO[PIO_PDR / 4] = periph_b_mask;
+	if (use_pullup)
+		PIO[PIO_PUER / 4] = periph_b_mask;
+	else
+		PIO[PIO_PUDR / 4] = periph_b_mask;
 }
 
 void
@@ -314,11 +322,15 @@
 }
 
 void
-at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask)
+at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask, int use_pullup)
 {
 	uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio);
 
 	PIO[PIO_OER / 4] = output_enable_mask;
+	if (use_pullup)
+		PIO[PIO_PUER / 4] = output_enable_mask;
+	else
+		PIO[PIO_PUDR / 4] = output_enable_mask;
 }
 
 void

==== //depot/projects/smpng/sys/arm/at91/at91_piovar.h#2 (text+ko) ====

@@ -22,16 +22,17 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* $FreeBSD: src/sys/arm/at91/at91_piovar.h,v 1.1 2006/07/02 03:50:44 imp Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91_piovar.h,v 1.2 2006/07/14 22:22:57 imp Exp $ */
 
 #ifndef ARM_AT91_AT91_PIOVAR_H
 #define ARM_AT91_AT91_PIOVAR_H
 
-void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask);
-void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask);
+void at91_pio_use_periph_a(uint32_t pio, uint32_t periph_a_mask, int use_pullup);
+void at91_pio_use_periph_b(uint32_t pio, uint32_t periph_b_mask, int use_pullup);
 void at91_pio_use_gpio(uint32_t pio, uint32_t gpio_mask);
 void at91_pio_gpio_input(uint32_t pio, uint32_t input_enable_mask);
-void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask);
+void at91_pio_gpio_output(uint32_t pio, uint32_t output_enable_mask,
+	int use_pullup);
 void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask);
 void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask);
 

==== //depot/projects/smpng/sys/arm/at91/at91_pmc.c#3 (text) ====

@@ -22,8 +22,10 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_at91.h"
+
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_pmc.c,v 1.2 2006/06/17 23:22:10 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_pmc.c,v 1.3 2006/07/14 22:01:51 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -397,7 +399,11 @@
 	pmc_softc->dev = dev;
 	if ((err = at91_pmc_activate(dev)) != 0)
 		return err;
+#ifdef AT91_TSC
+	at91_pmc_init_clock(pmc_softc, 16000000);
+#else
 	at91_pmc_init_clock(pmc_softc, 10000000);
+#endif
 
 	return (0);
 }

==== //depot/projects/smpng/sys/arm/at91/at91_rtc.c#2 (text) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_rtc.c,v 1.1 2006/03/24 07:35:30 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_rtc.c,v 1.2 2006/07/14 21:37:19 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -223,9 +223,14 @@
 static int
 at91_rtc_settime(device_t dev, struct timespec *ts)
 {
-	// XXX UGLY XXX
-	printf("SET TIME\n");
-	return (EINVAL);
+	struct at91_rtc_softc *sc;
+	struct clocktime ct;
+
+	sc = device_get_softc(dev);
+	clock_ts_to_ct(ts, &ct);
+	WR4(sc, RTC_TIMR, RTC_TIMR_MK(ct.hour, ct.min, ct.sec));
+	WR4(sc, RTC_CALR, RTC_CALR_MK(ct.year, ct.mon, ct.day, ct.dow));
+	return (0);
 }
 
 static device_method_t at91_rtc_methods[] = {

==== //depot/projects/smpng/sys/arm/at91/at91_rtcreg.h#2 (text) ====

@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* $FreeBSD: src/sys/arm/at91/at91_rtcreg.h,v 1.1 2006/03/24 07:35:30 imp Exp $ */
+/* $FreeBSD: src/sys/arm/at91/at91_rtcreg.h,v 1.2 2006/07/14 22:06:01 imp Exp $ */
 
 #ifndef ARM_AT91_AT91_RTCREG_H
 #define ARM_AT91_AT91_RTCREG_H
@@ -74,7 +74,7 @@
 #define RTC_CALR_DAY_S	24
 #define RTC_CALR_DAY(x)	FROMBCD(((x) & RTC_CALR_DAY_M) >> RTC_CALR_DAY_S)
 #define RTC_CALR_MK(yr, mon, day, dow) \
-		((TOBCD((yr) / 100 + 19) << RTC_CALR_CENTURY_S) | \
+		((TOBCD((yr) / 100 + 19) << RTC_CALR_CEN_S) | \
 		 (TOBCD((yr) % 100) << RTC_CALR_YEAR_S) | \
 		 (TOBCD(mon) << RTC_CALR_MON_S) | \
 		 (TOBCD(dow) << RTC_CALR_DOW_S) | \

==== //depot/projects/smpng/sys/arm/at91/at91_spi.c#2 (text) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.1 2006/02/04 23:32:13 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91_spi.c,v 1.2 2006/07/14 21:35:59 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -39,7 +39,10 @@
 #include <machine/bus.h>
 
 #include <arm/at91/at91_spireg.h>
-#include <arm/at91/at91_spiio.h>
+#include <arm/at91/at91_pdcreg.h>
+
+#include <dev/spibus/spi.h>
+#include "spibus_if.h"
 
 struct at91_spi_softc
 {
@@ -48,13 +51,8 @@
 	struct resource *irq_res;	/* IRQ resource */
 	struct resource	*mem_res;	/* Memory resource */
 	struct mtx sc_mtx;		/* basically a perimeter lock */
-	int flags;
-#define XFER_PENDING	1		/* true when transfer taking place */
-#define OPENED		2		/* Device opened */
-#define RXRDY		4
-#define TXCOMP		8
-#define TXRDY		0x10
-	struct cdev *cdev;
+	bus_dma_tag_t dmatag;		/* bus dma tag for mbufs */
+	bus_dmamap_t map[4];		/* Maps for the transaction */
 };
 
 static inline uint32_t
@@ -77,7 +75,6 @@
 #define AT91_SPI_LOCK_DESTROY(_sc)	mtx_destroy(&_sc->sc_mtx);
 #define AT91_SPI_ASSERT_LOCKED(_sc)	mtx_assert(&_sc->sc_mtx, MA_OWNED);
 #define AT91_SPI_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
-#define CDEV2SOFTC(dev)		((dev)->si_drv1)
 
 static devclass_t at91_spi_devclass;
 
@@ -86,25 +83,11 @@
 static int at91_spi_probe(device_t dev);
 static int at91_spi_attach(device_t dev);
 static int at91_spi_detach(device_t dev);
-static void at91_spi_intr(void *);
 
 /* helper routines */
 static int at91_spi_activate(device_t dev);
 static void at91_spi_deactivate(device_t dev);
 
-/* cdev routines */
-static d_open_t at91_spi_open;
-static d_close_t at91_spi_close;
-static d_ioctl_t at91_spi_ioctl;
-
-static struct cdevsw at91_spi_cdevsw =
-{
-	.d_version = D_VERSION,
-	.d_open = at91_spi_open,
-	.d_close = at91_spi_close,
-	.d_ioctl = at91_spi_ioctl
-};
-
 static int
 at91_spi_probe(device_t dev)
 {
@@ -116,7 +99,7 @@
 at91_spi_attach(device_t dev)
 {
 	struct at91_spi_softc *sc = device_get_softc(dev);
-	int err;
+	int err, i;
 
 	sc->dev = dev;
 	err = at91_spi_activate(dev);
@@ -126,31 +109,45 @@
 	AT91_SPI_LOCK_INIT(sc);
 
 	/*
-	 * Activate the interrupt
+	 * Allocate DMA tags and maps
 	 */
-	err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
-	    at91_spi_intr, sc, &sc->intrhand);
-	if (err) {
-		AT91_SPI_LOCK_DESTROY(sc);
+	err = bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT,
+	    BUS_SPACE_MAXADDR, NULL, NULL, 2058, 1, 2048, BUS_DMA_ALLOCNOW,
+	    NULL, NULL, &sc->dmatag);
+	if (err != 0)
 		goto out;
+	for (i = 0; i < 4; i++) {
+		err = bus_dmamap_create(sc->dmatag, 0,  &sc->map[i]);
+		if (err != 0)
+			goto out;
 	}
-	sc->cdev = make_dev(&at91_spi_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
-	    "spi%d", device_get_unit(dev));
-	if (sc->cdev == NULL) {
-		err = ENOMEM;
-		goto out;
-	}
-	sc->cdev->si_drv1 = sc;
-#if 0
-	/* init */
-	sc->cwgr = SPI_CWGR_CKDIV(1) |
-	    SPI_CWGR_CHDIV(SPI_CWGR_DIV(SPI_DEF_CLK)) |
-	    SPI_CWGR_CLDIV(SPI_CWGR_DIV(SPI_DEF_CLK));
 
+	// reset the SPI
 	WR4(sc, SPI_CR, SPI_CR_SWRST);
-	WR4(sc, SPI_CR, SPI_CR_MSEN | SPI_CR_SVDIS);
-	WR4(sc, SPI_CWGR, sc->cwgr);
-#endif
+
+	WR4(sc, SPI_MR, (0xf << 24) | SPI_MR_MSTR | SPI_MR_MODFDIS |
+	    (0xE << 16));
+
+	WR4(sc, SPI_CSR0, SPI_CSR_CPOL | (4 << 16) | (2 << 8));
+	WR4(sc, SPI_CR, SPI_CR_SPIEN);
+
+	WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS);
+	WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS);
+	WR4(sc, PDC_RNPR, 0);
+	WR4(sc, PDC_RNCR, 0);
+	WR4(sc, PDC_TNPR, 0);
+	WR4(sc, PDC_TNCR, 0);
+	WR4(sc, PDC_RPR, 0);
+	WR4(sc, PDC_RCR, 0);
+	WR4(sc, PDC_TPR, 0);
+	WR4(sc, PDC_TCR, 0);
+	WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN);
+	WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN);
+	RD4(sc, SPI_RDR);
+	RD4(sc, SPI_SR);
+
+	device_add_child(dev, "spibus", -1);
+	bus_generic_attach(dev);
 out:;
 	if (err)
 		at91_spi_deactivate(dev);
@@ -208,229 +205,70 @@
 }
 
 static void
-at91_spi_intr(void *xsc)
+at91_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
 {
-	struct at91_spi_softc *sc = xsc;
-#if 0
-	uint32_t status;
-
-	/* Reading the status also clears the interrupt */
-	status = RD4(sc, SPI_SR);
-	if (status == 0)
+	if (error != 0)
 		return;
-	AT91_SPI_LOCK(sc);
-	if (status & SPI_SR_RXRDY)
-		sc->flags |= RXRDY;
-	if (status & SPI_SR_TXCOMP)
-		sc->flags |= TXCOMP;
-	if (status & SPI_SR_TXRDY)
-		sc->flags |= TXRDY;
-	AT91_SPI_UNLOCK(sc);
-#endif
-	wakeup(sc);
-	return;
-}
-
-static int 
-at91_spi_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
-{
-	struct at91_spi_softc *sc;
-
-	sc = CDEV2SOFTC(dev);
-	AT91_SPI_LOCK(sc);
-	if (!(sc->flags & OPENED)) {
-		sc->flags |= OPENED;
-#if 0
-		WR4(sc, SPI_IER, SPI_SR_TXCOMP | SPI_SR_RXRDY | SPI_SR_TXRDY |
-		    SPI_SR_OVRE | SPI_SR_UNRE | SPI_SR_NACK);
-#endif
-	}
-	AT91_SPI_UNLOCK(sc);
-    	return (0);
+	*(bus_addr_t *)arg = segs[0].ds_addr;
 }
 
 static int
-at91_spi_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
+at91_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct at91_spi_softc *sc;
+	int i;
+	bus_addr_t addr;
 
-	sc = CDEV2SOFTC(dev);
-	AT91_SPI_LOCK(sc);
-	sc->flags &= ~OPENED;
-#if 0
-	WR4(sc, SPI_IDR, SPI_SR_TXCOMP | SPI_SR_RXRDY | SPI_SR_TXRDY |
-	    SPI_SR_OVRE | SPI_SR_UNRE | SPI_SR_NACK);
-#endif
-	AT91_SPI_UNLOCK(sc);
-	return (0);
-}
+	sc = device_get_softc(dev);
+	WR4(sc, PDC_PTCR, PDC_PTCR_TXTDIS | PDC_PTCR_RXTDIS);
+	i = 0;
+	if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_cmd,
+	    cmd->tx_cmd_sz, at91_getaddr, &addr, 0) != 0)
+		goto out;
+	WR4(sc, PDC_TPR, addr);
+	WR4(sc, PDC_TCR, cmd->tx_cmd_sz);
+	bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
+	i++;
+	if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->tx_data,
+	    cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
+		goto out;
+	WR4(sc, PDC_TNPR, addr);
+	WR4(sc, PDC_TNCR, cmd->tx_cmd_sz);
+	bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREWRITE);
+	i++;
+	if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_cmd,
+	    cmd->tx_cmd_sz, at91_getaddr, &addr, 0) != 0)
+		goto out;
+	WR4(sc, PDC_RPR, addr);
+	WR4(sc, PDC_RCR, cmd->tx_cmd_sz);
+	bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
+	i++;
+	if (bus_dmamap_load(sc->dmatag, sc->map[i], cmd->rx_data,
+	    cmd->tx_data_sz, at91_getaddr, &addr, 0) != 0)
+		goto out;
+	WR4(sc, PDC_RNPR, addr);
+	WR4(sc, PDC_RNCR, cmd->tx_data_sz);
+	bus_dmamap_sync(sc->dmatag, sc->map[i], BUS_DMASYNC_PREREAD);
 
-static int
-at91_spi_read_master(struct at91_spi_softc *sc, struct at91_spi_io *xfr)
-{
-#if 1
-    return ENOTTY;
-#else
-	uint8_t *walker;
-	uint8_t buffer[256];
-	size_t len;
-	int err = 0;
+	WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN | PDC_PTCR_RXTEN);
 
-	if (xfr->xfer_len > sizeof(buffer))
-		return (EINVAL);
-	walker = buffer;
-	len = xfr->xfer_len;
-	RD4(sc, SPI_RHR);
-	// Master mode, with the right address and interal addr size
-	WR4(sc, SPI_MMR, SPI_MMR_IADRSZ(xfr->iadrsz) | SPI_MMR_MREAD |
-	    SPI_MMR_DADR(xfr->dadr));
-	WR4(sc, SPI_IADR, xfr->iadr);
-	WR4(sc, SPI_CR, SPI_CR_START);
-	while (len-- > 1) {
-		while (!(sc->flags & RXRDY)) {
-			err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "spird",
-			    0);
-			if (err)
-				return (err);
-		}
-		sc->flags &= ~RXRDY;
-		*walker++ = RD4(sc, SPI_RHR) & 0xff;
-	}
-	WR4(sc, SPI_CR, SPI_CR_STOP);
-	while (!(sc->flags & TXCOMP)) {
-		err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "spird2", 0);
-		if (err)
-			return (err);
-	}
-	sc->flags &= ~TXCOMP;
-	*walker = RD4(sc, SPI_RHR) & 0xff;
-	if (xfr->xfer_buf) {
-		AT91_SPI_UNLOCK(sc);
-		err = copyout(buffer, xfr->xfer_buf, xfr->xfer_len);
-		AT91_SPI_LOCK(sc);
-	}
-	return (err);
-#endif
-}
+	// wait for completion
+	// XXX should be done as an ISR of some sort.
+	while (RD4(sc, SPI_SR) & SPI_SR_ENDRX)
+		DELAY(700);
 
-static int
-at91_spi_write_master(struct at91_spi_softc *sc, struct at91_spi_io *xfr)
-{
-#if 1
-    return ENOTTY;
-#else
-	uint8_t *walker;
-	uint8_t buffer[256];
-	size_t len;
-	int err;
-
-	if (xfr->xfer_len > sizeof(buffer))
-		return (EINVAL);
-	walker = buffer;
-	len = xfr->xfer_len;
-	AT91_SPI_UNLOCK(sc);
-	err = copyin(xfr->xfer_buf, buffer, xfr->xfer_len);
-	AT91_SPI_LOCK(sc);
-	if (err)
-		return (err);
-	/* Setup the xfr for later readback */
-	xfr->xfer_buf = 0;
-	xfr->xfer_len = 1;
-	while (len--) {
-		WR4(sc, SPI_MMR, SPI_MMR_IADRSZ(xfr->iadrsz) | SPI_MMR_MWRITE |
-		    SPI_MMR_DADR(xfr->dadr));
-		WR4(sc, SPI_IADR, xfr->iadr++);
-		WR4(sc, SPI_THR, *walker++);
-		WR4(sc, SPI_CR, SPI_CR_START);
-		/*
-		 * If we get signal while waiting for TXRDY, make sure we
-		 * try to stop this device
-		 */
-		while (!(sc->flags & TXRDY)) {
-			err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "spiwr",
-			    0);
-			if (err)
-				break;
-		}
-		WR4(sc, SPI_CR, SPI_CR_STOP);
-		if (err)
-			return (err);
-		while (!(sc->flags & TXCOMP)) {
-			err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH, "spiwr2",
-			    0);
-			if (err)
-				return (err);
-		}
-		/* Readback */
-		at91_spi_read_master(sc, xfr);
-	}
-	return (err);
-#endif
-}
-
-static int
-at91_spi_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
-    struct thread *td)
-{
-	int err = 0;
-	struct at91_spi_softc *sc;
-
-	sc = CDEV2SOFTC(dev);
-	AT91_SPI_LOCK(sc);
-	while (sc->flags & XFER_PENDING) {
-		err = msleep(sc, &sc->sc_mtx, PZERO | PCATCH,
-		    "spiwait", 0);
-		if (err) {
-			AT91_SPI_UNLOCK(sc);
-			return (err);
-		}
-	}
-	sc->flags |= XFER_PENDING;
-
-	switch (cmd)
-	{
-	case SPIIOCXFER:
-	{
-		struct at91_spi_io *xfr = (struct at91_spi_io *)data;
-		switch (xfr->type)
-		{
-		case SPI_IO_READ_MASTER:
-			err = at91_spi_read_master(sc, xfr);
-			break;
-		case SPI_IO_WRITE_MASTER:
-			err = at91_spi_write_master(sc, xfr);

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607191457.k6JEvdpA047863>