Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2007 13:35:05 GMT
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 129878 for review
Message-ID:  <200712011335.lB1DZ42J014073@repoman.freebsd.org>

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

Change 129878 by rpaulo@rpaulo_zoo on 2007/12/01 13:34:51

	IFC

Affected files ...

.. //depot/projects/tcpecn/amd64/amd64/busdma_machdep.c#2 integrate
.. //depot/projects/tcpecn/amd64/amd64/pmap.c#2 integrate
.. //depot/projects/tcpecn/amd64/amd64/prof_machdep.c#2 integrate
.. //depot/projects/tcpecn/amd64/conf/GENERIC#2 integrate
.. //depot/projects/tcpecn/amd64/include/pci_cfgreg.h#2 integrate
.. //depot/projects/tcpecn/amd64/pci/pci_cfgreg.c#2 integrate
.. //depot/projects/tcpecn/arm/arm/busdma_machdep.c#2 integrate
.. //depot/projects/tcpecn/arm/arm/cpufunc.c#2 integrate
.. //depot/projects/tcpecn/arm/include/atomic.h#2 integrate
.. //depot/projects/tcpecn/boot/i386/gptboot/gptldr.S#2 integrate
.. //depot/projects/tcpecn/boot/i386/pmbr/pmbr.s#2 integrate
.. //depot/projects/tcpecn/compat/linprocfs/linprocfs.c#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/rpc/xdr.h#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/sys/atomic.h#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/sys/bitmap.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/cpupart.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/cpuvar.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/cyclic.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/elf.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/kmem.h#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/sys/mman.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/modctl.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/objfs.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/param.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/pcpu.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/proc.h#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/sys/stat.h#1 branch
.. //depot/projects/tcpecn/compat/opensolaris/sys/time.h#2 integrate
.. //depot/projects/tcpecn/compat/opensolaris/sys/types.h#2 integrate
.. //depot/projects/tcpecn/conf/NOTES#2 integrate
.. //depot/projects/tcpecn/conf/options#2 integrate
.. //depot/projects/tcpecn/conf/options.amd64#2 integrate
.. //depot/projects/tcpecn/conf/options.i386#2 integrate
.. //depot/projects/tcpecn/contrib/ipfilter/netinet/fil.c#2 integrate
.. //depot/projects/tcpecn/contrib/ipfilter/netinet/ip_auth.c#2 integrate
.. //depot/projects/tcpecn/contrib/ipfilter/netinet/ip_fil_freebsd.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/common/avl/avl.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/common/nvpair/nvpair.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/zil.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/fs/zfs/zio.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/rpc/xdr.c#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/rpc/xdr.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/sys/byteorder.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/sys/isa_defs.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/sys/procset.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/sys/sysmacros.h#2 integrate
.. //depot/projects/tcpecn/contrib/opensolaris/uts/common/sys/vmem.h#2 integrate
.. //depot/projects/tcpecn/dev/aac/aac_debug.c#2 integrate
.. //depot/projects/tcpecn/dev/agp/agp_i810.c#2 integrate
.. //depot/projects/tcpecn/dev/amr/amr.c#2 integrate
.. //depot/projects/tcpecn/dev/amr/amr_cam.c#2 integrate
.. //depot/projects/tcpecn/dev/an/if_an.c#2 integrate
.. //depot/projects/tcpecn/dev/ata/ata-chipset.c#2 integrate
.. //depot/projects/tcpecn/dev/em/if_em.c#2 integrate
.. //depot/projects/tcpecn/dev/em/if_em.h#2 integrate
.. //depot/projects/tcpecn/dev/hwpmc/hwpmc_x86.c#2 integrate
.. //depot/projects/tcpecn/dev/ichsmb/ichsmb_pci.c#2 integrate
.. //depot/projects/tcpecn/dev/random/yarrow.c#2 integrate
.. //depot/projects/tcpecn/dev/sio/sio_isa.c#2 integrate
.. //depot/projects/tcpecn/dev/sio/sio_puc.c#2 integrate
.. //depot/projects/tcpecn/dev/sound/pci/hda/hdac.c#2 integrate
.. //depot/projects/tcpecn/dev/usb/if_zyd.c#2 integrate
.. //depot/projects/tcpecn/dev/usb/usbdevs#2 integrate
.. //depot/projects/tcpecn/dev/wpi/if_wpi.c#2 integrate
.. //depot/projects/tcpecn/dev/wpi/if_wpireg.h#2 integrate
.. //depot/projects/tcpecn/i386/conf/GENERIC#2 integrate
.. //depot/projects/tcpecn/i386/conf/XBOX#2 integrate
.. //depot/projects/tcpecn/i386/i386/busdma_machdep.c#2 integrate
.. //depot/projects/tcpecn/i386/i386/pmap.c#2 integrate
.. //depot/projects/tcpecn/i386/isa/prof_machdep.c#2 integrate
.. //depot/projects/tcpecn/i386/linux/linux_machdep.c#2 integrate
.. //depot/projects/tcpecn/i386/pci/pci_cfgreg.c#2 integrate
.. //depot/projects/tcpecn/ia64/ia64/busdma_machdep.c#2 integrate
.. //depot/projects/tcpecn/ia64/include/atomic.h#2 integrate
.. //depot/projects/tcpecn/kern/kern_clock.c#2 integrate
.. //depot/projects/tcpecn/kern/kern_mutex.c#2 integrate
.. //depot/projects/tcpecn/kern/kern_rwlock.c#2 integrate
.. //depot/projects/tcpecn/kern/kern_sysctl.c#2 integrate
.. //depot/projects/tcpecn/kern/subr_bus.c#2 integrate
.. //depot/projects/tcpecn/modules/zfs/Makefile#2 integrate
.. //depot/projects/tcpecn/net/if_enc.c#2 integrate
.. //depot/projects/tcpecn/net/if_lagg.c#2 integrate
.. //depot/projects/tcpecn/net/pfil.c#2 integrate
.. //depot/projects/tcpecn/net/pfil.h#2 integrate
.. //depot/projects/tcpecn/net80211/ieee80211_scan_sta.c#2 integrate
.. //depot/projects/tcpecn/netgraph/ng_cisco.c#2 integrate
.. //depot/projects/tcpecn/netinet/tcp_output.c#3 integrate
.. //depot/projects/tcpecn/netinet/tcp_subr.c#2 integrate
.. //depot/projects/tcpecn/netinet/tcp_syncache.c#3 integrate
.. //depot/projects/tcpecn/netipsec/ipsec.c#2 integrate
.. //depot/projects/tcpecn/netipsec/ipsec.h#2 integrate
.. //depot/projects/tcpecn/netipsec/ipsec_input.c#2 integrate
.. //depot/projects/tcpecn/netipsec/ipsec_output.c#2 integrate
.. //depot/projects/tcpecn/netipsec/xform.h#2 integrate
.. //depot/projects/tcpecn/netipsec/xform_ipip.c#2 integrate
.. //depot/projects/tcpecn/pci/if_rl.c#2 integrate
.. //depot/projects/tcpecn/pci/if_rlreg.h#2 integrate
.. //depot/projects/tcpecn/powerpc/include/atomic.h#2 integrate
.. //depot/projects/tcpecn/sparc64/conf/GENERIC#2 integrate
.. //depot/projects/tcpecn/sparc64/pci/ofw_pcibus.c#2 integrate
.. //depot/projects/tcpecn/sparc64/pci/psycho.c#2 integrate
.. //depot/projects/tcpecn/sparc64/pci/psychovar.h#2 integrate
.. //depot/projects/tcpecn/sun4v/conf/GENERIC#2 integrate
.. //depot/projects/tcpecn/sun4v/include/pcpu.h#2 integrate
.. //depot/projects/tcpecn/sys/_elf_solaris.h#2 delete
.. //depot/projects/tcpecn/sys/elf.h#2 integrate
.. //depot/projects/tcpecn/sys/kernel.h#2 integrate
.. //depot/projects/tcpecn/sys/param.h#2 integrate
.. //depot/projects/tcpecn/sys/pcpu.h#2 integrate
.. //depot/projects/tcpecn/sys/resource.h#2 integrate
.. //depot/projects/tcpecn/sys/signal.h#2 integrate
.. //depot/projects/tcpecn/sys/stat.h#2 integrate
.. //depot/projects/tcpecn/sys/sysctl.h#2 integrate
.. //depot/projects/tcpecn/sys/time.h#2 integrate
.. //depot/projects/tcpecn/sys/types.h#2 integrate
.. //depot/projects/tcpecn/ufs/ffs/ffs_alloc.c#2 integrate
.. //depot/projects/tcpecn/vm/vm_contig.c#2 integrate
.. //depot/projects/tcpecn/vm/vm_pageout.c#2 integrate
.. //depot/projects/tcpecn/vm/vm_pageout.h#2 integrate

