Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2008 21:07:48 GMT
From:      Marius Strobl <marius@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 148286 for review
Message-ID:  <200808242107.m7OL7mfQ067504@repoman.freebsd.org>

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

Change 148286 by marius@flak on 2008/08/24 21:07:02

	IFC @148283

Affected files ...

.. //depot/projects/usiii/amd64/amd64/local_apic.c#6 integrate
.. //depot/projects/usiii/arm/include/endian.h#3 integrate
.. //depot/projects/usiii/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h#3 integrate
.. //depot/projects/usiii/conf/files#15 integrate
.. //depot/projects/usiii/conf/files.i386#9 integrate
.. //depot/projects/usiii/conf/files.sparc64#8 integrate
.. //depot/projects/usiii/conf/options#14 integrate
.. //depot/projects/usiii/dev/acpica/acpi.c#9 integrate
.. //depot/projects/usiii/dev/agp/agp.c#2 integrate
.. //depot/projects/usiii/dev/dc/if_dc.c#5 integrate
.. //depot/projects/usiii/dev/drm/ati_pcigart.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm-subprocess.pl#2 integrate
.. //depot/projects/usiii/dev/drm/drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/drmP.h#3 integrate
.. //depot/projects/usiii/dev/drm/drm_agpsupport.c#3 integrate
.. //depot/projects/usiii/dev/drm/drm_auth.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_bufs.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_context.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_dma.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_drawable.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_drv.c#3 integrate
.. //depot/projects/usiii/dev/drm/drm_fops.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_internal.h#1 branch
.. //depot/projects/usiii/dev/drm/drm_ioctl.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_lock.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_memory.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_pci.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_pciids.h#4 integrate
.. //depot/projects/usiii/dev/drm/drm_sarea.h#2 integrate
.. //depot/projects/usiii/dev/drm/drm_scatter.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_sysctl.c#2 integrate
.. //depot/projects/usiii/dev/drm/drm_vm.c#2 integrate
.. //depot/projects/usiii/dev/drm/i915_dma.c#3 integrate
.. //depot/projects/usiii/dev/drm/i915_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/i915_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/i915_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/i915_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/i915_mem.c#2 integrate
.. //depot/projects/usiii/dev/drm/i915_suspend.c#1 branch
.. //depot/projects/usiii/dev/drm/mach64_dma.c#2 integrate
.. //depot/projects/usiii/dev/drm/mach64_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/mach64_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/mach64_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/mach64_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/mach64_state.c#2 integrate
.. //depot/projects/usiii/dev/drm/mga_dma.c#2 integrate
.. //depot/projects/usiii/dev/drm/mga_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/mga_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/mga_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/mga_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/mga_state.c#2 integrate
.. //depot/projects/usiii/dev/drm/mga_warp.c#2 integrate
.. //depot/projects/usiii/dev/drm/r128_cce.c#2 integrate
.. //depot/projects/usiii/dev/drm/r128_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/r128_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/r128_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/r128_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/r128_state.c#2 integrate
.. //depot/projects/usiii/dev/drm/r300_cmdbuf.c#2 integrate
.. //depot/projects/usiii/dev/drm/r300_reg.h#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_cp.c#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_irq.c#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_mem.c#2 integrate
.. //depot/projects/usiii/dev/drm/radeon_microcode.h#1 branch
.. //depot/projects/usiii/dev/drm/radeon_state.c#2 integrate
.. //depot/projects/usiii/dev/drm/savage_bci.c#2 integrate
.. //depot/projects/usiii/dev/drm/savage_drm.h#2 integrate
.. //depot/projects/usiii/dev/drm/savage_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/savage_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/savage_state.c#2 integrate
.. //depot/projects/usiii/dev/drm/sis_drv.c#2 integrate
.. //depot/projects/usiii/dev/drm/sis_drv.h#2 integrate
.. //depot/projects/usiii/dev/drm/sis_mm.c#2 integrate
.. //depot/projects/usiii/dev/drm/tdfx_drv.c#2 integrate
.. //depot/projects/usiii/dev/ex/if_ex.c#3 integrate
.. //depot/projects/usiii/dev/ex/if_ex_isa.c#3 integrate
.. //depot/projects/usiii/dev/ex/if_exvar.h#3 integrate
.. //depot/projects/usiii/dev/gem/if_gem.c#9 integrate
.. //depot/projects/usiii/dev/iicbus/iiconf.c#3 integrate
.. //depot/projects/usiii/dev/lmc/if_lmc.c#3 integrate
.. //depot/projects/usiii/dev/mfi/mfi.c#6 integrate
.. //depot/projects/usiii/dev/mii/mii.c#2 integrate
.. //depot/projects/usiii/dev/mii/mlphy.c#2 integrate
.. //depot/projects/usiii/dev/mii/tlphy.c#2 integrate
.. //depot/projects/usiii/dev/pci/pci.c#7 integrate
.. //depot/projects/usiii/dev/sis/if_sis.c#2 integrate
.. //depot/projects/usiii/dev/sound/pci/csa.c#2 integrate
.. //depot/projects/usiii/dev/sound/usb/uaudio.c#2 integrate
.. //depot/projects/usiii/dev/syscons/syscons.c#7 integrate
.. //depot/projects/usiii/dev/syscons/sysmouse.c#4 integrate
.. //depot/projects/usiii/dev/usb/uvisor.c#2 integrate
.. //depot/projects/usiii/dev/xen/blkfront/blkfront.c#3 integrate
.. //depot/projects/usiii/i386/conf/NOTES#8 integrate
.. //depot/projects/usiii/i386/cpufreq/est.c#8 integrate
.. //depot/projects/usiii/i386/i386/local_apic.c#5 integrate
.. //depot/projects/usiii/i386/isa/dpms.c#1 branch
.. //depot/projects/usiii/isa/isa_common.c#2 integrate
.. //depot/projects/usiii/isa/isavar.h#2 integrate
.. //depot/projects/usiii/kern/kern_exec.c#9 integrate
.. //depot/projects/usiii/kern/kern_intr.c#6 integrate
.. //depot/projects/usiii/kern/tty.c#7 integrate
.. //depot/projects/usiii/kern/tty_outq.c#2 integrate
.. //depot/projects/usiii/kern/tty_pty.c#7 integrate
.. //depot/projects/usiii/kern/vfs_cache.c#9 integrate
.. //depot/projects/usiii/kern/vfs_mount.c#11 integrate
.. //depot/projects/usiii/kern/vfs_subr.c#12 integrate
.. //depot/projects/usiii/mips/mips/mp_machdep.c#2 integrate
.. //depot/projects/usiii/modules/Makefile#13 integrate
.. //depot/projects/usiii/modules/dpms/Makefile#1 branch
.. //depot/projects/usiii/modules/drm/i915/Makefile#2 integrate
.. //depot/projects/usiii/net/if.c#9 integrate
.. //depot/projects/usiii/net/if_spppsubr.c#3 integrate
.. //depot/projects/usiii/netinet/sctp_output.c#8 integrate
.. //depot/projects/usiii/netinet/tcp_lro.c#2 integrate
.. //depot/projects/usiii/netinet/tcp_syncache.c#8 integrate
.. //depot/projects/usiii/security/audit/audit_bsm_klib.c#8 integrate
.. //depot/projects/usiii/security/audit/audit_syscalls.c#7 integrate
.. //depot/projects/usiii/security/mac/mac_framework.c#2 integrate
.. //depot/projects/usiii/security/mac/mac_framework.h#7 integrate
.. //depot/projects/usiii/security/mac/mac_inet.c#5 integrate
.. //depot/projects/usiii/security/mac/mac_internal.h#4 integrate
.. //depot/projects/usiii/security/mac/mac_net.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_pipe.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_policy.h#7 integrate
.. //depot/projects/usiii/security/mac/mac_posix_sem.c#5 integrate
.. //depot/projects/usiii/security/mac/mac_posix_shm.c#2 integrate
.. //depot/projects/usiii/security/mac/mac_process.c#4 integrate
.. //depot/projects/usiii/security/mac/mac_socket.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_syscalls.c#5 integrate
.. //depot/projects/usiii/security/mac/mac_sysv_msg.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_sysv_sem.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_sysv_shm.c#3 integrate
.. //depot/projects/usiii/security/mac/mac_vfs.c#4 integrate
.. //depot/projects/usiii/security/mac_biba/mac_biba.c#5 integrate
.. //depot/projects/usiii/security/mac_bsdextended/mac_bsdextended.c#5 integrate
.. //depot/projects/usiii/security/mac_ifoff/mac_ifoff.c#3 integrate
.. //depot/projects/usiii/security/mac_lomac/mac_lomac.c#5 integrate
.. //depot/projects/usiii/security/mac_mls/mac_mls.c#6 integrate
.. //depot/projects/usiii/security/mac_none/mac_none.c#3 integrate
.. //depot/projects/usiii/security/mac_partition/mac_partition.c#4 integrate
.. //depot/projects/usiii/security/mac_portacl/mac_portacl.c#4 integrate
.. //depot/projects/usiii/security/mac_seeotheruids/mac_seeotheruids.c#3 integrate
.. //depot/projects/usiii/security/mac_stub/mac_stub.c#6 integrate
.. //depot/projects/usiii/security/mac_test/mac_test.c#6 integrate
.. //depot/projects/usiii/sparc64/central/central.c#2 integrate
.. //depot/projects/usiii/sparc64/conf/GENERIC#12 integrate
.. //depot/projects/usiii/sparc64/conf/NOTES#3 integrate
.. //depot/projects/usiii/sparc64/ebus/ebus.c#2 integrate
.. //depot/projects/usiii/sparc64/fhc/fhc.c#5 integrate
.. //depot/projects/usiii/sparc64/include/cpufunc.h#4 integrate
.. //depot/projects/usiii/sparc64/pci/ofw_pcibus.c#10 integrate
.. //depot/projects/usiii/sparc64/pci/psycho.c#13 integrate
.. //depot/projects/usiii/sparc64/sbus/dma_sbus.c#2 integrate
.. //depot/projects/usiii/sparc64/sbus/sbus.c#6 integrate
.. //depot/projects/usiii/sparc64/sparc64/trap.c#6 integrate
.. //depot/projects/usiii/sys/copyright.h#4 integrate
.. //depot/projects/usiii/ufs/ufs/ufs_vnops.c#5 integrate
.. //depot/projects/usiii/vm/uma_core.c#4 integrate

