CVS commit: [matt-nb6-plus] src/sys/arch/arm/cortex

2013-03-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Mar 12 21:20:04 UTC 2013

Modified Files:
src/sys/arch/arm/cortex [matt-nb6-plus]: a9_mpsubr.S

Log Message:
Busy wait in a WFI loop until told to exit.


To generate a diff of this commit:
cvs rdiff -u -r1.3.6.2 -r1.3.6.3 src/sys/arch/arm/cortex/a9_mpsubr.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.3.6.2 src/sys/arch/arm/cortex/a9_mpsubr.S:1.3.6.3
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.3.6.2	Wed Nov 28 22:40:25 2012
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Tue Mar 12 21:20:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.3.6.2 2012/11/28 22:40:25 matt Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.3.6.3 2013/03/12 21:20:04 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -367,17 +367,18 @@ a9_mpstart:
 	/* Now we will wait for someone tell this cpu to start running */
 #ifdef MULTIPROCESSOR
 	ldr	r0, .Lcpu_mbox
-#else
-	cmp	r0, r0
 #endif
 2:
 #ifdef MULTIPROCESSOR
 	dmb
 	ldr	r2, [r0]
 	tst	r2, r5
-#endif
-	@wfeeq
+	wfieq
 	beq	2b
+#else
+	wfi
+	b	2b
+#endif
 
 #ifdef MULTIPROCESSOR
 3:	XPUTC(#98)



CVS commit: [matt-nb6-plus] src/sys/sys

2013-02-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Feb 19 07:19:41 UTC 2013

Modified Files:
src/sys/sys [matt-nb6-plus]: kernhist.h

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/sys/kernhist.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/kernhist.h
diff -u src/sys/sys/kernhist.h:1.4 src/sys/sys/kernhist.h:1.4.6.1
--- src/sys/sys/kernhist.h:1.4	Mon Nov 21 04:36:05 2011
+++ src/sys/sys/kernhist.h	Tue Feb 19 07:19:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernhist.h,v 1.4 2011/11/21 04:36:05 christos Exp $	*/
+/*	$NetBSD: kernhist.h,v 1.4.6.1 2013/02/19 07:19:40 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -93,9 +93,11 @@ LIST_HEAD(kern_history_head, kern_histor
  */
 #ifndef KERNHIST
 #define KERNHIST_DECL(NAME)
+#define KERNHIST_DEFINE(NAME)
 #define KERNHIST_INIT(NAME,N)
 #define KERNHIST_INIT_STATIC(NAME,BUF)
 #define KERNHIST_LOG(NAME,FMT,A,B,C,D)
+#define KERNHIST_CALLARGS(NAME,FMT,A,B,C,D)
 #define KERNHIST_CALLED(NAME)
 #define KERNHIST_FUNC(FNAME)
 #define kernhist_dump(NAME)
@@ -106,7 +108,8 @@ LIST_HEAD(kern_history_head, kern_histor
 
 extern	struct kern_history_head kern_histories;
 
-#define KERNHIST_DECL(NAME) struct kern_history NAME
+#define KERNHIST_DECL(NAME) extern struct kern_history NAME
+#define KERNHIST_DEFINE(NAME) struct kern_history NAME
 
 #define KERNHIST_INIT(NAME,N) \
 do { \
@@ -130,13 +133,18 @@ do { \
 	LIST_INSERT_HEAD(&kern_histories, &(NAME), list); \
 } while (/*CONSTCOND*/ 0)
 
+#ifndef KERNHIST_DELAY
+#define KERNHIST_DELAY	10
+#endif
+
 #if defined(KERNHIST_PRINT)
 extern int kernhist_print_enabled;
 #define KERNHIST_PRINTNOW(E) \
 do { \
 		if (kernhist_print_enabled) { \
 			kernhist_entry_print(E); \
-			DELAY(10); \
+			if (KERNHISTDELAY != 0) \
+DELAY(KERNHIST_DELAY); \
 		} \
 } while (/*CONSTCOND*/ 0)
 #else
@@ -172,10 +180,20 @@ do { \
 	KERNHIST_LOG(NAME, "called!", 0, 0, 0, 0); \
 } while (/*CONSTCOND*/ 0)
 
+/*
+ * This extends kernhist to avoid wasting a separate "called!" entry on every
+ * function.
+ */
+#define KERNHIST_CALLARGS(NAME, FMT, A, B, C, D) \
+do { \
+	_kernhist_call = atomic_inc_uint_nv(&_kernhist_cnt); \
+	KERNHIST_LOG(NAME, "called: "FMT, (A), (B), (C), (D)); \
+} while (/*CONSTCOND*/ 0)
+
 #define KERNHIST_FUNC(FNAME) \
 	static unsigned int _kernhist_cnt = 0; \
 	static const char *const _kernhist_name = FNAME; \
-	int _kernhist_call = 0;
+	unsigned int _kernhist_call = 0;
 
 static inline void kernhist_entry_print(const struct kern_history_ent *);
 



CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2013-02-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Feb 19 02:31:55 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.5 -r1.8.4.6 src/sys/arch/arm/broadcom/bcm53xx_board.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.6
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5	Tue Feb 19 02:22:02 2013
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Tue Feb 19 02:31:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.8.4.6 2013/02/19 02:31:55 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.6 2013/02/19 02:31:55 matt Exp $");
 
 #include 
 #include 
@@ -106,18 +106,9 @@ struct arm32_bus_dma_tag bcm53xx_coheren
 };
 
 #ifdef _ARM32_NEED_BUS_DMA_BOUNCE
-struct arm32_dma_range bcm53xx_bounce_dma_ranges[] = {
-	[0] = {
-		.dr_sysbase = 0x8000,
-		.dr_busbase = 0x8000,
-		.dr_len = 0x1000,
-		.dr_flags = _BUS_DMAMAP_COHERENT,
-	},
-};
-
 struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag = {
-	._ranges = bcm53xx_bounce_dma_ranges,
-	._nranges = __arraycount(bcm53xx_bounce_dma_ranges),
+	._ranges = bcm53xx_coherent_dma_ranges,
+	._nranges = 1,
 	_BUS_DMAMAP_FUNCS,
 	_BUS_DMAMEM_FUNCS,
 	_BUS_DMATAG_FUNCS,
@@ -544,11 +535,7 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		bcm53xx_dma_ranges[0].dr_len = memsize;
 		bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
 		bcm53xx_dma_tag._nranges = 1;
-#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 		bcm53xx_coherent_dma_tag._nranges = 1;
-#else
-		bcm53xx_bounce_dma_ranges[0].dr_len = memsize;
-#endif
 	} else {
 		/*
 		 * By setting up two ranges, bus_dmamem_alloc will always
@@ -557,9 +544,6 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		 */
 		bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000;
 		bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000;
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
-		bcm53xx_bounce_dma_ranges[1].dr_len = memsize - 0x1000;
-#endif
 	}
 	KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0);
 	KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);



CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2013-02-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Feb 19 02:22:02 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c
bcm53xx_eth.c bcm53xx_pax.c bcm53xx_var.h

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.4 -r1.8.4.5 src/sys/arch/arm/broadcom/bcm53xx_board.c
cvs rdiff -u -r1.17.2.4 -r1.17.2.5 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/arm/broadcom/bcm53xx_pax.c
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/sys/arch/arm/broadcom/bcm53xx_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.5
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4	Wed Feb 13 23:52:18 2013
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Tue Feb 19 02:22:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.5 2013/02/19 02:22:02 matt Exp $");
 
 #include 
 #include 
@@ -91,11 +91,9 @@ struct arm32_dma_range bcm53xx_coherent_
 		.dr_busbase = 0x8000,
 		.dr_len = 0x1000,
 		.dr_flags = _BUS_DMAMAP_COHERENT,
-#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 	}, [1] = {
 		.dr_sysbase = 0x9000,
 		.dr_busbase = 0x9000,
-#endif
 	},
 };
 
@@ -107,6 +105,25 @@ struct arm32_bus_dma_tag bcm53xx_coheren
 	_BUS_DMATAG_FUNCS,
 };
 
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+struct arm32_dma_range bcm53xx_bounce_dma_ranges[] = {
+	[0] = {
+		.dr_sysbase = 0x8000,
+		.dr_busbase = 0x8000,
+		.dr_len = 0x1000,
+		.dr_flags = _BUS_DMAMAP_COHERENT,
+	},
+};
+
+struct arm32_bus_dma_tag bcm53xx_bounce_dma_tag = {
+	._ranges = bcm53xx_bounce_dma_ranges,
+	._nranges = __arraycount(bcm53xx_bounce_dma_ranges),
+	_BUS_DMAMAP_FUNCS,
+	_BUS_DMAMEM_FUNCS,
+	_BUS_DMATAG_FUNCS,
+};
+#endif
+
 #ifdef BCM53XX_CONSOLE_EARLY
 #include 
 #include 
@@ -529,6 +546,8 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		bcm53xx_dma_tag._nranges = 1;
 #ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 		bcm53xx_coherent_dma_tag._nranges = 1;
+#else
+		bcm53xx_bounce_dma_ranges[0].dr_len = memsize;
 #endif
 	} else {
 		/*
@@ -537,12 +556,16 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		 * below 256MB which for PCI and GMAC are coherent.
 		 */
 		bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000;
-#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 		bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000;
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+		bcm53xx_bounce_dma_ranges[1].dr_len = memsize - 0x1000;
 #endif
 	}
 	KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0);
 	KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
+#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+	KASSERT(bcm53xx_bounce_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);
+#endif
 }
 
 #ifdef MULTIPROCESSOR

Index: src/sys/arch/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.4 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.5
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.4	Thu Feb  7 06:51:49 2013
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Tue Feb 19 02:22:02 2013
@@ -35,7 +35,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.4 2013/02/07 06:51:49 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.5 2013/02/19 02:22:02 matt Exp $");
 
 #include 
 #include 
