PERFORCE change 181661 for review

Bjoern A. Zeeb bz at FreeBSD.org
Sat Jul 31 22:33:23 UTC 2010


http://p4web.freebsd.org/@@181661?ac=10

Change 181661 by bz at bz_dumpster on 2010/07/31 22:33:09

	IFC @181660
	
	Could fix a "SRAT: CPU with APIC ID 0 is not known" in Fusion.

Affected files ...

.. //depot/projects/soc2009/anchie_send/src/sys/amd64/acpica/acpi_switch.S#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/cpu_switch.S#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/genassym.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/support.S#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/conf/GENERIC#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/include/pcpu.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/amd64/include/specialreg.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/boot/zfs/zfstest.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/conf/NOTES#10 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/files.powerpc#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/files.sparc64#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/files.sun4v#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/options#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/conf/options.powerpc#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/amr/amrvar.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/coretemp/coretemp.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/e1000/e1000_osdep.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_et.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_etreg.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_etvar.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/hwpmc/hwpmc_core.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/hwpmc/hwpmc_core.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/ipmi/ipmi_smbios.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/pci/pci.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/pci/pci_user.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/quirk/usb_quirk.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/serial/uplcom.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/dev/usb/usbdevs#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/conf/GENERIC#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/genassym.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/i386/swtch.s#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/include/pcpu.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/i386/include/specialreg.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ia64/conf/GENERIC#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/ia64/include/pcpu.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/kern_malloc.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/kern/subr_witness.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/_stdint.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/param.h#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/profile.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/runq.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/include/vmparam.h#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/exception.S#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/genassym.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/locore.S#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/pm_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/pmap.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/support.S#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/swtch.S#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/trap.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/mips/vm_machdep.c#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/mips/rmi/dev/xlr/rge.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/modules/ata/atacore/Makefile#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/if_ether.c#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/in_rmx.c#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/sctp_indata.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/sctp_output.c#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/sctp_structs.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/sctp_timer.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet/tcp_syncache.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#39 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/opencrypto/cryptodev.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/pc98/conf/GENERIC#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/aim/mmu_oea64.c#9 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/aim/slb.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/conf/GENERIC#8 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/conf/GENERIC64#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/conf/NOTES#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/include/slb.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambo.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambo_console.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambo_disk.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambo_openpic.c#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambocall.S#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/powerpc/mambo/mambocall.h#1 branch
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/conf/GENERIC#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/intr_machdep.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/pcpu.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/smp.h#5 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/include/tick.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/clock.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/intr_machdep.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/mp_machdep.c#6 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sparc64/sparc64/tick.c#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/conf/GENERIC#7 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/clock.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/intr_machdep.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/pcpu.h#4 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/smp.h#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/include/tick.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/clock.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/intr_machdep.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/mp_machdep.c#3 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sun4v/sun4v/tick.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sys/malloc.h#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/sys/param.h#11 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/x86/acpica/srat.c#2 integrate
.. //depot/projects/soc2009/anchie_send/src/sys/x86/x86/mca.c#2 integrate

Differences ...

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/acpica/acpi_switch.S#4 (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/amd64/acpica/acpi_switch.S,v 1.6 2010/07/26 19:53:09 jkim Exp $
+ * $FreeBSD: src/sys/amd64/acpica/acpi_switch.S,v 1.7 2010/07/29 16:41:21 jkim Exp $
  */
 
 #include <machine/asmacros.h>
@@ -156,7 +156,7 @@
 	movq	PCPU(FPCURTHREAD), %rax
 	testq	%rax, %rax
 	je	1f
-	fxrstor	WAKEUP_PCB(USER_FPU)
+	fxrstor	WAKEUP_PCB(USERFPU)
 1:
 
 	/* Restore CR0 with FPU mode. */

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/cpu_switch.S#5 (text+ko) ====

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.173 2010/07/26 19:53:09 jkim Exp $
+ * $FreeBSD: src/sys/amd64/amd64/cpu_switch.S,v 1.175 2010/07/29 16:49:20 jkim Exp $
  */
 
 #include <machine/asmacros.h>
@@ -347,7 +347,7 @@
 	lmsw	%ax
 
 	movq	$PCB_SAVEFPU_SIZE,%rdx	/* arg 3 */
-	movq	PCB_SAVEFPU(%rcx),%rsi	/* arg 2 */
+	leaq	PCB_USERFPU(%rcx),%rsi	/* arg 2 */
 	/* arg 1 (%rdi) already loaded */
 	call	bcopy
 1:
@@ -421,7 +421,7 @@
 	testq	%rax,%rax
 	je	1f
 	clts
-	fxsave	PCB_USER_FPU(%r8)
+	fxsave	PCB_USERFPU(%r8)
 1:
 
 	movl	$1, %eax

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/genassym.c#4 (text+ko) ====

@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.178 2010/07/26 19:53:09 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.179 2010/07/29 16:41:21 jkim Exp $");
 
 #include "opt_compat.h"
 #include "opt_hwpmc_hooks.h"