Differences ...

==== //depot/projects/usiii/amd64/amd64/local_apic.c#6 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.45 2008/05/24 06:32:26 jb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/local_apic.c,v 1.46 2008/08/23 12:35:43 jhb Exp $");
 
 #include "opt_hwpmc_hooks.h"
 #include "opt_kdtrace.h"
@@ -77,10 +77,6 @@
 CTASSERT(APIC_LOCAL_INTS == 240);
 CTASSERT(IPI_STOP < APIC_SPURIOUS_INT);
 
-#define	LAPIC_TIMER_HZ_DIVIDER		2
-#define	LAPIC_TIMER_STATHZ_DIVIDER	15
-#define	LAPIC_TIMER_PROFHZ_DIVIDER	3
-
 /* Magic IRQ values for the timer and syscalls. */
 #define	IRQ_TIMER	(NUM_IO_INTS + 1)
 #define	IRQ_SYSCALL	(NUM_IO_INTS + 2)
@@ -389,13 +385,24 @@
 		    lapic_timer_divisor, value);
 
 	/*
-	 * We will drive the timer at a small multiple of hz and drive
-	 * both of the other timers with similarly small but relatively
-	 * prime divisors.
+	 * We want to run stathz in the neighborhood of 128hz.  We would
+	 * like profhz to run as often as possible, so we let it run on
+	 * each clock tick.  We try to honor the requested 'hz' value as
+	 * much as possible.
+	 *
+	 * If 'hz' is above 1500, then we just let the lapic timer
+	 * (and profhz) run at hz.  If 'hz' is below 1500 but above
+	 * 750, then we let the lapic timer run at 2 * 'hz'.  If 'hz'
+	 * is below 750 then we let the lapic timer run at 4 * 'hz'.
 	 */