@@ -281,6 +281,11 @@ bcmeth_ccb_attach(device_t parent, devic
 	 * We need to use the coherent dma tag for the GMAC.
 	 */
 	sc->sc_dmat = &bcm53xx_coherent_dma_tag;
+#if _ARM32_NEED_BUS_DMA_BOUNCE
+	if (device_cfdata(self)->cf_flags & 2) {
+		sc->sc_dmat = &bcm53xx_bounce_dma_tag;
+	}
+#endif
 
 	prop_data_t eaprop = prop_dictionary_get(dict, "mac-address");
 if (eaprop == NULL) {

Index: src/sys/arch/arm/broadcom/bcm53xx_pax.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.2 src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.3
--- src/sys/arch/arm/broadcom/bcm53xx_pax.c:1.7.4.2	Wed Nov 28 22:40:23 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_pax.c	Tue Feb 19 02:22:02 2013
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.2 2012/11/28 22:40:23 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_pax.c,v 1.7.4.3 2013/02/19 02:22:02 matt Exp $");
 
 #include 
 #include 
@@ -199,10 +199,15 @@ bcmpax_ccb_attach(device_t parent, devic
 	struct bcmccb_attach_args * const ccbaa = aux;
 	const struct bcm_locators * const loc = &ccbaa->ccbaa_loc;
 	const char * const xname = device_xname(self);
+	cfdata_t cf = de

CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/string

2013-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 15 22:38:51 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string [matt-nb6-plus]: memcpy.S

Log Message:
#include  to get _ARM_ARCH_DWORD_OK


To generate a diff of this commit:
cvs rdiff -u -r1.1.54.2 -r1.1.54.3 \
src/common/lib/libc/arch/arm/string/memcpy.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/string/memcpy.S
diff -u src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.2 src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.3
--- src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.2	Fri Feb  8 01:41:49 2013
+++ src/common/lib/libc/arch/arm/string/memcpy.S	Fri Feb 15 22:38:51 2013
@@ -1,4 +1,6 @@
-/*	$NetBSD: memcpy.S,v 1.1.54.2 2013/02/08 01:41:49 matt Exp $	*/
+/*	$NetBSD: memcpy.S,v 1.1.54.3 2013/02/15 22:38:51 matt Exp $	*/
+
+#include 
 
 #if !defined(_ARM_ARCH_DWORD_OK) || defined(_STANDALONE)
 #include "memcpy_arm.S"



CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 15 01:02:59 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: bus_dma.c

Log Message:
Actually use the calculated uboundary


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.5 -r1.54.10.6 src/sys/arch/arm/arm32/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54.10.5 src/sys/arch/arm/arm32/bus_dma.c:1.54.10.6
--- src/sys/arch/arm/arm32/bus_dma.c:1.54.10.5	Thu Feb 14 08:24:58 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Fri Feb 15 01:02:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54.10.5 2013/02/14 08:24:58 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.54.10.6 2013/02/15 01:02:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.5 2013/02/14 08:24:58 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.6 2013/02/15 01:02:59 matt Exp $");
 
 #include 
 #include 
@@ -1562,7 +1562,7 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t,
 	/*
 	 * Allocate pages from the VM system.
 	 */
-	error = uvm_pglistalloc(size, low, high, alignment, boundary,
+	error = uvm_pglistalloc(size, low, high, alignment, uboundary,
 	&mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
 	if (error)
 		return (error);



CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 14 08:24:59 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: bus_dma.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.4 -r1.54.10.5 src/sys/arch/arm/arm32/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54.10.4 src/sys/arch/arm/arm32/bus_dma.c:1.54.10.5
--- src/sys/arch/arm/arm32/bus_dma.c:1.54.10.4	Thu Feb 14 08:08:18 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Thu Feb 14 08:24:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54.10.4 2013/02/14 08:08:18 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.54.10.5 2013/02/14 08:24:58 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.4 2013/02/14 08:08:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.5 2013/02/14 08:24:58 matt Exp $");
 
 #include 
 #include 
@@ -763,11 +763,11 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 		const size_t line_size = arm_dcache_align;
 		const size_t line_mask = arm_dcache_align_mask;
 		vsize_t misalignment = va & line_mask;
-		STAT_INCR(sync_preread);
 		if (misalignment) {
 			va -= misalignment;
 			pa -= misalignment;
 			len += misalignment;
+			STAT_INCR(sync_preread_begin);
 			cpu_dcache_wbinv_range(va, line_size);
 			cpu_sdcache_wbinv_range(va, pa, line_size);
 			if (len <= line_size)
@@ -779,12 +779,14 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 		misalignment = len & line_mask;
 		len -= misalignment;
 		if (len > 0) {
+			STAT_INCR(sync_preread);
 			cpu_dcache_inv_range(va, len);
 			cpu_sdcache_inv_range(va, pa, len);
 		}
 		if (misalignment) {
 			va += len;
 			pa += len;
+			STAT_INCR(sync_preread_tail);
 			cpu_dcache_wbinv_range(va, line_size);
 			cpu_sdcache_wbinv_range(va, pa, line_size);
 		}



CVS commit: [matt-nb6-plus] src/sys/arch/arm/conf

2013-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 14 08:09:00 UTC 2013

Modified Files:
src/sys/arch/arm/conf [matt-nb6-plus]: files.arm

Log Message:
Add BUSDMA_COUNTERS option


To generate a diff of this commit:
cvs rdiff -u -r1.103.2.1.2.1 -r1.103.2.1.2.2 src/sys/arch/arm/conf/files.arm

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.103.2.1.2.1 src/sys/arch/arm/conf/files.arm:1.103.2.1.2.2
--- src/sys/arch/arm/conf/files.arm:1.103.2.1.2.1	Wed Nov 28 22:40:25 2012
+++ src/sys/arch/arm/conf/files.arm	Thu Feb 14 08:09:00 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.103.2.1.2.1 2012/11/28 22:40:25 matt Exp $
+#	$NetBSD: files.arm,v 1.103.2.1.2.2 2013/02/14 08:09:00 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -45,7 +45,9 @@ defparam opt_arm_intr_impl.h	ARM_INTR_IM
 defflag	opt_arm_debug.h		ARM_LOCK_CAS_DEBUG
 
 # Board-specific bus_space(9)/bus_dma(9) definitions
-defflag  opt_arm_bus_space.h	__BUS_SPACE_HAS_STREAM_METHODS _ARM32_NEED_BUS_DMA_BOUNCE
+defflag  opt_arm_bus_space.h	__BUS_SPACE_HAS_STREAM_METHODS
+_ARM32_NEED_BUS_DMA_BOUNCE
+BUSDMA_COUNTERS
 
 # Floating point emulator
 defflagARMFPE



CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 14 08:08:18 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: bus_dma.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.3 -r1.54.10.4 src/sys/arch/arm/arm32/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54.10.3 src/sys/arch/arm/arm32/bus_dma.c:1.54.10.4
--- src/sys/arch/arm/arm32/bus_dma.c:1.54.10.3	Thu Feb 14 01:12:53 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Thu Feb 14 08:08:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54.10.3 2013/02/14 01:12:53 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.54.10.4 2013/02/14 08:08:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.3 2013/02/14 01:12:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.4 2013/02/14 08:08:18 matt Exp $");
 
 #include 
 #include 
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 
 
 #include 
 
+#ifdef BUSDMA_COUNTERS
 static struct evcnt bus_dma_creates =
 	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "creates");
 static struct evcnt bus_dma_bounced_creates =
@@ -75,6 +76,22 @@ static struct evcnt bus_dma_bounced_dest
 	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "bounced destroys");
 static struct evcnt bus_dma_destroys =
 	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "destroys");
+static struct evcnt bus_dma_sync_prereadwrite = 
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync prereadwrite");
+static struct evcnt bus_dma_sync_preread_begin =
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync preread begin");
+static struct evcnt bus_dma_sync_preread =
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync preread");
+static struct evcnt bus_dma_sync_preread_tail =
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync preread tail");
+static struct evcnt bus_dma_sync_prewrite = 
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync prewrite");
+static struct evcnt bus_dma_sync_postread = 
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync postread");
+static struct evcnt bus_dma_sync_postreadwrite = 
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync postreadwrite");
+static struct evcnt bus_dma_sync_postwrite = 
+	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "sync postwrite");
 
 EVCNT_ATTACH_STATIC(bus_dma_creates);
 EVCNT_ATTACH_STATIC(bus_dma_bounced_creates);
@@ -86,8 +103,19 @@ EVCNT_ATTACH_STATIC(bus_dma_unloads);
 EVCNT_ATTACH_STATIC(bus_dma_bounced_unloads);
 EVCNT_ATTACH_STATIC(bus_dma_destroys);
 EVCNT_ATTACH_STATIC(bus_dma_bounced_destroys);
+EVCNT_ATTACH_STATIC(bus_dma_sync_prereadwrite);
+EVCNT_ATTACH_STATIC(bus_dma_sync_preread_begin);
+EVCNT_ATTACH_STATIC(bus_dma_sync_preread);
+EVCNT_ATTACH_STATIC(bus_dma_sync_preread_tail);
+EVCNT_ATTACH_STATIC(bus_dma_sync_prewrite);
+EVCNT_ATTACH_STATIC(bus_dma_sync_postread);
+EVCNT_ATTACH_STATIC(bus_dma_sync_postreadwrite);
+EVCNT_ATTACH_STATIC(bus_dma_sync_postwrite);
 
 #define	STAT_INCR(x)	(bus_dma_ ## x.ev_count++)
+#else
+#define	STAT_INCR(x)	/*(bus_dma_ ## x.ev_count++)*/
+#endif
 
 int	_bus_dmamap_load_buffer(bus_dma_tag_t, bus_dmamap_t, void *,
 	bus_size_t, struct vmspace *, int);
@@ -724,6 +752,7 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 	switch (ops) {
 	case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE:
 		if (!readonly_p) {
+			STAT_INCR(sync_prereadwrite);
 			cpu_dcache_wbinv_range(va, len);
 			cpu_sdcache_wbinv_range(va, pa, len);
 			break;
@@ -734,6 +763,7 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 		const size_t line_size = arm_dcache_align;
 		const size_t line_mask = arm_dcache_align_mask;
 		vsize_t misalignment = va & line_mask;
+		STAT_INCR(sync_preread);
 		if (misalignment) {
 			va -= misalignment;
 			pa -= misalignment;
@@ -762,6 +792,7 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 	}
 
 	case BUS_DMASYNC_PREWRITE:
+		STAT_INCR(sync_prewrite);
 		cpu_dcache_wb_range(va, len);
 		cpu_sdcache_wb_range(va, pa, len);
 		break;
@@ -774,7 +805,12 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 	 * have to worry about having to write back their contents.
 	 */
 	case BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE:
+		STAT_INCR(sync_postreadwrite);
+		cpu_dcache_inv_range(va, len);
+		cpu_sdcache_inv_range(va, pa, len);
+		break;
 	case BUS_DMASYNC_POSTREAD:
+		STAT_INCR(sync_postread);
 		cpu_dcache_inv_range(va, len);
 		cpu_sdcache_inv_range(va, pa, len);
 		break;
@@ -975,6 +1011,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	const int post_ops = 0;
 #endif
 	if (!bouncing && pre_ops == 0 && post_ops == BUS_DMASYNC_POSTWRITE) {
+		STAT_INCR(sync_postwrite);
 		return;
 	}
 	KASSERTMSG(bouncing || pre_ops != 0 || (post_

CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-02-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 14 01:12:53 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: bus_dma.c

Log Message:
sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.2 -r1.54.10.3 src/sys/arch/arm/arm32/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54.10.2 src/sys/arch/arm/arm32/bus_dma.c:1.54.10.3
--- src/sys/arch/arm/arm32/bus_dma.c:1.54.10.2	Wed Jan 16 22:44:18 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Thu Feb 14 01:12:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54.10.2 2013/01/16 22:44:18 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.54.10.3 2013/02/14 01:12:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.2 2013/01/16 22:44:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.3 2013/02/14 01:12:53 matt Exp $");
 
 #include 
 #include 
@@ -169,16 +169,17 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 		 * If this region is coherent, mark the segment as coherent.
 		 */
 		_ds_flags |= dr->dr_flags & _BUS_DMAMAP_COHERENT;
-#if 0
-		printf("%p: %#lx: range %#lx/%#lx/%#lx/%#x: %#x\n",
-		t, paddr, dr->dr_sysbase, dr->dr_busbase,
-		dr->dr_len, dr->dr_flags, _ds_flags);
-#endif
+
 		/*
 		 * In a valid DMA range.  Translate the physical
 		 * memory address to an address in the DMA window.
 		 */
 		curaddr = (paddr - dr->dr_sysbase) + dr->dr_busbase;
+#if 0
+		printf("%p: %#lx: range %#lx/%#lx/%#lx/%#x: %#x <-- %#lx\n",
+		t, paddr, dr->dr_sysbase, dr->dr_busbase,
+		dr->dr_len, dr->dr_flags, _ds_flags, curaddr);
+#endif
 	} else
 		curaddr = paddr;
 
@@ -450,7 +451,9 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
 	map->_dm_buftype = _BUS_DMA_BUFTYPE_INVALID;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"dm_maxsegsz %lu _dm_maxmaxsegsz %lu",
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 	if (buflen > map->_dm_size)
 		return (EINVAL);
@@ -517,7 +520,9 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
 	map->_dm_buftype = _BUS_DMA_BUFTYPE_INVALID;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"dm_maxsegsz %lu _dm_maxmaxsegsz %lu",
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 #ifdef DIAGNOSTIC
 	if ((m0->m_flags & M_PKTHDR) == 0)
@@ -639,7 +644,9 @@ _bus_dmamap_load_uio(bus_dma_tag_t t, bu
 	 */
 	map->dm_mapsize = 0;
 	map->dm_nsegs = 0;
-	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
+	KASSERTMSG(map->dm_maxsegsz <= map->_dm_maxmaxsegsz,
+	"dm_maxsegsz %lu _dm_maxmaxsegsz %lu",
+	map->dm_maxsegsz, map->_dm_maxmaxsegsz);
 
 	resid = uio->uio_resid;
 	iov = uio->uio_iov;
@@ -956,7 +963,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 *	POSTWRITE -- Nothing.
 	 */
 #ifdef _ARM32_NEED_BUS_DMA_BOUNCE
-	const bool bouncing = (map->_dm_flags & _BUS_DMA_IS_BOUNCING);
+	const bool bouncing = (map->_dm_flags & _BUS_DMAMAP_IS_BOUNCING);
 #else
 	const bool bouncing = false;
 #endif
@@ -970,7 +977,8 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	if (!bouncing && pre_ops == 0 && post_ops == BUS_DMASYNC_POSTWRITE) {
 		return;
 	}
-
+	KASSERTMSG(bouncing || pre_ops != 0 || (post_ops & BUS_DMASYNC_POSTREAD),
+	"pre_ops %#x post_ops %#x", pre_ops, post_ops);
 #ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 	if (bouncing && (ops & BUS_DMASYNC_PREWRITE)) {
 		struct arm32_bus_dma_cookie * const cookie = map->_dm_cookie;
@@ -1010,7 +1018,8 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	/* Skip cache frobbing if mapping was COHERENT. */
 	if (!bouncing && (map->_dm_flags & _BUS_DMAMAP_COHERENT)) {
 		/* Drain the write buffer. */
-		cpu_drain_writebuf();
+		if (pre_ops & BUS_DMASYNC_PREWRITE)
+			cpu_drain_writebuf();
 		return;
 	}
 
@@ -1132,7 +1141,8 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_s
 	if ((dr = t->_ranges) != NULL) {
 		error = ENOMEM;
 		for (i = 0; i < t->_nranges; i++, dr++) {
-			if (dr->dr_len == 0)
+			if (dr->dr_len == 0
+			|| (dr->dr_flags & _BUS_DMAMAP_NOALLOC))
 continue;
 			error = _bus_dmamem_alloc_range(t, size, alignment,
 			boundary, segs, nsegs, rsegs, flags,
@@ -1213,34 +1223,32 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 	 * avoid having a separate mapping for it.
 	 */
 	if (nsegs == 1) {
-		paddr_t paddr = segs[0].ds_addr;
 		/*
 		 * If this is a non-COHERENT mapping, then the existing kernel
 		 * mapping is already compatible with it.
 		 */
-		if ((flags & BUS_DMA_COHERENT) == 0) {
-#ifdef DEBUG_DMA
-			printf("dmamem_map: =%p\n", *kvap);
-#endif	/* DEBUG_DMA */
-			*kvap = (void *)PMAP_MAP_POOLPAGE(paddr);
-			retur

CVS commit: [matt-nb6-plus] src/sys/arch/evbarm/conf

2013-02-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 13 23:54:05 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf [matt-nb6-plus]: std.bcm53xx

Log Message:
enable bounce buffers


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/sys/arch/evbarm/conf/std.bcm53xx

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/std.bcm53xx
diff -u src/sys/arch/evbarm/conf/std.bcm53xx:1.7.4.2 src/sys/arch/evbarm/conf/std.bcm53xx:1.7.4.3
--- src/sys/arch/evbarm/conf/std.bcm53xx:1.7.4.2	Wed Nov 28 22:50:09 2012
+++ src/sys/arch/evbarm/conf/std.bcm53xx	Wed Feb 13 23:54:04 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: std.bcm53xx,v 1.7.4.2 2012/11/28 22:50:09 matt Exp $
+#	$NetBSD: std.bcm53xx,v 1.7.4.3 2013/02/13 23:54:04 matt Exp $
 #
 # standard NetBSD/evbarm for BEAGLEBAORD options
 
@@ -16,7 +16,7 @@ options 	COM_TOLERANCE=40
 options 	ARM32
 options 	FPU_VFP
 options 	CORTEX_PMC
-#options 	_ARM32_NEED_BUS_DMA_BOUNCE
+options 	_ARM32_NEED_BUS_DMA_BOUNCE
 options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP



CVS commit: [matt-nb6-plus] src/sys

2013-02-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 13 23:52:45 UTC 2013

Modified Files:
src/sys/arch/arm/include [matt-nb6-plus]: bus_defs.h
src/sys/sys [matt-nb6-plus]: bus_proto.h

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.1 -r1.1.10.2 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/sys/bus_proto.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/bus_defs.h
diff -u src/sys/arch/arm/include/bus_defs.h:1.1.10.1 src/sys/arch/arm/include/bus_defs.h:1.1.10.2
--- src/sys/arch/arm/include/bus_defs.h:1.1.10.1	Wed Nov 28 22:40:28 2012
+++ src/sys/arch/arm/include/bus_defs.h	Wed Feb 13 23:52:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.1.10.1 2012/11/28 22:40:28 matt Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.1.10.2 2013/02/13 23:52:45 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -300,7 +300,8 @@ struct bus_space {
  * Private flags stored in the DMA map.
  */
 #define	_BUS_DMAMAP_COHERENT	0x1	/* no cache flush necessary on sync */
-#define	_BUS_DMAMAP_IS_BOUNCING	0x2	/* is bouncing current xfer */
+#define	_BUS_DMAMAP_IS_BOUNCING	0x2 /* is bouncing current xfer */
+#define	_BUS_DMAMAP_NOALLOC	0x4	/* don't alloc memory from this range */
 
 /* Forwards needed by prototypes below. */
 struct mbuf;

Index: src/sys/sys/bus_proto.h
diff -u src/sys/sys/bus_proto.h:1.6 src/sys/sys/bus_proto.h:1.6.10.1
--- src/sys/sys/bus_proto.h:1.6	Wed Aug 17 10:46:38 2011
+++ src/sys/sys/bus_proto.h	Wed Feb 13 23:52:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_proto.h,v 1.6 2011/08/17 10:46:38 martin Exp $	*/
+/*	$NetBSD: bus_proto.h,v 1.6.10.1 2013/02/13 23:52:45 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001, 2007 The NetBSD Foundation, Inc.
@@ -319,6 +319,8 @@ bool	bus_space_handle_is_equal(bus_space
 #define	BUS_DMA_READ		0x100	/* mapping is device -> memory only */
 #define	BUS_DMA_WRITE		0x200	/* mapping is memory -> device only */
 #define	BUS_DMA_NOCACHE		0x400	/* hint: map non-cached memory */
+#define	BUS_DMA_PREFETCHABLE	0x800	/* hint: map non-cached but allow 
+	 * things like write combining */
 
 /* Operations performed by bus_dmamap_sync(). */
 #define	BUS_DMASYNC_PREREAD	0x01	/* pre-read synchronization */



CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2013-02-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 13 23:52:18 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.3 -r1.8.4.4 src/sys/arch/arm/broadcom/bcm53xx_board.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.4
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3	Thu Feb  7 06:51:48 2013
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Wed Feb 13 23:52:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.4 2013/02/13 23:52:18 matt Exp $");
 
 #include 
 #include 
@@ -66,7 +66,7 @@ bus_space_handle_t bcm53xx_armcore_bsh;
 
 static struct cpu_softc cpu_softc;
 
-struct arm32_dma_range bcm53xx_dma_ranges[2] = {
+struct arm32_dma_range bcm53xx_dma_ranges[] = {
 	[0] = {
 		.dr_sysbase = 0x8000,
 		.dr_busbase = 0x8000,
@@ -85,15 +85,17 @@ struct arm32_bus_dma_tag bcm53xx_dma_tag
 	_BUS_DMATAG_FUNCS,
 };
 
-struct arm32_dma_range bcm53xx_coherent_dma_ranges[2] = {
+struct arm32_dma_range bcm53xx_coherent_dma_ranges[] = {
 	[0] = {
 		.dr_sysbase = 0x8000,
 		.dr_busbase = 0x8000,
 		.dr_len = 0x1000,
 		.dr_flags = _BUS_DMAMAP_COHERENT,
+#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 	}, [1] = {
 		.dr_sysbase = 0x9000,
 		.dr_busbase = 0x9000,
+#endif
 	},
 };
 
@@ -521,19 +523,23 @@ bcm53xx_bootstrap(vaddr_t iobase)
 void
 bcm53xx_dma_bootstrap(psize_t memsize)
 {
-	if (memsize > 256*1024*1024) {
+	if (memsize <= 256*1024*1024) {
+		bcm53xx_dma_ranges[0].dr_len = memsize;
+		bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
+		bcm53xx_dma_tag._nranges = 1;
+#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
+		bcm53xx_coherent_dma_tag._nranges = 1;
+#endif
+	} else {
 		/*
 		 * By setting up two ranges, bus_dmamem_alloc will always
 		 * try to allocate from range 0 first resulting in allocations
 		 * below 256MB which for PCI and GMAC are coherent.
 		 */
 		bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000;
+#ifndef _ARM32_NEED_BUS_DMA_BOUNCE
 		bcm53xx_coherent_dma_ranges[1].dr_len = memsize - 0x1000;
-	} else {
-		bcm53xx_dma_ranges[0].dr_len = memsize;
-		bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
-		bcm53xx_dma_tag._nranges = 1;
-		bcm53xx_coherent_dma_tag._nranges = 1;
+#endif
 	}
 	KASSERT(bcm53xx_dma_tag._ranges[0].dr_flags == 0);
 	KASSERT(bcm53xx_coherent_dma_tag._ranges[0].dr_flags == _BUS_DMAMAP_COHERENT);



CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-02-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 13 23:52:03 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: pmap.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.228.2.1.2.2 -r1.228.2.1.2.3 src/sys/arch/arm/arm32/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.2 src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.3
--- src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.2	Thu Feb  7 06:52:53 2013
+++ src/sys/arch/arm/arm32/pmap.c	Wed Feb 13 23:52:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.228.2.1.2.2 2013/02/07 06:52:53 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.228.2.1.2.3 2013/02/13 23:52:02 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.228.2.1.2.2 2013/02/07 06:52:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.228.2.1.2.3 2013/02/13 23:52:02 matt Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -605,14 +605,32 @@ struct pv_entry {
  * Macro to determine if a mapping might be resident in the
  * instruction cache and/or TLB
  */
+#if ARM_MMU_V7 > 0
+/*
+ * Speculative loads by Cortex cores can cause TLB entries to be filled even if
+ * there are no explicit accesses, so there may be always be TLB entries to
+ * flush.  If we used ASIDs then this would not be a problem.
+ */
+#define	PV_BEEN_EXECD(f)  (((f) & PVF_EXEC) == PVF_EXEC)
+#else
 #define	PV_BEEN_EXECD(f)  (((f) & (PVF_REF | PVF_EXEC)) == (PVF_REF | PVF_EXEC))
+#endif
 #define	PV_IS_EXEC_P(f)   (((f) & PVF_EXEC) != 0)
 
 /*
  * Macro to determine if a mapping might be resident in the
  * data cache and/or TLB
  */
+#if ARM_MMU_V7 > 0
+/*
+ * Speculative loads by Cortex cores can cause TLB entries to be filled even if
+ * there are no explicit accesses, so there may be always be TLB entries to
+ * flush.  If we used ASIDs then this would not be a problem.
+ */
+#define	PV_BEEN_REFD(f)   (1)
+#else
 #define	PV_BEEN_REFD(f)   (((f) & PVF_REF) != 0)
+#endif
 
 /*
  * Local prototypes
@@ -726,7 +744,16 @@ pmap_tlb_flushID(pmap_t pm)
 
 	if (pm->pm_cstate.cs_tlb_id) {
 		cpu_tlb_flushID();
+#if ARM_MMU_V7 == 0
+		/*
+		 * Speculative loads by Cortex cores can cause TLB entries to
+		 * be filled even if there are no explicit accesses, so there
+		 * may be always be TLB entries to flush.  If we used ASIDs
+		 * then it would not be a problem.
+		 * This is not true for other CPUs.
+		 */
 		pm->pm_cstate.cs_tlb = 0;
+#endif
 	}
 }
 
@@ -736,7 +763,16 @@ pmap_tlb_flushD(pmap_t pm)
 
 	if (pm->pm_cstate.cs_tlb_d) {
 		cpu_tlb_flushD();
+#if ARM_MMU_V7 == 0
+		/*
+		 * Speculative loads by Cortex cores can cause TLB entries to
+		 * be filled even if there are no explicit accesses, so there
+		 * may be always be TLB entries to flush.  If we used ASIDs
+		 * then it would not be a problem.
+		 * This is not true for other CPUs.
+		 */
 		pm->pm_cstate.cs_tlb_d = 0;
+#endif
 	}
 }
 



CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 02:22:41 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string [matt-nb6-plus]: strchr_arm.S
strrchr_arm.S

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 \
src/common/lib/libc/arch/arm/string/strchr_arm.S
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 \
src/common/lib/libc/arch/arm/string/strrchr_arm.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/string/strchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.2 src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.3
--- src/common/lib/libc/arch/arm/string/strchr_arm.S:1.4.2.2	Thu Feb  7 07:06:00 2013
+++ src/common/lib/libc/arch/arm/string/strchr_arm.S	Fri Feb  8 02:22:41 2013
@@ -29,7 +29,7 @@
 
 #include 
 
-RCSID("$NetBSD: strchr_arm.S,v 1.4.2.2 2013/02/07 07:06:00 matt Exp $")
+RCSID("$NetBSD: strchr_arm.S,v 1.4.2.3 2013/02/08 02:22:41 matt Exp $")
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -90,6 +90,8 @@ ENTRY(strchr)
 	 * We've encountered a NUL or a match but we don't know which happened
 	 * first.
 	 */
+	teq	r2, #0			/* searching for NUL? */
+	beq	.Lfind_match		/*   yes, find the match */
 	mvns	ip, ip			/* did we encounter a NUL? */
 	beq	.Lfind_match		/*   no, find the match */
 	bics	r3, r3, ip		/* clear match for the NUL(s) */

Index: src/common/lib/libc/arch/arm/string/strrchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.2 src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.3
--- src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2.2.2	Thu Feb  7 07:06:02 2013
+++ src/common/lib/libc/arch/arm/string/strrchr_arm.S	Fri Feb  8 02:22:41 2013
@@ -29,7 +29,7 @@
 
 #include 
 
-RCSID("$NetBSD: strrchr_arm.S,v 1.2.2.2 2013/02/07 07:06:02 matt Exp $")
+RCSID("$NetBSD: strrchr_arm.S,v 1.2.2.3 2013/02/08 02:22:41 matt Exp $")
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -47,16 +47,24 @@ RCSID("$NetBSD: strrchr_arm.S,v 1.2.2.2 
 
 	.text
 ENTRY(strrchr)
-	mov	ip, r0			/* we use r0 at the return value */
+	teq	r1, #0			/* searching for NUL? */
+	bne	1f			/*   no, do it the hard way */
+	push	{r0, lr}		/* save pointer and return addr */
+	bl	PLT_SYM(strlen)		/* get length */
+	pop	{r1, lr}		/* restore pointer and returna addr */
+	add	r0, r0, r1		/* add pointer to length */
+	RET/* return */
+
+1:	mov	ip, r0			/* we use r0 at the return value */
 	mov	r0, #0			/* return NULL by default */
 	and	r2, r1, #0xff		/* restrict to byte value */
-1:	tst	ip, #3			/* test for word alignment */
+2:	tst	ip, #3			/* test for word alignment */
 	beq	.Lpre_main_loop		/*   finally word aligned */
 	ldrb	r3, [ip], #1		/* load a byte */
 	cmp	r3, r2			/* did it match? */
 	subeq	r0, ip, #1		/*   yes, remember that it did */
 	teq	r3, #0			/* was it NUL? */
-	bne	1b			/*   no, try next byte */
+	bne	2b			/*   no, try next byte */
 	RET/* return */
 .Lpre_main_loop:
 	push	{r4, r5}		/* save some registers */



CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/string

2013-02-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb  8 01:41:49 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string [matt-nb6-plus]: memcpy.S

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1.54.1 -r1.1.54.2 \
src/common/lib/libc/arch/arm/string/memcpy.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/string/memcpy.S
diff -u src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.1 src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.2
--- src/common/lib/libc/arch/arm/string/memcpy.S:1.1.54.1	Thu Feb  7 07:05:59 2013
+++ src/common/lib/libc/arch/arm/string/memcpy.S	Fri Feb  8 01:41:49 2013
@@ -1,6 +1,6 @@
-/*	$NetBSD: memcpy.S,v 1.1.54.1 2013/02/07 07:05:59 matt Exp $	*/
+/*	$NetBSD: memcpy.S,v 1.1.54.2 2013/02/08 01:41:49 matt Exp $	*/
 
-#if !defined(_ARM_ARCH_DWORK_OK) || defined(_STANDALONE)
+#if !defined(_ARM_ARCH_DWORD_OK) || defined(_STANDALONE)
 #include "memcpy_arm.S"
 #else
 #include "memcpy_xscale.S"



CVS commit: [matt-nb6-plus] src/lib/libc/arch/arm/string

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 07:06:28 UTC 2013

Added Files:
src/lib/libc/arch/arm/string [matt-nb6-plus]: strncat_naive.S

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.2 src/lib/libc/arch/arm/string/strncat_naive.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/lib/libc/arch/arm/string/strncat_naive.S
diff -u /dev/null src/lib/libc/arch/arm/string/strncat_naive.S:1.1.2.2
--- /dev/null	Thu Feb  7 07:06:28 2013
+++ src/lib/libc/arch/arm/string/strncat_naive.S	Thu Feb  7 07:06:28 2013
@@ -0,0 +1,53 @@
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+RCSID("$NetBSD: strncat_naive.S,v 1.1.2.2 2013/02/07 07:06:28 matt Exp $")
+
+/* LINTSTUB: char *strncat(char *, const char *, size_t) */
+ENTRY(strncat)
+	teq	r2, #0			/* count is 0? */
+	RETc(eq)			/*   yes, just return dst */
+	mov	ip, r0			/* need to preserve r0 */
+1:	ldrb	r3, [ip], #1		/* load next byte */
+	teq	r3, #0			/* was it a NUL? */
+	bne	1b			/*   no, get next byte */
+	sub	ip, ip, #1		/* back up one to the NUL */
+2:	subs	r2, r2, #1		/* subtract 1 from the count */
+	blt	3f			/*   <0? write terminating NUL */
+	ldrb	r3, [r1], #1		/* load next byte from append */
+	strb	r3, [ip], #1		/* store it */
+	teq	r3, #0			/* was it a NUL? */
+	bne	2b			/*   no, get next byte */
+	RET/* return */
+3:	mov	r3, #0			/* load a NUL */
+	strb	r3, [ip]		/* store it */
+	RET/* return */
+END(strncat)



CVS commit: [matt-nb6-plus] src/sys/arch/evbarm/conf

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 07:04:44 UTC 2013

Modified Files:
src/sys/arch/evbarm/conf [matt-nb6-plus]: BCM5301X

Log Message:
Disable UVMHIST


To generate a diff of this commit:
cvs rdiff -u -r1.9.4.2 -r1.9.4.3 src/sys/arch/evbarm/conf/BCM5301X

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/BCM5301X
diff -u src/sys/arch/evbarm/conf/BCM5301X:1.9.4.2 src/sys/arch/evbarm/conf/BCM5301X:1.9.4.3
--- src/sys/arch/evbarm/conf/BCM5301X:1.9.4.2	Wed Nov 28 22:50:05 2012
+++ src/sys/arch/evbarm/conf/BCM5301X	Thu Feb  7 07:04:44 2013
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BCM5301X,v 1.9.4.2 2012/11/28 22:50:05 matt Exp $
+#	$NetBSD: BCM5301X,v 1.9.4.3 2013/02/07 07:04:44 matt Exp $
 #
 #	BCM5301X -- Broadcom BCM5301X Eval Board Kernel
 #
@@ -18,7 +18,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 # CPU options
 
 #makeoptions	DEFCOPTS="-O0"
-options 	UVMHIST
+#options 	UVMHIST
 #options 	UVMHIST_PRINT,A9WDT_PERIOD_DEFAULT=30
 options 	BCM53XX_CONSOLE_EARLY
 #options 	MULTIPROCESSOR



CVS commit: [matt-nb6-plus] src/sys/lib/libkern

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 07:03:28 UTC 2013

Modified Files:
src/sys/lib/libkern [matt-nb6-plus]: Makefile.libkern

Log Message:
Pullup rev 1.19:
date: 2013/01/23 22:34:37;  author: matt;  state: Exp;  lines: +2 -2
Add strnlen.c to SRCS (which will automatically use the .S version if it
exists).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/lib/libkern/Makefile.libkern

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/Makefile.libkern
diff -u src/sys/lib/libkern/Makefile.libkern:1.17 src/sys/lib/libkern/Makefile.libkern:1.17.4.1
--- src/sys/lib/libkern/Makefile.libkern:1.17	Sun Feb  5 14:19:03 2012
+++ src/sys/lib/libkern/Makefile.libkern	Thu Feb  7 07:03:28 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.libkern,v 1.17 2012/02/05 14:19:03 dholland Exp $
+#	$NetBSD: Makefile.libkern,v 1.17.4.1 2013/02/07 07:03:28 matt Exp $
 
 # 
 # Variable definitions for libkern.  
@@ -84,7 +84,7 @@ SRCS+=	random.c
 SRCS+=	rngtest.c
 
 SRCS+=	memchr.c
-SRCS+=	strcat.c strcmp.c strcpy.c strlen.c
+SRCS+=	strcat.c strcmp.c strcpy.c strlen.c strnlen.c
 SRCS+=	strncmp.c strncpy.c
 SRCS+=	strcasecmp.c strncasecmp.c
 



CVS commit: [matt-nb6-plus] src/sys/sys

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 06:58:40 UTC 2013

Modified Files:
src/sys/sys [matt-nb6-plus]: cdefs.h

Log Message:
Pull rev 1.104 from HEAD:
Don't define __BIT/__BITS if __ASSEMBLER__ is defined.
(since they use C syntax they won't work anyways).


To generate a diff of this commit:
cvs rdiff -u -r1.89.6.2 -r1.89.6.2.2.1 src/sys/sys/cdefs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.89.6.2 src/sys/sys/cdefs.h:1.89.6.2.2.1
--- src/sys/sys/cdefs.h:1.89.6.2	Sun Jun 24 15:44:07 2012
+++ src/sys/sys/cdefs.h	Thu Feb  7 06:58:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.89.6.2 2012/06/24 15:44:07 jdc Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.89.6.2.2.1 2013/02/07 06:58:40 matt Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -499,6 +499,7 @@
  */
 #define	__arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
 
+#ifndef __ASSEMBLER__
 /* __BIT(n): nth bit, where __BIT(0) == 0x1. */
 #define	__BIT(__n)	\
 (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : ((uintmax_t)1 << (uintmax_t)(__n)))
@@ -506,6 +507,7 @@
 /* __BITS(m, n): bits m through n, m < n. */
 #define	__BITS(__m, __n)	\
 	((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1))
+#endif /* !__ASSEMBLER__ */
 
 /* find least significant bit that is set */
 #define	__LOWEST_SET_BIT(__mask) __mask) - 1) & (__mask)) ^ (__mask))



CVS commit: [matt-nb6-plus] src/sys/arch/arm/cortex

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 06:55:01 UTC 2013

Modified Files:
src/sys/arch/arm/cortex [matt-nb6-plus]: pl310.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/sys/arch/arm/cortex/pl310.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/pl310.c
diff -u src/sys/arch/arm/cortex/pl310.c:1.8.2.2 src/sys/arch/arm/cortex/pl310.c:1.8.2.3
--- src/sys/arch/arm/cortex/pl310.c:1.8.2.2	Wed Nov 28 22:40:27 2012
+++ src/sys/arch/arm/cortex/pl310.c	Thu Feb  7 06:55:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pl310.c,v 1.8.2.2 2012/11/28 22:40:27 matt Exp $	*/
+/*	$NetBSD: pl310.c,v 1.8.2.3 2013/02/07 06:55:01 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.8.2.2 2012/11/28 22:40:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl310.c,v 1.8.2.3 2013/02/07 06:55:01 matt Exp $");
 
 #include 
 #include 
@@ -195,11 +195,14 @@ arml2cc_attach(device_t parent, device_t
 }
 
 static inline void
-arml2cc_cache_op(struct arml2cc_softc *sc, bus_size_t off, uint32_t val)
+arml2cc_cache_op(struct arml2cc_softc *sc, bus_size_t off, uint32_t val,
+bool wait)
 {
 	arml2cc_write_4(sc, off, val);
-	while (arml2cc_read_4(sc, off) & 1) {
-		/* spin */
+	if (wait) {
+		while (arml2cc_read_4(sc, off) & 1) {
+			/* spin */
+		}
 	}
 }
 
@@ -215,7 +218,7 @@ arml2cc_cache_way_op(struct arml2cc_soft
 static inline void
 arml2cc_cache_sync(struct arml2cc_softc *sc)
 {
-	arml2cc_cache_op(sc, L2C_CACHE_SYNC, 0);
+	arml2cc_cache_op(sc, L2C_CACHE_SYNC, 0, true);
 }
 
 static inline void
@@ -284,20 +287,16 @@ arml2cc_cache_range_op(paddr_t pa, psize
 		pa -= off;
 	}
 	len = roundup2(len, line_size);
-	off = pa & PAGE_MASK;
-	for (const paddr_t endpa = pa + len; pa < endpa; off = 0) {
-		psize_t seglen = min(len, PAGE_SIZE - off);
-
-		mutex_spin_enter(&sc->sc_lock);
-		if (!sc->sc_enabled) {
-			mutex_spin_exit(&sc->sc_lock);
-			return;
-		}
-		for (paddr_t segend = pa + seglen; pa < segend; pa += line_size) {
-			arml2cc_cache_op(sc, cache_op, pa);
-		}
+	mutex_spin_enter(&sc->sc_lock);
+	if (__predict_false(!sc->sc_enabled)) {
 		mutex_spin_exit(&sc->sc_lock);
+		return;
+	}
+	for (const paddr_t endpa = pa + len; pa < endpa; pa += line_size) {
+		arml2cc_cache_op(sc, cache_op, pa, false);
 	}
+	arml2cc_cache_sync(sc);
+	mutex_spin_exit(&sc->sc_lock);
 }
 
 static void



CVS commit: [matt-nb6-plus] src/sys/arch/arm

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 06:52:54 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: pmap.c
src/sys/arch/arm/include/arm32 [matt-nb6-plus]: pmap.h

Log Message:
pullup pmap changes from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.228.2.1.2.1 -r1.228.2.1.2.2 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.101.4.1 -r1.101.4.2 src/sys/arch/arm/include/arm32/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.1 src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.2
--- src/sys/arch/arm/arm32/pmap.c:1.228.2.1.2.1	Wed Nov 28 22:40:19 2012
+++ src/sys/arch/arm/arm32/pmap.c	Thu Feb  7 06:52:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.228.2.1.2.1 2012/11/28 22:40:19 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.228.2.1.2.2 2013/02/07 06:52:53 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.228.2.1.2.1 2012/11/28 22:40:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.228.2.1.2.2 2013/02/07 06:52:53 matt Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -668,12 +668,6 @@ static vaddr_t		kernel_pt_lookup(paddr_t
 
 
 /*
- * External function prototypes
- */
-extern void bzero_page(vaddr_t);
-extern void bcopy_page(vaddr_t, vaddr_t);
-
-/*
  * Misc variables
  */
 vaddr_t virtual_avail;
@@ -699,6 +693,12 @@ pmap_debug(int level)
 }
 #endif	/* PMAP_DEBUG */
 
+#ifdef PMAP_CACHE_VIPT
+#define PMAP_VALIDATE_MD_PAGE(md)	\
+	KASSERTMSG(arm_cache_prefer_mask == 0 || (((md)->pvh_attrs & PVF_WRITE) == 0) == ((md)->urw_mappings + (md)->krw_mappings == 0), \
+	"(md) %p: attrs=%#x urw=%u krw=%u", (md), \
+	(md)->pvh_attrs, (md)->urw_mappings, (md)->krw_mappings);
+#endif /* PMAP_CACHE_VIPT */
 /*
  * A bunch of routines to conditionally flush the caches/TLB depending
  * on whether the specified pmap actually needs to be flushed at any
@@ -829,10 +829,10 @@ do {	\
 /*
  * main pv_entry manipulation functions:
  *   pmap_enter_pv: enter a mapping onto a vm_page list
- *   pmap_remove_pv: remove a mappiing from a vm_page list
+ *   pmap_remove_pv: remove a mapping from a vm_page list
  *
  * NOTE: pmap_enter_pv expects to lock the pvh itself
- *   pmap_remove_pv expects te caller to lock the pvh before calling
+ *   pmap_remove_pv expects the caller to lock the pvh before calling
  */
 
 /*
@@ -896,6 +896,13 @@ pmap_enter_pv(struct vm_page_md *md, pad
 
 #ifdef PMAP_CACHE_VIPT
 	/*
+	 * Even though pmap_vac_me_harder will set PVF_WRITE for us,
+	 * do it here as well to keep the mappings & KVF_WRITE consistent.
+	 */
+	if (arm_cache_prefer_mask != 0 && (flags & PVF_WRITE) != 0) {
+		md->pvh_attrs |= PVF_WRITE;
+	}
+	/*
 	 * If this is an exec mapping and its the first exec mapping
 	 * for this page, make sure to sync the I-cache.
 	 */
@@ -1014,8 +1021,11 @@ pmap_remove_pv(struct vm_page_md *md, pa
 	 * mappings (ignoring KMPAGE), clear the WRITE flag and writeback
 	 * the contents to memory.
 	 */
-	if (md->krw_mappings + md->urw_mappings == 0)
-		md->pvh_attrs &= ~PVF_WRITE;
+	if (arm_cache_prefer_mask != 0) {
+		if (md->krw_mappings + md->urw_mappings == 0)
+			md->pvh_attrs &= ~PVF_WRITE;
+		PMAP_VALIDATE_MD_PAGE(md);
+	}
 	KASSERT((md->pvh_attrs & PVF_DMOD) == 0 || (md->pvh_attrs & (PVF_DIRTY|PVF_NC)));
 #endif /* PMAP_CACHE_VIPT */
 
@@ -1093,8 +1103,13 @@ pmap_modify_pv(struct vm_page_md *md, pa
 		}
 	}
 #ifdef PMAP_CACHE_VIPT
-	if (md->urw_mappings + md->krw_mappings == 0)
-		md->pvh_attrs &= ~PVF_WRITE;
+	if (arm_cache_prefer_mask != 0) {
+		if (md->urw_mappings + md->krw_mappings == 0) {
+			md->pvh_attrs &= ~PVF_WRITE;
+		} else {
+			md->pvh_attrs |= PVF_WRITE;
+		}
+	}
 	/*
 	 * We have two cases here: the first is from enter_pv (new exec
 	 * page), the second is a combined pmap_remove_pv/pmap_enter_pv.
@@ -1850,7 +1865,7 @@ pmap_vac_me_harder(struct vm_page_md *md
 		 * Only check for a bad alias if we have writable mappings.
 		 */
 		tst_mask &= arm_cache_prefer_mask;
-		if (rw_mappings > 0 && arm_cache_prefer_mask) {
+		if (rw_mappings > 0) {
 			for (; pv && !bad_alias; pv = SLIST_NEXT(pv, pv_link)) {
 /* if there's a bad alias, stop checking. */
 if (tst_mask != (pv->pv_va & arm_cache_prefer_mask))
@@ -1906,7 +1921,7 @@ pmap_vac_me_harder(struct vm_page_md *md
 		KASSERT((md->pvh_attrs & PVF_DMOD) == 0 || (md->pvh_attrs & (PVF_DIRTY|PVF_NC)));
 		KASSERT((rw_mappings == 0) == !(md->pvh_attrs & PVF_WRITE));
 	} else if (!va) {
-		KASSERT(arm_cache_prefer_mask == 0 || pmap_is_page_colored_p(md));
+		KASSERT(pmap_is_page_colored_p(md));
 		KASSERT(!(md->pvh_attrs & PVF_WRITE)
 		|| (md->pvh_attrs & PVF_DIRTY));
 		if (rw_mappings == 0) {
@@ -2230,8 +2245,13 @@ pmap_clearbit(struct vm_page_md *md, pad
 	md->uro_mappings++;
 }
 #ifdef PMAP_CACHE_V

CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 06:51:50 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_board.c
bcm53xx_eth.c bcm53xx_idm.c bcm53xx_reg.h bcm53xx_rng.c

Log Message:
Sync bcm53xx support to HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.2 -r1.8.4.3 src/sys/arch/arm/broadcom/bcm53xx_board.c
cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/bcm53xx_idm.c
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/sys/arch/arm/broadcom/bcm53xx_reg.h
cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/sys/arch/arm/broadcom/bcm53xx_rng.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.2 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.3
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.8.4.2	Wed Nov 28 22:40:21 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Thu Feb  7 06:51:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.8.4.2 2012/11/28 22:40:21 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.2 2012/11/28 22:40:21 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.8.4.3 2013/02/07 06:51:48 matt Exp $");
 
 #include 
 #include 
@@ -65,7 +65,6 @@ bus_space_tag_t bcm53xx_armcore_bst = &b
 bus_space_handle_t bcm53xx_armcore_bsh;
 
 static struct cpu_softc cpu_softc;
-static struct bcm53xx_clock_info clk_info;
 
 struct arm32_dma_range bcm53xx_dma_ranges[2] = {
 	[0] = {
@@ -450,23 +449,24 @@ void
 bcm53xx_print_clocks(void)
 {
 #if defined(VERBOSE_ARM_INIT)
-	printf("ref clk =	%u (%#x)\n", clk_info.clk_ref, clk_info.clk_ref);
-	printf("sys clk =	%u (%#x)\n", clk_info.clk_sys, clk_info.clk_sys);
-	printf("lcpll clk =	%u (%#x)\n", clk_info.clk_lcpll, clk_info.clk_lcpll);
-	printf("pcie ref clk =	%u (%#x) [CH0]\n", clk_info.clk_pcie_ref, clk_info.clk_pcie_ref);
-	printf("sdio clk =	%u (%#x) [CH1]\n", clk_info.clk_sdio, clk_info.clk_sdio);
-	printf("ddr ref clk =	%u (%#x) [CH2]\n", clk_info.clk_ddr_ref, clk_info.clk_ddr_ref);
-	printf("axi clk =	%u (%#x) [CH3]\n", clk_info.clk_axi, clk_info.clk_axi);
-	printf("genpll clk =	%u (%#x)\n", clk_info.clk_genpll, clk_info.clk_genpll);
-	printf("mac clk =	%u (%#x) [CH0]\n", clk_info.clk_mac, clk_info.clk_mac);
-	printf("robo clk =	%u (%#x) [CH1]\n", clk_info.clk_robo, clk_info.clk_robo);
-	printf("usb2 clk =	%u (%#x) [CH2]\n", clk_info.clk_usb2, clk_info.clk_usb2);
-	printf("iproc clk =	%u (%#x) [CH3]\n", clk_info.clk_iproc, clk_info.clk_iproc);
-	printf("ddr clk =	%u (%#x)\n", clk_info.clk_ddr, clk_info.clk_ddr);
-	printf("ddr mhz =	%u (%#x)\n", clk_info.clk_ddr_mhz, clk_info.clk_ddr_mhz);
-	printf("cpu clk =	%u (%#x)\n", clk_info.clk_cpu, clk_info.clk_cpu);
-	printf("apb clk =	%u (%#x)\n", clk_info.clk_apb, clk_info.clk_apb);
-	printf("usb ref clk =	%u (%#x)\n", clk_info.clk_usb_ref, clk_info.clk_usb_ref);
+	const struct bcm53xx_clock_info * const clk = &cpu_softc.cpu_clk;
+	printf("ref clk =	%u (%#x)\n", clk->clk_ref, clk->clk_ref);
+	printf("sys clk =	%u (%#x)\n", clk->clk_sys, clk->clk_sys);
+	printf("lcpll clk =	%u (%#x)\n", clk->clk_lcpll, clk->clk_lcpll);
+	printf("pcie ref clk =	%u (%#x) [CH0]\n", clk->clk_pcie_ref, clk->clk_pcie_ref);
+	printf("sdio clk =	%u (%#x) [CH1]\n", clk->clk_sdio, clk->clk_sdio);
+	printf("ddr ref clk =	%u (%#x) [CH2]\n", clk->clk_ddr_ref, clk->clk_ddr_ref);
+	printf("axi clk =	%u (%#x) [CH3]\n", clk->clk_axi, clk->clk_axi);
+	printf("genpll clk =	%u (%#x)\n", clk->clk_genpll, clk->clk_genpll);
+	printf("mac clk =	%u (%#x) [CH0]\n", clk->clk_mac, clk->clk_mac);
+	printf("robo clk =	%u (%#x) [CH1]\n", clk->clk_robo, clk->clk_robo);
+	printf("usb2 clk =	%u (%#x) [CH2]\n", clk->clk_usb2, clk->clk_usb2);
+	printf("iproc clk =	%u (%#x) [CH3]\n", clk->clk_iproc, clk->clk_iproc);
+	printf("ddr clk =	%u (%#x)\n", clk->clk_ddr, clk->clk_ddr);
+	printf("ddr mhz =	%u (%#x)\n", clk->clk_ddr_mhz, clk->clk_ddr_mhz);
+	printf("cpu clk =	%u (%#x)\n", clk->clk_cpu, clk->clk_cpu);
+	printf("apb clk =	%u (%#x)\n", clk->clk_apb, clk->clk_apb);
+	printf("usb ref clk =	%u (%#x)\n", clk->clk_usb_ref, clk->clk_usb_ref);
 #endif
 }
 
@@ -500,7 +500,7 @@ bcm53xx_bootstrap(vaddr_t iobase)
 	bcm53xx_get_chip_ioreg_state(&bcs, bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh);
 	bcm53xx_get_chip_armcore_state(&bcs, bcm53xx_armcore_bst, bcm53xx_armcore_bsh);
 
-	struct bcm53xx_clock_info * const clk = &clk_info;
+	struct bcm53xx_clock_info * const clk = &cpu_softc.cpu_clk;
 
 	bcm53xx_clock_init(clk);
 	bcm53xx_lcpll_clock_init(clk, bcs.bcs_lcpll_control1,
@@ -575,7 +575,7 @@ bcm53xx_device_register(device_t self, v
 		 * to ti

CVS commit: [matt-nb6-plus] src/gnu/dist/binutils/gas/config

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 01:42:09 UTC 2013

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb6-plus]: tc-arm.c

Log Message:
Add support for push/pop register list.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.6 -r1.6.6.7 src/gnu/dist/binutils/gas/config/tc-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.6 src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.7
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.6	Thu Feb  7 01:18:07 2013
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Thu Feb  7 01:42:08 2013
@@ -6651,25 +6651,35 @@ do_ldmstm (char * str)
 
   skip_whitespace (str);
 
-  if ((base_reg = reg_required_here (&str, 16)) == FAIL)
-return;
-
-  if (base_reg == REG_PC)
+  base_reg = (inst.instruction >> 16) & 0xf;
+  if (base_reg == 0)
 {
-  inst.error = _("r15 not allowed as base register");
-  return;
-}
+  if ((base_reg = reg_required_here (&str, 16)) == FAIL)
+	return;
 
-  skip_whitespace (str);
+  if (base_reg == REG_PC)
+	{
+	  inst.error = _("r15 not allowed as base register");
+	  return;
+	}
 
-  if (*str == '!')
-{
-  inst.instruction |= WRITE_BACK;
-  str++;
+  skip_whitespace (str);
+
+  if (*str == '!')
+	{
+	  inst.instruction |= WRITE_BACK;
+	  str++;
+	}
+
+  if (skip_past_comma (&str) == FAIL)
+	{
+	  if (! inst.error)
+	inst.error = BAD_ARGS;
+	  return;
+	}
 }
 
-  if (skip_past_comma (&str) == FAIL
-  || (range = reg_list (&str)) == FAIL)
+  if ((range = reg_list (&str)) == FAIL)
 {
   if (! inst.error)
 	inst.error = BAD_ARGS;
@@ -9995,11 +10005,13 @@ static const struct asm_opcode insns[] =
   {"stmda",  0xe800, 3,  ARM_EXT_V1,   do_ldmstm},
   {"stmdb",  0xe900, 3,  ARM_EXT_V1,   do_ldmstm},
   {"stmfd",  0xe900, 3,  ARM_EXT_V1,   do_ldmstm},
+  {"push",	 0xe92d, 4,  ARM_EXT_V1,   do_ldmstm},
   {"stmfa",  0xe980, 3,  ARM_EXT_V1,   do_ldmstm},
   {"stmea",  0xe880, 3,  ARM_EXT_V1,   do_ldmstm},
   {"stmed",  0xe800, 3,  ARM_EXT_V1,   do_ldmstm},
 
   {"ldmia",  0xe890, 3,  ARM_EXT_V1,   do_ldmstm},
+  {"pop",	 0xe8bd, 3,  ARM_EXT_V1,   do_ldmstm},
   {"ldmib",  0xe990, 3,  ARM_EXT_V1,   do_ldmstm},
   {"ldmda",  0xe810, 3,  ARM_EXT_V1,   do_ldmstm},
   {"ldmdb",  0xe910, 3,  ARM_EXT_V1,   do_ldmstm},



CVS commit: [matt-nb6-plus] src/gnu/dist/binutils/gas/config

2013-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb  7 01:18:09 UTC 2013

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb6-plus]: tc-arm.c

Log Message:
Support the movt instruction


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.5 -r1.6.6.6 src/gnu/dist/binutils/gas/config/tc-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.5 src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.6
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.5	Mon Dec 24 22:16:18 2012
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Thu Feb  7 01:18:07 2013
@@ -6757,7 +6757,7 @@ do_dsb (char * str)
 }
 
 static void
-do_movw (char * str)
+do_movwt (char * str)
 {
   expressionS expr;
   int reg;
@@ -6791,7 +6791,7 @@ do_movw (char * str)
   return;
 }
 
-  if ((expr.X_add_number >> 16) != 0)
+  if ((expr.X_add_number & 0x) != 0)
 {
   inst.error = _("invalid unsigned 16-bit value");
   return;
@@ -10245,7 +10245,8 @@ static const struct asm_opcode insns[] =
   { "dmb",   0xf57ff05f, 0,  ARM_EXT_V7A,  do_dsb},
   { "dsb",   0xf57ff04f, 0,  ARM_EXT_V7A,  do_dsb},
   { "isb",   0xf57ff06f, 0,  ARM_EXT_V7A,  do_dsb},
-  { "movw",	 0xe300, 2,  ARM_EXT_V7A,  do_movw},
+  { "movw",	 0xe300, 2,  ARM_EXT_V7A,  do_movwt},
+  { "movt",	 0xe340, 2,  ARM_EXT_V7A,  do_movwt},
   { "sbfx",  0xe7a00050, 4,  ARM_EXT_V7A,  do_bfx},
   { "ubfx",  0xe7e00050, 4,  ARM_EXT_V7A,  do_bfx},
 



CVS commit: [matt-nb6-plus] src/lib/csu/common

2013-01-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 16:56:14 UTC 2013

Modified Files:
src/lib/csu/common [matt-nb6-plus]: crt0-common.c

Log Message:
Use __weakref_visible


To generate a diff of this commit:
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/lib/csu/common/crt0-common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/common/crt0-common.c
diff -u src/lib/csu/common/crt0-common.c:1.7.6.1 src/lib/csu/common/crt0-common.c:1.7.6.2
--- src/lib/csu/common/crt0-common.c:1.7.6.1	Tue Jan 22 22:56:58 2013
+++ src/lib/csu/common/crt0-common.c	Mon Jan 28 16:56:14 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.7.6.1 2013/01/22 22:56:58 matt Exp $ */
+/* $NetBSD: crt0-common.c,v 1.7.6.2 2013/01/28 16:56:14 matt Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: crt0-common.c,v 1.7.6.1 2013/01/22 22:56:58 matt Exp $");
+__RCSID("$NetBSD: crt0-common.c,v 1.7.6.2 2013/01/28 16:56:14 matt Exp $");
 
 #include 
 #include 
@@ -95,10 +95,14 @@ do {		\
  * Since we don't need .init or .fini sections, just code them in C
  * to make life easier.
  */
-extern const fptr_t init_array_start[] __weak_reference(__init_array_start);
-extern const fptr_t init_array_end[] __weak_reference(__init_array_end);
-extern const fptr_t fini_array_start[] __weak_reference(__fini_array_start);
-extern const fptr_t fini_array_end[] __weak_reference(__fini_array_end);
+__weakref_visible const fptr_t init_array_start[1]
+__weak_reference(__init_array_start);
+__weakref_visible const fptr_t init_array_end[1]
+__weak_reference(__init_array_end);
+__weakref_visible const fptr_t fini_array_start[1]
+__weak_reference(__fini_array_start);
+__weakref_visible const fptr_t fini_array_end[1]
+__weak_reference(__fini_array_end);
 
 static inline void
 _init(void)



CVS commit: [matt-nb6-plus] src/gnu/dist/gcc4/gcc/config/arm

2013-01-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 25 08:50:06 UTC 2013

Modified Files:
src/gnu/dist/gcc4/gcc/config/arm [matt-nb6-plus]: arm.h

Log Message:
Pullup from HEAD:
Make GCC define __ARM_PCS and __ARM_PCS_VFP as defined by the ARM C Language
Extentions (clang already defines them):
__ARM_PCS is defined to 1 if the default procedure calling standard for
the translation unit conforms to the "base PCS" defined in [AAPCS].
__ARM_PCS_VFP is defined to 1 if the default is to pass floating-point
parameters in hardware floating-point registers using the "VFP variant PCS"
defined in [AAPCS].


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.46.1 src/gnu/dist/gcc4/gcc/config/arm/arm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/gcc4/gcc/config/arm/arm.h
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1 src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1.46.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1	Thu Apr 20 09:50:52 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/arm.h	Fri Jan 25 08:50:06 2013
@@ -77,7 +77,12 @@ extern char arm_arch_name[];
 	if (arm_arch_iwmmxt)\
 	  builtin_define ("__IWMMXT__");		\
 	if (TARGET_AAPCS_BASED)\
-	  builtin_define ("__ARM_EABI__");		\
+	  {		\
+	builtin_define ("__ARM_EABI__");		\
+	builtin_define ("__ARM_PCS");		\
+	if (TARGET_HARD_FLOAT && TARGET_VFP)	\
+	  builtin_define ("__ARM_PCS_VFP");		\
+	  }		\
 } while (0)
 
 /* The various ARM cores.  */



CVS commit: [matt-nb6-plus] src/libexec/ld.elf_so/arch/arm

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 23 02:15:53 UTC 2013

Modified Files:
src/libexec/ld.elf_so/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
Handle CPUFLAGS being empty


To generate a diff of this commit:
cvs rdiff -u -r1.11.46.1 -r1.11.46.2 \
src/libexec/ld.elf_so/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/arch/arm/Makefile.inc
diff -u src/libexec/ld.elf_so/arch/arm/Makefile.inc:1.11.46.1 src/libexec/ld.elf_so/arch/arm/Makefile.inc:1.11.46.2
--- src/libexec/ld.elf_so/arch/arm/Makefile.inc:1.11.46.1	Tue Jan 22 21:47:28 2013
+++ src/libexec/ld.elf_so/arch/arm/Makefile.inc	Wed Jan 23 02:15:53 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11.46.1 2013/01/22 21:47:28 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.11.46.2 2013/01/23 02:15:53 matt Exp $
 
 SRCS+=		rtld_start.S mdreloc.c
 
@@ -6,7 +6,8 @@ SRCS+=		rtld_start.S mdreloc.c
 CPPFLAGS+=	-fpic
 
 CPPFLAGS+=	-DELFSIZE=32
-.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb"
+.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb" \
+|| (!empty(CPUFLAGS) && ${CPUFLAGS:M-mabi=aapcs*} != "")
 CPPFLAGS+=	-DHAVE_INITFINI_ARRAY
 .endif
 



CVS commit: [matt-nb6-plus] src/lib/csu/arch/arm

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 23 02:14:54 UTC 2013

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
Handle CPUFLAGS being empty


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.2 -r1.1.10.3 src/lib/csu/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/arch/arm/Makefile.inc
diff -u src/lib/csu/arch/arm/Makefile.inc:1.1.10.2 src/lib/csu/arch/arm/Makefile.inc:1.1.10.3
--- src/lib/csu/arch/arm/Makefile.inc:1.1.10.2	Tue Jan 22 22:56:35 2013
+++ src/lib/csu/arch/arm/Makefile.inc	Wed Jan 23 02:14:54 2013
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.1.10.2 2013/01/22 22:56:35 matt Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.3 2013/01/23 02:14:54 matt Exp $
 
 CPPFLAGS+=	-DELFSIZE=32
 .if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb" \
-|| ${CPUFLAGS:M-mabi=aapcs*} != ""
+|| (!empty(CPUFLAGS) && ${CPUFLAGS:M-mabi=aapcs*} != "")
 CPPFLAGS+=  -DHAVE_INITFINI_ARRAY
 .endif



CVS commit: [matt-nb6-plus] src/lib/csu/common

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 22 22:56:58 UTC 2013

Modified Files:
src/lib/csu/common [matt-nb6-plus]: crt0-common.c

Log Message:
Pullup from HEAD:
Add support for init_array/fini_array (conditionalized on HAVE_INITFINI_ARRAY).
[This is needed for ARM EABI.]


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.6.1 src/lib/csu/common/crt0-common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/common/crt0-common.c
diff -u src/lib/csu/common/crt0-common.c:1.7 src/lib/csu/common/crt0-common.c:1.7.6.1
--- src/lib/csu/common/crt0-common.c:1.7	Thu Jun 30 20:07:35 2011
+++ src/lib/csu/common/crt0-common.c	Tue Jan 22 22:56:58 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.7 2011/06/30 20:07:35 matt Exp $ */
+/* $NetBSD: crt0-common.c,v 1.7.6.1 2013/01/22 22:56:58 matt Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: crt0-common.c,v 1.7 2011/06/30 20:07:35 matt Exp $");
+__RCSID("$NetBSD: crt0-common.c,v 1.7.6.1 2013/01/22 22:56:58 matt Exp $");
 
 #include 
 #include 
@@ -49,8 +49,10 @@ __RCSID("$NetBSD: crt0-common.c,v 1.7 20
 
 extern int main(int, char **, char **);
 
+#ifndef HAVE_INITFINI_ARRAY
 extern void	_init(void);
 extern void	_fini(void);
+#endif
 extern void	_libc_init(void);
 
 /*
@@ -85,6 +87,36 @@ do {		\
 	_exit(1);\
 } while (0)
 
+#ifdef HAVE_INITFINI_ARRAY
+/*
+ * If we are using INIT_ARRAY/FINI_ARRAY and we are linked statically,
+ * we have to process these instead of relying on RTLD to do it for us.
+ *
+ * Since we don't need .init or .fini sections, just code them in C
+ * to make life easier.
+ */
+extern const fptr_t init_array_start[] __weak_reference(__init_array_start);
+extern const fptr_t init_array_end[] __weak_reference(__init_array_end);
+extern const fptr_t fini_array_start[] __weak_reference(__fini_array_start);
+extern const fptr_t fini_array_end[] __weak_reference(__fini_array_end);
+
+static inline void
+_init(void)
+{
+	for (const fptr_t *f = init_array_start; f < init_array_end; f++) {
+		(*f)();
+	}
+}
+
+static void
+_fini(void)
+{
+	for (const fptr_t *f = fini_array_start; f < fini_array_end; f++) {
+		(*f)();
+	}
+}
+#endif /* HAVE_INITFINI_ARRAY */
+
 void
 ___start(void (*cleanup)(void),			/* from shared loader */
 const Obj_Entry *obj,			/* from shared loader */



CVS commit: [matt-nb6-plus] src/lib/csu/arch/arm

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 22 22:56:36 UTC 2013

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
If we are using aapcs (EABI), we must be using init/fini arrays


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.1 -r1.1.10.2 src/lib/csu/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/arch/arm/Makefile.inc
diff -u src/lib/csu/arch/arm/Makefile.inc:1.1.10.1 src/lib/csu/arch/arm/Makefile.inc:1.1.10.2
--- src/lib/csu/arch/arm/Makefile.inc:1.1.10.1	Fri Nov 30 23:32:14 2012
+++ src/lib/csu/arch/arm/Makefile.inc	Tue Jan 22 22:56:35 2013
@@ -1,3 +1,7 @@
-# $NetBSD: Makefile.inc,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.2 2013/01/22 22:56:35 matt Exp $
 
 CPPFLAGS+=	-DELFSIZE=32
+.if ${MACHINE_ARCH} == "earm" || ${MACHINE_ARCH} == "earmeb" \
+|| ${CPUFLAGS:M-mabi=aapcs*} != ""
+CPPFLAGS+=  -DHAVE_INITFINI_ARRAY
+.endif



CVS commit: [matt-nb6-plus] src/libexec/ld.elf_so

2013-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 22 21:47:29 UTC 2013

Modified Files:
src/libexec/ld.elf_so [matt-nb6-plus]: Makefile headers.c rtld.c rtld.h
symbol.c
src/libexec/ld.elf_so/arch/arm [matt-nb6-plus]: Makefile.inc
rtld_start.S

Log Message:
Pullup from HEAD:
Add .init_array/.fini_array support (conditionalized on HAVE_INITFINI_ARRAY).


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.110.6.1 src/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.41.4.1 -r1.41.4.1.2.1 src/libexec/ld.elf_so/headers.c
cvs rdiff -u -r1.155 -r1.155.4.1 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.107 -r1.107.4.1 src/libexec/ld.elf_so/rtld.h
cvs rdiff -u -r1.59 -r1.59.4.1 src/libexec/ld.elf_so/symbol.c
cvs rdiff -u -r1.11 -r1.11.46.1 src/libexec/ld.elf_so/arch/arm/Makefile.inc
cvs rdiff -u -r1.10 -r1.10.10.1 src/libexec/ld.elf_so/arch/arm/rtld_start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/ld.elf_so/Makefile
diff -u src/libexec/ld.elf_so/Makefile:1.110 src/libexec/ld.elf_so/Makefile:1.110.6.1
--- src/libexec/ld.elf_so/Makefile:1.110	Fri Oct  7 09:15:21 2011
+++ src/libexec/ld.elf_so/Makefile	Tue Jan 22 21:47:27 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.110 2011/10/07 09:15:21 mrg Exp $
+#	$NetBSD: Makefile,v 1.110.6.1 2013/01/22 21:47:27 matt Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -43,7 +43,7 @@ LDFLAGS+=	${${ACTIVE_CC} == "clang":? -W
 LDFLAGS+=	-Wl,-static
 LDFLAGS+=	-Wl,--warn-shared-textrel
 
-CFLAGS+=	-fvisibility=hidden
+COPTS+=		-fvisibility=hidden
 
 # Adds SRCS, CPPFLAGS, LDFLAGS, etc.  Must go first so MD startup source
 # is first.
@@ -92,10 +92,10 @@ CPPFLAGS+=	-DCOMBRELOC
 #CPPFLAGS+=	-DRTLD_DEBUG
 #CPPFLAGS+=	-DRTLD_DEBUG_RELOC
 #DBG=		-g
-DBG=		-O3 -fomit-frame-pointer
+COPTS=		-O3 -fomit-frame-pointer
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
-DBG+=		-mno-3dnow -mno-mmx -mno-sse -mno-sse2 -mno-sse3
+COPTS+=		-mno-3dnow -mno-mmx -mno-sse -mno-sse2 -mno-sse3
 .endif
 
 

Index: src/libexec/ld.elf_so/headers.c
diff -u src/libexec/ld.elf_so/headers.c:1.41.4.1 src/libexec/ld.elf_so/headers.c:1.41.4.1.2.1
--- src/libexec/ld.elf_so/headers.c:1.41.4.1	Wed Aug  8 06:24:51 2012
+++ src/libexec/ld.elf_so/headers.c	Tue Jan 22 21:47:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: headers.c,v 1.41.4.1 2012/08/08 06:24:51 jdc Exp $	 */
+/*	$NetBSD: headers.c,v 1.41.4.1.2.1 2013/01/22 21:47:27 matt Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: headers.c,v 1.41.4.1 2012/08/08 06:24:51 jdc Exp $");
+__RCSID("$NetBSD: headers.c,v 1.41.4.1.2.1 2013/01/22 21:47:27 matt Exp $");
 #endif /* not lint */
 
 #include 
@@ -227,10 +227,32 @@ _rtld_digest_dynamic(const char *execnam
 			init = dynp->d_un.d_ptr;
 			break;
 
+#ifdef HAVE_INITFINI_ARRAY
+		case DT_INIT_ARRAY:
+			obj->init_array =
+			(fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
+			break;
+
+		case DT_INIT_ARRAYSZ:
+			obj->init_arraysz = dynp->d_un.d_val / sizeof(fptr_t);
+			break;
+#endif
+
 		case DT_FINI:
 			fini = dynp->d_un.d_ptr;
 			break;
 
+#ifdef HAVE_INITFINI_ARRAY
+		case DT_FINI_ARRAY:
+			obj->fini_array =
+			(fptr_t *)(obj->relocbase + dynp->d_un.d_ptr);
+			break;
+
+		case DT_FINI_ARRAYSZ:
+			obj->fini_arraysz = dynp->d_un.d_val / sizeof(fptr_t); 
+			break;
+#endif
+
 		/*
 		 * Don't process DT_DEBUG on MIPS as the dynamic section
 		 * is mapped read-only. DT_MIPS_RLD_MAP is used instead.

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.155 src/libexec/ld.elf_so/rtld.c:1.155.4.1
--- src/libexec/ld.elf_so/rtld.c:1.155	Fri Nov 25 21:27:15 2011
+++ src/libexec/ld.elf_so/rtld.c	Tue Jan 22 21:47:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.155 2011/11/25 21:27:15 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.155.4.1 2013/01/22 21:47:28 matt Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.155 2011/11/25 21:27:15 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.155.4.1 2013/01/22 21:47:28 matt Exp $");
 #endif /* not lint */
 
 #include 
@@ -134,13 +134,50 @@ static void _rtld_unload_object(sigset_t
 static void _rtld_unref_dag(Obj_Entry *);
 static Obj_Entry *_rtld_obj_from_addr(const void *);
 
+static inline void
+_rtld_call_initfini_function(fptr_t func, sigset_t *mask)
+{
+	_rtld_exclusive_exit(mask);
+	(*func)();
+	_rtld_exclusive_enter(mask);
+}
+
+static void
+_rtld_call_fini_function(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
+{
+	if (obj->fini_arraysz == 0 && (obj->fini == NULL || obj->fini_called)) {
+			return;
+	}
+	if (obj->fini != NULL && !obj->fini_called) {
+		dbg (("calling fini function %s at %p%s", obj->path,
+		(void *)obj->fini,
+		obj->z_initfirst ? " (DF_1_INITFIRST)" : ""));
+		obj->fini_called = 1; 
+		

CVS commit: [matt-nb6-plus] src/sys/arch/arm/include

2013-01-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 17 01:33:34 UTC 2013

Modified Files:
src/sys/arch/arm/include [matt-nb6-plus]: bus_funcs.h

Log Message:
Pullup from HEAD:
Cortex needs ._dmamap_sync_post for BUS_DMASYNC_POSTREAD


To generate a diff of this commit:
cvs rdiff -u -r1.1.10.1 -r1.1.10.2 src/sys/arch/arm/include/bus_funcs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/bus_funcs.h
diff -u src/sys/arch/arm/include/bus_funcs.h:1.1.10.1 src/sys/arch/arm/include/bus_funcs.h:1.1.10.2
--- src/sys/arch/arm/include/bus_funcs.h:1.1.10.1	Wed Nov 28 22:40:28 2012
+++ src/sys/arch/arm/include/bus_funcs.h	Thu Jan 17 01:33:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_funcs.h,v 1.1.10.1 2012/11/28 22:40:28 matt Exp $	*/
+/*	$NetBSD: bus_funcs.h,v 1.1.10.2 2013/01/17 01:33:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -64,6 +64,10 @@
 #ifndef _ARM32_BUS_FUNCS_H_
 #define _ARM32_BUS_FUNCS_H_
 
+#ifdef _KERNEL_OPT
+#include "opt_cputypes.h"
+#endif
+
 /*
  * Utility macros; INTERNAL USE ONLY.
  */
@@ -635,7 +639,7 @@ void	_bus_dmamap_unload(bus_dma_tag_t, b
 void	_bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
 	bus_size_t, int);
 
-#ifdef _ARM32_NEED_BUS_DMA_BOUNCE
+#if defined(_ARM32_NEED_BUS_DMA_BOUNCE) || defined(CPU_CORTEX)
 #define	_BUS_DMAMAP_SYNC_FUNCS \
 	._dmamap_sync_pre = _bus_dmamap_sync,	\
 	._dmamap_sync_post = _bus_dmamap_sync



CVS commit: [matt-nb6-plus] src/sys/arch/arm/arm32

2013-01-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 16 22:44:18 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [matt-nb6-plus]: bus_dma.c

Log Message:
Pullup from HEAD:
On Cortex, speculative loads can cache lines to be populated after then they've
been invalidated for a DMA read.  So after the DMA read we have to reinvalidate
them again.  We have to both invalidates since the former prevents dirty lines
overwriting just DMAed data.


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.1 -r1.54.10.2 src/sys/arch/arm/arm32/bus_dma.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.54.10.1 src/sys/arch/arm/arm32/bus_dma.c:1.54.10.2
--- src/sys/arch/arm/arm32/bus_dma.c:1.54.10.1	Wed Nov 28 22:40:17 2012
+++ src/sys/arch/arm/arm32/bus_dma.c	Wed Jan 16 22:44:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.54.10.1 2012/11/28 22:40:17 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.54.10.2 2013/01/16 22:44:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.1 2012/11/28 22:40:17 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.54.10.2 2013/01/16 22:44:18 matt Exp $");
 
 #include 
 #include 
@@ -758,6 +758,20 @@ _bus_dmamap_sync_segment(vaddr_t va, pad
 		cpu_dcache_wb_range(va, len);
 		cpu_sdcache_wb_range(va, pa, len);
 		break;
+
+#ifdef CPU_CORTEX
+	/*
+	 * Cortex CPUs can do speculative loads so we need to clean the cache
+	 * after a DMA read to deal with any speculatively loaded cache lines.
+	 * Since these can't be dirty, we can just invalidate them and don't
+	 * have to worry about having to write back their contents.
+	 */
+	case BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE:
+	case BUS_DMASYNC_POSTREAD:
+		cpu_dcache_inv_range(va, len);
+		cpu_sdcache_inv_range(va, pa, len);
+		break;
+#endif
 	}
 }
 
@@ -786,7 +800,7 @@ _bus_dmamap_sync_linear(bus_dma_tag_t t,
 
 		if ((ds->_ds_flags & _BUS_DMAMAP_COHERENT) == 0)
 			_bus_dmamap_sync_segment(va + offset, pa, seglen, ops,
-			 false);
+			false);
 
 		offset += seglen;
 		len -= seglen;
@@ -935,7 +949,9 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	 *	we are doing a PREREAD|PREWRITE, we can collapse
 	 *	the whole thing into a single Wb-Inv.
 	 *
-	 *	POSTREAD -- Nothing.
+	 *	POSTREAD -- Re-invalidate the D-cache in case speculative
+	 *	memory accesses caused cachelines to become valid with now
+	 *	invalid data.
 	 *
 	 *	POSTWRITE -- Nothing.
 	 */
@@ -946,7 +962,12 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 #endif
 
 	const int pre_ops = ops & (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
-	if (!bouncing && pre_ops == 0) {
+#ifdef CPU_CORTEX
+	const int post_ops = ops & (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+#else
+	const int post_ops = 0;
+#endif
+	if (!bouncing && pre_ops == 0 && post_ops == BUS_DMASYNC_POSTWRITE) {
 		return;
 	}
 



CVS commit: [matt-nb6-plus] src/gnu/dist/binutils

2012-12-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec 24 22:16:19 UTC 2012

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb6-plus]: tc-arm.c
src/gnu/dist/binutils/opcodes [matt-nb6-plus]: arm-dis.c

Log Message:
Add support for the armv7 movw instruction.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.4 -r1.6.6.5 src/gnu/dist/binutils/gas/config/tc-arm.c
cvs rdiff -u -r1.2.6.3 -r1.2.6.4 src/gnu/dist/binutils/opcodes/arm-dis.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.4 src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.5
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.4	Mon Dec  3 18:44:40 2012
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Mon Dec 24 22:16:18 2012
@@ -6757,6 +6757,51 @@ do_dsb (char * str)
 }
 
 static void
+do_movw (char * str)
+{
+  expressionS expr;
+  int reg;
+
+  skip_whitespace (str);
+
+  if ((reg = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL)
+return;
+
+  if (reg == REG_PC)
+{
+  inst.error = BAD_PC;
+  return;
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return;
+}
+
+  if ((expr.X_add_number >> 16) != 0)
+{
+  inst.error = _("invalid unsigned 16-bit value");
+  return;
+}
+
+  inst.instruction |= (expr.X_add_number & 0xf000) << 4;
+  inst.instruction |= (expr.X_add_number & 0x0fff);
+}
+
+static void
 do_bfci (char * str)
 {
   expressionS expr;
@@ -10195,12 +10240,13 @@ static const struct asm_opcode insns[] =
   { "smi",   0xe1600070, 3,  ARM_EXT_V6Z,  do_smi},
 
   /*  ARM V7A.  */
+  { "bfi",   0xe7c00010, 3,  ARM_EXT_V7A,  do_bfci},
+  { "bfc",   0xe7c0001f, 3,  ARM_EXT_V7A,  do_bfci},
   { "dmb",   0xf57ff05f, 0,  ARM_EXT_V7A,  do_dsb},
   { "dsb",   0xf57ff04f, 0,  ARM_EXT_V7A,  do_dsb},
   { "isb",   0xf57ff06f, 0,  ARM_EXT_V7A,  do_dsb},
+  { "movw",	 0xe300, 2,  ARM_EXT_V7A,  do_movw},
   { "sbfx",  0xe7a00050, 4,  ARM_EXT_V7A,  do_bfx},
-  { "bfi",   0xe7c00010, 3,  ARM_EXT_V7A,  do_bfci},
-  { "bfc",   0xe7c0001f, 3,  ARM_EXT_V7A,  do_bfci},
   { "ubfx",  0xe7e00050, 4,  ARM_EXT_V7A,  do_bfx},
 
   /* Core FPA instruction set (V1).  */

Index: src/gnu/dist/binutils/opcodes/arm-dis.c
diff -u src/gnu/dist/binutils/opcodes/arm-dis.c:1.2.6.3 src/gnu/dist/binutils/opcodes/arm-dis.c:1.2.6.4
--- src/gnu/dist/binutils/opcodes/arm-dis.c:1.2.6.3	Wed Nov 21 08:52:09 2012
+++ src/gnu/dist/binutils/opcodes/arm-dis.c	Mon Dec 24 22:16:19 2012
@@ -123,6 +123,7 @@ static const struct arm_opcode arm_opcod
   {ARM_EXT_V7A, 0x07a00050, 0x0fa00070, "%22?usbfx%c\t%12-15r, %0-3r, #%7-11d, #%16-20W"},
   {ARM_EXT_V7A, 0x07c0001f, 0x0fa0007f, "bfc%c\t%12-15R, %E"},
   {ARM_EXT_V7A, 0x07c00010, 0x0fa00070, "bfi%c\t%12-15R, %0-3r, %E"},
+  {ARM_EXT_V7A, 0x0300, 0x0ff0, "movw%c\t%12-15r, #%16-19,0-11d"},
   {ARM_EXT_V7A, 0xf57ff05f, 0x, "dmb"},
   {ARM_EXT_V7A, 0xf57ff050, 0xfff0, "dmb\t#%0-3d"},
   {ARM_EXT_V7A, 0xf57ff05f, 0x, "dsb"},
@@ -392,7 +393,8 @@ static const struct arm_opcode arm_opcod
   {ARM_EXT_V1, 0x00e0, 0x0de0, "rsc%c%20's\t%12-15r, %16-19r, %o"},
   {ARM_EXT_V3, 0x0120f000, 0x0db0f000, "msr%c\t%22?SCPSR%C, %o"},
   {ARM_EXT_V3, 0x010f, 0x0fbf0fff, "mrs%c\t%12-15r, %22?SCPSR"},
-  {ARM_EXT_V1, 0x0100, 0x0de0, "tst%c%p\t%16-19r, %o"},
+  {ARM_EXT_V1, 0x0110, 0x0df0, "tst%c%p\t%16-19r, %o"},
+  {ARM_EXT_V1, 0x0310, 0x0df0, "tst%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0120, 0x0de0, "teq%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0140, 0x0de0, "cmp%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0160, 0x0de0, "cmn%c%p\t%16-19r, %o"},
@@ -1332,60 +1334,59 @@ print_insn_arm (pc, info, given)
 		  {
 			int bitstart = *c++ - '0';
 			int bitend = 0;
+			long value = 0;
+
 			while (*c >= '0' && *c <= '9')
 			  bitstart = (bitstart * 10) + *c++ - '0';
 
 			switch (*c)
 			  {
 			  case '-':
-			c++;
+			while (*c == '-')
+			  {
+c++;
+bitend = 0;
+while (*c >= '0' && *c <= '9')
+  bitend = (bitend * 10) + *c++ - '0';
 
-			while (*c >= '0' && *c <= '9')
-			  bitend = (bitend * 10) + *c++ - '0';
+if (!bitend)
+  abort ();
 
-			if (!bitend)
-			  abort ();
+if (*c == ',')
+  {
+c++;
+value <<= (bitend - bitstart + 1);
+value |= (given & ((2 << bitend) - 1)) >> bitstart;
+
+bitstart = 0;
+while (*c >= '0' && *c <= '9')
+  bitstart = (bitstart * 10) + *

CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2012-12-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  7 22:47:13 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_eth.c files.bcm53xx

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/files.bcm53xx

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.2 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.3
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.17.2.2	Wed Nov 28 22:40:22 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Fri Dec  7 22:47:13 2012
@@ -31,10 +31,11 @@
 #define GMAC_PRIVATE
 
 #include "locators.h"
+#include "opt_broadcom.h"
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.2 2012/11/28 22:40:22 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.17.2.3 2012/12/07 22:47:13 matt Exp $");
 
 #include 
 #include 
@@ -63,6 +64,13 @@ __KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.
 
 //#define BCMETH_MPSAFE
 
+#ifdef BCMETH_COUNTERS
+#define	BCMETH_EVCNT_ADD(a,b)	((void)((a).ev_count += (b)))
+#else
+#define	BCMETH_EVCNT_ADD(a,b)	do { } while (/*CONSTCOND*/0)
+#endif
+#define	BCMETH_EVCNT_INCR(a)	BCMETH_EVCNT_ADD((a), 1)
+
 #define	BCMETH_RCVOFFSET	10
 #define	BCMETH_MAXTXMBUFS	128
 #define	BCMETH_NTXSEGS		30
@@ -148,12 +156,14 @@ struct bcmeth_softc {
 #define	SOFT_RXINTR		0x01
 #define	SOFT_TXINTR		0x02
 
+#ifdef BCMETH_COUNTERS
 	struct evcnt sc_ev_intr;
 	struct evcnt sc_ev_soft_intr;
 	struct evcnt sc_ev_work;
 	struct evcnt sc_ev_tx_stall;
 	struct evcnt sc_ev_rx_badmagic_lo;
 	struct evcnt sc_ev_rx_badmagic_hi;
+#endif
 
 	struct ifqueue sc_rx_bufcache;
 	struct bcmeth_mapcache *sc_rx_mapcache; 
@@ -386,6 +396,7 @@ bcmeth_ccb_attach(device_t parent, devic
 	if_attach(ifp);
 	ether_ifattach(ifp, sc->sc_enaddr);
 
+#ifdef BCMETH_COUNTERS
 	evcnt_attach_dynamic(&sc->sc_ev_intr, EVCNT_TYPE_INTR,
 	NULL, xname, "intr");
 	evcnt_attach_dynamic(&sc->sc_ev_soft_intr, EVCNT_TYPE_INTR,
@@ -398,6 +409,7 @@ bcmeth_ccb_attach(device_t parent, devic
 	NULL, xname, "rx badmagic lo");
 	evcnt_attach_dynamic(&sc->sc_ev_rx_badmagic_hi, EVCNT_TYPE_MISC,
 	NULL, xname, "rx badmagic hi");
+#endif
 }
 
 static int
@@ -1056,9 +1068,9 @@ bcmeth_rxq_consume(
 		if (rxsts == BCMETH_RCVMAGIC) {	
 			ifp->if_ierrors++;
 			if ((m->m_ext.ext_paddr >> 28) == 8) {
-sc->sc_ev_rx_badmagic_lo.ev_count++;
+BCMETH_EVCNT_INCR(sc->sc_ev_rx_badmagic_lo);
 			} else {
-sc->sc_ev_rx_badmagic_hi.ev_count++;
+BCMETH_EVCNT_INCR( sc->sc_ev_rx_badmagic_hi);
 			}
 			IF_ENQUEUE(&sc->sc_rx_bufcache, m);
 		} else
@@ -1709,7 +1721,7 @@ bcmeth_intr(void *arg)
 	mutex_enter(sc->sc_hwlock);
 
 	uint32_t intmask = sc->sc_intmask;
-	sc->sc_ev_intr.ev_count++;
+	BCMETH_EVCNT_INCR(sc->sc_ev_intr);
 
 	for (;;) {
 		uint32_t intstatus = bcmeth_read_4(sc, GMAC_INTSTATUS);
@@ -1821,7 +1833,7 @@ bcmeth_soft_txintr(struct bcmeth_softc *
 	 */
 	if (!bcmeth_txq_consume(sc, &sc->sc_txq)
 	|| !bcmeth_txq_enqueue(sc, &sc->sc_txq)) {
-		sc->sc_ev_tx_stall.ev_count++;
+		BCMETH_EVCNT_INCR(sc->sc_ev_tx_stall);
 		sc->sc_if.if_flags |= IFF_OACTIVE;
 	} else {
 		sc->sc_if.if_flags &= ~IFF_OACTIVE;
@@ -1847,7 +1859,7 @@ bcmeth_soft_intr(void *arg)
 
 	u_int soft_flags = atomic_swap_uint(&sc->sc_soft_flags, 0);
 
-	sc->sc_ev_soft_intr.ev_count++;
+	BCMETH_EVCNT_INCR(sc->sc_ev_soft_intr);
 
 	if ((soft_flags & SOFT_TXINTR)
 	|| bcmeth_txq_active_p(sc, &sc->sc_txq)) {
@@ -1857,7 +1869,7 @@ bcmeth_soft_intr(void *arg)
 		 */
 		if (!bcmeth_txq_consume(sc, &sc->sc_txq)
 		|| !bcmeth_txq_enqueue(sc, &sc->sc_txq)) {
-			sc->sc_ev_tx_stall.ev_count++;
+			BCMETH_EVCNT_INCR(sc->sc_ev_tx_stall);
 			ifp->if_flags |= IFF_OACTIVE;
 		} else {
 			ifp->if_flags &= ~IFF_OACTIVE;
@@ -1893,7 +1905,7 @@ bcmeth_worker(struct work *wk, void *arg
 
 	mutex_enter(sc->sc_lock);
 
-	sc->sc_ev_work.ev_count++;
+	BCMETH_EVCNT_INCR(sc->sc_ev_work);
 
 	uint32_t work_flags = atomic_swap_32(&sc->sc_work_flags, 0);
 	if (work_flags & WORK_REINIT) {

Index: src/sys/arch/arm/broadcom/files.bcm53xx
diff -u src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.2 src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.3
--- src/sys/arch/arm/broadcom/files.bcm53xx:1.2.4.2	Wed Nov 28 22:40:24 2012
+++ src/sys/arch/arm/broadcom/files.bcm53xx	Fri Dec  7 22:47:13 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm53xx,v 1.2.4.2 2012/11/28 22:40:24 matt Exp $
+#	$NetBSD: files.bcm53xx,v 1.2.4.3 2012/12/07 22:47:13 matt Exp $
 #
 # Configuration info for Broadcom BCM5301X ARM Peripherals
 #
@@ -20,6 +20,7 @@ defparam opt_broadcom.hCONSPEED
 defparam opt_broadcom.hCONMODE
 defparam opt_broadcom.hMEMSIZE
 defflag opt_broadcom.hBCM53XX_CONSOLE_EARLY
+defflag opt_broadcom.hBCMET

CVS commit: [matt-nb6-plus] src/etc/etc.evbarm

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  7 00:02:07 UTC 2012

Modified Files:
src/etc/etc.evbarm [matt-nb6-plus]: MAKEDEV.conf

Log Message:
Add more ld, dk, and drvctl devices for all and ramdisk|floppy


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.8.1 src/etc/etc.evbarm/MAKEDEV.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/etc.evbarm/MAKEDEV.conf
diff -u src/etc/etc.evbarm/MAKEDEV.conf:1.5 src/etc/etc.evbarm/MAKEDEV.conf:1.5.8.1
--- src/etc/etc.evbarm/MAKEDEV.conf:1.5	Sun Mar 20 03:00:56 2011
+++ src/etc/etc.evbarm/MAKEDEV.conf	Fri Dec  7 00:02:07 2012
@@ -1,8 +1,11 @@
-# $NetBSD: MAKEDEV.conf,v 1.5 2011/03/20 03:00:56 nonaka Exp $
+# $NetBSD: MAKEDEV.conf,v 1.5.8.1 2012/12/07 00:02:07 matt Exp $
 
 all_md)
 	makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 ld0
 	makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
+	makedev dk0 dk1 dk2 dk3 dk4 dk5 dk5 dk7
+	makedev dk8 dk9 dk10 dk11 dk12 dk13 dk14 dk15
+	makedev drvctl
 	makedev tty0 tty1 st0 st1 ch0 cd0 cd1
 	makedev uk0 uk1 ss0
 	makedev lpa0 lpt0
@@ -11,14 +14,18 @@ all_md)
 	makedev scsibus0 scsibus1 scsibus2 scsibus3
 	makedev	sysmon
 	makedev dmoverio
-	makedev pci0
+	makedev pci0 pci1 pci2
 	makedev kttcp
 	makedev cfs
 	;;
 
 ramdisk|floppy)
-	makedev std fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3 ld0
+	makedev std fd0 fd1 wd0 wd1 wd2 wd3 md0 md1 sd0 sd1 sd2 sd3
+	makedev ld0 ld1 ld2 ld3 ld4 ld5 ld6 ld7
 	makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
+	makedev dk0 dk1 dk2 dk3 dk4 dk5 dk5 dk7
+	makedev dk8 dk9 dk10 dk11 dk12 dk13 dk14 dk15
+	makedev drvctl
 	makedev tty0 tty1 opty
 	makedev st0 st1 cd0 cd1
 	;;



CVS commit: [matt-nb6-plus] src/sys/arch/evbarm/bcm53xx

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  7 00:00:20 UTC 2012

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb6-plus]: bcm53xx_start.S

Log Message:
After calling a9_mpstart make sure cps is set to SVC32


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.4.4.2 src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.4.4.3
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.4.4.2	Wed Nov 28 22:50:03 2012
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S	Fri Dec  7 00:00:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_start.S,v 1.4.4.2 2012/11/28 22:50:03 matt Exp $	*/
+/*	$NetBSD: bcm53xx_start.S,v 1.4.4.3 2012/12/07 00:00:20 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,7 +45,7 @@
 #define	CONADDR		0x18000300
 #endif
 
-RCSID("$NetBSD: bcm53xx_start.S,v 1.4.4.2 2012/11/28 22:50:03 matt Exp $")
+RCSID("$NetBSD: bcm53xx_start.S,v 1.4.4.3 2012/12/07 00:00:20 matt Exp $")
 
 #undef VERBOSE_INIT_ARM
 #define VERBOSE_INIT_ARM
@@ -83,6 +83,7 @@ _C_LABEL(bcm53xx_start):
 	 * Cal the initial start code for the a9
 	 */
 	bl	a9_start
+	cps	#PSR_SVC32_MODE
 
 	/*
 	 * Set up a preliminary mapping in the MMU to allow us to run



CVS commit: [matt-nb6-plus] src/sys/conf

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 18:01:22 UTC 2012

Modified Files:
src/sys/conf [matt-nb6-plus]: files

Log Message:
Don't enable KERN_SA for COMPAT_40


To generate a diff of this commit:
cvs rdiff -u -r1.1043.2.1 -r1.1043.2.1.2.1 src/sys/conf/files

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1043.2.1 src/sys/conf/files:1.1043.2.1.2.1
--- src/sys/conf/files:1.1043.2.1	Mon Jul  2 18:01:16 2012
+++ src/sys/conf/files	Thu Dec  6 18:01:21 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1043.2.1 2012/07/02 18:01:16 jdc Exp $
+#	$NetBSD: files,v 1.1043.2.1.2.1 2012/12/06 18:01:21 matt Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -126,7 +126,7 @@ defparam opt_wapbl.h		WAPBL_DEBUG_PRINT
 defflag	opt_sa.h		KERN_SA
 defflag opt_compat_netbsd.h	COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_50: COMPAT_NETBSD
-defflag	opt_compat_netbsd.h	COMPAT_40: COMPAT_50, KERN_SA, COMPAT_NETBSD
+defflag	opt_compat_netbsd.h	COMPAT_40: COMPAT_50, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_30: COMPAT_40, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_20: COMPAT_30, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_16: COMPAT_20, COMPAT_NETBSD



CVS commit: [matt-nb6-plus] src/sys/arch

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 17:57:25 UTC 2012

Modified Files:
src/sys/arch/arm/include [matt-nb6-plus]: isa_machdep.h
src/sys/arch/shark/conf [matt-nb6-plus]: std.shark
src/sys/arch/shark/include [matt-nb6-plus]: vmparam.h
src/sys/arch/shark/isa [matt-nb6-plus]: isa_irq.S isadma_machdep.c
src/sys/arch/shark/ofw [matt-nb6-plus]: ofw.c
src/sys/arch/shark/shark [matt-nb6-plus]: autoconf.c shark_machdep.c

Log Message:
Merge changes from -current.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/arch/arm/include/isa_machdep.h
cvs rdiff -u -r1.8 -r1.8.52.1 src/sys/arch/shark/conf/std.shark
cvs rdiff -u -r1.17 -r1.17.16.1 src/sys/arch/shark/include/vmparam.h
cvs rdiff -u -r1.13 -r1.13.16.1 src/sys/arch/shark/isa/isa_irq.S
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/arch/shark/isa/isadma_machdep.c
cvs rdiff -u -r1.57 -r1.57.6.1 src/sys/arch/shark/ofw/ofw.c
cvs rdiff -u -r1.17.18.1 -r1.17.18.1.2.1 src/sys/arch/shark/shark/autoconf.c
cvs rdiff -u -r1.39 -r1.39.10.1 src/sys/arch/shark/shark/shark_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/isa_machdep.h
diff -u src/sys/arch/arm/include/isa_machdep.h:1.8 src/sys/arch/arm/include/isa_machdep.h:1.8.10.1
--- src/sys/arch/arm/include/isa_machdep.h:1.8	Fri Jul  1 21:16:40 2011
+++ src/sys/arch/arm/include/isa_machdep.h	Thu Dec  6 17:57:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.8 2011/07/01 21:16:40 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.8.10.1 2012/12/06 17:57:24 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -45,13 +45,12 @@ struct arm32_isa_chipset {
 
 typedef struct arm32_isa_chipset *isa_chipset_tag_t;
 
-struct device;			/* XXX */
 struct isabus_attach_args;	/* XXX */
 
 /*
  * Functions provided to machine-independent ISA code.
  */
-void	isa_attach_hook(struct device *, struct device *,
+void	isa_attach_hook(device_t, device_t,
 	struct isabus_attach_args *);
 void	isa_detach_hook(isa_chipset_tag_t, device_t);
 const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq);
@@ -115,42 +114,6 @@ void	isa_intr_disestablish(isa_chipset_t
 
 extern struct arm32_bus_dma_tag isa_bus_dma_tag;
 
-/*
- * Cookie used by ISA DMA.  A pointer to one of these is stashed in
- * the DMA map.
- */
-struct arm32_isa_dma_cookie {
-	int	id_flags;		/* flags; see below */
-
-	/*
-	 * Information about the original buffer used during
-	 * DMA map syncs.  Note that origbuflen is only used
-	 * for ID_BUFTYPE_LINEAR.
-	 */
-	void	*id_origbuf;		/* pointer to orig buffer if
-	   bouncing */
-	bus_size_t id_origbuflen;	/* ...and size */
-	int	id_buftype;		/* type of buffer */
-
-	void	*id_bouncebuf;		/* pointer to the bounce buffer */
-	bus_size_t id_bouncebuflen;	/* ...and size */
-	int	id_nbouncesegs;		/* number of valid bounce segs */
-	bus_dma_segment_t id_bouncesegs[0]; /* array of bounce buffer
-	   physical memory segments */
-};
-
-/* id_flags */
-#define	ID_MIGHT_NEED_BOUNCE	0x01	/* map could need bounce buffers */
-#define	ID_HAS_BOUNCE		0x02	/* map currently has bounce buffers */
-#define	ID_IS_BOUNCING		0x04	/* map is bouncing current xfer */
-
-/* id_buftype */
-#define	ID_BUFTYPE_INVALID	0
-#define	ID_BUFTYPE_LINEAR	1
-#define	ID_BUFTYPE_MBUF		2
-#define	ID_BUFTYPE_UIO		3
-#define	ID_BUFTYPE_RAW		4
-
 /* bus space tags */
 extern struct bus_space isa_io_bs_tag;
 extern struct bus_space isa_mem_bs_tag;

Index: src/sys/arch/shark/conf/std.shark
diff -u src/sys/arch/shark/conf/std.shark:1.8 src/sys/arch/shark/conf/std.shark:1.8.52.1
--- src/sys/arch/shark/conf/std.shark:1.8	Sun Jan 27 12:37:12 2008
+++ src/sys/arch/shark/conf/std.shark	Thu Dec  6 17:57:24 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: std.shark,v 1.8 2008/01/27 12:37:12 chris Exp $
+#	$NetBSD: std.shark,v 1.8.52.1 2012/12/06 17:57:24 matt Exp $
 #
 # standard NetBSD/shark options
 
@@ -12,6 +12,7 @@ options 	EXEC_SCRIPT
 
 # To support easy transit to ../arch/arm/arm32
 options 	ARM32
+options 	_ARM32_NEED_BUS_DMA_BOUNCE
 
 #options 	ARM32_NEW_VM_LAYOUT	# Not yet ready for prime-time
 

Index: src/sys/arch/shark/include/vmparam.h
diff -u src/sys/arch/shark/include/vmparam.h:1.17 src/sys/arch/shark/include/vmparam.h:1.17.16.1
--- src/sys/arch/shark/include/vmparam.h:1.17	Sat Nov  6 15:42:49 2010
+++ src/sys/arch/shark/include/vmparam.h	Thu Dec  6 17:57:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.17 2010/11/06 15:42:49 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.17.16.1 2012/12/06 17:57:24 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -29,10 +29,10 @@
  * SUCH DAMAGE.
  */
 
-#ifndef	_ARM32_VMPARAM_H_
-#define	_ARM32_VMPARAM_H_
+#ifndef	_SHARK_VMPARAM_H_
+#define	_SHARK_VMPARAM_H_
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_KMEMUSER)
 
 #include 
 
@@ -90,4 

CVS commit: [matt-nb6-plus] src/distrib/sets/lists/comp

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 17:22:46 UTC 2012

Modified Files:
src/distrib/sets/lists/comp [matt-nb6-plus]: mi

Log Message:
elfedit needs binutils=219


To generate a diff of this commit:
cvs rdiff -u -r1.1738.2.6.2.1 -r1.1738.2.6.2.2 src/distrib/sets/lists/comp/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1738.2.6.2.1 src/distrib/sets/lists/comp/mi:1.1738.2.6.2.2
--- src/distrib/sets/lists/comp/mi:1.1738.2.6.2.1	Thu Nov  1 16:44:48 2012
+++ src/distrib/sets/lists/comp/mi	Thu Dec  6 17:22:42 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1738.2.6.2.1 2012/11/01 16:44:48 matt Exp $
+#	$NetBSD: mi,v 1.1738.2.6.2.2 2012/12/06 17:22:42 matt Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -25,7 +25,7 @@
 ./usr/bin/ctfmergecomp-util-bin		dtrace
 ./usr/bin/cvs	comp-cvs-bin		cvs
 ./usr/bin/cvsbugcomp-cvs-bin		cvs
-./usr/bin/elfeditcomp-util-bin		binutils
+./usr/bin/elfeditcomp-util-bin		binutils=219
 ./usr/bin/f77	comp-fortran-bin	gcc=3,gcccmds
 ./usr/bin/f77	comp-obsolete		gcc=4,obsolete
 ./usr/bin/fgen	comp-util-bin
@@ -3585,7 +3585,7 @@
 ./usr/libdata/debug/usr/bin/dns-sd.debug	comp-mdns-debug		mdns,debug
 ./usr/libdata/debug/usr/bin/du.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/eject.debug		comp-util-debug		debug
-./usr/libdata/debug/usr/bin/elfedit.debug	comp-util-debug		binutils,debug
+./usr/libdata/debug/usr/bin/elfedit.debug	comp-util-debug		binutils=219,debug
 ./usr/libdata/debug/usr/bin/env.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/eqn.debug		comp-groff-debug	groff,debug
 ./usr/libdata/debug/usr/bin/error.debug		comp-util-debug		debug
@@ -4609,7 +4609,7 @@
 ./usr/share/man/cat1/cvs.0			comp-cvs-catman		cvs,.cat
 ./usr/share/man/cat1/elf2aout.0			comp-sysutil-catman	.cat
 ./usr/share/man/cat1/elf2ecoff.0		comp-sysutil-catman	.cat
-./usr/share/man/cat1/elfedit.0			comp-util-catman	binutils,.cat
+./usr/share/man/cat1/elfedit.0			comp-util-catman	binutils=219,.cat
 ./usr/share/man/cat1/f77.0			comp-fortran-catman	gcc=3,gcccmds,.cat
 ./usr/share/man/cat1/f77.0			comp-obsolete		gcc=4,obsolete
 ./usr/share/man/cat1/fgen.0			comp-util-catman	.cat
@@ -11001,7 +11001,7 @@
 ./usr/share/man/html1/cvs.html			comp-cvs-htmlman	cvs,html
 ./usr/share/man/html1/elf2aout.html		comp-sysutil-htmlman	html
 ./usr/share/man/html1/elf2ecoff.html		comp-sysutil-htmlman	html
-./usr/share/man/html1/elfedit.html		comp-util-htmlman	binutils,html
+./usr/share/man/html1/elfedit.html		comp-util-htmlman	binutils=219,html
 ./usr/share/man/html1/f77.html			comp-fortran-htmlman	gcc=3,gcccmds,html
 ./usr/share/man/html1/fgen.html			comp-util-htmlman	html
 ./usr/share/man/html1/flex.html			comp-c-htmlman		html
@@ -17128,7 +17128,7 @@
 ./usr/share/man/man1/cvs.1			comp-cvs-man		cvs,.man
 ./usr/share/man/man1/elf2aout.1			comp-sysutil-man	.man
 ./usr/share/man/man1/elf2ecoff.1		comp-sysutil-man	.man
-./usr/share/man/man1/elfedit.1			comp-util-man		binutils,.man
+./usr/share/man/man1/elfedit.1			comp-util-man		binutils=219,.man
 ./usr/share/man/man1/f77.1			comp-fortran-man	gcc=3,gcccmds,.man
 ./usr/share/man/man1/f77.1			comp-obsolete		gcc=4,obsolete
 ./usr/share/man/man1/fgen.1			comp-util-man		.man



CVS commit: [matt-nb6-plus] src/sys/rump/librump/rumpkern

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 17:20:26 UTC 2012

Modified Files:
src/sys/rump/librump/rumpkern [matt-nb6-plus]: Makefile.rumpkern

Log Message:
Only add atomic_cas_generic.c to SRCS if there isn't already some
atomic_cas_* already in SRCS.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.1 -r1.115.2.1.2.1 \
src/sys/rump/librump/rumpkern/Makefile.rumpkern

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.115.2.1 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.115.2.1.2.1
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.115.2.1	Tue Jun 26 14:49:09 2012
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Thu Dec  6 17:20:26 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.115.2.1 2012/06/26 14:49:09 riz Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.115.2.1.2.1 2012/12/06 17:20:26 matt Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -194,10 +194,12 @@ KERNMISCCPPFLAGS+=	-D_RUMPKERNEL
 .if ${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "hppa" \
 || ${MACHINE_CPU} == "mips" || ${MACHINE_CPU} == "sh3" \
 || ${MACHINE_CPU} == "vax" || ${MACHINE_ARCH} == "m68000"
+.if ${SRCS:Matomic_cas_*} == ""
 CPPFLAGS+=	-I${RUMPTOP}/../../common/lib/libc/atomic
 SRCS+=		atomic_cas_generic.c
 #SRCS+=		rump_atomic_cas_up.c
 .endif
+.endif
 
 .include 
 .include 



CVS commit: [matt-nb6-plus] src/sys/arch/evbarm/stand

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 17:14:24 UTC 2012

Modified Files:
src/sys/arch/evbarm/stand/boot2440 [matt-nb6-plus]: Makefile
src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014 
[matt-nb6-plus]:
Makefile
src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160 [matt-nb6-plus]:
Makefile
src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008 
[matt-nb6-plus]:
Makefile
src/sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf008 
[matt-nb6-plus]:
Makefile
src/sys/arch/evbarm/stand/gzboot/TS7200_flash_0x6066 
[matt-nb6-plus]:
Makefile

Log Message:
Hardcode CPUFLAGS appropriately so that these are always built for the correct
cpu/architecture.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/evbarm/stand/boot2440/Makefile
cvs rdiff -u -r1.2 -r1.2.150.1 \
src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile
cvs rdiff -u -r1.2 -r1.2.30.1 \
src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile
cvs rdiff -u -r1.3 -r1.3.150.1 \
src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile
cvs rdiff -u -r1.3 -r1.3.150.1 \
src/sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf008/Makefile
cvs rdiff -u -r1.2 -r1.2.120.1 \
src/sys/arch/evbarm/stand/gzboot/TS7200_flash_0x6066/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/stand/boot2440/Makefile
diff -u src/sys/arch/evbarm/stand/boot2440/Makefile:1.2 src/sys/arch/evbarm/stand/boot2440/Makefile:1.2.4.1
--- src/sys/arch/evbarm/stand/boot2440/Makefile:1.2	Tue Jan 31 11:04:17 2012
+++ src/sys/arch/evbarm/stand/boot2440/Makefile	Thu Dec  6 17:14:23 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/01/31 11:04:17 nisimura Exp $
+#	$NetBSD: Makefile,v 1.2.4.1 2012/12/06 17:14:23 matt Exp $
 
 S=		${.CURDIR}/../../../..
 PROG=		bootmini2440
@@ -8,7 +8,8 @@ SRCS+=		s3csdi.c vers.c
 .include 
 
 CLEANFILES+=	vers.c ${PROG}.elf
-CFLAGS+=	-Wall -Wno-main -ffreestanding -march=armv4
+CFLAGS+=	-Wall -Wno-main -ffreestanding
+CPUFLAGS=	-march=armv4
 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP 
 CPPFLAGS+=	-DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27" 
 CPPFLAGS+=	-DDEFAULT_BOOTFILE="ld0a:netbsd;net:"

Index: src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile
diff -u src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile:1.2 src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile:1.2.150.1
--- src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile:1.2	Tue Apr 29 05:36:20 2003
+++ src/sys/arch/evbarm/stand/gzboot/ADI_BRH_flash_0x0014/Makefile	Thu Dec  6 17:14:23 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2003/04/29 05:36:20 thorpej Exp $
+#	$NetBSD: Makefile,v 1.2.150.1 2012/12/06 17:14:23 matt Exp $
 
 S=	${.CURDIR}/../../../../..
 
@@ -11,6 +11,7 @@ CPPFLAGS+= -DBECC_SUPPORT_V7
 CPPFLAGS+= -DCONSPEED=57600
 CPPFLAGS+= -DCONADDR=0x0300UL
 CPPFLAGS+= -DNS16550_FREQ=3330
+CPUFLAGS= -mcpu=xscale
 
 LDSCRIPT= ${.CURDIR}/ldscript
 

Index: src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile
diff -u src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile:1.2 src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile:1.2.30.1
--- src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile:1.2	Mon Nov 10 20:30:12 2008
+++ src/sys/arch/evbarm/stand/gzboot/GEMINI_dram_0x0160/Makefile	Thu Dec  6 17:14:23 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/11/10 20:30:12 cliff Exp $
+#	$NetBSD: Makefile,v 1.2.30.1 2012/12/06 17:14:23 matt Exp $
 
 S=	${.CURDIR}/../../../../..
 
@@ -11,6 +11,7 @@ CPPFLAGS+= -DCONSPEED=19200
 CPPFLAGS+= -DCONADDR=0x4200UL
 CPPFLAGS+= -DNS16550_AX4
 CPPFLAGS+= -DNS16550_FREQ=4800
+CPUFLAGS= -march=armv4
 
 LDSCRIPT= ${.CURDIR}/ldscript
 

Index: src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile
diff -u src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile:1.3 src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile:1.3.150.1
--- src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile:1.3	Tue Apr 29 05:38:52 2003
+++ src/sys/arch/evbarm/stand/gzboot/IQ80310_flash_0x0008/Makefile	Thu Dec  6 17:14:23 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2003/04/29 05:38:52 thorpej Exp $
+#	$NetBSD: Makefile,v 1.3.150.1 2012/12/06 17:14:23 matt Exp $
 
 S=	${.CURDIR}/../../../../..
 
@@ -9,6 +9,7 @@ LOADADDR= 0xa020
 
 CPPFLAGS+= -DCONSPEED=115200
 CPPFLAGS+= -DCONADDR=0xfe81UL
+CPUFLAGS= -mcpu=xscale
 
 LDSCRIPT= ${.CURDIR}/ldscript
 

Index: src/sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf008/Makefile
diff -u src/sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf008/Makefile:1.3 src/sys/arch/evbarm/stand/gzboot/IQ80321_flash_0xf008/Makefile:1

CVS commit: [matt-nb6-plus] src/sys/lib/libkern

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 17:13:31 UTC 2012

Modified Files:
src/sys/lib/libkern [matt-nb6-plus]: Makefile.inc

Log Message:
Don't pass CPUFLAGS down since its value is in CFLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.118.1 src/sys/lib/libkern/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/Makefile.inc
diff -u src/sys/lib/libkern/Makefile.inc:1.40 src/sys/lib/libkern/Makefile.inc:1.40.118.1
--- src/sys/lib/libkern/Makefile.inc:1.40	Tue Dec 20 19:35:26 2005
+++ src/sys/lib/libkern/Makefile.inc	Thu Dec  6 17:13:31 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.40 2005/12/20 19:35:26 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.40.118.1 2012/12/06 17:13:31 matt Exp $
 #
 #	Configuration variables (default values are below):
 #
@@ -42,6 +42,7 @@ KERNMAKE= \
 	TSORT=${TSORT:Q} \
 	LD=${LD:Q} STRIP=${STRIP:Q} \
 	AR=${AR:Q} NM=${NM:Q} \
+	CPUFLAGS= \
 	RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
 	MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
 	KERNCPPFLAGS=${CPPFLAGS:S@^-I.@-I${KERNDOTDIR}@g:Q} \



CVS commit: [matt-nb6-plus] src/sys/kern

2012-12-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec  6 16:07:21 UTC 2012

Modified Files:
src/sys/kern [matt-nb6-plus]: sys_generic.c

Log Message:
Make sure ioctl stkbuf has a minimal alignment of (__ALIGNBYTES+1)


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.128.4.1 src/sys/kern/sys_generic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_generic.c
diff -u src/sys/kern/sys_generic.c:1.128 src/sys/kern/sys_generic.c:1.128.4.1
--- src/sys/kern/sys_generic.c:1.128	Wed Jan 25 00:28:36 2012
+++ src/sys/kern/sys_generic.c	Thu Dec  6 16:07:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_generic.c,v 1.128 2012/01/25 00:28:36 christos Exp $	*/
+/*	$NetBSD: sys_generic.c,v 1.128.4.1 2012/12/06 16:07:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_generic.c,v 1.128 2012/01/25 00:28:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_generic.c,v 1.128.4.1 2012/12/06 16:07:21 matt Exp $");
 
 #include 
 #include 
@@ -525,7 +525,7 @@ sys_ioctl(struct lwp *l, const struct sy
 	size_t		size, alloc_size;
 	void 		*data, *memp;
 #define	STK_PARAMS	128
-	u_long		stkbuf[STK_PARAMS/sizeof(u_long)];
+	u_long		stkbuf[STK_PARAMS/sizeof(u_long)] __aligned(__ALIGNBYTES+1);
 
 	memp = NULL;
 	alloc_size = 0;



CVS commit: [matt-nb6-plus] src/sys/conf

2012-12-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Dec  4 07:00:31 UTC 2012

Modified Files:
src/sys/conf [matt-nb6-plus]: Makefile.kern.inc

Log Message:
Add SYSTEM_LD_TAIL_DBSYM for arm.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.152.4.1 src/sys/conf/Makefile.kern.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.152 src/sys/conf/Makefile.kern.inc:1.152.4.1
--- src/sys/conf/Makefile.kern.inc:1.152	Sun Feb 12 16:34:11 2012
+++ src/sys/conf/Makefile.kern.inc	Tue Dec  4 07:00:30 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.152 2012/02/12 16:34:11 matt Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.152.4.1 2012/12/04 07:00:30 matt Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -236,6 +236,7 @@ SYSTEM_LD?=	@${_MKSHMSG} "   link  ${.CU
 SYSTEM_LD_TAIL?=@${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/\\.*//' vers.c; \
 		${SIZE} $@; chmod 755 $@; \
 		${SYSTEM_CTFMERGE}
+SYSTEM_LD_TAIL_DBSYM?=  true
 
 TEXTADDR?=	${LOADADDRESS}			# backwards compatibility
 LINKTEXT?=	${TEXTADDR:C/.+/-Ttext &/}



CVS commit: [matt-nb6-plus] src/sys/dev/ic

2012-12-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec  3 22:00:53 UTC 2012

Modified Files:
src/sys/dev/ic [matt-nb6-plus]: ahcisata_core.c

Log Message:
Pullup changes in rev 1.44.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/ic/ahcisata_core.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.33 src/sys/dev/ic/ahcisata_core.c:1.33.4.1
--- src/sys/dev/ic/ahcisata_core.c:1.33	Tue Jan 10 01:43:05 2012
+++ src/sys/dev/ic/ahcisata_core.c	Mon Dec  3 22:00:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.33 2012/01/10 01:43:05 jakllsch Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.33.4.1 2012/12/03 22:00:53 matt Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.33 2012/01/10 01:43:05 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.33.4.1 2012/12/03 22:00:53 matt Exp $");
 
 #include 
 #include 
@@ -686,11 +686,12 @@ ahci_probe_drive(struct ata_channel *chp
 		splx(s);
 		/* clear port interrupt register */
 		AHCI_WRITE(sc, AHCI_P_IS(chp->ch_channel), 0x);
+		
 		/* and enable interrupts */
 		AHCI_WRITE(sc, AHCI_P_IE(chp->ch_channel),
 		AHCI_P_IX_TFES | AHCI_P_IX_HBFS | AHCI_P_IX_IFS |
 		AHCI_P_IX_OFS | AHCI_P_IX_DPS | AHCI_P_IX_UFS |
-		AHCI_P_IX_DHRS);
+		AHCI_P_IX_PSS | AHCI_P_IX_DHRS);
 		/* wait 500ms before actually starting operations */
 		tsleep(&sc, PRIBIO, "ahciprb", mstohz(500));
 		break;
@@ -769,8 +770,9 @@ ahci_cmd_start(struct ata_channel *chp, 
 	int i;
 	int channel = chp->ch_channel;
 
-	AHCIDEBUG_PRINT(("ahci_cmd_start CI 0x%x\n",
-	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel))), DEBUG_XFERS);
+	AHCIDEBUG_PRINT(("ahci_cmd_start CI 0x%x timo %d\n",
+	AHCI_READ(sc, AHCI_P_CI(chp->ch_channel)), ata_c->timeout),
+	DEBUG_XFERS);
 
 	cmd_tbl = achp->ahcic_cmd_tbl[slot];
 	AHCIDEBUG_PRINT(("%s port %d tbl %p\n", AHCINAME(sc), chp->ch_channel,
@@ -912,18 +914,18 @@ ahci_cmd_done(struct ata_channel *chp, s
 	uint16_t *idwordbuf;
 	int i;
 
-	AHCIDEBUG_PRINT(("ahci_cmd_done channel %d\n", chp->ch_channel),
-	DEBUG_FUNCS);
+	AHCIDEBUG_PRINT(("ahci_cmd_done channel %d (status %#x) flags %#x/%#x\n",
+	chp->ch_channel, chp->ch_status, xfer->c_flags, ata_c->flags), DEBUG_FUNCS);
 
 	/* this comamnd is not active any more */
 	achp->ahcic_cmds_active &= ~(1 << slot);
 
 	if (ata_c->flags & (AT_READ|AT_WRITE) && ata_c->bcount > 0) {
-		bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[slot], 0,
-		achp->ahcic_datad[slot]->dm_mapsize,
+		bus_dmamap_t map = achp->ahcic_datad[slot];
+		bus_dmamap_sync(sc->sc_dmat, map, 0, map->dm_mapsize,
 		(ata_c->flags & AT_READ) ? BUS_DMASYNC_POSTREAD :
 		BUS_DMASYNC_POSTWRITE);
-		bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[slot]);
+		bus_dmamap_unload(sc->sc_dmat, map);
 	}
 
 	AHCI_CMDH_SYNC(sc, achp, slot,
@@ -1192,8 +1194,12 @@ ahci_timeout(void *v)
 {
 	struct ata_channel *chp = (struct ata_channel *)v;
 	struct ata_xfer *xfer = chp->ch_queue->active_xfer;
+#ifdef AHCI_DEBUG
+	struct ahci_softc *sc = (struct ahci_softc *)chp->ch_atac;
+#endif
 	int s = splbio();
-	AHCIDEBUG_PRINT(("ahci_timeout xfer %p\n", xfer), DEBUG_INTR);
+	AHCIDEBUG_PRINT(("ahci_timeout xfer %p intr %#x\n", xfer, AHCI_READ(sc, AHCI_P_IS(chp->ch_channel))), DEBUG_INTR);
+	
 	if ((chp->ch_flags & ATACH_IRQ_WAIT) != 0) {
 		xfer->c_flags |= C_TIMEOU;
 		xfer->c_intr(chp, xfer, 0);



CVS commit: [matt-nb6-plus] src/gnu/dist/binutils/gas/config

2012-12-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec  3 18:44:42 UTC 2012

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb6-plus]: tc-arm.c

Log Message:
Remove return values from void functions.  (c&p error)


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.3 -r1.6.6.4 src/gnu/dist/binutils/gas/config/tc-arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.3 src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.4
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.3	Wed Nov 21 08:52:09 2012
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Mon Dec  3 18:44:40 2012
@@ -6803,7 +6803,7 @@ do_bfci (char * str)
   if (expr.X_op != O_constant)
 {
   inst.error = _("constant expression expected");
-  return FAIL;
+  return;
 }
 
   lsb = expr.X_add_number;
@@ -6830,7 +6830,7 @@ do_bfci (char * str)
   if (expr.X_op != O_constant)
 {
   inst.error = _("constant expression expected");
-  return FAIL;
+  return;
 }
 
   width = expr.X_add_number;
@@ -6885,7 +6885,7 @@ do_bfx (char * str)
   if (expr.X_op != O_constant)
 {
   inst.error = _("constant expression expected");
-  return FAIL;
+  return;
 }
 
   lsb = expr.X_add_number;



CVS commit: [matt-nb6-plus] src/gnu/usr.bin

2012-12-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec  3 18:28:23 UTC 2012

Modified Files:
src/gnu/usr.bin [matt-nb6-plus]: Makefile

Log Message:
Fix check of binutils to use right version.


To generate a diff of this commit:
cvs rdiff -u -r1.135.6.1 -r1.135.6.2 src/gnu/usr.bin/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/usr.bin/Makefile
diff -u src/gnu/usr.bin/Makefile:1.135.6.1 src/gnu/usr.bin/Makefile:1.135.6.2
--- src/gnu/usr.bin/Makefile:1.135.6.1	Tue Nov 20 18:52:37 2012
+++ src/gnu/usr.bin/Makefile	Mon Dec  3 18:28:22 2012
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.135.6.1 2012/11/20 18:52:37 matt Exp $
+#	$NetBSD: Makefile,v 1.135.6.2 2012/12/03 18:28:22 matt Exp $
 
 .include 
 
 SUBDIR+=	bc
-.if ${MKBINUTILS} != "no" && ${HAVE_BINUTILS} == "219"
+.if ${MKBINUTILS} != "no" && ${HAVE_BINUTILS} == "216"
 SUBDIR+=	binutils
 .endif
 SUBDIR+=	c89 c99



CVS commit: [matt-nb6-plus] src/lib/csu/arm_elf

2012-11-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 30 23:38:57 UTC 2012

Modified Files:
src/lib/csu/arm_elf [matt-nb6-plus]: crt0.c dot_init.h

Log Message:
Don't include  in C files.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.4.1 src/lib/csu/arm_elf/crt0.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/lib/csu/arm_elf/dot_init.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/arm_elf/crt0.c
diff -u src/lib/csu/arm_elf/crt0.c:1.10 src/lib/csu/arm_elf/crt0.c:1.10.4.1
--- src/lib/csu/arm_elf/crt0.c:1.10	Wed Jan 25 13:29:58 2012
+++ src/lib/csu/arm_elf/crt0.c	Fri Nov 30 23:38:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: crt0.c,v 1.10 2012/01/25 13:29:58 he Exp $	*/
+/*	$NetBSD: crt0.c,v 1.10.4.1 2012/11/30 23:38:57 matt Exp $	*/
 
 /*
  * Copyright (C) 1997 Mark Brinicombe
@@ -35,7 +35,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include "common.h"
@@ -68,7 +67,7 @@ __asm("	.text			\n"
 "	b	" ___STRING(_C_LABEL(___start)) " ");
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.10 2012/01/25 13:29:58 he Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.10.4.1 2012/11/30 23:38:57 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 void

Index: src/lib/csu/arm_elf/dot_init.h
diff -u src/lib/csu/arm_elf/dot_init.h:1.6 src/lib/csu/arm_elf/dot_init.h:1.6.22.1
--- src/lib/csu/arm_elf/dot_init.h:1.6	Sat May 10 15:31:03 2008
+++ src/lib/csu/arm_elf/dot_init.h	Fri Nov 30 23:38:57 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dot_init.h,v 1.6 2008/05/10 15:31:03 martin Exp $ */
+/* $NetBSD: dot_init.h,v 1.6.22.1 2012/11/30 23:38:57 matt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -34,7 +34,6 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-#include 
 
 #define	MD_SECTION_PROLOGUE(sect, entry_pt)		\
 		__asm (	\



CVS commit: [matt-nb6-plus] src/share/mk

2012-11-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 30 23:34:22 UTC 2012

Modified Files:
src/share/mk [matt-nb6-plus]: bsd.own.mk

Log Message:
Switch ARM to USE_COMPILERCRTSTUFF=no


To generate a diff of this commit:
cvs rdiff -u -r1.696.2.2.2.3 -r1.696.2.2.2.4 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.696.2.2.2.3 src/share/mk/bsd.own.mk:1.696.2.2.2.4
--- src/share/mk/bsd.own.mk:1.696.2.2.2.3	Tue Nov 20 23:22:25 2012
+++ src/share/mk/bsd.own.mk	Fri Nov 30 23:34:22 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.3 2012/11/20 23:22:25 matt Exp $
+#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.4 2012/11/30 23:34:22 matt Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -57,6 +57,7 @@ HAVE_GCC?=45
 .endif
 
 .if \
+${MACHINE_CPU} == "arm" || \
 ${MACHINE_ARCH} == "i386" || \
 ${MACHINE_ARCH} == "powerpc" || \
 ${MACHINE_ARCH} == "x86_64"



CVS commit: [matt-nb6-plus] src/lib/csu/arch/arm

2012-11-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Nov 30 23:32:14 UTC 2012

Modified Files:
src/lib/csu/arch/arm [matt-nb6-plus]: Makefile.inc crt0.S crti.S crtn.S
Added Files:
src/lib/csu/arch/arm [matt-nb6-plus]: crtbegin.S crtend.S

Log Message:
Pull from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.10.1 src/lib/csu/arch/arm/Makefile.inc \
src/lib/csu/arch/arm/crt0.S src/lib/csu/arch/arm/crti.S \
src/lib/csu/arch/arm/crtn.S
cvs rdiff -u -r0 -r1.4.6.2 src/lib/csu/arch/arm/crtbegin.S
cvs rdiff -u -r0 -r1.2.6.2 src/lib/csu/arch/arm/crtend.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/csu/arch/arm/Makefile.inc
diff -u src/lib/csu/arch/arm/Makefile.inc:1.1 src/lib/csu/arch/arm/Makefile.inc:1.1.10.1
--- src/lib/csu/arch/arm/Makefile.inc:1.1	Sat Aug  7 18:01:33 2010
+++ src/lib/csu/arch/arm/Makefile.inc	Fri Nov 30 23:32:14 2012
@@ -1,5 +1,3 @@
-# $NetBSD: Makefile.inc,v 1.1 2010/08/07 18:01:33 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $
 
 CPPFLAGS+=	-DELFSIZE=32
-
-
Index: src/lib/csu/arch/arm/crt0.S
diff -u src/lib/csu/arch/arm/crt0.S:1.1 src/lib/csu/arch/arm/crt0.S:1.1.10.1
--- src/lib/csu/arch/arm/crt0.S:1.1	Sat Aug  7 18:01:33 2010
+++ src/lib/csu/arch/arm/crt0.S	Fri Nov 30 23:32:14 2012
@@ -1,11 +1,12 @@
-/*	$NetBSD: crt0.S,v 1.1 2010/08/07 18:01:33 joerg Exp $	*/
+/*	$NetBSD: crt0.S,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $	*/
 
-/*
- * Copyright (C) 1997 Mark Brinicombe
- * Copyright (C) 1995 Wolfgang Solfrank.
- * Copyright (C) 1995 TooLs GmbH.
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -14,43 +15,41 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *	This product includes software developed by TooLs GmbH.
- * 4. The name of TooLs GmbH may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
-#include 
 
-RCSID("$NetBSD: crt0.S,v 1.1 2010/08/07 18:01:33 joerg Exp $")
+#include 
+
+RCSID("$NetBSD: crt0.S,v 1.1.10.1 2012/11/30 23:32:14 matt Exp $")
 
 STRONG_ALIAS(_start,__start)
 
 _ENTRY(__start)
-	mov	r5, r2		/* cleanup */
-	mov	r4, r1		/* obj_main */
-	mov	r3, r0		/* ps_strings */
-	/* Get argc, argv, and envp from stack */
-	ldr	r0, [sp, #0x]
-	add	r1, sp, #0x0004
-	add	r2, r1, r0, lsl #2
-	add	r2, r2, #0x0004
+	/*
+	 * We need to swap ps_strings and cleanup
+ 	 */
+	mov	ip, r0		/* ps_strings -> tmp */
+	mov	r0, r2		/* cleanup -> ps_strings */
+	mov	r2, ip		/* tmp -> ps_strings */
 
 	/* Ensure the stack is properly aligned before calling C code. */
 	bic	sp, sp, #7
-	sub	sp, sp, #8
-	str	r5, [sp, #4]
-	str	r4, [sp, #0]
+
+	/*
+	 * void ___start(void (*cleanup)(void),
+	 *const Obj_Entry *o

CVS commit: [matt-nb6-plus] src/sys/arch/arm/broadcom

2012-11-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov 29 18:42:06 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom [matt-nb6-plus]: bcm53xx_reg.h bcm53xx_usb.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 src/sys/arch/arm/broadcom/bcm53xx_reg.h
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/sys/arch/arm/broadcom/bcm53xx_usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_reg.h
diff -u src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.2 src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.3
--- src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.10.2.2	Wed Nov 28 22:40:23 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_reg.h	Thu Nov 29 18:42:05 2012
@@ -658,6 +658,13 @@
 
 #endif /* IDM_PRIVATE */
 
+#ifdef USBH_PRIVATE
+#define	USBH_PHY_CTRL_P0		0x200
+#define	USBH_PHY_CTRL_P1		0x204
+
+#define	USBH_PHY_CTRL_INIT		0x3ff
+#endif
+
 #ifdef GMAC_PRIVATE
 
 struct gmac_txdb {

Index: src/sys/arch/arm/broadcom/bcm53xx_usb.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.2 src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.3
--- src/sys/arch/arm/broadcom/bcm53xx_usb.c:1.2.4.2	Wed Nov 28 22:40:24 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_usb.c	Thu Nov 29 18:42:05 2012
@@ -26,12 +26,13 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#define USBH_PRIVATE
 
 #include "locators.h"
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.2.4.2 2012/11/28 22:40:24 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.2.4.3 2012/11/29 18:42:05 matt Exp $");
 
 #include 
 #include 
@@ -242,6 +243,14 @@ bcmusb_ccb_attach(device_t parent, devic
 	0x1000, &usbsc->usbsc_ohci_bsh);
 
 	/*
+	 * Bring the PHYs out of reset.
+	 */
+	bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ehci_bsh,
+	USBH_PHY_CTRL_P0, USBH_PHY_CTRL_INIT);
+	bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ehci_bsh,
+	USBH_PHY_CTRL_P1, USBH_PHY_CTRL_INIT);
+
+	/*
 	 * Disable interrupts
 	 */
 	bus_space_write_4(usbsc->usbsc_bst, usbsc->usbsc_ohci_bsh,



CVS commit: [matt-nb6-plus] src/sys/arch/arm/cortex

2012-11-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov 29 18:33:41 UTC 2012

Modified Files:
src/sys/arch/arm/cortex [matt-nb6-plus]: a9tmr.c

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.3.4.2 -r1.3.4.3 src/sys/arch/arm/cortex/a9tmr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/cortex/a9tmr.c
diff -u src/sys/arch/arm/cortex/a9tmr.c:1.3.4.2 src/sys/arch/arm/cortex/a9tmr.c:1.3.4.3
--- src/sys/arch/arm/cortex/a9tmr.c:1.3.4.2	Wed Nov 28 22:40:25 2012
+++ src/sys/arch/arm/cortex/a9tmr.c	Thu Nov 29 18:33:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9tmr.c,v 1.3.4.2 2012/11/28 22:40:25 matt Exp $	*/
+/*	$NetBSD: a9tmr.c,v 1.3.4.3 2012/11/29 18:33:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.3.4.2 2012/11/28 22:40:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.3.4.3 2012/11/29 18:33:41 matt Exp $");
 
 #include 
 #include 
@@ -196,7 +196,7 @@ a9tmr_init_cpu_clock(struct cpu_info *ci
 	 * Re-enable the comparator and now enable interrupts.
 	 */
 	a9tmr_global_write(sc, TMR_GBL_INT, 1);	/* clear interrupt pending */
-	ctl |= TMR_GBL_CTL_CMP_ENABLE | TMR_GBL_CTL_INT_ENABLE | TMR_GBL_CTL_AUTO_INC;
+	ctl |= TMR_GBL_CTL_CMP_ENABLE | TMR_GBL_CTL_INT_ENABLE | TMR_GBL_CTL_AUTO_INC | TMR_CTL_ENABLE;
 	a9tmr_global_write(sc, TMR_GBL_CTL, ctl);
 #if 0
 	printf("%s: %s: ctl %#x autoinc %u cmp %#x%08x now %#"PRIx64"\n",



CVS commit: [matt-nb6-plus] src/sys/compat/linux/arch/arm

2012-11-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Nov 29 16:31:01 UTC 2012

Modified Files:
src/sys/compat/linux/arch/arm [matt-nb6-plus]: linux_machdep.c

Log Message:
Sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.16.1 src/sys/compat/linux/arch/arm/linux_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/arm/linux_machdep.c
diff -u src/sys/compat/linux/arch/arm/linux_machdep.c:1.29 src/sys/compat/linux/arch/arm/linux_machdep.c:1.29.16.1
--- src/sys/compat/linux/arch/arm/linux_machdep.c:1.29	Wed Jul  7 01:30:33 2010
+++ src/sys/compat/linux/arch/arm/linux_machdep.c	Thu Nov 29 16:31:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.c,v 1.29 2010/07/07 01:30:33 chs Exp $	*/
+/*	$NetBSD: linux_machdep.c,v 1.29.16.1 2012/11/29 16:31:01 matt Exp $	*/
 
 /*-
  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29 2010/07/07 01:30:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29.16.1 2012/11/29 16:31:01 matt Exp $");
 
 #include 
 #include 
@@ -76,15 +76,14 @@ linux_setregs(struct lwp *l, struct exec
 void
 linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-	struct lwp *l = curlwp;
-	struct proc *p = l->l_proc;
-	struct trapframe *tf;
+	struct lwp * const l = curlwp;
+	struct proc * const p = l->l_proc;
+	struct trapframe * const tf = lwp_trapframe(l);
 	struct linux_sigframe *fp, frame;
 	int onstack, error;
 	const int sig = ksi->ksi_signo;
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-	tf = process_frame(l);
 
 	/*
 	 * The Linux version of this code is in
@@ -195,13 +194,11 @@ int
 linux_sys_sigreturn(struct lwp *l, const struct linux_sys_sigreturn_args *v,
 	register_t *retval)
 {
+	struct trapframe * const tf = lwp_trapframe(l);
+	struct proc * const p = l->l_proc;
 	struct linux_sigframe *sfp, frame;
-	struct proc *p = l->l_proc;
-	struct trapframe *tf;
 	sigset_t mask;
 
-	tf = process_frame(l);
-
 	/*
 	 * The trampoline code hands us the context.
 	 * It is unsafe to keep track of it ourselves, in the event that a
@@ -219,7 +216,6 @@ linux_sys_sigreturn(struct lwp *l, const
 		return EINVAL;
 
 	/* Restore register context. */
-	tf = process_frame(l);
 	tf->tf_r0= frame.sf_sc.sc_r0;
 	tf->tf_r1= frame.sf_sc.sc_r1;
 	tf->tf_r2= frame.sf_sc.sc_r2;



CVS commit: [matt-nb6-plus] src/sys

2012-11-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 22:59:09 UTC 2012

Modified Files:
src/sys/kern [matt-nb6-plus]: kern_kthread.c
src/sys/uvm [matt-nb6-plus]: uvm_extern.h uvm_glue.c

Log Message:
Pull from HEAD:
Add a __HAVE_CPU_UAREA_IDLELWP hook so that the MD code can allocate
special UAREAs for idle lwp's.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.10.1 src/sys/kern/kern_kthread.c
cvs rdiff -u -r1.181.2.1 -r1.181.2.1.2.1 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.156.2.3 -r1.156.2.3.2.1 src/sys/uvm/uvm_glue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_kthread.c
diff -u src/sys/kern/kern_kthread.c:1.38 src/sys/kern/kern_kthread.c:1.38.10.1
--- src/sys/kern/kern_kthread.c:1.38	Tue Nov  1 15:39:37 2011
+++ src/sys/kern/kern_kthread.c	Wed Nov 28 22:59:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_kthread.c,v 1.38 2011/11/01 15:39:37 jym Exp $	*/
+/*	$NetBSD: kern_kthread.c,v 1.38.10.1 2012/11/28 22:59:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.38 2011/11/01 15:39:37 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.38.10.1 2012/11/28 22:59:09 matt Exp $");
 
 #include 
 #include 
@@ -70,7 +70,8 @@ kthread_create(pri_t pri, int flag, stru
 
 	KASSERT((flag & KTHREAD_INTR) == 0 || (flag & KTHREAD_MPSAFE) != 0);
 
-	uaddr = uvm_uarea_system_alloc();
+	uaddr = uvm_uarea_system_alloc(
+	   (flag & (KTHREAD_INTR|KTHREAD_IDLE)) == KTHREAD_IDLE ? ci : NULL);
 	if (uaddr == 0) {
 		return ENOMEM;
 	}

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.181.2.1 src/sys/uvm/uvm_extern.h:1.181.2.1.2.1
--- src/sys/uvm/uvm_extern.h:1.181.2.1	Thu Apr 12 17:05:37 2012
+++ src/sys/uvm/uvm_extern.h	Wed Nov 28 22:59:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.181.2.1 2012/04/12 17:05:37 riz Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.181.2.1.2.1 2012/11/28 22:59:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -611,7 +611,7 @@ bool			uvm_kernacc(void *, size_t, vm_pr
 __dead void		uvm_scheduler(void);
 vaddr_t			uvm_uarea_alloc(void);
 void			uvm_uarea_free(vaddr_t);
-vaddr_t			uvm_uarea_system_alloc(void);
+vaddr_t			uvm_uarea_system_alloc(struct cpu_info *);
 void			uvm_uarea_system_free(vaddr_t);
 vaddr_t			uvm_lwp_getuarea(lwp_t *);
 void			uvm_lwp_setuarea(lwp_t *, vaddr_t);

Index: src/sys/uvm/uvm_glue.c
diff -u src/sys/uvm/uvm_glue.c:1.156.2.3 src/sys/uvm/uvm_glue.c:1.156.2.3.2.1
--- src/sys/uvm/uvm_glue.c:1.156.2.3	Thu Apr 12 17:05:37 2012
+++ src/sys/uvm/uvm_glue.c	Wed Nov 28 22:59:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_glue.c,v 1.156.2.3 2012/04/12 17:05:37 riz Exp $	*/
+/*	$NetBSD: uvm_glue.c,v 1.156.2.3.2.1 2012/11/28 22:59:09 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.156.2.3 2012/04/12 17:05:37 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.156.2.3.2.1 2012/11/28 22:59:09 matt Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_kstack.h"
@@ -366,8 +366,12 @@ uvm_uarea_alloc(void)
 }
 
 vaddr_t
-uvm_uarea_system_alloc(void)
+uvm_uarea_system_alloc(struct cpu_info *ci)
 {
+#ifdef __HAVE_CPU_UAREA_ALLOC_IDLELWP
+	if (__predict_false(ci != NULL))
+		return cpu_uarea_alloc_idlelwp(ci);
+#endif
 
 	return (vaddr_t)pool_cache_get(uvm_uarea_system_cache, PR_WAITOK);
 }



CVS commit: [matt-nb6-plus] src/sys/sys

2012-11-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 22:52:53 UTC 2012

Modified Files:
src/sys/sys [matt-nb6-plus]: lwp.h

Log Message:
Pulled from HEAD:
Don't give a boost to system threads.


To generate a diff of this commit:
cvs rdiff -u -r1.159.2.1.2.1 -r1.159.2.1.2.2 src/sys/sys/lwp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.159.2.1.2.1 src/sys/sys/lwp.h:1.159.2.1.2.2
--- src/sys/sys/lwp.h:1.159.2.1.2.1	Thu Nov  1 16:45:04 2012
+++ src/sys/sys/lwp.h	Wed Nov 28 22:52:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.159.2.1.2.1 2012/11/01 16:45:04 matt Exp $	*/
+/*	$NetBSD: lwp.h,v 1.159.2.1.2.2 2012/11/28 22:52:52 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
@@ -416,7 +416,7 @@ lwp_eprio(lwp_t *l)
 	pri_t pri;
 
 	pri = l->l_priority;
-	if (l->l_kpriority && pri < PRI_KERNEL)
+	if ((l->l_flag & LW_SYSTEM) == 0 && l->l_kpriority && pri < PRI_KERNEL)
 		pri = (pri >> 1) + l->l_kpribase;
 	return MAX(l->l_inheritedprio, pri);
 }



CVS commit: [matt-nb6-plus] src/sys/arch/arm/include

2012-11-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 22:45:22 UTC 2012

Modified Files:
src/sys/arch/arm/include [matt-nb6-plus]: lock.h types.h

Log Message:
Make __swp for the kernel return unsigned char and restore __cpu_simple_lock_t
(match what -HEAD has).


To generate a diff of this commit:
cvs rdiff -u -r1.17.42.1 -r1.17.42.2 src/sys/arch/arm/include/lock.h
cvs rdiff -u -r1.21.8.1 -r1.21.8.2 src/sys/arch/arm/include/types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/lock.h
diff -u src/sys/arch/arm/include/lock.h:1.17.42.1 src/sys/arch/arm/include/lock.h:1.17.42.2
--- src/sys/arch/arm/include/lock.h:1.17.42.1	Wed Nov 28 22:40:29 2012
+++ src/sys/arch/arm/include/lock.h	Wed Nov 28 22:45:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.17.42.1 2012/11/28 22:40:29 matt Exp $	*/
+/*	$NetBSD: lock.h,v 1.17.42.2 2012/11/28 22:45:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@ __cpu_simple_lock_set(__cpu_simple_lock_
 #endif
 
 #if defined(_KERNEL)
-static __inline __cpu_simple_lock_t
+static __inline unsigned char
 __swp(__cpu_simple_lock_t __val, volatile __cpu_simple_lock_t *__ptr)
 {
 #ifdef _ARM_ARCH_6

Index: src/sys/arch/arm/include/types.h
diff -u src/sys/arch/arm/include/types.h:1.21.8.1 src/sys/arch/arm/include/types.h:1.21.8.2
--- src/sys/arch/arm/include/types.h:1.21.8.1	Wed Nov 28 22:40:30 2012
+++ src/sys/arch/arm/include/types.h	Wed Nov 28 22:45:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.21.8.1 2012/11/28 22:40:30 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.21.8.2 2012/11/28 22:45:22 matt Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -73,17 +73,9 @@ typedef unsigned long	pmc_ctr_t;
  * to user-space, we don't want ABI breakage there.
  */
 #if defined(_KERNEL)
-typedef 
-#if __GNUC_PREREQ__(4,5)
-	volatile
-#endif
-	unsigned char	__cpu_simple_lock_t;
+typedef volatile unsigned char	__cpu_simple_lock_t;
 #else
-typedef
-#if __GNUC_PREREQ__(4,5)
-	volatile
-#endif
-	int		__cpu_simple_lock_t;
+typedef volatile int		__cpu_simple_lock_t;
 #endif /* _KERNEL */
 
 #define	__SIMPLELOCK_LOCKED	1



CVS commit: [matt-nb6-plus] src/sys/dev/pci

2012-11-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 22:31:49 UTC 2012

Modified Files:
src/sys/dev/pci [matt-nb6-plus]: pcireg.h

Log Message:
Add LCSR definitions and NVM storage subclass.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.10.1 src/sys/dev/pci/pcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.73 src/sys/dev/pci/pcireg.h:1.73.10.1
--- src/sys/dev/pci/pcireg.h:1.73	Wed Aug 17 00:59:47 2011
+++ src/sys/dev/pci/pcireg.h	Wed Nov 28 22:31:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.73 2011/08/17 00:59:47 dyoung Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.73.10.1 2012/11/28 22:31:47 matt Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -179,6 +179,7 @@ typedef u_int8_t pci_revision_t;
 #define	PCI_SUBCLASS_MASS_STORAGE_ATA		0x05
 #define	PCI_SUBCLASS_MASS_STORAGE_SATA		0x06
 #define	PCI_SUBCLASS_MASS_STORAGE_SAS		0x07
+#define	PCI_SUBCLASS_MASS_STORAGE_NVM		0x08
 #define	PCI_SUBCLASS_MASS_STORAGE_MISC		0x80
 
 /* 0x02 network subclasses */
@@ -656,6 +657,17 @@ struct pci_msix_table_entry {
 #define PCI_PCIE_LCSR		0x10	/* Link Control & Status Register */
 #define PCI_PCIE_LCSR_ASPM_L0S	__BIT(0)
 #define PCI_PCIE_LCSR_ASPM_L1	__BIT(1)
+#define PCI_PCIE_LCSR_RCB	__BIT(3)
+#define PCI_PCIE_LCSR_LINK_DIS	__BIT(4)
+#define PCI_PCIE_LCSR_RETRAIN	__BIT(5)
+#define PCI_PCIE_LCSR_COMCLKCFG	__BIT(6)
+#define PCI_PCIE_LCSR_EXTNDSYNC	__BIT(7)
+#define PCI_PCIE_LCSR_ENCLKPM	__BIT(8)
+#define	PCI_PCIE_LCSR_LINKSPEED	__BITS(19,16)
+#define	PCI_PCIE_LCSR_NLW	__BITS(25,20)
+#define	PCI_PCIE_LCSR_LINKTRAIN	__BIT(27)
+#define	PCI_PCIE_LCSR_SLOTCLKCFG __BIT(28)
+#define	PCI_PCIE_LCSR_DLACTIVE	__BIT(29)
 #define PCI_PCIE_SLCAP		0x14	/* Slot Capabilities Register */
 #define PCI_PCIE_SLCAP_ABP	__BIT(0)	/* Attention Button Present */
 #define PCI_PCIE_SLCAP_PCP	__BIT(1)	/* Power Controller Present */



CVS commit: [matt-nb6-plus] src/sys/lib/libkern/arch/arm

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 02:25:44 UTC 2012

Modified Files:
src/sys/lib/libkern/arch/arm [matt-nb6-plus]: Makefile.inc

Log Message:
Deal with div/mod changes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.20.1 src/sys/lib/libkern/arch/arm/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/arch/arm/Makefile.inc
diff -u src/sys/lib/libkern/arch/arm/Makefile.inc:1.9 src/sys/lib/libkern/arch/arm/Makefile.inc:1.9.20.1
--- src/sys/lib/libkern/arch/arm/Makefile.inc:1.9	Fri Aug 14 19:23:53 2009
+++ src/sys/lib/libkern/arch/arm/Makefile.inc	Wed Nov 28 02:25:43 2012
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.9 2009/08/14 19:23:53 dsl Exp $
+#	$NetBSD: Makefile.inc,v 1.9.20.1 2012/11/28 02:25:43 matt Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S
 SRCS+=	ffs.S
-SRCS+=	divsi3.S clzsi2.S
+SRCS+=	divsi3.S udivsi3.S divide.S clzsi2.S modsi3.S umodsi3.S
 SRCS+=	memcmp.S memcpy.S memset.S memmove.S strcmp.S strncmp.S



CVS commit: [matt-nb6-plus] src/lib/libc/arch/arm

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 02:21:41 UTC 2012

Modified Files:
src/lib/libc/arch/arm [matt-nb6-plus]: Makefile.inc
src/lib/libc/arch/arm/gen [matt-nb6-plus]: _lwp.c makecontext.c
swapcontext.S
Added Files:
src/lib/libc/arch/arm [matt-nb6-plus]: genassym.cf

Log Message:
Pullup EABI changes.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.4.1 src/lib/libc/arch/arm/Makefile.inc
cvs rdiff -u -r0 -r1.1.6.2 src/lib/libc/arch/arm/genassym.cf
cvs rdiff -u -r1.5 -r1.5.8.1 src/lib/libc/arch/arm/gen/_lwp.c
cvs rdiff -u -r1.3 -r1.3.26.1 src/lib/libc/arch/arm/gen/makecontext.c
cvs rdiff -u -r1.5.26.1 -r1.5.26.2 src/lib/libc/arch/arm/gen/swapcontext.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/arm/Makefile.inc
diff -u src/lib/libc/arch/arm/Makefile.inc:1.10 src/lib/libc/arch/arm/Makefile.inc:1.10.4.1
--- src/lib/libc/arch/arm/Makefile.inc:1.10	Fri Nov 18 16:10:02 2011
+++ src/lib/libc/arch/arm/Makefile.inc	Wed Nov 28 02:21:41 2012
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.10 2011/11/18 16:10:02 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.10.4.1 2012/11/28 02:21:41 matt Exp $
 
 .include 
 
 SRCS+=	__aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
 
-CPPFLAGS += -DSOFTFLOAT
+CPPFLAGS += -I.
+CPPFLAGS += -DSOFTFLOAT -I.
 
 SOFTFLOAT_BITS=32
 .include 

Index: src/lib/libc/arch/arm/gen/_lwp.c
diff -u src/lib/libc/arch/arm/gen/_lwp.c:1.5 src/lib/libc/arch/arm/gen/_lwp.c:1.5.8.1
--- src/lib/libc/arch/arm/gen/_lwp.c:1.5	Thu Feb 24 04:28:41 2011
+++ src/lib/libc/arch/arm/gen/_lwp.c	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.5.8.1 2012/11/28 02:21:41 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:41 joerg Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.5.8.1 2012/11/28 02:21:41 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -50,7 +50,7 @@ void
 _lwp_makecontext(ucontext_t *u, void (*start)(void *),
 void *arg, void *private, caddr_t stack_base, size_t stack_size)
 {
-	void **sp;
+	uintptr_t sp;
 
 	getcontext(u);
 	u->uc_link = NULL;
@@ -58,16 +58,15 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u->uc_stack.ss_sp = stack_base;
 	u->uc_stack.ss_size = stack_size;
 
-	sp = (void **) (stack_base + stack_size);
-
+	sp = (uintptr_t)stack_base + stack_size;
 	/*
 	 * Note: We make sure the stack is 8-byte aligned, here.
 	 */
 
-	u->uc_mcontext.__gregs[_REG_R0] = (__greg_t) arg;
-	u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t) sp) & ~7;
-	u->uc_mcontext.__gregs[_REG_LR] = (__greg_t) _lwp_exit;
-	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t) start;
-	u->uc_mcontext._mc_tlsbase = (uintptr_t)private;
+	u->uc_mcontext.__gregs[_REG_R0] = (__greg_t)(uintptr_t)arg;
+	u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t)sp) & ~7;
+	u->uc_mcontext.__gregs[_REG_LR] = (__greg_t)(uintptr_t)_lwp_exit;
+	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t)(uintptr_t)start;
+	u->uc_mcontext._mc_tlsbase = (__greg_t)(uintptr_t)private;
 	u->uc_flags |= _UC_TLSBASE;
 }

Index: src/lib/libc/arch/arm/gen/makecontext.c
diff -u src/lib/libc/arch/arm/gen/makecontext.c:1.3 src/lib/libc/arch/arm/gen/makecontext.c:1.3.26.1
--- src/lib/libc/arch/arm/gen/makecontext.c:1.3	Mon Apr 28 20:22:55 2008
+++ src/lib/libc/arch/arm/gen/makecontext.c	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.3.26.1 2012/11/28 02:21:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.3 2008/04/28 20:22:55 martin Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.3.26.1 2012/11/28 02:21:41 matt Exp $");
 #endif
 
 #include 
@@ -55,12 +55,12 @@ makecontext(ucontext_t *ucp, void (*func
 	/* Allocate necessary stack space for arguments exceeding r0-3. */
 	if (argc > 4)
 		sp -= argc - 4;
-	gr[_REG_SP] = (__greg_t)sp;
+	gr[_REG_SP] = (__greg_t)(uintptr_t)sp;
 	/* Wipe out frame pointer. */
 	gr[_REG_FP] = 0;
 	/* Arrange for return via the trampoline code. */
-	gr[_REG_LR] = (__greg_t)_resumecontext;
-	gr[_REG_PC] = (__greg_t)func;
+	gr[_REG_LR] = (__greg_t)(uintptr_t)_resumecontext;
+	gr[_REG_PC] = (__greg_t)(uintptr_t)func;
 
 	va_start(ap, argc);
 	/* Pass up to four arguments in r0-3. */

Index: src/lib/libc/arch/arm/gen/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.1 src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.2
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.5.26.1	Thu Nov  1 16:44:57 2012
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Wed Nov 28 02:21:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.

CVS commit: [matt-nb6-plus] src

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 01:53:43 UTC 2012

Modified Files:
src/common/lib/libc/arch/arm/gen [matt-nb6-plus]: divsi3.S
src/lib/libc/arch/arm/gen [matt-nb6-plus]: Makefile.inc
Added Files:
src/common/lib/libc/arch/arm/gen [matt-nb6-plus]: divide.S modsi3.S
udivsi3.S umodsi3.S

Log Message:
Merge from HEAD.
split udivsi3 and divsi3 to fix static linking.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.6.2 src/common/lib/libc/arch/arm/gen/divide.S \
src/common/lib/libc/arch/arm/gen/udivsi3.S
cvs rdiff -u -r1.1 -r1.1.54.1 src/common/lib/libc/arch/arm/gen/divsi3.S
cvs rdiff -u -r0 -r1.2.2.2 src/common/lib/libc/arch/arm/gen/modsi3.S \
src/common/lib/libc/arch/arm/gen/umodsi3.S
cvs rdiff -u -r1.16.8.2 -r1.16.8.2.2.1 src/lib/libc/arch/arm/gen/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/gen/divsi3.S
diff -u src/common/lib/libc/arch/arm/gen/divsi3.S:1.1 src/common/lib/libc/arch/arm/gen/divsi3.S:1.1.54.1
--- src/common/lib/libc/arch/arm/gen/divsi3.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/arm/gen/divsi3.S	Wed Nov 28 01:53:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: divsi3.S,v 1.1 2005/12/20 19:28:49 christos Exp $	*/
+/*	$NetBSD: divsi3.S,v 1.1.54.1 2012/11/28 01:53:42 matt Exp $	*/
 
 /*
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -16,371 +16,5 @@
 
 #include 
 
-/* 
- * stack is aligned as there's a possibility of branching to .L_overflow
- * which makes a C call
- */
-
-ENTRY(__umodsi3)
-	stmfd	sp!, {lr}
-	sub	sp, sp, #4	/* align stack */
-	bl	.L_udivide
-	add	sp, sp, #4	/* unalign stack */
-	mov	r0, r1
-	ldmfd	sp!, {pc}
-
-ENTRY(__modsi3)
-	stmfd	sp!, {lr}
-	sub	sp, sp, #4	/* align stack */
-	bl	.L_divide
-	add	sp, sp, #4	/* unalign stack */
-	mov	r0, r1
-	ldmfd	sp!, {pc}
-
-.L_overflow:
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-	mov	r0, #8			/* SIGFPE */
-	bl	PIC_SYM(_C_LABEL(raise), PLT)	/* raise it */
-	mov	r0, #0
-#else
-	/* XXX should cause a fatal error */
-	mvn	r0, #0
-#endif
-	RET
-
-ENTRY(__udivsi3)
-.L_udivide:/* r0 = r0 / r1; r1 = r0 % r1 */
-	eor r0, r1, r0 
-	eor r1, r0, r1 
-	eor r0, r1, r0 
-	/* r0 = r1 / r0; r1 = r1 % r0 */
-	cmp	r0, #1
-	bcc	.L_overflow
-	beq	.L_divide_l0
-	mov	ip, #0
-	movs	r1, r1
-	bpl	.L_divide_l1
-	orr	ip, ip, #0x2000	/* ip bit 0x2000 = -ve r1 */
-	movs	r1, r1, lsr #1
-	orrcs	ip, ip, #0x1000	/* ip bit 0x1000 = bit 0 of r1 */
-	b	.L_divide_l1
-
-.L_divide_l0:/* r0 == 1 */
-	mov	r0, r1
-	mov	r1, #0
-	RET
-
 ENTRY(__divsi3)
-.L_divide:/* r0 = r0 / r1; r1 = r0 % r1 */
-	eor r0, r1, r0 
-	eor r1, r0, r1 
-	eor r0, r1, r0 
-	/* r0 = r1 / r0; r1 = r1 % r0 */
-	cmp	r0, #1
-	bcc	.L_overflow
-	beq	.L_divide_l0
-	ands	ip, r0, #0x8000
-	rsbmi	r0, r0, #0
-	ands	r2, r1, #0x8000
-	eor	ip, ip, r2
-	rsbmi	r1, r1, #0
-	orr	ip, r2, ip, lsr #1	/* ip bit 0x4000 = -ve division */
-	/* ip bit 0x8000 = -ve remainder */
-
-.L_divide_l1:
-	mov	r2, #1
-	mov	r3, #0
-
-	/*
-	 * If the highest bit of the dividend is set, we have to be
-	 * careful when shifting the divisor. Test this. 
-	 */
-	movs	r1,r1
-	bpl	.L_old_code
-
-	/*
-	 * At this point, the highest bit of r1 is known to be set.
-	 * We abuse this below in the tst instructions.
-	 */
-	tst	r1, r0 /*, lsl #0 */
-	bmi	.L_divide_b1
-	tst	r1, r0, lsl #1
-	bmi	.L_divide_b2
-	tst	r1, r0, lsl #2
-	bmi	.L_divide_b3
-	tst	r1, r0, lsl #3
-	bmi	.L_divide_b4
-	tst	r1, r0, lsl #4
-	bmi	.L_divide_b5
-	tst	r1, r0, lsl #5
-	bmi	.L_divide_b6
-	tst	r1, r0, lsl #6
-	bmi	.L_divide_b7
-	tst	r1, r0, lsl #7
-	bmi	.L_divide_b8
-	tst	r1, r0, lsl #8
-	bmi	.L_divide_b9
-	tst	r1, r0, lsl #9
-	bmi	.L_divide_b10
-	tst	r1, r0, lsl #10
-	bmi	.L_divide_b11
-	tst	r1, r0, lsl #11
-	bmi	.L_divide_b12
-	tst	r1, r0, lsl #12
-	bmi	.L_divide_b13
-	tst	r1, r0, lsl #13
-	bmi	.L_divide_b14
-	tst	r1, r0, lsl #14
-	bmi	.L_divide_b15
-	tst	r1, r0, lsl #15
-	bmi	.L_divide_b16
-	tst	r1, r0, lsl #16
-	bmi	.L_divide_b17
-	tst	r1, r0, lsl #17
-	bmi	.L_divide_b18
-	tst	r1, r0, lsl #18
-	bmi	.L_divide_b19
-	tst	r1, r0, lsl #19
-	bmi	.L_divide_b20
-	tst	r1, r0, lsl #20
-	bmi	.L_divide_b21
-	tst	r1, r0, lsl #21
-	bmi	.L_divide_b22
-	tst	r1, r0, lsl #22
-	bmi	.L_divide_b23
-	tst	r1, r0, lsl #23
-	bmi	.L_divide_b24
-	tst	r1, r0, lsl #24
-	bmi	.L_divide_b25
-	tst	r1, r0, lsl #25
-	bmi	.L_divide_b26
-	tst	r1, r0, lsl #26
-	bmi	.L_divide_b27
-	tst	r1, r0, lsl #27
-	bmi	.L_divide_b28
-	tst	r1, r0, lsl #28
-	bmi	.L_divide_b29
-	tst	r1, r0, lsl #29
-	bmi	.L_divide_b30
-	tst	r1, r0, lsl #30
-	bmi	.L_divide_b31
-/*
- * instead of:
- *	tst	r1, r0, lsl #31
- *	bmi	.L_divide_b32
- */
-	b	.L_divide_b32
-
-.L_old_code:
-	cmp	r1, r0
-	bcc	.L_divide_b0
-	cmp	r1, r0, lsl #1
-	bcc	.L_divide_b1
-	cmp	r1, r0, lsl #2
-	bcc	.L_divide_b2
-	cmp	r1, r0, lsl #3
-	bc

CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/gen

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 28 01:45:27 UTC 2012

Modified Files:
src/common/lib/libc/arch/arm/gen [matt-nb6-plus]: byte_swap_2.S
byte_swap_4.S

Log Message:
Use rev/rev16 on armv6 and later.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.24.1 src/common/lib/libc/arch/arm/gen/byte_swap_2.S \
src/common/lib/libc/arch/arm/gen/byte_swap_4.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/gen/byte_swap_2.S
diff -u src/common/lib/libc/arch/arm/gen/byte_swap_2.S:1.4 src/common/lib/libc/arch/arm/gen/byte_swap_2.S:1.4.24.1
--- src/common/lib/libc/arch/arm/gen/byte_swap_2.S:1.4	Mon Apr 28 20:22:52 2008
+++ src/common/lib/libc/arch/arm/gen/byte_swap_2.S	Wed Nov 28 01:45:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap_2.S,v 1.4 2008/04/28 20:22:52 martin Exp $	*/
+/*	$NetBSD: byte_swap_2.S,v 1.4.24.1 2012/11/28 01:45:26 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -41,7 +41,11 @@ _ENTRY(_C_LABEL(ntohs))
 _ENTRY(_C_LABEL(htons))
 #endif
 _PROF_PROLOGUE
+#ifdef _ARM_ARCH_6
+	rev16		r0, r0
+#else
 	and		r1, r0, #0xff
 	mov		r0, r0, lsr #8
 	orr		r0, r0, r1, lsl #8
+#endif
 	RET
Index: src/common/lib/libc/arch/arm/gen/byte_swap_4.S
diff -u src/common/lib/libc/arch/arm/gen/byte_swap_4.S:1.4 src/common/lib/libc/arch/arm/gen/byte_swap_4.S:1.4.24.1
--- src/common/lib/libc/arch/arm/gen/byte_swap_4.S:1.4	Mon Apr 28 20:22:52 2008
+++ src/common/lib/libc/arch/arm/gen/byte_swap_4.S	Wed Nov 28 01:45:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap_4.S,v 1.4 2008/04/28 20:22:52 martin Exp $	*/
+/*	$NetBSD: byte_swap_4.S,v 1.4.24.1 2012/11/28 01:45:26 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -41,8 +41,12 @@ _ENTRY(_C_LABEL(ntohl))
 _ENTRY(_C_LABEL(htonl))
 #endif
 _PROF_PROLOGUE
+#ifdef _ARM_ARCH_6
+	rev		r0, r0
+#else
 	eor		r1, r0, r0, ror #16
 	bic		r1, r1, #0x00FF
 	mov		r0, r0, ror #8
 	eor		r0, r0, r1, lsr #8
+#endif
 	RET



CVS commit: [matt-nb6-plus] src/common/lib/libc/arch/arm/atomic

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 27 23:42:35 UTC 2012

Modified Files:
src/common/lib/libc/arch/arm/atomic [matt-nb6-plus]: Makefile.inc
atomic_add_32.S atomic_and_32.S atomic_cas_32.S atomic_cas_8.S
atomic_dec_32.S atomic_inc_32.S atomic_op_asm.h atomic_or_32.S
atomic_swap.S membar_ops.S
Added Files:
src/common/lib/libc/arch/arm/atomic [matt-nb6-plus]: atomic_add_64.S
atomic_and_64.S atomic_cas_64.S atomic_dec_64.S atomic_inc_64.S
atomic_or_64.S atomic_swap_64.S

Log Message:
Pull atomic ops from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.12.1 \
src/common/lib/libc/arch/arm/atomic/Makefile.inc
cvs rdiff -u -r1.2 -r1.2.24.1 \
src/common/lib/libc/arch/arm/atomic/atomic_add_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_and_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_dec_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_inc_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h \
src/common/lib/libc/arch/arm/atomic/atomic_or_32.S \
src/common/lib/libc/arch/arm/atomic/atomic_swap.S \
src/common/lib/libc/arch/arm/atomic/membar_ops.S
cvs rdiff -u -r0 -r1.3.4.2 \
src/common/lib/libc/arch/arm/atomic/atomic_add_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S
cvs rdiff -u -r0 -r1.2.4.2 \
src/common/lib/libc/arch/arm/atomic/atomic_and_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_dec_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_or_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_swap_64.S
cvs rdiff -u -r1.1 -r1.1.12.1 \
src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.8 src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.8.12.1
--- src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.8	Sun Jan  4 17:54:29 2009
+++ src/common/lib/libc/arch/arm/atomic/Makefile.inc	Tue Nov 27 23:42:34 2012
@@ -1,19 +1,43 @@
-#	$NetBSD: Makefile.inc,v 1.8 2009/01/04 17:54:29 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.8.12.1 2012/11/27 23:42:34 matt Exp $
+
+ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
+ARMV6+= ${CFLAGS:M-march=armv7*:} ${CFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
+ARMV6+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
 
 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread" \
 	|| ${LIB} == "rump")
 
-SRCS+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
-	atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
-	atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
-	atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops_nop.c
+.if empty(ARMV6)
+SRCS.atomic+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c \
+		atomic_and_32_cas.c atomic_and_32_nv_cas.c \
+		atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
+		atomic_inc_32_cas.c atomic_inc_32_nv_cas.c \
+		atomic_or_32_cas.c atomic_or_32_nv_cas.c \
+		atomic_swap_32_cas.c membar_ops_nop.c
+.else
+SRCS.atomic+=	atomic_add_32.S atomic_and_32.S atomic_cas_32.S
+SRCS.atomic+=	atomic_dec_32.S atomic_inc_32.S atomic_or_32.S
+SRCS.atomic+=	atomic_swap.S membar_ops.S
+SRCS.atomic+=	atomic_add_64.S atomic_and_64.S atomic_cas_64.S
+SRCS.atomic+=	atomic_dec_64.S atomic_inc_64.S atomic_or_64.S
+SRCS.atomic+=	atomic_swap_64.S
+.endif
 
 .endif
 
 .if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
 
-SRCS+=	atomic_init_testset.c
-SRCS+=	atomic_cas_up.S
+.if empty(ARMV6)
+SRCS.atomic+=	atomic_init_testset.c
+SRCS.atomic+=	atomic_cas_up.S
 CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
+.else
+SRCS.atomic+=	atomic_init_cas.c
+.endif
 
 .endif
+
+SRCS+=	${SRCS.atomic}

Index: src/common/lib/libc/arch/arm/atomic/atomic_add_32.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_add_32.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_add_32.S:1.2.24.1
--- src/common/lib/libc/arch/arm/atomic/atomic_add_32.S:1.2	Sat Aug 16 07:12:39 2008
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_32.S	Tue Nov 27 23:42:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_add_32.S,v 1.2 2008/08/16 07:12:39 matt Exp $	*/
+/*	$NetBSD: atomic_add_32.S,v 1.2.24.1 2012/11/27 23:42:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -40,6 +40,11 @@ ENTRY_NP(_atomic_add_32)
 	strex	ip, r2, [r3]		/* try to store */
 	cmp	ip, #0			/*   succeed? */
 	bne	1b			/* no, try again */
+#ifdef _ARM_ARCH_7
+	dmb
+#else
+	mcr	p15, 0, ip, c7, c10, 5	/* data memory barrier */
+#endif
 	R

CVS commit: [matt-nb6-plus] src/gnu/dist/gcc4/libcpp

2012-11-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 27 22:18:50 UTC 2012

Modified Files:
src/gnu/dist/gcc4/libcpp [matt-nb6-plus]: init.c macro.c
src/gnu/dist/gcc4/libcpp/include [matt-nb6-plus]: cpplib.h

Log Message:
Pull from HEAD:
Teach gcc4.1's cpp about the magic __COUNTER__ macro,
which returns a unique integer each time it is expanded.
This code was written without reference to any other
implementation of the same feature.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.46.1 src/gnu/dist/gcc4/libcpp/init.c
cvs rdiff -u -r1.3 -r1.3.10.1 src/gnu/dist/gcc4/libcpp/macro.c
cvs rdiff -u -r1.2 -r1.2.10.1 src/gnu/dist/gcc4/libcpp/include/cpplib.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/gcc4/libcpp/init.c
diff -u src/gnu/dist/gcc4/libcpp/init.c:1.2 src/gnu/dist/gcc4/libcpp/init.c:1.2.46.1
--- src/gnu/dist/gcc4/libcpp/init.c:1.2	Fri May 12 00:24:43 2006
+++ src/gnu/dist/gcc4/libcpp/init.c	Tue Nov 27 22:18:49 2012
@@ -309,6 +309,7 @@ static const struct builtin builtin_arra
   B("__BASE_FILE__",	 BT_BASE_FILE),
   B("__LINE__",		 BT_SPECLINE),
   B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
+  B("__COUNTER__",	 BT_COUNTER),
   /* Keep builtins not used for -traditional-cpp at the end, and
  update init_builtins() if any more are added.  */
   B("_Pragma",		 BT_PRAGMA),

Index: src/gnu/dist/gcc4/libcpp/macro.c
diff -u src/gnu/dist/gcc4/libcpp/macro.c:1.3 src/gnu/dist/gcc4/libcpp/macro.c:1.3.10.1
--- src/gnu/dist/gcc4/libcpp/macro.c:1.3	Wed Nov 11 19:03:52 2009
+++ src/gnu/dist/gcc4/libcpp/macro.c	Tue Nov 27 22:18:49 2012
@@ -284,6 +284,14 @@ _cpp_builtin_macro_text (cpp_reader *pfi
   else
 	result = pfile->time;
   break;
+
+case BT_COUNTER:
+  {
+	static unsigned int counter = 0;
+
+	number = counter++;
+  }
+  break;
 }
 
   if (result == NULL)

Index: src/gnu/dist/gcc4/libcpp/include/cpplib.h
diff -u src/gnu/dist/gcc4/libcpp/include/cpplib.h:1.2 src/gnu/dist/gcc4/libcpp/include/cpplib.h:1.2.10.1
--- src/gnu/dist/gcc4/libcpp/include/cpplib.h:1.2	Wed Nov 11 19:03:52 2009
+++ src/gnu/dist/gcc4/libcpp/include/cpplib.h	Tue Nov 27 22:18:49 2012
@@ -551,6 +551,7 @@ enum builtin_type
   BT_BASE_FILE,			/* `__BASE_FILE__' */
   BT_INCLUDE_LEVEL,		/* `__INCLUDE_LEVEL__' */
   BT_TIME,			/* `__TIME__' */
+  BT_COUNTER,			/* `__COUNTER__' */
   BT_STDC,			/* `__STDC__' */
   BT_PRAGMA			/* `_Pragma' operator */
 };



CVS commit: [matt-nb6-plus] src/gnu/dist/gcc4/gcc/config/arm

2012-11-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 21 08:54:21 UTC 2012

Modified Files:
src/gnu/dist/gcc4/gcc/config/arm [matt-nb6-plus]: arm-cores.def arm.c

Log Message:
Let gcc match -march=armv7a and -mcpu=cortex-a[89].


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.46.1 \
src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.30.1 src/gnu/dist/gcc4/gcc/config/arm/arm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1 src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1.46.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1	Thu Apr 20 09:50:55 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def	Wed Nov 21 08:54:21 2012
@@ -115,3 +115,7 @@ ARM_CORE("arm1176jz-s",	  arm1176jzs,	6Z
 ARM_CORE("arm1176jzf-s",  arm1176jzfs,	6ZK, FL_LDSCHED | FL_VFPV2, 9e)
 ARM_CORE("mpcorenovfp",	  mpcorenovfp,	6K, FL_LDSCHED, 9e)
 ARM_CORE("mpcore",	  mpcore,	6K, FL_LDSCHED | FL_VFPV2, 9e)
+
+/* V7 Architecture Processors */
+ARM_CORE("cortex-a8", cortexa8,	7A, FL_LDSCHED | FL_VFPV2, 9e)
+ARM_CORE("cortex-a9", cortexa9,	7A, FL_LDSCHED | FL_VFPV2, 9e)

Index: src/gnu/dist/gcc4/gcc/config/arm/arm.c
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm.c:1.1.1.4 src/gnu/dist/gcc4/gcc/config/arm/arm.c:1.1.1.4.30.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm.c:1.1.1.4	Sat Feb  2 22:48:58 2008
+++ src/gnu/dist/gcc4/gcc/config/arm/arm.c	Wed Nov 21 08:54:21 2012
@@ -433,6 +433,7 @@ static int thumb_call_reg_needed;
 #define FL_WBUF	  (1 << 14)	  /* Schedule for write buffer ops.
 	 Note: ARM6 & 7 derivatives only.  */
 #define FL_ARCH6K (1 << 15)   /* Architecture rel 6 K extensions.  */
+#define FL_ARCH7A (1 << 16)   /* Architecture rel 7.  */
 
 #define FL_IWMMXT (1 << 29)	  /* XScale v2 or "Intel Wireless MMX technology".  */
 
@@ -451,6 +452,7 @@ static int thumb_call_reg_needed;
 #define FL_FOR_ARCH6K	(FL_FOR_ARCH6 | FL_ARCH6K)
 #define FL_FOR_ARCH6Z	FL_FOR_ARCH6
 #define FL_FOR_ARCH6ZK	FL_FOR_ARCH6K
+#define FL_FOR_ARCH7A	(FL_ARCH7A | FL_FOR_ARCH6K)
 
 /* The bits in this mask specify which
instructions we are allowed to generate.  */
@@ -484,6 +486,9 @@ int arm_arch6 = 0;
 /* Nonzero if this chip supports the ARM 6K extensions.  */
 int arm_arch6k = 0;
 
+/* Nonzero if this chip supports the ARM Architecutre 7 extensions.  */
+int arm_arch7 = 0;
+
 /* Nonzero if this chip can benefit from load scheduling.  */
 int arm_ld_sched = 0;
 
@@ -596,6 +601,7 @@ static const struct processors all_archi
   {"armv6k",  mpcore,	  "6K",  FL_CO_PROC | FL_FOR_ARCH6K, NULL},
   {"armv6z",  arm1176jzs, "6Z",  FL_CO_PROC | FL_FOR_ARCH6Z, NULL},
   {"armv6zk", arm1176jzs, "6ZK", FL_CO_PROC | FL_FOR_ARCH6ZK, NULL},
+  {"armv7a",  cortexa8,	  "7A",  FL_CO_PROC | FL_FOR_ARCH7A, NULL},
   {"ep9312",  ep9312, "4T",  FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL},
   {"iwmmxt",  iwmmxt, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
   {NULL, arm_none, NULL, 0 , NULL}
@@ -1100,6 +1106,7 @@ arm_override_options (void)
   arm_arch5e = (insn_flags & FL_ARCH5E) != 0;
   arm_arch6 = (insn_flags & FL_ARCH6) != 0;
   arm_arch6k = (insn_flags & FL_ARCH6K) != 0;
+  arm_arch7 = (insn_flags & FL_ARCH7A) != 0;
   arm_arch_xscale = (insn_flags & FL_XSCALE) != 0;
   arm_arch_cirrus = (insn_flags & FL_CIRRUS) != 0;
 



CVS commit: [matt-nb6-plus] src/gnu/dist/binutils

2012-11-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 21 08:52:09 UTC 2012

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb6-plus]: tc-arm.c
src/gnu/dist/binutils/include/opcode [matt-nb6-plus]: arm.h
src/gnu/dist/binutils/opcodes [matt-nb6-plus]: arm-dis.c

Log Message:
Teach binutils (gas) just enough to handle some armv7 instructions
(dsb, dmb, isb, bfc, bfi, sbfx, ubfx) and the .arch pseudo-op.


To generate a diff of this commit:
cvs rdiff -u -r1.6.6.2 -r1.6.6.3 src/gnu/dist/binutils/gas/config/tc-arm.c
cvs rdiff -u -r1.2.6.2 -r1.2.6.3 src/gnu/dist/binutils/include/opcode/arm.h
cvs rdiff -u -r1.2.6.2 -r1.2.6.3 src/gnu/dist/binutils/opcodes/arm-dis.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.2 src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.3
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.6.6.2	Tue Nov 20 18:41:50 2012
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Wed Nov 21 08:52:09 2012
@@ -6746,6 +6746,186 @@ do_swi (char * str)
 }
 
 static void
+do_dsb (char * str)
+{
+  skip_whitespace (str);
+  /* Allow optional leading '#'.  */
+  if (is_immediate_prefix (*str))
+str++;
+
+  end_of_line (str);
+}
+
+static void
+do_bfci (char * str)
+{
+  expressionS expr;
+  unsigned long lsb;
+  unsigned long width;
+  int reg;
+
+  skip_whitespace (str);
+
+  if ((reg = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL)
+return;
+
+  if (reg == REG_PC)
+{
+  inst.error = BAD_PC;
+  return;
+}
+
+  if ((inst.instruction & 0xf) == 0)
+{
+  if ((reg == reg_required_here (&str, 0)) == FAIL
+	  || skip_past_comma (&str) == FAIL)
+	return;
+
+  if (reg == REG_PC)
+	{
+	  inst.error = BAD_PC;
+	  return;
+	}
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return FAIL;
+}
+
+  lsb = expr.X_add_number;
+  if (lsb > 31)
+{
+  inst.error = _("invalid lsb");
+  return;
+}
+
+  if (skip_past_comma (&str) == FAIL)
+return;
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return FAIL;
+}
+
+  width = expr.X_add_number;
+  if (lsb + width > 32 || width > 32 || width == 0)
+{
+  if (!inst.error)
+inst.error = _("invalid width");
+  return;
+}
+
+  inst.instruction |= (lsb << 7);
+  inst.instruction |= (lsb + width - 1) << 16;
+
+  end_of_line (str);
+}
+
+static void
+do_bfx (char * str)
+{
+  expressionS expr;
+  unsigned long lsb;
+  unsigned long width;
+  int rd, rn;
+
+  skip_whitespace (str);
+
+  if ((rd = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL
+  || (rn = reg_required_here (&str, 0)) == FAIL
+  || skip_past_comma (&str) == FAIL)
+{
+  inst.error = BAD_ARGS;
+  return;
+}
+  else if (rd == REG_PC || rn == REG_PC)
+{
+  inst.error = BAD_PC;
+  return;
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return FAIL;
+}
+
+  lsb = expr.X_add_number;
+  if (lsb > 31)
+{
+  inst.error = _("invalid lsb");
+  return;
+}
+
+  if (skip_past_comma (&str) == FAIL)
+{
+  inst.error = BAD_ARGS;
+  return;
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  width = expr.X_add_number;
+  if (lsb + width > 32 || width > 32 || width == 0)
+{
+  inst.error = _("invalid width");
+  return;
+}
+
+  inst.instruction |= (lsb << 7);
+  inst.instruction |= (width - 1) << 16;
+
+  end_of_line (str);
+}
+
+static void
 do_swap (char * str)
 {
   int reg;
@@ -10014,6 +10194,15 @@ static const struct asm_opcode insns[] =
   /*  ARM V6Z.  */
   { "smi",   0xe1600070, 3,  ARM_EXT_V6Z,  do_smi},
 
+  /*  ARM V7A.  */
+  { "dmb",   0xf57ff05f, 0,  ARM_EXT_V7A,  do_dsb},
+  { "dsb",   0xf57ff04f, 0,  ARM_EXT_V7A,  do_dsb},
+  { "isb",   0xf57ff06f, 0,  ARM_EXT_V7A,  do_dsb},
+  { "sbfx",  0xe7a00050, 4,  ARM_EXT_V7A,  do_bfx},
+  { "bfi

CVS commit: [matt-nb6-plus] src/external

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 21 01:04:34 UTC 2012

Modified Files:
src/external [matt-nb6-plus]: Makefile
src/external/gpl3 [matt-nb6-plus]: Makefile

Log Message:
Don't descend into gpl3 unless we are building a gpl3 tool.
Only build binutils if we want 2.19 [sic]


To generate a diff of this commit:
cvs rdiff -u -r1.16.6.1 -r1.16.6.1.2.1 src/external/Makefile
cvs rdiff -u -r1.6 -r1.6.6.1 src/external/gpl3/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/Makefile
diff -u src/external/Makefile:1.16.6.1 src/external/Makefile:1.16.6.1.2.1
--- src/external/Makefile:1.16.6.1	Mon Aug 13 23:18:23 2012
+++ src/external/Makefile	Wed Nov 21 01:04:33 2012
@@ -1,6 +1,11 @@
-#	$NetBSD: Makefile,v 1.16.6.1 2012/08/13 23:18:23 riz Exp $
+#	$NetBSD: Makefile,v 1.16.6.1.2.1 2012/11/21 01:04:33 matt Exp $
 
-SUBDIR+= apache2 atheros bsd intel-fw-eula intel-fw-public gpl2 gpl3 historical
-SUBDIR+= ibm-public public-domain cddl mit realtek
+.include 
+
+SUBDIR+= apache2 atheros bsd intel-fw-eula intel-fw-public gpl2
+.if ${HAVE_BINUTILS} == "219" || ${HAVE_GCC} == "45" || ${HAVE_GDB} == "7"
+SUBDIR+= gpl3
+.endif
+SUBDIR+= historical ibm-public public-domain cddl mit realtek
 
 .include 

Index: src/external/gpl3/Makefile
diff -u src/external/gpl3/Makefile:1.6 src/external/gpl3/Makefile:1.6.6.1
--- src/external/gpl3/Makefile:1.6	Mon Oct 31 08:14:44 2011
+++ src/external/gpl3/Makefile	Wed Nov 21 01:04:34 2012
@@ -1,10 +1,12 @@
-#	$NetBSD: Makefile,v 1.6 2011/10/31 08:14:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.6.6.1 2012/11/21 01:04:34 matt Exp $
 
 .include 
 
 .if ${MKBINUTILS} != "no"
+.if ${HAVE_BINUTILS} == "219"
 SUBDIR+=	binutils
 .endif
+.endif
 
 .if ${HAVE_GCC} == 45
 .if ${MKGCCCMDS} != "no"



CVS commit: [matt-nb6-plus] src/distrib/sets

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 21 00:07:37 UTC 2012

Modified Files:
src/distrib/sets [matt-nb6-plus]: mkvars.mk
src/distrib/sets/lists/base [matt-nb6-plus]: shl.mi
src/distrib/sets/lists/comp [matt-nb6-plus]: ad.arm shl.mi

Log Message:
Add HAVE_BINUTILS back.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.6.1 src/distrib/sets/mkvars.mk
cvs rdiff -u -r1.616.2.4.2.1 -r1.616.2.4.2.2 \
src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.38 -r1.38.6.1 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.209.2.4.2.1 -r1.209.2.4.2.2 \
src/distrib/sets/lists/comp/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/mkvars.mk
diff -u src/distrib/sets/mkvars.mk:1.6 src/distrib/sets/mkvars.mk:1.6.6.1
--- src/distrib/sets/mkvars.mk:1.6	Wed Nov  2 14:42:43 2011
+++ src/distrib/sets/mkvars.mk	Wed Nov 21 00:07:33 2012
@@ -1,9 +1,10 @@
-# $NetBSD: mkvars.mk,v 1.6 2011/11/02 14:42:43 he Exp $
+# $NetBSD: mkvars.mk,v 1.6.6.1 2012/11/21 00:07:33 matt Exp $
 
 MKEXTRAVARS= \
 	MACHINE \
 	MACHINE_ARCH \
 	MACHINE_CPU \
+	HAVE_BINUTILS \
 	HAVE_GCC \
 	HAVE_GDB \
 	HAS_SSP \

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.616.2.4.2.1 src/distrib/sets/lists/base/shl.mi:1.616.2.4.2.2
--- src/distrib/sets/lists/base/shl.mi:1.616.2.4.2.1	Thu Nov  1 16:44:47 2012
+++ src/distrib/sets/lists/base/shl.mi	Wed Nov 21 00:07:34 2012
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.616.2.4.2.1 2012/11/01 16:44:47 matt Exp $
+# $NetBSD: shl.mi,v 1.616.2.4.2.2 2012/11/21 00:07:34 matt Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -157,8 +157,10 @@
 ./usr/lib/libavl.sobase-zfs-shlib		dynamicroot,zfs
 ./usr/lib/libavl.so.0base-zfs-shlib		dynamicroot,zfs
 ./usr/lib/libavl.so.0.0  		base-zfs-shlib		zfs,dynamicroot
-./usr/lib/libbfd.so.12base-sys-shlib		binutils
-./usr/lib/libbfd.so.12.0			base-sys-shlib		binutils
+./usr/lib/libbfd.so.10base-sys-shlib		binutils=216
+./usr/lib/libbfd.so.10.0			base-sys-shlib		binutils=216
+./usr/lib/libbfd.so.12base-sys-shlib		binutils=219
+./usr/lib/libbfd.so.12.0			base-sys-shlib		binutils=219
 ./usr/lib/libbind9.sobase-bind-shlib
 ./usr/lib/libbind9.so.5base-bind-shlib
 ./usr/lib/libbind9.so.5.7			base-bind-shlib

Index: src/distrib/sets/lists/comp/ad.arm
diff -u src/distrib/sets/lists/comp/ad.arm:1.38 src/distrib/sets/lists/comp/ad.arm:1.38.6.1
--- src/distrib/sets/lists/comp/ad.arm:1.38	Mon Jul 18 17:39:05 2011
+++ src/distrib/sets/lists/comp/ad.arm	Wed Nov 21 00:07:34 2012
@@ -1,8 +1,9 @@
-# $NetBSD: ad.arm,v 1.38 2011/07/18 17:39:05 dyoung Exp $
+# $NetBSD: ad.arm,v 1.38.6.1 2012/11/21 00:07:34 matt Exp $
 ./usr/include/gcc-4.5/arm_neon.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/mmintrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/tgmath.h			comp-c-include		gcccmds,gcc=45
 ./usr/include/armcomp-c-include
+./usr/include/arm/aeabi.h			comp-c-include
 ./usr/include/arm/ansi.h			comp-c-include
 ./usr/include/arm/aout_machdep.h		comp-c-include
 ./usr/include/arm/arm26comp-c-include
@@ -27,6 +28,7 @@
 ./usr/include/arm/byte_swap.h			comp-c-include
 ./usr/include/arm/cdefs.h			comp-c-include
 ./usr/include/arm/cpu.hcomp-c-include
+./usr/include/arm/cpuconf.h			comp-c-include
 ./usr/include/arm/db_machdep.h			comp-obsolete		obsolete
 ./usr/include/arm/disklabel.h			comp-c-include
 ./usr/include/arm/disklabel_acorn.h		comp-obsolete		obsolete
@@ -70,6 +72,7 @@
 ./usr/include/arm/trap.h			comp-c-include
 ./usr/include/arm/types.h			comp-c-include
 ./usr/include/arm/varargs.h			comp-obsolete		obsolete
+./usr/include/arm/vfpreg.h			comp-c-include
 ./usr/include/arm/wchar_limits.h		comp-c-include
 ./usr/include/arm32/bootconfig.h		comp-obsolete		obsolete
 ./usr/include/arm32/cpufunc.h			comp-obsolete		obsolete

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.209.2.4.2.1 src/distrib/sets/lists/comp/shl.mi:1.209.2.4.2.2
--- src/distrib/sets/lists/comp/shl.mi:1.209.2.4.2.1	Thu Nov  1 16:44:51 2012
+++ src/distrib/sets/lists/comp/shl.mi	Wed Nov 21 00:07:36 2012
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.209.2.4.2.1 2012/11/01 16:44:51 matt Exp $
+# $NetBSD: shl.mi,v 1.209.2.4.2.2 2012/11/21 00:07:36 matt Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -94,8 +94,10 @@
 ./usr/lib/libnpf_pic.acomp-npf-piclib		npf
 ./usr/lib/libnvpair_pic.a			comp-zfs-piclib		zfs
 ./usr/lib/libobjc_pic.acomp-objc-piclib
-./usr/lib/libopcodes.so.5			comp-c-shlib		binutils
-./usr/lib/libopcodes.so.5.0			comp-c-shlib		binutils
+./usr/lib/libopcodes.so.3			comp-c-shlib		binutils=216
+./usr/lib/libopcodes.so.3.0			comp-c-shlib		binutils=216
+./usr/lib/libopcodes.so.5			comp-c-shlib		binutils=219
+./usr/l

CVS commit: [matt-nb6-plus] src/sys/arch/arm/include

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Nov 21 00:00:10 UTC 2012

Modified Files:
src/sys/arch/arm/include [matt-nb6-plus]: Makefile vfpreg.h
Added Files:
src/sys/arch/arm/include [matt-nb6-plus]: aeabi.h

Log Message:
Add aeabi.h, cpuconf.h, and vfpreg.h


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.10.1 src/sys/arch/arm/include/Makefile
cvs rdiff -u -r0 -r1.2.6.2 src/sys/arch/arm/include/aeabi.h
cvs rdiff -u -r1.1 -r1.1.56.1 src/sys/arch/arm/include/vfpreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/Makefile
diff -u src/sys/arch/arm/include/Makefile:1.40 src/sys/arch/arm/include/Makefile:1.40.10.1
--- src/sys/arch/arm/include/Makefile:1.40	Sun Jul 17 23:52:12 2011
+++ src/sys/arch/arm/include/Makefile	Wed Nov 21 00:00:10 2012
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.40 2011/07/17 23:52:12 dyoung Exp $
+#	$NetBSD: Makefile,v 1.40.10.1 2012/11/21 00:00:10 matt Exp $
 
 INCSDIR= /usr/include/arm
 
-INCS=	ansi.h aout_machdep.h armreg.h asm.h atomic.h \
+INCS=	aeabi.h ansi.h aout_machdep.h armreg.h asm.h atomic.h \
 	bswap.h byte_swap.h \
-	cdefs.h cpu.h \
+	cdefs.h cpu.h cpuconf.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \
 	float.h fp.h frame.h \
@@ -18,6 +18,7 @@ INCS=	ansi.h aout_machdep.h armreg.h asm
 	reg.h rwlock.h \
 	setjmp.h signal.h swi.h sysarch.h \
 	trap.h types.h \
+	vfpreg.h \
 	wchar_limits.h
 
 .include 

Index: src/sys/arch/arm/include/vfpreg.h
diff -u src/sys/arch/arm/include/vfpreg.h:1.1 src/sys/arch/arm/include/vfpreg.h:1.1.56.1
--- src/sys/arch/arm/include/vfpreg.h:1.1	Sat Mar 15 10:16:43 2008
+++ src/sys/arch/arm/include/vfpreg.h	Wed Nov 21 00:00:10 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfpreg.h,v 1.1 2008/03/15 10:16:43 rearnsha Exp $ */
+/*  $NetBSD: vfpreg.h,v 1.1.56.1 2012/11/21 00:00:10 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -45,20 +45,60 @@
 #define VFP_FPSID_ARCH_MSK	0x000f	/* Architecture */
 #define VFP_FPSID_ARCH_V1	0x	/* Arch VFPv1 */
 #define VFP_FPSID_ARCH_V2	0x0001	/* Arch VFPv2 */
+#define VFP_FPSID_ARCH_V3_2	0x0002	/* Arch VFPv3 (subarch v2) */
+#define VFP_FPSID_ARCH_V3	0x0003	/* Arch VFPv3 (no subarch) */
+#define VFP_FPSID_ARCH_V3_3	0x0004	/* Arch VFPv3 (subarch v3) */
 #define VFP_FPSID_PART_MSK	0xff00	/* Part number */
 #define VFP_FPSID_PART_VFP10	0x1000	/* VFP10 */
+#define VFP_FPSID_PART_VFP11	0x2000	/* VFP11 */
+#define VFP_FPSID_PART_VFP30	0x3000	/* VFP30 */
 #define VFP_FPSID_VAR_MSK	0x00f0	/* Variant */
 #define VFP_FPSID_VAR_ARM10	0x00a0	/* Variant ARM10 */
+#define VFP_FPSID_VAR_ARM11	0x00b0	/* Variant ARM11 */
 #define VFP_FPSID_REV_MSK	0x000f	/* Revision */
 
-#define VFP_FPEXC_EX		0x8000	/* Exception status bit */
-#define VFP_FPEXC_EN		0x4000	/* Enable bit */
-
-#define VFP_FPSCR_DN		0x0200	/* Default NaN mode */
-#define VFP_FPSCR_FZ		0x0100	/* Flush-to-zero mode */
-
-
 #define FPU_VFP10_ARM10E	0x410001a0	/* Really a VFPv2 part */
 #define FPU_VFP11_ARM11		0x410120b0
+#define FPU_VFP_CORTEXA5	0x41023050
+#define FPU_VFP_CORTEXA7	0x41023070
+#define FPU_VFP_CORTEXA8	0x410330c0
+#define FPU_VFP_CORTEXA9	0x41033090
+
+#define VFP_FPEXC_EX		0x8000	/* Exception status bit */
+#define VFP_FPEXC_EN		0x4000	/* VFP Enable bit */
+#define VFP_FPEXC_FP2V		0x1000	/* FPINST2 instruction valid */
+#define VFP_FPEXC_VECITR	0x0700	/* Vector iteration count */
+#define VFP_FPEXC_INV		0x0080	/* Input exception flag */
+#define VFP_FPEXC_UFC		0x0080	/* Potential underflow flag */
+#define VFP_FPEXC_OFC		0x0080	/* Potential overflow flag */
+#define VFP_FPEXC_IOC		0x0080	/* Potential inv. op. flag */
+
+#define VFP_FPSCR_N	0x8000	/* set if compare <= result */
+#define VFP_FPSCR_Z	0x4000	/* set if compare = result */
+#define VFP_FPSCR_C	0x2000	/* set if compare (=,>=,UNORD) result */
+#define VFP_FPSCR_V	0x1000	/* set if compare UNORD result */
+#define VFP_FPSCR_DN	0x0200	/* Default NaN mode */
+#define VFP_FPSCR_FZ	0x0100	/* Flush-to-zero mode */
+#define VFP_FPSCR_RMODE	0x00c0	/* Rounding Mode */
+#define VFP_FPSCR_RZ	0x00c0	/* round towards zero (RZ) */
+#define VFP_FPSCR_RM	0x0080	/* round towards +INF (RP) */
+#define VFP_FPSCR_RP	0x0040	/* round towards -INF (RM) */
+#define VFP_FPSCR_RN	0x	/* round to nearest (RN) */
+#define VFP_FPSCR_STRIDE 0x0030	/* Vector Stride */
+#define VFP_FPSCR_LEN	0x0007	/* Vector Length */
+#define VFP_FPSCR_IDE	0x8000	/* Inout Subnormal Exception Enable */
+#define VFP_FPSCR_ESUM	0x1f00	/* IXE|UFE|OFE|DZE|IOE */
+#define VFP_FPSCR_IXE	0x1000	/* Inexact Exception Enable */
+#define VFP_FPSCR_UFE	0x0800	/* Underflow Exception Enable */
+#define VFP_FPSCR_OFE	0x0400	/* Overflow Exception Enable */
+#define VFP_FPSCR_DZE	0x0200	/* Inexact

CVS commit: [matt-nb6-plus] src/sys/rump

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:58:02 UTC 2012

Modified Files:
src/sys/rump [matt-nb6-plus]: Makefile.rump

Log Message:
Don't use ldscript unless HAVE_BINUTILS == 219


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.61.12.1 src/sys/rump/Makefile.rump

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.61 src/sys/rump/Makefile.rump:1.61.12.1
--- src/sys/rump/Makefile.rump:1.61	Tue May 10 00:33:58 2011
+++ src/sys/rump/Makefile.rump	Tue Nov 20 23:58:02 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.61 2011/05/10 00:33:58 matt Exp $
+#	$NetBSD: Makefile.rump,v 1.61.12.1 2012/11/20 23:58:02 matt Exp $
 #
 
 WARNS?=		3	# XXX: src/sys won't compile with -Wsign-compare yet
@@ -32,7 +32,9 @@ CPPFLAGS+=	-I${RUMPTOP}/../../common/inc
 CPPFLAGS+=	-I${RUMPTOP}/include
 CPPFLAGS+=	-I${RUMPTOP}/librump/rumpkern/opt
 CPPFLAGS+=	-nostdinc -isystem ${RUMPTOP}/..
+.if ${HAVE_BINUTILS} == "219"
 LDFLAGS+=	-T ${RUMPTOP}/ldscript.rump
+.endif
 #CPPFLAGS+=	-DDEBUG
 
 .ifdef RUMP_LOCKDEBUG



CVS commit: [matt-nb6-plus] src/tests

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:26:55 UTC 2012

Modified Files:
src/tests/crypto/libcrypto/idea [matt-nb6-plus]: Makefile
src/tests/crypto/libcrypto/mdc2 [matt-nb6-plus]: Makefile
src/tests/crypto/libcrypto/rc5 [matt-nb6-plus]: Makefile
src/tests/lib/libcurses/slave [matt-nb6-plus]: Makefile

Log Message:
Conditionalize use of --no-fatal-warnings on ${HAVE_BINUTILS} == "219"


To generate a diff of this commit:
cvs rdiff -u -r1.3.6.1 -r1.3.6.2 src/tests/crypto/libcrypto/idea/Makefile
cvs rdiff -u -r1.3.6.1 -r1.3.6.2 src/tests/crypto/libcrypto/mdc2/Makefile
cvs rdiff -u -r1.3 -r1.3.6.1 src/tests/crypto/libcrypto/rc5/Makefile
cvs rdiff -u -r1.6 -r1.6.6.1 src/tests/lib/libcurses/slave/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/crypto/libcrypto/idea/Makefile
diff -u src/tests/crypto/libcrypto/idea/Makefile:1.3.6.1 src/tests/crypto/libcrypto/idea/Makefile:1.3.6.2
--- src/tests/crypto/libcrypto/idea/Makefile:1.3.6.1	Thu Nov  1 16:45:06 2012
+++ src/tests/crypto/libcrypto/idea/Makefile	Tue Nov 20 23:26:54 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3.6.1 2012/11/01 16:45:06 matt Exp $
+# $NetBSD: Makefile,v 1.3.6.2 2012/11/20 23:26:54 matt Exp $
 
 HELPER_NAME=	ideatest
 HELPER_DIR=	idea
@@ -7,4 +7,6 @@ HELPER_DIR=	idea
 
 LDADD= -lcrypto
 
+.if ${HAVE_BINUTILS} == "219"
 LDADD+=		-Wl,--no-fatal-warnings
+.endif

Index: src/tests/crypto/libcrypto/mdc2/Makefile
diff -u src/tests/crypto/libcrypto/mdc2/Makefile:1.3.6.1 src/tests/crypto/libcrypto/mdc2/Makefile:1.3.6.2
--- src/tests/crypto/libcrypto/mdc2/Makefile:1.3.6.1	Thu Nov  1 16:45:06 2012
+++ src/tests/crypto/libcrypto/mdc2/Makefile	Tue Nov 20 23:26:54 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3.6.1 2012/11/01 16:45:06 matt Exp $
+# $NetBSD: Makefile,v 1.3.6.2 2012/11/20 23:26:54 matt Exp $
 
 HELPER_NAME=	mdc2test
 HELPER_DIR=	mdc2
@@ -7,4 +7,6 @@ HELPER_DIR=	mdc2
 
 LDADD= -lcrypto
 
+.if ${HAVE_BINUTILS} == "219"
 LDADD+= -Wl,--no-fatal-warnings
+.endif

Index: src/tests/crypto/libcrypto/rc5/Makefile
diff -u src/tests/crypto/libcrypto/rc5/Makefile:1.3 src/tests/crypto/libcrypto/rc5/Makefile:1.3.6.1
--- src/tests/crypto/libcrypto/rc5/Makefile:1.3	Tue Jul  5 10:03:10 2011
+++ src/tests/crypto/libcrypto/rc5/Makefile	Tue Nov 20 23:26:54 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2011/07/05 10:03:10 spz Exp $
+# $NetBSD: Makefile,v 1.3.6.1 2012/11/20 23:26:54 matt Exp $
 
 HELPER_NAME=	rc5test
 HELPER_DIR=	rc5
@@ -11,4 +11,6 @@ LDADD= -lcrypto_rc5 -lcrypto
 CPPFLAGS+= -DOPENSSL_NO_RC5
 .endif
 
+.if ${HAVE_BINUTILS} == "219"
 LDADD+=		-Wl,--no-fatal-warnings
+.endif

Index: src/tests/lib/libcurses/slave/Makefile
diff -u src/tests/lib/libcurses/slave/Makefile:1.6 src/tests/lib/libcurses/slave/Makefile:1.6.6.1
--- src/tests/lib/libcurses/slave/Makefile:1.6	Thu Sep  8 18:44:38 2011
+++ src/tests/lib/libcurses/slave/Makefile	Tue Nov 20 23:26:54 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2011/09/08 18:44:38 jmmv Exp $
+#	$NetBSD: Makefile,v 1.6.6.1 2012/11/20 23:26:54 matt Exp $
 #
 .include 
 
@@ -12,7 +12,10 @@ NOMAN=	"true"
 SRCS=	slave.c commands.c curses_commands.c
 
 CPPFLAGS+=	-g -I${.CURDIR} -I. -I${.CURDIR}/../director
-LDADD+=		-lcurses -lterminfo -Wl,--no-fatal-warnings
+LDADD+=		-lcurses -lterminfo
+.if ${HAVE_BINUTILS} == "219"
+LDADD+=		-Wl,--no-fatal-warnings
+.endif
 
 COPTS.curses_commands.c += -Wno-format-nonliteral
 CWARNFLAGS.clang+=	-Wno-format



CVS commit: [matt-nb6-plus] src/lib/libc/arch/arm/sys

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:25:41 UTC 2012

Modified Files:
src/lib/libc/arch/arm/sys [matt-nb6-plus]: __aeabi_read_tp.S

Log Message:
Don't push/pop r1 around SYSTRAP, save it in ip instead.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.6.1 src/lib/libc/arch/arm/sys/__aeabi_read_tp.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/arch/arm/sys/__aeabi_read_tp.S
diff -u src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.2 src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.2.6.1
--- src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.2	Tue Feb 14 17:32:43 2012
+++ src/lib/libc/arch/arm/sys/__aeabi_read_tp.S	Tue Nov 20 23:25:41 2012
@@ -1,13 +1,20 @@
+/* $NetBSD: __aeabi_read_tp.S,v 1.2.6.1 2012/11/20 23:25:41 matt Exp $ */
+
 #include "SYS.h"
 
+/*
+ * Implementations of this function should corrupt only the result register
+ * (r0) and the non-parameter integer core registers allowed to be corrupted
+ * by the [AAPCS] (ip, lr, and CPSR).
+ */
 ENTRY(__aeabi_read_tp)
-	mrc p15, 0, r0, c13, c0, 3
+	mrc	p15, 0, r0, c13, c0, 3
 #ifndef _ARM_ARCH_6
-	cmp r0, #0			/* was it zero? */
+	cmp	r0, #0			/* was it zero? */
 	RETc(ne)			/* return it's not zero */
-	push {r1}			/* syscall zeroes r1 */
+	mov	ip, r1 			/* syscall zeroes r1 */
 	SYSTRAP(_lwp_getprivate)	/* can't fail */
-	pop {r1}			/* restore r1 */
+	mov	r1, ip			/* restore r1 */
 #endif
 	RET
 _END(__aeabi_read_tp)



CVS commit: [matt-nb6-plus] src/lib

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:24:55 UTC 2012

Modified Files:
src/lib [matt-nb6-plus]: Makefile

Log Message:
Add back building binutils 2.16 libraries


To generate a diff of this commit:
cvs rdiff -u -r1.181.2.1 -r1.181.2.1.2.1 src/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/Makefile
diff -u src/lib/Makefile:1.181.2.1 src/lib/Makefile:1.181.2.1.2.1
--- src/lib/Makefile:1.181.2.1	Fri Mar  2 18:27:53 2012
+++ src/lib/Makefile	Tue Nov 20 23:24:55 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.181.2.1 2012/03/02 18:27:53 riz Exp $
+#	$NetBSD: Makefile,v 1.181.2.1.2.1 2012/11/20 23:24:55 matt Exp $
 #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
 
 .include 
@@ -127,7 +127,13 @@ SUBDIR+=	../external/gpl2/lvm2/lib	# dep
 .endif
 
 .if (${MKBINUTILS} != "no")
+. if (${HAVE_BINUTILS} == "219")
 SUBDIR+=	../external/gpl3/binutils/lib	# libbfd depends on libz
+. else
+SUBDIR+=	../gnu/lib/libopcodes		# libbfd depends on libz
+SUBDIR+=	../gnu/lib/libbfd		# libbfd depends on libz
+SUBDIR+=	../gnu/lib/libiberty		# libbfd depends on libz
+. endif
 .endif
 
 .if (${MKGCC} != "no" && ${MKCXX} != "no")



CVS commit: [matt-nb6-plus] src/share/mk

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:22:25 UTC 2012

Modified Files:
src/share/mk [matt-nb6-plus]: bsd.own.mk

Log Message:
When using binutils 2.16 with arm, add -D__HAVE_NO__THREADS to CPPFLAGS since
that version bintuils doesn't support TLS for arm.  XXX not sure if it supports
TLS for anything.


To generate a diff of this commit:
cvs rdiff -u -r1.696.2.2.2.2 -r1.696.2.2.2.3 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.696.2.2.2.2 src/share/mk/bsd.own.mk:1.696.2.2.2.3
--- src/share/mk/bsd.own.mk:1.696.2.2.2.2	Tue Nov 20 18:55:09 2012
+++ src/share/mk/bsd.own.mk	Tue Nov 20 23:22:25 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.2 2012/11/20 18:55:09 matt Exp $
+#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.3 2012/11/20 23:22:25 matt Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -78,6 +78,11 @@ HAVE_GDB?=	7
 # default to binutils 2.21	 
 HAVE_BINUTILS?= 219
 
+# binutils 2.16 has no TLS support for ARM
+.if ${HAVE_BINUTILS} != "219" && ${MACHINE_CPU} == "arm"
+CPPFLAGS+=	-D__HAVE_NO___THREAD
+.endif
+
 .if empty(.MAKEFLAGS:M-V*)
 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
 PRINTOBJDIR=	${MAKE} -r -V .OBJDIR -f /dev/null xxx



CVS commit: [matt-nb6-plus] src/tools/binutils

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:14:29 UTC 2012

Modified Files:
src/tools/binutils [matt-nb6-plus]: Makefile

Log Message:
Make sure binutils is using sysroot regardless of version.


To generate a diff of this commit:
cvs rdiff -u -r1.21.4.1.2.1 -r1.21.4.1.2.2 src/tools/binutils/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/binutils/Makefile
diff -u src/tools/binutils/Makefile:1.21.4.1.2.1 src/tools/binutils/Makefile:1.21.4.1.2.2
--- src/tools/binutils/Makefile:1.21.4.1.2.1	Tue Nov 20 18:54:42 2012
+++ src/tools/binutils/Makefile	Tue Nov 20 23:14:28 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21.4.1.2.1 2012/11/20 18:54:42 matt Exp $
+#	$NetBSD: Makefile,v 1.21.4.1.2.2 2012/11/20 23:14:28 matt Exp $
 
 .include 
 
@@ -6,14 +6,12 @@ MODULE=		binutils
 
 .if $(HAVE_BINUTILS) == "219"
 GNUHOSTDIST=	${.CURDIR}/../../external/gpl3/binutils/dist
+.endif
 
 BRANDING?=	\
 	--with-pkgversion="NetBSD Binutils nb1" \
 	--with-bugurl="http://www.NetBSD.org/support/send-pr.html"; \
 	--with-lib-path="=/usr/lib" --with-sysroot
-.else
-BRANDING?=	
-.endif
 
 CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \



CVS commit: [matt-nb6-plus] src/share/examples/npf

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 23:13:36 UTC 2012

Added Files:
src/share/examples/npf [matt-nb6-plus]: Makefile hashtablefile
host-npf.conf soho_gw-npf.conf treetablefile

Log Message:
Add missing files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.8.2 src/share/examples/npf/Makefile \
src/share/examples/npf/hashtablefile src/share/examples/npf/treetablefile
cvs rdiff -u -r0 -r1.2.8.2 src/share/examples/npf/host-npf.conf \
src/share/examples/npf/soho_gw-npf.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/share/examples/npf/Makefile
diff -u /dev/null src/share/examples/npf/Makefile:1.1.8.2
--- /dev/null	Tue Nov 20 23:13:36 2012
+++ src/share/examples/npf/Makefile	Tue Nov 20 23:13:35 2012
@@ -0,0 +1,12 @@
+#	$NetBSD: Makefile,v 1.1.8.2 2012/11/20 23:13:35 matt Exp $
+
+NOOBJ=	# defined
+
+.include 
+
+.if ${MKSHARE} != "no"
+FILES=		host-npf.conf soho_gw-npf.conf hashtablefile treetablefile
+FILESDIR=	/usr/share/examples/npf
+.endif
+
+.include 
Index: src/share/examples/npf/hashtablefile
diff -u /dev/null src/share/examples/npf/hashtablefile:1.1.8.2
--- /dev/null	Tue Nov 20 23:13:36 2012
+++ src/share/examples/npf/hashtablefile	Tue Nov 20 23:13:36 2012
@@ -0,0 +1,8 @@
+# $NetBSD: hashtablefile,v 1.1.8.2 2012/11/20 23:13:36 matt Exp $
+#
+# hash tables can only have single IP addresses
+#
+# entry comment 1 (optional)
+192.0.2.7
+# entry comment 2 (optional)
+198.51.100.48
Index: src/share/examples/npf/treetablefile
diff -u /dev/null src/share/examples/npf/treetablefile:1.1.8.2
--- /dev/null	Tue Nov 20 23:13:36 2012
+++ src/share/examples/npf/treetablefile	Tue Nov 20 23:13:36 2012
@@ -0,0 +1,8 @@
+# $NetBSD: treetablefile,v 1.1.8.2 2012/11/20 23:13:36 matt Exp $
+#
+# tree tables can have address blocks
+#
+# entry comment 1 (optional)
+198.51.100.40/30
+# entry comment 2 (optional)
+192.0.2.7

Index: src/share/examples/npf/host-npf.conf
diff -u /dev/null src/share/examples/npf/host-npf.conf:1.2.8.2
--- /dev/null	Tue Nov 20 23:13:36 2012
+++ src/share/examples/npf/host-npf.conf	Tue Nov 20 23:13:36 2012
@@ -0,0 +1,120 @@
+# $NetBSD: host-npf.conf,v 1.2.8.2 2012/11/20 23:13:36 matt Exp $
+#
+# this is an example of NPF rules for a host (i.e., not routing) with
+# two network interfaces, wired and wifi
+#
+# it does both IPv4 and IPv6 and allows for DHCP in v4 and SLAAC in v6
+# it also does IPSEC on the wifi
+#
+$wired_if = "wm0"
+$wifi_if = "iwn0"
+
+$dhcpserver = { 198.51.100.1 }
+
+# sample udp service
+$services_udp = { ntp }
+
+# sample mixed service
+$backupsrv_v4 = { 198.51.100.11 }
+$backupsrv_v6 = { 2001:0DB8:404::11 }
+$backup_port = { amanda }
+
+# watching a tcpdump of npflog0, when it only logs blocks,
+# can be very helpful for building the rules you actually need
+procedure "log" {
+ log: npflog0
+}
+
+procedure "rid" {
+ normalise: "random-id"
+}
+
+group (name "wired", interface $wired_if) {
+
+	# not being picky about our own address here
+	pass in  final family inet6 proto ipv6-icmp all
+	pass out final family inet6 proto ipv6-icmp all
+	pass in  final family inet  proto icmp  all
+
+	pass in  final family inet proto tcp \
+		from $dhcpserver port bootps to $wired_if port bootpc
+	pass in  final family inet proto udp \
+		from $dhcpserver port bootps to $wired_if port bootpc
+
+	pass in final family inet6 proto tcp to $wired_if port ssh
+
+	pass in final family inet  proto tcp flags S/SA \
+		from $backupsrv_v4 to $wired_if port $backup_port 
+	pass in final family inet  proto udp \
+		from $backupsrv_v4 to $wired_if port $backup_port
+	pass in final family inet6 proto tcp flags S/SA \
+		from $backupsrv_v6 to $wired_if port $backup_port 
+	pass in final family inet6 proto udp \
+		from $backupsrv_v6 to $wired_if port $backup_port
+
+	pass stateful in final family inet6 proto udp to $wired_if \
+		port $services_udp
+	pass stateful in final family inet  proto udp to $wired_if \
+		port $services_udp
+
+	# only SYN packets need to generate state
+	pass stateful out final family inet6 proto tcp flags S/SA \
+		from $wired_if apply "rid" 
+	pass stateful out final family inet  proto tcp flags S/SA \
+		from $wired_if apply "rid" 
+	# pass the other tcp packets without generating extra state
+	pass out final family inet6 proto tcp from $wired_if apply "rid" 
+	pass out final family inet  proto tcp from $wired_if apply "rid" 
+
+	# all other types of traffic, generate state per packet
+	pass stateful out final family inet6 from $wired_if apply "rid" 
+	pass stateful out final family inet  from $wired_if apply "rid" 
+
+}
+
+group (name "wifi", interface $wifi_if) {
+	# linklocal
+	pass in  final family inet6 proto ipv6-icmp  to fe80::/10
+	pass out final family inet6 proto ipv6-icmp from fe80::/10
+
+	# administrative multicasts
+	pass in  final family inet6 proto ipv6-icmp  to ff00::/10
+	pass out final family i

CVS commit: [matt-nb6-plus] src/share/mk

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 18:55:10 UTC 2012

Modified Files:
src/share/mk [matt-nb6-plus]: bsd.own.mk

Log Message:
Default to binutils 2.21


To generate a diff of this commit:
cvs rdiff -u -r1.696.2.2.2.1 -r1.696.2.2.2.2 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.696.2.2.2.1 src/share/mk/bsd.own.mk:1.696.2.2.2.2
--- src/share/mk/bsd.own.mk:1.696.2.2.2.1	Thu Nov  1 16:44:58 2012
+++ src/share/mk/bsd.own.mk	Tue Nov 20 18:55:09 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.1 2012/11/01 16:44:58 matt Exp $
+#	$NetBSD: bsd.own.mk,v 1.696.2.2.2.2 2012/11/20 18:55:09 matt Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -75,6 +75,8 @@ HAVE_GDB?= 6
 HAVE_GDB?=	7
 .endif
 
+# default to binutils 2.21	 
+HAVE_BINUTILS?= 219
 
 .if empty(.MAKEFLAGS:M-V*)
 .if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)



CVS commit: [matt-nb6-plus] src/tools

2012-11-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Nov 20 18:54:42 UTC 2012

Modified Files:
src/tools/binutils [matt-nb6-plus]: Makefile
src/tools/dbsym [matt-nb6-plus]: Makefile
src/tools/gdb [matt-nb6-plus]: Makefile
src/tools/mdsetimage [matt-nb6-plus]: Makefile

Log Message:
Support building GPL2 versions of binutils, dbsym, gdb, and mdsetimage


To generate a diff of this commit:
cvs rdiff -u -r1.21.4.1 -r1.21.4.1.2.1 src/tools/binutils/Makefile
cvs rdiff -u -r1.7 -r1.7.6.1 src/tools/dbsym/Makefile
cvs rdiff -u -r1.21 -r1.21.4.1 src/tools/gdb/Makefile
cvs rdiff -u -r1.9 -r1.9.6.1 src/tools/mdsetimage/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/binutils/Makefile
diff -u src/tools/binutils/Makefile:1.21.4.1 src/tools/binutils/Makefile:1.21.4.1.2.1
--- src/tools/binutils/Makefile:1.21.4.1	Mon May  7 03:08:35 2012
+++ src/tools/binutils/Makefile	Tue Nov 20 18:54:42 2012
@@ -1,15 +1,19 @@
-#	$NetBSD: Makefile,v 1.21.4.1 2012/05/07 03:08:35 riz Exp $
+#	$NetBSD: Makefile,v 1.21.4.1.2.1 2012/11/20 18:54:42 matt Exp $
 
 .include 
 
 MODULE=		binutils
 
+.if $(HAVE_BINUTILS) == "219"
 GNUHOSTDIST=	${.CURDIR}/../../external/gpl3/binutils/dist
 
 BRANDING?=	\
 	--with-pkgversion="NetBSD Binutils nb1" \
 	--with-bugurl="http://www.NetBSD.org/support/send-pr.html"; \
 	--with-lib-path="=/usr/lib" --with-sysroot
+.else
+BRANDING?=	
+.endif
 
 CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \

Index: src/tools/dbsym/Makefile
diff -u src/tools/dbsym/Makefile:1.7 src/tools/dbsym/Makefile:1.7.6.1
--- src/tools/dbsym/Makefile:1.7	Mon Oct 31 08:14:44 2011
+++ src/tools/dbsym/Makefile	Tue Nov 20 18:54:42 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2011/10/31 08:14:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.7.6.1 2012/11/20 18:54:42 matt Exp $
 
 NOMAN=	# defined
 
@@ -6,7 +6,11 @@ NOMAN=	# defined
 
 HOSTPROGNAME=	${MACHINE_GNU_PLATFORM}-dbsym
 
+.if $(HAVE_BINUTILS) == "219"
 HOST_SRCDIR=external/gpl3/binutils/usr.sbin/dbsym
+.else
+HOST_SRCDIR=	gnu/usr.sbin/dbsym
+.endif
 
 TOOLCHAINOBJ!=	cd ${.CURDIR}/../binutils && ${PRINTOBJDIR}
 BFDDIR=		${TOOLCHAINOBJ}/build/bfd

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.21 src/tools/gdb/Makefile:1.21.4.1
--- src/tools/gdb/Makefile:1.21	Thu Feb  9 15:15:58 2012
+++ src/tools/gdb/Makefile	Tue Nov 20 18:54:42 2012
@@ -1,9 +1,13 @@
-#	$NetBSD: Makefile,v 1.21 2012/02/09 15:15:58 skrll Exp $
+#	$NetBSD: Makefile,v 1.21.4.1 2012/11/20 18:54:42 matt Exp $
 
 .include 
 
+.if ${HAVE_GDB} == "6"
+MODULE=		gdb6
+.else
 MODULE=		gdb
 GNUHOSTDIST=${.CURDIR}/../../external/gpl3/gdb/dist
+.endif
 
 FIND_ARGS=	\! \( -type d -name sim -prune \)
 

Index: src/tools/mdsetimage/Makefile
diff -u src/tools/mdsetimage/Makefile:1.9 src/tools/mdsetimage/Makefile:1.9.6.1
--- src/tools/mdsetimage/Makefile:1.9	Mon Oct 31 08:14:44 2011
+++ src/tools/mdsetimage/Makefile	Tue Nov 20 18:54:42 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2011/10/31 08:14:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.9.6.1 2012/11/20 18:54:42 matt Exp $
 
 NOMAN=	# defined
 
@@ -6,7 +6,11 @@ NOMAN=	# defined
 
 HOSTPROGNAME=	${MACHINE_GNU_PLATFORM}-mdsetimage
 
+.if $(HAVE_BINUTILS) == "219"
 HOST_SRCDIR=	external/gpl3/binutils/usr.sbin/mdsetimage
+.else
+HOST_SRCDIR=	gnu/usr.sbin/mdsetimage
+.endif
 
 TOOLCHAINOBJ!=	cd ${.CURDIR}/../binutils && ${PRINTOBJDIR}
 BFDDIR=		${TOOLCHAINOBJ}/build/bfd