CVS commit: src/usr.bin/sort

2009-08-20 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Thu Aug 20 06:36:26 UTC 2009

Modified Files:
src/usr.bin/sort: append.c fields.c fsort.c fsort.h msort.c sort.c
sort.h

Log Message:
Delete more unwanted/unused cruft.
Simplify logic for reading input records.
Do a merge sort whenever we have 16 partial sorted blocks.
The patient is breathing, but still carrying a lot of extra weight.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/sort/append.c
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/sort/fields.c src/usr.bin/sort/sort.h
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/sort/fsort.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/sort/fsort.h
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/sort/msort.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/sort/sort.c

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

Modified files:

Index: src/usr.bin/sort/append.c
diff -u src/usr.bin/sort/append.c:1.18 src/usr.bin/sort/append.c:1.19
--- src/usr.bin/sort/append.c:1.18	Tue Aug 18 18:00:28 2009
+++ src/usr.bin/sort/append.c	Thu Aug 20 06:36:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: append.c,v 1.18 2009/08/18 18:00:28 dsl Exp $	*/
+/*	$NetBSD: append.c,v 1.19 2009/08/20 06:36:25 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
 #include sort.h
 
 #ifndef lint
-__RCSID($NetBSD: append.c,v 1.18 2009/08/18 18:00:28 dsl Exp $);
+__RCSID($NetBSD: append.c,v 1.19 2009/08/20 06:36:25 dsl Exp $);
 __SCCSID(@(#)append.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
@@ -73,13 +73,8 @@
 
 #define OUTPUT {			\
 	if ((n = cpos - ppos)  1) {	\
-		for (; ppos  cpos; ++ppos)\
-			*ppos -= depth;\
 		ppos -= n;		\
-		if (stable_sort)	\
-			sradixsort(ppos, n, wts1, REC_D);		\
-		else			\
-			radixsort(ppos, n, wts1, REC_D);		\
+		radix_sort(ppos, n, wts1, REC_D);			\
 		for (; ppos  cpos; ppos++) {\
 			prec = (const RECHEADER *) (*ppos - REC_DATA_OFFSET);\
 			put(prec, fp);	\
@@ -91,35 +86,36 @@
  * copy sorted lines to output; check for uniqueness
  */
 void