Differences ...

==== //depot/projects/tcpecn/amd64/amd64/busdma_machdep.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.83 2007/06/17 04:21:58 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/busdma_machdep.c,v 1.84 2007/11/27 17:28:11 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -580,7 +580,6 @@
 	bus_addr_t curaddr, lastaddr, baddr, bmask;
 	vm_offset_t vaddr;
 	bus_addr_t paddr;
-	int needbounce = 0;
 	int seg;
 
 	if (map == NULL)
@@ -604,10 +603,8 @@
 
 		while (vaddr < vendaddr) {
 			paddr = pmap_kextract(vaddr);
-			if (run_filter(dmat, paddr) != 0) {
-				needbounce = 1;
+			if (run_filter(dmat, paddr) != 0)
 				map->pagesneeded++;
-			}
 			vaddr += PAGE_SIZE;
 		}
 		CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded);
@@ -679,7 +676,7 @@
 			segs[seg].ds_len = sgsize;
 			first = 0;
 		} else {
-			if (needbounce == 0 && curaddr == lastaddr &&
+			if (curaddr == lastaddr &&
 			    (segs[seg].ds_len + sgsize) <= dmat->maxsegsz &&
 			    (dmat->boundary == 0 ||
 			     (segs[seg].ds_addr & bmask) == (curaddr & bmask)))

==== //depot/projects/tcpecn/amd64/amd64/pmap.c#2 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.594 2007/11/17 22:52:28 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.596 2007/11/30 07:14:42 alc Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1733,6 +1733,7 @@
 	TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
 	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
 	dump_drop_page(m->phys_addr);
+	vm_page_unwire(m, 0);
 	vm_page_free(m);
 }
 
@@ -1746,6 +1747,7 @@
 	static const struct timeval printinterval = { 60, 0 };
 	static struct timeval lastprint;
 	static vm_pindex_t colour;
+	struct vpgqueues *pq;
 	int bit, field;
 	pv_entry_t pv;
 	struct pv_chunk *pc;
@@ -1760,6 +1762,8 @@
 			printf("Approaching the limit on PV entries, consider "
 			    "increasing either the vm.pmap.shpgperproc or the "
 			    "vm.pmap.pv_entry_max sysctl.\n");
+	pq = NULL;
+retry:
 	pc = TAILQ_FIRST(&pmap->pm_pvchunk);
 	if (pc != NULL) {
 		for (field = 0; field < _NPCM; field++) {
@@ -1782,7 +1786,9 @@
 		}
 	}
 	/* No free items, allocate another chunk */
-	m = vm_page_alloc(NULL, colour, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ);
+	m = vm_page_alloc(NULL, colour, (pq == &vm_page_queues[PQ_ACTIVE] ?
+	    VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ |
+	    VM_ALLOC_WIRED);
 	if (m == NULL) {
 		if (try) {
 			pv_entry_count--;
@@ -1794,18 +1800,16 @@
 		 * pages.  After that, if a pv chunk entry is still needed,
 		 * destroy mappings to active pages.
 		 */
-		PV_STAT(pmap_collect_inactive++);
-		pmap_collect(pmap, &vm_page_queues[PQ_INACTIVE]);
-		m = vm_page_alloc(NULL, colour,
-		    VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ);
-		if (m == NULL) {
+		if (pq == NULL) {
+			PV_STAT(pmap_collect_inactive++);
+			pq = &vm_page_queues[PQ_INACTIVE];
+		} else if (pq == &vm_page_queues[PQ_INACTIVE]) {
 			PV_STAT(pmap_collect_active++);
-			pmap_collect(pmap, &vm_page_queues[PQ_ACTIVE]);
-			m = vm_page_alloc(NULL, colour,
-			    VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ);
-			if (m == NULL)
-				panic("get_pv_entry: increase vm.pmap.shpgperproc");
-		}
+			pq = &vm_page_queues[PQ_ACTIVE];
+		} else
+			panic("get_pv_entry: increase vm.pmap.shpgperproc");
+		pmap_collect(pmap, pq);
+		goto retry;
 	}
 	PV_STAT(pc_chunk_count++);
 	PV_STAT(pc_chunk_allocs++);
@@ -3048,6 +3052,7 @@
 			TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
 			m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
 			dump_drop_page(m->phys_addr);
+			vm_page_unwire(m, 0);
 			vm_page_free(m);
 		}
 	}

==== //depot/projects/tcpecn/amd64/amd64/prof_machdep.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/prof_machdep.c,v 1.29 2007/03/26 18:03:29 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/prof_machdep.c,v 1.31 2007/11/29 02:01:21 bde Exp $");
 
 #ifdef GUPROF
 #if 0
@@ -82,10 +82,10 @@
 	# Check that we are profiling.  Do it early for speed.	\n\
 	#							\n\
 	cmpl	$GMON_PROF_OFF,_gmonparam+GM_STATE		\n\
- 	je	.mcount_exit					\n\
- 	#							\n\
- 	# __mcount is the same as [.]mcount except the caller	\n\
- 	# hasn't changed the stack except to call here, so the	\n\
+	je	.mcount_exit					\n\
+	#							\n\
+	# __mcount is the same as [.]mcount except the caller	\n\
+	# hasn't changed the stack except to call here, so the	\n\
 	# caller's raddr is above our raddr.			\n\
 	#							\n\
 	pushq	%rax						\n\
@@ -96,13 +96,11 @@
 	pushq	%r8						\n\
 	pushq	%r9						\n\
 	movq	7*8+8(%rsp),%rdi				\n\
- 	jmp	.got_frompc					\n\
- 								\n\
- 	.p2align 4,0x90						\n\
- 	.globl	.mcount						\n\
+	jmp	.got_frompc					\n\
+								\n\
+	.p2align 4,0x90						\n\
+	.globl	.mcount						\n\
 .mcount:							\n\
- 	.globl	__cyg_profile_func_enter			\n\
-__cyg_profile_func_enter:					\n\
 	cmpl	$GMON_PROF_OFF,_gmonparam+GM_STATE		\n\
 	je	.mcount_exit					\n\
 	#							\n\
@@ -137,7 +135,7 @@
 	popq	%rdx						\n\
 	popq	%rax						\n\
 .mcount_exit:							\n\
-	ret							\n\
+	ret	$0						\n\
 ");
 #else /* !__GNUCLIKE_ASM */
 #error "this file needs to be ported to your compiler"
@@ -167,8 +165,6 @@
 	.p2align 4,0x90						\n\
 	.globl	.mexitcount					\n\
 .mexitcount:							\n\
- 	.globl	__cyg_profile_func_exit				\n\
-__cyg_profile_func_exit:					\n\
 	cmpl	$GMON_PROF_HIRES,_gmonparam+GM_STATE		\n\
 	jne	.mexitcount_exit				\n\
 	pushq	%rax						\n\
@@ -191,7 +187,7 @@
 	popq	%rdx						\n\
 	popq	%rax						\n\
 .mexitcount_exit:						\n\
-	ret							\n\
+	ret	$0						\n\
 ");
 #endif /* __GNUCLIKE_ASM */
 

==== //depot/projects/tcpecn/amd64/conf/GENERIC#2 (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.487 2007/10/26 02:35:42 imp Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.488 2007/11/28 05:50:44 attilio Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -59,7 +59,6 @@
 options 	SYSVSEM			# SYSV-style semaphores
 options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
 options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
-options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
 options 	STOP_NMI		# Stop CPUS using NMI instead of IPI
 options 	AUDIT			# Security event auditing
 

==== //depot/projects/tcpecn/amd64/include/pci_cfgreg.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/pci_cfgreg.h,v 1.13 2005/01/05 20:17:20 imp Exp $
+ * $FreeBSD: src/sys/amd64/include/pci_cfgreg.h,v 1.14 2007/11/28 22:20:07 jhb Exp $
  *
  */
 
@@ -37,11 +37,6 @@
 #define CONF1_ENABLE_MSK1  0x80000001ul
 #define CONF1_ENABLE_RES1  0x80000000ul
 
-#define CONF2_ENABLE_PORT  0x0cf8
-#define CONF2_FORWARD_PORT 0x0cfa
-#define CONF2_ENABLE_CHK   0x0e
-#define CONF2_ENABLE_RES   0x0e
-
 int		pci_cfgregopen(void);
 u_int32_t	pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
 void		pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);

