PERFORCE change 125395 for review

Roman Divacky rdivacky at FreeBSD.org
Mon Aug 20 02:28:15 PDT 2007


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

Change 125395 by rdivacky at rdivacky_witten on 2007/08/20 09:27:45

	IFC

Affected files ...

.. //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/conf/NOTES#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/include/specialreg.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/arm/arm/busdma_machdep.c#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/boot/arm/at91/boot2/boot2.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_proto.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_syscall.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_syscalls.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_sysent.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/syscalls.master#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/opensolaris/sys/proc.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/NOTES#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/files.amd64#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/files.i386#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/ata/ata-raid.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/coretemp/coretemp.c#1 branch
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/common/cxgb_t3_hw.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_adapter.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_ioctl.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_l2t.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_l2t.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_main.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_offload.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_offload.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_sge.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/dcons/dcons_os.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/ichwd/ichwd.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/ichwd/ichwd.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mfi/mfi.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mfi/mfi_disk.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mfi/mfi_pci.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mfi/mfireg.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mfi/mfivar.h#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mpt/mpt.c#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mpt/mpt.h#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/mpt/mpt_cam.c#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/re/if_re.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/usb/ehci.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/fs/msdosfs/msdosfs_vfsops.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/fs/tmpfs/tmpfs_vnops.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/gnu/fs/ext2fs/ext2_vfsops.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/i386/conf/NOTES#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/i386/include/specialreg.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/init_sysent.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/kern_cpu.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/kern_switch.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/kern_thr.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/sched_ule.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/syscalls.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/syscalls.master#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/systrace_args.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/vfs_mount.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/kern/vfs_subr.c#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/modules/Makefile#4 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/modules/coretemp/Makefile#1 branch
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/modules/netgraph/bluetooth/Makefile#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/net/bridgestp.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netgraph/bluetooth/drivers/h4/TODO#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netgraph/bluetooth/drivers/h4/ng_h4.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netgraph/bluetooth/drivers/h4/ng_h4_prse.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netgraph/bluetooth/drivers/h4/ng_h4_var.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netgraph/ng_base.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_asconf.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_input.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_output.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_pcb.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_timer.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctp_usrreq.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/sctputil.c#5 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/netinet/tcp_subr.c#6 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/include/intr_machdep.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/include/md_var.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/include/openpicvar.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powermac/hrowpic.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powermac/hrowpicvar.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powermac/openpic_macio.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/autoconf.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/interrupt.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/intr_machdep.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/nexus.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/openpic.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/powerpc/pic_if.m#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/powerpc/psim/openpic_iobus.c#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/sys/ata.h#2 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/sys/syscall.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/sys/syscall.mk#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/sys/sysproto.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/sys/thr.h#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/vm/device_pager.c#3 integrate
.. //depot/projects/soc2007/rdivacky/linux_futex/sys/vm/phys_pager.c#3 integrate

Differences ...

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/conf/NOTES#4 (text+ko) ====

@@ -4,7 +4,7 @@
 # This file contains machine dependent kernel configuration notes.  For
 # machine independent notes, look in /sys/conf/NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.68 2007/07/04 00:18:38 bz Exp $
+# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.69 2007/08/15 19:26:02 des Exp $
 #
 
 #
@@ -446,6 +446,13 @@
 #
 device		ichwd
 
+#
+# Temperature sensors:
+#
+# coretemp: on-die sensor on Intel Core and newer CPUs
+#
+device		coretemp
+
 #---------------------------------------------------------------------------
 # ISDN4BSD
 #

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/amd64/include/specialreg.h#3 (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.39 2007/05/31 11:26:44 des Exp $
+ * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.40 2007/08/15 19:26:01 des Exp $
  */
 
 #ifndef _MACHINE_SPECIALREG_H_
@@ -179,6 +179,7 @@
 #define	MSR_BIOS_SIGN		0x08b
 #define	MSR_PERFCTR0		0x0c1
 #define	MSR_PERFCTR1		0x0c2