@@ -140,7 +140,7 @@
 ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3));
 ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6));
 ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7));
-ASSYM(PCB_USER_FPU, offsetof(struct pcb, pcb_user_save));
+ASSYM(PCB_USERFPU, offsetof(struct pcb, pcb_user_save));
 ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp));
 ASSYM(PCB_FULL_IRET, offsetof(struct pcb, pcb_full_iret));
 ASSYM(PCB_DBREGS, PCB_DBREGS);

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/amd64/support.S#3 (text+ko) ====

@@ -27,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.130 2009/06/05 20:23:29 kib Exp $
+ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.131 2010/07/30 21:39:28 delphij Exp $
  */
 
 #include "opt_ddb.h"
@@ -729,7 +729,7 @@
 	rdmsr			/* Read MSR pointed by %ecx. Returns
 				   hi byte in edx, lo in %eax */
 	salq	$32,%rdx	/* sign-shift %rdx left */
-	cltq			/* sign-extend %eax -> %rax */
+	movl	%eax,%eax	/* zero-extend %eax -> %rax */
 	orq	%rdx,%rax
 	movq	%rax,(%rsi)
 	xorq	%rax,%rax

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/conf/GENERIC#10 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.545 2010/07/07 09:23:46 kevlo Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.546 2010/07/28 15:36:12 mdf Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -76,6 +76,7 @@
 options 	INVARIANT_SUPPORT	# Extra sanity checks of internal structures, required by INVARIANTS
 options 	WITNESS			# Enable checks to detect deadlocks and cycles
 options 	WITNESS_SKIPSPIN	# Don't run witness on spinlocks for speed
+options 	MALLOC_DEBUG_MAXZONES=8	# Separate malloc(9) zones
 
 # Make an SMP-capable kernel by default
 options 	SMP			# Symmetric MultiProcessor Kernel

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/include/pcpu.h#3 (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/amd64/include/pcpu.h,v 1.55 2010/05/24 15:45:05 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/pcpu.h,v 1.56 2010/07/29 18:44:10 jhb Exp $
  */
 
 #ifndef _MACHINE_PCPU_H_
@@ -216,12 +216,12 @@
 #define	PCPU_PTR(member)	__PCPU_PTR(pc_ ## member)
 #define	PCPU_SET(member, val)	__PCPU_SET(pc_ ## member, val)
 
-static __inline struct thread *
+static __inline __pure2 struct thread *
 __curthread(void)
 {
 	struct thread *td;
 
-	__asm __volatile("movq %%gs:0,%0" : "=r" (td));
+	__asm("movq %%gs:0,%0" : "=r" (td));
 	return (td);
 }
 #define	curthread		(__curthread())

==== //depot/projects/soc2009/anchie_send/src/sys/amd64/include/specialreg.h#6 (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.63 2010/05/24 15:45:05 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/specialreg.h,v 1.65 2010/07/29 19:08:22 delphij Exp $
  */
 
 #ifndef _MACHINE_SPECIALREG_H_
@@ -258,6 +258,7 @@
 #define	MSR_THERM_INTERRUPT	0x19b
 #define	MSR_THERM_STATUS	0x19c
 #define	MSR_IA32_MISC_ENABLE	0x1a0
+#define	MSR_IA32_TEMPERATURE_TARGET	0x1a2
 #define	MSR_DEBUGCTLMSR		0x1d9
 #define	MSR_LASTBRANCHFROMIP	0x1db
 #define	MSR_LASTBRANCHTOIP	0x1dc
@@ -372,10 +373,10 @@
 #define	MC_STATUS_MCA_ERROR	0x000000000000ffff
 #define	MC_STATUS_MODEL_ERROR	0x00000000ffff0000
 #define	MC_STATUS_OTHER_INFO	0x01ffffff00000000
-#define	MC_STATUS_COR_COUNT	0x001fffc000000000	/* If MCG_CAP_TES_P */
+#define	MC_STATUS_COR_COUNT	0x001fffc000000000	/* If MCG_CAP_CMCI_P */
 #define	MC_STATUS_TES_STATUS	0x0060000000000000	/* If MCG_CAP_TES_P */
-#define	MC_STATUS_AR		0x0080000000000000	/* If MCG_CAP_CMCI_P */
-#define	MC_STATUS_S		0x0100000000000000	/* If MCG_CAP_CMCI_P */
+#define	MC_STATUS_AR		0x0080000000000000	/* If MCG_CAP_TES_P */
+#define	MC_STATUS_S		0x0100000000000000	/* If MCG_CAP_TES_P */
 #define	MC_STATUS_PCC		0x0200000000000000
 #define	MC_STATUS_ADDRV		0x0400000000000000
 #define	MC_STATUS_MISCV		0x0800000000000000

==== //depot/projects/soc2009/anchie_send/src/sys/conf/NOTES#10 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1587 2010/06/18 18:51:09 kib Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1588 2010/07/28 15:36:12 mdf Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -385,6 +385,20 @@
 options		NO_SYSCTL_DESCR
 
 #