==== //depot/projects/tcpecn/amd64/pci/pci_cfgreg.c#2 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.109 2005/10/25 04:53:29 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/pci/pci_cfgreg.c,v 1.110 2007/11/28 22:20:08 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -38,12 +38,8 @@
 #include <dev/pci/pcireg.h>
 #include <machine/pci_cfgreg.h>
 
-static int cfgmech;
-static int devmax;
-
 static int	pcireg_cfgread(int bus, int slot, int func, int reg, int bytes);
 static void	pcireg_cfgwrite(int bus, int slot, int func, int reg, int data, int bytes);
-static int	pcireg_cfgopen(void);
 
 static struct mtx pcicfg_mtx;
 
@@ -57,8 +53,6 @@
 
 	if (opened)
 		return (1);
-	if (pcireg_cfgopen() == 0)
-		return (0);
 	mtx_init(&pcicfg_mtx, "pcicfg", NULL, MTX_SPIN);
 	opened = 1;
 	return (1);
@@ -109,26 +103,12 @@
 {
 	int dataport = 0;
 
-	if (bus <= PCI_BUSMAX
-	    && slot < devmax
-	    && func <= PCI_FUNCMAX
-	    && reg <= PCI_REGMAX
-	    && bytes != 3
-	    && (unsigned) bytes <= 4
-	    && (reg & (bytes - 1)) == 0) {
-		switch (cfgmech) {
-		case 1:
-			outl(CONF1_ADDR_PORT, (1 << 31)
-			    | (bus << 16) | (slot << 11) 
-			    | (func << 8) | (reg & ~0x03));
-			dataport = CONF1_DATA_PORT + (reg & 0x03);
-			break;
-		case 2:
-			outb(CONF2_ENABLE_PORT, 0xf0 | (func << 1));
-			outb(CONF2_FORWARD_PORT, bus);
-			dataport = 0xc000 | (slot << 8) | reg;
-			break;
-		}
+	if (bus <= PCI_BUSMAX && slot < 32 && func <= PCI_FUNCMAX &&
+	    reg <= PCI_REGMAX && bytes != 3 && (unsigned) bytes <= 4 &&
+	    (reg & (bytes - 1)) == 0) {
+		outl(CONF1_ADDR_PORT, (1 << 31) | (bus << 16) | (slot << 11) 
+		    | (func << 8) | (reg & ~0x03));
+		dataport = CONF1_DATA_PORT + (reg & 0x03);
 	}
 	return (dataport);
 }
@@ -137,19 +117,11 @@
 static void
 pci_cfgdisable(void)
 {
-	switch (cfgmech) {
-	case 1:
-		/*
-		 * Do nothing for the config mechanism 1 case.
-		 * Writing a 0 to the address port can apparently
-		 * confuse some bridges and cause spurious
-		 * access failures.
-		 */
-		break;
-	case 2:
-		outb(CONF2_ENABLE_PORT, 0);
-		break;
-	}
+
+	/*
+	 * Do nothing.  Writing a 0 to the address port can apparently
+	 * confuse some bridges and cause spurious access failures.
+	 */
 }
 
 static int
@@ -201,131 +173,3 @@
 	}
 	mtx_unlock_spin(&pcicfg_mtx);
 }