+#define	MSR_IA32_EXT_CONFIG	0x0ee	/* Undocumented. Core Solo/Duo only */
 #define	MSR_MTRRcap		0x0fe
 #define	MSR_BBL_CR_ADDR		0x116
 #define	MSR_BBL_CR_DECC		0x118

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/arm/arm/busdma_machdep.c#4 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.34 2007/07/27 14:46:43 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.35 2007/08/18 16:47:28 cognet Exp $");
 
 /*
  * ARM bus dma support routines
@@ -1091,13 +1091,19 @@
 {
 	char _tmp_cl[arm_dcache_align], _tmp_clend[arm_dcache_align];
 
-	if (op & BUS_DMASYNC_PREWRITE) {
+	if ((op & BUS_DMASYNC_PREWRITE) && !(op & BUS_DMASYNC_PREREAD)) {
 		cpu_dcache_wb_range((vm_offset_t)buf, len);
 		cpu_l2cache_wb_range((vm_offset_t)buf, len);
 	}
 	if (op & BUS_DMASYNC_PREREAD) {
-		cpu_idcache_wbinv_range((vm_offset_t)buf, len);
-		cpu_l2cache_wbinv_range((vm_offset_t)buf, len);
+		if ((op & BUS_DMASYNC_PREWRITE) ||
+		    ((((vm_offset_t)(buf) | len) & arm_dcache_align_mask) == 0)) {
+			cpu_dcache_inv_range((vm_offset_t)buf, len);
+			cpu_l2cache_inv_range((vm_offset_t)buf, len);
+		} else {
+		    	cpu_dcache_wbinv_range((vm_offset_t)buf, len);
+	    		cpu_l2cache_wbinv_range((vm_offset_t)buf, len);
+		}
 	}
 	if (op & BUS_DMASYNC_POSTREAD) {
 		if ((vm_offset_t)buf & arm_dcache_align_mask) {

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/boot/arm/at91/boot2/boot2.c#3 (text+ko) ====

@@ -14,7 +14,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/arm/at91/boot2/boot2.c,v 1.6 2007/07/13 14:27:04 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/arm/at91/boot2/boot2.c,v 1.7 2007/08/17 18:22:31 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/disklabel.h>
@@ -216,7 +216,7 @@
 	    return;
     }
     addr = eh.e_entry;
-    ((void(*)(int))addr)(RB_BOOTINFO | (opts & RBX_MASK));
+    ((void(*)(int))addr)(opts & RBX_MASK);
 }
 
 static int

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_proto.h#3 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.77 2007/07/04 23:03:50 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_proto.h,v 1.78 2007/08/16 05:32:25 davidxu Exp $
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp 
  */
 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_syscall.h#3 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.75 2007/07/04 23:03:50 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscall.h,v 1.76 2007/08/16 05:32:25 davidxu Exp $
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp 
  */
 
@@ -337,4 +337,5 @@
 #define	FREEBSD32_SYS_freebsd32_lseek	478
 #define	FREEBSD32_SYS_freebsd32_truncate	479
 #define	FREEBSD32_SYS_freebsd32_ftruncate	480
-#define	FREEBSD32_SYS_MAXSYSCALL	481
+#define	FREEBSD32_SYS_thr_kill2	481
+#define	FREEBSD32_SYS_MAXSYSCALL	482

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_syscalls.c#3 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.66 2007/07/04 23:03:50 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_syscalls.c,v 1.67 2007/08/16 05:32:25 davidxu Exp $
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp 
  */
 
@@ -488,4 +488,5 @@
 	"freebsd32_lseek",			/* 478 = freebsd32_lseek */
 	"freebsd32_truncate",			/* 479 = freebsd32_truncate */
 	"freebsd32_ftruncate",			/* 480 = freebsd32_ftruncate */
+	"thr_kill2",			/* 481 = thr_kill2 */
 };

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/freebsd32_sysent.c#3 (text+ko) ====

@@ -2,7 +2,7 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.76 2007/07/04 23:03:50 peter Exp $
+ * $FreeBSD: src/sys/compat/freebsd32/freebsd32_sysent.c,v 1.77 2007/08/16 05:32:25 davidxu Exp $
  * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp 
  */
 
@@ -519,4 +519,5 @@
 	{ AS(freebsd32_lseek_args), (sy_call_t *)freebsd32_lseek, AUE_LSEEK, NULL, 0, 0 },	/* 478 = freebsd32_lseek */
 	{ AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0 },	/* 479 = freebsd32_truncate */
 	{ AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0 },	/* 480 = freebsd32_ftruncate */
+	{ AS(thr_kill2_args), (sy_call_t *)thr_kill2, AUE_KILL, NULL, 0, 0 },	/* 481 = thr_kill2 */
 };

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/freebsd32/syscalls.master#3 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.90 2007/07/04 23:02:40 peter Exp $
+ $FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.91 2007/08/16 05:30:04 davidxu Exp $
 ;	from: @(#)syscalls.master	8.2 (Berkeley) 1/13/94
 ;	from: src/sys/kern/syscalls.master 1.107
 ;
@@ -794,3 +794,4 @@
 				    u_int32_t lengthlo, u_int32_t lengthhi); }
 480	AUE_FTRUNCATE	STD	{ int freebsd32_ftruncate(int fd, \
 				    u_int32_t lengthlo, u_int32_t lengthhi); }