+# MALLOC_DEBUG_MAXZONES enables multiple uma zones for malloc(9)
+# allocations that are smaller than a page.  The purpose is to isolate
+# different malloc types into hash classes, so that any buffer
+# overruns or use-after-free will usually only affect memory from
+# malloc types in that hash class.  This is purely a debugging tool;
+# by varying the hash function and tracking which hash class was
+# corrupted, the intersection of the hash classes from each instance
+# will point to a single malloc type that is being misused.  At this
+# point inspection or memguard(9) can be used to catch the offending
+# code.
+#
+options 	MALLOC_DEBUG_MAXZONES=8
+
+#
 # DEBUG_MEMGUARD builds and enables memguard(9), a replacement allocator
 # for the kernel used to detect modify-after-free scenarios.  See the
 # memguard(9) man page for more information on usage.

==== //depot/projects/soc2009/anchie_send/src/sys/conf/files.powerpc#7 (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.powerpc,v 1.113 2010/07/13 05:32:19 nwhitehorn Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.114 2010/07/31 13:22:34 nwhitehorn Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -111,6 +111,11 @@
 powerpc/fpu/fpu_mul.c		optional	fpu_emu
 powerpc/fpu/fpu_sqrt.c		optional	fpu_emu
 powerpc/fpu/fpu_subr.c		optional	fpu_emu
+powerpc/mambo/mambocall.S	optional	mambo
+powerpc/mambo/mambo.c		optional	mambo
+powerpc/mambo/mambo_console.c	optional	mambo
+powerpc/mambo/mambo_disk.c	optional	mambo
+powerpc/mambo/mambo_openpic.c	optional	mambo
 powerpc/mpc85xx/atpic.c		optional	mpc85xx isa
 powerpc/mpc85xx/ds1553_bus_fdt.c	optional	ds1553 fdt
 powerpc/mpc85xx/ds1553_core.c	optional	ds1553

==== //depot/projects/soc2009/anchie_send/src/sys/conf/files.sparc64#8 (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.sparc64,v 1.115 2010/05/20 12:46:19 marius Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.116 2010/07/29 12:08:46 mav Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -59,6 +59,7 @@
 dev/syscons/scvtb.c		optional	sc
 dev/uart/uart_cpu_sparc64.c	optional	uart
 dev/uart/uart_kbd_sun.c		optional	uart sc
+kern/kern_clocksource.c		standard
 kern/syscalls.c			optional	ktr
 libkern/ffs.c			standard
 libkern/ffsl.c			standard

==== //depot/projects/soc2009/anchie_send/src/sys/conf/files.sun4v#4 (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.sun4v,v 1.21 2010/04/24 16:27:43 marius Exp $
+# $FreeBSD: src/sys/conf/files.sun4v,v 1.22 2010/07/29 12:08:46 mav Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -29,6 +29,7 @@
 dev/ofw/openfirmio.c		standard
 dev/ofw/openpromio.c		standard
 dev/uart/uart_cpu_sparc64.c	optional	uart
+kern/kern_clocksource.c		standard
 kern/syscalls.c			optional	ktr
 libkern/ffs.c			standard
 libkern/ffsl.c			standard

==== //depot/projects/soc2009/anchie_send/src/sys/conf/options#11 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.705 2010/06/09 12:25:57 ae Exp $
+# $FreeBSD: src/sys/conf/options,v 1.706 2010/07/28 15:36:12 mdf Exp $
 #
 #        On the handling of kernel options
 #
@@ -586,6 +586,7 @@
 NO_SWAPPING		opt_vm.h
 MALLOC_MAKE_FAILURES	opt_vm.h
 MALLOC_PROFILE		opt_vm.h
+MALLOC_DEBUG_MAXZONES	opt_vm.h
 
 # The MemGuard replacement allocator used for tamper-after-free detection
 DEBUG_MEMGUARD		opt_vm.h

==== //depot/projects/soc2009/anchie_send/src/sys/conf/options.powerpc#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options.powerpc,v 1.14 2010/07/13 05:32:19 nwhitehorn Exp $
+# $FreeBSD: src/sys/conf/options.powerpc,v 1.15 2010/07/31 13:22:34 nwhitehorn Exp $
 # Options specific to the powerpc platform kernels
 
 AIM			opt_global.h
@@ -17,6 +17,7 @@
 
 MPC85XX			opt_platform.h
 POWERMAC		opt_platform.h
+MAMBO
 PSIM
 
 SC_OFWFB		opt_ofwfb.h

==== //depot/projects/soc2009/anchie_send/src/sys/dev/amr/amrvar.h#2 (text+ko) ====

@@ -53,7 +53,7 @@
  * SUCH DAMAGE.
  *
  *
- *      $FreeBSD: src/sys/dev/amr/amrvar.h,v 1.36 2008/11/03 00:53:54 scottl Exp $
+ *      $FreeBSD: src/sys/dev/amr/amrvar.h,v 1.37 2010/07/28 16:24:11 mdf Exp $
  */
 
 #include <geom/geom_disk.h>