-	lapic_timer_hz = hz * LAPIC_TIMER_HZ_DIVIDER;
-	stathz = lapic_timer_hz / LAPIC_TIMER_STATHZ_DIVIDER;
-	profhz = lapic_timer_hz / LAPIC_TIMER_PROFHZ_DIVIDER;
+	if (hz >= 1500)
+		lapic_timer_hz = hz;
+	else if (hz >= 750)
+		lapic_timer_hz = hz * 2;
+	else
+		lapic_timer_hz = hz * 4;
+	stathz = lapic_timer_hz / (lapic_timer_hz / 128);
+	profhz = lapic_timer_hz;
 	lapic_timer_period = value / lapic_timer_hz;
 
 	/*

==== //depot/projects/usiii/arm/include/endian.h#3 (text+ko) ====

@@ -27,7 +27,7 @@
  *
  *	@(#)endian.h	8.1 (Berkeley) 6/10/93
  * $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $
- * $FreeBSD: src/sys/arm/include/endian.h,v 1.11 2007/09/09 11:58:38 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/endian.h,v 1.12 2008/08/23 23:35:08 imp Exp $
  */
 
 #ifndef _ENDIAN_H_
@@ -94,7 +94,7 @@
 			 : "+r" (v), "=r" (t1));
 	
 	return (v);
- }
+}
 
 static __inline __uint16_t
 __bswap16_var(__uint16_t v)

==== //depot/projects/usiii/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h#3 (text+ko) ====

@@ -382,6 +382,49 @@
 #define	_DONT_USE_1275_GENERIC_NAMES
 #define	_HAVE_CPUID_INSN
 