+481	AUE_KILL	NOPROTO	{ int thr_kill2(pid_t pid, long id, int sig); }

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/compat/opensolaris/sys/proc.h#2 (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/compat/opensolaris/sys/proc.h,v 1.1 2007/04/06 01:09:06 pjd Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/proc.h,v 1.2 2007/08/16 20:33:20 pjd Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_PROC_H_
@@ -56,6 +56,12 @@
 typedef struct thread	*kthread_id_t;
 typedef struct proc	proc_t;
 
+#if (KSTACK_PAGES * PAGE_SIZE) < 16384
+#define	ZFS_KSTACK_PAGES	(16384 / PAGE_SIZE)
+#else
+#define	ZFS_KSTACK_PAGES	0
+#endif
+
 static __inline kthread_t *
 thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
     size_t len, proc_t *pp, int state, pri_t pri)
@@ -71,7 +77,8 @@
 	ASSERT(len == 0);
 	ASSERT(state == TS_RUN);
 
-	error = kthread_create(proc, arg, &p, 0, 0, "solthread %p", proc);
+	error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES,
+	    "solthread %p", proc);
 	return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL);
 }
 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/NOTES#5 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1448 2007/08/05 16:16:15 bz Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1449 2007/08/13 17:19:27 emax Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -627,7 +627,7 @@
 options 	NETGRAPH_ATM_ATMPIF
 options 	NETGRAPH_BLUETOOTH		# ng_bluetooth(4)
 options 	NETGRAPH_BLUETOOTH_BT3C		# ng_bt3c(4)
-# options 	NETGRAPH_BLUETOOTH_H4		# ng_h4(4) - not MPSAFE
+options 	NETGRAPH_BLUETOOTH_H4		# ng_h4(4)
 options 	NETGRAPH_BLUETOOTH_HCI		# ng_hci(4)
 options 	NETGRAPH_BLUETOOTH_L2CAP	# ng_l2cap(4)
 options 	NETGRAPH_BLUETOOTH_SOCKET	# ng_btsocket(4)

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/files.amd64#5 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.106 2007/07/05 06:12:40 peter Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.107 2007/08/15 19:26:01 des Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -145,6 +145,7 @@
 dev/atkbdc/atkbdc_isa.c		optional	atkbdc isa
 dev/atkbdc/atkbdc_subr.c	optional	atkbdc
 dev/atkbdc/psm.c		optional	psm atkbdc
+dev/coretemp/coretemp.c		optional	coretemp
 # There are no systems with isa slots, so all ed isa entries should go..
 dev/ed/if_ed_3c503.c		optional	ed isa ed_3c503
 dev/ed/if_ed_isa.c		optional	ed isa

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/conf/files.i386#5 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.579 2007/07/05 06:12:40 peter Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.580 2007/08/15 19:26:01 des Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -158,6 +158,7 @@
 dev/ce/if_ce.c			optional ce
 dev/ce/tau32-ddk.c		optional ce
 dev/cm/if_cm_isa.c		optional cm isa
+dev/coretemp/coretemp.c		optional coretemp
 dev/cp/cpddk.c			optional cp
 dev/cp/if_cp.c			optional cp
 dev/ctau/ctau.c			optional ctau

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/ata/ata-raid.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.123 2007/02/21 19:07:18 sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.124 2007/08/13 18:46:31 jhb Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -56,7 +56,7 @@
 /* prototypes */
 static void ata_raid_done(struct ata_request *request);
 static void ata_raid_config_changed(struct ar_softc *rdp, int writeback);
-static int ata_raid_status(struct ata_ioc_raid_config *config);
+static int ata_raid_status(struct ata_ioc_raid_status *status);
 static int ata_raid_create(struct ata_ioc_raid_config *config);
 static int ata_raid_delete(int array);
 static int ata_raid_addspare(struct ata_ioc_raid_config *config);