@@ -66,8 +66,8 @@
 # define debug(level, fmt, args...)	do {if (level <= AMR_DEBUG) printf("%s: " fmt "\n", __func__ , ##args);} while(0)
 # define debug_called(level)		do {if (level <= AMR_DEBUG) printf("%s: called\n", __func__);} while(0)
 #else
-# define debug(level, fmt, args...)
-# define debug_called(level)
+# define debug(level, fmt, args...)	do {} while (0)
+# define debug_called(level)		do {} while (0)
 #endif
 #define xdebug(fmt, args...)	printf("%s: " fmt "\n", __func__ , ##args)
 

==== //depot/projects/soc2009/anchie_send/src/sys/dev/coretemp/coretemp.c#3 (text+ko) ====

@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/coretemp/coretemp.c,v 1.10 2009/09/06 12:01:29 nork Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/coretemp/coretemp.c,v 1.11 2010/07/29 19:08:22 delphij Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -133,15 +133,13 @@
 	struct coretemp_softc *sc = device_get_softc(dev);
 	device_t pdev;
 	uint64_t msr;
-	int cpu_model;
-	int cpu_mask;
+	int cpu_model, cpu_stepping;
+	int ret, tjtarget;
 
 	sc->sc_dev = dev;
 	pdev = device_get_parent(dev);
-	cpu_model = (cpu_id >> 4) & 15;
-	/* extended model */
-	cpu_model += ((cpu_id >> 16) & 0xf) << 4;
-	cpu_mask = cpu_id & 15;
+	cpu_model = CPUID_TO_MODEL(cpu_id);
+	cpu_stepping = cpu_id & CPUID_STEPPING;
 
 	/*
 	 * Some CPUs, namely the PIII, don't have thermal sensors, but
@@ -164,7 +162,7 @@
 	 *
 	 * Adapted from the Linux coretemp driver.
 	 */