-
-/* check whether the configuration mechanism has been correctly identified */
-static int
-pci_cfgcheck(int maxdev)
-{
-	uint32_t id, class;
-	uint8_t header;
-	uint8_t device;
-	int port;
-
-	if (bootverbose) 
-		printf("pci_cfgcheck:\tdevice ");
-
-	for (device = 0; device < maxdev; device++) {
-		if (bootverbose) 
-			printf("%d ", device);
-
-		port = pci_cfgenable(0, device, 0, 0, 4);
-		id = inl(port);
-		if (id == 0 || id == 0xffffffff)
-			continue;
-
-		port = pci_cfgenable(0, device, 0, 8, 4);
-		class = inl(port) >> 8;
-		if (bootverbose)
-			printf("[class=%06x] ", class);
-		if (class == 0 || (class & 0xf870ff) != 0)
-			continue;
-
-		port = pci_cfgenable(0, device, 0, 14, 1);
-		header = inb(port);
-		if (bootverbose)
-			printf("[hdr=%02x] ", header);
-		if ((header & 0x7e) != 0)
-			continue;
-
-		if (bootverbose)
-			printf("is there (id=%08x)\n", id);
-
-		pci_cfgdisable();
-		return (1);
-	}
-	if (bootverbose) 
-		printf("-- nothing found\n");
-
-	pci_cfgdisable();
-	return (0);
-}
-
-static int
-pcireg_cfgopen(void)
-{
-	uint32_t mode1res, oldval1;
-	uint8_t mode2res, oldval2;
-
-	oldval1 = inl(CONF1_ADDR_PORT);
-
-	if (bootverbose) {
-		printf("pci_open(1):\tmode 1 addr port (0x0cf8) is 0x%08x\n",
-		    oldval1);
-	}
-
-	if ((oldval1 & CONF1_ENABLE_MSK) == 0) {
-
-		cfgmech = 1;
-		devmax = 32;
-
-		outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK);
-		DELAY(1);
-		mode1res = inl(CONF1_ADDR_PORT);
-		outl(CONF1_ADDR_PORT, oldval1);
-
-		if (bootverbose)
-			printf("pci_open(1a):\tmode1res=0x%08x (0x%08lx)\n", 
-			    mode1res, CONF1_ENABLE_CHK);
-
-		if (mode1res) {
-			if (pci_cfgcheck(32)) 
-				return (cfgmech);
-		}
-
-		outl(CONF1_ADDR_PORT, CONF1_ENABLE_CHK1);
-		mode1res = inl(CONF1_ADDR_PORT);
-		outl(CONF1_ADDR_PORT, oldval1);
-
-		if (bootverbose)
-			printf("pci_open(1b):\tmode1res=0x%08x (0x%08lx)\n", 
-			    mode1res, CONF1_ENABLE_CHK1);
-
-		if ((mode1res & CONF1_ENABLE_MSK1) == CONF1_ENABLE_RES1) {
-			if (pci_cfgcheck(32)) 
-				return (cfgmech);
-		}
-	}
-
-	oldval2 = inb(CONF2_ENABLE_PORT);
-
-	if (bootverbose) {
-		printf("pci_open(2):\tmode 2 enable port (0x0cf8) is 0x%02x\n",
-		    oldval2);
-	}
-
-	if ((oldval2 & 0xf0) == 0) {
-
-		cfgmech = 2;
-		devmax = 16;
-
-		outb(CONF2_ENABLE_PORT, CONF2_ENABLE_CHK);
-		mode2res = inb(CONF2_ENABLE_PORT);
-		outb(CONF2_ENABLE_PORT, oldval2);
-
-		if (bootverbose)
-			printf("pci_open(2a):\tmode2res=0x%02x (0x%02x)\n", 
-			    mode2res, CONF2_ENABLE_CHK);
-
-		if (mode2res == CONF2_ENABLE_RES) {
-			if (bootverbose)
-				printf("pci_open(2a):\tnow trying mechanism 2\n");
-
-			if (pci_cfgcheck(16)) 
-				return (cfgmech);
-		}
-	}
-
-	cfgmech = 0;
-	devmax = 0;
-	return (cfgmech);
-}