@@ -216,13 +216,14 @@
 static int
 ata_raid_ioctl(u_long cmd, caddr_t data)
 {
+    struct ata_ioc_raid_status *status = (struct ata_ioc_raid_status *)data;
     struct ata_ioc_raid_config *config = (struct ata_ioc_raid_config *)data;
     int *lun = (int *)data;
     int error = EOPNOTSUPP;
 
     switch (cmd) {
     case IOCATARAIDSTATUS:
-	error = ata_raid_status(config);
+	error = ata_raid_status(status);
 	break;
 			
     case IOCATARAIDCREATE:
@@ -929,25 +930,32 @@
 }
 
 static int
-ata_raid_status(struct ata_ioc_raid_config *config)
+ata_raid_status(struct ata_ioc_raid_status *status)
 {
     struct ar_softc *rdp;
     int i;
 	
-    if (!(rdp = ata_raid_arrays[config->lun]))
+    if (!(rdp = ata_raid_arrays[status->lun]))
 	return ENXIO;
 	
-    config->type = rdp->type;
-    config->total_disks = rdp->total_disks;
+    status->type = rdp->type;
+    status->total_disks = rdp->total_disks;
     for (i = 0; i < rdp->total_disks; i++ ) {
-	if ((rdp->disks[i].flags & AR_DF_PRESENT) && rdp->disks[i].dev)  
-	    config->disks[i] = device_get_unit(rdp->disks[i].dev);
-	else
-	    config->disks[i] = -1;
+	status->disks[i].state = 0;
+	if ((rdp->disks[i].flags & AR_DF_PRESENT) && rdp->disks[i].dev) {
+	    status->disks[i].lun = device_get_unit(rdp->disks[i].dev);
+	    if (rdp->disks[i].flags & AR_DF_PRESENT)
+		status->disks[i].state |= AR_DISK_PRESENT;
+	    if (rdp->disks[i].flags & AR_DF_ONLINE)
+		status->disks[i].state |= AR_DISK_ONLINE;
+	    if (rdp->disks[i].flags & AR_DF_SPARE)
+		status->disks[i].state |= AR_DISK_SPARE;
+	} else
+	    status->disks[i].lun = -1;
     }
-    config->interleave = rdp->interleave;
-    config->status = rdp->status;
-    config->progress = 100 * rdp->rebuild_lba / rdp->total_sectors;
+    status->interleave = rdp->interleave;
+    status->status = rdp->status;
+    status->progress = 100 * rdp->rebuild_lba / rdp->total_sectors;
     return 0;
 }
 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/common/cxgb_t3_hw.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/common/cxgb_t3_hw.c,v 1.6 2007/07/17 06:50:34 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/common/cxgb_t3_hw.c,v 1.7 2007/08/17 05:57:04 kmacy Exp $");
 
 
 #ifdef CONFIG_DEFINED
@@ -501,7 +501,7 @@
 #undef CAPS_10G
 
 #define VPD_ENTRY(name, len) \
-	u8 name##_kword[2]; u8 name##_len; u8 name##_data[len]
+	u8 name##_kword[2]; u8 name##_len; char name##_data[len]
 
 /*
  * Partial EEPROM Vital Product Data structure.  Includes only the ID and

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_adapter.h#3 (text+ko) ====

@@ -26,7 +26,7 @@
 POSSIBILITY OF SUCH DAMAGE.
 
 
-$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.15 2007/08/10 23:33:34 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.16 2007/08/17 05:57:03 kmacy Exp $
 
 ***************************************************************************/
 
@@ -36,7 +36,7 @@
 #define _CXGB_ADAPTER_H_
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.15 2007/08/10 23:33:34 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.16 2007/08/17 05:57:03 kmacy Exp $");
 
 #include <sys/lock.h>
 #include <sys/mutex.h>
@@ -310,7 +310,7 @@
 	TAILQ_ENTRY(adapter)    adapter_entry;
 	
 	/* PCI register resources */
-	uint32_t		regs_rid;
+	int			regs_rid;
 	struct resource		*regs_res;
 	bus_space_handle_t	bh;
 	bus_space_tag_t		bt;

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_ioctl.h#3 (text+ko) ====

@@ -25,7 +25,7 @@
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
-$FreeBSD: src/sys/dev/cxgb/cxgb_ioctl.h,v 1.4 2007/07/17 06:50:33 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_ioctl.h,v 1.5 2007/08/17 05:57:03 kmacy Exp $
 
 ***************************************************************************/
 #ifndef __CHIOCTL_H__
@@ -128,7 +128,7 @@
 	int8_t   channel;
 	int32_t  kbps;        /* rate in Kbps */
 	int32_t  class_ipg;   /* tenths of nanoseconds */
-	int32_t  flow_ipg;    /* usec */
+	uint32_t flow_ipg;    /* usec */
 };
 
 struct ch_filter_tuple {

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_l2t.c#2 (text+ko) ====

@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.c,v 1.2 2007/05/28 22:57:26 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.c,v 1.3 2007/08/17 05:57:03 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -37,9 +37,10 @@
 #include <sys/bus.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
+#if __FreeBSD_version > 700000
 #include <sys/rwlock.h>
+#endif
 
-
 #include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <net/if.h>
@@ -58,7 +59,7 @@
 
 #define VLAN_NONE 0xfff
 #define SDL(s) ((struct sockaddr_dl *)s) 
-#define RT_ENADDR(rt)  ((char *)LLADDR(SDL((rt))))
+#define RT_ENADDR(rt)  ((u_char *)LLADDR(SDL((rt))))
 #define rt_expire rt_rmx.rmx_expire 
 
 struct llinfo_arp { 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_l2t.h#2 (text+ko) ====

@@ -25,7 +25,7 @@
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
-$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.h,v 1.1 2007/05/25 09:48:19 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.h,v 1.2 2007/08/17 05:57:03 kmacy Exp $
 
 ***************************************************************************/
 #ifndef _CHELSIO_L2T_H
@@ -33,7 +33,18 @@
 
 #include <dev/cxgb/ulp/toecore/toedev.h>
 #include <sys/lock.h>
+
+#if __FreeBSD_version > 700000
 #include <sys/rwlock.h>
+#else
+#define rwlock mtx
+#define rw_wlock(x) mtx_lock((x))
+#define rw_wunlock(x) mtx_unlock((x))
+#define rw_rlock(x) mtx_lock((x))
+#define rw_runlock(x) mtx_unlock((x))
+#define rw_init(x, str) mtx_init((x), (str), NULL, MTX_DEF)
+#define rw_destroy(x) mtx_destroy((x))
+#endif
 
 enum {
 	L2T_STATE_VALID,      /* entry is up to date */

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_main.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.30 2007/08/10 23:47:39 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_main.c,v 1.31 2007/08/17 05:57:04 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -384,10 +384,12 @@
 	device_t child;
 	const struct adapter_info *ai;
 	struct adapter *sc;
-	int i, reg, msi_needed, error = 0;
+	int i, reg, error = 0;
 	uint32_t vers;
 	int port_qsets = 1;
-	
+#ifdef MSI_SUPPORTED
+	int msi_needed;
+#endif	
 	sc = device_get_softc(dev);
 	sc->dev = dev;
 	sc->msi_count = 0;
@@ -935,6 +937,7 @@
 /* Don't enable TSO6 yet */
 #define CXGB_CAP_ENABLE (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM |  IFCAP_JUMBO_MTU)
 #define IFCAP_TSO4 0x0
+#define IFCAP_TSO6 0x0
 #define CSUM_TSO   0x0
 #endif
 
@@ -1038,7 +1041,7 @@
 	    taskqueue_thread_enqueue, &p->tq);
 #else
 	/* Create a port for handling TX without starvation */
-	p->tq = taskqueue_create_fast(buf, M_NOWAIT,
+	p->tq = taskqueue_create_fast(p->taskqbuf, M_NOWAIT,
 	    taskqueue_thread_enqueue, &p->tq);
 #endif	
 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_offload.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_offload.c,v 1.7 2007/08/10 23:33:34 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_offload.c,v 1.8 2007/08/17 05:57:04 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -596,7 +596,7 @@
 
 	BUG_ON(tid >= t->ntids);
 	if (tdev->type == T3A)
-		atomic_cmpset_ptr((long *)&t->tid_tab[tid].ctx, (long)NULL, (long)ctx);
+		atomic_cmpset_ptr((uintptr_t *)&t->tid_tab[tid].ctx, (long)NULL, (long)ctx);
 	else {
 		struct mbuf *m;
 

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_offload.h#2 (text+ko) ====

@@ -26,7 +26,7 @@
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
 
-$FreeBSD: src/sys/dev/cxgb/cxgb_offload.h,v 1.3 2007/07/17 06:50:33 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_offload.h,v 1.4 2007/08/17 05:57:04 kmacy Exp $
 
 ***************************************************************************/
 
@@ -149,7 +149,7 @@
 struct tid_info {
 	struct toe_tid_entry *tid_tab;
 	unsigned int ntids;
-	volatile int tids_in_use;
+	volatile unsigned int tids_in_use;
 
 	union listen_entry *stid_tab;
 	unsigned int nstids;

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/cxgb/cxgb_sge.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
 ***************************************************************************/
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.26 2007/08/10 23:47:39 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_sge.c,v 1.27 2007/08/17 05:57:04 kmacy Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1168,8 +1168,8 @@
 	struct sge_txq *txq;
 	struct tx_sw_desc *stx;
 	struct txq_state txqs;
-	unsigned int nsegs, ndesc, flits, cntrl, mlen;
-	int err, tso_info = 0;
+	unsigned int ndesc, flits, cntrl, mlen;
+	int err, nsegs, tso_info = 0;
 
 	struct work_request_hdr *wrp;
 	struct tx_sw_desc *txsd;
@@ -1212,7 +1212,7 @@
 		struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *) cpl;
 		struct ip *ip;
 		struct tcphdr *tcp;
-		uint8_t *pkthdr, tmp[TCPPKTHDRSIZE]; /* is this too large for the stack? */
+		char *pkthdr, tmp[TCPPKTHDRSIZE]; /* is this too large for the stack? */
 		
 		txd->flit[2] = 0;
 		cntrl |= V_TXPKT_OPCODE(CPL_TX_PKT_LSO);
@@ -1222,7 +1222,7 @@
 			pkthdr = &tmp[0];
 			m_copydata(m0, 0, TCPPKTHDRSIZE, pkthdr);
 		} else {
-			pkthdr = mtod(m0, uint8_t *);
+			pkthdr = mtod(m0, char *);
 		}
 
 		if (__predict_false(m0->m_flags & M_VLANTAG)) {
@@ -1792,12 +1792,10 @@
 static int
 ofld_xmit(adapter_t *adap, struct sge_txq *q, struct mbuf *m)
 {
-	int ret;
-	unsigned int pidx, gen, nsegs;
-	unsigned int ndesc;
+	unsigned int pidx, gen, ndesc;
 	struct mbuf *m_vec[TX_CLEAN_MAX_DESC];
 	bus_dma_segment_t segs[TX_MAX_SEGS];
-	int i, cleaned;
+	int i, cleaned, ret, nsegs;
 	struct tx_sw_desc *stx = &q->sdesc[q->pidx];
 
 	mtx_lock(&q->lock);

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/dcons/dcons_os.c#3 (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.18 2007/06/11 04:08:50 simokawa Exp $
+ * $FreeBSD: src/sys/dev/dcons/dcons_os.c,v 1.19 2007/08/17 05:32:39 simokawa Exp $
  */
 
 #include <sys/param.h>
@@ -241,11 +241,10 @@
 #endif
 
 static int
-dcons_os_checkc(struct dcons_softc *dc)
+dcons_os_checkc_nopoll(struct dcons_softc *dc)
 {
 	int c;
 
-	EVENTHANDLER_INVOKE(dcons_poll, 0);
 	if (dg.dma_tag != NULL)
 		bus_dmamap_sync(dg.dma_tag, dg.dma_map, BUS_DMASYNC_POSTREAD);
   
@@ -257,6 +256,13 @@
 	return (c);
 }
 
+static int
+dcons_os_checkc(struct dcons_softc *dc)
+{
+	EVENTHANDLER_INVOKE(dcons_poll, 0);
+	return (dcons_os_checkc_nopoll(dc));
+}
+
 #if defined(GDB) || !defined(CONS_NODEV)
 static int
 dcons_os_getc(struct dcons_softc *dc)
@@ -408,7 +414,7 @@
 	for (i = 0; i < DCONS_NPORT; i ++) {
 		dc = &sc[i];
 		tp = ((DEV)dc->dev)->si_tty;
-		while ((c = dcons_os_checkc(dc)) != -1)
+		while ((c = dcons_os_checkc_nopoll(dc)) != -1)
 			if (tp->t_state & TS_ISOPEN)
 #if __FreeBSD_version < 502113
 				(*linesw[tp->t_line].l_rint)(c, tp);

==== //depot/projects/soc2007/rdivacky/linux_futex/sys/dev/ichwd/ichwd.c#2 (text+ko) ====

@@ -51,10 +51,12 @@
  * (document no. 292273-001).  The WDT is also described in the individual
  * chipset datasheets, e.g. Intel82801EB ICH5 / 82801ER ICH5R Datasheet
  * (document no. 252516-001) sections 9.10 and 9.11.
+ *
+ * ICH6/7/8 support by Takeharu KATO <takeharu1219 at ybb.ne.jp>
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.9 2007/03/27 21:03:36 n_hibma Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ichwd/ichwd.c,v 1.10 2007/08/13 18:52:37 des Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -71,20 +73,27 @@
 #include <dev/ichwd/ichwd.h>
 
 static struct ichwd_device ichwd_devices[] = {
-	{ VENDORID_INTEL, DEVICEID_82801AA, "Intel 82801AA watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801AB, "Intel 82801AB watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801BA, "Intel 82801BA watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801BAM, "Intel 82801BAM watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801CA, "Intel 82801CA watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801CAM, "Intel 82801CAM watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801DB, "Intel 82801DB watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801DBM, "Intel 82801DBM watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801E, "Intel 82801E watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer" },
-	{ VENDORID_INTEL, DEVICEID_ICH5, "Intel ICH5 watchdog timer"},
-	{ VENDORID_INTEL, DEVICEID_6300ESB, "Intel 6300ESB watchdog timer"},
-	{ 0, 0, NULL },
+	{ DEVICEID_82801AA,  "Intel 82801AA watchdog timer",    1 },
+	{ DEVICEID_82801AB,  "Intel 82801AB watchdog timer",    1 },
+	{ DEVICEID_82801BA,  "Intel 82801BA watchdog timer",    2 },
+	{ DEVICEID_82801BAM, "Intel 82801BAM watchdog timer",   2 },
+	{ DEVICEID_82801CA,  "Intel 82801CA watchdog timer",    3 },
+	{ DEVICEID_82801CAM, "Intel 82801CAM watchdog timer",   3 },
+	{ DEVICEID_82801DB,  "Intel 82801DB watchdog timer",    4 },
+	{ DEVICEID_82801DBM, "Intel 82801DBM watchdog timer",   4 },
+	{ DEVICEID_82801E,   "Intel 82801E watchdog timer",     5 },
+	{ DEVICEID_82801EBR, "Intel 82801EB/ER watchdog timer", 5 },
+	{ DEVICEID_6300ESB,  "Intel 6300ESB watchdog timer",    5 },
+	{ DEVICEID_82801FBR, "Intel 82801FB/FR watchdog timer", 6 },
+	{ DEVICEID_ICH6M,    "Intel ICH6M watchdog timer",      6 },
+	{ DEVICEID_ICH6W,    "Intel ICH6W watchdog timer",      6 },
+	{ DEVICEID_ICH7,     "Intel ICH7 watchdog timer",       7 },
+	{ DEVICEID_ICH7M,    "Intel ICH7M watchdog timer",      7 },
+	{ DEVICEID_ICH7MDH,  "Intel ICH7MDH watchdog timer",    7 },
+	{ DEVICEID_ICH8,     "Intel ICH8 watchdog timer",       8 },
+	{ DEVICEID_ICH8DH,   "Intel ICH8DH watchdog timer",     8 },
+	{ DEVICEID_ICH8DO,   "Intel ICH8DO watchdog timer",     8 },
+	{ 0, NULL, 0 },
 };
 
 static devclass_t ichwd_devclass;
@@ -95,6 +104,10 @@
 	bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off))
 #define ichwd_read_tco_4(sc, off) \
 	bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off))
+#define ichwd_read_smi_4(sc, off) \
+	bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off))
+#define ichwd_read_gcs_4(sc, off) \
+	bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off))
 
 #define ichwd_write_tco_1(sc, off, val) \
 	bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