+#elif defined(__mips__)
+
+/*
+ * Define the appropriate "processor characteristics"
+ */
+#define	_STACK_GROWS_DOWNWARD
+#define	_LONG_LONG_LTOH
+#define	_BIT_FIELDS_LTOH
+#define	_IEEE_754
+#define	_CHAR_IS_SIGNED
+#define	_BOOL_ALIGNMENT			1
+#define	_CHAR_ALIGNMENT			1
+#define	_SHORT_ALIGNMENT		2
+#define	_INT_ALIGNMENT			4
+#define	_FLOAT_ALIGNMENT		4
+#define	_FLOAT_COMPLEX_ALIGNMENT	4
+#define	_LONG_ALIGNMENT			4
+#define	_LONG_LONG_ALIGNMENT		4
+#define	_DOUBLE_ALIGNMENT		4
+#define	_DOUBLE_COMPLEX_ALIGNMENT	4
+#define	_LONG_DOUBLE_ALIGNMENT		4
+#define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	4
+#define	_POINTER_ALIGNMENT		4
+#define	_MAX_ALIGNMENT			4
+#define	_ALIGNMENT_REQUIRED		0
+
+#define	_LONG_LONG_ALIGNMENT_32		_LONG_LONG_ALIGNMENT
+
+/*
+ * Define the appropriate "implementation choices".
+ */
+#define	_ILP32
+#if !defined(_I32LPx) && defined(_KERNEL)
+#define	_I32LPx
+#endif
+#define	_SUNOS_VTOC_16
+#define	_DMA_USES_PHYSADDR
+#define	_FIRMWARE_NEEDS_FDISK
+#define	_PSM_MODULES
+#define	_RTC_CONFIG
+#define	_DONT_USE_1275_GENERIC_NAMES
+#define	_HAVE_CPUID_INSN
+
 #elif defined(__powerpc__)
 
 /*

==== //depot/projects/usiii/conf/files#15 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1331 2008/08/20 08:31:58 ed Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1332 2008/08/23 20:59:12 rnoland Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -572,6 +572,7 @@
 dev/drm/i915_drv.c		optional i915drm
 dev/drm/i915_irq.c		optional i915drm
 dev/drm/i915_mem.c		optional i915drm
+dev/drm/i915_suspend.c		optional i915drm
 dev/drm/mach64_dma.c		optional mach64drm
 dev/drm/mach64_drv.c		optional mach64drm
 dev/drm/mach64_irq.c		optional mach64drm

==== //depot/projects/usiii/conf/files.i386#9 (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.604 2008/08/17 23:44:09 kmacy Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.605 2008/08/23 21:00:40 jhb Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -329,6 +329,7 @@
 #i386/isa/atpic_vector.s		standard
 i386/isa/clock.c		optional native
 i386/xen/clock.c		optional xen
+i386/isa/dpms.c			optional dpms
 i386/isa/elcr.c			standard
 i386/isa/elink.c		optional ep | ie
 i386/isa/isa.c			optional isa

==== //depot/projects/usiii/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.95 2008/04/26 11:01:37 marius Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.96 2008/08/23 14:28:44 marius Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -74,7 +74,7 @@
 libkern/flsl.c			standard
 sparc64/central/central.c	optional	central
 sparc64/ebus/ebus.c		optional	ebus
-sparc64/fhc/clkbrd.c		optional	clkbrd fhc
+sparc64/fhc/clkbrd.c		optional	fhc
 sparc64/fhc/fhc.c		optional	fhc
 sparc64/isa/isa.c		optional	isa
 sparc64/isa/isa_dma.c		optional	isa

==== //depot/projects/usiii/conf/options#14 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.636 2008/08/20 08:31:58 ed Exp $
+# $FreeBSD: src/sys/conf/options,v 1.637 2008/08/23 15:26:36 rwatson Exp $
 #
 #        On the handling of kernel options
 #
@@ -114,7 +114,6 @@
 KTRACE_REQUEST_POOL	opt_ktrace.h
 LIBICONV
 MAC
-MAC_ALWAYS_LABEL_MBUF	opt_mac.h
 MAC_BIBA	opt_dontuse.h
 MAC_BSDEXTENDED	opt_dontuse.h
 MAC_IFOFF	opt_dontuse.h

==== //depot/projects/usiii/dev/acpica/acpi.c#9 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.251 2008/08/22 02:14:23 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.252 2008/08/23 16:38:20 imp Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -665,7 +665,9 @@
      * device has an _SxD method for the next sleep state, use that power
      * state instead.
      */