==== //depot/projects/tcpecn/arm/arm/busdma_machdep.c#2 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.35 2007/08/18 16:47:28 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.37 2007/11/28 22:21:17 cognet Exp $");
 
 /*
  * ARM bus dma support routines
@@ -664,12 +664,11 @@
 
 static int
 _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-			bus_size_t buflen, int flags, int *nb)
+			bus_size_t buflen, int flags)
 {
 	vm_offset_t vaddr;
 	vm_offset_t vendaddr;
 	bus_addr_t paddr;
-	int needbounce = *nb;
 
 	if ((map->pagesneeded == 0)) {
 		CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, "
@@ -687,10 +686,8 @@
 		while (vaddr < vendaddr) {
 			paddr = pmap_kextract(vaddr);
 			if (((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) &&
-			    run_filter(dmat, paddr) != 0) {
-				needbounce = 1;
+			    run_filter(dmat, paddr) != 0)
 				map->pagesneeded++;
-			}
 			vaddr += PAGE_SIZE;
 		}
 		CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded);
@@ -716,7 +713,6 @@
 		mtx_unlock(&bounce_lock);
 	}
 
-	*nb = needbounce;
 	return (0);
 }
 
@@ -739,14 +735,12 @@
 	pd_entry_t *pde;
 	pt_entry_t pte;
 	pt_entry_t *ptep;
-	int needbounce = 0;
 
 	lastaddr = *lastaddrp;
 	bmask = ~(dmat->boundary - 1);
 
 	if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) {
-		error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags,
-		    &needbounce);
+		error = _bus_dmamap_count_pages(dmat, map, buf, buflen, flags);
 		if (error)
 			return (error);
 	}
@@ -840,7 +834,7 @@
 		 * Insert chunk into a segment, coalescing with
 		 * the previous segment if possible.
 		 */