@@ -102,12 +115,17 @@
 	bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
 #define ichwd_write_tco_4(sc, off, val) \
 	bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
-
-#define ichwd_read_smi_4(sc, off) \
-	bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off))
 #define ichwd_write_smi_4(sc, off, val) \
 	bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val))
+#define ichwd_write_gcs_4(sc, off, val) \
+	bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val))
 
+#define ichwd_verbose_printf(dev, ...) \
+	do {						\
+		if (bootverbose)			\
+			device_printf(dev, __VA_ARGS__);\
+	} while (0)
+
 static __inline void
 ichwd_intr_enable(struct ichwd_softc *sc)
 {
@@ -136,8 +154,7 @@
 	cnt = ichwd_read_tco_2(sc, TCO1_CNT) & TCO_CNT_PRESERVE;
 	ichwd_write_tco_2(sc, TCO1_CNT, cnt & ~TCO_TMR_HALT);
 	sc->active = 1;
-	if (bootverbose)
-		device_printf(sc->device, "timer enabled\n");
+	ichwd_verbose_printf(sc->device, "timer enabled\n");
 }
 
 static __inline void
@@ -148,25 +165,85 @@
 	cnt = ichwd_read_tco_2(sc, TCO1_CNT) & TCO_CNT_PRESERVE;
 	ichwd_write_tco_2(sc, TCO1_CNT, cnt | TCO_TMR_HALT);
 	sc->active = 0;