-	if (cpu_model == 0xe && cpu_mask < 0xc) {
+	if (cpu_model == 0xe && cpu_stepping < 0xc) {
 		msr = rdmsr(MSR_BIOS_SIGN);
 		msr = msr >> 32;
 		if (msr < 0x39) {
@@ -174,20 +172,56 @@
 		}
 	}
 #endif
+
 	/*
-	 * On some Core 2 CPUs, there's an undocumented MSR that
-	 * can tell us if Tj(max) is 100 or 85.
+	 * Use 100C as the initial value.
+	 */
+	sc->sc_tjmax = 100;
+
+	/*
+	 * Attempt to get Tj(max) from MSR IA32_TEMPERATURE_TARGET.
 	 *
-	 * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted
-	 * from the Linux coretemp driver.
+	 * This method is described in Intel white paper
+	 * "CPU Monitoring With DTS/PECI". (#322683)
 	 */
-	sc->sc_tjmax = 100;
-	if ((cpu_model == 0xf && cpu_mask >= 2) || cpu_model == 0xe) {
+	ret = rdmsr_safe(MSR_IA32_TEMPERATURE_TARGET, &msr);
+	if (ret == 0) {
+		tjtarget = (msr >> 16) & 0xff;
+		/*
+		 * On earlier generation of processors, the value obtained
+		 * from IA32_TEMPERATURE_TARGET register is an offset that
+		 * needs to be summed with a model specific base.  It is
+		 * however not clear what these numbers are, with the
+		 * publicly available documents from Intel.
+		 *
+		 * For now, we consider [70, 100]C range, as described in
+		 * #322683, as "reasonable" and accept these values
+		 * whenever the MSR is available for read, regardless the
+		 * CPU model.
+		 */
+		if (tjtarget >= 70 && tjtarget <= 100)
+			sc->sc_tjmax = tjtarget;
+		else
+			device_printf(dev, "Tj(target) value %d does "
+				    "not seem right.\n", tjtarget);
+	}
+
+	if ((cpu_model == 0xf && cpu_stepping >= 2) || cpu_model == 0xe) {
+		/*
+		 * On some Core 2 CPUs, there's an undocumented MSR that
+		 * can tell us if Tj(max) is 100 or 85.
+		 *
+		 * The if-clause for CPUs having the MSR_IA32_EXT_CONFIG was adapted
+		 * from the Linux coretemp driver.
+		 */
 		msr = rdmsr(MSR_IA32_EXT_CONFIG);
 		if (msr & (1 << 30))
 			sc->sc_tjmax = 85;
 	}
 
+	if (bootverbose)
+		device_printf(dev, "Setting TjMax=%d\n", sc->sc_tjmax);
+
 	/*
 	 * Add the "temperature" MIB to dev.cpu.N.
 	 */

==== //depot/projects/soc2009/anchie_send/src/sys/dev/e1000/e1000_osdep.h#3 (text+ko) ====

@@ -30,7 +30,7 @@
   POSSIBILITY OF SUCH DAMAGE.
 
 ******************************************************************************/
-/*$FreeBSD: src/sys/dev/e1000/e1000_osdep.h,v 1.6 2010/01/27 18:00:24 jfv Exp $*/
+/*$FreeBSD: src/sys/dev/e1000/e1000_osdep.h,v 1.7 2010/07/28 16:24:06 mdf Exp $*/
 
 
 #ifndef _FREEBSD_OS_H_
@@ -65,11 +65,11 @@
 
 #define MSGOUT(S, A, B)     printf(S "\n", A, B)
 #define DEBUGFUNC(F)        DEBUGOUT(F);
-	#define DEBUGOUT(S)
-	#define DEBUGOUT1(S,A)
-	#define DEBUGOUT2(S,A,B)
-	#define DEBUGOUT3(S,A,B,C)
-	#define DEBUGOUT7(S,A,B,C,D,E,F,G)
+#define DEBUGOUT(S)			do {} while (0)
+#define DEBUGOUT1(S,A)			do {} while (0)
+#define DEBUGOUT2(S,A,B)		do {} while (0)
+#define DEBUGOUT3(S,A,B,C)		do {} while (0)
+#define DEBUGOUT7(S,A,B,C,D,E,F,G)	do {} while (0)
 
 #define STATIC			static
 #define FALSE			0

==== //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_et.c#4 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2007 Sepherosa Ziehau.  All rights reserved.
  *
  * This code is derived from software contributed to The DragonFly Project
  * by Sepherosa Ziehau <sepherosa at gmail.com>
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/et/if_et.c,v 1.17 2009/11/20 20:43:16 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/et/if_et.c,v 1.18 2010/07/30 17:51:22 delphij Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

==== //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_etreg.h#3 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2007 Sepherosa Ziehau.  All rights reserved.
  *
  * This code is derived from software contributed to The DragonFly Project
  * by Sepherosa Ziehau <sepherosa at gmail.com>
@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  * $DragonFly: src/sys/dev/netif/et/if_etreg.h,v 1.3 2007/10/23 14:28:42 sephe Exp $
- * $FreeBSD: src/sys/dev/et/if_etreg.h,v 1.3 2009/11/19 21:46:58 yongari Exp $
+ * $FreeBSD: src/sys/dev/et/if_etreg.h,v 1.4 2010/07/30 17:51:22 delphij Exp $
  */
 /*-
  * Portions of this code is derived from NetBSD which is covered by

==== //depot/projects/soc2009/anchie_send/src/sys/dev/et/if_etvar.h#3 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
+ * Copyright (c) 2007 Sepherosa Ziehau.  All rights reserved.
  *
  * This code is derived from software contributed to The DragonFly Project
  * by Sepherosa Ziehau <sepherosa at gmail.com>
@@ -32,7 +32,7 @@
  * SUCH DAMAGE.
  *
  * $DragonFly: src/sys/dev/netif/et/if_etvar.h,v 1.4 2007/10/23 14:28:42 sephe Exp $
- * $FreeBSD: src/sys/dev/et/if_etvar.h,v 1.7 2009/11/20 20:33:59 yongari Exp $
+ * $FreeBSD: src/sys/dev/et/if_etvar.h,v 1.8 2010/07/30 17:51:22 delphij Exp $
  */
 
 #ifndef _IF_ETVAR_H

==== //depot/projects/soc2009/anchie_send/src/sys/dev/hwpmc/hwpmc_core.c#7 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_core.c,v 1.11 2010/07/13 19:37:45 gnn Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_core.c,v 1.12 2010/07/29 17:52:23 gnn Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -168,13 +168,13 @@
 	core_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAP].pcd_ri;
 
 	for (n = 0; n < npmc; n++) {
-		msr = rdmsr(IAP_EVSEL0 + n);
-		wrmsr(IAP_EVSEL0 + n, msr & ~IAP_EVSEL_MASK);
+		msr = rdmsr(IAP_EVSEL0 + n) & ~IAP_EVSEL_MASK;
+		wrmsr(IAP_EVSEL0 + n, msr);
 	}
 
 	if (core_cputype != PMC_CPU_INTEL_CORE) {
-		msr = rdmsr(IAF_CTRL);
-		wrmsr(IAF_CTRL, msr & ~IAF_CTRL_MASK);
+		msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK;
+		wrmsr(IAF_CTRL, msr);
 		npmc += md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAF].pcd_num;
 	}
 
@@ -392,13 +392,13 @@
 
 	iafc->pc_iafctrl |= pm->pm_md.pm_iaf.pm_iaf_ctrl;
 
- 	msr = rdmsr(IAF_CTRL);
+ 	msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK;
  	wrmsr(IAF_CTRL, msr | (iafc->pc_iafctrl & IAF_CTRL_MASK));
 
 	do {
 		iafc->pc_resync = 0;
 		iafc->pc_globalctrl |= (1ULL << (ri + IAF_OFFSET));
- 		msr = rdmsr(IA_GLOBAL_CTRL);
+ 		msr = rdmsr(IA_GLOBAL_CTRL) & ~IAF_GLOBAL_CTRL_MASK;
  		wrmsr(IA_GLOBAL_CTRL, msr | (iafc->pc_globalctrl & 
  					     IAF_GLOBAL_CTRL_MASK));
 	} while (iafc->pc_resync != 0);