-append(const u_char **keylist, int nelem, int depth, FILE *fp, put_func_t put,
+append(const u_char **keylist, int nelem, FILE *fp, put_func_t put,
 struct field *ftbl)
 {
 	u_char *wts, *wts1;
 	int n;
-	int hdr_off;
 	const u_char **cpos, **ppos, **lastkey;
 	const u_char *cend, *pend, *start;
 	const struct recheader *crec, *prec;
 
 	if (*keylist == '\0'  UNIQUE)
 		return;
+
 	wts1 = wts = ftbl[0].weights;
-	if ((!UNIQUE)  SINGL_FLD) {
-		if ((ftbl[0].flags  F)  (ftbl[0].flags  R))
+	if ((!UNIQUE)  SINGL_FLD  ftbl[0].flags  F) {
+		/* Folding case */
+		if (ftbl[0].flags  R)
 			wts1 = Rascii;
-		else if (ftbl[0].flags  F)
+		else
 			wts1 = ascii;
 	}
+
 	lastkey = keylist + nelem;
-	hdr_off = REC_DATA_OFFSET + depth;
 	if (SINGL_FLD  (UNIQUE || wts1 != wts)) {
 		ppos = keylist;
-		prec = (const RECHEADER *) (*ppos - hdr_off);
+		prec = (const RECHEADER *) (*ppos - REC_DATA_OFFSET);
 		if (UNIQUE)
 			put(prec, fp);
 		for (cpos = keylist[1]; cpos  lastkey; cpos++) {
-			crec = (const RECHEADER *) (*cpos - hdr_off);
-			if (crec-length  == prec-length) {
+			crec = (const RECHEADER *) (*cpos - REC_DATA_OFFSET);
+			if (crec-length == prec-length) {
 /*
  * Set pend and cend so that trailing NUL and
  * record separator is ignored.
@@ -151,10 +147,10 @@
 		if (!UNIQUE)  { OUTPUT; }
 	} else if (UNIQUE) {
 		ppos = keylist;
-		prec = (const RECHEADER *) (*ppos - hdr_off);
+		prec = (const RECHEADER *) (*ppos - REC_DATA_OFFSET);
 		put(prec, fp);
 		for (cpos = keylist[1]; cpos  lastkey; cpos++) {
-			crec = (const RECHEADER *) (*cpos - hdr_off);
+			crec = (const RECHEADER *) (*cpos - REC_DATA_OFFSET);
 			if (crec-offset == prec-offset) {
 /*
  * Set pend and cend so that trailing NUL and
@@ -179,7 +175,7 @@
 			}
 		}
 	} else for (cpos = keylist; cpos  lastkey; cpos++) {
-		crec = (const RECHEADER *) (*cpos - hdr_off);
+		crec = (const RECHEADER *) (*cpos - REC_DATA_OFFSET);
 		put(crec, fp);
 	}
 }

Index: src/usr.bin/sort/fields.c
diff -u src/usr.bin/sort/fields.c:1.23 src/usr.bin/sort/fields.c:1.24
--- src/usr.bin/sort/fields.c:1.23	Sat Aug 15 21:26:32 2009
+++ src/usr.bin/sort/fields.c	Thu Aug 20 06:36:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fields.c,v 1.23 2009/08/15 21:26:32 dsl Exp $	*/
+/*	$NetBSD: fields.c,v 1.24 2009/08/20 06:36:25 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #include sort.h
 
 #ifndef lint
-__RCSID($NetBSD: fields.c,v 1.23 2009/08/15 21:26:32 dsl Exp $);
+__RCSID($NetBSD: fields.c,v 1.24 2009/08/20 06:36:25 dsl Exp $);
 __SCCSID(@(#)fields.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
@@ -97,7 +97,8 @@
  * followed by the original line.
  */
 length_t
-enterkey(RECHEADER *keybuf, const u_char *keybuf_end, u_char *line_data, size_t line_size, struct field fieldtable[])
+enterkey(RECHEADER *keybuf, const 

CVS commit: [matt-nb5-mips64] src/sys/arch/sbmips/conf

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 06:51:40 UTC 2009

Modified Files:
src/sys/arch/sbmips/conf [matt-nb5-mips64]: std.sbmips

Log Message:
When building sbmips kernels, always use compile with -mips64 -mtune=sb1


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.96.1 src/sys/arch/sbmips/conf/std.sbmips

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/sbmips/conf/std.sbmips
diff -u src/sys/arch/sbmips/conf/std.sbmips:1.5 src/sys/arch/sbmips/conf/std.sbmips:1.5.96.1
--- src/sys/arch/sbmips/conf/std.sbmips:1.5	Sun Dec 11 12:18:51 2005
+++ src/sys/arch/sbmips/conf/std.sbmips	Thu Aug 20 06:51:40 2009
@@ -1,14 +1,16 @@
-# $NetBSD: std.sbmips,v 1.5 2005/12/11 12:18:51 christos Exp $
+# $NetBSD: std.sbmips,v 1.5.96.1 2009/08/20 06:51:40 matt Exp $
 
 machine sbmips mips
 include		conf/std	# MI standard options
 
-options	MIPS64
-options	MIPS64_SB1	# we use an SB1 core
+options 	MIPS64
+options 	MIPS64_SB1	# we use an SB1 core
 
-options	EXEC_ELF32	# exec ELF32 binaries
-options	EXEC_SCRIPT	# exec #! scripts
+options 	EXEC_ELF32	# exec ELF32 binaries
+options 	EXEC_SCRIPT	# exec #! scripts
 
+makeoptions	CFLAGS+=-mips64 -mtune=sb1
+makeoptions	AFLAGS+=-mips64 -mtune=sb1
 makeoptions	DEFTEXTADDR=0x80001000
 
 include	arch/mips/conf/files.sibyte



CVS commit: [matt-nb5-mips64] src/sys/arch/sbmips/conf

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 06:52:43 UTC 2009

Added Files:
src/sys/arch/sbmips/conf [matt-nb5-mips64]: GENERIC64

Log Message:
This config will build a N64 (64-bit) kernel.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sbmips/conf/GENERIC64

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

Added files:

Index: src/sys/arch/sbmips/conf/GENERIC64
diff -u /dev/null src/sys/arch/sbmips/conf/GENERIC64:1.1.2.1
--- /dev/null	Thu Aug 20 06:52:43 2009
+++ src/sys/arch/sbmips/conf/GENERIC64	Thu Aug 20 06:52:43 2009
@@ -0,0 +1,5 @@
+
+include arch/sbmips/conf/GENERIC
+
+makeoptions	LP64=yes
+options 	EXEC_ELF64



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/conf

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:32:11 UTC 2009

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: Makefile.mips

Log Message:
Add support for building N64 kernels.  This is done by adding
makeoptions LP64=yes

to your config file.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.24.1 src/sys/arch/mips/conf/Makefile.mips

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/mips/conf/Makefile.mips
diff -u src/sys/arch/mips/conf/Makefile.mips:1.50 src/sys/arch/mips/conf/Makefile.mips:1.50.24.1
--- src/sys/arch/mips/conf/Makefile.mips:1.50	Mon Feb 18 15:21:04 2008
+++ src/sys/arch/mips/conf/Makefile.mips	Thu Aug 20 07:32:11 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mips,v 1.50 2008/02/18 15:21:04 tsutsui Exp $
+#	$NetBSD: Makefile.mips,v 1.50.24.1 2009/08/20 07:32:11 matt Exp $
 
 # Makefile for NetBSD
 #
@@ -47,9 +47,20 @@
 DEFGP?=		-G 0
 GP?=		${DEFGP}
 CFLAGS+=	${GP} -mno-abicalls -msoft-float -ffixed-23
+.if defined(LP64)  ${LP64} == yes
 .if ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el
-CFLAGS+=	-msym32
+CFLAGS+=	-msym32 -mabi=64
+AFLAGS+=	-msym32 -mabi=64
 .endif
+.if ${MACHINE_ARCH} == mips64eb
+LDFLAGS+=	-m elf64btsmip
+LINKFLAGS+=	-m elf64btsmip
+.endif
+.if ${MACHINE_ARCH} == mips64el
+LDFLAGS+=	-m elf64ltsmip
+LINKFLAGS+=	-m elf64ltsmip
+.endif
+.endif # LP64=yes
 AFLAGS+=	-mno-abicalls -x assembler-with-cpp -traditional-cpp ${AOPTS}
 
 ##



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:44:50 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: mips3_pte.h

Log Message:
Add a MIPS3_PG_TO_CCA() macro to get the CCA out of the saved page attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.38.1 src/sys/arch/mips/include/mips3_pte.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/mips/include/mips3_pte.h
diff -u src/sys/arch/mips/include/mips3_pte.h:1.23 src/sys/arch/mips/include/mips3_pte.h:1.23.38.1
--- src/sys/arch/mips/include/mips3_pte.h:1.23	Wed Oct 17 19:55:37 2007
+++ src/sys/arch/mips/include/mips3_pte.h	Thu Aug 20 07:44:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips3_pte.h,v 1.23 2007/10/17 19:55:37 garbled Exp $	*/
+/*	$NetBSD: mips3_pte.h,v 1.23.38.1 2009/08/20 07:44:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -126,6 +126,7 @@
 #define	MIPS3_PG_ATTR	0x003f
 
 #define	MIPS3_CCA_TO_PG(cca)	((cca)  3)
+#define	MIPS3_PG_TO_CCA(cca)	(((cca)  3)  7)
 
 #define	MIPS3_PG_UNCACHED	MIPS3_CCA_TO_PG(2)
 #ifdef HPCMIPS_L1CACHE_DISABLE		/* MIPS3_L1CACHE_DISABLE */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:45:40 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: asm.h

Log Message:
Add XXX_WORD for INT and LONG.
Use PTR_LA in the PANIC macro.


To generate a diff of this commit:
cvs rdiff -u -r1.40.38.4 -r1.40.38.5 src/sys/arch/mips/include/asm.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/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.40.38.4 src/sys/arch/mips/include/asm.h:1.40.38.5
--- src/sys/arch/mips/include/asm.h:1.40.38.4	Wed Aug 19 07:40:10 2009
+++ src/sys/arch/mips/include/asm.h	Thu Aug 20 07:45:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.40.38.4 2009/08/19 07:40:10 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.40.38.5 2009/08/20 07:45:40 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -251,13 +251,13 @@
  * Macros to panic and printf from assembly language.
  */
 #define	PANIC(msg)			\
-	la	a0, 9f;			\
+	PTR_LA	a0, 9f;			\
 	jal	_C_LABEL(panic);	\
 	nop;\
 	MSG(msg)
 
 #define	PRINTF(msg)			\
-	la	a0, 9f;			\
+	PTR_LA	a0, 9f;			\
 	jal	_C_LABEL(printf);	\
 	nop;\
 	MSG(msg)
@@ -423,6 +423,7 @@
 #define	INT_SRAV	srav
 #define	INT_LL		ll
 #define	INT_SC		sc
+#define	INT_WORD	.word
 #define	INT_SCALESHIFT	2
 #else
 #define	INT_ADD		dadd
@@ -444,6 +445,7 @@
 #define	INT_SRAV	dsrav
 #define	INT_LL		lld
 #define	INT_SC		scd
+#define	INT_WORD	.dword
 #define	INT_SCALESHIFT	3
 #endif
 
@@ -467,6 +469,7 @@
 #define	LONG_SRAV	srav
 #define	LONG_LL		ll
 #define	LONG_SC		sc
+#define	LONG_WORD	.word
 #define	LONG_SCALESHIFT	2
 #else
 #define	LONG_ADD	dadd
@@ -488,6 +491,7 @@
 #define	LONG_SRAV	dsrav
 #define	LONG_LL		lld
 #define	LONG_SC		scd
+#define	LONG_WORD	.dword
 #define	LONG_SCALESHIFT	3
 #endif
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:47:52 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: mips_param.h

Log Message:
Add a default MSIZE/MCLBYTES block here since each mips port does the same
thing.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.78.1 src/sys/arch/mips/include/mips_param.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/mips/include/mips_param.h
diff -u src/sys/arch/mips/include/mips_param.h:1.23 src/sys/arch/mips/include/mips_param.h:1.23.78.1
--- src/sys/arch/mips/include/mips_param.h:1.23	Mon Aug 28 13:43:35 2006
+++ src/sys/arch/mips/include/mips_param.h	Thu Aug 20 07:47:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_param.h,v 1.23 2006/08/28 13:43:35 yamt Exp $	*/
+/*	$NetBSD: mips_param.h,v 1.23.78.1 2009/08/20 07:47:52 matt Exp $	*/
 
 #ifdef _KERNEL
 #include machine/cpu.h
@@ -57,3 +57,36 @@
 #define mips_trunc_page(x)	((uintptr_t)(x)  ~(NBPG-1))
 #define mips_btop(x)		((paddr_t)(x)  PGSHIFT)
 #define mips_ptob(x)		((paddr_t)(x)  PGSHIFT)
+
+/*
+ * Constants related to network buffer management.
+ * MCLBYTES must be no larger than NBPG (the software page size), and,
+ * on machines that exchange pages of input or output buffers with mbuf
+ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
+ * of the hardware page size.
+ */
+#ifndef MSIZE
+#ifdef _LP64
+#define	MSIZE		512		/* size of an mbuf */
+#else
+#define	MSIZE		256		/* size of an mbuf */
+#endif
+
+#ifndef MCLSHIFT
+# define MCLSHIFT	11		/* convert bytes to m_buf clusters */
+#endif	/* MCLSHIFT */
+
+#define	MCLBYTES	(1  MCLSHIFT)	/* size of a m_buf cluster */
+
+#ifndef NMBCLUSTERS
+#if defined(_KERNEL_OPT)
+#include opt_gateway.h
+#endif
+
+#ifdef GATEWAY
+#define	NMBCLUSTERS	2048		/* map size, max cluster allocation */
+#else
+#define	NMBCLUSTERS	1024		/* map size, max cluster allocation */
+#endif
+#endif
+#endif



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:48:43 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: elf_machdep.h

Log Message:
On _LP64 default to ELFSIZE=64
Add a ELF64 default case for EM_MIPS


To generate a diff of this commit:
cvs rdiff -u -r1.10.96.1 -r1.10.96.2 src/sys/arch/mips/include/elf_machdep.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/mips/include/elf_machdep.h
diff -u src/sys/arch/mips/include/elf_machdep.h:1.10.96.1 src/sys/arch/mips/include/elf_machdep.h:1.10.96.2
--- src/sys/arch/mips/include/elf_machdep.h:1.10.96.1	Sun Aug 16 03:33:57 2009
+++ src/sys/arch/mips/include/elf_machdep.h	Thu Aug 20 07:48:43 2009
@@ -1,17 +1,22 @@
-/*	$NetBSD: elf_machdep.h,v 1.10.96.1 2009/08/16 03:33:57 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.10.96.2 2009/08/20 07:48:43 matt Exp $	*/
 
 #define	ELF32_MACHDEP_ID_CASES		\
 		case EM_MIPS:		\
 			break;
 
 #define	ELF64_MACHDEP_ID_CASES		\
-		/* no 64-bit ELF machine types supported */
+		case EM_MIPS:		\
+			break;
 
 
 #define	ELF32_MACHDEP_ID	EM_MIPS
 #define	ELF64_MACHDEP_ID	EM_MIPS
 
+#ifdef _LP64
+#define ARCH_ELFSIZE		64	/* MD native binary size */
+#else
 #define ARCH_ELFSIZE		32	/* MD native binary size */
+#endif
 
 /* mips relocs.  */
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:49:52 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: cpuregs.h

Log Message:
Add a MIPS_XKPHYS_P(va) macro.
Define MIPS_XKSEG related macros


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.74.28.1 src/sys/arch/mips/include/cpuregs.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/mips/include/cpuregs.h
diff -u src/sys/arch/mips/include/cpuregs.h:1.74 src/sys/arch/mips/include/cpuregs.h:1.74.28.1
--- src/sys/arch/mips/include/cpuregs.h:1.74	Tue Feb 19 11:26:40 2008
+++ src/sys/arch/mips/include/cpuregs.h	Thu Aug 20 07:49:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuregs.h,v 1.74 2008/02/19 11:26:40 simonb Exp $	*/
+/*	$NetBSD: cpuregs.h,v 1.74.28.1 2009/08/20 07:49:52 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -94,9 +94,14 @@
 #define	MIPS3_VA_TO_CINDEX(x) \
 		((uintptr_t)(x)  0xff | MIPS_KSEG0_START)
 
+#define	MIPS_XSEG_MASK		(0x3fffULL)
+#define	MIPS_XKSEG_BASE		(0x3ULL  62)
+#define	MIPS_XKSEG_P(x)		(((uint64_t)(x)  62) == 3)
+
 #define	MIPS_PHYS_TO_XKPHYS(cca,x) \
-	((0x2ULL  62) | ((unsigned long long)(cca)  59) | (x))
+	((0x2ULL  62) | ((uint64_t)(cca)  59) | (x))
 #define	MIPS_XKPHYS_TO_PHYS(x)	((x)  0x0effULL)
+#define	MIPS_XKPHYS_P(x)	(((uint64_t)(x)  62) == 2)
 
 /* CPU dependent mtc0 hazard hook */
 #define	COP0_SYNC		/* nothing */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 07:52:38 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: proc.h

Log Message:
Change md_regs in mdlwp to struct frame * from void *.  Every use just casts
it to struct frame * anyways so enforce the type.
Add p_abi which indicates the ABI of the process.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.36.1 src/sys/arch/mips/include/proc.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/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.21 src/sys/arch/mips/include/proc.h:1.21.36.1
--- src/sys/arch/mips/include/proc.h:1.21	Fri Nov 16 07:36:11 2007
+++ src/sys/arch/mips/include/proc.h	Thu Aug 20 07:52:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.21 2007/11/16 07:36:11 skrll Exp $	*/
+/*	$NetBSD: proc.h,v 1.21.36.1 2009/08/20 07:52:38 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -44,9 +44,10 @@
 /*
  * Machine-dependent part of the lwp structure for MIPS
  */
+struct frame;
 
 struct mdlwp {
-	void	*md_regs;		/* registers on current frame */
+	struct frame *md_regs;		/* registers on current frame */
 	int	md_flags;		/* machine-dependent flags */
 	int	md_upte[UPAGES];	/* ptes for mapping u page */
 	vaddr_t	md_ss_addr;		/* single step address for ptrace */
@@ -56,7 +57,9 @@
 
 struct mdproc {
 	/* syscall entry for this process */
-	void	(*md_syscall)(struct lwp *, u_int, u_int, u_int);
+	void	(*md_syscall)(struct lwp *, u_int, u_int, vaddr_t);
+	int	md_abi;			/* which ABI is this process using? */
+	int	md_fancy;		
 };
 
 /* md_flags */



CVS commit: src/lib/libc/gen

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 08:30:04 UTC 2009

Modified Files:
src/lib/libc/gen: nlist.c nlist_aout.c

Log Message:
Instead of including a.out.h to get at struct nlist (with a comment
to explain it), include nlist.h instead, so that our mips ports don't
error out in the absence of aout_machdep.h.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/nlist.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/nlist_aout.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/libc/gen/nlist.c
diff -u src/lib/libc/gen/nlist.c:1.21 src/lib/libc/gen/nlist.c:1.22
--- src/lib/libc/gen/nlist.c:1.21	Thu Aug  7 16:42:54 2003
+++ src/lib/libc/gen/nlist.c	Thu Aug 20 08:30:04 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist.c,v 1.21 2003/08/07 16:42:54 agc Exp $ */
+/* $NetBSD: nlist.c,v 1.22 2009/08/20 08:30:04 he Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)nlist.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: nlist.c,v 1.21 2003/08/07 16:42:54 agc Exp $);
+__RCSID($NetBSD: nlist.c,v 1.22 2009/08/20 08:30:04 he Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -81,7 +81,7 @@
 #include stdio.h
 #include string.h
 #include unistd.h
-#include a.out.h			/* for 'struct nlist' declaration */
+#include nlist.h
 
 #if 0
 #ifdef __weak_alias

Index: src/lib/libc/gen/nlist_aout.c
diff -u src/lib/libc/gen/nlist_aout.c:1.19 src/lib/libc/gen/nlist_aout.c:1.20
--- src/lib/libc/gen/nlist_aout.c:1.19	Sun Aug 16 03:56:26 2009
+++ src/lib/libc/gen/nlist_aout.c	Thu Aug 20 08:30:04 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist_aout.c,v 1.19 2009/08/16 03:56:26 matt Exp $ */
+/* $NetBSD: nlist_aout.c,v 1.20 2009/08/20 08:30:04 he Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)nlist.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: nlist_aout.c,v 1.19 2009/08/16 03:56:26 matt Exp $);
+__RCSID($NetBSD: nlist_aout.c,v 1.20 2009/08/20 08:30:04 he Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -82,7 +82,7 @@
 #include string.h
 #include unistd.h
 #include stdlib.h
-#include a.out.h			/* for 'struct nlist' declaration */
+#include nlist.h
 
 #include nlist_private.h
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 10:05:34 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: endian_machdep.h

Log Message:
Add REG_LLO and REG_LHI macros which expand to the appropriate
lwl/lwr/ldl/ldr instruction


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.154.1 src/sys/arch/mips/include/endian_machdep.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/mips/include/endian_machdep.h
diff -u src/sys/arch/mips/include/endian_machdep.h:1.1 src/sys/arch/mips/include/endian_machdep.h:1.1.154.1
--- src/sys/arch/mips/include/endian_machdep.h:1.1	Fri Mar 17 00:09:22 2000
+++ src/sys/arch/mips/include/endian_machdep.h	Thu Aug 20 10:05:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian_machdep.h,v 1.1 2000/03/17 00:09:22 mycroft Exp $	*/
+/*	$NetBSD: endian_machdep.h,v 1.1.154.1 2009/08/20 10:05:34 matt Exp $	*/
 
 #ifndef _BYTE_ORDER
 # error  Define MIPS target CPU endian-ness in port-specific header file.
@@ -14,6 +14,13 @@
 # define LWLO lwl
 # define SWHI swr
 # define SWLO swl
+# if SZREG == 4
+#  define REG_LHI   lwr
+#  define REG_LLO   lwl
+# else
+#  define REG_LHI   ldr
+#  define REG_LLO   ldl
+# endif
 #endif
 
 #if _BYTE_ORDER == _BIG_ENDIAN
@@ -21,6 +28,13 @@
 # define LWLO lwr
 # define SWHI swl
 # define SWLO swr
+# if SZREG == 4
+#  define REG_LHI   lwl
+#  define REG_LLO   lwr
+# else
+#  define REG_LHI   ldl
+#  define REG_LLO   ldr
+# endif
 #endif
 
 #endif /* LOCORE */



CVS commit: src/lib/libc/gen

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 10:19:36 UTC 2009

Modified Files:
src/lib/libc/gen: nlist_aout.c

Log Message:
Actually, when we really need the a.out defines from nlist.h, we
need to include a.out.h anyway.  Move it inside #ifdef NLIST_AOUT.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/gen/nlist_aout.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/libc/gen/nlist_aout.c
diff -u src/lib/libc/gen/nlist_aout.c:1.20 src/lib/libc/gen/nlist_aout.c:1.21
--- src/lib/libc/gen/nlist_aout.c:1.20	Thu Aug 20 08:30:04 2009
+++ src/lib/libc/gen/nlist_aout.c	Thu Aug 20 10:19:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist_aout.c,v 1.20 2009/08/20 08:30:04 he Exp $ */
+/* $NetBSD: nlist_aout.c,v 1.21 2009/08/20 10:19:36 he Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)nlist.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: nlist_aout.c,v 1.20 2009/08/20 08:30:04 he Exp $);
+__RCSID($NetBSD: nlist_aout.c,v 1.21 2009/08/20 10:19:36 he Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -82,11 +82,11 @@
 #include string.h
 #include unistd.h
 #include stdlib.h
-#include nlist.h
 
 #include nlist_private.h
 
 #ifdef NLIST_AOUT
+#include a.out.h
 #include sys/exec_aout.h
 
 int



CVS commit: src/usr.bin/sdpquery

2009-08-20 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Aug 20 11:07:42 UTC 2009

Modified Files:
src/usr.bin/sdpquery: print.c

Log Message:
add SupportedRepositories attribute for Phonebook Access profile
providing PhonebookAccessServer service


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/sdpquery/print.c

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

Modified files:

Index: src/usr.bin/sdpquery/print.c
diff -u src/usr.bin/sdpquery/print.c:1.3 src/usr.bin/sdpquery/print.c:1.4
--- src/usr.bin/sdpquery/print.c:1.3	Sat Jul 25 17:32:47 2009
+++ src/usr.bin/sdpquery/print.c	Thu Aug 20 11:07:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.3 2009/07/25 17:32:47 plunky Exp $	*/
+/*	$NetBSD: print.c,v 1.4 2009/08/20 11:07:42 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: print.c,v 1.3 2009/07/25 17:32:47 plunky Exp $);
+__RCSID($NetBSD: print.c,v 1.4 2009/08/20 11:07:42 plunky Exp $);
 
 #include ctype.h
 #include iconv.h
@@ -110,6 +110,7 @@
 static void print_net_access_type(sdp_data_t *);
 static void print_pnp_source(sdp_data_t *);
 static void print_mas_types(sdp_data_t *);
+static void print_supported_repositories(sdp_data_t *);
 
 static void print_rfcomm(sdp_data_t *);
 static void print_bnep(sdp_data_t *);
@@ -278,6 +279,10 @@
 	{ 0x0316, SupportedMessageTypes,		print_mas_types },
 };
 
+attr_t pse_attrs[] = {	/* Phonebook Access Server */
+	{ 0x0314, SupportedRepositories,		print_supported_repositories },
+};
+
 #define A(a)	a, __arraycount(a)
 service_t service_list[] = {
 	{ 0x1000, Service Discovery Server,		A(sds_attrs) },
@@ -328,8 +333,8 @@
 	{ 0x112b, UDI TA,NULL, 0 },
 	{ 0x112c, Audio/Video,			NULL, 0 },
 	{ 0x112d, SIM Access,NULL, 0 },
-	{ 0x112e, Phonebook Access PCE,		NULL, 0 },
-	{ 0x112f, Phonebook Access PSE,		NULL, 0 },
+	{ 0x112e, Phonebook Access Client,		NULL, 0 },
+	{ 0x112f, Phonebook Access Server,		A(pse_attrs) },
 	{ 0x1130, Phonebook Access,			NULL, 0 },
 	{ 0x1131, Headset HS,NULL, 0 },
 	{ 0x1132, Message Access Server,		A(mas_attrs) },
@@ -1325,6 +1330,22 @@
 }
 
 static void
+print_supported_repositories(sdp_data_t *data)
+{
+	uint8_t v;
+
+	if (!sdp_get_uint8(data, v))
+		return;
+
+	if (Nflag)
+		printf((0x%02x), v);
+
+	printf(\n);
+	if (v  (10))	printf(Local Phonebook\n);
+	if (v  (11))	printf(SIM Card\n);
+}
+
+static void
 print_rfcomm(sdp_data_t *data)
 {
 	uint8_t v;



CVS commit: src/lib/libc/gen

2009-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug 20 11:08:59 UTC 2009

Modified Files:
src/lib/libc/gen: nlist_aout.c

Log Message:
forward declare struct nlist before including nlist_private.h to avoid a
compiler warning.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/nlist_aout.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/libc/gen/nlist_aout.c
diff -u src/lib/libc/gen/nlist_aout.c:1.21 src/lib/libc/gen/nlist_aout.c:1.22
--- src/lib/libc/gen/nlist_aout.c:1.21	Thu Aug 20 10:19:36 2009
+++ src/lib/libc/gen/nlist_aout.c	Thu Aug 20 11:08:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: nlist_aout.c,v 1.21 2009/08/20 10:19:36 he Exp $ */
+/* $NetBSD: nlist_aout.c,v 1.22 2009/08/20 11:08:59 martin Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = @(#)nlist.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: nlist_aout.c,v 1.21 2009/08/20 10:19:36 he Exp $);
+__RCSID($NetBSD: nlist_aout.c,v 1.22 2009/08/20 11:08:59 martin Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -83,6 +83,7 @@
 #include unistd.h
 #include stdlib.h
 
+struct nlist;
 #include nlist_private.h
 
 #ifdef NLIST_AOUT



CVS commit: src/sys/arch/cobalt/dev

2009-08-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Aug 20 11:44:00 UTC 2009

Modified Files:
src/sys/arch/cobalt/dev: panel.c

Log Message:
Adjust attach message for failure path (found on gxemul).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/cobalt/dev/panel.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/cobalt/dev/panel.c
diff -u src/sys/arch/cobalt/dev/panel.c:1.18 src/sys/arch/cobalt/dev/panel.c:1.19
--- src/sys/arch/cobalt/dev/panel.c:1.18	Fri May  9 10:59:55 2008
+++ src/sys/arch/cobalt/dev/panel.c	Thu Aug 20 11:43:59 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: panel.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $ */
+/* $NetBSD: panel.c,v 1.19 2009/08/20 11:43:59 tsutsui Exp $ */
 
 /*
  * Copyright (c) 2002 Dennis I. Chernoivanov
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: panel.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: panel.c,v 1.19 2009/08/20 11:43:59 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -139,6 +139,8 @@
 	bus_space_subregion(sc-sc_lcd.sc_iot, sc-sc_lcd.sc_ioir, DATA_OFFSET,
 	1, sc-sc_lcd.sc_iodr);
 
+	printf(\n);
+
 	sc-sc_lcd.sc_dev_ok = 1;
 	sc-sc_lcd.sc_cols = PANEL_COLS;
 	sc-sc_lcd.sc_vcols = PANEL_VCOLS;
@@ -169,8 +171,6 @@
 
 	callout_init(sc-sc_callout, 0);
 	selinit(sc-sc_selq);
-
-	printf(\n);
 }
 
 static void



CVS commit: src/external/gpl3/binutils/dist/include/opcode

2009-08-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 20 12:48:53 UTC 2009

Modified Files:
src/external/gpl3/binutils/dist/include/opcode: hppa.h

Log Message:
Add a !FLAG_STRICT bb variant to (re-)allow:

sign:   .equ8
bb  sign, 0, foo


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/binutils/dist/include/opcode/hppa.h

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

Modified files:

Index: src/external/gpl3/binutils/dist/include/opcode/hppa.h
diff -u src/external/gpl3/binutils/dist/include/opcode/hppa.h:1.1.1.1 src/external/gpl3/binutils/dist/include/opcode/hppa.h:1.2
--- src/external/gpl3/binutils/dist/include/opcode/hppa.h:1.1.1.1	Tue Aug 18 09:49:31 2009
+++ src/external/gpl3/binutils/dist/include/opcode/hppa.h	Thu Aug 20 12:48:53 2009
@@ -597,6 +597,7 @@
 { bb,		0xc0006000, 0xffe06000, ?Bnx,!,w, pa20, FLAG_STRICT}, 
 { bb,		0xc4004000, 0xfc006000, ?bnx,Q,w, pa10, FLAG_STRICT}, 
 { bb,		0xc4004000, 0xfc004000, ?Bnx,B,w, pa20, FLAG_STRICT}, 
+{ bb,		0xc4004000, 0xfc006000, ?bnx,Q,w, pa10, 0}, 
 { bvb,	0xc0004000, 0xffe04000, ?bnx,w, pa10, 0},
 { clrbts,	0xe8004005, 0x, , pa20, FLAG_STRICT},
 { popbts,	0xe8004005, 0xf007, $, pa20, FLAG_STRICT},



CVS commit: src/sys/arch/arm/footbridge/isa

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 12:51:28 UTC 2009

Modified Files:
src/sys/arch/arm/footbridge/isa: isa_machdep.c

Log Message:
Typo correction: it's isa_dmadestroy(), not isa_dma_destroy(), apparently.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/footbridge/isa/isa_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/footbridge/isa/isa_machdep.c
diff -u src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.15 src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.16
--- src/sys/arch/arm/footbridge/isa/isa_machdep.c:1.15	Wed Aug 19 15:01:07 2009
+++ src/sys/arch/arm/footbridge/isa/isa_machdep.c	Thu Aug 20 12:51:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.15 2009/08/19 15:01:07 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.16 2009/08/20 12:51:28 he Exp $	*/
 
 /*-
  * Copyright (c) 1996-1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.15 2009/08/19 15:01:07 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.16 2009/08/20 12:51:28 he Exp $);
 
 #include opt_irqstats.h
 
@@ -504,7 +504,7 @@
 isa_detach_hook(isa_chipset_tag_t ic, device_t self)
 {
 #if NISADMA  0
-	isa_dma_destroy();
+	isa_dmadestroy(ic);
 #endif
 }
 



CVS commit: src/sys/dev/tc

2009-08-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Aug 20 12:55:26 UTC 2009

Modified Files:
src/sys/dev/tc: sfb.c

Log Message:
Use volatile on device register access.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/tc/sfb.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/tc/sfb.c
diff -u src/sys/dev/tc/sfb.c:1.78 src/sys/dev/tc/sfb.c:1.79
--- src/sys/dev/tc/sfb.c:1.78	Wed Dec 17 20:51:35 2008
+++ src/sys/dev/tc/sfb.c	Thu Aug 20 12:55:26 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: sfb.c,v 1.78 2008/12/17 20:51:35 cegger Exp $ */
+/* $NetBSD: sfb.c,v 1.79 2009/08/20 12:55:26 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sfb.c,v 1.78 2008/12/17 20:51:35 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sfb.c,v 1.79 2009/08/20 12:55:26 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -330,8 +330,8 @@
 
 	base = (void *)ri-ri_hw;
 	asic = base + SFB_ASIC_OFFSET;
-	hsetup = *(u_int32_t *)(asic + SFB_ASIC_VIDEO_HSETUP);
-	vsetup = *(u_int32_t *)(asic + SFB_ASIC_VIDEO_VSETUP);
+	hsetup = *(volatile u_int32_t *)(asic + SFB_ASIC_VIDEO_HSETUP);
+	vsetup = *(volatile u_int32_t *)(asic + SFB_ASIC_VIDEO_VSETUP);
 
 	vbase = 1;
 	SFBWRITE32(asic, SFB_ASIC_VIDEO_BASE, vbase);



CVS commit: src/sys/arch/powerpc/include

2009-08-20 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Aug 20 14:21:12 UTC 2009

Modified Files:
src/sys/arch/powerpc/include: isa_machdep.h

Log Message:
Declare genppc_isa_detach_hook().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/isa_machdep.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/powerpc/include/isa_machdep.h
diff -u src/sys/arch/powerpc/include/isa_machdep.h:1.5 src/sys/arch/powerpc/include/isa_machdep.h:1.6
--- src/sys/arch/powerpc/include/isa_machdep.h:1.5	Wed Aug 19 14:44:48 2009
+++ src/sys/arch/powerpc/include/isa_machdep.h	Thu Aug 20 14:21:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.5 2009/08/19 14:44:48 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.6 2009/08/20 14:21:12 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -101,6 +101,7 @@
  */
 void	genppc_isa_attach_hook(struct device *, struct device *,
 	struct isabus_attach_args *);
+void	genppc_isa_detach_hook(isa_chipset_tag_t, device_t);
 const struct evcnt *genppc_isa_intr_evcnt(isa_chipset_tag_t, int);
 void	*genppc_isa_intr_establish(isa_chipset_tag_t, int /*irq*/, int /*type*/,
 	int /*level*/, int (*ih_fun)(void *), void *);



CVS commit: src

2009-08-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 20 14:43:07 UTC 2009

Modified Files:
src/distrib/cats/instkernel: Makefile
src/sys/arch/cats/conf: Makefile.cats.inc

Log Message:
Remove .ARM.attributes when converting from ELF to a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/cats/instkernel/Makefile
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/cats/conf/Makefile.cats.inc

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

Modified files:

Index: src/distrib/cats/instkernel/Makefile
diff -u src/distrib/cats/instkernel/Makefile:1.17 src/distrib/cats/instkernel/Makefile:1.18
--- src/distrib/cats/instkernel/Makefile:1.17	Mon Jun  9 20:05:12 2008
+++ src/distrib/cats/instkernel/Makefile	Thu Aug 20 14:43:06 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2008/06/09 20:05:12 he Exp $
+#	$NetBSD: Makefile,v 1.18 2009/08/20 14:43:06 skrll Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -17,6 +17,7 @@
 	-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 	-R .debug_frame -R .debug_loc -R .debug_pubnames -R .debug_aranges \
 	-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
+	-R .ARM.attributes \
 	${.TARGET} ${.TARGET}
 
 .include ${DISTRIBDIR}/common/Makefile.mdset

Index: src/sys/arch/cats/conf/Makefile.cats.inc
diff -u src/sys/arch/cats/conf/Makefile.cats.inc:1.21 src/sys/arch/cats/conf/Makefile.cats.inc:1.22
--- src/sys/arch/cats/conf/Makefile.cats.inc:1.21	Sat Jun  7 19:22:43 2008
+++ src/sys/arch/cats/conf/Makefile.cats.inc	Thu Aug 20 14:43:07 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.cats.inc,v 1.21 2008/06/07 19:22:43 he Exp $
+#	$NetBSD: Makefile.cats.inc,v 1.22 2009/08/20 14:43:07 skrll Exp $
 
 MACHINE_ARCH=	arm
 CPPFLAGS+=	-D${MACHINE}
@@ -27,13 +27,13 @@
 		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
 		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 		-R .debug_frame -R .debug_loc -R .debug_pubnames \
-		-R .debug_aranges \
+		-R .debug_aranges -R .ARM.attributes \
 		$@ $...@.aout; \
 	${OBJCOPY} -O a.out-arm-netbsd \
 		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
 		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 		-R .debug_frame -R .debug_loc -R .debug_pubnames \
-		-R .debug_aranges \
+		-R .debug_aranges -R .ARM.attributes \
 		$@ $...@.aout
 .endif
 .endif



CVS commit: src

2009-08-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Aug 20 15:14:49 UTC 2009

Modified Files:
src/share/man/man8/man8.atari: binpatch.8
src/sys/arch/atari/stand/binpatch: Makefile binpatch.c

Log Message:
Rewrite binpatch(8) utility to add support for ELF binaries,
using implementation of old src/usr.sbin/mdsetimage sources
which supports misc executable formats without LGPL'ed libbfd.

No particular comments on port-at...@.

XXX1: amiga also has the similar utility in amiga/stand/binpatch
  but it has slightly different options.
XXX2: Is it worth to put this utility into MI src/usr.sbin to patch
  rtc_offset etc. in GENERIC kernel binaries in distribution?


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man8/man8.atari/binpatch.8
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/atari/stand/binpatch/Makefile \
src/sys/arch/atari/stand/binpatch/binpatch.c

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

Modified files:

Index: src/share/man/man8/man8.atari/binpatch.8
diff -u src/share/man/man8/man8.atari/binpatch.8:1.5 src/share/man/man8/man8.atari/binpatch.8:1.6
--- src/share/man/man8/man8.atari/binpatch.8:1.5	Wed Dec 26 01:26:44 2001
+++ src/share/man/man8/man8.atari/binpatch.8	Thu Aug 20 15:14:49 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: binpatch.8,v 1.5 2001/12/26 01:26:44 wiz Exp $
+.\	$NetBSD: binpatch.8,v 1.6 2009/08/20 15:14:49 tsutsui Exp $
 .\
 .\ Copyright (c) 1994 Christian E. Hopps
 .\ All rights reserved.
@@ -28,22 +28,24 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 2, 1994
+.Dd August 20, 2009
 .Dt BINPATCH 8 atari
 .Os
 .Sh NAME
 .Nm binpatch
-.Nd examine and or modify initialized data in a binary file
+.Nd examine and or modify initialized data in an executable binary
 .Sh SYNOPSIS
 .Nm binpatch
-.Op Fl b | Fl w | Fl l
+.Op Fl b | Fl w | Fl l | Fl d
 .Op Fl o Ar offset
+.Op Fl T Ar saddr
 .Fl s Ar symname
 .Op Fl r Ar value
 .Ar binfile
 .Nm binpatch
-.Op Fl b | Fl w | Fl l
+.Op Fl b | Fl w | Fl l | Fl d
 .Op Fl o Ar offset
+.Op Fl T Ar saddr
 .Fl a Ar addr
 .Op Fl r Ar value
 .Ar binfile
@@ -52,20 +54,39 @@
 is used to modify or examine the data associated with a symbol in a binary
 file
 .Ar binfile .
+.Pp
 The flags
 .Fl b ,
-.Fl w
+.Fl w ,
+.Fl l ,
 and
+.Fl d
+specify the size of the data to be modified or examined.
+.Fl b
+is for 8bit
+.Pq Li int8_t ,
+.Fl w
+is for 16bit
+.Pq Li int16_t ,
 .Fl l
-specify the size of the data to be modified or examined
-(byte, word and long respectively.) The
+is for 32bit
+.Pq Li int32_t ,
+and
+.Fl d
+is for 64bit
+.Pq Li int64_t
+variables.
+.Pp
+The
 .Ar binfile
 is scanned in search of the symbol
 .Ar symname
 (specified with the
 .Fl s
 flag.)
-If the symbol is found the current data and address are printed.  Next if the
+If the symbol is found the current data and address are printed.
+.Pp
+Next if the
 .Fl r
 flag has been given, the current data is replaced with that of
 .Ar value .
@@ -79,11 +100,17 @@
 .Pp
 The
 .Fl o
-flag specifies an offset in byte, word or long
+flag specifies an offset in
+.Li int8_t ,
+.Li int16_t ,
+.Li int32_t ,
+and
+.Li int64_t
 .Fl ( b ,
 .Fl w ,
+.Fl l ,
 or
-.Fl l )
+.Fl d )
 units from the given locator
 .Fl ( s
 or
@@ -91,3 +118,28 @@
 for
 .Nm
 to perform its described actions.
+This might be useful to patch a member of array or structure.
+.Pp
+The
+.Fl T
+flag is used to specify the starting address of a.out binary text segment.
+Ignored for other binary executable formats.
+.Sh SEE ALSO
+.Xr gdb 1 ,
+.Xr mdsetimage 8
+.Sh BUGS
+The
+.Nm
+command doesn't check if size of specified symbol is same with the
+specified size by
+.Fl b ,
+.Fl w ,
+.Fl l ,
+or
+.Fl d
+flag.
+.Pp
+The
+.Nm
+command doesn't check if specified address or symbol is a patchable variable
+and it might corrupts the specified executable binary.

Index: src/sys/arch/atari/stand/binpatch/Makefile
diff -u src/sys/arch/atari/stand/binpatch/Makefile:1.5 src/sys/arch/atari/stand/binpatch/Makefile:1.6
--- src/sys/arch/atari/stand/binpatch/Makefile:1.5	Wed Dec 12 01:49:38 2001
+++ src/sys/arch/atari/stand/binpatch/Makefile	Thu Aug 20 15:14:49 2009
@@ -1,9 +1,50 @@
-#	$NetBSD: Makefile,v 1.5 2001/12/12 01:49:38 tv Exp $
+#	$NetBSD: Makefile,v 1.6 2009/08/20 15:14:49 tsutsui Exp $
 
-PROG=binpatch
-NOMAN=	# defined
+BINDIR?= /sbin
+WARNS?=	4
 
-BINDIR=/sbin
-LDFLAGS+=-static
+PROG=	binpatch
+SRCS=	binpatch.c
+SRCS+=	exec_aout.c exec_ecoff.c exec_elf32.c exec_elf64.c exec_coff.c
+
+#MAN=	binpatch.8	# currently it's in src/share/man/man8/man8.atari
+NOMAN=
+
+MDSETIMAGE=${NETBSDSRCDIR}/usr.sbin/mdsetimage
+CPPFLAGS+= -I${MDSETIMAGE}
+.PATH:	${MDSETIMAGE}
+
+.include bsd.own.mk	# for ${MACHINE_CPU}
+
+.if	${MACHINE_ARCH} == alpha
+CPPFLAGS+=-DNLIST_ECOFF
+CPPFLAGS+=-DNLIST_ELF64
+.elif	${MACHINE_CPU} == mips

CVS commit: src/usr.sbin/sdpd

2009-08-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Aug 20 15:51:29 UTC 2009

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
Simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sdpd/sdpd.8

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

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.6 src/usr.sbin/sdpd/sdpd.8:1.7
--- src/usr.sbin/sdpd/sdpd.8:1.6	Tue May 12 10:27:53 2009
+++ src/usr.sbin/sdpd/sdpd.8	Thu Aug 20 15:51:28 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: sdpd.8,v 1.6 2009/05/12 10:27:53 wiz Exp $
+.\ $NetBSD: sdpd.8,v 1.7 2009/08/20 15:51:28 joerg Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com
@@ -49,9 +49,7 @@
 .Pp
 In order to discover services, remote Bluetooth devices send Service
 Search and Service Attribute or Service Search Attribute requests over
-Bluetooth L2CAP connections on the SDP PSM
-. Pq 0x0001 .
-The
+Bluetooth L2CAP connections on the SDP PSM (0x0001).  The
 .Nm
 daemon will try to find matching Service Records in its Service Database
 and will return the requested record extracts for the remote device to



CVS commit: src/usr.sbin/sdpd

2009-08-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 20 15:59:57 UTC 2009

Modified Files:
src/usr.sbin/sdpd: sdpd.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sdpd/sdpd.8

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

Modified files:

Index: src/usr.sbin/sdpd/sdpd.8
diff -u src/usr.sbin/sdpd/sdpd.8:1.7 src/usr.sbin/sdpd/sdpd.8:1.8
--- src/usr.sbin/sdpd/sdpd.8:1.7	Thu Aug 20 15:51:28 2009
+++ src/usr.sbin/sdpd/sdpd.8	Thu Aug 20 15:59:57 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: sdpd.8,v 1.7 2009/08/20 15:51:28 joerg Exp $
+.\ $NetBSD: sdpd.8,v 1.8 2009/08/20 15:59:57 wiz Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com
@@ -49,7 +49,8 @@
 .Pp
 In order to discover services, remote Bluetooth devices send Service
 Search and Service Attribute or Service Search Attribute requests over
-Bluetooth L2CAP connections on the SDP PSM (0x0001).  The
+Bluetooth L2CAP connections on the SDP PSM (0x0001).
+The
 .Nm
 daemon will try to find matching Service Records in its Service Database
 and will return the requested record extracts for the remote device to



CVS commit: src/etc/ssh

2009-08-20 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Thu Aug 20 16:26:55 UTC 2009

Modified Files:
src/etc/ssh: ssh_known_hosts

Log Message:
add morden, mollari, pkgbuild and build
adjust funtion names' keys
add the proper names of hosts too in preparation of their function moving


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/etc/ssh/ssh_known_hosts

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

Modified files:

Index: src/etc/ssh/ssh_known_hosts
diff -u src/etc/ssh/ssh_known_hosts:1.4 src/etc/ssh/ssh_known_hosts:1.5
--- src/etc/ssh/ssh_known_hosts:1.4	Tue Sep 26 21:57:06 2006
+++ src/etc/ssh/ssh_known_hosts	Thu Aug 20 16:26:55 2009
@@ -1,12 +1,27 @@
-#	$NetBSD: ssh_known_hosts,v 1.4 2006/09/26 21:57:06 tron Exp $
+#	$NetBSD: ssh_known_hosts,v 1.5 2009/08/20 16:26:55 spz Exp $
 #
-anoncvs.netbsd.org 1024 33 124527836847225907702134616704062642655823674633646867489991942489052722003567896405835432181052901730304969527126160762854542328265293874791858398238222787853274712973179184350617008506840396224723739301126809289775083202762136105883911120059428253653584248682397589937086051061126544879545951581690785060623
 anoncvs.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEA3QiBl8leG9fqIJpKeNov0PKq5YryFFiroMWOPUv4hDFn8R0jC07YVaR/OSBrr37CTmGX5AFceXPzoFnLlwCqWR7rXg4NR75FTlTp9CG9EBAEtU8mee27KDrUFBTZdfVl2+aRYoAI5fTXA+0vpIO68Cq843vRWUZCcwinS4cNLUU=
 
-cvs.netbsd.org,cvs4.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEA1b7MS3j0v6NzPr/Snh8OJTILvGLD9OA/zdrTfzQdq3doJjkLKJhD4WYj8SonaauEKuqzdJa1KVilj44GCrJBnjwbWg2BdJWLzB5YFmNgvmXwoqrl9kRyzMVk47UOxeREIipXldKajkCTc/nwa1mGrsCwVlC+TwAhWIyjyza6MOk=
+cvs.netbsd.org,cvs4.netbsd.org,cvs6.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEA1b7MS3j0v6NzPr/Snh8OJTILvGLD9OA/zdrTfzQdq3doJjkLKJhD4WYj8SonaauEKuqzdJa1KVilj44GCrJBnjwbWg2BdJWLzB5YFmNgvmXwoqrl9kRyzMVk47UOxeREIipXldKajkCTc/nwa1mGrsCwVlC+TwAhWIyjyza6MOk=
 
-ftp.netbsd.org,ftp4.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEApDHT2kauEY8RhFXgB5/QIlg3vbdLWvXSfofAvZQ6Ks5y3xKXYiMqKG/WEm5kkycpFMI4QBCA/wzi1/IiTFA2f2ZosxZlTVOhGPoyB6oEQPPHmLEjS3vzkc2Dwo59qF+6VGkRH+Yd2Q03gbxXKqEY7ck2GFsSpIzdA0fm3jwmb+E=
+ftp.netbsd.org,ftp4.netbsd.org,ftp6.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAv+tO1aHHsW1McwHgnJ28qsXn8gH8z/61yopJzmOKuHH07zBYOnhenAcni6E0+BRavSXXIuuTDdyxEyWcTqXoR0LEVShTzAFmZS3RyzTVl7A+Fp644lNnRaJh1380H+20uZjcKSPU0IudG5J7QllMbJY9RnIBFjGLzTb4vrC8GIc=
 
 mail.netbsd.org,homeworld.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAt8UJLhW8iou8Ack7V5XrzfCgzOkdK75+xDZePMBPg+CYDLnHbP1+KQaSrvfnvDzCvgOUXHOkGji1jbrtzDYwv7Itw0hRUo7TxR99c3bTomb9U0vWV5k4FDIyz4xJXWBJMVkKseAWAXgnc5FSdB6V/e21TAISJBl9dolhqOGVsxM=
 
 www.netbsd.org,www4.netbsd.org,gnats.netbsd.org,releng.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAyBrlCbbZ2lQxWt7c9Ru0byoOktalLWKJ4t0kzWp6C2oVa+Ll1c1TO2FJb34DCZqULfSHaMmKgq647d75npk9GeXXLk8QwcX6kNl7QFnHo7GUHnHtiZAjTMbYmYOaNLi1PjwyQH+9yeRQYsGW7xejTsyK0yuRKROdCl/QU9gkB3s=
+
+pkgbuild.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAz2c3dFuPdL75gpvwiYinwQ5jiRlfe3HvbXbMkTvpZxLFBQWTVkcDr/yd+vCiWcqVKVENX2tIvT91gPM9/iw7Wl82rxZ54jjaL0pWPL0yjSVhSFxff9pH+as5hgX4l1HjmXLB6v+MWyYVmOSpB01NfVVV2Z9+BGp3Y7i+U5pCdf0=
+
+build.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAzmmcuzoX0D/qDFdDJDyRgQGkUaNTEu7GdruMg1N+ajqvEoKQHQEEBrMdDbeYqCUYacHyhTRMrP6vZ27iX90rl9iS1lR2iPHp/mbnf+iV/BzdWROPvJWxp9/Am/DrYL+Idah5AYNnkC7fon9n+BeMqPDXYGYl/U+dAzp+8GHPhRc=
+
+blog.netbsd.org,rt.netbsd.org,monitor.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEArWf/facPOPEDY9ZfTpiNHK0HQFv05VtvR/LzgBAXnugAD87VdlkSKTj97UGkEjxIVFDMc2Wfh5THeCNvl38sScY9JGtKaE1VSCdmmVyG2d1Ky4XjARS3l4/ZYiBbZRNGm34+ZlpxgXOGSgNB72RrBVK6upAweXpR7egY6fpiwi0=
+
+mollari.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEArWf/facPOPEDY9ZfTpiNHK0HQFv05VtvR/LzgBAXnugAD87VdlkSKTj97UGkEjxIVFDMc2Wfh5THeCNvl38sScY9JGtKaE1VSCdmmVyG2d1Ky4XjARS3l4/ZYiBbZRNGm34+ZlpxgXOGSgNB72RrBVK6upAweXpR7egY6fpiwi0=
+
+garibaldi.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEA7CW/T6MxwXi2qAQSGnSRXqwlwhrKsKVj3VKbsPpFf3fg28259fpqBYHgE4qWlhxg/wEtHoMaxRee1H3KaQwj88ez4fYMgDRkDgFY+NlwII/vgeFFKvjZvzsmfLP75uXC9YS/AlagHmIeubu4ymlgQ29fpwacKmrgCLTrEIXMHPc=
+
+babylon5.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEApDHT2kauEY8RhFXgB5/QIlg3vbdLWvXSfofAvZQ6Ks5y3xKXYiMqKG/WEm5kkycpFMI4QBCA/wzi1/IiTFA2f2ZosxZlTVOhGPoyB6oEQPPHmLEjS3vzkc2Dwo59qF+6VGkRH+Yd2Q03gbxXKqEY7ck2GFsSpIzdA0fm3jwmb+E=
+
+morden.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAv+tO1aHHsW1McwHgnJ28qsXn8gH8z/61yopJzmOKuHH07zBYOnhenAcni6E0+BRavSXXIuuTDdyxEyWcTqXoR0LEVShTzAFmZS3RyzTVl7A+Fp644lNnRaJh1380H+20uZjcKSPU0IudG5J7QllMbJY9RnIBFjGLzTb4vrC8GIc=
+
+narn.netbsd.org ssh-rsa B3NzaC1yc2EBIwAAAIEAyBrlCbbZ2lQxWt7c9Ru0byoOktalLWKJ4t0kzWp6C2oVa+Ll1c1TO2FJb34DCZqULfSHaMmKgq647d75npk9GeXXLk8QwcX6kNl7QFnHo7GUHnHtiZAjTMbYmYOaNLi1PjwyQH+9yeRQYsGW7xejTsyK0yuRKROdCl/QU9gkB3s=



CVS commit: src/usr.bin/crunch/crunchide

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 17:39:51 UTC 2009

Modified Files:
src/usr.bin/crunch/crunchide: crunchide.c exec_coff.c

Log Message:
Remove the include of a.out.h, since these files do not appear
to need it.  Fixes build for mips ports.
Also fix a comment: crunchide walks the symbol table, not
just the a.out symbol table.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/crunch/crunchide/crunchide.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/crunch/crunchide/exec_coff.c

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

Modified files:

Index: src/usr.bin/crunch/crunchide/crunchide.c
diff -u src/usr.bin/crunch/crunchide/crunchide.c:1.12 src/usr.bin/crunch/crunchide/crunchide.c:1.13
--- src/usr.bin/crunch/crunchide/crunchide.c:1.12	Tue Aug 24 12:25:26 2004
+++ src/usr.bin/crunch/crunchide/crunchide.c	Thu Aug 20 17:39:51 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: crunchide.c,v 1.12 2004/08/24 12:25:26 wiz Exp $ */
+/* $NetBSD: crunchide.c,v 1.13 2009/08/20 17:39:51 he Exp $ */
 
 /*
  * Copyright (c) 1997 Christopher G. Demetriou.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 /*
- * crunchide.c - tiptoes through an a.out symbol table, hiding all defined
+ * crunchide.c - tiptoes through a symbol table, hiding all defined
  *	global symbols.  Allows the user to supply a keep list of symbols
  *	that are not to be hidden.  This program relies on the use of the
  * 	linker's -dc flag to actually put global bss data into the file's
@@ -63,7 +63,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: crunchide.c,v 1.12 2004/08/24 12:25:26 wiz Exp $);
+__RCSID($NetBSD: crunchide.c,v 1.13 2009/08/20 17:39:51 he Exp $);
 #endif
 
 #include unistd.h
@@ -72,7 +72,6 @@
 #include string.h
 #include fcntl.h
 #include errno.h
-#include a.out.h
 #include sys/types.h
 #include sys/stat.h
 

Index: src/usr.bin/crunch/crunchide/exec_coff.c
diff -u src/usr.bin/crunch/crunchide/exec_coff.c:1.6 src/usr.bin/crunch/crunchide/exec_coff.c:1.7
--- src/usr.bin/crunch/crunchide/exec_coff.c:1.6	Sat Jul 26 20:34:12 2003
+++ src/usr.bin/crunch/crunchide/exec_coff.c	Thu Aug 20 17:39:51 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_coff.c,v 1.6 2003/07/26 20:34:12 salo Exp $ */
+/* $NetBSD: exec_coff.c,v 1.7 2009/08/20 17:39:51 he Exp $ */
 
 /*
  * Copyright (c) 1997 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: exec_coff.c,v 1.6 2003/07/26 20:34:12 salo Exp $);
+__RCSID($NetBSD: exec_coff.c,v 1.7 2009/08/20 17:39:51 he Exp $);
 #endif
  
 #include stdio.h
@@ -44,7 +44,6 @@
 #include string.h
 #include unistd.h
 #include errno.h
-#include a.out.h
 #include limits.h
 #include sys/types.h
 #include sys/stat.h



CVS commit: src/external/gpl3/binutils/lib/libbfd/arch

2009-08-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 20 19:44:55 UTC 2009

Modified Files:
src/external/gpl3/binutils/lib/libbfd/arch/alpha: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/arm: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/armeb: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/hppa: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/i386: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/m68000: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/m68k: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/mipseb: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/mipsel: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/powerpc: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/powerpc64: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/sh3eb: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/sh3el: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/sparc: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/sparc64: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/vax: bfdver.h
src/external/gpl3/binutils/lib/libbfd/arch/x86_64: bfdver.h

Log Message:
Re-run mknative for the PKGVERSION fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/i386/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/m68000/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/m68k/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/vax/bfdver.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h

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

Modified files:

Index: src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h:1.1 src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h:1.2
--- src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h:1.1	Tue Aug 18 20:21:59 2009
+++ src/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h	Thu Aug 20 19:44:53 2009
@@ -4,5 +4,5 @@
 
 #define BFD_VERSION_DATE 20090202
 #define BFD_VERSION 21901
-#define BFD_VERSION_STRING  (GNU Binutils)   2.19.1
+#define BFD_VERSION_STRING  (GNU Binutils)  2.19.1
 #define REPORT_BUGS_TO http://www.sourceware.org/bugzilla/

Index: src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h:1.1 src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h:1.2
--- src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h:1.1	Tue Aug 18 20:21:59 2009
+++ src/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h	Thu Aug 20 19:44:53 2009
@@ -4,5 +4,5 @@
 
 #define BFD_VERSION_DATE 20090202
 #define BFD_VERSION 21901
-#define BFD_VERSION_STRING  (GNU Binutils)   2.19.1
+#define BFD_VERSION_STRING  (GNU Binutils)  2.19.1
 #define REPORT_BUGS_TO http://www.sourceware.org/bugzilla/

Index: src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h:1.1 src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h:1.2
--- src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h:1.1	Tue Aug 18 20:21:59 2009
+++ src/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h	Thu Aug 20 19:44:53 2009
@@ -4,5 +4,5 @@
 
 #define BFD_VERSION_DATE 20090202
 #define BFD_VERSION 21901
-#define BFD_VERSION_STRING  (GNU Binutils)   2.19.1
+#define BFD_VERSION_STRING  (GNU Binutils)  2.19.1
 #define REPORT_BUGS_TO http://www.sourceware.org/bugzilla/

Index: src/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h:1.1 

CVS commit: src/usr.bin/ldd

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 21:07:47 UTC 2009

Modified Files:
src/usr.bin/ldd: Makefile

Log Message:
Um, the test for mips should use MACHINE_CPU, not MACHINE_ARCH.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/ldd/Makefile

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

Modified files:

Index: src/usr.bin/ldd/Makefile
diff -u src/usr.bin/ldd/Makefile:1.11 src/usr.bin/ldd/Makefile:1.12
--- src/usr.bin/ldd/Makefile:1.11	Thu Aug 20 19:17:19 2009
+++ src/usr.bin/ldd/Makefile	Thu Aug 20 21:07:47 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2009/08/20 19:17:19 he Exp $
+#	$NetBSD: Makefile,v 1.12 2009/08/20 21:07:47 he Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -9,7 +9,7 @@
 MAN=	ldd.1
 
 
-.if (${MACHINE_ARCH} != mips)
+.if (${MACHINE_CPU} != mips)
 SUBDIR=		aout
 LIB_AOUTDIR!=	cd ${.CURDIR}/aout  ${PRINTOBJDIR}
 EXTRA_LIBS+=	${LIB_AOUTDIR}/libldd_aout.a



CVS commit: src/usr.sbin/lpr/lpr

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 21:25:59 UTC 2009

Modified Files:
src/usr.sbin/lpr/lpr: lpr.c

Log Message:
Remove what appears to be a spurious include of a.out.h.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/lpr/lpr/lpr.c

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

Modified files:

Index: src/usr.sbin/lpr/lpr/lpr.c
diff -u src/usr.sbin/lpr/lpr/lpr.c:1.42 src/usr.sbin/lpr/lpr/lpr.c:1.43
--- src/usr.sbin/lpr/lpr/lpr.c:1.42	Sun Jan 18 09:57:26 2009
+++ src/usr.sbin/lpr/lpr/lpr.c	Thu Aug 20 21:25:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lpr.c,v 1.42 2009/01/18 09:57:26 lukem Exp $	*/
+/*	$NetBSD: lpr.c,v 1.43 2009/08/20 21:25:59 he Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)lpr.c	8.4 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: lpr.c,v 1.42 2009/01/18 09:57:26 lukem Exp $);
+__RCSID($NetBSD: lpr.c,v 1.43 2009/08/20 21:25:59 he Exp $);
 #endif
 #endif /* not lint */
 
@@ -59,7 +59,6 @@
 
 #include dirent.h
 #include fcntl.h
-#include a.out.h
 #include signal.h
 #include syslog.h
 #include pwd.h



CVS commit: src

2009-08-20 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Aug 20 21:40:59 UTC 2009

Modified Files:
src/share/man/man4: bluetooth.4
src/sys/netbt: hci.h hci_event.c hci_ioctl.c
src/usr.sbin/btconfig: btconfig.8 btconfig.c

Log Message:
add a per-unit master setting, to control requesting the master role
when accepting connections.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/bluetooth.4
cvs rdiff -u -r1.30 -r1.31 src/sys/netbt/hci.h
cvs rdiff -u -r1.18 -r1.19 src/sys/netbt/hci_event.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netbt/hci_ioctl.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/btconfig/btconfig.8
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/btconfig/btconfig.c

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

Modified files:

Index: src/share/man/man4/bluetooth.4
diff -u src/share/man/man4/bluetooth.4:1.13 src/share/man/man4/bluetooth.4:1.14
--- src/share/man/man4/bluetooth.4:1.13	Mon May  4 20:42:00 2009
+++ src/share/man/man4/bluetooth.4	Thu Aug 20 21:40:59 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: bluetooth.4,v 1.13 2009/05/04 20:42:00 wiz Exp $
+.\	$NetBSD: bluetooth.4,v 1.14 2009/08/20 21:40:59 plunky Exp $
 .\
 .\ Copyright (c) 2006 Itronix Inc.
 .\ All rights reserved.
@@ -338,6 +338,7 @@
 #define BTF_INIT_FEATURES	(1\*[Lt]\*[Lt]7)	/* waiting for features */
 #define BTF_NOOP_ON_RESET	(1\*[Lt]\*[Lt]8)	/* wait for No-op on reset */
 #define BTF_INIT_COMMANDS	(1\*[Lt]\*[Lt]9)	/* waiting for supported commands */
+#define BTF_MASTER		(1\*[Lt]\*[Lt]10)	/* request Master role */
 
 struct bt_stats {
 	uint32_t	err_tx;

Index: src/sys/netbt/hci.h
diff -u src/sys/netbt/hci.h:1.30 src/sys/netbt/hci.h:1.31
--- src/sys/netbt/hci.h:1.30	Mon Aug 10 18:25:20 2009
+++ src/sys/netbt/hci.h	Thu Aug 20 21:40:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci.h,v 1.30 2009/08/10 18:25:20 plunky Exp $	*/
+/*	$NetBSD: hci.h,v 1.31 2009/08/20 21:40:59 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -54,7 +54,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hci.h,v 1.30 2009/08/10 18:25:20 plunky Exp $
+ * $Id: hci.h,v 1.31 2009/08/20 21:40:59 plunky Exp $
  * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
  */
 
@@ -2346,6 +2346,7 @@
 #define BTF_INIT_FEATURES	(17)	/* waiting for features */
 #define BTF_POWER_UP_NOOP	(18)	/* should wait for No-op on power up */
 #define BTF_INIT_COMMANDS	(19)	/* waiting for supported commands */
+#define BTF_MASTER		(110) /* request Master role */
 
 #define BTF_INIT		(BTF_INIT_BDADDR	\
 | BTF_INIT_BUFFER_SIZE	\

Index: src/sys/netbt/hci_event.c
diff -u src/sys/netbt/hci_event.c:1.18 src/sys/netbt/hci_event.c:1.19
--- src/sys/netbt/hci_event.c:1.18	Thu Apr 24 11:38:37 2008
+++ src/sys/netbt/hci_event.c	Thu Aug 20 21:40:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_event.c,v 1.18 2008/04/24 11:38:37 ad Exp $	*/
+/*	$NetBSD: hci_event.c,v 1.19 2009/08/20 21:40:59 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hci_event.c,v 1.18 2008/04/24 11:38:37 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: hci_event.c,v 1.19 2009/08/20 21:40:59 plunky Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -653,7 +653,7 @@
 	} else {
 		memset(ap, 0, sizeof(ap));
 		bdaddr_copy(ap.bdaddr, ep.bdaddr);
-		if (unit-hci_link_policy  HCI_LINK_POLICY_ENABLE_ROLE_SWITCH)
+		if (unit-hci_flags  BTF_MASTER)
 			ap.role = HCI_ROLE_MASTER;
 		else
 			ap.role = HCI_ROLE_SLAVE;

Index: src/sys/netbt/hci_ioctl.c
diff -u src/sys/netbt/hci_ioctl.c:1.8 src/sys/netbt/hci_ioctl.c:1.9
--- src/sys/netbt/hci_ioctl.c:1.8	Sun May  3 17:21:12 2009
+++ src/sys/netbt/hci_ioctl.c	Thu Aug 20 21:40:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_ioctl.c,v 1.8 2009/05/03 17:21:12 elad Exp $	*/
+/*	$NetBSD: hci_ioctl.c,v 1.9 2009/08/20 21:40:59 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hci_ioctl.c,v 1.8 2009/05/03 17:21:12 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: hci_ioctl.c,v 1.9 2009/08/20 21:40:59 plunky Exp $);
 
 #include sys/param.h
 #include sys/domain.h
@@ -234,7 +234,8 @@
 			unit-hci_flags = ~BTF_UP;
 		}
 
-		unit-hci_flags |= (btr-btr_flags  BTF_INIT);
+		unit-hci_flags = ~BTF_MASTER;
+		unit-hci_flags |= (btr-btr_flags  (BTF_INIT | BTF_MASTER));
 
 		if ((unit-hci_flags  BTF_UP) == 0
 		 (btr-btr_flags  BTF_UP)) {

Index: src/usr.sbin/btconfig/btconfig.8
diff -u src/usr.sbin/btconfig/btconfig.8:1.10 src/usr.sbin/btconfig/btconfig.8:1.11
--- src/usr.sbin/btconfig/btconfig.8:1.10	Thu Aug 20 11:45:51 2009
+++ src/usr.sbin/btconfig/btconfig.8	Thu Aug 20 21:40:59 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: btconfig.8,v 1.10 2009/08/20 11:45:51 plunky Exp $
+.\ $NetBSD: btconfig.8,v 1.11 2009/08/20 21:40:59 plunky Exp $
 .\
 .\ Copyright (c) 2006 

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 21:45:59 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: compat_16_machdep.c

Log Message:
No need to cast to (struct frame *) anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.14.1 src/sys/arch/mips/mips/compat_16_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/mips/mips/compat_16_machdep.c
diff -u src/sys/arch/mips/mips/compat_16_machdep.c:1.12 src/sys/arch/mips/mips/compat_16_machdep.c:1.12.14.1
--- src/sys/arch/mips/mips/compat_16_machdep.c:1.12	Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mips/mips/compat_16_machdep.c	Thu Aug 20 21:45:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.12 2008/04/28 20:23:28 martin Exp $	*/
+/*	$NetBSD: compat_16_machdep.c,v 1.12.14.1 2009/08/20 21:45:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 	
-__KERNEL_RCSID(0, $NetBSD: compat_16_machdep.c,v 1.12 2008/04/28 20:23:28 martin Exp $); 
+__KERNEL_RCSID(0, $NetBSD: compat_16_machdep.c,v 1.12.14.1 2009/08/20 21:45:59 matt Exp $); 
 
 #include opt_cputype.h
 #include opt_compat_netbsd.h
@@ -89,10 +89,9 @@
 	struct sigacts *ps = p-p_sigacts;
 	int onstack, error;
 	struct sigcontext *scp = getframe(l, sig, onstack), ksc;
-	struct frame *f;
+	struct frame *f = l-l_md.md_regs;
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-	f = (struct frame *)l-l_md.md_regs;
 
 	scp--;
 
@@ -243,7 +242,7 @@
 		return (EINVAL);
 
 	/* Restore the register context. */
-	f = (struct frame *)l-l_md.md_regs;
+	f = l-l_md.md_regs;
 	f-f_regs[_R_PC] = ksc.sc_pc;
 	f-f_regs[_R_MULLO] = ksc.mullo;
 	f-f_regs[_R_MULHI] = ksc.mulhi;



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 21:49:24 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: compat_13_machdep.c
cpu_exec.c db_interface.c

Log Message:
No need to cast to (struct frame *) anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.20.1 src/sys/arch/mips/mips/compat_13_machdep.c
cvs rdiff -u -r1.50.54.1 -r1.50.54.1.4.1 src/sys/arch/mips/mips/cpu_exec.c
cvs rdiff -u -r1.64 -r1.64.16.1 src/sys/arch/mips/mips/db_interface.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/mips/mips/compat_13_machdep.c
diff -u src/sys/arch/mips/mips/compat_13_machdep.c:1.16 src/sys/arch/mips/mips/compat_13_machdep.c:1.16.20.1
--- src/sys/arch/mips/mips/compat_13_machdep.c:1.16	Thu Apr 24 18:39:21 2008
+++ src/sys/arch/mips/mips/compat_13_machdep.c	Thu Aug 20 21:49:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_13_machdep.c,v 1.16 2008/04/24 18:39:21 ad Exp $	*/
+/*	$NetBSD: compat_13_machdep.c,v 1.16.20.1 2009/08/20 21:49:24 matt Exp $	*/
 
 /*
  * Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -15,7 +15,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: compat_13_machdep.c,v 1.16 2008/04/24 18:39:21 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: compat_13_machdep.c,v 1.16.20.1 2009/08/20 21:49:24 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -68,7 +68,7 @@
 		return (EINVAL);
 
 	/* Resture the register context. */
-	f = (struct frame *)l-l_md.md_regs;
+	f = l-l_md.md_regs;
 	f-f_regs[_R_PC] = ksc.sc_pc;
 	f-f_regs[_R_MULLO] = ksc.mullo;
 	f-f_regs[_R_MULHI] = ksc.mulhi;

Index: src/sys/arch/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.1
--- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1	Wed Apr  1 00:25:21 2009
+++ src/sys/arch/mips/mips/cpu_exec.c	Thu Aug 20 21:49:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.50.54.1 2009/04/01 00:25:21 snj Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.1 2009/08/20 21:49:24 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1 2009/04/01 00:25:21 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.1 2009/08/20 21:49:24 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_ultrix.h
@@ -130,7 +130,7 @@
 	u_long stack;
 {
 	struct ecoff_exechdr *execp = (struct ecoff_exechdr *)epp-ep_hdr;
-	struct frame *f = (struct frame *)l-l_md.md_regs;
+	struct frame *f = l-l_md.md_regs;
 
 	f-f_regs[_R_GP] = (register_t)execp-a.gp_value;
 }

Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.64 src/sys/arch/mips/mips/db_interface.c:1.64.16.1
--- src/sys/arch/mips/mips/db_interface.c:1.64	Fri May 23 17:01:32 2008
+++ src/sys/arch/mips/mips/db_interface.c	Thu Aug 20 21:49:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.64 2008/05/23 17:01:32 tsutsui Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.64.16.1 2009/08/20 21:49:24 matt Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64 2008/05/23 17:01:32 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.1 2009/08/20 21:49:24 matt Exp $);
 
 #include opt_cputype.h	/* which mips CPUs do we support? */
 #include opt_ddb.h
@@ -176,7 +176,7 @@
 	db_active--;
 
 	if (type  T_USER)
-		*(struct frame *)curlwp-l_md.md_regs = *f;
+		*curlwp-l_md.md_regs = *f;
 	else {
 		/* Synthetic full scale register context when trap happens */
 		tfp[TF_AST] = f-f_regs[_R_AST];
@@ -233,7 +233,7 @@
 	/* Should switch to kdb`s own stack here. */
 
 	if (type  T_USER)
-		*f = *(struct frame *)curlwp-l_md.md_regs;
+		*f = *curlwp-l_md.md_regs;
 	else {
 		/* Synthetic full scale register context when trap happens */
 		f-f_regs[_R_AST] = tfp[TF_AST];



CVS commit: src/usr.sbin/mopd/common

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 21:59:13 UTC 2009

Modified Files:
src/usr.sbin/mopd/common: Makefile

Log Message:
Define NOAOUT if we're building for mips.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/mopd/common/Makefile

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

Modified files:

Index: src/usr.sbin/mopd/common/Makefile
diff -u src/usr.sbin/mopd/common/Makefile:1.13 src/usr.sbin/mopd/common/Makefile:1.14
--- src/usr.sbin/mopd/common/Makefile:1.13	Sat Oct 25 22:27:39 2008
+++ src/usr.sbin/mopd/common/Makefile	Thu Aug 20 21:59:12 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2008/10/25 22:27:39 apb Exp $
+#	$NetBSD: Makefile,v 1.14 2009/08/20 21:59:12 he Exp $
 
 LIBISPRIVATE=	yes
 
@@ -7,6 +7,12 @@
 	print.c put.c rc.c version.c
 CLEANFILES= version.c
 
+.include bsd.own.mk
+
+.if ${MACHINE_CPU} == mips
+CFLAGS+= -DNOAOUT
+.endif
+
 version.c: VERSION
 	${_MKTARGET_CREATE}
 	rm -f version.c; \



CVS commit: src

2009-08-20 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Aug 20 22:07:50 UTC 2009

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/sys: Makefile core.h exec_aout.h
Added Files:
src/sys/sys: aout_mids.h

Log Message:
Introduce sys/aout_mids.h, and include it from sys/core.h and
sys/exec_aout.h.  This contains the various a.out machine IDs
moved out from exec_aout.h.  The a.out machine IDs are not only
used to identify a.out executable files, but also used to identify
NetBSD core dumps, so should be accessible outside of exec_aout.h.

OK'ed by matt@


To generate a diff of this commit:
cvs rdiff -u -r1.1293 -r1.1294 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.120 -r1.121 src/sys/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/sys/aout_mids.h
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/core.h
cvs rdiff -u -r1.38 -r1.39 src/sys/sys/exec_aout.h

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.1293 src/distrib/sets/lists/comp/mi:1.1294
--- src/distrib/sets/lists/comp/mi:1.1293	Sat Aug 15 16:21:04 2009
+++ src/distrib/sets/lists/comp/mi	Thu Aug 20 22:07:49 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1293 2009/08/15 16:21:04 joerg Exp $
+#	$NetBSD: mi,v 1.1294 2009/08/20 22:07:49 he Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1921,6 +1921,7 @@
 ./usr/include/sys/agpio.h			comp-c-include
 ./usr/include/sys/aio.hcomp-c-include
 ./usr/include/sys/ansi.h			comp-c-include
+./usr/include/sys/aout_mids.h			comp-c-include
 ./usr/include/sys/ataio.h			comp-c-include
 ./usr/include/sys/atomic.h			comp-c-include
 ./usr/include/sys/audioio.h			comp-c-include

Index: src/sys/sys/Makefile
diff -u src/sys/sys/Makefile:1.120 src/sys/sys/Makefile:1.121
--- src/sys/sys/Makefile:1.120	Sat Aug 15 09:43:59 2009
+++ src/sys/sys/Makefile	Thu Aug 20 22:07:49 2009
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.120 2009/08/15 09:43:59 mbalmer Exp $
+#	$NetBSD: Makefile,v 1.121 2009/08/20 22:07:49 he Exp $
 
 .include bsd.sys.mk
 
 INCSDIR= /usr/include/sys
 
-INCS=	acct.h agpio.h aio.h ansi.h ataio.h atomic.h audioio.h \
+INCS=	acct.h agpio.h aio.h ansi.h aout_mids.h ataio.h atomic.h audioio.h \
 	bitops.h bootblock.h bswap.h buf.h \
 	callback.h callout.h cdefs.h cdefs_aout.h \
 	cdefs_elf.h cdio.h chio.h clockctl.h condvar.h conf.h core.h \

Index: src/sys/sys/core.h
diff -u src/sys/sys/core.h:1.11 src/sys/sys/core.h:1.12
--- src/sys/sys/core.h:1.11	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/core.h	Thu Aug 20 22:07:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: core.h,v 1.11 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: core.h,v 1.12 2009/08/20 22:07:49 he Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -57,6 +57,8 @@
 #define CORE_DATA	2
 #define CORE_STACK	4
 
+#include sys/aout_mids.h
+
 /*
  * A core file consists of a header followed by a number of segments.
  * Each segment is preceded by a `coreseg' structure giving the

Index: src/sys/sys/exec_aout.h
diff -u src/sys/sys/exec_aout.h:1.38 src/sys/sys/exec_aout.h:1.39
--- src/sys/sys/exec_aout.h:1.38	Mon Dec 26 18:41:36 2005
+++ src/sys/sys/exec_aout.h	Thu Aug 20 22:07:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_aout.h,v 1.38 2005/12/26 18:41:36 perry Exp $	*/
+/*	$NetBSD: exec_aout.h,v 1.39 2009/08/20 22:07:49 he Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -59,41 +59,7 @@
 #define	ZMAGIC		0413	/* demand load format */
 #define	QMAGIC		0314	/* compact demand load format; deprecated */
 
-/*
- * a_mid - keep sorted in numerical order for sanity's sake
- * ensure that: 0  mid  0x3ff
- */
-#define	MID_ZERO	0	/* unknown - implementation dependent */
-#define	MID_SUN010	1	/* sun 68010/68020 binary */
-#define	MID_SUN020	2	/* sun 68020-only binary */
-#define	MID_PC386	100	/* 386 PC binary. (so quoth BFD) */
-#define	MID_HP200	200	/* hp200 (68010) BSD binary */
-#define	MID_I386	134	/* i386 BSD binary */
-#define	MID_M68K	135	/* m68k BSD binary with 8K page sizes */
-#define	MID_M68K4K	136	/* m68k BSD binary with 4K page sizes */
-#define	MID_NS32532	137	/* ns32532 */
-#define	MID_SPARC	138	/* sparc */
-#define	MID_PMAX	139	/* pmax */
-#define	MID_VAX1K	140	/* VAX 1K page size binaries */
-#define	MID_ALPHA	141	/* Alpha BSD binary */
-#define	MID_MIPS	142	/* big-endian MIPS */
-#define	MID_ARM6	143	/* ARM6 */
-#define	MID_M680002K	144	/* m68000 with 2K page sizes */
-#define	MID_SH3		145	/* SH3 */
-#define	MID_POWERPC	149	/* big-endian PowerPC */
-#define	MID_VAX		150	/* VAX */
-/* 151 - MIPS1 */
-/* 152 - MIPS2 */
-#define	MID_M88K	153	/* m88k BSD */
-#define	MID_HPPA	154	/* HP PARISC */
-#define	MID_SH5_64	155	/* LP64 SH5 */
-#define	MID_SPARC64	156	/* LP64 sparc */
-#define	MID_X86_64	157	/* AMD x86-64 */
-#define	MID_SH5_32	158	/* ILP32 SH5 */
-#define	MID_HP200	200	/* hp200 (68010) BSD binary */
-#define	

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-08-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 20 22:11:36 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: lock_stubs.S

Log Message:
Make ABI agnostic.  (generates same identical code for O32)


To generate a diff of this commit:
cvs rdiff -u -r1.9.18.1 -r1.9.18.2 src/sys/arch/mips/mips/lock_stubs.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/mips/mips/lock_stubs.S
diff -u src/sys/arch/mips/mips/lock_stubs.S:1.9.18.1 src/sys/arch/mips/mips/lock_stubs.S:1.9.18.2
--- src/sys/arch/mips/mips/lock_stubs.S:1.9.18.1	Thu Aug 20 04:19:15 2009
+++ src/sys/arch/mips/mips/lock_stubs.S	Thu Aug 20 22:11:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.9.18.1 2009/08/20 04:19:15 uebayasi Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.9.18.2 2009/08/20 22:11:36 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -42,18 +42,6 @@
 #define	FULL
 #endif
 
-#if defined(__mips_n32) || defined(_LP64)
-#define	LL	lld
-#define	SC	scd
-#define	LDPTR	ld
-#define	STPTR	sd
-#else /* !(n32 || LP64) */
-#define	LL	ll
-#define	SC	sc
-#define	LDPTR	lw
-#define	STPTR	sw
-#endif /* !(n32 || LP64) */
-
 #if MIPS_HAS_LLSC != 0  defined(MULTIPROCESSOR)
 #define	SYNC		sync
 #define	BDSYNC		sync
@@ -85,10 +73,10 @@
  */
 LEAF(_atomic_cas_ulong)
 1:
-	LL	t0, (a0)
+	LONG_LL	t0, (a0)
 	bne	t0, a1, 2f
 	 addu	t1, zero, a2
-	SC	t1, (a0)
+	LONG_SC	t1, (a0)
 	beq	t1, zero, 1b
 	 nop
 	j	ra
@@ -107,7 +95,7 @@
 STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_ulong)
 STRONG_ALIAS(atomic_cas_ptr_ni,_atomic_cas_ulong)
 
-#if defined(__mips_n32) || defined(_LP64)
+#if defined(_LP64)
 STRONG_ALIAS(_atomic_cas_64,_atomic_cas_ulong)
 STRONG_ALIAS(atomic_cas_64,_atomic_cas_ulong)
 
@@ -121,10 +109,10 @@
  */
 LEAF(_atomic_cas_uint)
 1:
-	ll	t0, (a0)
+	INT_LL	t0, (a0)
 	bne	t0, a1, 2f
 	 addu	t1, zero, a2
-	sc	t1, (a0)
+	INT_SC	t1, (a0)
 	beq	t1, zero, 1b
 	 nop
 	j	ra
@@ -149,13 +137,13 @@
  * void	mutex_enter(kmutex_t *mtx);
  */
 LEAF(mutex_enter)
-	LL	t0, MTX_OWNER(a0)
+	PTR_LL	t0, MTX_OWNER(a0)
 1:
 	bne	t0, zero, 2f
 	 addu	t2, zero, MIPS_CURLWP
-	SC	t2, MTX_OWNER(a0)
+	PTR_SC	t2, MTX_OWNER(a0)
 	beq	t2, zero, 1b
-	 LL	t0, MTX_OWNER(a0)
+	 PTR_LL	t0, MTX_OWNER(a0)
 	j	ra
 	 BDSYNC
 2:
@@ -167,14 +155,14 @@
  * void	mutex_exit(kmutex_t *mtx);
  */
 LEAF(mutex_exit)
-	LL	t0, MTX_OWNER(a0)
+	PTR_LL	t0, MTX_OWNER(a0)
 	BDSYNC
 1:
 	bne	t0, MIPS_CURLWP, 2f
 	 addu	t2, zero, zero
-	SC	t2, MTX_OWNER(a0)
+	PTR_SC	t2, MTX_OWNER(a0)
 	beq	t2, zero, 1b
-	 LL	t0, MTX_OWNER(a0)
+	 PTR_LL	t0, MTX_OWNER(a0)
 	j	ra
 	 nop
 2:
@@ -186,12 +174,12 @@
  * void	mutex_spin_enter(kmutex_t *mtx);
  */
 LEAF(mutex_spin_enter)
-	lw	t2, L_CPU(MIPS_CURLWP)
-	li	t9, -1
-	lw	t8, CPU_INFO_MTX_COUNT(t2)
-	lw	t1, MTX_IPL(a0)
-	addu	t8, t8, t9
-	sw	t8, CPU_INFO_MTX_COUNT(t2)
+	PTR_L	t2, L_CPU(MIPS_CURLWP)
+	li	ta3, -1
+	INT_L	ta2, CPU_INFO_MTX_COUNT(t2)
+	INT_L	t1, MTX_IPL(a0)
+	addu	ta2, ta2, ta3
+	INT_S	ta2, CPU_INFO_MTX_COUNT(t2)
 	mfc0	v0, MIPS_COP_0_STATUS
 	and	t1, t1, MIPS_INT_MASK
 	nor	t1, zero, t1
@@ -201,17 +189,17 @@
 	COP0_SYNC
 	bne	t8, t9, 1f
 	 and	v0, v0, (MIPS_INT_MASK | MIPS_SR_INT_IE)
-	sw	v0, CPU_INFO_MTX_OLDSPL(t2)
+	INT_S	v0, CPU_INFO_MTX_OLDSPL(t2)
 1:
 #if defined(FULL)
-	ll	t0, MTX_LOCK(a0)
+	INT_LL	t0, MTX_LOCK(a0)
 	nop
 2:
 	bne	t0, zero, 3f
 	 li	t1, 1
-	sc	t1, MTX_LOCK(a0)
+	INT_SC	t1, MTX_LOCK(a0)
 	beq	t1, zero, 2b
-	 ll	t0, MTX_LOCK(a0)
+	 INT_LL	t0, MTX_LOCK(a0)
 	j	ra
 	 BDSYNC
 3:
@@ -272,12 +260,12 @@
 	.space	12
 
 LEAF_NOPROFILE(_atomic_cas_ulong)
-	LDPTR	t0, (a0)	/* - critical section start */
+	PTR_L	t0, (a0)	/* - critical section start */
 _atomic_cas_start:
 	 nop
 	bne	t0, a1, 1f
  	 nop
-	STPTR	a2, (a0)	/* - critical section end */
+	PTR_S	a2, (a0)	/* - critical section end */
 	j	ra
 	 addu	v0, zero, a1
 1:
@@ -310,12 +298,12 @@
 	nop
 	nop
 LEAF_NOPROFILE(mutex_enter)
-	LDPTR	t0, (a0)	/* - critical section start */
+	PTR_L	t0, (a0)	/* - critical section start */
 _mutex_enter_start:
 	nop
 	bne	t0, zero, 1f
 	 nop			
-	STPTR	MIPS_CURLWP, (a0)/* - critical section end */
+	PTR_S	MIPS_CURLWP, (a0)/* - critical section end */
 	j	ra
 	 nop
 1:	j	_C_LABEL(mutex_vector_enter)
@@ -329,12 +317,12 @@
 	nop
 	nop
 LEAF_NOPROFILE(mutex_exit)
-	LDPTR	t0, (a0)	/* - critical section start */
+	PTR_L	t0, (a0)	/* - critical section start */
 _mutex_exit_start:
 	 nop
 	bne	t0, MIPS_CURLWP, 1f
 	 nop			
-	STPTR	zero, (a0)	/* - critical section end */
+	PTR_S	zero, (a0)	/* - critical section end */
 	j	ra
 	 nop
 1:	j	_C_LABEL(mutex_vector_exit)
@@ -347,12 +335,12 @@
  * void	mutex_spin_enter(kmutex_t *mtx);
  */
 LEAF(mutex_spin_enter)
-	lw	t2, L_CPU(MIPS_CURLWP)
-	li	t9, -1
-	lw	t8, CPU_INFO_MTX_COUNT(t2)
-	lw	t1, MTX_IPL(a0)
-	addu	t8, t8, t9
-	sw	t8, CPU_INFO_MTX_COUNT(t2)
+	PTR_L	t2, L_CPU(MIPS_CURLWP)
+	li	ta3, -1
+	INT_L	ta2, CPU_INFO_MTX_COUNT(t2)
+	INT_L	t1, MTX_IPL(a0)
+	addu	ta2, 

CVS commit: src/sys/common/bus_dma

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 03:33:17 UTC 2009

Added Files:
src/sys/common/bus_dma: bus_dmamem_common.c bus_dmamem_common.h

Log Message:
Add some common bus_dmamem routines to be shared by multiple platforms.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/common/bus_dma/bus_dmamem_common.c \
src/sys/common/bus_dma/bus_dmamem_common.h

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

Added files:

Index: src/sys/common/bus_dma/bus_dmamem_common.c
diff -u /dev/null src/sys/common/bus_dma/bus_dmamem_common.c:1.1
--- /dev/null	Fri Aug 21 03:33:17 2009
+++ src/sys/common/bus_dma/bus_dmamem_common.c	Fri Aug 21 03:33:17 2009
@@ -0,0 +1,227 @@
+/*	$NetBSD: bus_dmamem_common.c,v 1.1 2009/08/21 03:33:17 thorpej Exp $	*/
+
+/*-
+ * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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 sys/cdefs.h			/* RCS ID  Copyright macro defns */
+
+__KERNEL_RCSID(0, $NetBSD: bus_dmamem_common.c,v 1.1 2009/08/21 03:33:17 thorpej Exp $);
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/proc.h
+#include sys/bus.h
+
+#include uvm/uvm.h
+
+#include common/bus_dma/bus_dmamem_common.h
+
+/*
+ * _bus_dmamem_alloc_range_common --
+ *	Allocate physical memory from the specified physical address range.
+ */
+int
+_bus_dmamem_alloc_range_common(bus_dma_tag_t t,
+			   bus_size_t size,
+			   bus_size_t alignment,
+			   bus_size_t boundary,
+			   bus_dma_segment_t *segs,
+			   int nsegs,
+			   int *rsegs,
+			   int flags,
+			   paddr_t low,
+			   paddr_t high)
+{
+	paddr_t curaddr, lastaddr;
+	struct vm_page *m;
+	struct pglist mlist;
+	int curseg, error;
+
+	/* Always round the size. */
+	size = round_page(size);
+
+	/* Allocate pages from the VM system. */
+	error = uvm_pglistalloc(size, low, high, alignment, boundary,
+mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
+	if (__predict_false(error != 0))
+		return (error);
+	
+	/*
+	 * Compute the location, size, and number of segments actually
+	 * returned by the VM system.
+	 */
+	m = TAILQ_FIRST(mlist);
+	curseg = 0;
+	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
+	segs[curseg].ds_len = PAGE_SIZE;
+	m = TAILQ_NEXT(m, pageq.queue);
+
+	for (; m != NULL; m = TAILQ_NEXT(m, pageq.queue)) {
+		curaddr = VM_PAGE_TO_PHYS(m);
+		KASSERT(curaddr = low);
+		KASSERT(curaddr  high);
+		if (curaddr == (lastaddr + PAGE_SIZE))
+			segs[curseg].ds_len += PAGE_SIZE;
+		else {
+			curseg++;
+			segs[curseg].ds_addr = curaddr;
+			segs[curseg].ds_len = PAGE_SIZE;
+		}
+		lastaddr = curaddr;
+	}
+
+	*rsegs = curseg + 1;
+
+	return (0);
+}
+
+/*
+ * _bus_dmamem_free_common --
+ *	Free memory allocated with _bus_dmamem_alloc_range_common()
+ *	back to the VM system.
+ */
+void
+_bus_dmamem_free_common(bus_dma_tag_t t,
+			bus_dma_segment_t *segs,
+			int nsegs)
+{
+	struct vm_page *m;
+	bus_addr_t addr;
+	struct pglist mlist;
+	int curseg;
+
+	TAILQ_INIT(mlist);
+	for (curseg = 0; curseg  nsegs; curseg++) {
+		for (addr = segs[curseg].ds_addr;
+		 addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
+		 addr += PAGE_SIZE) {
+			m = PHYS_TO_VM_PAGE(addr);
+			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
+		}
+	}
+
+	uvm_pglistfree(mlist);
+}
+
+/*
+ * _bus_dmamem_map_common --
+ *	Map memory allocated with _bus_dmamem_alloc_range_common() into
+ *	the kernel virtual address 

CVS commit: src/sys/arch/cobalt

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 03:50:01 UTC 2009

Modified Files:
src/sys/arch/cobalt/cobalt: bus.c
src/sys/arch/cobalt/conf: files.cobalt

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/cobalt/cobalt/bus.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/cobalt/conf/files.cobalt

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/cobalt/cobalt/bus.c
diff -u src/sys/arch/cobalt/cobalt/bus.c:1.36 src/sys/arch/cobalt/cobalt/bus.c:1.37
--- src/sys/arch/cobalt/cobalt/bus.c:1.36	Thu Aug 20 11:50:11 2009
+++ src/sys/arch/cobalt/cobalt/bus.c	Fri Aug 21 03:50:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.36 2009/08/20 11:50:11 tsutsui Exp $	*/
+/*	$NetBSD: bus.c,v 1.37 2009/08/21 03:50:01 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.36 2009/08/20 11:50:11 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.37 2009/08/21 03:50:01 thorpej Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -44,6 +44,8 @@
 #define _COBALT_BUS_DMA_PRIVATE
 #include machine/bus.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include uvm/uvm_extern.h
 
 #include mips/cache.h
@@ -603,57 +605,11 @@
 int flags)
 {
 	extern paddr_t avail_start, avail_end;
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return error;
 
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
-
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -663,25 +619,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -692,11 +631,6 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -710,31 +644,8 @@
 		return 0;
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
-			if (size == 0)
-panic(_bus_dmamem_map: size botch);
-			pmap_enter(pmap_kernel(), va, addr,
-			VM_PROT_READ | VM_PROT_WRITE,
-			VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED);
-
-			/* XXX Do something about COHERENT here. */
-		}
-	}
-	pmap_update(pmap_kernel());
-
-	return 0;
+	/* XXX BUS_DMA_COHERENT */
+	return (_bus_dmamem_map_common(t, segs, nsegs, size, kvap, flags, 0));
 }
 
 /*
@@ -745,11 +656,6 @@
 _bus_dmamem_unmap(bus_dma_tag_t t, void *kva, size_t size)
 {
 
-#ifdef DIAGNOSTIC
-	if ((u_long)kva  PGOFSET)
-		panic(_bus_dmamem_unmap);
-#endif
-
 	/*
 	 * Nothing to do if we mapped it with KSEG0 or KSEG1 (i.e.
 	 * not in KSEG2).
@@ -758,10 +664,7 @@
 	kva  (void *)MIPS_KSEG2_START)
 		return;
 
-	size = 

CVS commit: src/sys/arch/ews4800mips

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 03:53:18 UTC 2009

Modified Files:
src/sys/arch/ews4800mips/conf: files.ews4800mips
src/sys/arch/ews4800mips/ews4800mips: bus_dma.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ews4800mips/conf/files.ews4800mips
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ews4800mips/ews4800mips/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/ews4800mips/conf/files.ews4800mips
diff -u src/sys/arch/ews4800mips/conf/files.ews4800mips:1.3 src/sys/arch/ews4800mips/conf/files.ews4800mips:1.4
--- src/sys/arch/ews4800mips/conf/files.ews4800mips:1.3	Wed Feb 20 21:43:34 2008
+++ src/sys/arch/ews4800mips/conf/files.ews4800mips	Fri Aug 21 03:53:18 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ews4800mips,v 1.3 2008/02/20 21:43:34 drochner Exp $
+#	$NetBSD: files.ews4800mips,v 1.4 2009/08/21 03:53:18 thorpej Exp $
 
 maxpartitions 16
 
@@ -21,6 +21,8 @@
 file arch/ews4800mips/ews4800mips/sector.c		disk
 file arch/ews4800mips/ews4800mips/vtoc.c		disk
 
+file common/bus_dma/bus_dmamem_common.c
+
 file arch/ews4800mips/ews4800mips/cons_machdep.c
 file dev/cons.c
 

Index: src/sys/arch/ews4800mips/ews4800mips/bus_dma.c
diff -u src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.9 src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.10
--- src/sys/arch/ews4800mips/ews4800mips/bus_dma.c:1.9	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/ews4800mips/ews4800mips/bus_dma.c	Fri Aug 21 03:53:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.9 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.10 2009/08/21 03:53:18 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.9 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.10 2009/08/21 03:53:18 thorpej Exp $);
 
 /* #define	BUS_DMA_DEBUG */
 #include sys/param.h
@@ -45,6 +45,8 @@
 #include machine/bus.h
 #include machine/sbdvar.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include uvm/uvm_extern.h
 
 extern	paddr_t kvtophys(vaddr_t);		/* XXX */
@@ -539,57 +541,11 @@
 int flags)
 {
 	extern paddr_t avail_start, avail_end;
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return error;
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
 
-	*rsegs = curseg + 1;
-
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -599,25 +555,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -628,11 +567,6 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -646,31 +580,8 @@
 		return 0;
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		  

CVS commit: src/sys/arch/mipsco

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:00:57 UTC 2009

Modified Files:
src/sys/arch/mipsco/conf: files.mipsco
src/sys/arch/mipsco/mipsco: bus_dma.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/conf/files.mipsco
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mipsco/mipsco/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/mipsco/conf/files.mipsco
diff -u src/sys/arch/mipsco/conf/files.mipsco:1.13 src/sys/arch/mipsco/conf/files.mipsco:1.14
--- src/sys/arch/mipsco/conf/files.mipsco:1.13	Fri Sep  1 13:28:17 2006
+++ src/sys/arch/mipsco/conf/files.mipsco	Fri Aug 21 04:00:56 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mipsco,v 1.13 2006/09/01 13:28:17 cube Exp $
+#	$NetBSD: files.mipsco,v 1.14 2009/08/21 04:00:56 thorpej Exp $
 
 #  MIPS Computer Corp -specific configuration info
 
@@ -61,6 +61,8 @@
 file arch/mipsco/mipsco/prom.c
 file dev/cons.c
 
+file common/bus_dma/bus_dmamem_common.c
+
 # Memory Disk
 file dev/md_root.c			memory_disk_hooks
 

Index: src/sys/arch/mipsco/mipsco/bus_dma.c
diff -u src/sys/arch/mipsco/mipsco/bus_dma.c:1.24 src/sys/arch/mipsco/mipsco/bus_dma.c:1.25
--- src/sys/arch/mipsco/mipsco/bus_dma.c:1.24	Sat Mar 14 21:04:12 2009
+++ src/sys/arch/mipsco/mipsco/bus_dma.c	Fri Aug 21 04:00:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.24 2009/03/14 21:04:12 dsl Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.25 2009/08/21 04:00:57 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.24 2009/03/14 21:04:12 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.25 2009/08/21 04:00:57 thorpej Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -44,6 +44,8 @@
 #define _MIPSCO_BUS_DMA_PRIVATE
 #include machine/bus.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include mips/cache.h
 
 paddr_t	kvtophys(vaddr_t);	/* XXX */
@@ -510,58 +512,10 @@
 	paddr_t low;
 	paddr_t high;
 {
-	paddr_t curaddr, lastaddr;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, low, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return (error);
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg]._ds_paddr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_addr = segs[curseg]._ds_paddr + t-dma_offset;
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
 
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%llx\n, (long long)curaddr);
-			panic(_bus_dmamem_alloc_range);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr + t-dma_offset;
-			segs[curseg].ds_len = PAGE_SIZE;
-			segs[curseg]._ds_paddr = curaddr;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
-
-	return (0);
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   low, high));
 }
 
 /*
@@ -571,25 +525,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg]._ds_paddr;
-		addr  (segs[curseg]._ds_paddr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -599,11 +536,6 @@
 int
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -617,32 +549,8 @@
 		return (0);
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		segs[curseg]._ds_vaddr = va;
-		for (addr = segs[curseg]._ds_paddr;
-		addr  (segs[curseg]._ds_paddr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += 

CVS commit: src/sys/arch/newsmips

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:03:01 UTC 2009

Modified Files:
src/sys/arch/newsmips/conf: files.newsmips
src/sys/arch/newsmips/newsmips: bus.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/conf/files.newsmips
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/newsmips/newsmips/bus.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/newsmips/conf/files.newsmips
diff -u src/sys/arch/newsmips/conf/files.newsmips:1.26 src/sys/arch/newsmips/conf/files.newsmips:1.27
--- src/sys/arch/newsmips/conf/files.newsmips:1.26	Wed Feb 20 21:43:34 2008
+++ src/sys/arch/newsmips/conf/files.newsmips	Fri Aug 21 04:03:01 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.newsmips,v 1.26 2008/02/20 21:43:34 drochner Exp $
+#	$NetBSD: files.newsmips,v 1.27 2009/08/21 04:03:01 thorpej Exp $
 
 # NEWSMIPS-specific configuration info
 
@@ -96,6 +96,8 @@
 file arch/newsmips/newsmips/cpu_cons.c
 file dev/cons.c
 
+file common/bus_dma/bus_dmamem_common.c
+
 file arch/mips/mips/softintr.c
 
 #

Index: src/sys/arch/newsmips/newsmips/bus.c
diff -u src/sys/arch/newsmips/newsmips/bus.c:1.28 src/sys/arch/newsmips/newsmips/bus.c:1.29
--- src/sys/arch/newsmips/newsmips/bus.c:1.28	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/newsmips/newsmips/bus.c	Fri Aug 21 04:03:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.28 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus.c,v 1.29 2009/08/21 04:03:01 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.28 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.29 2009/08/21 04:03:01 thorpej Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -45,6 +45,8 @@
 #include machine/bus.h
 #include machine/cpu.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include uvm/uvm_extern.h
 
 #include mips/cache.h
@@ -700,57 +702,11 @@
 int flags)
 {
 	extern paddr_t avail_start, avail_end;
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return error;
 
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
-
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -760,25 +716,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -789,11 +728,6 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, and the address is lower than
@@ -807,31 +741,8 @@
 		return 0;
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return ENOMEM;
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
-			if (size == 0)
-panic(_bus_dmamem_map: size botch);
-			

CVS commit: src/sys/arch/playstation2

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:03:28 UTC 2009

Modified Files:
src/sys/arch/playstation2/conf: files.playstation2
src/sys/arch/playstation2/playstation2: bus_dma.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/playstation2/conf/files.playstation2
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/playstation2/playstation2/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/playstation2/conf/files.playstation2
diff -u src/sys/arch/playstation2/conf/files.playstation2:1.17 src/sys/arch/playstation2/conf/files.playstation2:1.18
--- src/sys/arch/playstation2/conf/files.playstation2:1.17	Wed Feb 20 21:43:35 2008
+++ src/sys/arch/playstation2/conf/files.playstation2	Fri Aug 21 04:03:28 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.playstation2,v 1.17 2008/02/20 21:43:35 drochner Exp $
+#	$NetBSD: files.playstation2,v 1.18 2009/08/21 04:03:28 thorpej Exp $
 
 maxpartitions 8
 
@@ -25,6 +25,7 @@
 file arch/playstation2/playstation2/sifbios.c
 file arch/mips/mips/mips3_clock.c
 
+file common/bus_dma/bus_dmamem_common.c
 
 file dev/kloader.c	kloader
 file arch/playstation2/playstation2/kloader_machdep.c	kloader

Index: src/sys/arch/playstation2/playstation2/bus_dma.c
diff -u src/sys/arch/playstation2/playstation2/bus_dma.c:1.18 src/sys/arch/playstation2/playstation2/bus_dma.c:1.19
--- src/sys/arch/playstation2/playstation2/bus_dma.c:1.18	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/playstation2/playstation2/bus_dma.c	Fri Aug 21 04:03:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.18 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.19 2009/08/21 04:03:28 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.18 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.19 2009/08/21 04:03:28 thorpej Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -43,6 +43,8 @@
 #define _PLAYSTATION2_BUS_DMA_PRIVATE
 #include machine/bus.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include uvm/uvm_extern.h
 
 #include machine/locore.h
@@ -478,57 +480,11 @@
 int flags)
 {
 	extern paddr_t avail_start, avail_end;
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return error;
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
 
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -538,25 +494,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -567,11 +506,6 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -585,31 +519,8 @@
 		return 0;
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		

CVS commit: src/sys/arch/pmax

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:05:20 UTC 2009

Modified Files:
src/sys/arch/pmax/conf: files.pmax
src/sys/arch/pmax/pmax: bus_dma.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/pmax/conf/files.pmax
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/pmax/pmax/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/pmax/conf/files.pmax
diff -u src/sys/arch/pmax/conf/files.pmax:1.111 src/sys/arch/pmax/conf/files.pmax:1.112
--- src/sys/arch/pmax/conf/files.pmax:1.111	Wed Feb 20 21:43:35 2008
+++ src/sys/arch/pmax/conf/files.pmax	Fri Aug 21 04:05:20 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pmax,v 1.111 2008/02/20 21:43:35 drochner Exp $
+#	$NetBSD: files.pmax,v 1.112 2009/08/21 04:05:20 thorpej Exp $
 # DECstation-specific configuration info
 
 # maxpartitions must be first item in files.${ARCH}.
@@ -122,6 +122,8 @@
 file	arch/pmax/stand/common/callvec.c
 file	dev/cons.c
 
+file	common/bus_dma/bus_dmamem_common.c
+
 file arch/mips/mips/softintr.c
 
 #

Index: src/sys/arch/pmax/pmax/bus_dma.c
diff -u src/sys/arch/pmax/pmax/bus_dma.c:1.52 src/sys/arch/pmax/pmax/bus_dma.c:1.53
--- src/sys/arch/pmax/pmax/bus_dma.c:1.52	Mon Jul 20 17:05:13 2009
+++ src/sys/arch/pmax/pmax/bus_dma.c	Fri Aug 21 04:05:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.52 2009/07/20 17:05:13 tsutsui Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.53 2009/08/21 04:05:20 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.52 2009/07/20 17:05:13 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.53 2009/08/21 04:05:20 thorpej Exp $);
 
 #include opt_cputype.h
 
@@ -45,6 +45,8 @@
 #define _PMAX_BUS_DMA_PRIVATE
 #include machine/bus.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include mips/cache.h
 
 static int	_bus_dmamap_load_buffer(bus_dmamap_t,
@@ -655,57 +657,11 @@
 int flags)
 {
 	extern paddr_t avail_start, avail_end;		/* XXX */
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return (error);
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
 
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -715,25 +671,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -744,11 +683,6 @@
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -762,31 +696,7 @@
 		return 0;
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return ENOMEM;
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
-			if (size == 0)
-panic(_bus_dmamem_map: size botch);
-	

CVS commit: src/usr.sbin/veriexecgen

2009-08-20 Thread Elad Efrat
Module Name:src
Committed By:   elad
Date:   Fri Aug 21 04:09:41 UTC 2009

Modified Files:
src/usr.sbin/veriexecgen: veriexecgen.c

Log Message:
PR/41911: Jukka Ruohonen: A bug in veriexecgen

Do as suggested and add the missing 'T' to getopt() and update usage.

Thanks for the PR!


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/veriexecgen/veriexecgen.c

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

Modified files:

Index: src/usr.sbin/veriexecgen/veriexecgen.c
diff -u src/usr.sbin/veriexecgen/veriexecgen.c:1.16 src/usr.sbin/veriexecgen/veriexecgen.c:1.17
--- src/usr.sbin/veriexecgen/veriexecgen.c:1.16	Tue Apr 29 06:53:04 2008
+++ src/usr.sbin/veriexecgen/veriexecgen.c	Fri Aug 21 04:09:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: veriexecgen.c,v 1.16 2008/04/29 06:53:04 martin Exp $ */
+/* $NetBSD: veriexecgen.c,v 1.17 2009/08/21 04:09:41 elad Exp $ */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #ifndef lint
 #ifdef __RCSID
-__RCSID($NetBSD: veriexecgen.c,v 1.16 2008/04/29 06:53:04 martin Exp $);
+__RCSID($NetBSD: veriexecgen.c,v 1.17 2009/08/21 04:09:41 elad Exp $);
 #endif
 #endif /* not lint */
 
@@ -129,7 +129,7 @@
 usage(void)
 {
 	(void)fprintf(stderr,
-	usage:  %s [-AaDrSvW] [-d dir] [-o fingerprintdb] [-p prefix]\n
+	usage:  %s [-AaDrSTvW] [-d dir] [-o fingerprintdb] [-p prefix]\n
 	\t\t[-t algorithm]\n
 	\t%s [-h]\n, getprogname(), getprogname());
 }
@@ -389,7 +389,7 @@
 	/* error out if we have a dangling symlink or other fs problem */
 	v.exit_on_error = 1;
 
-	while ((ch = getopt(argc, argv, AaDd:ho:p:rSt:vW)) != -1) {
+	while ((ch = getopt(argc, argv, AaDd:ho:p:rSTt:vW)) != -1) {
 		switch (ch) {
 		case 'A':
 			v.append_output = 1;



CVS commit: src/sys/arch/sgimips

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:10:33 UTC 2009

Modified Files:
src/sys/arch/sgimips/conf: files.sgimips
src/sys/arch/sgimips/sgimips: bus.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/sgimips/conf/files.sgimips
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/sgimips/sgimips/bus.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/sgimips/conf/files.sgimips
diff -u src/sys/arch/sgimips/conf/files.sgimips:1.48 src/sys/arch/sgimips/conf/files.sgimips:1.49
--- src/sys/arch/sgimips/conf/files.sgimips:1.48	Thu Feb 12 06:33:56 2009
+++ src/sys/arch/sgimips/conf/files.sgimips	Fri Aug 21 04:10:33 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sgimips,v 1.48 2009/02/12 06:33:56 rumble Exp $
+#	$NetBSD: files.sgimips,v 1.49 2009/08/21 04:10:33 thorpej Exp $
 
 maxpartitions 16
 
@@ -25,6 +25,8 @@
 file arch/sgimips/sgimips/disksubr.c
 file arch/sgimips/sgimips/machdep.c
 
+file common/bus_dma/bus_dmamem_common.c
+
 file arch/mips/mips/mips3_clock.c	mips3
 file arch/mips/mips/mips3_clockintr.c	mips3
 

Index: src/sys/arch/sgimips/sgimips/bus.c
diff -u src/sys/arch/sgimips/sgimips/bus.c:1.56 src/sys/arch/sgimips/sgimips/bus.c:1.57
--- src/sys/arch/sgimips/sgimips/bus.c:1.56	Thu Feb 12 06:33:57 2009
+++ src/sys/arch/sgimips/sgimips/bus.c	Fri Aug 21 04:10:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.56 2009/02/12 06:33:57 rumble Exp $	*/
+/*	$NetBSD: bus.c,v 1.57 2009/08/21 04:10:33 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.56 2009/02/12 06:33:57 rumble Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.57 2009/08/21 04:10:33 thorpej Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -48,6 +48,8 @@
 #include machine/cpu.h
 #include machine/machtype.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #include uvm/uvm_extern.h
 
 #include mips/cpuregs.h
@@ -1082,57 +1084,11 @@
 		  int nsegs, int *rsegs, int flags)
 {
 	extern paddr_t avail_start, avail_end;
-	vaddr_t curaddr, lastaddr;
-	psize_t high;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
 
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, avail_start, high, alignment, boundary,
-	mlist, nsegs, (flags  BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return error;
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m-pageq.queue.tqe_next;
-
-	for (; m != NULL; m = m-pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr  avail_start || curaddr = high) {
-			printf(uvm_pglistalloc returned non-sensical
-			 address 0x%lx\n, curaddr);
-			panic(_bus_dmamem_alloc);
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr;
-			segs[curseg].ds_len = PAGE_SIZE;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
-
-	return 0;
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   avail_start /*low*/,
+	   avail_end - PAGE_SIZE /*high*/));
 }
 
 /*
@@ -1142,25 +1098,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
 
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
-
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -1229,11 +1168,6 @@
 _bus_dmamem_unmap(bus_dma_tag_t t, void *kva, size_t size)
 {
 
-#ifdef DIAGNOSTIC
-	if ((u_long)kva  PGOFSET)
-		panic(_bus_dmamem_unmap);
-#endif
-
 	/*
 	 * Nothing to do if we mapped it with KSEG0 or KSEG1 (i.e.
 	 * not in KSEG2).
@@ -1242,10 +1176,7 @@
 	kva  (void *)MIPS_KSEG2_START)
 		return;
 
-	size = round_page(size);
-	pmap_remove(pmap_kernel(), (vaddr_t)kva, (vaddr_t)kva + size);
-	pmap_update(pmap_kernel());
-	uvm_km_free(kernel_map, (vaddr_t)kva, size, UVM_KMF_VAONLY);
+	_bus_dmamem_unmap_common(t, kva, size);
 }
 
 /*
@@ -1256,32 +1187,17 @@
 _bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 		 off_t off, int prot, int flags)
 {
-	int i;
-
-	for (i = 0; i  nsegs; i++) {
-#ifdef DIAGNOSTIC
-		if (off  

CVS commit: src/sys/arch/x68k

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:12:27 UTC 2009

Modified Files:
src/sys/arch/x68k/conf: files.x68k
src/sys/arch/x68k/x68k: bus.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/x68k/conf/files.x68k
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x68k/x68k/bus.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/x68k/conf/files.x68k
diff -u src/sys/arch/x68k/conf/files.x68k:1.69 src/sys/arch/x68k/conf/files.x68k:1.70
--- src/sys/arch/x68k/conf/files.x68k:1.69	Sun Dec 21 09:20:40 2008
+++ src/sys/arch/x68k/conf/files.x68k	Fri Aug 21 04:12:27 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x68k,v 1.69 2008/12/21 09:20:40 isaki Exp $
+#	$NetBSD: files.x68k,v 1.70 2009/08/21 04:12:27 thorpej Exp $
 #
 # new style config file for x68k architecture
 #
@@ -43,6 +43,8 @@
 file	arch/m68k/m68k/sys_machdep.c
 file	arch/m68k/m68k/vm_machdep.c
 
+file	common/bus_dma/bus_dmamem_common.c
+
 file	dev/cons.c
 file	dev/cninit.c
 

Index: src/sys/arch/x68k/x68k/bus.c
diff -u src/sys/arch/x68k/x68k/bus.c:1.33 src/sys/arch/x68k/x68k/bus.c:1.34
--- src/sys/arch/x68k/x68k/bus.c:1.33	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/x68k/x68k/bus.c	Fri Aug 21 04:12:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.33 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus.c,v 1.34 2009/08/21 04:12:27 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.33 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus.c,v 1.34 2009/08/21 04:12:27 thorpej Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -51,6 +51,8 @@
 #include m68k/cacheops.h
 #include machine/bus.h
 
+#include common/bus_dma/bus_dmamem_common.h
+
 #if defined(M68040) || defined(M68060)
 static inline void dmasync_flush(bus_addr_t, bus_size_t);
 static inline void dmasync_inval(bus_addr_t, bus_size_t);
@@ -416,25 +418,8 @@
 void
 x68k_bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(mlist);
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -445,35 +430,9 @@
 x68k_bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags  BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
-
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
 
-	for (curseg = 0; curseg  nsegs; curseg++) {
-		for (addr = segs[curseg].ds_addr;
-		addr  (segs[curseg].ds_addr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
-			if (size == 0)
-panic(x68k_bus_dmamem_map: size botch);
-			pmap_enter(pmap_kernel(), va, addr,
-			VM_PROT_READ | VM_PROT_WRITE,
-			VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED);
-		}
-	}
-	pmap_update(pmap_kernel());
-
-	return (0);
+	/* XXX BUS_DMA_COHERENT */
+	return (_bus_dmamem_map_common(t, segs, nsegs, size, kvap, flags, 0));
 }
 
 /*
@@ -483,16 +442,8 @@
 void
 x68k_bus_dmamem_unmap(bus_dma_tag_t t, void *kva, size_t size)
 {
-#ifdef DIAGNOSTIC
-	if (m68k_page_offset(kva))
-		panic(x68k_bus_dmamem_unmap);
-#endif
-
-	size = round_page(size);
 
-	pmap_remove(pmap_kernel(), (vaddr_t)kva, (vaddr_t)kva + size);
-	pmap_update(pmap_kernel());
-	uvm_km_free(kernel_map, (vaddr_t)kva, size, UVM_KMF_VAONLY);
+	_bus_dmamem_unmap_common(t, kva, size);
 }
 
 /*
@@ -503,28 +454,13 @@
 x68k_bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
 off_t off, int prot, int flags)
 {
-	int i;
+	bus_addr_t rv;
 
-	for (i = 0; i  nsegs; i++) {
-#ifdef DIAGNOSTIC
-		if (m68k_page_offset(off))
-			panic(x68k_bus_dmamem_mmap: offset unaligned);
-		if (m68k_page_offset(segs[i].ds_addr))
-			panic(x68k_bus_dmamem_mmap: segment unaligned);
-		if (m68k_page_offset(segs[i].ds_len))
-			panic(x68k_bus_dmamem_mmap: segment size not multiple
-			 of page size);
-#endif
-		if (off = segs[i].ds_len) {
-			off -= segs[i].ds_len;
-			continue;
-		}
-
-		return (m68k_btop((char *)segs[i].ds_addr + off));
-	}
-
-	/* Page not found. */
-	return (-1);
+	rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags);
+	if (rv == (bus_addr_t)-1)
+		return (-1);
+	
+	return (m68k_btop((char *)rv));
 }
 
 
@@ -635,52 +571,8 @@