-	if (bootverbose)
-		device_printf(sc->device, "timer disabled\n");
+	ichwd_verbose_printf(sc->device, "timer disabled\n");
 }
 
 static __inline void
 ichwd_tmr_reload(struct ichwd_softc *sc)
 {
-	ichwd_write_tco_1(sc, TCO_RLD, 1);
-	if (bootverbose)
-		device_printf(sc->device, "timer reloaded\n");
+	if (sc->ich_version <= 5)
+		ichwd_write_tco_1(sc, TCO_RLD, 1);
+	else
+		ichwd_write_tco_2(sc, TCO_RLD, 1);
+
+	ichwd_verbose_printf(sc->device, "timer reloaded\n");
 }
 
 static __inline void
-ichwd_tmr_set(struct ichwd_softc *sc, uint8_t timeout)
+ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout)
 {
-	ichwd_write_tco_1(sc, TCO_TMR, timeout);
+
+	/*
+	 * If the datasheets are to be believed, the minimum value
+	 * actually varies from chipset to chipset - 4 for ICH5 and 2 for
+	 * all other chipsets.  I suspect this is a bug in the ICH5
+	 * datasheet and that the minimum is uniformly 2, but I'd rather
+	 * err on the side of caution.
+	 */
+	if (timeout < 4)
+		timeout = 4;
+
+	if (sc->ich_version <= 5) {
+		uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1);
+
+		tmr_val8 &= 0xc0;
+		if (timeout > 0xbf)
+			timeout = 0xbf;
+		tmr_val8 |= timeout;
+		ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8);
+	} else {
+		uint16_t tmr_val16 = ichwd_read_tco_2(sc, TCO_TMR2);
+
+		tmr_val16 &= 0xfc00;
+		if (timeout > 0x0bff)
+			timeout = 0x0bff;
+		tmr_val16 |= timeout;
+		ichwd_write_tco_2(sc, TCO_TMR2, tmr_val16);
+	}
+
 	sc->timeout = timeout;