@@ -434,13 +434,13 @@
 	iafc->pc_iafctrl &= ~fc;
 
 	PMCDBG(MDP,STO,1,"iaf-stop iafctrl=%x", iafc->pc_iafctrl);
- 	msr = rdmsr(IAF_CTRL);
+ 	msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK;
  	wrmsr(IAF_CTRL, msr | (iafc->pc_iafctrl & IAF_CTRL_MASK));
 
 	do {
 		iafc->pc_resync = 0;
 		iafc->pc_globalctrl &= ~(1ULL << (ri + IAF_OFFSET));
- 		msr = rdmsr(IA_GLOBAL_CTRL);
+ 		msr = rdmsr(IA_GLOBAL_CTRL) & ~IAF_GLOBAL_CTRL_MASK;
  		wrmsr(IA_GLOBAL_CTRL, msr | (iafc->pc_globalctrl &
  					     IAF_GLOBAL_CTRL_MASK));
 	} while (iafc->pc_resync != 0);
@@ -473,10 +473,14 @@
 	if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
 		v = iaf_reload_count_to_perfctr_value(v);
 
-	msr = rdmsr(IAF_CTRL);
-	wrmsr(IAF_CTRL, msr & ~IAF_CTRL_MASK);
+	/* Turn off fixed counters */
+	msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK;
+	wrmsr(IAF_CTRL, msr); 
+
 	wrmsr(IAF_CTR0 + ri, v & ((1ULL << core_iaf_width) - 1));
-	msr = rdmsr(IAF_CTRL);
+
+	/* Turn on fixed counters */
+	msr = rdmsr(IAF_CTRL) & ~IAF_CTRL_MASK;
 	wrmsr(IAF_CTRL, msr | (cc->pc_iafctrl & IAF_CTRL_MASK));
 
 	PMCDBG(MDP,WRI,1, "iaf-write cpu=%d ri=%d msr=0x%x v=%jx iafctrl=%jx "
@@ -1910,15 +1914,17 @@
 
 	PMCDBG(MDP,STO,1, "iap-stop cpu=%d ri=%d", cpu, ri);
 
-	msr = rdmsr(IAP_EVSEL0 + ri);
-	wrmsr(IAP_EVSEL0 + ri, msr & IAP_EVSEL_MASK);	/* stop hw */
+	msr = rdmsr(IAP_EVSEL0 + ri) & ~IAP_EVSEL_MASK;
+	wrmsr(IAP_EVSEL0 + ri, msr);	/* stop hw */
 
 	if (core_cputype == PMC_CPU_INTEL_CORE)
 		return (0);
 
+	msr = 0;
 	do {
 		cc->pc_resync = 0;
 		cc->pc_globalctrl &= ~(1ULL << ri);
+		msr = rdmsr(IA_GLOBAL_CTRL) & ~IA_GLOBAL_CTRL_MASK;
 		wrmsr(IA_GLOBAL_CTRL, cc->pc_globalctrl);
 	} while (cc->pc_resync != 0);
 
@@ -2004,7 +2010,7 @@
 	struct pmc *pm;
 	struct core_cpu *cc;
 	int error, found_interrupt, ri;
-	uint64_t msr = 0;
+	uint64_t msr;
 
 	PMCDBG(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf,
 	    TRAPF_USERMODE(tf));
@@ -2036,15 +2042,15 @@
 		 * Stop the counter, reload it but only restart it if
 		 * the PMC is not stalled.
 		 */
-		msr = rdmsr(IAP_EVSEL0 + ri);
-		wrmsr(IAP_EVSEL0 + ri, msr & ~IAP_EVSEL_MASK);
+		msr = rdmsr(IAP_EVSEL0 + ri) & ~IAP_EVSEL_MASK;
+		wrmsr(IAP_EVSEL0 + ri, msr);
 		wrmsr(IAP_PMC0 + ri, v);
 
 		if (error)
 			continue;
 
-		wrmsr(IAP_EVSEL0 + ri,
-		    pm->pm_md.pm_iap.pm_iap_evsel | IAP_EN);
+		wrmsr(IAP_EVSEL0 + ri, msr | (pm->pm_md.pm_iap.pm_iap_evsel | 
+					      IAP_EN));
 	}
 
 	if (found_interrupt)