-    device_get_children(dev, &devlist, &numdevs);
+    error = device_get_children(dev, &devlist, &numdevs);
+    if (error)
+	return (error);
     for (i = 0; i < numdevs; i++) {
 	/* If the device is not attached, we've powered it down elsewhere. */
 	child = devlist[i];
@@ -692,7 +694,7 @@
 acpi_resume(device_t dev)
 {
     ACPI_HANDLE handle;
-    int i, numdevs;
+    int i, numdevs, error;
     device_t child, *devlist;
 
     GIANT_REQUIRED;
@@ -701,7 +703,9 @@
      * Put all devices in D0 before resuming them.  Call _S0D on each one
      * since some systems expect this.
      */
-    device_get_children(dev, &devlist, &numdevs);
+    error = device_get_children(dev, &devlist, &numdevs);
+    if (error)
+	return (error);
     for (i = 0; i < numdevs; i++) {
 	child = devlist[i];
 	handle = acpi_get_handle(child);
@@ -801,7 +805,8 @@
     int i, numdevs;
 
     DEVICE_IDENTIFY(driver, dev);
-    device_get_children(dev, &devlist, &numdevs);
+    if (device_get_children(dev, &devlist, &numdevs))
+	    return;
     for (i = 0; i < numdevs; i++) {
 	child = devlist[i];
 	if (device_get_state(child) == DS_NOTPRESENT) {

==== //depot/projects/usiii/dev/agp/agp.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/agp/agp.c,v 1.58 2007/11/12 21:51:36 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/agp/agp.c,v 1.59 2008/08/23 15:57:43 imp Exp $");
 
 #include "opt_bus.h"
 
@@ -118,7 +118,8 @@
 		bus = devclass_get_device(pci, busnum);
 		if (!bus)
 			continue;
-		device_get_children(bus, &kids, &numkids);
+		if (device_get_children(bus, &kids, &numkids) != 0)
+			continue;
 		for (i = 0; i < numkids; i++) {
 			dev = kids[i];
 			if (pci_get_class(dev) == PCIC_DISPLAY

==== //depot/projects/usiii/dev/dc/if_dc.c#5 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/dc/if_dc.c,v 1.195 2008/06/08 02:52:26 yongari Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/dc/if_dc.c,v 1.196 2008/08/23 20:57:48 marius Exp $");
 
 /*
  * DEC "tulip" clone ethernet driver. Supports the DEC/Intel 21143
@@ -3138,7 +3138,7 @@
 	bus_dma_segment_t segs[DC_MAXFRAGS];
 	struct dc_desc *f;
 	struct mbuf *m;
-	int chainlen, cur, error, first, frag, i, idx, nseg;
+	int cur, defragged, error, first, frag, i, idx, nseg;
 
 	/*
 	 * If there's no way we can send any packets, return now.
@@ -3146,22 +3146,30 @@
 	if (DC_TX_LIST_CNT - sc->dc_cdata.dc_tx_cnt <= DC_TX_LIST_RSVD)
 		return (ENOBUFS);
 
-	/*
-	 * Count the number of frags in this chain to see if
-	 * we need to m_defrag.  Since the descriptor list is shared
-	 * by all packets, we'll m_defrag long chains so that they
-	 * do not use up the entire list, even if they would fit.
-	 */
-	chainlen = 0;
-	for (m = *m_head; m != NULL; m = m->m_next)
-		chainlen++;
-
 	m = NULL;
-	if ((sc->dc_flags & DC_TX_COALESCE && ((*m_head)->m_next != NULL ||
-	    sc->dc_flags & DC_TX_ALIGN)) || (chainlen > DC_TX_LIST_CNT / 4) ||
-	    (DC_TX_LIST_CNT - (chainlen + sc->dc_cdata.dc_tx_cnt) <=
-	    DC_TX_LIST_RSVD)) {
+	defragged = 0;
+	if (sc->dc_flags & DC_TX_COALESCE &&
+	    ((*m_head)->m_next != NULL || sc->dc_flags & DC_TX_ALIGN)) {
 		m = m_defrag(*m_head, M_DONTWAIT);
+		defragged = 1;
+	} else {
+		/*
+		 * Count the number of frags in this chain to see if we
+		 * need to m_collapse.  Since the descriptor list is shared
+		 * by all packets, we'll m_collapse long chains so that they
+		 * do not use up the entire list, even if they would fit.
+		 */
+		i = 0;
+		for (m = *m_head; m != NULL; m = m->m_next)
+			i++;
+		if (i > DC_TX_LIST_CNT / 4 ||
+		    DC_TX_LIST_CNT - i + sc->dc_cdata.dc_tx_cnt <=
+		    DC_TX_LIST_RSVD) {
+			m = m_collapse(*m_head, M_DONTWAIT, DC_MAXFRAGS);
+			defragged = 1;
+		}
+	}
+	if (defragged != 0) {
 		if (m == NULL) {
 			m_freem(*m_head);
 			*m_head = NULL;
@@ -3169,15 +3177,16 @@
 		}
 		*m_head = m;
 	}
+
 	idx = sc->dc_cdata.dc_tx_prod;
 	error = bus_dmamap_load_mbuf_sg(sc->dc_mtag,
 	    sc->dc_cdata.dc_tx_map[idx], *m_head, segs, &nseg, 0);
 	if (error == EFBIG) {
-		m = m_defrag(*m_head, M_DONTWAIT);
-		if (m == NULL) {
+		if (defragged != 0 || (m = m_collapse(*m_head, M_DONTWAIT,
+		    DC_MAXFRAGS)) == NULL) {
 			m_freem(*m_head);
 			*m_head = NULL;
-			return (ENOBUFS);
+			return (defragged != 0 ? error : ENOBUFS);
 		}
 		*m_head = m;
 		error = bus_dmamap_load_mbuf_sg(sc->dc_mtag,

==== //depot/projects/usiii/dev/drm/ati_pcigart.c#2 (text+ko) ====

@@ -1,6 +1,3 @@
-/* ati_pcigart.h -- ATI PCI GART support -*- linux-c -*-
- * Created: Wed Dec 13 21:52:19 2000 by gareth@valinux.com
- */
 /*-
  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
@@ -30,74 +27,135 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/drm/ati_pcigart.c,v 1.3 2005/11/28 23:13:52 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/drm/ati_pcigart.c,v 1.4 2008/08/23 20:59:12 rnoland Exp $");
+
+/** @file ati_pcigart.c
+ * Implementation of ATI's PCIGART, which provides an aperture in card virtual
+ * address space with addresses remapped to system memory.
+ */
 
 #include "dev/drm/drmP.h"
 
 #define ATI_PCIGART_PAGE_SIZE		4096	/* PCI GART page size */
-#define ATI_MAX_PCIGART_PAGES		8192	/* 32 MB aperture, 4K pages */
-#define ATI_PCIGART_TABLE_SIZE		32768
+#define ATI_PCIGART_PAGE_MASK		(~(ATI_PCIGART_PAGE_SIZE-1))
+
+#define ATI_PCIE_WRITE 0x4
+#define ATI_PCIE_READ 0x8
+
+static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
+				       struct drm_ati_pcigart_info *gart_info)
+{
+	dev->sg->dmah = drm_pci_alloc(dev, gart_info->table_size,
+						PAGE_SIZE,
+						gart_info->table_mask);
+	if (dev->sg->dmah == NULL)
+		return ENOMEM;
+
+	return 0;
+}
+
+static void drm_ati_free_pcigart_table(struct drm_device *dev,
+				       struct drm_ati_pcigart_info *gart_info)
+{
+	drm_pci_free(dev, dev->sg->dmah);
+	dev->sg->dmah = NULL;
+}
+
+int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info)
+{
+	/* we need to support large memory configurations */
+	if (dev->sg == NULL) {
+		DRM_ERROR("no scatter/gather memory!\n");
+		return 0;
+	}
+
+	if (gart_info->bus_addr) {
+		if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
+			gart_info->bus_addr = 0;
+			if (dev->sg->dmah)
+				drm_ati_free_pcigart_table(dev, gart_info);
+		}
+	}
+
+	return 1;
+}
 
-int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
+int drm_ati_pcigart_init(struct drm_device *dev,
+			 struct drm_ati_pcigart_info *gart_info)
 {
+
+	void *address = NULL;
 	unsigned long pages;
-	u32 *pci_gart = NULL, page_base;
-	int i, j;
+	u32 *pci_gart, page_base;
+	dma_addr_t bus_address = 0;
+	int i, j, ret = 0;
+	int max_pages;
+	dma_addr_t entry_addr;
 
+	/* we need to support large memory configurations */
 	if (dev->sg == NULL) {
-		DRM_ERROR( "no scatter/gather memory!\n" );
-		return 0;
+		DRM_ERROR("no scatter/gather memory!\n");
+		goto done;
 	}
 
 	if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
-		/* GART table in system memory */
-		dev->sg->dmah = drm_pci_alloc(dev, ATI_PCIGART_TABLE_SIZE, 0,
-		    0xfffffffful);
-		if (dev->sg->dmah == NULL) {
-			DRM_ERROR("cannot allocate PCI GART table!\n");
-			return 0;
+		DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
+
+		ret = drm_ati_alloc_pcigart_table(dev, gart_info);
+		if (ret) {
+			DRM_ERROR("cannot allocate PCI GART page!\n");
+			goto done;
 		}
-	
-		gart_info->addr = (void *)dev->sg->dmah->vaddr;
-		gart_info->bus_addr = dev->sg->dmah->busaddr;
-		pci_gart = (u32 *)dev->sg->dmah->vaddr;
+
+		address = (void *)dev->sg->dmah->vaddr;
+		bus_address = dev->sg->dmah->busaddr;
 	} else {
-		/* GART table in framebuffer memory */
-		pci_gart = gart_info->addr;
+		address = gart_info->addr;
+		bus_address = gart_info->bus_addr;
+		DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
+			  (unsigned int)bus_address, (unsigned long)address);
 	}
-	
-	pages = DRM_MIN(dev->sg->pages, ATI_MAX_PCIGART_PAGES);
+
+	pci_gart = (u32 *) address;
+
+	max_pages = (gart_info->table_size / sizeof(u32));
+	pages = (dev->sg->pages <= max_pages)
+	    ? dev->sg->pages : max_pages;
 
-	bzero(pci_gart, ATI_PCIGART_TABLE_SIZE);
+	memset(pci_gart, 0, max_pages * sizeof(u32));
 
 	KASSERT(PAGE_SIZE >= ATI_PCIGART_PAGE_SIZE, ("page size too small"));
 
-	for ( i = 0 ; i < pages ; i++ ) {
-		page_base = (u32) dev->sg->busaddr[i];
-
+	for (i = 0; i < pages; i++) {
+		entry_addr = dev->sg->busaddr[i];
 		for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
-			if (gart_info->is_pcie)
-				*pci_gart = (cpu_to_le32(page_base) >> 8) | 0xc;
-			else
-				*pci_gart = cpu_to_le32(page_base);
+			page_base = (u32) entry_addr & ATI_PCIGART_PAGE_MASK;
+			switch(gart_info->gart_reg_if) {
+			case DRM_ATI_GART_IGP:
+				page_base |= (upper_32_bits(entry_addr) & 0xff) << 4;
+				page_base |= 0xc;
+				break;
+			case DRM_ATI_GART_PCIE:
+				page_base >>= 8;
+				page_base |= (upper_32_bits(entry_addr) & 0xff) << 24;
+				page_base |= ATI_PCIE_READ | ATI_PCIE_WRITE;
+				break;
+			default:
+			case DRM_ATI_GART_PCI:
+				break;
+			}
+			*pci_gart = cpu_to_le32(page_base);
 			pci_gart++;
-			page_base += ATI_PCIGART_PAGE_SIZE;
+			entry_addr += ATI_PCIGART_PAGE_SIZE;
 		}
 	}
 
 	DRM_MEMORYBARRIER();
 
-	return 1;
-}
+	ret = 1;
 
-int drm_ati_pcigart_cleanup(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
-{
-	if (dev->sg == NULL) {
-		DRM_ERROR( "no scatter/gather memory!\n" );
-		return 0;
-	}
-
-	drm_pci_free(dev, dev->sg->dmah);
-
-	return 1;
+    done:
+	gart_info->addr = address;
+	gart_info->bus_addr = bus_address;
+	return ret;
 }

==== //depot/projects/usiii/dev/drm/drm-subprocess.pl#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/dev/drm/drm-subprocess.pl,v 1.1 2005/11/28 23:13:52 anholt Exp $
+# $FreeBSD: src/sys/dev/drm/drm-subprocess.pl,v 1.2 2008/08/23 20:59:12 rnoland Exp $
 #
 # Props to Daniel Stone for starting this script for me.  I hate perl.
 
@@ -23,7 +23,7 @@
 			print $lastline;
 		}
 	} elsif ($foundopening && !$foundclosing && /\*\//) {
-		# print the $FreeBSD: src/sys/dev/drm/drm-subprocess.pl,v 1.1 2005/11/28 23:13:52 anholt Exp $ bits after the end of the license block
+		# print the $FreeBSD: src/sys/dev/drm/drm-subprocess.pl,v 1.2 2008/08/23 20:59:12 rnoland Exp $ bits after the end of the license block
 		$foundclosing = 1;
 		print;
 		print "\n";
@@ -37,6 +37,7 @@
 		s/#include "(.*)_drm.h/#include "dev\/drm\/\1_drm.h/;
 		s/#include "mga_ucode.h/#include "dev\/drm\/mga_ucode.h/;
 		s/#include "r300_reg.h/#include "dev\/drm\/r300_reg.h/;
+		s/#include "radeon_microcode.h/#include "dev\/drm\/radeon_microcode.h/;
 		s/#include "sis_ds.h/#include "dev\/drm\/sis_ds.h/;
 		s/#include "drm/#include "dev\/drm\/drm/;
 		print;
@@ -47,4 +48,4 @@
 # if we never found the copyright header, then we're still a line behind.
 if (!$foundopening) {
 	print $lastline;
-}+}

==== //depot/projects/usiii/dev/drm/drm.h#2 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/drm/drm.h,v 1.12 2006/05/17 06:36:28 anholt Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/drm/drm.h,v 1.13 2008/08/23 20:59:12 rnoland Exp $");
 
 /**
  * \mainpage
@@ -64,6 +64,9 @@
 #ifndef __user
 #define __user
 #endif
+#ifndef __iomem
+#define __iomem
+#endif
 
 #ifdef __GNUC__
 # define DEPRECATED  __attribute__ ((deprecated))
@@ -72,9 +75,6 @@
 #endif
 
 #if defined(__linux__)
-#if defined(__KERNEL__)
-#include <linux/config.h>
-#endif
 #include <asm/ioctl.h>		/* For _IO* macros */
 #define DRM_IOCTL_NR(n)		_IOC_NR(n)
 #define DRM_IOC_VOID		_IOC_NONE
@@ -83,14 +83,7 @@
 #define DRM_IOC_READWRITE	_IOC_READ|_IOC_WRITE
 #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE)
-/* Prevent name collision when including sys/ioccom.h */
-#undef ioctl
-#include <sys/ioccom.h>
-#define ioctl(a,b,c)		xf86ioctl(a,b,c)
-#else
 #include <sys/ioccom.h>
-#endif				/* __FreeBSD__ && xf86ioctl */
 #define DRM_IOCTL_NR(n)		((n) & 0xff)
 #define DRM_IOC_VOID		IOC_VOID
 #define DRM_IOC_READ		IOC_OUT
@@ -99,24 +92,6 @@
 #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
 #endif
 
-#define XFREE86_VERSION(major,minor,patch,snap) \
-		((major << 16) | (minor << 8) | patch)
-
-#ifndef CONFIG_XFREE86_VERSION
-#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0)
-#endif
-
-#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
-#define DRM_PROC_DEVICES "/proc/devices"
-#define DRM_PROC_MISC	 "/proc/misc"
-#define DRM_PROC_DRM	 "/proc/drm"
-#define DRM_DEV_DRM	 "/dev/drm"
-#define DRM_DEV_MODE	 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
-#define DRM_DEV_UID	 0
-#define DRM_DEV_GID	 0
-#endif
-
-#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0)
 #ifdef __OpenBSD__
 #define DRM_MAJOR       81
 #endif
@@ -124,7 +99,7 @@
 #define DRM_MAJOR       226
 #endif
 #define DRM_MAX_MINOR   15
-#endif
+
 #define DRM_NAME	"drm"	  /**< Name in kernel, /dev, and /proc */
 #define DRM_MIN_ORDER	5	  /**< At least 2^5 bytes = 32 bytes */
 #define DRM_MAX_ORDER	22	  /**< Up to 2^22 bytes = 4MB */
@@ -139,6 +114,7 @@
 #if defined(__linux__)
 typedef unsigned int drm_handle_t;
 #else
+#include <sys/types.h>
 typedef unsigned long drm_handle_t;	/**< To mapped regions */
 #endif
 typedef unsigned int drm_context_t;	/**< GLXContext handle */
@@ -154,23 +130,23 @@
  * \note KW: Actually it's illegal to change either for
  * backwards-compatibility reasons.
  */
-typedef struct drm_clip_rect {
+struct drm_clip_rect {
 	unsigned short x1;
 	unsigned short y1;
 	unsigned short x2;
 	unsigned short y2;
-} drm_clip_rect_t;
+};
 
 /**
  * Texture region,
  */
-typedef struct drm_tex_region {
+struct drm_tex_region {
 	unsigned char next;
 	unsigned char prev;
 	unsigned char in_use;
 	unsigned char padding;
 	unsigned int age;
-} drm_tex_region_t;
+};
 
 /**
  * Hardware lock.
@@ -179,10 +155,10 @@
  * processor bus contention on a multiprocessor system, there should not be any
  * other data stored in the same cache line.
  */
-typedef struct drm_hw_lock {
+struct drm_hw_lock {
 	__volatile__ unsigned int lock;		/**< lock variable */
 	char padding[60];			/**< Pad to cache line */
-} drm_hw_lock_t;
+};
 
 /* This is beyond ugly, and only works on GCC.  However, it allows me to use
  * drm.h in places (i.e., in the X-server) where I can't use size_t.  The real
@@ -205,7 +181,7 @@
  *
  * \sa drmGetVersion().
  */
-typedef struct drm_version {
+struct drm_version {
 	int version_major;	  /**< Major version */
 	int version_minor;	  /**< Minor version */
 	int version_patchlevel;	  /**< Patch level */
@@ -215,35 +191,35 @@
 	char __user *date;		  /**< User-space buffer to hold date */
 	DRM_SIZE_T desc_len;	  /**< Length of desc buffer */
 	char __user *desc;		  /**< User-space buffer to hold desc */
-} drm_version_t;
+};
 
 /**
  * DRM_IOCTL_GET_UNIQUE ioctl argument type.
  *
  * \sa drmGetBusid() and drmSetBusId().
  */
-typedef struct drm_unique {
+struct drm_unique {
 	DRM_SIZE_T unique_len;	  /**< Length of unique */
 	char __user *unique;		  /**< Unique name for driver instantiation */
-} drm_unique_t;
+};
 
 #undef DRM_SIZE_T
 
-typedef struct drm_list {
+struct drm_list {
 	int count;		  /**< Length of user-space structures */
-	drm_version_t __user *version;
-} drm_list_t;
+	struct drm_version __user *version;
+};
 
-typedef struct drm_block {
+struct drm_block {
 	int unused;
-} drm_block_t;
+};
 
 /**
  * DRM_IOCTL_CONTROL ioctl argument type.
  *
  * \sa drmCtlInstHandler() and drmCtlUninstHandler().
  */
-typedef struct drm_control {
+struct drm_control {
 	enum {
 		DRM_ADD_COMMAND,
 		DRM_RM_COMMAND,
@@ -251,37 +227,39 @@
 		DRM_UNINST_HANDLER
 	} func;
 	int irq;
-} drm_control_t;
+};
 
 /**
  * Type of memory to map.
  */
-typedef enum drm_map_type {
+enum drm_map_type {
 	_DRM_FRAME_BUFFER = 0,	  /**< WC (no caching), no core dump */
 	_DRM_REGISTERS = 1,	  /**< no caching, no core dump */
 	_DRM_SHM = 2,		  /**< shared, cached */
 	_DRM_AGP = 3,		  /**< AGP/GART */
 	_DRM_SCATTER_GATHER = 4,  /**< Scatter/gather memory for PCI DMA */
-	_DRM_CONSISTENT = 5	  /**< Consistent memory for PCI DMA */
-} drm_map_type_t;
+	_DRM_CONSISTENT = 5,	  /**< Consistent memory for PCI DMA */
+	_DRM_TTM = 6
+};
 
 /**
  * Memory mapping flags.
  */
-typedef enum drm_map_flags {
+enum drm_map_flags {
 	_DRM_RESTRICTED = 0x01,	     /**< Cannot be mapped to user-virtual */
 	_DRM_READ_ONLY = 0x02,
 	_DRM_LOCKED = 0x04,	     /**< shared, cached, locked */
 	_DRM_KERNEL = 0x08,	     /**< kernel requires access */
 	_DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */
 	_DRM_CONTAINS_LOCK = 0x20,   /**< SHM page that contains lock */
-	_DRM_REMOVABLE = 0x40	     /**< Removable mapping */
-} drm_map_flags_t;
+	_DRM_REMOVABLE = 0x40,	     /**< Removable mapping */
+	_DRM_DRIVER = 0x80	     /**< Managed by driver */
+};
 
-typedef struct drm_ctx_priv_map {
+struct drm_ctx_priv_map {
 	unsigned int ctx_id;	 /**< Context requesting private mapping */
 	void *handle;		 /**< Handle of map */
-} drm_ctx_priv_map_t;
+};
 
 /**
  * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
@@ -289,30 +267,30 @@
  *
  * \sa drmAddMap().
  */
-typedef struct drm_map {
+struct drm_map {
 	unsigned long offset;	 /**< Requested physical address (0 for SAREA)*/
 	unsigned long size;	 /**< Requested physical size (bytes) */
-	drm_map_type_t type;	 /**< Type of memory to map */
-	drm_map_flags_t flags;	 /**< Flags */
+	enum drm_map_type type;	 /**< Type of memory to map */
+	enum drm_map_flags flags;	 /**< Flags */
 	void *handle;		 /**< User-space: "Handle" to pass to mmap() */

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



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