-	if (bootverbose)
-		device_printf(sc->device, "timeout set to %u ticks\n", timeout);
+
+	ichwd_verbose_printf(sc->device, "timeout set to %u ticks\n", timeout);
+}
+
+static __inline int
+ichwd_clear_noreboot(struct ichwd_softc *sc)
+{
+	uint32_t status;
+	int rc = 0;
+
+	/* try to clear the NO_REBOOT bit */
+	if (sc->ich_version <= 5) {
+		status = pci_read_config(sc->ich, ICH_GEN_STA, 1);
+		status &= ~ICH_GEN_STA_NO_REBOOT;
+		pci_write_config(sc->ich, ICH_GEN_STA, status, 1);
+		status = pci_read_config(sc->ich, ICH_GEN_STA, 1);
+		if (status & ICH_GEN_STA_NO_REBOOT)
+			rc = EIO;
+	} else {
+		status = ichwd_read_gcs_4(sc, 0);
+		status &= ~ICH_GCS_NO_REBOOT;
+		ichwd_write_gcs_4(sc, 0, status);
+		status = ichwd_read_gcs_4(sc, 0);
+		if (status & ICH_GCS_NO_REBOOT)
+			rc = EIO;
+	}
+
+	if (rc)
+		device_printf(sc->device,
+		    "ICH WDT present but disabled in BIOS or hardware\n");
+
+	return (rc);
 }
 
 /*
@@ -181,14 +258,12 @@
 	/* convert from power-of-two-ns to WDT ticks */
 	cmd &= WD_INTERVAL;
 	timeout = ((uint64_t)1 << cmd) / ICHWD_TICK;
-	if (cmd > 0 && cmd <= 63
-	    && timeout >= ICHWD_MIN_TIMEOUT && timeout <= ICHWD_MAX_TIMEOUT) {
+	if (cmd) {
 		if (timeout != sc->timeout) {
 			if (!sc->active)
 				ichwd_tmr_enable(sc);
 			ichwd_tmr_set(sc, timeout);
 		}
-
 		ichwd_tmr_reload(sc);
 		*error = 0;
 	} else {
@@ -197,7 +272,28 @@
 	}
 }
 
-static unsigned int pmbase = 0;
+static device_t
+ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p)
+{

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


More information about the p4-projects mailing list