@@ -2060,7 +2066,7 @@
 core2_intr(int cpu, struct trapframe *tf)
 {
 	int error, found_interrupt, n;
-	uint64_t flag, intrstatus, intrenable;
+	uint64_t flag, intrstatus, intrenable, msr;
 	struct pmc *pm;
 	struct core_cpu *cc;
 	pmc_value_t v;
@@ -2091,7 +2097,8 @@
 	/*
 	 * Stop PMCs and clear overflow status bits.
 	 */
-	wrmsr(IA_GLOBAL_CTRL, 0);
+	msr = rdmsr(IA_GLOBAL_CTRL) & ~IA_GLOBAL_CTRL_MASK;
+	wrmsr(IA_GLOBAL_CTRL, msr);
 	wrmsr(IA_GLOBAL_OVF_CTRL, intrenable |
 	    IA_GLOBAL_STATUS_FLAG_OVFBUF |
 	    IA_GLOBAL_STATUS_FLAG_CONDCHG);
@@ -2162,7 +2169,7 @@
 
 	cc->pc_globalctrl |= intrenable;
 
-	wrmsr(IA_GLOBAL_CTRL, cc->pc_globalctrl);
+	wrmsr(IA_GLOBAL_CTRL, cc->pc_globalctrl & IA_GLOBAL_CTRL_MASK);
 
 	PMCDBG(MDP,INT, 1, "cpu=%d fixedctrl=%jx globalctrl=%jx status=%jx "
 	    "ovf=%jx", cpu, (uintmax_t) rdmsr(IAF_CTRL),

==== //depot/projects/soc2009/anchie_send/src/sys/dev/hwpmc/hwpmc_core.h#4 (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/dev/hwpmc/hwpmc_core.h,v 1.3 2010/07/13 19:37:45 gnn Exp $
+ * $FreeBSD: src/sys/dev/hwpmc/hwpmc_core.h,v 1.4 2010/07/29 17:52:23 gnn Exp $
  */
 
 #ifndef _DEV_HWPMC_CORE_H_
@@ -144,6 +144,12 @@
 /* The mask is only for the fixed porttion of the register. */
 #define	IAF_GLOBAL_CTRL_MASK			0x0000000700000000
 
+/* The mask is only for the programmable porttion of the register. */
+#define IAP_GLOBAL_CTRL_MASK			0x00000000ffffffff
+
+/* The mask is for both the fixed and programmable porttions of the register. */
+#define IA_GLOBAL_CTRL_MASK			0x00000007ffffffff
+
 #define	IA_GLOBAL_OVF_CTRL			0x390
 
 #define	IA_GLOBAL_STATUS_FLAG_CONDCHG		(1ULL << 63)

==== //depot/projects/soc2009/anchie_send/src/sys/dev/ipmi/ipmi_smbios.c#3 (text) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_smbios.c,v 1.6 2010/07/14 18:06:21 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ipmi/ipmi_smbios.c,v 1.7 2010/07/29 13:46:37 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -189,7 +189,7 @@
 		 * formatted area of this structure.
 		 */
 		p += s->length;
-		while (p[0] != 0 && p[1] != 0)
+		while (!(p[0] == 0 && p[1] == 0))
 			p++;
 
 		/*

==== //depot/projects/soc2009/anchie_send/src/sys/dev/pci/pci.c#7 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.399 2010/06/14 07:10:37 mav Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.400 2010/07/29 20:42:38 yongari Exp $");
 
 #include "opt_bus.h"
 
@@ -450,12 +450,12 @@
 static void
 pci_fixancient(pcicfgregs *cfg)
 {
-	if (cfg->hdrtype != 0)
+	if ((cfg->hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL)
 		return;
 
 	/* PCI to PCI bridges use header type 1 */
 	if (cfg->baseclass == PCIC_BRIDGE && cfg->subclass == PCIS_BRIDGE_PCI)
-		cfg->hdrtype = 1;
+		cfg->hdrtype = PCIM_HDRTYPE_BRIDGE;
 }
 
 /* extract header type specific config data */
@@ -464,16 +464,16 @@
 pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg)
 {
 #define	REG(n, w)	PCIB_READ_CONFIG(pcib, b, s, f, n, w)
-	switch (cfg->hdrtype) {
-	case 0:
+	switch (cfg->hdrtype & PCIM_HDRTYPE) {
+	case PCIM_HDRTYPE_NORMAL:
 		cfg->subvendor      = REG(PCIR_SUBVEND_0, 2);
 		cfg->subdevice      = REG(PCIR_SUBDEV_0, 2);
 		cfg->nummaps	    = PCI_MAXMAPS_0;
 		break;
-	case 1:
+	case PCIM_HDRTYPE_BRIDGE:
 		cfg->nummaps	    = PCI_MAXMAPS_1;
 		break;
-	case 2:
+	case PCIM_HDRTYPE_CARDBUS:
 		cfg->subvendor      = REG(PCIR_SUBVEND_2, 2);
 		cfg->subdevice      = REG(PCIR_SUBDEV_2, 2);
 		cfg->nummaps	    = PCI_MAXMAPS_2;
@@ -569,11 +569,11 @@
 	int	ptr, nextptr, ptrptr;
 
 	switch (cfg->hdrtype & PCIM_HDRTYPE) {
-	case 0:
-	case 1:
+	case PCIM_HDRTYPE_NORMAL:
+	case PCIM_HDRTYPE_BRIDGE:
 		ptrptr = PCIR_CAP_PTR;
 		break;
-	case 2:
+	case PCIM_HDRTYPE_CARDBUS:
 		ptrptr = PCIR_CAP_PTR_2;	/* cardbus capabilities ptr */
 		break;
 	default:
@@ -660,7 +660,8 @@
 			break;
 		case PCIY_SUBVENDOR:
 			/* Should always be true. */
-			if ((cfg->hdrtype & PCIM_HDRTYPE) == 1) {
+			if ((cfg->hdrtype & PCIM_HDRTYPE) ==
+			    PCIM_HDRTYPE_BRIDGE) {
 				val = REG(ptr + PCIR_SUBVENDCAP_ID, 4);
 				cfg->subvendor = val & 0xffff;
 				cfg->subdevice = val >> 16;
@@ -674,7 +675,8 @@
 			 * PCI-express or HT chipsets might match on
 			 * this check as well.
 			 */
-			if ((cfg->hdrtype & PCIM_HDRTYPE) == 1)
+			if ((cfg->hdrtype & PCIM_HDRTYPE) ==
+			    PCIM_HDRTYPE_BRIDGE)
 				pcix_chipset = 1;
 			break;
 		case PCIY_EXPRESS:	/* PCI-express */
@@ -1117,11 +1119,11 @@
 	 * Determine the start pointer of the capabilities list.
 	 */
 	switch (cfg->hdrtype & PCIM_HDRTYPE) {
-	case 0:
-	case 1:
+	case PCIM_HDRTYPE_NORMAL:
+	case PCIM_HDRTYPE_BRIDGE:
 		ptr = PCIR_CAP_PTR;
 		break;
-	case 2:
+	case PCIM_HDRTYPE_CARDBUS:
 		ptr = PCIR_CAP_PTR_2;
 		break;
 	default:
@@ -2947,7 +2949,9 @@
 	for (i = 0; acpi_dev && i < numdevs; i++) {
 		child = devlist[i];
 		dinfo = (struct pci_devinfo *) device_get_ivars(child);
-		if (device_is_attached(child) && dinfo->cfg.hdrtype == 0) {
+		if (device_is_attached(child) &&
+		    (dinfo->cfg.hdrtype & PCIM_HDRTYPE) ==
+		    PCIM_HDRTYPE_NORMAL) {
 			dstate = PCI_POWERSTATE_D3;
 			ACPI_PWR_FOR_SLEEP(acpi_dev, child, &dstate);
 			pci_set_powerstate(child, dstate);
@@ -2981,7 +2985,8 @@
 		child = devlist[i];
 		dinfo = (struct pci_devinfo *) device_get_ivars(child);
 		if (acpi_dev && device_is_attached(child) &&
-		    dinfo->cfg.hdrtype == 0) {
+		    (dinfo->cfg.hdrtype & PCIM_HDRTYPE) ==
+		    PCIM_HDRTYPE_NORMAL) {
 			ACPI_PWR_FOR_SLEEP(acpi_dev, child, NULL);
 			pci_set_powerstate(child, PCI_POWERSTATE_D0);
 		}
@@ -4014,7 +4019,7 @@
 	 * Other types are unknown, and we err on the side of safety
 	 * by ignoring them.
 	 */
-	if (dinfo->cfg.hdrtype != 0)
+	if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL)
 		return;
 
 	/*
@@ -4062,7 +4067,7 @@
 	 * we err on the side of safety by ignoring them.  Powering down
 	 * bridges should not be undertaken lightly.
 	 */
-	if (dinfo->cfg.hdrtype != 0)
+	if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL)
 		return;
 	for (i = 0; i < dinfo->cfg.nummaps; i++)
 		dinfo->cfg.bar[i] = pci_read_config(dev, PCIR_BAR(i), 4);

==== //depot/projects/soc2009/anchie_send/src/sys/dev/pci/pci_user.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.28 2009/09/11 18:48:49 avg Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci_user.c,v 1.29 2010/07/29 06:27:41 neel Exp $");
 
 #include "opt_bus.h"	/* XXX trim includes */
 #include "opt_compat.h"
@@ -735,6 +735,16 @@
 			bio->pbi_enabled = (value & PCIM_CMD_PORTEN) != 0;
 		error = 0;
 		break;
+	case PCIOCATTACHED:
+		error = 0;
+		io = (struct pci_io *)data;
+		pcidev = pci_find_dbsf(io->pi_sel.pc_domain, io->pi_sel.pc_bus,
+				       io->pi_sel.pc_dev, io->pi_sel.pc_func);
+		if (pcidev != NULL)
+			io->pi_data = device_is_attached(pcidev);
+		else
+			error = ENODEV;
+		break;
 	default:
 		error = ENOTTY;
 		break;

==== //depot/projects/soc2009/anchie_send/src/sys/dev/usb/quirk/usb_quirk.c#9 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/usb/quirk/usb_quirk.c,v 1.21 2010/07/27 17:07:16 gavin Exp $ */
+/* $FreeBSD: src/sys/dev/usb/quirk/usb_quirk.c,v 1.22 2010/07/28 18:56:01 tijl Exp $ */
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved.

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


More information about the p4-projects mailing list