-		if (needbounce == 0 && seg >= 0 && curaddr == lastaddr &&
+		if (seg >= 0 && curaddr == lastaddr &&
 		    (segs[seg].ds_len + sgsize) <= dmat->maxsegsz &&
 		    (dmat->boundary == 0 ||
 		     (segs[seg].ds_addr & bmask) == 
@@ -1096,7 +1090,7 @@
 		cpu_l2cache_wb_range((vm_offset_t)buf, len);
 	}
 	if (op & BUS_DMASYNC_PREREAD) {
-		if ((op & BUS_DMASYNC_PREWRITE) ||
+		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);

==== //depot/projects/tcpecn/arm/arm/cpufunc.c#2 (text+ko) ====

@@ -45,7 +45,7 @@
  * Created      : 30/01/97
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/cpufunc.c,v 1.21 2007/11/08 13:19:08 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/cpufunc.c,v 1.22 2007/11/28 22:55:55 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -939,7 +939,7 @@
 		cpu_reset_needs_v4_MMU_disable = 1;	/* V4 or higher */
 		get_cachetype_cp15();
 		pmap_pte_init_generic();
-		return 0;
+		goto out;
 	}
 #endif /* CPU_ARM9E || CPU_ARM10 */
 #ifdef CPU_ARM10
@@ -1799,6 +1799,9 @@
 	/* Now really make sure they are clean.  */
 	__asm __volatile ("mcr\tp15, 0, r0, c7, c7, 0" : : );
 
+	if (vector_page == ARM_VECTORS_HIGH)
+		cpuctrl |= CPU_CONTROL_VECRELOC;
+
 	/* Set the control register */
 	ctrl = cpuctrl;
 	cpu_control(0xffffffff, cpuctrl);

==== //depot/projects/tcpecn/arm/include/atomic.h#2 (text+ko) ====

@@ -33,7 +33,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/arm/include/atomic.h,v 1.21 2007/01/05 02:50:27 ticso Exp $
+ * $FreeBSD: src/sys/arm/include/atomic.h,v 1.22 2007/11/27 22:12:05 cognet Exp $
  */
 
 #ifndef	_MACHINE_ATOMIC_H_
@@ -271,9 +271,10 @@
 	    "mov	%0, #0xe0000004\n"
 	    "str	%1, [%0]\n"
 	    "ldr	%1, [%2]\n"
-	    "add	%3, %1, %3\n"
-	    "str	%3, [%2]\n"
+	    "add	%0, %1, %3\n"
+	    "str	%0, [%2]\n"
 	    "2:\n"
+	    "mov	%0, #0xe0000004\n"
 	    "mov	%3, #0\n"
 	    "str	%3, [%0]\n"
 	    : "=r" (ras_start), "=r" (start), "+r" (p), "+r" (v)

==== //depot/projects/tcpecn/boot/i386/gptboot/gptldr.S#2 (text+ko) ====

@@ -27,7 +27,9 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/boot/i386/gptboot/gptldr.S,v 1.1 2007/10/24 21:32:59 jhb Exp $
+ * $FreeBSD: src/sys/boot/i386/gptboot/gptldr.S,v 1.2 2007/11/26 21:29:58 jhb Exp $
+ *
+ * Partly from: src/sys/boot/i386/boot2/boot1.S 1.31
  */
 
 /* Memory Locations */

==== //depot/projects/tcpecn/boot/i386/pmbr/pmbr.s#2 (text+ko) ====

@@ -27,7 +27,9 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/sys/boot/i386/pmbr/pmbr.s,v 1.1 2007/10/24 21:32:59 jhb Exp $
+# $FreeBSD: src/sys/boot/i386/pmbr/pmbr.s,v 1.2 2007/11/26 21:29:59 jhb Exp $
+#
+# Partly from: src/sys/boot/i386/mbr/mbr.s 1.7
 
 # A 512 byte PMBR boot manager that looks for a FreeBSD boot GPT partition
 # and boots it.

==== //depot/projects/tcpecn/compat/linprocfs/linprocfs.c#2 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.116 2007/10/12 06:03:42 kevlo Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.117 2007/11/29 06:34:29 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -374,19 +374,28 @@
 static int
 linprocfs_dostat(PFS_FILL_ARGS)
 {
+	struct pcpu *pcpu;
+	long cp_time[CPUSTATES];
+	long *cp;
 	int i;
 
+	read_cpu_time(cp_time);
 	sbuf_printf(sb, "cpu %ld %ld %ld %ld\n",
 	    T2J(cp_time[CP_USER]),
 	    T2J(cp_time[CP_NICE]),
 	    T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/),
 	    T2J(cp_time[CP_IDLE]));
-	for (i = 0; i < mp_ncpus; ++i)
+	for (i = 0; i <= mp_maxid; ++i) {
+		if (CPU_ABSENT(i))
+			continue;
+		pcpu = pcpu_find(i);
+		cp = pcpu->pc_cp_time;
 		sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i,
-		    T2J(cp_time[CP_USER]) / mp_ncpus,
-		    T2J(cp_time[CP_NICE]) / mp_ncpus,
-		    T2J(cp_time[CP_SYS]) / mp_ncpus,
-		    T2J(cp_time[CP_IDLE]) / mp_ncpus);
+		    T2J(cp[CP_USER]),
+		    T2J(cp[CP_NICE]),
+		    T2J(cp[CP_SYS] /*+ cp[CP_INTR]*/),
+		    T2J(cp[CP_IDLE]));
+	}
 	sbuf_printf(sb,
 	    "disk 0 0 0 0\n"
 	    "page %u %u\n"
@@ -410,9 +419,11 @@
 static int
 linprocfs_douptime(PFS_FILL_ARGS)
 {
+	long cp_time[CPUSTATES];
 	struct timeval tv;
 
 	getmicrouptime(&tv);
+	read_cpu_time(cp_time);
 	sbuf_printf(sb, "%lld.%02ld %ld.%02ld\n",
 	    (long long)tv.tv_sec, tv.tv_usec / 10000,
 	    T2S(cp_time[CP_IDLE]), T2J(cp_time[CP_IDLE]) % 100);

==== //depot/projects/tcpecn/compat/opensolaris/rpc/xdr.h#2 (text+ko) ====

@@ -50,19 +50,6 @@
 #define xdr_control(a,b,c) xdrmem_control(a,b,c)
 
 /*
- * These are XDR control operators
- */
-
-#define	XDR_GET_BYTES_AVAIL 1
-
-struct xdr_bytesrec {
-	bool_t xc_is_last_record;
-	size_t xc_num_avail;
-};
-
-typedef struct xdr_bytesrec xdr_bytesrec;
-
-/*
  * These are the request arguments to XDR_CONTROL.
  *
  * XDR_PEEK - returns the contents of the next XDR unit on the XDR stream.

==== //depot/projects/tcpecn/compat/opensolaris/sys/atomic.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/atomic.h,v 1.1 2007/06/08 12:35:46 pjd Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/atomic.h,v 1.2 2007/11/28 21:47:09 jb Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_ATOMIC_H_
@@ -106,7 +106,7 @@
 static __inline void *
 atomic_cas_ptr(volatile void *target, void *cmp,  void *newval)
 {
-	return ((void *)atomic_cas_64((uint64_t *)target, (uint64_t)cmp,
+	return ((void *)atomic_cas_64((volatile uint64_t *)target, (uint64_t)cmp,
 	    (uint64_t)newval));
 }
 #endif

==== //depot/projects/tcpecn/compat/opensolaris/sys/kmem.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/kmem.h,v 1.2 2007/04/10 02:35:56 pjd Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/kmem.h,v 1.3 2007/11/28 21:48:25 jb Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_KMEM_H_
@@ -32,6 +32,7 @@
 #include <sys/param.h>
 #include <sys/proc.h>
 #include <sys/malloc.h>
+#include <sys/vmem.h>
 
 #include <vm/uma.h>
 #include <vm/vm.h>
@@ -41,8 +42,6 @@
 #define	KM_NOSLEEP		M_NOWAIT
 #define	KMC_NODEBUG		0
 
-typedef	void	vmem_t;
-
 typedef struct kmem_cache {
 	char		kc_name[32];
 #ifdef _KERNEL

==== //depot/projects/tcpecn/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.3 2007/10/20 23:23:13 julian Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/proc.h,v 1.4 2007/11/28 21:50:05 jb Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_PROC_H_
@@ -44,8 +44,6 @@
 #define	max_ncpus	mp_ncpus
 #define	boot_max_ncpus	mp_ncpus
 
-extern int hz;	/* system clock's frequency */
-
 #define	TS_RUN	0
 
 #define	p0	proc0

==== //depot/projects/tcpecn/compat/opensolaris/sys/time.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/time.h,v 1.1 2007/04/06 01:09:06 pjd Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/time.h,v 1.2 2007/11/28 21:44:17 jb Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_TIME_H_
@@ -31,9 +31,17 @@
 
 #include_next <sys/time.h>
 
+#define SEC		1
+#define MILLISEC	1000
+#define MICROSEC	1000000
+#define NANOSEC		1000000000
+
+typedef longlong_t	hrtime_t;
+
+#define	LBOLT	((gethrtime() * hz) / NANOSEC)
+
 #ifdef _KERNEL
-#define	lbolt	((gethrtime() * hz) / NANOSEC)
-#define	lbolt64	(int64_t)(lbolt)
+#define	lbolt64	(int64_t)(LBOLT)
 
 static __inline hrtime_t
 gethrtime(void) {
@@ -53,6 +61,15 @@
 #define	gethrestime_sec()	(time_second)
 #define	gethrestime(ts)		getnanotime(ts)
 
+#else
+
+static __inline hrtime_t gethrtime(void) {
+	struct timespec ts;
+	clock_gettime(CLOCK_UPTIME,&ts);
+	return (((u_int64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
+}
+
+
 #endif	/* _KERNEL */
 
 #endif	/* !_OPENSOLARIS_SYS_TIME_H_ */

==== //depot/projects/tcpecn/compat/opensolaris/sys/types.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/types.h,v 1.2 2007/04/23 00:52:06 pjd Exp $
+ * $FreeBSD: src/sys/compat/opensolaris/sys/types.h,v 1.3 2007/11/28 21:49:16 jb Exp $
  */
 
 #ifndef _OPENSOLARIS_SYS_TYPES_H_
@@ -39,6 +39,18 @@
 #define	MAXNAMELEN	256
 
 typedef	struct timespec	timestruc_t;
+typedef u_int		uint_t;
+typedef u_char		uchar_t;
+typedef u_short		ushort_t;
+typedef u_long		ulong_t;
+typedef long long	longlong_t;  
+typedef unsigned long long	u_longlong_t;
+typedef off_t		off64_t;
+typedef id_t		taskid_t;
+typedef id_t		projid_t;
+typedef id_t		poolid_t;
+typedef id_t		zoneid_t;
+typedef id_t		ctid_t;
 
 #ifdef _KERNEL
 
@@ -53,6 +65,12 @@
 
 #else
 
+#if defined(__XOPEN_OR_POSIX)
+typedef enum { _B_FALSE, _B_TRUE }	boolean_t;
+#else
+typedef enum { B_FALSE, B_TRUE }	boolean_t;
+#endif /* defined(__XOPEN_OR_POSIX) */

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



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